query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Get offset for starting at point i
function point_offset(i) { return 4*i; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function xyOffsetIndex(i, x, y, w, h) {\n var index = i + x + y * w;\n var absx = (i % w) + x;\n if (absx < 0 && index < 0 || absx >= w && index >= w * h) {\n return i - x - y * w;\n }\n if (absx < 0 || absx >= w) { // if off the left.\n return i - x + y * w;\n }\n //var absy = index - (w * y)\n if (...
[ "0.71080905", "0.66481745", "0.6582959", "0.65806395", "0.6579403", "0.6416223", "0.6397922", "0.6320511", "0.6294632", "0.6288614", "0.6284078", "0.6176096", "0.6164112", "0.60976374", "0.60885394", "0.6046089", "0.60413516", "0.59861773", "0.5944714", "0.593127", "0.5903677...
0.7845121
0
can only search by pieces of recipe name not tag or ingredient yet
function searchRecipes() { showAllRecipes(); let searchedRecipes = domUpdates.recipeData.filter(recipe => { return recipe.name.toLowerCase().includes(searchInput.value.toLowerCase()); }); filterNonSearched(createRecipeObject(searchedRecipes)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ingredientFilter(recipe) {\n const searchTerm = this.state.search;\n if (recipe.ingredients.length !== 0) {\n for (let i = 0; i < recipe.ingredients.length; i++) {\n if (recipe.ingredients[i].ingredient.toLowerCase().includes(searchTerm.toLowerCase())) {\n ...
[ "0.7252004", "0.70465595", "0.68432355", "0.6830532", "0.66288525", "0.65536004", "0.6512453", "0.64728564", "0.64419496", "0.63705194", "0.63671297", "0.63345647", "0.6268975", "0.62577915", "0.6214152", "0.6207526", "0.6146746", "0.6137458", "0.61369", "0.60902214", "0.6088...
0.73634744
0
Como profesor y alumno: Obtener registro horas (solo categorias)
function obtenerRegistroHorasSoloCategorias() { var params = { tipo: 1, idActividadUHorario: $scope.actividad.idActividad } serviceCRUD.TypePost('registro_horas/obtener_registro_horas', params).then(function (res) { if (res.data.succeed == false) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function obtenerHorasDia() {\n $.ajax({\n url: 'controlador/actividad/horasDias.php',\n dataType: 'json',\n type: 'GET',\n success: function(data){ \n $.each(data,function(key, registro) {\n $(\"#resumenHorasDia\").html('Hoy: '+ reg...
[ "0.57781124", "0.5671068", "0.55887645", "0.5525759", "0.5513564", "0.5496842", "0.549508", "0.54854286", "0.5467593", "0.5387576", "0.53186435", "0.5317505", "0.5292057", "0.527212", "0.5264984", "0.5262028", "0.52477163", "0.5245794", "0.5218228", "0.5215809", "0.51880157",...
0.67796105
0
Returns the integer whose value is the reverse of the lowest 'bits' bits of the integer 'x'.
function reverseBits(x, bits) { var y = 0; for (var i = 0; i < bits; i++) { y = (y << 1) | (x & 1); x >>>= 1; } return y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reverseBits(x, bits) {\n var y = 0;\n for (var i = 0; i < bits; i++) {\n y = (y << 1) | (x & 1);\n x >>>= 1;\n }\n return y;\n }", "function reverseBits(x, bits) {\n\t var y = 0;\n\t for (var i = 0; i < bits; ...
[ "0.79123724", "0.79059154", "0.69503933", "0.66386217", "0.66386217", "0.6609222", "0.6608287", "0.6595684", "0.65949583", "0.65949583", "0.65710026", "0.6563645", "0.6556227", "0.6537848", "0.65276194", "0.65276194", "0.6521527", "0.6521527", "0.6521527", "0.6521527", "0.652...
0.7915349
1
================================================== FUNCTIONS ================================================== Start game [X] Move all characters back to Select Char Div [X] Reset character formatting [X] Reset all character stats [X] Starting instructions [X] Disable Attack button [X] Hide Fight description [X] Disab...
function startGame() { // Move all characters back to Select Char Div for (var i = 1; i < 5; i++) { char = $("#char" + [i]); $("#select-char-div").append(char); } // Reset character formatting $(".select-char") .addClass("btn-light") .removeClass("btn-success btn-primary btn-danger") .removeAttr("disabl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startGame () {\n // resets the game to original state;\n characters = resetCharacters()\n gameState = resetGameState()\n\n // renders characters\n renderCharacters()\n}", "startGame() {\n document.getElementById('homemenu-interface').style.display = 'none';\n document.getElementById('...
[ "0.72590494", "0.7137934", "0.69712394", "0.68926716", "0.6830214", "0.6796557", "0.6775559", "0.6764172", "0.67301494", "0.67225975", "0.66506976", "0.6637074", "0.6624445", "0.6622911", "0.65883297", "0.65740377", "0.65636814", "0.65475655", "0.6546622", "0.6530521", "0.652...
0.81063074
0
Ingame Functions: Update stats [X] Update Hero HP [X] Update Hero AP [X] Update Defender HP
function updateHeroHP() { heroStats.hp = (heroStats.hp - defenderStats.cap); $(`#${heroID}-hp`).html(heroStats.hp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateStats()\n{\n updateGoalAttempts();\n updateShotsOnGoal();\n updateShotsOffGoal();\n updateBlockedShots();\n updateCorners();\n updateOffsides();\n updateGKSaves();\n updateFoulsCommited();\n updateFoulsReceived();\n\n updateCompletePasses();\n updateIncompletePasses(...
[ "0.72429234", "0.7191889", "0.7177363", "0.7103198", "0.69540983", "0.68900734", "0.6889164", "0.6888862", "0.68313295", "0.67823595", "0.67788136", "0.67568207", "0.6748019", "0.67359936", "0.67307687", "0.67196995", "0.6703701", "0.6687616", "0.66762", "0.6650789", "0.66503...
0.7845786
0
End Game [X] Hide Attack button [X] Display Restart button [X] Disable Character buttons
function endGame() { $(".attack").hide(); $("#restart").show(); $(".select-char").attr("disabled", true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function endGame() {\n $('.home').css({ 'margin-top': '0px' });\n disappear('.instructions');\n hide('.view-button');\n disappear('.follow-circle');\n disappear('.instructions');\n state = \"view\";\n }", "function end_turn(){\n\tif(dbg){\n\t\tdebug(\"ending turn\");\...
[ "0.7204891", "0.716683", "0.687477", "0.67717034", "0.6661637", "0.6610735", "0.6602704", "0.6589147", "0.65886396", "0.65773183", "0.6573447", "0.6562098", "0.65372306", "0.6481077", "0.6480078", "0.6451495", "0.64462996", "0.64246583", "0.64192665", "0.63977104", "0.6384193...
0.8102784
0
Remove option data created today
async function removeOptionsForToday( symbol ) { const query = { created_at: { $gte: new Date( today() ) }, 'data.underlying': symbol.toUpperCase() }; const { result } = await collection.remove( query ); console.log( `✅ Removed ${result.n} duplicate option data created today.` ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function removeOldOptions( symbol ) {\n const query = {\n 'data.expiration_date': {\n $lt: new Date( today() )\n },\n 'data.underlying': symbol.toUpperCase()\n };\n\n const { result } = await collection.remove( query );\n console.log( `✅ Removed ${result.n} expired options.` );\n}", "fun...
[ "0.6469132", "0.64079565", "0.6229777", "0.6220863", "0.61056554", "0.5927294", "0.587598", "0.58640337", "0.58505905", "0.584272", "0.58213365", "0.5814374", "0.57892525", "0.5724698", "0.5724227", "0.5716026", "0.5684587", "0.5678539", "0.56498575", "0.56316304", "0.5613209...
0.71898055
0
Remove options that have expired
async function removeOldOptions( symbol ) { const query = { 'data.expiration_date': { $lt: new Date( today() ) }, 'data.underlying': symbol.toUpperCase() }; const { result } = await collection.remove( query ); console.log( `✅ Removed ${result.n} expired options.` ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeOptionsTime() {\n //remove all OLD hours options\n var list = document.getElementById(\"StartHours\");\n var OptLength = list.childNodes.length;\n for (var a = 0; a < OptLength; a++) {\n list.removeChild(list.childNodes[0]);\n }\n}", "async function removeOptionsForToday( sym...
[ "0.6510984", "0.6308981", "0.6281474", "0.6258858", "0.62090516", "0.61488795", "0.6138212", "0.6064511", "0.60642624", "0.60087407", "0.59033906", "0.58779675", "0.58444685", "0.57719177", "0.5767166", "0.5759839", "0.5756269", "0.56374794", "0.5635796", "0.561701", "0.56066...
0.75787526
0
A TimelineSlice represents an interval of time on a given thread associated with a specific trace event. For example, TRACE_EVENT_BEGIN1("x","myArg", 7) at time=0.1ms TRACE_EVENT_END() at time=0.3ms Results in a single timeline slice from 0.1 with duration 0.2. All time units are stored in milliseconds.
function TimelineSlice(title, colorId, start, args) { this.title = title; this.start = start; this.colorId = colorId; this.args = args; this.subSlices = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "SliceList(sliceCsts) {\n const sourceMap = this.args.sourceMap;\n const idContext = this.args.idContext;\n const slices = sliceCsts.toAST(sourceMap, idContext);\n if (slices.length > 1) {\n return new ExtSlice(this.sourceLoc(sourceMap), this.id(idContext), slices);\n } else {\n return slic...
[ "0.53248817", "0.52395767", "0.51110965", "0.5103927", "0.5096916", "0.4977215", "0.492534", "0.4883767", "0.4874222", "0.4872183", "0.48698822", "0.48441377", "0.48076788", "0.4792898", "0.46872103", "0.46628708", "0.45980352", "0.45950478", "0.45950478", "0.4553307", "0.455...
0.7147857
0
A TimelineThread stores all the trace events collected for a particular thread. We organize the slices on a thread by "subrows," where subrow 0 has all the root slices, subrow 1 those nested 1 deep, and so on.
function TimelineThread(parent, tid) { this.parent = parent; this.tid = tid; this.subRows = [[]]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getThreadInfo(thread) {\n let info = [];\n let tooltips = [];\n\n const endPendingStateTimestampMicros = thread?.['2']?.['39'];\n const [pendingStateInfo, pendingTooltip] =\n this.getPendingStateInfo(endPendingStateTimestampMicros);\n if (pendingStateInfo) info.push(pendingStateInfo);\n if...
[ "0.592558", "0.56824195", "0.550676", "0.5464706", "0.5459258", "0.5416639", "0.53526866", "0.5334867", "0.5284146", "0.5187332", "0.5137146", "0.49711394", "0.49577636", "0.49145645", "0.49120075", "0.4909757", "0.48926133", "0.4889958", "0.48220187", "0.48201647", "0.476178...
0.7440948
0
The TimelineProcess represents a single process in the trace. Right now, we keep this around purely for bookkeeping reasons.
function TimelineProcess(pid) { this.pid = pid; this.threads = {}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get currentProcessStage() {\n return this.__currentProcessStage;\n }", "function BpmnStatsController ($scope, BpmnStatsProcessDefinitionResource,BpmnStatsTaskProcessDefinitionResource) {\n // input: processInstance\n\n $scope.processStats = null;\n $scope.taskStats = null;\n \n BpmnStats...
[ "0.5630941", "0.5524205", "0.5407339", "0.53542864", "0.53498006", "0.5309115", "0.52529144", "0.5209009", "0.5207986", "0.51946145", "0.5116018", "0.5111279", "0.51071966", "0.50840205", "0.5075695", "0.5061418", "0.5055981", "0.5049268", "0.50190604", "0.49848813", "0.48723...
0.8097432
0
Computes ell = SHA256(pubKeys[0], ..., pubKeys[pubKeys.length1]) with pubKeys serialized in compressed form.
function computeEll(pubKeys) { check.checkPubKeyArr(pubKeys); return convert.hash(concat(pubKeys)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SHA256() {\r\n if (!this.k[0])\r\n this.precompute();\r\n this.initialize();\r\n}", "function serializePublicKey(pub){\n return sjcl.codec.base64.fromBits(pub.get().x.concat(pub.get().y));\n}", "function hashV2(key,arrayLen){\n var total = 0;\n var WEIRD_PRIME = 31;\n for(var i = 0; i...
[ "0.65649396", "0.6305199", "0.62842053", "0.62457985", "0.62457985", "0.62438154", "0.62438154", "0.62438154", "0.6239097", "0.6130765", "0.6117556", "0.61146885", "0.61106145", "0.6078439", "0.60695535", "0.6055211", "0.6037053", "0.6029666", "0.5998561", "0.59797895", "0.59...
0.7205707
1
query and zoom by chapter
function zoomChapter(){ var MapQuery = "SELECT * FROM chapterboundaries WHERE chptrnames = '"+ $( "#zoom option:selected" ).text()+"'"; sql.getBounds(MapQuery).done(function(bounds) { bounds[1][1] = bounds[1][1] + 0.75; map.fitBounds(bounds); }); sql.execute(MapQuery) .done(function(data){ // read table t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zoomToQuery(query) {\n map.setCenter(locs[query][\"coordinates\"])\n map.setZoom(locs[query][\"zoom\"])\n if (children[\"ciana\"] != undefined) {\n for (var i = 0; i < children[query].length; i++) {\n child = children[query][i]\n var marker = new google.maps.Marker({\n position: loc...
[ "0.5724077", "0.56094533", "0.5261696", "0.5199728", "0.51305234", "0.51132", "0.5068618", "0.5026904", "0.49847615", "0.49726024", "0.4959995", "0.49271643", "0.4926838", "0.48946717", "0.48493063", "0.48105988", "0.4801164", "0.47788906", "0.47697893", "0.47555503", "0.4751...
0.7063365
0
Changes the value line by setting the map of the old value to null and the new one to the current map. Probably not the most efficient way to do this But it works
function changeLine(val){ var newVal = parseInt(val); switch(oldVal){ case 1: polylinesTemp.forEach(function(line){ line.setMap(null); }) break; case 2: polylinesHum.forEach(function(line){ line.setMap(null); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removePassedLine() {\n Object.keys(passed_polyline).map(function(k) {\n passed_polyline[k].setMap(null);\n });\n passed_polyline = {};\n has_assigned = false;\n }", "function copyOldValue(map,key,newTime){\n\tvar ancienneVariable = map.get(key);\n\tvar valeurCourante = ancienneVariable...
[ "0.6173306", "0.5810586", "0.56659913", "0.5633059", "0.55716115", "0.5570325", "0.55653256", "0.5559789", "0.54485893", "0.5399408", "0.53726435", "0.53290224", "0.53252864", "0.5290506", "0.52670366", "0.5263554", "0.52399224", "0.5232861", "0.5232616", "0.5220914", "0.5220...
0.7143827
0
when a like is clicked on: change the color in blue and remove the "onclick" html attribute.
function clicked(id){ postLike(id); $("#"+id).css("color", "blue"); $("#"+id).prop("onclick", null).off("click"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function colorLike() {\n setLike(!like);\n }", "clickedLike (e) {\n var numOfLikesEl = e.currentTarget.parentNode.children[1]\n var numOfLikesValue = parseInt(numOfLikesEl.textContent)+1\n numOfLikesEl.textContent = numOfLikesValue\n e.currentTarget.style.color = \"blue\"\n }", "function...
[ "0.66644883", "0.63411665", "0.6272349", "0.6197885", "0.6176079", "0.6158974", "0.59117335", "0.5853589", "0.5825452", "0.58026034", "0.5795063", "0.5751204", "0.57365793", "0.570031", "0.5649227", "0.5646722", "0.56130576", "0.5586583", "0.5574663", "0.5524897", "0.5474703"...
0.75387436
0
Return the next character and move forward.
function nextChar() { return source[index++]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextChar() {\n return text.charAt(offset);\n }", "next() {\n return this.input.charAt(this.pos++);\n }", "function next_char() {\n c = ++pos < str.length ? str[pos] : undefined;\n }", "next() {\n const char = this.content[this.index++];\n if (char === unde...
[ "0.82221246", "0.81937486", "0.81186616", "0.7908192", "0.78399336", "0.7731608", "0.77143985", "0.75143766", "0.7504847", "0.7497063", "0.73993117", "0.7398385", "0.73325753", "0.726066", "0.726066", "0.726066", "0.71745205", "0.71745205", "0.71381974", "0.7111688", "0.70919...
0.8233421
0
Return true if provided expression is LeftHandSideExpression
function isLeftHandSide(expr) { switch (expr.type) { case 'AssignmentExpression': case 'BinaryExpression': case 'ConditionalExpression': case 'LogicalExpression': case 'SequenceExpression': case 'UnaryExpression': case 'UpdateExpression': retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isLeftHandSide(node) {\n const parent = node.parent;\n // a++\n if (parent.type === utils_1.AST_NODE_TYPES.UpdateExpression) {\n return true;\n }\n // a + b\n if ((parent.type === utils_1.AST_NODE_TYPES.BinaryExpression ||\n parent.type === utils_1.AST_NODE_TYPES.LogicalExp...
[ "0.74610513", "0.7084724", "0.69904274", "0.69904274", "0.69904274", "0.69904274", "0.69904274", "0.69904274", "0.69904274", "0.69904274", "0.69904274", "0.69904274", "0.69904274", "0.69904274", "0.69904274", "0.69904274", "0.69904274", "0.69904274", "0.69904274", "0.69904274",...
0.82145387
0
Spirit + Magic Armor
get magicResist() { return this.Spirit + this.magicArmorRating; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get magicResist() {\n return this.Spirit;\n }", "function it(type, value, quote) {\n var id, the_token;\n if (type === '(string)' || type === '(range)') {\n if (jx.test(value)) {\n warn_at(bundle.url, line, from);\n }\n }...
[ "0.5627212", "0.50592303", "0.5045465", "0.5014506", "0.48401392", "0.4827302", "0.4822546", "0.481948", "0.48189813", "0.48113084", "0.4772949", "0.47610095", "0.4755417", "0.47477424", "0.47458005", "0.4729305", "0.469743", "0.46927312", "0.46906957", "0.46906957", "0.46883...
0.5097727
1
Interact with Environment pick up an Item
pickUp() { if(this.addToInventory(this.Target)) { this.emit("Player.Environment.Interacted", "You picked up a "+this.Target.name+"."); this.generateEnvironment(); this.save(); } else { this.emit("Player.Environment.Interacted", "You do not have room in you...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pickUpItem(item) {\n inventory.push(items[currentLocation].name);\n updateDisplay(\"Taken \" + items[currentLocation].name + \".\");\n items[currentLocation].isTaken = true;\n }", "function selectItem(){\n\n inquirer.prompt([\n {\n type: \"list\",\n message: \"W...
[ "0.64455235", "0.63677925", "0.61358595", "0.6055775", "0.60284513", "0.6022055", "0.5991698", "0.5977255", "0.58880144", "0.5822352", "0.58075994", "0.58007437", "0.5789619", "0.5755299", "0.5735624", "0.56531245", "0.5636927", "0.5636927", "0.56334776", "0.5623755", "0.5607...
0.660124
0
consume a Consumable Item
consume(Consumable) { Consumable.effect(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "consume() {}", "function processConsume(data) {\n setConsume(data);\n}", "consume() {\n return this._onConsume();\n }", "process(raw_item) {\n return raw_item;\n }", "processItems() {}", "releaseItem(item) {}", "function purchaseItem() {}", "function purchaseItem() {}", "function p...
[ "0.6204114", "0.61202115", "0.58555263", "0.563772", "0.5487205", "0.5470537", "0.5415115", "0.5415115", "0.5415115", "0.5415115", "0.5415115", "0.5415115", "0.52521557", "0.5186788", "0.51742893", "0.51742893", "0.51677835", "0.5157363", "0.51364785", "0.51157284", "0.511034...
0.66463906
0
The function above will get called when getRandomActivity fails
function getRandomActivity(eventDetails) { axios.request({ method: "GET", url: "http://www.boredapi.com/api/activity/", }).then(randomActivitySuccess).catch(randomActivityFailure); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomActivity() {\n axios.request({\n method: \"GET\",\n url: \"https://www.boredapi.com/api/activity/\"\n }).then(randomSuccess).catch(randomFail);\n}", "function setRandomActivity() {\n // get all activities. extracted into a local variable to possibly later add some statistics...
[ "0.66709054", "0.66239965", "0.62643933", "0.6153696", "0.5805628", "0.56915253", "0.5638478", "0.53849643", "0.53847706", "0.5295225", "0.52837837", "0.5255362", "0.5254278", "0.52532893", "0.52361", "0.52203393", "0.5197327", "0.51928025", "0.51753354", "0.51735157", "0.516...
0.67224646
0
Type of the `options` parameter for the `CSSStyleSheet` constructor. The actual property definitions are in wicg_constructable_stylesheets.js, which must be explicitly passed to the compiler in order to use them. This record is defined here since CSSStyleSheet cannot be redefined with its optional init parameter.
function CSSStyleSheetInit() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async addStyleTag(options) {\n const { url = null, path = null, content = null } = options;\n if (url !== null) {\n try {\n const context = await this.executionContext();\n return (await context.evaluateHandle(addStyleUrl, url)).asElement();\n }\n ...
[ "0.57079375", "0.5662071", "0.5651021", "0.5651021", "0.5639957", "0.5639957", "0.5639957", "0.5639957", "0.5639957", "0.5639957", "0.5639957", "0.5639957", "0.5639957", "0.5639957", "0.5639957", "0.5639957", "0.5639957", "0.5639957", "0.5639957", "0.5639957", "0.5639957", ...
0.57528865
0
will generate 1 river
generateRiver (map) { const b = map.getRandomPointOfType('beach'); const m = map.getRandomPointOfType('mountain'); let p = b; let wander = null; let d = b.dist(m); // want to reduce the distance between b and m const altered = []; let count = 0; while (p.getBiome() !== 'mountain') { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateRivers() {\n let endNode = pickRiverEndPoint();\n let startNode = pickRiverStartPoint();\n\n let path = new aStar(resultingMap, startNode, endNode, 10); //, 0.4);\n\n for (let i = 0; i < path.length; i++) {\n let x = path[i].x;\n let y = path[i].y;...
[ "0.74722725", "0.70124847", "0.68923974", "0.600382", "0.57770616", "0.5709481", "0.56886953", "0.5650134", "0.560318", "0.5600564", "0.55902356", "0.5566952", "0.55581844", "0.5511295", "0.55111814", "0.55031776", "0.5495158", "0.5477471", "0.5472372", "0.54660535", "0.54113...
0.7253626
1
returns true if shapes have changed
shouldComponentUpdate(nextProps,nextState){ let oldNumberOfShapes = this.props.shapes.length, nextNumberOfShapes = nextProps.shapes.length; // console.log('checking whether to update canvas: ',this.props.id); // if both canvases are blank if (!oldNumberOfShapes && !nextNumberOfShapes){ // console.log(' b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isEdited() {\n return this._canvas.getObjects().length > 0;\n }", "function isChanged() {\n var x = currentCircle.attr(\"cx\");\n var xBackup = currentCircle.attr(\"cx-backup\");\n return Math.round(parseFloat(x) / minSpace) != Math.round(parseFloat(xBackup) / minSpace);\n}", "get geometryCh...
[ "0.637515", "0.6332178", "0.6309739", "0.6198564", "0.61645806", "0.61193377", "0.60308695", "0.5989494", "0.59809864", "0.5979974", "0.5979974", "0.5979974", "0.5935911", "0.5905871", "0.5890702", "0.5882215", "0.5871792", "0.58589005", "0.5810837", "0.5797281", "0.5791194",...
0.68753827
0
Replaces the first separator in the given string with the second separator
function replaceSeparator( string, firstSep, secondSep ) { for ( var i = 0; i < string.length; ++i ) { if ( string.charAt( i ) == firstSep ) { string = string.replace( firstSep, secondSep ); } } console.log(string); return string; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeSeparator(string, separator1, separator2) {\r\n var words = string.split(separator1);\r\n return words.join(separator2);\r\n}", "function stringSplitter(str, seperator) {\n if(str.length === 0){\n return '';\n }\n if(str[0] !== seperator){\n return str[0] + stringSplitter(str.slice(1), ...
[ "0.79280317", "0.6255087", "0.6246329", "0.61609346", "0.60246414", "0.58883476", "0.58580744", "0.57796234", "0.5766014", "0.5762998", "0.57026976", "0.56540376", "0.5641292", "0.5629478", "0.56083614", "0.5606484", "0.55948627", "0.55763036", "0.55730784", "0.55441755", "0....
0.81277794
0
Returns true if string begins with 'http:' or 'https:'
function isURL( string ) { var substr1; var substr2; substr1 = string.substr( 0, 5 ); substr2 = string.substr( 0, 6 ); if ( substr1 == "http:" || substr2 == "https:" ) return true; else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_url(str) {\n\t\treturn starts_with(str, 'http://') || starts_with(str, 'https://') || starts_with(str, '//');\n\t}", "function isURL(s) {\n return /^(http|https):/.test(s)\n}", "function isURL(str){\n\t\tif(typeof str === 'string'){\n\t\t\tif(str.indexOf('http') >= 0) return true;\n\t\t}\n\t\tretu...
[ "0.7782369", "0.7384118", "0.72073555", "0.7202176", "0.7193883", "0.69328976", "0.69113714", "0.6846007", "0.6808626", "0.6808367", "0.67970514", "0.67845285", "0.67504144", "0.66621256", "0.66258794", "0.65987", "0.6580114", "0.65603703", "0.65603703", "0.6546252", "0.65342...
0.75596374
1
Get variants call get the varaiants stored in etc/design folder
function getVariants(productId){ var url = "/etc/designs/aem-utils/products/items/"+productId+"/variants.infinity.json"; $.getJSON(url).done(function(data){ var currentVariant = $("input[name='./variants']").val(); console.log(currentVariant); var...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get assetBundleVariant() {}", "async function fetchVariant() {\n const sites = await fetch(URL)\n const parsedSites = await sites.json()\n return parsedSites.variants[Math.round(Math.random())]\n}", "async function fetchPageVariants() {\n const variants = await fetch(\"https://cfw-takehome.developers...
[ "0.6293214", "0.5796789", "0.5727843", "0.56753814", "0.56680214", "0.5656013", "0.56532055", "0.5548594", "0.5442433", "0.54019344", "0.53694963", "0.5339515", "0.52892554", "0.52164644", "0.5210565", "0.5196859", "0.51959246", "0.51539034", "0.5134901", "0.5092836", "0.5092...
0.61084455
1
API method to allow for removing all tooltips
removeAllTooltips() { if (!this.activeToolTips?.length) { return; } for (let i = this.activeToolTips.length - 1; i > -1; i--) { this.activeToolTips[i].destroy(); this.activeToolTips.splice(i, 1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeTooltips() {\r\n\t$('.tooltip').remove();\r\n}", "function removeTooltip() {\t\t\t\r\n\t\t\t$('.popover').each(function() { $(this).remove(); });\r\n\t\t\treturn;\r\n\r\n\t\t}//end function removeTooltip ", "remove() { this.tooltip.remove(); this.element.remove(); }", "function hideTooltips() ...
[ "0.8338505", "0.8124259", "0.81156963", "0.8103268", "0.7822129", "0.77557856", "0.77258945", "0.76344144", "0.75435394", "0.74764544", "0.7455595", "0.73848486", "0.7376626", "0.7336867", "0.7305954", "0.7300402", "0.72824514", "0.72824514", "0.72671133", "0.72613883", "0.72...
0.82634616
1
this function will pull the JSON data abd call the myHome function
function myHouse() { var ourRequest = new XMLHttpRequest(); ourRequest.open('GET', 'http://localhost:8080/realestate/all'); ourRequest.send(); ourRequest.onload = function () { const ourData = JSON.parse(ourRequest.responseText); myHome(ourData); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getData(){\r\n\r\n \r\n //url of the site where the info comes from\r\n const Launches_URL = \"https://api.spacexdata.com/v2/launches/all\";\r\n \r\n let url = Launches_URL;\r\n\r\n \r\n \r\n \r\n //calling the method that will look through th...
[ "0.7085089", "0.67937934", "0.67543423", "0.67467654", "0.66182274", "0.6587462", "0.65781075", "0.655238", "0.6514605", "0.64243615", "0.64129066", "0.64105016", "0.64050597", "0.6354852", "0.63354695", "0.6320696", "0.63148385", "0.6294958", "0.62939894", "0.6268982", "0.62...
0.701032
1
Takes the generated YAML and puts it into a file that gets downloaded. Modified from the example here:
function download() { let filename = $('#title').val() === '' ? 'zones.yaml' : $('#title').val(); let text = '# Generated with Zone.yaml Generator for Home Assistant, version ' + TOOL_VERSION + ` ` + $('#generatedYaml').text(); var element = document.createElement('a'); element.setAttribute('href', 'da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processYAML(yamlFile) {\n try {\n console.log('convert Yaml file', yamlFile);\n // Get document, or throw exception on error\n var yamlObject = yaml.safeLoad(fs.readFileSync(yamlFile, 'utf8'));\n //console.log('yaml json string', JSON.stringify(yamlObject));\n console.log('processYAML', ya...
[ "0.6159273", "0.59325963", "0.57152563", "0.5614873", "0.55311775", "0.55256546", "0.5505538", "0.54357374", "0.5410762", "0.5323188", "0.53051996", "0.5297309", "0.5290261", "0.52624106", "0.52599746", "0.52554375", "0.52489054", "0.5235959", "0.5215657", "0.52087003", "0.51...
0.7462202
0
Make sure the title is not empty, and let's not duplicate '.yaml' at the end :) Also replaces spaces with underscores.
function validateTitle() { let title = $('#title').val(); title = title.replace(/ /g, "_").toLowerCase(); title = title.replace(/.yaml$/, ""); $('#title').val(title + ".yaml"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalizeTitle(title)\n {\n return title.replace(/^_+/, \"\").replace(/_+$/, \"\").replace(/[\\s_]+/g, \"_\")\n }", "function normalizeTitle(title)\n {\n return title.replace(/^_+/, \"\").replace(/_+$/, \"\").replace(/[\\s_]+/g, \"_\")\n ...
[ "0.73509336", "0.73509336", "0.6729913", "0.67139935", "0.6684378", "0.66055524", "0.6566727", "0.6551654", "0.6486323", "0.64489895", "0.6442737", "0.64157563", "0.6355857", "0.6300094", "0.6290084", "0.6256342", "0.62494177", "0.62405473", "0.62286884", "0.6219451", "0.6216...
0.82943404
0
Looks at the value in the 'zoneName' field and checks that it isn't empty.
function validateZoneName() { $("#zoneName").removeClass("is-invalid is-valid"); let name = $("#zoneName").val(); let namefeedback = $("#nameFeedback"); namefeedback.removeClass("valid-feedback invalid-feedback"); if (name.length === 0) { namefeedback.html("Please use type a name!"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nameCheked(value) {\n value = value.trim();\n if(value != \"\" && value.length > 2 && value != null){\n return true;\n }\n return false;\n}", "get zoneIdInput() {\n return this._zoneId;\n }", "zonename(zone){\n let relay_id = this.relayid(zone);\n if (relay_id == 0...
[ "0.5450692", "0.5362462", "0.5347555", "0.49919882", "0.49153075", "0.49120936", "0.49120936", "0.4910688", "0.4907157", "0.48639083", "0.48563266", "0.48501185", "0.4837719", "0.48319846", "0.48319846", "0.48319846", "0.48319846", "0.48319846", "0.48272216", "0.48206002", "0...
0.6113849
0
Build a zone from the values in the form, formatted as YAML. This shouldn't be called unless input has been validated. It will sanity check for the "isvalid" class in the name and coordinates field.
function addZone() { if ($('#location').hasClass("is-valid") && $('#zoneName').hasClass("is-valid")) { let name = $('#zoneName').val(); let latitude = $('#location').attr("data-latitude"); let longitude = $('#location').attr("data-longitude"); let radius = $('#radius').val() === '' ?...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zoneCreator (zoneInfo){\n this.name = zoneInfo.name;\n this.desc = zoneInfo.desc;\n this.exits = zoneInfo.exits;\n this.mobs = zoneInfo.mobs;\n this.exitValues = zoneInfo.exitValues;\n this.decor = zoneInfo.decor;\n zones.push(this);\n }// end of Room co...
[ "0.46994245", "0.4506406", "0.44301668", "0.43429202", "0.43015152", "0.42736173", "0.419072", "0.415986", "0.41517478", "0.41275185", "0.41262648", "0.4096904", "0.40855214", "0.4071424", "0.40586135", "0.40421292", "0.4033595", "0.40218773", "0.4021706", "0.4021706", "0.401...
0.61013496
0
function for updating x scale variable
function updateXScale(xData,curXAxis){ var xLineraScale = d3.scaleLinear() .domain([d3.min(xData, d=> d[curXAxis]),d3.max(xData, d=> d[curXAxis])]) .range([0,chartWidth]); return xLineraScale; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateXscale(data, chosen_x_axis) {\n var x_scale = d3.scaleLinear()\n .domain([-1.05, 1.05])\n .range([0, width]);\n return x_scale;\n}", "function updateX() {\n\t\td3.select('#axisX')\n\t\t\t.transition().duration(500)\n\t\t\t.call(d3.axisBottom(x).tickValues(x.domain().filter(func...
[ "0.7913701", "0.74852467", "0.747622", "0.74663705", "0.7289515", "0.7174372", "0.7169657", "0.7086964", "0.7077253", "0.7076484", "0.70730686", "0.70730686", "0.7066281", "0.70625454", "0.7062129", "0.7012705", "0.7012705", "0.70052475", "0.7000195", "0.69689924", "0.6968382...
0.807261
0
fucntion for updating y scale variable
function updateYScale(yData,curYaxis){ var yLinearScale = d3.scaleLinear() .domain([d3.min(yData, d=> d[curYaxis]),d3.max(yData, d=> d[curYaxis])]) .range([chartHeight,0]); // var yLinearScale = d3.scaleLinear() // .domain([d3.min(yData, d=> d[curYaxis]),d3.max(yData, d=> d[curYaxis])])...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function yUpdate(healthData, paramY) {\n //scaling\n var yLinScale = d3.scaleLinear()\n .domain([d3.min(healthData, d => d[paramY]),\n d3.max(healthData, d => d[paramY])\n ])\n .range([height,0]);\n return yLinScale; \n }", "function newYScal...
[ "0.7824697", "0.7794378", "0.75385034", "0.745426", "0.74008954", "0.7372127", "0.7367232", "0.73661786", "0.73044956", "0.7239815", "0.7224437", "0.7222201", "0.7222201", "0.7222201", "0.7214713", "0.7204196", "0.71963227", "0.71776235", "0.71669865", "0.7146236", "0.7139646...
0.7848573
0
update the evaluation section on demand
async function updateEval() { const eval = await (await fetch( './getEvaluation', { method: 'POST'} )).json(); fillElements( eval ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "storeForEval(toBeEvaluated) {\n this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(toBeEvaluated);\n }", "globalEval() {\n // phase one, if we have head inserts, we build up those before going into the script eval phase\n let insertHeadElems = new ExtDomQuery_1.ExtDomQuery(...t...
[ "0.61523974", "0.60626906", "0.59911644", "0.59875536", "0.5912755", "0.5891825", "0.5730362", "0.5729748", "0.5696358", "0.5546726", "0.55125016", "0.54731554", "0.54149276", "0.5393383", "0.5369736", "0.5340484", "0.5336918", "0.53241855", "0.5321739", "0.5320111", "0.53019...
0.74171984
0
update the audit section on demand
async function updateAudit() { const eval = await (await fetch( './getAudit', { method: 'POST'} )).json(); fillAuditElements( eval['res'] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onModifyAtk() {}", "update(dt) {\n logID(1007);\n }", "applyAudit() {\n super.applyAudit();\n this.log.debug('This is only another custom messagem from your custom server :)');\n }", "function updateSalesAuditChanged(grid,row,index,type,subtype) {\n console.log...
[ "0.5855567", "0.57262254", "0.559126", "0.55678165", "0.5565757", "0.55646795", "0.5512729", "0.54811454", "0.54513466", "0.5400357", "0.5395581", "0.5270561", "0.5270561", "0.52480674", "0.52343273", "0.5197591", "0.51902586", "0.5166588", "0.5166381", "0.51566124", "0.51460...
0.70682836
0
update the list of missing mappings
async function updateMissingMappings(){ // fetch data const allData = await (await fetch( './getMissingMappings', { method: 'POST'} )).json(); // assemble output const out = []; for( const [type, data] of Object.entries(allData) ) { // create table for missing all const missAll = [ `<...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async replace_missing(missing=\"\") {\n this.df = this.df.map(row => {\n let temp = row\n for (const [key, value] of Object.entries(row)) {\n if (value == missing) row[key] = null\n }\n return temp\n })\n }", "appendMapping(mapping) {\n ...
[ "0.61974746", "0.59443384", "0.59295285", "0.5861349", "0.5849217", "0.58382523", "0.5585634", "0.55435807", "0.5505507", "0.54801047", "0.5470399", "0.5468221", "0.54605323", "0.5410784", "0.5410784", "0.53943527", "0.537162", "0.53681797", "0.53577244", "0.53419167", "0.530...
0.63842523
0
update the analysis of candidates
async function updateCandidateAnalysis(){ // empty detail window document.querySelector('#analysisDetail .header').innerHTML = ''; document.querySelector('#analysisDetail .tab').innerHTML = ''; // fetch data analysisData = await (await fetch( './getAnalysis', { method: 'POST'} )).json(); for(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createCandidates() {\n /* TODO: sort out find for subdoc or redesign schema, probably need to redesign\n as currently a candidate just holds references to a person & party */\n\n deleted = candidatesCollect.count();\n created = updated = 0;\n\n candidatesCollect.drop(); // just for now, may need ...
[ "0.5675238", "0.5542836", "0.54328656", "0.5337784", "0.53288245", "0.5320368", "0.53164226", "0.527611", "0.5268386", "0.5209739", "0.5164716", "0.51489097", "0.51426303", "0.5107026", "0.510041", "0.50859964", "0.50614285", "0.50607264", "0.50544196", "0.50525177", "0.50487...
0.6266913
0
Insert a new row when pressing "Enter"
function onEnter(event: any, data: any, state: Slate$State, opts: EditTableOptions) { // Only handle when startBlock is is cell const { startBlock } = state if (startBlock.type !== opts.typeCell) return event.preventDefault() return insertRow(opts, state.transform()).apply() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addTaskOnEnterKey(event) {\n if (event.keyCode === 13) {\n insertNewTask();\n }\n}", "function addRow() {\n $schedule.find('tbody').append('<tr><th><input type=\"text\" /></th><td></td><td></td><td></td><td></td><td></td></tr>');\n addRowUndoHighlight();\n a...
[ "0.68698317", "0.6829392", "0.66202253", "0.6604409", "0.65358704", "0.64390004", "0.64342725", "0.64236474", "0.6412826", "0.6391425", "0.63666666", "0.63547534", "0.63370734", "0.6321065", "0.63183606", "0.6278217", "0.6273314", "0.62699497", "0.6261665", "0.62361073", "0.6...
0.69462913
0
Creates the card of an artist
function getArtistCard(artist) { if (artist.name === undefined || artist.image_url === undefined) return null; let artistCard = document.createElement("div"); artistCard.className = "card"; let artistImg = document.createElement("img"); artistImg.src = artist.image_url; artistIm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createArtCard(holder, art) {\n\tvar card = new Card(holder, art, {\n\t\ttitle: art.toString(),\n\t\tclasses: \"card-art card-art\" + art.id,\n\t\thideDetails: true,\n\t});\n\n\t// Create the holder for the svg\n\tcard.art = $(\"<div/>\", {\n\t\tclass: \"art-thumbnail\",\n\t\thtml: art.svg\n\t}).appendTo(c...
[ "0.6729569", "0.64538205", "0.64470625", "0.64435303", "0.6435164", "0.6392107", "0.6374725", "0.6305389", "0.6261219", "0.623781", "0.6173755", "0.6140494", "0.6140197", "0.61352867", "0.61252886", "0.61090004", "0.609988", "0.6042055", "0.60318494", "0.6016157", "0.60111994...
0.70907664
0
Exhibits artists' cards on page
function exhibitCards() { artistsList.forEach(artist => { let card = getArtistCard(artist); if (card !== null) { artistsCardsList.push(card); artistsCardListContainer.appendChild(card); } }); //tmpArtistsCardListContainer = artistsCardListContainer.clo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function appendArtists(artists) {\r\n let buttons = document.querySelectorAll(\".button.addblue\");\r\n let filteredArtists = [];\r\n for (let button of buttons) {\r\n console.log(button.innerText);\r\n let genre = button.innerText;\r\n for (let artist of artists) {\r\n artist.genre.includes(genre...
[ "0.61357766", "0.604021", "0.5982854", "0.5943138", "0.5873402", "0.58647215", "0.5824642", "0.580285", "0.5788729", "0.578022", "0.57531077", "0.5726183", "0.5713087", "0.5698637", "0.56869066", "0.56827164", "0.5681564", "0.56672084", "0.5666177", "0.5662282", "0.5657053", ...
0.7094833
0
Coloca un nuevo Sitio
nuevoSitio(state, nuevoSitio) { state.sitio = nuevoSitio }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "vaciarSitio(state) {\n state.sitio = new Sitio('', '', '')\n }", "create(req, res) {\n RegistroEstudo.create(req.body)\n .then(function (newRegistroEstudo) {\n res.status(200).json(newRegistroEstudo);\n })\n .catch(function (error) {\n res.status(500).json(error)...
[ "0.63149273", "0.61929226", "0.6191138", "0.6084885", "0.6070408", "0.60573906", "0.6010749", "0.5980455", "0.59067404", "0.5895714", "0.58606285", "0.5856905", "0.5832493", "0.5830976", "0.5744662", "0.56797004", "0.56738484", "0.5653192", "0.56478983", "0.5617584", "0.56071...
0.67373335
0
Vacia el modelo Sitio
vaciarSitio(state) { state.sitio = new Sitio('', '', '') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "actualizarAuto() {\n let se = this.informacion_vehiculos.find(\n automovil => this.automovil.placa == automovil.placa \n );\n this.enEdicion = false;\n this.informacion_vehiculos.splice(se, 1, this.automovil);\n this.automovil = Object.assign(...
[ "0.5981651", "0.593445", "0.5922942", "0.5785356", "0.5761984", "0.5748203", "0.5717347", "0.5683199", "0.56746656", "0.56215155", "0.55875", "0.558148", "0.5562866", "0.5532726", "0.5511057", "0.5494162", "0.5485289", "0.54674476", "0.54515743", "0.54500115", "0.54463935", ...
0.6170958
0
Cambia el estado del Formulario Sitio
cambiarEstadoValidoFormSitio(state, nuevoEstado) { state.formSitioValido = nuevoEstado }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cambiarEstadoValidoFormFertilizante(state, nuevoEstado) {\n state.formFertilizanteValido = nuevoEstado\n }", "function adaptaFormulario () {\r\n\tvar secProfEl = getFormElementById(\"sectorprofesion_c\");\r\n\tif (! secProfEl) {\r\n\t\tconsole.error(\"No se ha definido el campo Sector Profesion...
[ "0.63983417", "0.6389043", "0.61056197", "0.605854", "0.58961535", "0.5894254", "0.58489865", "0.5840994", "0.5834638", "0.5831708", "0.58142143", "0.57993925", "0.5774077", "0.5759964", "0.5744662", "0.57139796", "0.5712168", "0.57113063", "0.5700386", "0.56726855", "0.56716...
0.71299326
0
Build the script, in whatever form it is declared in, to be compatible with `Deno.run()`. This function add flags, arguments and actions.
build(script) { // global options const g = Object.assign({ watch: true, }, this.#config); delete g.scripts; const s = this.#config.scripts[script]; if (!s && this.#args) { const cmd = this.#args.join(" "); let out = []; if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function build() {\n\treturn function(cb) {\n\n\t\t///////////////////////////////////////////////////////////////////////////\n\t\t// TODO hardcoding mocks for now but after dev cloud we need to remove this\n\t\targs.mocks = true;\n\t\t///////////////////////////////////////////////////////////////////////////\n\...
[ "0.6542197", "0.61815464", "0.5895068", "0.5751882", "0.5610925", "0.55749166", "0.5449912", "0.54151654", "0.54115474", "0.53919566", "0.5352887", "0.5302891", "0.52734846", "0.52734846", "0.52626073", "0.5219508", "0.5209944", "0.51941574", "0.513126", "0.51269317", "0.5124...
0.7701214
0
and returns a longest common subsequence of s1 and s2. "ABAZDC", "BACBAD" => "ABAD" "AGGTAB", "GXTXAYB" => "GTAB" "", "asdf" => "" "asdf", "" => "" Recursive.
function lcs(s1, s2) { let result = ""; helper(s1.length - 1, s2.length - 1, ""); return result; function helper(n, m, string) { if (n < 0 || m < 0) { if ( result.length < string.length ) result = string; return; } if (s1[n] === s2[m]) { helper(n - 1, m - 1, string + s1[n]); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function longestCommon(str1, str2) {\n let shortest = (str1.length > str2.length ? str2 : str1);\n let longest = (str1.length > str2.length ? str1 : str2);\n let ans = \"\";\n for (let i = 0; i < shortest.length; i++) {\n for (let j = shortest.length - 1; j > i; j--) {\n let slice = shortest.slice(i, j...
[ "0.8111576", "0.7815594", "0.77384454", "0.7702741", "0.7553568", "0.75443065", "0.7477258", "0.73974556", "0.7348899", "0.7340546", "0.73384964", "0.71867526", "0.7184763", "0.7140617", "0.7112392", "0.70697534", "0.70034254", "0.6988711", "0.6982025", "0.6939562", "0.691764...
0.79777986
1
Replacement for arrayname.push(value) not implemented in IE until version 5.5 Appends element to the array
function arraypush(thearray,value) { thearray[ getarraysize(thearray) ] = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "push(value) {\n if (this.size + 1 > this.elements.length) {\n const newArray = new PlainArray(Math.max(this.size * 2, 3))\n for (let i = 0; i < this.size; i++) {\n newArray.set(i, this.elements.get(i))\n }\n this.elements = newArray\n }\n ...
[ "0.7301515", "0.7277395", "0.7277395", "0.7272819", "0.72301877", "0.71384925", "0.71246696", "0.70993954", "0.70936525", "0.70334613", "0.70293003", "0.698827", "0.69549567", "0.6949139", "0.6827701", "0.6821291", "0.6817722", "0.67862606", "0.67862606", "0.67736036", "0.675...
0.76636183
0
figure out the base rate for a specific type of shooting
function calculateBaseRate(typeOfShoot) { var hourlyRate; // switch between shooting options with different rates switch(typeOfShoot) { case 'individual', 'kids', 'ceremony', 'lovestory': hourlyRate = 120; break; case 'mitzvahs', 'birthdays': hourlyRate = 125; break; case 'family', 'bothp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shoot()\r\n\t{ if(shotoffset<timer)\r\n\t\t{switch (stype) {\r\n case 0:\r\n\t\t\t\tmysound.play();\r\n\t\t\t\tproj.changeproj(\"laser\");\r\n proj.laser();\r\n break;\r\n case 1:\r\n\t\t\t\tproj.fireball();\r\n\t\t\t\tproj.changeproj(\"fireball\");\r\n...
[ "0.638171", "0.62912726", "0.6148266", "0.6119788", "0.6078163", "0.6067329", "0.6036481", "0.60314924", "0.6025289", "0.59812176", "0.5955089", "0.5943187", "0.59099036", "0.59099036", "0.59099036", "0.59099036", "0.59099036", "0.59099036", "0.59099036", "0.5903115", "0.5866...
0.8664183
0
figure out the approximate total cost based ototaln rate, hours, and extra images
function calculateFinalCost(baseRate, hours, extraHi, extraLow) { var baseHours = 0; var extraHours = 0; var extraRate = 100; var extraHiRate = 5; var extraLowRate = 2.5; var finalQuote = 0; if (hours>0 && hours<= 4) { baseHours = hours; extraHours = 0; } else if (hours > 4){ baseHours = 4; extraHo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "calculateAdvancedCost() {\n var scale = this.isMonthly ? 1 : 1 / 12; // divide by 12 if the user input yearly numbers \n this.cost = parseInt( ( parseInt(this.monthlyRentCost) + parseInt(this.homeInsuranceCost) + parseInt(this.utilitiesCost)) * scale);\n // this.cost = this.cost.toFixed(2);\...
[ "0.65527445", "0.6055179", "0.6051668", "0.604132", "0.5974131", "0.59399205", "0.5879923", "0.58499", "0.57684493", "0.57658637", "0.57262874", "0.5716664", "0.57017", "0.5700301", "0.56919533", "0.5671234", "0.5643638", "0.5641274", "0.5624666", "0.5610408", "0.56009495", ...
0.6203818
1
Returns true if user is either a bot or an owner.
function isBotOrOwner(nick, host) { return isBot(nick, host) || isOwner(nick, host); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isOwner() {\n\t\treturn this.owner === Meteor.userId();\n \t}", "static isUserOwner(story) {\n if (!story) return false\n\n // doing string compare because of auth payload \n return story.postedBy._id === Auth.getPayload().sub\n }", "function checkAdminOrOwnerSender(msg){\n\n\tif (msg.author.id == m...
[ "0.68274695", "0.660479", "0.64130026", "0.6364136", "0.63149166", "0.62672", "0.624617", "0.62342536", "0.6201917", "0.6191936", "0.6056537", "0.6056537", "0.5944191", "0.59279853", "0.5893602", "0.5833457", "0.57830626", "0.57695055", "0.57426286", "0.5708887", "0.56891423"...
0.7501916
0
Flushes the config back to config.json.
function flushConfig(cb) { var conf = JSON.stringify(config); fs.writeFile('config.json', conf, cb); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetConfig() {\n writeConfig(skyuxConfigOriginal);\n}", "updateConfigFile() {\n\t\tconst { config } = this;\n\n\t\ttry {\n\t\t\tfs.writeFileSync(configFilePath, JSON.stringify(config, null, 2));\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t}\n\t}", "function saveConfig(){\n fs.writeFi...
[ "0.6954675", "0.69534206", "0.6737715", "0.6729587", "0.6655044", "0.6520643", "0.6452313", "0.6452313", "0.64380676", "0.6370877", "0.62082994", "0.6184066", "0.61443126", "0.60956806", "0.6088294", "0.60415983", "0.6032456", "0.60209984", "0.5975249", "0.59186405", "0.58960...
0.8034579
0
check if an ast node is a function call pipe
function isPipeCall (as, node) { return node.callee && node.callee.name === as }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nodeIsFnCall(node) {\n return node.type === 'CallExpression' &&\n node.callee.type === 'MemberExpression' &&\n node.callee.object &&\n node.callee.object.type === 'CallExpression' &&\n node.callee.object.callee &&\n node.callee.object.callee.type =...
[ "0.63771534", "0.62808263", "0.62100023", "0.60984874", "0.58360785", "0.5684", "0.5656649", "0.55682915", "0.5525111", "0.54821897", "0.5405377", "0.538201", "0.538171", "0.538171", "0.53807616", "0.53748727", "0.53741693", "0.5373649", "0.53731877", "0.53476554", "0.5304271...
0.771273
0
checks if an BinaryExpression is an pipe call
function isPipe (path) { return path.node.operator === LEFTPIPE }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPipe(){\n\treturn isMatch(pipe, getPipe());\n}", "function isPipeCall (as, node) {\n return node.callee && node.callee.name === as\n}", "function isAntiPipe (path) {\n return path.node.operator === RIGHTPIPE\n}", "test_pipe(){\n\t\tlet x = parse(`bash 'ls -al' | column 1| row 2`);\n\t\tif (!x) a...
[ "0.7348114", "0.70584697", "0.6415174", "0.6397568", "0.58888644", "0.586937", "0.5754677", "0.5736115", "0.56580573", "0.5523685", "0.5472415", "0.54560584", "0.53143287", "0.5285208", "0.52535325", "0.5229119", "0.52157235", "0.52094537", "0.5207817", "0.51648957", "0.51484...
0.7121537
1
checks if an BinaryExpression is a right pipe call
function isAntiPipe (path) { return path.node.operator === RIGHTPIPE }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPipe (path) {\n return path.node.operator === LEFTPIPE\n}", "function isPipe(){\n\treturn isMatch(pipe, getPipe());\n}", "function isPipeCall (as, node) {\n return node.callee && node.callee.name === as\n}", "isChainable() {\r\n\t\t\t\t\tvar ref1;\r\n\t\t\t\t\treturn (ref1 = this.operator) === '...
[ "0.6747389", "0.6522557", "0.6203571", "0.5898275", "0.58520496", "0.57663596", "0.57663596", "0.57663596", "0.57663596", "0.57663596", "0.57663596", "0.57663596", "0.57663596", "0.57663596", "0.57663596", "0.57663596", "0.57663596", "0.57663596", "0.57663596", "0.57663596", ...
0.6735486
1
gets the nodes to the left and right of a path
function side (path) { return [ leftOf(path), rightOf(path) ] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function leftOf (path) {\n return path.get('left')\n}", "function pathTo(node){\n var curr = node;\n var path = [];\n while(curr.parent) {\n path.push(curr);\n curr = curr.parent;\n }\n path.push(curr);\n return path...
[ "0.62843674", "0.61024475", "0.6046649", "0.59622806", "0.5918708", "0.5884718", "0.58731025", "0.58250284", "0.58076614", "0.58064985", "0.57856756", "0.5766808", "0.5766808", "0.5759492", "0.5744981", "0.5743836", "0.5742422", "0.57183754", "0.57146436", "0.57103115", "0.57...
0.6603489
0
gets the path left of a given path
function leftOf (path) { return path.get('left') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "previous(path) {\n if (path.length === 0) {\n throw new Error(\"Cannot get the previous path of a root path [\".concat(path, \"], because it has no previous index.\"));\n }\n\n var last = path[path.length - 1];\n\n if (last <= 0) {\n throw new Error(\"Cannot get the previous path of a first c...
[ "0.6732842", "0.6732842", "0.6305233", "0.6263872", "0.6263872", "0.6263872", "0.6263872", "0.6263872", "0.6263872", "0.6263872", "0.6263872", "0.6263872", "0.6263872", "0.62480307", "0.62480307", "0.6165048", "0.6157154", "0.6101187", "0.5998509", "0.5905806", "0.5844909", ...
0.8284094
0
maybe all of this can be lifted to the fleet component where the state can store all the ship shipTypes and they can be passed down here. Example, the shipType: "carrier" can be passed down as prop.shipType to the first instance of in fleet. Same for the length. Then the prop.length can be used for
shipBuilder(shipTypeStringInput) { // ensures that a string was inputted if (typeof shipTypeStringInput !== "string") { throw new Error("You haven't inputted a string name for the ship"); } // // status this.setState({ shipType: this.props.shipType }); this.setState({ length: this.determin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(props) {\n super(props);\n this.state = {\n sizes: [new Size(8), new Size(10), new Size(12)],\n types: [new Selectable('1/4 Inch'), new Selectable('1/2 Inch'), new Selectable('5/8 Inch'), new Selectable('Type-x'), new Selectable('Denshield')]\n };\n }", "...
[ "0.6089197", "0.59881353", "0.5712756", "0.56325334", "0.5577215", "0.54562795", "0.53237814", "0.52990085", "0.5278119", "0.5275606", "0.5269861", "0.52168757", "0.521465", "0.52002823", "0.5199666", "0.5190354", "0.51745343", "0.5173649", "0.51479226", "0.5132943", "0.51327...
0.66240144
0
Create the HTTPS server with custom request and response class
create () { this.server = https.createServer( Object.assign({ IncomingMessage: CherryIncomingMessage, ServerResponse: CherryServerResponse }, this.options.httpsOptions), (req, res) => { this.bootstrap(req, res) } ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function createHTTPServer(options) {\n let server;\n\n if (!options.https) {\n server = _http.default.createServer(options.listener);\n } else if (options.https === true) {\n let {\n cert,\n key\n } = await (0, _.generateCertificate)(options.outputFS, options.cacheDir, options.host);\n ...
[ "0.66243243", "0.6562006", "0.65481746", "0.6431938", "0.6431938", "0.6418612", "0.64156145", "0.63583106", "0.6228974", "0.6199678", "0.6182514", "0.61395645", "0.6120259", "0.60897386", "0.5986197", "0.5986197", "0.5986197", "0.5986197", "0.5986197", "0.59706587", "0.595419...
0.72832847
0
Updates a user's email and name. First checks if another user who is NOT the same user already has this email. If no one does, proceed as normal and change user's email and name and propapage changes to the TournamentDirector collection.
function updateEmailAndName(director, newName, newEmail, visible, callback) { TournamentDirector.findOne({ email: newEmail, _id: { $ne: director._id } }, function (err, result) { if (err) { console.log(err); callback(err); } else if (result) { callback(null, null,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateUser(doc, res, updateParams) {\n if (updateParams.name) {\n doc.name = updateParams.name;\n }\n if (updateParams.pendingTasks) {\n doc.pendingTasks = updateParams.pendingTasks;\n }\n if (updateParams.email && updateParams.email !== doc.email) {\n findEmailAndUpdat...
[ "0.6519412", "0.6359693", "0.6288918", "0.60624325", "0.60615534", "0.5981676", "0.5965841", "0.58825266", "0.58715135", "0.5838609", "0.58220226", "0.5774977", "0.576316", "0.57602847", "0.5717479", "0.5713122", "0.5702707", "0.57000846", "0.5691464", "0.56852525", "0.563875...
0.699503
0
returns data about the league from the API
async function getLeagueDetails() { const league = await axios.get( `https://soccer.sportmonks.com/api/v2.0/leagues/${LEAGUE_ID}`, { params: { include: "season", api_token: process.env.api_token, }, } ); if (league.data.data.current_stage_id == null) { return { le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLeagues() {\n fetch(leagueUrl)\n .then((response) => {\n if (response.ok) {\n return response.json();\n }\n throw new Error(response.statusText);\n })\n .then((responseJson) => displayLeaguesInput(responseJson))\n .catch((err) => {\n $(\"#js-error-message\").text...
[ "0.7234257", "0.708566", "0.69519395", "0.6838745", "0.6661692", "0.66026866", "0.64680773", "0.64669466", "0.6464151", "0.6435043", "0.63634807", "0.6340822", "0.6324632", "0.6320989", "0.631775", "0.6306202", "0.6256419", "0.6194845", "0.61879057", "0.6139603", "0.6132976",...
0.7276595
0
Internal function used to turn a single value, array of values, or function into an array of values
_standardValueArray(value) { if (_.isFunction(value)) { value = this.map(value); } else if (!(value instanceof Array)) { value = Array(this.length).fill(value); } return Array.from(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleArray (val) {\n\t\tvar self = this;\n\t\treturn val.map(function (m) {\n\t\t\treturn self.cast(m);\n\t\t});\n\t}", "function transformerList(val) {\n\t return util.arrayify(val);\n\t}", "function transformerList(val) {\n\t return util.arrayify(val);\n\t}", "function transformerList(val) {\n ...
[ "0.6915499", "0.6864493", "0.6864493", "0.68213", "0.65788776", "0.6562189", "0.6485239", "0.6485239", "0.6481594", "0.6437543", "0.6423243", "0.6405028", "0.63756585", "0.63756585", "0.6374637", "0.6356361", "0.6356361", "0.6356361", "0.6350005", "0.63425654", "0.62913376", ...
0.70019394
0
Takes in a uritobe with the form http___stuff_morestuff_otherstuff and replace all underscores with the URI characted for "/", except those three underscores following http
function URIify(str) { let str_change = str.replace(/\s/g, ''); // eliminate whitespace str_change = str_change.replace(/^(http)_{3}/, 'http%3A%2F%2F'); // replace http___ with uri encoded http:// str_change = str_change.replace(/_/g, '%2F'); // replace rest of underscores with slashes str_change = str_change.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeDamnHttp (strToFix) {\n return strToFix.replace(/http:\\/+/, '/');\n}", "function prepURL(url) {\r\n // if a complete URL is passed, get the hostname\r\n if (url.indexOf(\"//\") > 0) { url = url.split(\"/\")[2]; }\r\n // remove www. (ww2, ww18, etc.) if there to save some space and return va...
[ "0.6597479", "0.65241367", "0.63644403", "0.6343418", "0.6298548", "0.6254852", "0.6244276", "0.6239401", "0.62381715", "0.6232468", "0.6190229", "0.6111917", "0.60989106", "0.6064266", "0.60302716", "0.60214174", "0.60198313", "0.6014504", "0.59818804", "0.59583914", "0.5956...
0.6792518
0
Rotate the skier's direction to the left, but not if crashed or already fully left
rotateLeft() { if (this.direction !== Constants.SKIER_DIRECTIONS.CRASH && this.direction > Constants.SKIER_DIRECTIONS.LEFT) { this.setDirection(this.direction - 1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "leftTurn() {\r\n this.fltire.rotateY(16);\r\n this.frtire.rotateY(16);\r\n }", "turnLeft(){\n this.orientation--;\n if(this.orientation < 0){\n this.orientation = 3;\n }\n this.graphicalObject.rotateY(Math.PI/2);\n }", "returnFromLeft() {\r\n this.fltire.rota...
[ "0.76907295", "0.7677207", "0.7573631", "0.73277116", "0.7199664", "0.7047131", "0.703962", "0.7006461", "0.69782406", "0.69236064", "0.69099474", "0.6898828", "0.68800503", "0.6760709", "0.673194", "0.67089707", "0.6670232", "0.6652991", "0.6636754", "0.6606141", "0.6567042"...
0.8533729
0
Rotate the skier's direction to the right, but not if crashed or already fully right
rotateRight() { if (this.direction !== Constants.SKIER_DIRECTIONS.CRASH && this.direction < Constants.SKIER_DIRECTIONS.RIGHT) { this.setDirection(this.direction + 1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "rightTurn() {\r\n this.fltire.rotateY(-16);\r\n this.frtire.rotateY(-16);\r\n }", "returnFromRight() {\r\n this.fltire.rotateY(16);\r\n this.frtire.rotateY(16);\r\n }", "turnRight(){\n this.orientation++;\n if(this.orientation > 3){\n this.orientation = 0;\n }\n ...
[ "0.7905918", "0.756627", "0.74317634", "0.70341563", "0.6867266", "0.6832965", "0.6822648", "0.6785433", "0.6756719", "0.6733136", "0.6696991", "0.66676307", "0.6624552", "0.65855384", "0.65767086", "0.6568995", "0.65455395", "0.64941216", "0.6446672", "0.64262336", "0.641429...
0.8292196
0
Reset any current jump
resetJump() { this.z = 0; this.verticalVelocity = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reset() {\n this.yPos = this.groundYPos;\n this.jumpVelocity = 0;\n this.jumping = false;\n this.ducking = false;\n this.update(0, Trex.status.RUNNING);\n this.midair = false;\n this.speedDrop = false;\n this.jumpCount = 0;\n this.crashed = false;\n }", "resetSkier () {\n \n ...
[ "0.79965866", "0.7538875", "0.71773726", "0.6953237", "0.69506055", "0.6885844", "0.6867838", "0.6801198", "0.67955756", "0.67920697", "0.679145", "0.6770715", "0.67385626", "0.6719785", "0.6712105", "0.6708482", "0.6706903", "0.66810143", "0.6653213", "0.6630329", "0.6627917...
0.8172381
0
Progress the skier in vertical space until her/him has reached the ground
progressJump() { this.verticalVelocity -= Constants.GRAVITY; this.z += this.verticalVelocity; this.verticalVelocity *= Constants.FRICTION; if (this.z <= 0) { this.resetJump(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "move(){\r\n if (this.counter % this.trajectory[this.step][Trajectory.Duration] == 0) {\r\n this.hide()\r\n this.step ++\r\n this.counter= 0\r\n basic.pause(50)\r\n if (this.step == this.trajectory.length) {\r\n ...
[ "0.6352203", "0.6348262", "0.6272123", "0.61714625", "0.6036645", "0.59966874", "0.5970856", "0.59624624", "0.59369785", "0.5928239", "0.5927797", "0.5906245", "0.5890974", "0.5874666", "0.58489126", "0.58444065", "0.5828409", "0.5799846", "0.57996994", "0.5797698", "0.579692...
0.63926387
0
Skier has now crashed
crash() { this.resetJump(); this.setDirection(Constants.SKIER_DIRECTIONS.CRASH); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onChildAppCrashRestart () {\n\n }", "function handleCrash(event) {\n }", "function crash(req, res) {\n throw new Error('Server crashed intentially by /admin/crash')\n res.send({info: '/admin/crash failed to crash'})\n}", "function onFatal(root){root.finishedWork=null;}", "function onFatal(root){root....
[ "0.6409642", "0.59812343", "0.5927054", "0.580548", "0.580548", "0.580548", "0.58010465", "0.5788401", "0.5751608", "0.57491714", "0.5736645", "0.56937444", "0.5672388", "0.5642356", "0.5638092", "0.5611861", "0.5601527", "0.5601527", "0.558659", "0.55613846", "0.5553318", ...
0.6738502
0
Skier had now died
die() { this.resetJump(); this.setDirection(Constants.SKIER_DIRECTIONS.DEAD); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "dieSoon() {\n this.die(10);\n }", "function die() {\n this.state = 1;\n }", "die(){\n this.alive = false;\n this.unstageUnit();\n }", "function died() {\n if (lives == 0) {\n document.documentElement.style.setProperty('--blinkyAnimation', '0s');\n documen...
[ "0.6620919", "0.6407963", "0.63911265", "0.62799287", "0.62259394", "0.6132578", "0.61117125", "0.60968655", "0.60166484", "0.598299", "0.59520304", "0.5946879", "0.5905002", "0.5901405", "0.5820851", "0.58170164", "0.58005756", "0.57693", "0.57676154", "0.5760938", "0.572173...
0.6521144
1
Expand `asnType` property. This will mutate the object itself.
expand(modules, parameterMappings) { const expandedType = lodash_1.cloneDeep(this.asnType).expand(modules, parameterMappings); if (!lodash_1.isEqual(expandedType, this.asnType)) { this.asnType = expandedType; } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "expand(modules) {\r\n const expandedType = lodash_1.cloneDeep(this.asnType).expand(modules, []);\r\n if (!lodash_1.isEqual(expandedType, this.asnType)) {\r\n this.asnType = expandedType;\r\n }\r\n return this;\r\n }", "function relaxType(type) {\n switch (type.kind) {...
[ "0.5999276", "0.4601199", "0.45174056", "0.44681573", "0.44626394", "0.44552967", "0.43486917", "0.434109", "0.4309324", "0.4303919", "0.43037072", "0.42801148", "0.42801148", "0.42801148", "0.42801148", "0.42801148", "0.42801148", "0.42801148", "0.42621607", "0.42621607", "0...
0.55116993
1
Emits an open settings command
openSettings () { this.emit('opensettings', {}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openSettings() {\n let cfg = getConfigObject(true);\n $(\"#txtChannel\").val(cfg.Channels.join(\",\"));\n $(\"#txtNick\").val(cfg.Name || Strings.NAME_AUTOGEN);\n if (cfg.Pass && cfg.Pass.length > 0) {\n $(\"#txtPass\").attr(\"disabled\", \"disabled\").hide();\n $(\"#txtPassDummy\")....
[ "0.6698743", "0.6154602", "0.61126775", "0.59771645", "0.59605104", "0.5883141", "0.58462524", "0.579383", "0.5736518", "0.5734078", "0.5691047", "0.56441414", "0.56385547", "0.5609328", "0.5583275", "0.554959", "0.5549136", "0.55354404", "0.5474211", "0.547011", "0.5461043",...
0.782821
0
to check if one element (TopEl) is higher vertically than another (BottomEl):
static vertLocationCheck2Elemets(selectorTopEl, selectorBottomEl){ const emailLocation = $(selectorTopEl).getLocation('y'); const errorLocation = $(selectorBottomEl).getLocation('y'); return (emailLocation < errorLocation); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static vertLocationCheck3Elemets(selectorTopEl, selectorMiddleEl, selectorBottomEl){\n const topElLocation = $(selectorTopEl).getLocation('y');\n const middleElLocation = $(selectorMiddleEl).getLocation('y');\n const bottomElLocation = $(selectorBottomEl).getLocation('y');\n return (topElLocation < mid...
[ "0.73985046", "0.6994815", "0.6870329", "0.67210305", "0.67013127", "0.66789836", "0.6578103", "0.65428877", "0.65145457", "0.6484908", "0.6474341", "0.6474341", "0.6456574", "0.63929933", "0.6327254", "0.6294872", "0.62660307", "0.62203616", "0.61663735", "0.6158749", "0.611...
0.7276614
1
to check vertical order of 3 elements (Top, Middle, Bottom):
static vertLocationCheck3Elemets(selectorTopEl, selectorMiddleEl, selectorBottomEl){ const topElLocation = $(selectorTopEl).getLocation('y'); const middleElLocation = $(selectorMiddleEl).getLocation('y'); const bottomElLocation = $(selectorBottomEl).getLocation('y'); return (topElLocation < middleElLoca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static vertLocationCheck2Elemets(selectorTopEl, selectorBottomEl){\n const emailLocation = $(selectorTopEl).getLocation('y');\n const errorLocation = $(selectorBottomEl).getLocation('y');\n return (emailLocation < errorLocation);\n }", "function check_top_left_bottom_right(row, col, color) {\n ...
[ "0.604264", "0.5975084", "0.59341085", "0.5899418", "0.58858556", "0.5860638", "0.58361405", "0.58119076", "0.5760996", "0.5732975", "0.57281536", "0.57199657", "0.56972706", "0.56861544", "0.5685187", "0.5634745", "0.56083095", "0.5549911", "0.5544863", "0.5530138", "0.55275...
0.77715665
0
Called when a file starts downloading. The filename includes the entire path of the file; for example "materials/models/bobsModels/car.mdl".
function DownloadingFile( fileName ) { $("#loadingtext").hide().text("Downloading " + fileName).fadeIn(300); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onStartedDownload(id) {\n console.log(`Started downloading: ${id}`);\n}", "function startDownload(){\n\n}", "function onOpenFile (event, fileName) {\n event.preventDefault()\n\n if (E.app.isReady()) {\n createWindow(PageURLPackageFile, fileName, {fileName: fileName})\n return\n }\n\n Opened...
[ "0.62346643", "0.607141", "0.60604286", "0.6013204", "0.5901912", "0.58182585", "0.57999045", "0.5798119", "0.5789034", "0.5727687", "0.57239586", "0.57165545", "0.570948", "0.5677027", "0.5668314", "0.5637942", "0.5632472", "0.559915", "0.55950683", "0.55791146", "0.55199254...
0.6208994
1
Converts 2 dimensional Json object into an array of values to pass into google charts
function mapJsonToChartValues(values) { var r = []; for (value in values) { // If first value of JSON is an object, then user has passed in multiple tracked data... if (typeof values[value] == "object") {return mapJsonWithMultipleTracksToChartValues(values);} // Otherwise continue building return value ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_jsonToChartData(data) {\n const keys = Object.keys(data[0]);\n\n const parseData = data.map(item => {\n let values = [];\n\n keys.forEach((key) => values.push(item[key]));\n return values;\n });\n\n keys[0] = 'State';\n\n return [keys].concat(parseData);\n }", "chart() {\r\n ...
[ "0.70296305", "0.66179955", "0.6322003", "0.60976875", "0.6055462", "0.60540426", "0.601019", "0.6000539", "0.59385425", "0.5822317", "0.5799116", "0.5735078", "0.57246166", "0.5697735", "0.566695", "0.56298184", "0.5619722", "0.56121165", "0.55819434", "0.5578207", "0.550802...
0.7561006
0
Converts 2 dimensional Json object into an array of labels to pass into google charts
function mapJsonToChartLabels(labels) { var r = ''; for (label in labels) { r += label + "|"; } return r.slice(0, -1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generaDatasLabels(json) {\n let label = [],\n labels = [],\n data = [],\n datas = [],\n datasets = [],\n datasYlabels = [];\n let DatosJson = json;\n\n //Obtenemos los nombres de cada campo del JSON\n for (let key in DatosJson.data[0]) {\n label.push(k...
[ "0.6738255", "0.66985023", "0.65689576", "0.6410432", "0.63187116", "0.6311954", "0.63076526", "0.6166208", "0.6116274", "0.60131925", "0.5945692", "0.5945412", "0.5867", "0.5819871", "0.5805187", "0.579901", "0.57947785", "0.574283", "0.57153916", "0.56095403", "0.55904216",...
0.7748571
0
Does a quick check of the table to see if it can be used vertically or horizontally, and makes sure there are numeric values where there should be
function table_check(values) { var flag = true, counter = 0, finalCount = 0, arrTR = values.getElementsByTagName('TR'), lenTR = arrTR.length, x, y, arrTD, arrTD_len; // Check to see if we can use the table vertically... for(x = 0; x < lenTR; x++) { counter = 0; arrTD = arrTR[x].g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "normalize_table() {\n var trs = document.getElementById('ComparisonTable').getElementsByTagName('tr'), len = trs.length, max = 0, td;\n // first we search for the longest table row in terms of # of children \n for (var i = len; i--;) {\n if (trs[i].children.length > max) max = trs[i...
[ "0.607225", "0.5919915", "0.5834954", "0.5814228", "0.57355326", "0.571867", "0.567217", "0.5643945", "0.56188613", "0.5590484", "0.5581998", "0.5540249", "0.55279183", "0.5516734", "0.55041033", "0.55012774", "0.54839087", "0.5460866", "0.54589474", "0.5458069", "0.54406387"...
0.72298306
0
Converts 2 dimensional html table into an array of values to pass into google charts
function mapVerticalTableToChartValues(values, dataDepth) { var arrTR = values.getElementsByTagName('TR'), arr_values = ''; for (var j = 1; j <= dataDepth; j++) { if (j > 1) { arr_values = arr_values.slice(0,-1)+"|"; } for(var i = 0, arr_len = arrTR.length; i < arr_len; i++) { arr_values ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapHorizontalTableToChartValues(values, dataDepth) {\n\t\tvar arrTD,\n\t\t\tarr_values = \"\";\n\t\tfor (var j = 1; j <= dataDepth; j++) {\n\t\t\tif (j > 1) {\n\t\t\t\tarr_values = arr_values.slice(0,-1)+\"|\";\n\t\t\t}\n\t\t\tarrTD = values.getElementsByTagName('TR')[j].getElementsByTagName('TD');\n\t\t\...
[ "0.6717061", "0.6704774", "0.65078175", "0.64671814", "0.64628386", "0.64611864", "0.64171267", "0.63747954", "0.6334524", "0.6320124", "0.6318916", "0.62939334", "0.6239994", "0.6179651", "0.617438", "0.6133864", "0.61300385", "0.60972524", "0.6096232", "0.60942775", "0.6090...
0.67583406
0
Converts 2 dimensional html table into an array of values to pass into google charts
function mapHorizontalTableToChartValues(values, dataDepth) { var arrTD, arr_values = ""; for (var j = 1; j <= dataDepth; j++) { if (j > 1) { arr_values = arr_values.slice(0,-1)+"|"; } arrTD = values.getElementsByTagName('TR')[j].getElementsByTagName('TD'); for(var i = 0, arr_len = arrTD.length; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapVerticalTableToChartValues(values, dataDepth) {\n\n\t\tvar arrTR = values.getElementsByTagName('TR'),\n\t\t\tarr_values = '';\n\n\t\tfor (var j = 1; j <= dataDepth; j++) {\n\n\t\t\tif (j > 1) {\n\t\t\t\tarr_values = arr_values.slice(0,-1)+\"|\";\n\t\t\t}\n\t\t\t\n\t\t\tfor(var i = 0, arr_len = arrTR.le...
[ "0.67586887", "0.6705933", "0.6508076", "0.64673674", "0.6462148", "0.6461554", "0.64169407", "0.6373913", "0.63339514", "0.6320287", "0.6318515", "0.6293505", "0.62396324", "0.61796063", "0.6173636", "0.61327183", "0.6130177", "0.6098383", "0.6097697", "0.60927993", "0.60911...
0.6717034
1
Converts 2 dimensional html table into an array of labels to pass into google charts
function mapVerticalTableToChartLabels(values) { var arrTR = values.getElementsByTagName('TR'); var arr_values = [] for(var i = 0, arr_len = arrTR.length; i < arr_len; i++) { arr_values.push(arrTR[i].getElementsByTagName('TD')[0].innerHTML); } return arr_values.toString().replace(/,/g, '|'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapHorizontalTableToChartLabels(values) {\n\t\tvar arrTD = values.getElementsByTagName('TR')[0].getElementsByTagName('TD');\n\t\tvar arr_values = []\n\t\tfor(var i = 0, arr_len = arrTD.length; i < arr_len; i++) {\n\t\t\tarr_values.push(arrTD[i].innerHTML);\n\t\t}\n\t\treturn arr_values.toString().replace(...
[ "0.7566662", "0.6440661", "0.5989369", "0.59756875", "0.5928975", "0.5880012", "0.58201385", "0.5763961", "0.5702256", "0.56757367", "0.5641497", "0.5607323", "0.55997896", "0.559896", "0.55660427", "0.55625355", "0.5549151", "0.5521984", "0.55038226", "0.5487836", "0.5485757...
0.746769
1
Converts 2 dimensional html table into an array of labels to pass into google charts
function mapHorizontalTableToChartLabels(values) { var arrTD = values.getElementsByTagName('TR')[0].getElementsByTagName('TD'); var arr_values = [] for(var i = 0, arr_len = arrTD.length; i < arr_len; i++) { arr_values.push(arrTD[i].innerHTML); } return arr_values.toString().replace(/,/g, '|'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapVerticalTableToChartLabels(values) {\n\t\tvar arrTR = values.getElementsByTagName('TR');\n\t\tvar arr_values = []\n\t\tfor(var i = 0, arr_len = arrTR.length; i < arr_len; i++) {\n\t\t\tarr_values.push(arrTR[i].getElementsByTagName('TD')[0].innerHTML);\n\t\t}\n\t\treturn arr_values.toString().replace(/,...
[ "0.74678165", "0.6441191", "0.59897107", "0.5975811", "0.5928682", "0.58790094", "0.58202916", "0.57633245", "0.5702517", "0.56761193", "0.5640873", "0.5606071", "0.5599005", "0.5598843", "0.55647224", "0.55626315", "0.5549015", "0.55220306", "0.55050534", "0.5486945", "0.548...
0.7567045
0
Change hamburger color when it's over an element with class .changeHamburger
function changeHamburger() { var scrollTop = $(window).scrollTop(); var currentBackground = $('.current-bg'); $('.changeHamburger').each(function() { var $this = $(this); var topOfElement = $this.offset().top; var bottomOfElement = $this.offset().top + $this.outerHeight(true); var visible = false; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hamburger(x) {\n x.classList.toggle(\"change\");\n}", "function toggleHamburger(){\r\n navbar.classList.toggle(\"showNav\")\r\n ham.classList.toggle(\"showClose\")\r\n hamClose.classList.toggle(\"showClose\")\r\n }", "function hamburgerMenu(){\n\n $('.fa-bars').on('click',(e)=>{\n ...
[ "0.74421674", "0.69704854", "0.6945633", "0.6924199", "0.68566394", "0.6855117", "0.67811614", "0.67784405", "0.67599934", "0.675735", "0.6697124", "0.66933393", "0.66459703", "0.6637466", "0.66239417", "0.6480411", "0.6480106", "0.6478044", "0.6403832", "0.63857996", "0.6298...
0.78789854
0
componentDidMount is used to grab the canvas container ref, and hook up the pixi.js renderer
componentDidMount() { //setup pixi Canvas in componentDidMount this.renderer = PIXI.autoDetectRenderer(this.stagewidth, this.stageheight); this.refs.gameCanvas.appendChild(this.renderer.view); //create the root of the scene graph this.stage = new PIXI.Container(); this.stage.width = this.stage...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componenDidMount () {\n this.setupCanvas()\n }", "componentDidMount() {\n\tlet type = \"WebGL\"\n\tif( ! PIXI.utils.isWebGLSupported()){\n\t\ttype = \"canvas\"\n\t}\n\twindow.PIXI = PIXI;\t\n\tthis.app = this.props.app;\n\tthis.app.renderer.autoResize = true;\n\tthis.gameCanvas.appendChild(this.app.view);\n ...
[ "0.8107688", "0.7895788", "0.7707994", "0.76427567", "0.7596965", "0.7590477", "0.75493455", "0.7414095", "0.7342352", "0.7290459", "0.72827506", "0.7197887", "0.7194548", "0.70499146", "0.70024604", "0.6968226", "0.69596225", "0.684063", "0.6822191", "0.68221015", "0.6810323...
0.8160959
0
checking collisions with the boozied players
checkCollisions(){ //current user id const uid = this.props.userkey; // current players gfx const player = this[`player_${uid}`]; // getting list of boozied player const boozies = Object.keys(this.props.games[this.currentGame].players).filter((id)=>{ return this.props.games[this.currentGam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function collision(top_x, bottom_x, top_y, bottom_y) {\n\t\tfor (var i = 0; i < rows; i++) {\n\t\t\tfor (var j = 0; j < cols; j++) {\n\t\t\t\tvar b = bricks[j][i];\n\t\t\t\tif (b.exists == 1) {\n\t\t\t\t\tif (top_y < (b.y + block_height) && bottom_y > b.y && top_x < (b.x + block_width) && bottom_x > b.x) {\n\t\t\t...
[ "0.7946041", "0.776089", "0.7695484", "0.75994986", "0.7599341", "0.7582797", "0.7578276", "0.75577974", "0.7484719", "0.74536526", "0.74513334", "0.74510276", "0.74446684", "0.7444135", "0.7430981", "0.7421573", "0.74086314", "0.7408427", "0.7404942", "0.73946875", "0.733731...
0.79351944
1
Render our container that will store our pixijs game canvas. store ref
render(){ return( <div className="game-canvas-container" ref="gameCanvas"></div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render(container) {\n this.renderer.render(container);\n }", "render() {\n\t\treturn (\n\t\t\t<div className=\"gameContainer\" onKeyDown={this.handleKeyPress.bind(this)}>\n\t\t\t\t<div className=\"visableArea\" >\n\t\t\t\t<canvas \n\t\t\t\t\tid=\"myCanvas\" \n\t\t\t\t\tref=\"canvas\"\n\t\t\t\t\twidth={this.s...
[ "0.6964595", "0.69044733", "0.6846559", "0.68322486", "0.6829631", "0.682681", "0.68262124", "0.6783582", "0.6731954", "0.67130274", "0.6673724", "0.66568804", "0.66466665", "0.66466665", "0.66466665", "0.6639754", "0.6616009", "0.66111887", "0.6606369", "0.6605937", "0.66053...
0.6916334
1
Find Nearest square number
function nearestSq(n) { let x = Math.round(Math.sqrt(n)); return x * x; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bestSquareTiles(x, y, n) {\n //prevent div/0\n if (n === 0 || x === 0 || y === 0)\n return 0;\n var px = Math.ceil(Math.sqrt((n * x) / y));\n var sx = undefined;\n var sy = undefined;\n if (Math.floor((px * y) / x) * px < n) {\n sx = y / Math.ceil((px * y) / x);\n }\n ...
[ "0.6815909", "0.6694227", "0.66455805", "0.662259", "0.66210335", "0.6517796", "0.6506305", "0.6506077", "0.6500655", "0.64643353", "0.6419448", "0.64097273", "0.64056563", "0.6360637", "0.63488096", "0.6348543", "0.6347894", "0.62852263", "0.6280813", "0.6252322", "0.6233371...
0.7637027
0
Creates an Album from the data currently in the form
function getFormData () { const nameField = document.getElementById("albumTitle"); const yearField = document.getElementById("albumYear"); const artistList = document.getElementById("artistList"); const producerList = document.getElementById("producerList"); const genreList = document.getElemen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createAlbum() {\n const title = $('#albumTitel').val()\n const desc = $('#albumDisc').val()\n createAlbumImgur(title, desc)\n}", "function zoto_modal_create_album(options){\n\tthis.options = options ||{};\n\tthis.options.in_wizard = this.options.in_wizard || false;\n\tthis.$uber(options);\n\tthis.opt...
[ "0.68758273", "0.6755778", "0.66108584", "0.65253353", "0.6370736", "0.6344235", "0.63354653", "0.61940116", "0.61370265", "0.60628074", "0.60491526", "0.59154326", "0.58972025", "0.58245707", "0.5809051", "0.5790055", "0.5776884", "0.57633394", "0.57222694", "0.57180023", "0...
0.6974243
0
exp(i th) = cos th + i sin th
function _exp_i(th) { return { re: Math.cos(th), im: Math.sin(th) }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "exp () {\n\t\t\tconst ex = Math.exp (this.x); return Complex.C (ex * Math.cos (this.y), ex * Math.sin (this.y));\n\t\t}", "function generateExp(){\n for (var i=0;i<iterations;i++){\n if (a2*a2+b2*b2>=4){\n return i; \n }\n var e=Math.E;\n var tmA=a2;\n a2=e^tmA*Math.cos(b2)-0.65;\n ...
[ "0.72818464", "0.66558367", "0.6514539", "0.62819964", "0.6111568", "0.60996115", "0.6062343", "0.6053807", "0.5996887", "0.5875838", "0.58570784", "0.5850072", "0.5800608", "0.57469225", "0.57469225", "0.5726698", "0.5726698", "0.5726363", "0.56965", "0.5683699", "0.5667026"...
0.8234077
0
Join leftRow to all found foundRightRows
function joinRows(leftRow, foundRightRows) { return foundRightRows.map(rightRow => { return {...rightRow, ...leftRow}; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getEachRightMatchedByLeft(leftRow){\n let leftMatches = leftRow[leftMatchColumn.key];\n // If right matches is null, just return null.\n if (leftMatches) {\n return JSON.parse(leftMatches);\n } else {\n return null;\n }\n }", "function joinAdjacent(row, lastRow) {\n let prev...
[ "0.64893305", "0.6313847", "0.6282364", "0.5998735", "0.5972106", "0.5802652", "0.57487935", "0.57457536", "0.5709571", "0.56868327", "0.5647007", "0.563635", "0.56338835", "0.5614214", "0.5612061", "0.5592148", "0.555585", "0.5550729", "0.5534118", "0.55211395", "0.55152875"...
0.8136638
0
The latest info that was provided.
get latestInfo() { return this._previousPrivacyInfo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getInfo(){\t\t\n\treturn cachedInfo;\n}", "function getrecent(info) {\n return info[info.length - 1]\n}", "get info() {\n return this._data.info;\n }", "get info() {\n return this._data.info;\n }", "function getLatestInfo() {\n\t\t\treturn $http.get('http://localhost:4000/ar...
[ "0.6946801", "0.6943023", "0.6800297", "0.6800297", "0.6769137", "0.6690262", "0.65373456", "0.6468797", "0.6318321", "0.60325444", "0.6021805", "0.59878457", "0.5959173", "0.5945183", "0.5925164", "0.591753", "0.5815903", "0.5814892", "0.57904047", "0.57878095", "0.5780976",...
0.72685385
0
Add an approver for an ERC721 Token
async function addApproverNFToken(approved, tokenID, address) { console.log('Adding Approver for an NF Token', approved, tokenID, address); const nfTokenShield = shield[address] ? shield[address] : await NFTokenShield.deployed(); const nfToken = await NFTokenMetadata.at(await nfTokenShield.getNFToken.call()); r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function addApproverNFToken(approved, tokenID, address) {\n console.log('Adding Approver for an NF Token', approved, tokenID, address);\n const nfToken = await NFTokenMetadata.at(await getContractAddress('NFTokenMetadata'));\n return nfToken.approve(approved, tokenID, {\n from: address,\n gas: 40000...
[ "0.67028415", "0.5923604", "0.5826147", "0.5663045", "0.56427217", "0.5483138", "0.5461923", "0.5368112", "0.53489757", "0.52919674", "0.52812994", "0.5271364", "0.52439654", "0.5208623", "0.5202977", "0.51919216", "0.5165304", "0.5131422", "0.51238596", "0.49964038", "0.4967...
0.671656
0
Get an approver for an ERC721 Token
async function getApproved(tokenID, address) { console.log('Getting Approver for an NF Token', tokenID); const nfTokenShield = shield[address] ? shield[address] : await NFTokenShield.deployed(); const nfToken = await NFTokenMetadata.at(await nfTokenShield.getNFToken.call()); return nfToken.getApproved.call(toke...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getApproved(tokenID) {\n console.log('Getting Approver for an NF Token', tokenID);\n const nfToken = await NFTokenMetadata.at(await getContractAddress('NFTokenMetadata'));\n return nfToken.getApproved.call(tokenID);\n}", "getToken() {\n return axios.get('contract-builder/template/contracts/T...
[ "0.60899734", "0.5793048", "0.5685758", "0.5539664", "0.5536949", "0.55327", "0.54425573", "0.5430802", "0.54017437", "0.5399137", "0.5373804", "0.53418136", "0.53363484", "0.53175145", "0.53129447", "0.5283958", "0.52651733", "0.52124923", "0.5209201", "0.5171114", "0.515081...
0.6286191
0
Handle messages received from the player
function onMessageReceived(e) { var data = JSON.parse(e.data); switch (data.event) { case 'ready': onReady(); break; case 'playProgress': onPlayProgress(data.data); break; case 'play': onPlay(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onMessageReceived(e) {\n var data = JSON.parse(e.data);\n \n switch (data.event) {\n case 'ready':\n onReady();\n break;\n \n case 'playProgress':\n onPlayProgress(data.data);\n break;\n ...
[ "0.7624303", "0.75664914", "0.7510911", "0.7413529", "0.74086195", "0.7391647", "0.71614003", "0.7155294", "0.70481014", "0.69512886", "0.69511", "0.6902526", "0.68479025", "0.68479025", "0.68479025", "0.6843804", "0.6843804", "0.6690165", "0.6654687", "0.6636383", "0.6613185...
0.7659572
0
function load data for hour level
function loadDataForByHour() { var dateRange_value = 'where[full_date.between]=' + urlMaster.getParam('where[full_date.between]'); var url = apiRootUrl + '/revenueByHour?select=full_date|hour24_of_day&limit=2000&' + dateRange_value + "&by=pais|pid"; if (myAjaxStore.isLoading(url)) { return; } v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseOpenWeather1Hour()\n{\n // anviser data til vejret nu\n {\n data.now.time[1] = importJson.openWeather1Hour.current.dt;\n data.now.symbol_code[1] = convertSymbolCode(importJson.openWeather1Hour.current.weather[0].description, data.now.isDay);\n data.now.temperature[1] = round((importJson.op...
[ "0.6719133", "0.64808047", "0.63765603", "0.62551576", "0.6230779", "0.61333454", "0.61098593", "0.6022803", "0.59980714", "0.592831", "0.59189534", "0.58997256", "0.5893973", "0.58935195", "0.58632594", "0.5852812", "0.5831983", "0.5822792", "0.57262665", "0.5725985", "0.570...
0.76438487
0
Print the vertex and adjacency list.
printGraph() { // Get all the vertices. const getKeys = this.adjList.keys(); // Iterate over the vertices. for (const key of getKeys) { // Get the corresponding adjacency list for the vertex. const getValues = this.adjList.get(key); let conc = ""; // Iterate over the adjacency list for (c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "consolePrintGraph() {\n // get all the vertices \n let verts = this.AdjList.keys();\n\n // iterate over the vertices \n for (let i of verts) {\n // gets the adjacency list for the vertex \n let values = this.AdjList.get(i);\n let conc = \"\";\n\n ...
[ "0.79317904", "0.78408206", "0.78408206", "0.78408206", "0.7737555", "0.75455636", "0.73908883", "0.7286319", "0.71826035", "0.7126284", "0.7099545", "0.70067185", "0.6836454", "0.66427994", "0.66427994", "0.64229095", "0.6237789", "0.60992056", "0.60798246", "0.6066107", "0....
0.7847111
1
Compute the average with .forEach()
function average(numbers) { let sum = 0; numbers.forEach(function(arrNum) { sum = arrNum += sum; }); let arrAvg = sum/numbers.length; return arrAvg; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computedAvgPriceForEach() {\r\n let sumPrice = 0;\r\n shirts.forEach(val => sumPrice += val.price );\r\n return sumPrice/shirts.length;\r\n}", "function find_average(array) {\n // your code here\n var sum = 0;\n array.forEach( element => sum += element); \n return sum / array.length;\n}"...
[ "0.7685704", "0.74827963", "0.74165624", "0.7268294", "0.7214247", "0.71422815", "0.711882", "0.70813906", "0.7056593", "0.70411414", "0.70244527", "0.70135194", "0.7012624", "0.70075434", "0.7000389", "0.6995487", "0.6973325", "0.6960561", "0.69411045", "0.6934459", "0.69153...
0.7501999
1
When contentReady event is fired, you can call methods on the uploader.
function handleContentReady () { // Allows the uploader to send log messages to trace, as well as to YAHOO.log uploader.setAllowLogging(false); // Disallows multiple file selection in "Browse" dialog. uploader.setAllowMultipleFiles(false); // New set of file filters. var ff = new Ar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleContentReady() {\n // Allows the uploader to send log messages to trace, as well as to YAHOO.log\n // uploader.setAllowLogging(true);\n\n // Allows multiple file selection in \"Browse\" dialog.\n uploader.setAllowMultipleFiles(true);\n\n // New set of file filters (separate filter mas...
[ "0.80028933", "0.6526891", "0.6346865", "0.6307159", "0.62407184", "0.62350094", "0.6095813", "0.5998685", "0.59865046", "0.59778154", "0.59411085", "0.5930062", "0.59189683", "0.5916183", "0.58907115", "0.5873728", "0.58578813", "0.5855342", "0.5790693", "0.57880485", "0.577...
0.8163618
0
pick random resume responses from peers
function _chooseResumes(people) { var numToGet = 4, cur = 0, numPeople = people.length, responses = []; var pickPerson = function(question) { var foundPerson = false, person; while(!foundPerson) { var ran1 = Math.floor(Math.random() * numPeople); person = people[ran1]; if(person._id !== $game.$...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomReplyStart(){\n\treturn replyStartArray[Math.floor(Math.random() * replyStartArray.length)];\n}", "_rechoke () {\n if (!this.ready) return\n\n if (this._rechokeOptimisticTime > 0) this._rechokeOptimisticTime -= 1\n else this._rechokeOptimisticWire = null\n\n const peers = []\n\n thi...
[ "0.55567235", "0.5545901", "0.55229706", "0.55229706", "0.5485264", "0.54820615", "0.5449099", "0.54485923", "0.5444985", "0.5370956", "0.52916247", "0.52227354", "0.5211518", "0.5199912", "0.51470286", "0.50716525", "0.50698626", "0.50485927", "0.50384897", "0.5008299", "0.5...
0.6419684
0
save feedback on resume responses to db for each user
function _saveFeedback() { var info = []; $('.bossArea textarea').each(function(i) { var val = this.value; info.push({ comment: val, id: _resumes[i].id }); }); ss.rpc('game.player.resumeFeedback', info); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function user_feedback(result) //nbr_of_people\n{\n console.log(\"user_feedback\")\n console.log(result);\n updateUserFeedback(result);\n}", "function proceed() {\r\n $scope.status = ''\r\n $scope.logo.class = 'animated zoomOutDown'\r\n AppService.getMutualMatches() // load in the b...
[ "0.5719849", "0.56489706", "0.55924475", "0.5533195", "0.55163974", "0.54664105", "0.53860676", "0.5373823", "0.53586215", "0.5353799", "0.5339137", "0.5324053", "0.53219885", "0.5320527", "0.5311627", "0.5307906", "0.5302709", "0.5264749", "0.52245986", "0.52177715", "0.5210...
0.68400395
0