query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
initWidget() houses the actual code that we can use to initialize the widget. IMPORTANT: TGS.Widget.CreateWidget() is the function you use to initialize the TGS widget. Notice we are also setting game.tgsWidget(a variable we made up) to the return a value of the CreateWidget() function. We can use this later to close t...
function initWidget () { // vars for positioning the TGS Widget game.tgsWidgetX = 100; game.tgsWidgetY = 50; // We will use this to scale the widget game.tgsWidgetScale = null; game.tgsWidget = TGS.Widget.CreateWidget({ parentDiv: document.getElementById('game'), // The placement function runs every...
[ "function createWidget() {\n container = widget.addStack();\n container.layoutVertically();\n outbox = container.addStack();\n outbox.layoutHorizontally();\n\n box = outbox.addStack();\n box.layoutVertically();\n setDateWidget();\n\n if (VIEW_MODE === 1) {\n box.addSpacer();\n setWeatherWidget();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Event handler for the language select element. / \param ev the event that triggered the action / / The event handler is attached to a select control. It sets / `cuelang` to the selected language (a language code, such as / 'en' or 'ja') and updates the contents of the element `cue_elt` / to display the current caption ...
function change_language(ev) { cuelang = this.value; // Set the lang attribute of the cue_elt. cue_elt.setAttribute("lang", cuelang); // Set the cue_elt to the current caption in the chosen language. let i = 0, len = subtitles.length; while (i < len && subtitles[i].language !== cuelang) i++;...
[ "function change_cue(ev)\n {\n if (this.language !== cuelang) return; // Not the selected language\n\n if (!this.activeCues.length) cue_elt.innerHTML = \"\";\n else cue_elt.innerHTML = this.activeCues[0].text; // Only show one\n }", "function sync_cue(ev)\n {\n let t; // The position in the vi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[int]: task ID to activate [task]: task to activate
function activate(id, task) { _manager2.default.activate(id, task); if (!isRunning) { start(); } }
[ "taskActivator() {\n var Bot = exports.Bot;\n if (!botManager.isDoingDisassembly) {\n if (new Date().getDay() === 2 && new Date().getHours() === 19 && new Date().getMinutes() === 0) {\n require('./../tasks/CheckMarketplaceTask.js').check(Bot);\n }\n for ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Releases the model memory The model object is referencecounted so if some recognizer depends on this model, model might still stay alive. When last recognizer is released, model will be released too.
free() { libvosk.vosk_model_free(this.handle); }
[ "dispose(model) {\n if (model != null)\n {\n if (model.children) {\n for (let c of model.children) {\n this.dispose(c);\n }\n }\n if (model.geometry) {\n model.geometry.dispose();\n model.geometry = undefined;\n }\n if (model.material) {\n i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an array of the neighboring Cells to the Cell at the given row and column.
neighbors (row, column) { let leftColumn = column - 1 let rightColumn = column + 1 let upRow = row - 1 let downRow = row + 1 // Wrap around edges if (leftColumn < 1) leftColumn = this.cols if (rightColumn > this.cols) rightColumn = 1 if (upRow < 1) upRow = this.rows if (downRow > ...
[ "function neighbors() {\n var n = [] ;\n for (var i = -1; i <= 1; ++i)\n for (var j = -1; j <= 1; ++j) {\n if (Cells[this.row+i] && Cells[this.row+i][this.col+j] && !(i == 0 && j == 0))\n n.push(Cells[this.row+i][this.col+j]) ;\n }\n return n; \n}", "static neighbo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Provided a source, map each of the weights to a percentage, and then return one of the items based on a randomly generated number between 0 and 1 (0% 100%)
function selectFromWeights(source) { var data = source.list; var weightList = []; var sum = 0; var randomNumber = Math.random(1); //console.log("Random Number = " + randomNumber); for (var entry in data) { var entryToAdd = []; entryToAdd[0] = data...
[ "function getRandomItem(list, weight) {\n const totalWeight = weight.reduce(function (prev, cur, i, arr) { return prev + cur; }),\n n = Math.random() * totalWeight;\n\n let weightSum = 0;\n\n for (let i = 0; i < list.length; i++) {\n weightSum += weight[i];\n\n if (n <= weightSum) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates single indicator item
_generateIndicator(id) { const that = this, indicatorContainer = document.createElement('span'), indicatorId = id ? id : 0; if (that.indicatorTemplate) { const template = that._validateTemplate(that.indicatorTemplate); indicatorContainer.innerHTML = that...
[ "_generateIndicator(id) {\n const that = this,\n indicatorContainer = document.createElement('span'),\n indicatorId = id ? id : 0;\n\n if (that.indicatorTemplate) {\n const template = that._validateTemplate(that.indicatorTemplate);\n\n indicatorContainer.inn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove trailing 'c's. Equivalent to str.replace(/c$/, ''). /c$/ is vulnerable to REDOS. invert: Remove suffix of nonc chars instead. Default falsey.
function rtrim(str, c, invert) { if (str.length === 0) { return ''; } // Length of suffix matching the invert condition. var suffLen = 0; // Step left until we fail to match the invert condition. while (suffLen < str.length) { var currChar = str....
[ "function rtrim(str, c, invert) {\n if (str.length === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n var suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < str.length) {\n var currChar = str.charA...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
helper function to append the correct suffix to a date
function dateSuffix(day) { //set suffix according to date of the month if (day % 10 == 1 && day != 11) return 'st'; else if (day % 10 == 2 && day != 12) return 'nd'; else if (day % 10 == 3 && day != 13) return 'rd'; else return 'th'; }
[ "function dateSuffix(date){\n if(date == 1 || date == 21 || date == 31){\n date = date +\"st\"\n }else if(date ==2 ||date == 22 ){\n date = date+\"nd\"\n }else if(date ==3 || date == 23){\n date = date +\"rd\"\n }else {\n date = date +\"th\"\n }\n return date\n}", "funct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
orientates a bunch of circles to point in orientation
function orientateCircles(circles, orientation, orientationOrder) { if (orientationOrder === null) { circles.sort(function (a, b) { return b.radius - a.radius; }); } else { circles.sort(orientationOrder); } var i; // shift circles so largest circle is at (0, 0) if (circles.lengt...
[ "function orientateCircles(circles, orientation, orientationOrder) {\n if (orientationOrder === null) {\n circles.sort(function (a, b) { return b.radius - a.radius; });\n } else {\n circles.sort(orientationOrder);\n }\n\n var i;\n // shift circles so largest ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determines from the global and workspace configuration if tags should be case sensitive. Returns a boolean value of true if only to match upper case (TODO:) or false if matching both upper and lower case (TODO: and todo:).
caseSensitiveMatching() { // Set a default setting let caseSensitive = true; let global = nova.config.get("todo.global-case-sensitive-tag-matching"); let workspace = nova.workspace.config.get("todo.workspace-case-sensitive-tag-matching") // Override default with a global preference if it e...
[ "async loadCaseSensitiveMatching() {\n let caseSensitive = true\n let global = nova.config.get('todo.global-case-sensitive-tag-matching')\n let workspace = nova.workspace.config.get('todo.workspace-case-sensitive-tag-matching')\n\n // Override default with a global preference if it exists\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Verify that the userselected timestamps are valid subsets of the data, then redraw the graphs
function modifyInterval () { try { // Retrieve time values from the user inputs, verify the dates are valid by attempting to create Date objects var subsetStart = new Date($('#subsetStart').combodate('getValue', null)._d); subsetStart = subsetStart.getTime(); var subsetEnd = new Date...
[ "function check_everything(data) {\n if (data.length == selectedReleases().length) {\n //console.log(data);\n\n //draw the line chart\n redrawLineChart({});\n }\n }", "function checkAndPlotData() {\n if (locationS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Indicates if the action key is pressed
isActionPressed() { return this.currentKeys.get(SPACE); }
[ "function keyPressed() {}", "_handlePressed(keycode) {\n let res = false;\n if (this.bindings.actions[keycode]) {\n const name = this.bindings.actions[keycode];\n this.context.actions[name] = true;\n res = true;\n }\n\n if (\n this.bindings.triggers[keycode] &&\n this.bindings...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
THE OUTLINE OF THE THIRST METER FOR THE DYING MAN
function thirstMeter_outline_2() { stroke(0); strokeWeight(8); fill(0, 255, 0); rect(rect2_x_outline, rect2_y_outline, outline_rect_l, outline_rect_h); }
[ "torso() {\n const belly_end = this.shifted_extend(this.hip_nexus ,'up', 'belly');\n const ribs_end = this.shifted_extend(belly_end ,'up', 'ribs');\n this.shoulder_nexus = ribs_end;\n return [\n svg_line(this.hip_nexus, belly_end),\n svg_line(belly_end, ribs_end)\n ];\n }", "ghostFeet1()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Either insert or update a spot request. This ensures an atomic insert or update, but we never learn which one happened.
async upsertSpotRequest(spotRequest, client) { let { id, workerType, region, az, instanceType, state, status, imageId, created, } = assertValidSpotRequest(spotRequest); let text = [ 'INSERT INTO spotrequests (id, workerType, region, az, instanceTy...
[ "async insertSpotRequest(spotRequest, client) {\n let {\n id,\n workerType,\n region,\n az,\n instanceType,\n state,\n status,\n imageId,\n created,\n } = assertValidSpotRequest(spotRequest);\n\n let text = [\n 'INSERT INTO spotrequests (id, workerType, reg...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find the sum of all the multiples of 3 or 5 below 1000.
function multiplesOf3And5() { var total = 0; for (var i = 3; i < 1000; i += 1) { if (i%3 === 0 || i%5 === 0) { total += i; } } return total; }
[ "function sumMultiples3Or5Below1000() {\n const lcm = 15;\n let sum = 0;\n for (let i = lcm; i <= 1000; i += lcm) sum += i;\n return sum;\n}", "function sumUnder1000() {\n const array = [];\n for (i = 3; i < 1000; i++) {\n if (i % 3 === 0 || i % 5 === 0) {\n array.push(i);\n }\n }\n return arra...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add Meal Plan Data
function addMealPlanData(date, meal) { const mealPlanObject = newMealPlanObject(date, meal); // console.log('Meal Plan Object:',mealPlanObject) mealPlanData.push(mealPlanObject); localStorage.setItem('mealPlanData', JSON.stringify(mealPlanData)); }
[ "function addPlan(){\n var title = pTitle.value;\n var note = pNote.value;\n var date = pDate.value;\n var time = pTime.value;\n var duration = pDuration.value;\n var category = pCategory.value;\n\n var titleCheck = checkTitle(title);\n var timeCheck = checkTime(time);\n var durationChec...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ko.templateSources.anonymousTemplate Anonymous templates are normally saved/retrieved as DOM nodes through "nodes". For compatibility, you can also read "text"; it will be serialized from the nodes on demand. Writing to "text" is still supported, but then the template data will not be available as DOM nodes.
function anonymousTemplate (element) { this.domElement = element; }
[ "function templateNode () {\n return{\n id: '',\n label: '',\n level: '',\n title: '',\n image: '',\n shape: 'image'\n }\n}", "bindNodeTemplate (nodes) {\n if (isObservable(nodes)) {\n throw new Error('The \"nodes\" option must be a plain, non-observable...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the section days and times
function getSectionDetails(listItem){ var sectionLocation = null, sectionDays = null, sectionTimes = { start: 'TBA', end: 'TBA' }; //Find the meeting time information var fullSectionTime = listItem.find('span.meetingtime').text(); //Explode by spaces ...
[ "function getDayAndTime(area){\n function removeEmptySpaces(array){\n new_array = []\n \n for (var item=0;item<array.length;item++){\n if (array[item] == \"\")\n continue\n new_array.push(array[item])\n }\n return new_array;\n }\n\n if...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
print quotes change backgroundcolor color of page and button
function printQuote() { var selectedRandomQuote = getRandomQuote(); var html = '<p class="quote">' + selectedRandomQuote.quote + '</p>' + '<p class="source">' + selectedRandomQuote.source + '<span class="citation">' + selectedRandomQuote.citation + '</span>' + '<span class="year">' + selectedRandomQ...
[ "function printQuoteAndChangeBackgroundColor() {\r\n printQuote();\r\n var newBackgroundColor = \"rgb(\" + Math.floor(Math.random() * 256 + 1) + \", \" + Math.floor(Math.random() * 256 + 1) + \", \" + Math.floor(Math.random() * 256 + 1) + \")\";\r\n console.log(newBackgroundColor);\r\n document.body.style.backg...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return a list of imports for the given array of nodes.
function packageImports(nodes) { var map = {}, imports = []; // Compute a map from name to node. nodes.forEach(function(d) { map[d.name] = d; }); // For each import, construct a link from the source to target node. nodes.forEach(function(d) { if (d.imports) d.imports.forEach(funct...
[ "function packageImports(nodes) {\n var map = {},\n imports = [];\n\n // Compute a map from name to node.\n nodes.forEach(function (d) {\n map[d.name] = d;\n });\n\n // For each import, construct a link from the source to target node.\n nodes.forEach(function (d) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prepares place for browser in HTML
function placeBrowser(contents) { var place = document.getElementById('browserArea'); place.innerHTML = contents; processBrowser(place); resetInnerDivSize(); GLOBAL_lineStart = -1; GLOBAL_lineEnd = -1; }
[ "function prepareMainPage(res, user)\n{\n\t// Create an empty String to store the page.\n\tvar page = '';\n\t\n\t// Open up a file reading stream to load the file.\n\tvar pageStream = fs.createReadStream(__dirname + '/webs/index.html');\n\t\n\t// Create file-loading callbacks.\n\tpageStream.on('data', function(chun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determines if a list has at least one noun Returns boolean
function isNounCorrect(anArray) { for(i = 0; i < anArray.length; i++) { if(dictionary.nouns.includes(anArray[i])){ console.log("Noun matched: " + dictionary.nouns[i]); return true; } } console.log("No noun found.") }
[ "function phraseExists(phrase){\n return naughtyList.includes(phrase);\n}", "static isPronoun(word = \"\") {\n return (\n [\"i\", \"you\", \"he\", \"she\", \"it\", \"we\", \"they\"].indexOf(\n word.toLowerCase().trim()\n ) > -1\n )\n }", "function isExist(title){\n for(let i=0;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this function creates the map svg and sets many of the basic attributes the projection of the map is also set here the csv and topojson datasets are loaded into the page for user using the callback function
function setMap(){ var width = window.innerWidth * 0.5, height = 500; var map = d3.select("body") .append("svg") .attr("class", "map") .attr("width", width) .attr("height", height); var projection = d...
[ "function setMap() {\n\t\t//map frame dimensions\n\t\tvar width = window.innerWidth * 0.5,\n\t\t\theight = 460;\n\n\t\t//create new svg container for the map\n\t\tvar map = d3.select(\"body\")\n\t\t\t.append(\"svg\")\n\t\t\t.attr(\"class\", \"map\")\n\t\t\t.attr(\"width\", width)\n\t\t\t.attr(\"height\", height);\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to update the highlighted building, hourdiv and timeslider according to the new time that was set (either through moving the time silder or by selecting another div in the calendar)
function update(selectedTime){ if (!map.tilesloading) { document.getElementById("buttonWeekday_"+selectedWeekday).focus(); selectedTime = getNewSelectedTime(selectedTime) // 1. step: Highlight calendar var previousSelectedDiv = document.getElementById("hour_" + previousSe...
[ "_changeToHourSelection() {\n const that = this,\n svgCanvas = that._centralCircle.parentElement || that._centralCircle.parentNode;\n let hours = that.value.getHours();\n\n cancelAnimationFrame(that._animationFrameId);\n delete that._animationFrameId;\n that.interval = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a path, get the path to the previous sibling node.
previous(path) { if (path.length === 0) { throw new Error("Cannot get the previous path of a root path [".concat(path, "], because it has no previous index.")); } var last = path[path.length - 1]; if (last <= 0) { throw new Error("Cannot get the previous path of a first child path [".conca...
[ "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 var last2 = path[path.length - 1];\n if (last2 <= 0) {\n throw new Error(\"Cannot get the previous path of a first chi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generic function for sending requests through a $httplike http service obj is the api object that makes the request action and error are promises to be run on success and error respectively and after the corresponding default promises have been run
function sendRequest(obj, request, httpService, action, error) { obj.running = true; obj.valid = null; obj.raw = null; // action and error are functions for the promise. if defined they'll be run after the default action and error functions let _action = function (result) { obj.raw = result; obj.vali...
[ "function $http(url, token){\n \n // A small example of object\n var core = {\n\n // Method that performs the ajax request\n ajax: function (method, url, token, args) {\n\n // Creating a promise\n var promise = new Promise( function (resolve, reject) {\n\n var params = '';\t \n if (args...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
numTiles: The number of tiles in the grid qType: whether the grid uses 'q' or 'qu' tiles
function drawGrid(numTiles, qType) { var gridContainer = $('.grid'); var gridSize = Math.sqrt(numTiles); gridContainer.css('width', gridSize * TILE_SIZE + "px"); gridContainer.html('<label>Letters</label>'); var rowTemplate = $('.gridRow.template'); var tileTemplate = $('.tile.template'); var tileContaine...
[ "function getNumTilesInSpace(space){\n\t\t\n\t\tvar numItems = g_functions.getNumItemsInSpace(space, g_temp.tileWidth, g_options.carousel_space_between_tiles)\n\t\t\t\t\n\t\treturn(numItems);\n\t}", "function setGridSize() {\n //setting rows, cols and number of colored cells depending on the level\n colorCount ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
adds an event handler to the event queue
function addOnEvent(eventListener) { eventQueue.push(eventListener); }
[ "addEvent(event) {\r\n\t\tthis.eventQueue.add(event);\r\n\t}", "addHandler(handler) {\n this.handlers.push(handler);\n }", "addEvent(event) {\n this.q.enqueue(event);\n }", "on(handler, callback) {\n this.eventHandlers[handler] = callback;\n }", "set_event_handler(name, callback) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function stores target URL when navigating to new page, and restores state after navigation
function storeUrl(e) { console.log(this.getAttribute("href") + " Logging the current navigation URL."); if (e) { localStorage.setItem('selectedItem', this.getAttribute("href")); console.log("Local storage value for selectedItem is: " + localStorage.getItem('selectedItem')); } }
[ "function nav(target) {\n urlstate.page = $('#navigation').attr(target);\n urlstate.set_url();\n refresh_gallery();\n}", "function setCurrentUrl(url)\n{\n window.history.pushState({},'',url);\n}", "function onReplaceState() {\n recentActiveUrl = getUrl();\n}", "function updateURL(event) {\n ev...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculate fitness of each individual
calculateFitness() { for (var i = 0; i < this.individuals.length; i++) { this.individuals[i].calcFitness(); } this.getFittest(); }
[ "calculateFitness() {\n for (var i = 0; i < this.individual.length; i++) {\n this.individual[i].calculateFitness();\n }\n }", "calcFitness() {\n for (let i = 0; i < this.population.length; i++) {\n this.population[i].calcFitness(target);\n }\n }", "calcFitness () {\n c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this function changes the color of the exception regions to color same as the base country for eg. when China is clicked or hovered Hongkong color is set to same as china.
function dynamicColor(code, color, type){ if(exceptionRegionColorMapping[code]){ code = exceptionRegionColorMapping[code]; } if(prevCountryColor[type] && prevCountryColor[type].code){ var prevSelTerritories = _(exceptionRegionColorMapping).keys().filter(function(...
[ "function recolor_regions() {\n scope.regions_geojson.setStyle(get_region_style);\n }", "function getColorForsubprovince(e) {\n\tvar color = {};\n\tcolor.iso = e.ISOCODE;\n\tif(color.iso != undefined){\n\n\t\tif (iHealthMap.getIndicatorDataType() == \"Standard\") {\n\t\t\t\n\t\t\tif(subprovince.jsonda...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
hideTriggers() hide object triggers based on current facing direction
function hideTriggers() { dirArray[currentDir].hide(); }
[ "function showTriggers() {\n // hide triggers from the last direction\n dirArray[gameBackground.lastDir].hide();\n // show current direction triggers\n dirArray[currentDir].show();\n // update direction indicators\n dirIndicatorArr[gameBackground.lastDir].css({\n \"color\": \"White\"\n });\n // highlight...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This functions gets the interesting places around baseLoc. If places data is already available in the localStorgae, it is fetched from there. Else fetches from third party data provider (FOURSQUARE) through an API call.
function getPlacesAndDetail(baseLoc) { var locs; //check if locations are available in the localStorage //if available in LocalStorage, call 'generateLocations' to load data as an array of Objects //if not available in LocalStorage, call 'getLocations' to fetch from data provider (locs = JSON.parse(localStor...
[ "function getNearbyPlaces() {\n if (latitude != null && longitude != null) {\n const url = 'https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=' + latitude + ',' + longitude\n + '&radius=2000&type=restaurant&key=AIzaSyByamnPPlulIhr_56Qn94KuInBvctHRgMA';\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
handleAuth Detects and sends oauth response code to server
function handleAuth () { return new Promise(function (resolve, reject) { // Return if current URI does not begin with /auth: if (!window.location.pathname.startsWith("/auth")) { pushLog(LogType.ACTION, "Page Reload", window.location.pathname); resolve(); return; } pushLog(LogType.HT...
[ "function oAuthCallback(res, req){\n\t//TODO: Automate token capture within application\n\tconsole.log(\"oAuth Callback called\");\n\tvar myURL = url.parse(req.url);\n\tvar code = myURL.searchParams.get('code');\n\tvar state = myURL.searchParams.get('state');\n\t\n\tconsole.log(\"Auth code is: \" + code);\n\tconsol...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create the DOM element for a stream
function createStreamElement(stream, htmlContent) { if (stream.channel) { htmlContent += '<div class="stream">' + '<i class="fa fa-star fa-lg" data-stream-name=' + stream.channel.display_name + '></i><a class="stream-title" target="_blank" href="' + stream.channel.ur...
[ "function createStreamElement(stream, htmlContent) {\n if (stream.channel) {\n htmlContent += '<div class=\"stream\"><span class=\"first-row\">' + '<i class=\"fa fa-star fa-lg\" data-stream-name=' + stream.channel.display_name + '></i><a class=\"stream-title\" target=\"_blank\" href=\"' + stream.channel.url + '...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
_update this function will check the scroll position against the events. if the event has fired it will be removed from the events array.
function _update() { offset = window.scrollY; events = events.filter(function (event) { if (offset > event.offset) { event.cb.call(event.el, event.el, offset); return false; } return true; }); }
[ "_onScroll(e) {\n this._checkScroll();\n }", "_updateOnScroll(event) {\n const scrollDifference = this._parentPositions.handleScroll(event);\n if (scrollDifference) {\n const target = event.target;\n // ClientRect dimensions are based on the scroll position of the page and ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
scale the 1000x669 image in half to 500x334 onto a temp canvas scale the 500x335 canvas in half to 250x167 onto the main canvas
function hi_res_draw(img){ for(let x = 0; x < 33; x++){ var c1 = scaleIt(img,0.99999999999999999); }; my_canvas.width = c1.width/2; my_canvas.height = c1.height/2; ctx.drawImage(c1, 0,0, c1.width, c1.height, 0, 0, my_canvas.width, my_canvas.height); }
[ "function scaleCanvas(){\n scaledCanvasCtx.drawImage(drawCanvas, 0, 0, 1280, 720, 0, 0, scaledCanvas.width, scaledCanvas.height);\n}", "function scaleImage() {\r\n var canvas = document.getElementById('canvasScaledImageCanvas');\r\n var img = new Image();\r\n img.src = document...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
=== Filter the object property through the replacer
filter (owner, key, val) { /* Look for the replacement function */ if (val === undefined) return; if (val.toUSON !== undefined) val = val.toUSON.call (val, key); else if (val.toJSON !== undefined) val = val.toJSON.call (val, key); /* Replace the value */ if (this.replacer === null) return val; if (Arra...
[ "function replacer(key, value) {\n // Filtering out properties\n if (typeof value === 'string') {\n var arr = value.split(\" \");\n var str = arr.join(\"---\");\n return str;\n }\n return value;\n }", "function replacer(key, value) {\n // Filtering out properties\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
disables create button if no stations in database
renderCreateButton(){ if(this.state.stations.length === 0){ return <Button type='button' className="btn btn-secondary add-btn add-btn-disabled" onClick={this.toggleAddAlert} disabled>Add</Button> } else{ return <Button type='button' className="btn btn-secondary add-btn" o...
[ "function enableDisableButtonSaveTemplateToServer() {\n if ($(\"#fromExistingTemplate\").prop(\"checked\") || $(\"#templateName\").val()) {\n $(\"#saveTemplateToServer\").prop(\"disabled\", false);\n } else {\n $(\"#saveTemplateToServer\").prop(\"disabled\", true);\n }\n}", "function createNearbyStationL...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
alpha is learning rate temp[i] = theta[i] alpha d_J/d_theta[i] where d_J/d_x are the partials
function regressStep(J, theta, alpha) { var temp = []; // vector }
[ "calculateAlpha() {\n this.alpha_decay = Math.exp(-1/this.decay_);\n this.alpha_release =Math.exp(-1/this.release_);\n }", "beta(previous)\n {\n var DNI = this.ni-previous.ni; \n var DI = this.i - previous.i;\n return (DI + DNI) \n / \n (\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
respawns a new ball with random
function spawn() { // reset ball position x = width*0.5; y = height*0.5; rot = 0; // choose random angle & speed let angle = Math.random() * 2 * Math.PI; let speed = 200 + Math.random() * 1000; // set initial speed dx = speed * Math.sin(angle); dy = speed * Math.cos(angle); ...
[ "function spawn() {\n // reset ball position\n x = width*0.5;\n y = height*0.7;\n rot = 0;\n\n // choose new mass\n mass = 1 + Math.random()*30;\n\n // set initial speed\n dx = 300 * Math.sin(-45 / 180*Math.PI);\n dy = 300 * Math.cos(-45 / 180*Math.PI);\n\n // apply some rotation\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Define a function for creating a "port" that is normally transparent. The "name" is used as the GraphObject.portId, the "align" is used to determine where to position the port relative to the body of the node, the "spot" is used to control how links connect with the port and whether the port stretches along the side of...
function makePort(name, align, spot, output, input) { var horizontal = align.equals(go.Spot.Top) || align.equals(go.Spot.Bottom); // the port is basically just a transparent rectangle that stretches along the side of the node, // and becomes colored when the m...
[ "function makePort(name, align, spot, output, input) {\n var horizontal = align.equals(go.Spot.Top) || align.equals(go.Spot.Bottom);\n // the port is basically just a transparent rectangle that stretches along the side of the node,\n // and becomes colored when the mouse passes over...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
clears the error and restores the errortext.
clearError() { this.error = false; this._errortext = this.__initalErrorText; }
[ "clearError(){this.error=!1;this._errortext=this.__initalErrorText}", "function clearError() {\n setError('');\n }", "function clearError() {\n _sentCommand = \"\";\n _errorMessage = \"\";\n }", "function clearError() {\n return setError('');\n }", "function resetError() {\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transform equatorial into any coordinates, radians
function transform(c, euler) { var x, y, z, β, γ, λ, φ, dψ, ψ, θ, ε = 1.0e-5; if (!euler) return c; λ = c[0]; // celestial longitude 0..2pi if (λ < 0) λ += τ; φ = c[1]; // celestial latitude -pi/2..pi/2 λ -= euler[0]; // celestial longitude - celestial coordinates of the native pole β = e...
[ "getEquatorial() {\n let eq = new Coord();\n eq.y= asin(sin(this.y)*cos(eps) + cos(this.y)*sin(eps)*sin(this.x) ); \n let sinRA = (cos(this.y)*cos(eps)*sin(this.x)-sin(this.y)*sin(eps))/cos(eq.y);\n let cosRA = (cos(this.x)*cos(this.y))/cos(eq.y);\n eq.x = atan2(sinRA,cosRA);\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns true if specified move to target is legal
function isLegalMove(target) { if (!active) { return false; } var squareType = grid.getEnvOnlyInfo(target.z, target.x); var validSquares = [ componentType.land, componentType.grass, componentType.water, co...
[ "function isLegalMove(target)\n {\n if (!active)\n {\n return false;\n }\n var actor = grid.getActor(target); // actor at current target\n if (actor != null && actor != componentType.duck &&\n actor != componentType.duckling && actor != componentType.egg)\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method to set previous available option from time boundary options.
setPreviousDuration() { let activeDuration = this.state.display ? this.state.display : this.props.days.display; const index = TIME_BOUNDARY_OPTIONS.findIndex(option => option.display == activeDuration); const previousOptionIndex = index - 1; const previousOption = TIME_BOUNDARY_OPTIONS[previousOptionInd...
[ "setPrevious (format, timestr, options) {\n\t\tlet oldTime = this.getUnixTime();\n\t\tthis.setCurrent(format, timestr, options);\n\t\tif (this.getUnixTime() > oldTime) {\n\t\t\t// we have pushed the time to the future so we have to move it back\n\t\t\tlet longest = time.nextLongestToken(format);\n\t\t\tswitch (long...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Invoked when a Note button was received specifying that the device has entered the note layout.
didSwitchToNoteLayout() { this.controllerState.viewMode = ViewMode.note; this.didSwitchLayout(); }
[ "function handleNoteButtonEvent(thisObj) {\n _changed = true;\n if ($(thisObj.getHtmlIds().noteContainer).visible()) {\n if (thisObj.getStandardValue() == thisObj.getMeta().seeNoteCui) {\n thisObj.clearNote();\n }\n else {\n thisObj.hideNote();\n }\n }\n else {\n t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add route `el` with `parent`
function addRoute(el, parent) { validate(el); var type = el.type; var attributes = el.attributes; var children = el.children; var component = attributes.component; if (type.name == 'Redirect') { var path = (0, _normalizePath2.default)(join(attributes.from, parent)); var to...
[ "function addLayoutToRoute( route, parentLayout = \"default\" )\n{\n\troute.meta = route.meta || {} ;\n\troute.meta.layout = route.layout || parentLayout ;\n\t\n\tif( route.children )\n\t{\n\t\troute.children = route.children.map( ( childRoute ) => addLayoutToRoute( childRoute, route.meta.layout ) ) ;\n\t}\n\tretur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function erases all characterized images produced by the IPA
function eraseLocalImages(){ var characterizedImagesPath = appDataPath + "\\characterized-images"; var relativeImageFilePaths = jetpack.find(characterizedImagesPath, {files: true, matching: "*.png" } ); //Erase images one by one relativeImageFilePaths.forEach( (path) =>{ jetpack.remove(path); }); }
[ "function image_clear() {\n for (var i = 0; i < this.size * this.size; i++) {\n this.buffer[i] = 0.0;\n }\n return;\n}", "removeAllImagePreviews() {\n store.state.file = null;\n let forms = document.querySelectorAll('form');\n forms.forEach(item => {\n item.reset();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
called by IX when an agent is deleted
function agentDelete ( req, res, next ) { var handle = req.request['request.a2p3.org'].handle db.deleteAgentFromHandle( 'setup', handle, function (e) { if (e) return next( e ) return res.send({ result: { success: true } } ) }) }
[ "function agentDelete ( req, res, next ) {\n var handle = req.request['request.a2p3.org'].handle\n db.deleteAgentFromHandle( 'as', handle, function ( e ) {\n if (e) return next( e )\n return res.send( { result: { success: true } } )\n })\n}", "function deleteTransAgent(trans_agent_id) {\n\tjQuery.getJSON...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets splitted table widget.
getSplittedWidgetForTable(bottom, tableCollection, tableWidget) { let rowBottom = tableWidget.y; let splittedWidget = undefined; for (let i = 0; i < tableWidget.childWidgets.length; i++) { let rowWidget = undefined; let childWidget = tableWidget.childWidgets[i]; ...
[ "getTableWidget(cursorPoint) {\n let widget = undefined;\n let currentPage = this.owner.viewer.currentPage;\n if (!isNullOrUndefined(currentPage)) {\n for (let i = 0; i < currentPage.bodyWidgets.length; i++) {\n let bodyWidget = currentPage.bodyWidgets[i];\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Toggles the "No results" view. Called in the loadPage() function if no data available
toggleNoResults() { let max_columns = this.column_name_array.length+1; if (this.total_items === 0) { getComponentElementById(this,"DataTableBody").html('<tr id="#'+this.getUid()+'_DataTableLoading"><td' + ' colspan="'+max_columns+'"' + ' style="text-align: center;">No results</td></tr>'); getComponent...
[ "function ifNoResults() {\n $searchResultDiv.append(\"<p class='notFound'>No movie or series found!</p>\");\n $(\"#previous, #next\").addClass(\"hideButton\").prop(\"disabled\", true);\n $(\"#numberOfPage\").addClass(\"hideButton\");\n }", "function noResults (flag) {\n /* flag to identif...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Request all log lines Executed whilst the job is running
requestLatestJobLog() { this.state.scrollToEndOnNext = true; this.ui.showElement('spinner'); this.state.awaitingLog = true; this.bus.emit(jcm.MESSAGE_TYPE.LOGS, { [jcm.PARAM.JOB_ID]: this.jobId, latest: true, }); }
[ "requestJobLog() {\n this.ui.showElement('spinner');\n this.state.awaitingLog = true;\n const requestParams = {\n [jcm.PARAM.JOB_ID]: this.jobId,\n };\n const lastLine = this.model.getItem('lastLine');\n if ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given the current step, the client number, and the label, write it to the screen; splitting newlines if necessary.
function draw_label(step, c, label) { var t = svg.append('text') .attr('x', get_text_x(step)) .attr('y', get_text_y(c)) .attr('font-family', 'sans-serif') .attr('font-size', '18') .attr('id', 't'+get_text_x(step)+'label'+get_text_y(c)) .attr('text-anchor', 'middle'); for (i in label.split('\n')) { t.app...
[ "async writeLabel(label) {\n await this.writeLine(`label ${label}` + os.EOL);\n }", "function createDivForStep(step) {\n var divElement = document.createElement(\"div\");\n divElement.className = \"row\";\n divElement.innerHTML = \"Step \" + step.toString() + \": \";\n divElement.id = step.t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION: add_null_members() PURPOSE: Javascript supports writing past the end of an array and fills in the blank spaces w/ null entries this behavior must be mimicked in the CRDT
function add_null_members(me, parent) { for (var i = 0; i < parent.V.length; i++) { if (ZH.IsUndefined(parent.V[i]) || parent.V[i] === null) { parent.V[i] = ZConv.JsonElementToCrdt("X", parent.V[i], me.$._meta, true); } } }
[ "function myFunction() {\n\tfor(i=0; i<namMember.length; i++){\n\t\tif(namMember.some(checkNull)){\n\t\t\tvar x = namMember.indexOf(null);\n\t\t\tnamMember.splice(x,1);\n\t\t\ti--;\n\t\t}\n\t}\n\tnullArray = [];\n}", "function nullExpand(yVals, nullIdxs, alignedLen) {\n\tfor (let i = 0, xi, lastNullIdx = -1; i < ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
resetElementHeight Required variables: e = selector value to find and set to the same height This function finds every element that matches the passed selector string, and sets its height to auto. This is generally used in conjunction with setSameElementHeight() to revert heights back for mobile
function resetElementHeight(e) { $(e).each(function() { $(this).css('height','auto'); }); }
[ "function resetHeight($elements) {\n for( var i = 0; i < $elements.length; i++ ) {\n $elements[i].style.height = 'auto';\n }\n }", "function setSameElementHeight(e) {\n\tvar tallest = 0;\n\t$(e).each(function() {\n\t\t$(this).css('height','auto'); // reset height in case an empty div h...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update the URL based on current UserPreferences The placeId preference is set when there's a selected location and not when there's not, so loading a URL with that param will cause the selected location to be reselected.
function updateUrl() { urlRouter.updateUrl(urlRouter.buildExploreUrlFromPrefs()); }
[ "function setPrefsFromUrl() {\n var params = Utils.getUrlParams();\n if (params.destination) {\n UserPreferences.setPreference('method', 'directions');\n setPrefs(DIRECTIONS_ENCODE, params);\n } else if (params.origin) {\n UserPreferences.setPreference('method',...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
data is generic state of taking input char
function data(c) { // 3 options // 1. is a tag // 2. EOF // 3. text node like <a> abcd(text here) </a> if(c == "<"){ // tag opens < return tagOpen; } else if (c == EOF) { emit({ type: 'EOF' }); return ; } else { emit({ ...
[ "function newCharFromServer(data)\n{\n newChar(data,false)\n}", "function CharacterDataImpl(data) {\n var _this = _super.call(this) || this;\n _this._data = data;\n return _this;\n }", "function createCharacterData(data) {\n var results = (data !== undefined) ? new String(data) : new S...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts an xdr.MuxedAccount into its true "M..." string representation.
function _encodeMuxedAccountFullyToAddress(muxedAccount) { if (muxedAccount["switch"]() === src_xdr.CryptoKeyType.keyTypeEd25519()) { return encodeMuxedAccountToAddress(muxedAccount); } var muxed = muxedAccount.med25519(); return StrKey.encodeMed25519PublicKey(decode_encode_muxed_account_Buffer.concat([muxe...
[ "function _encodeMuxedAccountFullyToAddress(muxedAccount) {\n if (muxedAccount[\"switch\"]() === _xdr[\"default\"].CryptoKeyType.keyTypeEd25519()) {\n return encodeMuxedAccountToAddress(muxedAccount);\n }\n var muxed = muxedAccount.med25519();\n return _strkey.StrKey.encodeMed25519PublicKey(Buffer.concat([mu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[SVGTitleElement] getElementTitle([String] elemID) Returns the element title object
function getElementTitleObj(elemID) { var elem = svgDocument.getElementById(elemID); if(elem == null) return null; for(var i = 0; i < elem.childNodes.length; i++) { if(elem.childNodes[i] == '[object SVGTitleElement]') return elem.childNodes[i]; } re...
[ "function getElementTitle(elemID)\n{\n var elem = getElementTitleObj(elemID);\n \n if(elem != null)\n return elem.firstChild.nodeValue;\n \n return null;\n}", "function addElementTitle(elemID, title)\n{\n var titleObj = getElementTitleObj(elemID);\n \n if(titleObj != null)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When a user first logins in, update the navbar to reflect that.
function updateNavOnLogin() { console.debug('updateNavOnLogin'); $('.main-nav-links').show(); $navLogin.hide(); $navLogOut.show(); $navUserProfile.text(`${currentUser.username}`).show(); }
[ "function updateNavOnLogin() {\n console.debug(\"updateNavOnLogin\");\n $navMainLinks.show();\n $navLogin.hide();\n $navLogOut.show();\n $navUserProfile.text(`${currentUser.username}`).show();\n}", "function updateNavOnLogin() {\n\tconsole.debug('updateNavOnLogin');\n\t$('.main-nav-links').show();\n\t$navLog...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unfortunately this needs to be hardcoded for the time being. If we don't have this, we don't have the reference from the meta name to the custom var name and slot id.
function getAnalyticsCustomVars() { var customVars = { 'nid' : { 'name' : 'nid', 'slot' : 8, 'scope_id' : 3 }, 'pop' : { 'name' : 'pop', 'slot' : 9, 'scope_id' : 3 }, 'author' : { 'name' : 'author', 'slot' : 11, 's...
[ "get name() {\n return this.getAttribute(params.SLOT_NAME_ATTR) || 'default';\n }", "function slot_x(slot) { return slot[0] }", "slot$(name,ctx){\n\t\tvar $__slots;\n\t\t\n\t\tif (name == '__' && !(this.render)) {\n\t\t\t\n\t\t\treturn this;\n\t\t}\t\t\n\t\treturn ($__slots = this.__slots)[nam...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get the current component
getCurrentComponent(){ return this.currentComponent; }
[ "get currentWidget() {\n return this._currentWidget;\n }", "get currentWidget() {\n return this._tracker.currentWidget;\n }", "get componentInstance() {\n if (this._contentRef && this._contentRef.componentRef) {\n return this._contentRef.componentRef.instance;\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update an existing Item in an index corresponding to the Collection
async function updateItem(item) { const client = await _client() const exists = await client.indices.exists({ index: item.collection }) if (!exists.body) { return new Error(`Index ${item.collection} does not exist, add before creating items`) } const now = new Date().toISOString() const created = (awa...
[ "function update(item) {\n es.update({\n index: index,\n type: type,\n id: item.id,\n body: {\n doc: {\n name: item.name\n }\n }\n }, function(err) {\n if (err) {\n return debug(err);\n }\n debug('update item (id: %s) in index', item.id);\n });\n}", "function updat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
find the selected note from the Db
function findNote(id, callback) { db.findOne({_id: id}, function (err, docs) { console.log(`retrieve note with id: ${id} from db`); callback(err, docs); }); }
[ "static searchNote(noteToSave, allNotes) { \r\n const foundNote = allNotes.find(note => note.id == noteToSave.id)\r\n\r\n return foundNote\r\n }", "function retrieveNote(noteId, updateNoteDetailPageCallback) {\n DB.transaction(selectNote, selectError);\n\n function selectNote(tx) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert metadata into an `Expression` in the given `OutputContext`. This operation will handle arrays, references to symbols, or literal `null` or `undefined`.
function convertMetaToOutput(meta, ctx) { if (Array.isArray(meta)) { return literalArr(meta.map(function (entry) { return convertMetaToOutput(entry, ctx); })); } if (meta instanceof StaticSymbol) { return ctx.importExpr(meta); } if (meta == null) { ...
[ "function convertMetaToOutput(meta,ctx){if(Array.isArray(meta)){return literalArr(meta.map(function(entry){return convertMetaToOutput(entry,ctx);}));}if(meta instanceof StaticSymbol){return ctx.importExpr(meta);}if(meta==null){return literal(meta);}throw new Error(\"Internal error: Unsupported or unknown metadata: ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if this node should be displayed, used e.g. for the searchfilter
function shouldRenderNode(curNode, stringToSearchFor) { if (!isValidSearchActive(stringToSearchFor)){ return true; } return nodeOrChildrenMatchSearch(curNode, stringToSearchFor); }
[ "function navigationNodesShouldBeShown(){\n\tif(!DISABLE_NAVIGATION_CONTROLS){\n\t\treturn true;\n\t}\treturn false;\n}", "function checkNodeDisplay(node, currentFilters) {\n var flag = false;\n\n for (var i = 0; i < node.dependances.length && flag == false; i++) {\n if (currentFilters.includes(node....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if icon is selected
function isIconSelected(icons, icon) { // Check if provider and prefix exist if (icons[icon.provider] === void 0) { return false; } const provider = icons[icon.provider]; if (provider[icon.prefix] === void 0) { return false; } // Check name and aliases const lis...
[ "function selectIcon(icon) {\n\n if (allowInput)\n {\n selectedIcon = icon;\n selectedIconStartPos.x = icon.posX;\n selectedIconStartPos.y = icon.posY;\n }\n\n}", "preselectIcons() {\n get(this, 'icons').forEach((icon, index) => set(icon, 'isSelected', index < 12));\n }", "isIc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Open URL and get suggestion from it. eslintdisablenextline nounusedvars
function openUrl(newURL, getSuggestion) { // console.log('creating new tab: ' + newURL); chrome.tabs.create({ url: newURL, active: false }, function(tab) { // console.log('tab created: ' + newURL); store.commit(types.SET_CUR_SUGGESTION_TAB_ID, { tabId: tab.id, }); }); }
[ "get suggestionURL() { return namespace(this).suggestionURL; }", "function request() {\n window.open(\"https://inside.dell.com/community/active/assistive-technology/pages/technology-suggestion\");\n}", "function openURL(input, currentTab){\n if (input == undefined){\n // set default destination as google...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set rating based on current mismatches. Rating won't go below one star.
function setRating() { // make sure rating doesn't go below 1 star if (mismatches > 7) return; // decrease rating every 3 mismatches if ( (mismatches % 3) === 0 ) { rating--; ratingLabel.removeChild(ratingLabel.lastElementChild); } }
[ "set rating(r) {\n if (r < 6 && r > 0 && Number.isInteger(r)) {\n this._rating = r;\n }\n else {\n console.log('Rating must be an integer between 1 and 5')\n }\n }", "function updateRating(difference) {\n var newRating = gCurrBook.rating + difference;\n if (newRating >= 0 && newRating...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the authorization headers for a xhr request
function setAuthHeaders(xhr) { var timeStamp = toISOString(new Date()); var signatureHash = CryptoJS.HmacSHA1(timeStamp, sessionData.auth.secret).toString(); xhr.setRequestHeader('x-authtoken', sessionData.auth.authtoken); xhr.setRequestHeader('x-signature', signatureHash); xhr.setRequestHeader('x-request-ti...
[ "function setHeader(xhr){\n xhr.setRequestHeader('Authorization', 'Bearer ' + salesforce_sid);\n }", "function setAuthHeader(xhr, username, password) {\n var authorization = 'Basic ' + btoa(username + ':' + password);\n xhr.setRequestHeader('Authorization', authorization);\n }", "_setAu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Splits the Code words
splitCodeWord(ds, blk, count) { let ds1 = []; for (let i = 0; i < count; i++) { ds1.push(ds[blk][i]); } return ds1; }
[ "function tokenize(code)\n{\n var s1 = code.replace(/\\(/g, \" ( \").replace(/\\)/g, \" ) \")\n var s2 = s1.trim();\n var out = s2.split(/\\ +/);\n return out\n}", "function split(code){\n var i, j;\n var segment = [];\n for(i = 0; i < code.length/252; i++){\n\tsegment[i] = [];\n\tfor(j = 0; ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Callback function for Yahoo API
function cbfunc(yqlResult) { var count = yqlResult.query.count; if (count > 0) { enableStreaming = false; var quotes = yqlResult.query.results.quote; quotes.reverse(); convertYahooResults(quotes); stxx.newChart($$("symbol").value, quotes); } }
[ "function getYahooAjax(url, callback) {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4 && xhr.status === 200) {\n try {\n var data = JSON.parse(xhr.responseText);\n } catch(err) {\n console.log(err...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this just generates one string from an array of links
function getLinkStringFromArray(linkArray) { var abilityLink = ""; if (linkArray.length > 0) { for (var i = 0; i < linkArray.length; i++) { abilityLink = abilityLink + "\n"+gGMTell + linkArray[i]; } } return abilityLink; }
[ "function concatLinks(links) {\r\n\tvar str=\"\"; // string of links\r\n\t\r\n\tfor (var i=0; i<links.length; i++) {\r\n\t\tif (i==0) {\r\n\t\t\tstr=links[i];\r\n\t\t}\r\n\t\telse {\r\n\t\t\tstr += '\\n' + links[i];\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn str;\r\n}", "function toUrlVar(array) {\n\tvar output = \"\";\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
formula_print_aux pushes all printable strings to a list printlst and increases the length of printlen correspondingly. These side effects are the only effects: no result returned. Takes: data a formula like ["&",["&",[">","a",20],"a"],["",20]] origvars array containing for all vars in the frm the original var, like [n...
function formula_print_aux(data,origvars,depth) { var tmp,nr,s,op,i; tmp=typeof data; if (!data) return; // first check if data is a literal if (tmp==="number") { nr=data; if (data<0) { printlst.push("-"); printlen++; nr=0-data; } tmp=origvars[nr]; if (tmp) { nr=t...
[ "function formula_print_aux(data,origvars,depth) {\r\n var tmp,nr,s,op,i;\r\n tmp=typeof data;\r\n if (!data) return;\r\n // first check if data is a literal\r\n if (tmp===\"number\") {\r\n nr=data;\r\n if (data<0) {\r\n printlst.push(\"-\");\r\n printlen++;\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Pass through admin. Add chatID parameter that fetch_messages chatID passed it.
fetchMessages(username, chatId){ this.sendMessage({ command: 'fetch_messages', username: username, chatId: chatId }); console.log(chatId); console.log(username); }
[ "setChatID(chatID) {\n \t\tconsole.log('useAction: Chat id is being set to ', chatID);\n \t\tdispatch({type : constants.SET_CHAT_ID, value : chatID})\n \t}", "getChatId() {\n return this.chat_id;\n }", "setChatId(aChatId) {\n this.chat_id = aChatId;\n }", "function prepUpdateChat() {\n console.l...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function that decrease the element hours
function decreaseHours() { const elementHours = document.getElementById("hours"); if (numHours > 0) { numHours--; } else { numHours = 99; } elementHours.innerHTML = numHours.toString().padStart(2, "0"); }
[ "function DayHoursSubtractHour() {\r\n if ((this.currentHour - 1) < 1) {\r\n this.currentHour = 12\r\n } else {\r\n this.currentHour--;\r\n }\r\n}", "function dec_timer_hour()\r\n{\r\n\ttimer_hour--;\r\n}", "function substractHour()\n{\n\tvar prevval = $('.hourentry').html();\n\n\t/* Convert string tim...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
root mean square (RMS) a mean function used as a measure of the magnitude of a set of numbers, regardless of their sign this is the square root of the mean of the squares of the input numbers This runs on `O(n)`, linear time in respect to the array
function root_mean_square(x) { if (x.length === 0) return null; var sum_of_squares = 0; for (var i = 0; i < x.length; i++) { sum_of_squares += Math.pow(x[i], 2); } return Math.sqrt(sum_of_squares / x.length); }
[ "function rms(arr) {\n // Return Root Mean Square of numbers in the given array.\n const sumSquares = arr.reduce((sum, num) => sum + num * num, 0);\n return Math.sqrt(sumSquares / arr.length);\n}", "function root_mean_square(x) {\n\t if (x.length === 0) return null;\n\n\t var sum_of_squares...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Valida um barcode de 48 digitos, concessionaria
function validateBarCode48(barcode) { if (barcode != null) { barcode = barcode.replace(/\D/g,""); //console.log('Barcode: ' + barcode); if (barcode.length == 48) { var reference = barcode.substring(2,3); //console.log('Reference: ' + reference); var cam...
[ "function validateBarCode47(barcode) {\n\n if (barcode != null) {\n\tbarcode = barcode.replace(/\\D/g,\"\");\n\n\tif (barcode.length == 47) {\n\n\t var campo1 = barcode.substring(0,9);\n\t //console.log('Campo 1: ' + campo1 + ' ' + modulo10(campo1));\n\t var campo2 = barcode.substring(10,20);\n\t //c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Controller that renders a list of events in HTML.
function listEvents(request, response) { var currentTime = new Date(); var contextData = { 'events': events.all, 'time': currentTime }; response.render('event.html', contextData); }
[ "function listEvents(request, response) {\n var currentTime = new Date();\n var contextData = {\n 'events': events.all,\n 'cur_time': currentTime\n };\n response.render('event.html', contextData);\n}", "function renderEvents() {\n\t$(\"#event-items\").html(\"\");\n\n\tif (show_events) {\n\t\tvar i = 0;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the AWS CloudFormation properties of an `AWS::WAFv2::WebACL.VisibilityConfig` resource
function cfnWebACLVisibilityConfigPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnWebACL_VisibilityConfigPropertyValidator(properties).assertSuccess(); return { CloudWatchMetricsEnabled: cdk.booleanToCloudFormation(properties.cloudWatchMe...
[ "function CfnWebACL_VisibilityConfigPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
f(n) = f(n1) + born(n2,n3...n6) f(n9)
function born(n) { const f = [0, 0, 0, 1, 1, 2, 3, 5]; if (n <= 7) { return f[n]; } return born(n - 2) + born(n - 3) + born(n - 4) + born(n - 5) + born(n - 6) }
[ "function fibonacci_series(n)\r\n{\r\n\tvar f1=0,f2=1,f3;\r\n\tconsole.log(f1 + \" \");\r\n\tconsole.log(f2 + \" \");\r\n\tfor(var i=3;i<=n;i++)\r\n\t{\r\n\t\tf3=f1+f2;\r\n\t\tconsole.log(f3 + \" \");\r\n\t\tf1=f2;\r\n\t\tf2=f3;\r\n\t\t\r\n\t}\r\n}", "function fibon(n) {\n if (n <= 1) {\n return 1;\n }\n re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
elem, chartData, datalen, sGraphTitle, type, maxval, colorNum
function createSingleChart(elem, data, datalen, title, type, maxVal, color) { var chart = new AmCharts.AmStockChart(); chart["export"] = { "enabled": true }; var categoryAxesSettings = new AmCharts.CategoryAxesSettings(); categoryAxesSettings.minPeriod = "ss"; chart.categoryAxesSettings = categoryAx...
[ "function visualizeData(data) {\n\n}", "function buildDatasetB() {\nvar d = [0,0,0];\n\nreturn [\n {value: d[0], init:0, index: .712, text: pText(d[0]), type:\"b\", count: 1},\n {value: d[1], init:0, index: .512, text: pText(d[1]), type:\"b\", count: 3},\n {value: d[2], init:0, index: .312, text: pTex...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add menu to launch the tests
function onOpen() { SpreadsheetApp.getUi() .createMenu('Test FormulaConverter') .addItem('Run tests', 'tests') .addToUi(); }
[ "function setupMenus() {\n if (!Menu.menuExists(\"QA Test\")) {\n Menu.addMenu(\"QA Test\");\n Menu.addMenu(\"QA Test > Non-Smoke Test\");\n menuParameters(\"QA Test > Non-Smoke Test\", \"Non-Smoke Test QA Pass - SUCCESS\");\n menuParameters(\"QA Test > Non-Smoke Test\", \"Generate Non-Smoke Test [CUT ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
creates a dom item for the save movies div
setDomItem(movieDataforDb) { //create elements out of movies propertys var mainContainer = document.createElement("div") var title = document.createElement("div"); var id = document.createElement("div"); var offeringSubbed = document.createElement("div"); var offeringDub...
[ "function saveMovieToList() {\n let addMovSect = document.querySelector(\"#addMovieSec\");\n // Get input fields values\n let fName = document.querySelector(\"#movName\").value;\n let fMovUrl = document.querySelector(\"#movUrl\").value;\n let fPostUrl = document.querySelector(\"#postUrl\").value;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
longitude to metres "A degree of longitude at the equator is 111.2km... For other latitudes, multiply by cos(lat)" assumes the earth is a sphere but good enough for our purposes
function lonToMetres (lon,lat) { return lon * 111200 * Math.cos(lat * (Math.PI/180)); }
[ "function latDeg2M(lat){\n var a = 6378137; // equitorial radius, semi-major axis\n var e = 0.081819190842622; // first eccentricity\n return Math.pi * a * (1 - Math.pow(e,2)) /\n (180 * Math.sqrt(Math.pow((1 - Math.pow(e,2) * \n Math.pow(Math.sin(lat * Math.pi / 18...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
void Encode (string, X500NameFlags)
Encode(string, X500NameFlags) { }
[ "static pack(person, encode) {\n return encode(person.name);\n }", "function myEncodeURIComponent(name) {\n if (name) switch (name) {\n case \".\": return(\"%2E\");\n case \"..\": return(\"%2E%2E\");\n default: return(encodeURIComponent(name));\n }\n }", "function encodeToInternalField...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update PC by 3 if no jump occurs Opcode 5: update PC to value of param2 if param1 != 0 Opcode 6: update PC to value of param2 if param1 == 0
doConditionalJump(condition) { const modes = this.getMode() const mode_1 = this.getDigitFromRight(modes, 1) const mode_2 = this.getDigitFromRight(modes, 2) const param_1 = this.program[this.PC+1] const param_2 = this.program[this.PC+2] const value_1 = this.getValue(mode_1...
[ "function JMP(val) {\n PC = val - 1;\n}", "function JMP(operand){\n\t// Store PC value in memory cell 99\n\tdocument.Memory[\"M99\"].value = \" 0\" + document.CPU.PC.value;\n\t// Set PC to operand\n\tdocument.CPU.PC.value = operand;\n\treturn 0;\n}", "function jmpToV0Plusnnn(opcode) {\n\tvar op = \"0xb000\";...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
graph for user clicks
function showUserClicks() { var data = cached.userClicks; var total = cached.totalClicks; if (document.getElementById("graph")) { document.getElementById("graph").innerHTML = ''; document.getElementById("info").innerHTML = "Total clicks: " + total; var plot = $.jqplot('graph', [data], { axes: {...
[ "function tapPressed(){\n \n graphStart=true; //used to begin graph\n\n if(tapOn===false){\n tapOn=true;\n }\n\n else{\n tapOn=false;\n }\n}", "function mouseClicked() {\n\ts.addVertex(mouseX, mouseY);\n}", "function clickMetrics() { \n\t$(document).click(function(loc) {\n\t\tvar x = loc.pag...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the current artist uri of the specified Hypem player
function getArtistUri(playerId){ return mPlayers[playerId].artistUri; }
[ "function getArtist(playerId){\n\t\treturn mPlayers[playerId].artist;\n\t}", "getPlayingArtistName () {\n return document.querySelector('#page_player > div > div.player-track > div > div.track-heading > div.track-title > div > div > div > a:nth-child(2)').innerText\n }", "function LFM_TRACK_ARTIST() {\n\tif...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function will retrieve the MouseMoveBehaviour, inject the userId, and then print it out. Best way to use it is: mongo localhost/testdb eval "load('ExtractUserMouseMoveBehaviour.js');printMouseMoveStatistics();" > mouseMoveStatistics.json
function printMouseMoveStatistics(){ //////We need to load the constants file load("../MapReduceConstants.js"); /*OLD connection system * var db = connect(mongoPath); db.auth(mongoUser,mongoPass);*/ db = connectAndValidate(); var userBehaviourList = db.mouseMoveBehaviour.find().toArray(); print("["); for...
[ "function printMouseStatistics(){\n\t\n\t//////We need to load the constants file\n\tload(\"../MapReduceConstants.js\");\n\t\n\tvar db = connect(mongoPath);\n\tdb.auth(mongoUser,mongoPass);\n\n\n\tvar userBehaviourList = db.mouseBehaviour.find().toArray();\n\t\n\tprint(\"[\");\n\tfor (var i = 0; i < userBehaviourLi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
4.Sum all digits of a number having 3 digits
function sumDigits(n){ if (n.toString().length !== 3) return -1; const ones = n % 10; const tens = Math.trunc(n / 10) % 10; const hundreds = Math.trunc(n / 100); return ones + tens + hundreds; }
[ "function getSumOf3Digits (firstNum, secondNum, thirdNum) {\r\n return Number(firstNum) + Number(secondNum) + Number(thirdNum);\r\n}", "function digitSumThreeNine(inputNumber) { \n if(inputNumber==0 ||inputNumber==3) {\n return checkIfLastDigitIsFive(inputNumber);\n }\n else {\n const di...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the component instance associated with view which owns the DOM element (`null` otherwise).
function getViewComponent(element){var context=loadLContext(element);var lView=context.lView;while(lView[PARENT]&&lView[HOST]===null){// As long as lView[HOST] is null we know we are part of sub-template such as `*ngIf` lView=lView[PARENT];}return lView[FLAGS]&128/* IsRoot */?null:lView[CONTEXT];}
[ "get componentInstance() {\n const nativeElement = this.nativeNode;\n return nativeElement && (getComponent$1(nativeElement) || getOwningComponent(nativeElement));\n }", "get componentInstance() {\n const nativeElement = this.nativeNode;\n return nativeElement && (getComponent(nativeElement) || getOw...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
initialiseShellAwareness() Initialises shell events and performance manager
function initialiseShellAwareness() { updateBootStatus("org.webshell.shell:initialiseShellAwareness"); watermark.html("WebShell Version " + os.version + "<br>Experimental Copy. Build " + os.build); // Initialise watermark FPSMeter.run(6); // Initialise fps metre, running every 6 seconds document.addEventListene...
[ "function initShell() {\n\n\tupdateBootStatus(\"org.webshell.shell:initShell\");\n\n\tif (!settingUp) { // As long as the shell isn't in setup mode, start regular processes\n\t\tbootLogo.delay(1500).addClass(\"fadeout\"); // Fade out logo\n\t\t$(\".wallpaper,.lockscreen,.modulecontainer,.dwm,.authentication,.openta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this.BackSurfaceDraw = gSceneBackSurfaceDraw; this.FrontSurfaceDraw = gSceneFrontSurfaceDraw;
function game_draw() { /* this.BackSurfaceDraw(); obCtrl.draw(); this.FrontSurfaceDraw(); return; */ // work2.putImageTransform(tex_bg, 0, scroll_y - (480 * (1 - scrollsw)), 1, 0, 0, -1); scenechange = true; if ((scroll_x != dev.gs.world_x) || (scroll_y != dev.gs...
[ "_postDraw() {\r\n // Determine whether or not a press on the object is being isHeld\r\n if (this.isPressed) {\r\n this.isHeld = true;\r\n } \r\n else if (this.isReleased) {\r\n this.isHeld = false;\r\n }\r\n \r\n // These callbacks need to be implemented here because they need \r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
5724 Get the length of the first word in a string. // 5725
function getFirstWordLength( string ) { // 5726 return string.match( /\w+/ )[ 0 ].length // 5727 } ...
[ "function getFirstWordLength( string ) {\n return string.match( /\\w+/ )[ 0 ].length\n }", "function getlength(word) {\r\n return word.length;\r\n\r\n}", "function getlength(word) {\n return word.length;\n}", "function minLength(s) {\n // return s.split(\"CD\");\n\n let currWord = s;\n\n wh...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to switch language from English to Japanese and vice versa
function switchLanguage() { currentLang = (currentLang === 'en') ? 'ja' : 'en'; return currentLang; }
[ "function selectedLanguage(){\n if(languageOnPage === \"en-US\"){\n return English\n } else if(languageOnPage === \"jp\"){\n return Japanese\n }\n }", "function convert_language(ln){\n\tswitch(ln){\n\t\tcase \"FR\":\n\t\treturn \"Français\";\n\t\tcase \"EN\":\n\t\treturn \"Anglais\";\n\t\t}\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ATI: Draw the paddles and initialize them for use for both players.
function initPaddles() { // New paddle being created. gNumPaddlesCreated++; // ATI: Draw the paddle for player 1. drawPaddle(PADDLE_COLOR_PLAYER_1, START_POS_X_PLAYER_1, START_POS_Y_PLAYER_1, gNumPaddlesCreated); // New paddle being created. gNumPaddlesCreated++; // ATI: Draw the paddle f...
[ "function drawPaddles() { \r\n drawRect(0,\r\n\t Math.floor(leftPad*screenModifierY),\r\n\t Math.floor(paddleWidth*screenModifierX), \r\n Math.floor(paddleHeight*screenModifierY), \r\n\t 'rgb(240,240,240)');//xpos, ypos, width, height\r\n \r\n drawRect(Math.floor((gameX-paddleWidt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Variance value Information only For calculating real variance value use analyzer
get variance(): number { if(this.alpha > 2) { return Math.pow(this.xm, 2) * this.alpha / (Math.pow(this.alpha - 1, 2) * (this.alpha - 2)); } return Infinity; }
[ "get variance(): number {\n return Math.pow(this.sigma, 2) * (4 - Math.PI) / 2;\n }", "get variance(): number {\n return 2 * Math.pow(this.scale, 2);\n }", "get variance(): number {\n return Math.pow(this.sigma * Math.PI, 2) / 6;\n }", "variance() {\n return ((this.valueCount ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }