query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Function to return all relevant spell info. Usage: spellInfo(spell type, info type, (optional) spell level) Information (info type) currently provided: =========================================== General (information is not leveldependent) 'creation time' (time to create spell in Spell Factory) 'spell factory' (Spell F...
function spellInfo(strSpell, strInfo, intLevel) { if (!(Array.isArray(spellData))) populateSpellData(); var sSpell = strSpell.toLowerCase(); var sInfo = (arguments.length > 1 ? strInfo.toLowerCase() : ''); if (sSpell == 'list') return spellData['list']; if (sSpell == "santa's surprise") ...
[ "function populateSpellData() {\n spellData = [];\n spellData['list'] = [];\n var i = 0;\n\n spellData['list'].push('Lightning');\n spellData['lightning'] = [];\n spellData['lightning']['creation time'] = 30;\n spellData['lightning']['spell factory'] = 1;\n spellData['lightning']...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
1 Using Reduce Using the varabile persons Create a function called avgAge that accept an array and return average age of this array Ex: avgAge(persons) => 41.2
function avgAge(persons) { var out; out=persons.reduce() return out }
[ "function averageAge(people){\n\tvar average = 0;\n\tfor(var i = 0; i < people.length; i++){\n\t\taverage += people[i].age;\n\t}\n\treturn average / people.length;\n}", "function getSummedAge(people) {\n return people.reduce((sum,i)=>sum+i.age,0);\n}", "function sumAges(arr) {\n}", "function average(){\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the target row after navigating by the given dy offset. Also returns information whether the details cell should be the target on the target row. If the row is not in the viewport, it is first scrolled to.
__navigateRows(dy, activeRow, activeCell) { const currentRowIndex = this.__getIndexInGroup(activeRow, this._focusedItemIndex); const activeRowGroup = activeRow.parentNode; const maxRowIndex = (activeRowGroup === this.$.items ? this._effectiveSize : activeRowGroup.children.length) - 1; // Index ...
[ "function scrollToSelectedRow(gridSelector) {\r\n var gridWrapper = document.querySelector(gridSelector);\r\n if (gridWrapper) {\r\n var selectedRow = gridWrapper.querySelector(\"tr.k-state-selected\");\r\n if (selectedRow) {\r\n selectedRow.scrollIntoView();\r\n }\r\n }\r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
func is intended to be used in zw when clickced All or None. Elements are redrawed, no renderSelection() call needed / \param c assign this boolean value to all zbll of \param oll (true=select all, false=unmark all)
function selectAllZw(oll, coll, c) { var collMap = zbllMap[oll][coll]; for (var zbll in collMap) if (collMap.hasOwnProperty(zbll)) { collMap[zbll]["c"] = c; // change color if (c) document.getElementById( idItemZbll(oll, coll, zbll) ).style.backgroundColor = color...
[ "function changeSelectAll(aobjClicked,astrSelectAll){\n var objSelectAll=document.getElementById(astrSelectAll);\n if(!aobjClicked.checked){\n objSelectAll.checked = false;\n }\n }", "function selectAllCoutryMenuCheckBox(){ \n\tif(document.getElementById('countryMenuSelectAllId'...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Pipes are drawn onto the canvas with fillRect and colored with fillStyle, which will be replaced by actual images at a later time, using drawImage or whatever the method is called, positioned for each pipe.
drawPipes(ctx) { this.eachPipe(function (pipe) { let pipeOffsetTop = pipe.topPipe.bottom - pipe.topPipe.top; let pipeOffsetBottom = pipe.bottomPipe.bottom - pipe.bottomPipe.top; let topPipeRender = new Image(); topPipeRender.src = 'assets/images/top-pipe.png'; ...
[ "function drawPipeline() {\n var housesWidth = document.getElementById('houses').offsetWidth;\n var housesHeight = document.getElementById('houses').offsetHeight;\n\n // Pipeline outline\n outline = stage.rect(stage.getBounds().left, stage.getBounds().top + 50, housesWidth, housesHeight...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate a random number within the bounds of the array of sentences
function randomNumber() { return Math.floor(Math.random() * realSentences.length); }
[ "function genPhrase(){\n let subject = subjectsText[Math.floor(Math.random() * subjectsText.length)];\n let verb = verbsText[Math.floor(Math.random() * verbsText.length)];\n let preposition1 = prepositionsText[Math.floor(Math.random() * prepositionsText.length)];\n let preposition2 = prepositionsText[Math.floor...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a reference to a specific, existing tag document that exists on an archive record, not on an item
tagDocumentDbRef(uid, archiveId, tagId) { return firebase .firestore() .collection("archives") .doc(uid) .collection("userarchives") .doc(archiveId) .collection("tags") .doc(tagId); }
[ "itemDocumentDbRef(uid, archiveId, itemId) {\n return firebase\n .firestore()\n .collection(\"archives\")\n .doc(uid)\n .collection(\"userarchives\")\n .doc(archiveId)\n .collection(\"items\")\n .doc(itemId);\n }", "archiveDocumentDbRef(uid, archiveId) {\n return firebase...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Onclick method for 'Play Again' button Restarts the game by hiding scoreboard/play again buttons, resetting score & slider inputs, enabling 'Got It!' and 'Next!' buttons, and putting random color in swatch
function playAgainClick() { numTurns = settings.numTurns; $('#endOfGame').css('display', 'none'); resetInputs(); document.getElementById('gotItButton').disabled = false; document.getElementById('nextButton').disabled = false; $('#guessedSwatches').html(''); finalScore = 0; score = 0; randomColor(); obj...
[ "function playAgain(){\n document.querySelector('button').setAttribute('id', 'button-hide'); //remove play again button\n resetSelectionState();\n resetGameBoardState();\n addElementListener(document.getElementsByTagName('div')); //reapply board event listeners\n addElementListener(document.getElemen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new promise and exposes its resolver function. Use with care!
function createPromiseWithResolver() { let alreadyResolved = false; let resolvedTo; let resolver = doNothing; const promise = new Promise(resolve => { if (alreadyResolved) { resolve(resolvedTo); } else { resolver = resolve; } }); const expo...
[ "function createPromise() {\n var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var defaultTypes = [ActionType.Pending, ActionType.Fulfilled, ActionType.Rejected];\n var PROMISE_TYPE_SUFFIXES = config.promiseTypeSuffixes || defaultTypes;\n var PROMISE_TYPE_DELIMITER = conf...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Keep tracks of comment changes in commentText.
function onCommentChange(event) { setCommentText(event.target.value); }
[ "function changeComments(text) {\n var editor = ace.edit(\"editor\");\n var pos = editor.getSession().getDocument().indexToPosition(0, 0);\n editor.getSession().getDocument().insert(pos, text);\n}", "set comments(aValue) {\n this._logService.debug(\"gsDiggEvent.comments[set]\");\n this._comments = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
validate if path and method from routes exist in swagger
function doesPathExistInSwagger(swagger: any, path: string, method: string) { //replace :val with {val} let expressToSwaggerPath = convertExpressPathToSwaggerPath(path); let swaggerPath = Object.keys(swagger.paths).filter(swaggerPath => swaggerPath == expressToSwaggerPath); if (swaggerPath && swaggerPath.length...
[ "function updateSwaggerWithMissingRoutes(routeConfig, swagger) {\n routeConfig.hosts.forEach(host => {\n host.routes.forEach(route => {\n let method = route.method ? route.method : 'get';\n let doesPathExist = doesPathExistInSwagger(swagger, route.source, method);\n if (doesPathExist == false) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets context for a content file from a siteContext file Assumes the siteContext has already been fetched
function getFileContext(contentPath){ var contextPath = getContextFilePath(contentPath), parent = ''; try { if (!_.isUndefined(siteContext.files[contextPath])) { return siteContext.files[contextPath].context; } else if (useNearestContext){ //TODO: try to find the nearest matching context up the tree ...
[ "function getDirectoryContext(key){\n\tvar filename = util.getFileName(key),\n\t\t\tcontext = {};\n\ttry {\n\t\tcontext = siteContext.files[key + '/' + filename + '.json'].contents;\n\t\t//grunt.log.ok('found dir context: ' + JSON.stringify(context));\n\t\treturn context;\n\t} catch (error) {\n\t\t//grunt.log.ok('n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sound on game end
function endSound() { winSound.play(); }
[ "function playSoundGameOver() {\n game.sound.play('game_over');\n}", "function playSoundUh() {\n game.sound.play('uh', 2);\n}", "function bombShot() {\n playSound(\"audioBombShot\");\n }", "function groundShot() {\n playSound(\"audioCannonShot\");\n }", "function mixedShot() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
DG5 Codes Data Call back
function ZGW_MAM30_DG5_PIA_CODES_T3Dg5CodeCB(data) { if(data.length>0){ if(syncReferenceDetsUpdated){ localStorage.setItem('LastSyncReferenceDetails',localStorage.getItem('LastSyncReferenceDetails')+', DG5CODES:'+String(data.length)); }else{ localStorage.setItem('LastSync...
[ "function call_hscode(){\n\t\tstrURL = \"hs_code.html\";\n\t\tPopupOpenDialog(850,490);\n\n\t\tif(PopWinValue != null ){\n\t\t\tgcDs2.namevalue(gcDs2.rowposition,\"HSCODE\") = PopWinValue[0]; \n\t\t\tgcDs2.namevalue(gcDs2.rowposition,\"HSCODENM\") = PopWinValue[1]; \n\t\t}\n\t}", "function extractDatabase2(params...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
========================================================= Get Nearest URA Carpark Information =========================================================
function getnearestURACarparkInformation(carparknoinput) { //var geturacarparkfromuser = "K0087"; //var getlatfromuser = 1.332401; //var getlongfromuser = 103.848438; //To get new token everyday var token = "6hf2NfWWja4j12bn3H4z8g62287rha485Fu7ff1F8gVC0R-AbBC-38YT3c856fV3HCZmet2j54+gbCP40u3@Q184c...
[ "function getnearestURACarpark(latinput, longinput)\n{\n var getlatfromuser = latinput;\n var getlongfromuser = longinput;\n\n var token = \"6hf2NfWWja4j12bn3H4z8g62287rha485Fu7ff1F8gVC0R-AbBC-38YT3c856fV3HCZmet2j54+gbCP40u3@Q184ccRQGzcbXefE\";\n var options = {\n url: 'https://www.ura.gov.sg/uraDat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Avec l'initialisation de Dobbertin: state[0] = 0x12ac2375; state[1] = 0x3b341042; state[2] = 0x5f62b97c; state[3] = 0x4ba763ed; s'il y a une collision: begin 644 Message1 M7MH=JO6_>MG!X?!51$)W,CXV!A"=(!AR71,TF$W()/MEHR%C4:G1R:Q"= ` end begin 644 Message2 M7MH=JO6_>MG!X?!51$)W,CXV!A"=(!AR71,TF$W()/MEHREC4:G1R:Q"= ` end
function init() { count[0]=count[1] = 0; state[0] = 0x67452301; state[1] = 0xefcdab89; state[2] = 0x98badcfe; state[3] = 0x10325476; for (i = 0; i < digestBits.length; i++) digestBits[i] = 0; }
[ "function loadState(state) {\n // Clear everything first\n reservePile.hiddenStack.splice(0, reservePile.hiddenLength());\n reservePile.stack.splice(0, reservePile.getLength());\n stacks.forEach(stack => stack.stack.splice(0, stack.getLength()));\n piles.forEach(pile => pile.stack.splice(0, pile.getLength()));...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This modulates pwm with data. Modulation can be chosen from below. 1. "am" am modulation data "1" means put out the pwm with duty ratio of 50%. "0" means stop pwm. io will be 0. Interval defines the symbol baud rate. Duty is fixed at 50%. ![](media://pwm_modu.png) This is useful to generate IR signal (Remote control). ...
modulate(type, symbol_length, data) { if (!this.used) { throw new Error(`pwm${this.id} is not started`); } this.sendWS({ modulate: { type, symbol_length, data, }, }); }
[ "function update() {\n\tvar out;\n\n\tconfig.motors.forEach(function (motor) {\n\t\t// update motor.gpio with value from rawMotorValues[motor.key]\n\t\t// todo: constrain motor output values to range in configuration\n\t\t//out = ((rawMotorValues[motor.position.key] || 1000) - 1000) / 1000;\n\t\t//out = (out < 0 ? ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
throw e wrapped in a GHCJS.Prim.JSException in the current thread
function h$throwJSException(e) { // a GHCJS.Prim.JSException var jsE = h$c2(h$ghcjszmprimZCGHCJSziPrimziJSException_con_e,e,h$toHsString(e.toString())); // wrap it in a SomeException, adding the Exception dictionary var someE = h$c2(h$baseZCGHCziExceptionziSomeException_con_e, h$ghcjszmprimZCGHCJSziPrimziz...
[ "function sendUncaughtException(e) {\n if (window.sendUncaughtException) {\n return sendUncaughtException(e)\n } else if (window.onuncaughtException) {\n return onuncaughtException(e)\n } else {\n throw e\n }\n }", "function raise_exc(exc) {\n throw exc;\n}", "throw( ...args ) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Assign guest a default name and put it in nickNames array
function assignGuestName(socket, guestNumber, nickNames, namesUsed) { var name = 'Guest' + guestNumber; /*default guest name*/ nickNames[socket.id] = name; socket.emit('nameResult', { success:true, name: name, }); namesUsed.push(name); return guestNumber + 1 }
[ "function findGuestMasterUser()\n {\n if (userList.length == 0 || guestMasterUser.length > 0 || giveMasterToUser)\n {\n return;\n }\n \n var index = Math.floor(Math.random() * userList.length);\n var guest = userList[index].name;\n guestMasterUser = gue...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method will return the selected Tab for linked messages and Message page
function getSelectedTab() { // This will handle linked message folder types if (props.selectedTab === enums.MessageFolderType.None) { return props.message.messageFolderType; } else { return props.selectedTab; } }
[ "function getSelectedTab(tabs) {\n const childId = window.location.hash.split(\"=\")[1];\n return tabs.find(tab => tab.get(\"actor\").includes(childId));\n}", "function tabLinks( active ) {\n\tfunction tab( id, label ) {\n\t\treturn T( id == active ? 'tabLinkActive' : 'tabLinkInactive', {\n\t\t\tid: id,\n\t\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
endregion region text coloring calculates the number of characters within the given string that may be colored
function getColorableCount(text) { let colorableCount = 0; for (let i = 0; i < text.length; i++) { if (text[i] == '\u001B') { do { i++; } while (text[i] != 'm'); i++; } colorableCount++; } return colorableCount; }
[ "function charCount(txt){\n return txt.length;\n}", "function getHighlightedTextLen(n){\n var N=-1;\n if(n.createTextRange){\n var fa=document.selection.createRange().duplicate();\n N=fa.text.length;\n }else if(n.setSelectionRange){\n N=n.selectionEnd-n.selectionStart;\n }\n return N;\n}", "fun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates deck HTML using global variables
function updateHTML() { const HTMLDeck = document.querySelector('.deck'); HTMLDeck.innerHTML = ''; const docFrag = document.createDocumentFragment(); cards.forEach(c => docFrag.appendChild(c)); HTMLDeck.appendChild(docFrag); }
[ "function displayDeck(deck, path, htmlElement)\n{\n\t//Clear out the innerHTML\n\thtmlElement.innerHTML = \"\";\n\t\n\t/*\n\t\tLoop through the deck and, through string building, create new <img /> tags inside of htmlElement by concatenating the text onto the innerHTML.\n\t\t\n\t\tTHIS IS NOT AN EFFICIENT WAY TO AD...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
region Lines /Row Completion entity, contains three properties(left, middle and right) and assign default value
function RowCompletion(left, middle, right) { this.left = left ? left : 0; this.middle = middle ? middle : 0; this.right = right ? right : 0; }
[ "function Row(width, height, justifyContent, valign){\n\tSet.call(this);\n\tthis.coordinates=[]; //since we could insert objects that can be shared, so we just need to record their coordinate x, to bring it back to the row when need it (for example a pop up that share labels)\n\tthis.sp=[];//spaces between elements...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ FUNCTION NAME : openConsoleDevice AUTHOR :Juvindle C Tina DATE : March 26, 2014 MODIFIED BY : REVISION DATE : REVISION : DESCRIPTION : open console for specific device PARAMETERS : device
function openConsoleDevice(){ if(glblDevMenImg != undefined && glblDevMenImg != null){ $('#deviceMenuPopUp').dialog('close'); } if(globalInfoType == "JSON"){ devicesArr = getDevicesNodeJSON(); } if(devicesArr.length == 0){ alerts("No devices available in the canvas."); } var myArray = new Array(); if(glbl...
[ "function loadOpenConsole(device,devicesArr){\n\tvar devicesStr = deviceQstr(device); \n \tvar url = getURL('Console') + \"action=sessionIdCreator&query={'MAINCONFIG': [{'UserName': '\"+globalUserName+\"','ResourceId': '\"+globalMAINCONFIG[pageCanvas].MAINCONFIG[0].ResourceId+\"','To': '','DEVICE' : \"+devicesStr +...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Open dialog to add tool to current work request
function addTool(){ var panel = View.panels.get('wo_upd_wr_form'); var wrId = panel.getFieldValue("wr.wr_id"); var rest = new Ab.view.Restriction(); rest.addClause("wrtl.wr_id", wrId, "="); rest.addClause("wrtl.tool_id", '', "="); View.openDialog("ab-helpdesk-workrequest-newtool.axvw", rest, tru...
[ "onSelectTool(toolName, ...params) {\n if (!this.file) return false;\n // look for a given tool\n const tool = this.tools.find((t) => t.name === toolName);\n\n if (tool) {\n this.file.doAction(SetTool, tool, ...params);\n\n // update UI\n EventBus.$emit(\"ui-select-tool\", toolName);\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Merges two binary heaps to form a new heap containing elements of both // and preserves both original heaps
static merge(first, second){ if(!first instanceof BinaryMaxHeap || !second instanceof BinaryMaxHeap){ return null; } let merged = new BinaryMaxHeap(); let arr = []; for(let i = 0; i < first.size(); i++){ arr.push(first.heap[i]); } ...
[ "function inplaceMerge1(a, b){\n var i_a = a.length-1,\n i_b = b.length- 1,\n n = a.length + b.length;\n\n if(a[i_a]<b[0]){\n a.push(b);\n return true;\n }\n\n for(var i=0; i<n; i++){\n if(i_a>=0 && i_b >=0){\n if(a[i_a]>b[i_b]){\n a[n-1-i] = a[i_a--];\n }\n else{\n a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
dshuf shuffles div elements with the class dshuf and common class dshufsetX (X being an integer) taken from Maintainers: [[User:Gmaxwell]], [[User:Dschwen]]
function dshuf(){ var shufsets = {}; var rx = new RegExp('dshuf'+'\\s+(dshufset\\d+)', 'i'); var divs = document.getElementsByTagName("div"); var i = divs.length; while( i-- ) { if( rx.test(divs[i].className) ) { if ( typeof shufsets[RegExp.$1] == "undefined" ) { shufsets[RegExp.$1] = {}; shufs...
[ "function shuffle() {\n var parent = document.querySelector(\"#container\");\n for (var i = 0; i < parent.children.length; i++) {\n parent.appendChild(parent.children[Math.random() * i | 0]);\n }\n}", "shuffleElements() { \n this.deck.shuffle();\n }", "function shuffleCards() {\n // shuffle the...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
2 TAKES GENERATE ENDING VALUE Write a to function that takes a generator and an end value, and returns a generator that will produce numbers up to that limit.
function to(gen, end) { return function() { var value = gen(); if (value < end) { return value; } return undefined; } }
[ "function evaluate_generator(gen) {\r\n let next = gen.next();\r\n while (!next.done) {\r\n next = gen.next(); \r\n }\r\n return next.value;\r\n }", "runGenerator (it, callback = (lastVal) => {}) {\n it = util....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
broadcast a user's updated information to server viewers
function ServerViewerBroadcastUserUpdate(ws) { var returnMessage = {} returnMessage["type"] = "user-update"; returnMessage["data"] = {}; returnMessage.data["user-id"] = ws.userId; returnMessage.data["user-name"] = ws.userName; returnMessage.data["lobby-id"] = ws.lobbyId; returnMessage.data["gamemode"] = w...
[ "function ServerViewerBroadcastLobbyUpdate(lobbyId, status) {\n // currently the lobby updates are sent to all users //\n\n var returnMessage = {}\n returnMessage[\"type\"] = \"lobby-update\";\n returnMessage[\"data\"] = {};\n returnMessage.data[\"lobby-id\"] = lobbyId\n returnMessage.data[\"status\"] = statu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getAllNamesShorterThan: Given an array of names and a value, return an array of only the names shorter than the given value for example: input ['Clyde','Sue','Jerry','Jo'], 4 return ['Sue','Jo']
function getAllNamesShorterThan(arrayToSearch, num){ var output = []; for (var i = 0; i < arrayToSearch.length; i++) { if ( arrayToSearch[i].length < num ) { output.push(arrayToSearch[i]); } } return output; }
[ "function stringsLongerThan(arr, arg) { \n return arr.filter(function(string) {\n return (string.length > arg);\n });\n}", "function longestCountryName (arrayNames) {\n return arrayNames.reduce(function (acc, current) {\n if (current.length > acc.length) acc = current\n return acc\n }, '')\n}", "funct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a codeblock to the server, the local codeblock array and the list of tabs. This function disables the add button until a response comes back from the server. The server provides defaults for all codeblock values. This function also triggers updateCodeblockForm() so the form fields get filled in as well.
function addCodeblock() { // Disable the codeblock buttons so that multiple codeblocks can't be // added/saved/removed at once. changeCodeblockButtons(false); jQuery("#codeblock_add").button("option", "label", "Adding..."); // Request that the server adds a new codeblock. jQuery.post(a...
[ "function removeCodeblock() {\r\n\r\n // Disable the codeblock buttons so they can't be hit multiple times.\r\n changeCodeblockButtons(false);\r\n jQuery('#codeblock_remove').button('option', 'label', 'Removing...');\r\n\r\n // Request the server removes the codeblock. This will also remove any\r\n /...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set up the search filtering behavior only fires on the "people" page (aka, the page that has the participant_search_form element
function setupSearchFilter() { // an internal function that will add/remove a hidden element called "addl_query" to the // participant search form. The element will contain filtering information that will be used by // lunr in the participant search to filter out the found results based on the additional filter ...
[ "function addFilterFunctionality() {\n var bubble,\n form,\n input,\n submit;\n\n // filter is available only for logged in users\n if ( !Site.remoteUser ) {\n return;\n }\n\n bubble = $('#lj_controlstrip_new .w-cs-filter-inner');\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delegate the Github API rate limit request, and display the results by updating the $limit element.
function updateRateLimit() { api.getRateLimit(function(remaining, limit) { $limit.html("Rate Limit: " + remaining + "/" + limit); }); }
[ "function rate_limit_return(request){\n $.getJSON(options.twitter_rate_limit_url,function(data){\n console.log(\"-------------------------------------------------------\");\n console.log(\"RATE LIMIT STATUS\");\n console.log(\" User Timeline Limit: \"+ data.resources.statuses['/st...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A function to get a user's favorites Parameters: success : function a function to run if the request succeeds error : function a function to run if the request fails
function getFavorites(success, error){ let baseUrl = "/favorites"; baseXHRGet(baseUrl, success, error); }
[ "function getFavorites(username){\n\t$.ajax({\n\t url: Url+'/getfavs?Username='+username,\n\t type: \"GET\",\n\t success: listFavorites,\n\t error: displayError,\n\t})\n}", "function getFavoriteMovies() {\n\t\tlet movieId = $('.movie-id').val();\n\n\t\t$.ajax({\n\t\t\turl: \"/favorites/all\",\n\t\t\tmethod: \"GET...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create cards for each item in the recipeList
function makeCards() { //clear previous search results cardWrapperDiv.innerHTML = ``; for (let i = 0; i < recipeList.length; i++) { let newCard = document.createElement(`div`); newCard.classList.add(`card`); newCard.setAttribute(`data-id`, [i]); newCard.setAttribute(`style`, `backgro...
[ "function createCardsList() {\n const cardList = [];\n for (let i = 0; i < 16; i++) {\n const card = document.createElement(\"li\");\n card.classList.add(\"card\");\n const cardHtml = document.createElement(\"i\");\n switch (i) {\n case 0:\n case 1:\n cardHtml.classL...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
sortDescendingCpuTemp sorts the json array based on descending CPU temperatures.
function sortDescendingCpuTemp(json) { json.sort(function(b, a){ var x = parseFloat(a.nodeTemp.temp); var y = parseFloat(b.nodeTemp.temp); if (x < y) {return -1;} if (x > y) {return 1;} return 0; }); }
[ "function calculateHighestTemp() {\n var highTemp = 0;\n for (var h = 0; h < $scope.data2.length; h++) {\n if ($scope.data2[h].y > highTemp) {\n highTemp = $scope.data2[h].y;\n }\n }\n return highTemp.toFixed(2);\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
swap between different details views
function sg_swap_details_view( $this ){ var showing = $this.attr('show'); $this.parents('li.active').addClass('lastone'); if ( $('section#' + showing).hasClass('active') ) { return false; } $('section.sg-details.active').fadeOut(150,function(){ $(this).removeClass('active').find('img.active').hide().rem...
[ "function mainViewCtrl(viewToShow, data) {\n switch(viewToShow){\n // if course+/edit was clicked\n case 'add-course':\n $('#count').hide();\n emptyDetails(\"course\");\n studentDetails.addClass(\"hidden\");\n studentForm.addCl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
postCommandCallback is a hook executed after every command. Called with the stack name. An extensibility point to perform workspace cleanup (CLI operations may create/modify a Pulumi.stack.yaml) LocalWorkspace does not utilize this extensibility point.
postCommandCallback(_) { return __awaiter(this, void 0, void 0, function* () { // LocalWorkspace does not utilize this extensibility point. return; }); }
[ "exitPostDecrementExpression(ctx) {\n\t}", "static async deleteStack(stackName) {\n await KelchCommon.exec('aws cloudformation delete-stack --stack-name ' + stackName);\n }", "exitPostfixUnaryOperation(ctx) {\n\t}", "registerHooks() {\n S.addHook(this._hookPostFunctionDeploy.bind(this), {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transform cell to specific resolution
function transformCellToResolution(cell, resolution) { const cellResolution = h3.h3GetResolution(cell); if (cellResolution < resolution) { return h3js.h3ToCenterChild(cell, resolution); // Method not in h3-node } if (cellResolution > resolution) { return h3.h3ToParent(cell, resolution)...
[ "function resize() {\n\n var mapratio= parseInt(d3.select(tag_id).style('width'));\n\n if (width > 8*height) {\n mapratio = width /5;\n } else if (width > 6*height) {\n mapratio = width /4;\n } else if(width>4*heigh...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
IMGUI_API bool SliderAngle(const char label, float v_rad, float v_degrees_min = 360.0f, float v_degrees_max = +360.0f);
function SliderAngle(label, v_rad, v_degrees_min = -360.0, v_degrees_max = +360.0) { const _v_rad = import_Scalar(v_rad); const ret = bind.SliderAngle(label, _v_rad, v_degrees_min, v_degrees_max); export_Scalar(_v_rad, v_rad); return ret; }
[ "function onSliderRotationPlanet(slider) {\r\n\tangle[0] = parseFloat(slider.value);\r\n\tchanged=true; //Marco que hubo un cambio, lo cual habilita el reset\r\n\tupdateTextInput(1,slider.value);//Actualizo el valor del campo de texto asociado al slider\r\n}", "function onSliderRotationCamera(slider) {\r\n\tchang...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the styles string for a container class.
function getStyles(container) { return container.values().map(function (style) { return style.getStyles(); }).join(''); }
[ "function getStyles() {\r\n return `\r\n .ghx-issue-content .github-info {\r\n margin-top: 8px;\r\n }\r\n .ghx-issue-content .owner,\r\n .ghx-issue-content .reviewer {\r\n width: 30px;\r\n height: 30px;\r\n margin-right: 10px;\r\n position: relative;\r\n display: inline-bl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get a section from the front of text that fits width
function clipoffline(text, width) { words = text.split(' '); line = ''; while (words.length > 0) { word = words[0]; if (line.length == 0) { if (word.length > width) { let split = splitString(word, width); // try to split if (split !== word) { // got a split let parts = spli...
[ "matchBefore(expr) {\n let line = this.state.doc.lineAt(this.pos);\n let start = Math.max(line.from, this.pos - 250);\n let str = line.slice(start - line.from, this.pos - line.from);\n let found = str.search(ensureAnchor(expr, false));\n return found < 0 ? null : { from: start + f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets a list of all elements matching the given selector under this environment's root element.
async getAllRawElements(selector) { await this.forceStabilize(); return Array.from(this._options.queryFn(selector, this.rawRootElement)); }
[ "function query(selector) {\n return Array.prototype.slice.call(document.querySelectorAll(selector));\n }", "function _getChildren(element, selector) {\n\t\tvar allChildren = element.childNodes,\n\t\t\tlength = allChildren.length,\n\t\t\tchildren = [],\n\t\t\ti = 0;\n\n\t\tfor(; i < length; i++) {\n\t\t\tvar ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clear the current entry by changing the display to 0.
function clearEntry() { changeDisplay('0'); }
[ "clearDisplay() {\n\t\tconst {displayValue} = this.state\n\t\tthis.setState({\n\t\t\tdisplayValue: '0'\n\t\t})\n\t}", "function clearDisplay(val){\n\t\tprimaryOutput.innerHTML = \"\";\t\n\t\tif (val === \"AC\") {\n\t\t\ttotal = 0;\n\t\t\tsecondaryOutput.innerHTML = \"\";\n\t\t\tsecondaryOutput.style.right = \"0px...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Userdefined typeguard for runtime check of a putative assertion, to determine if it is simple.
static isSimpleAssertion(assertion) { let casted = assertion; return casted.apexAssertion !== undefined && typeof casted.apexAssertion === 'string'; }
[ "function assertType(value,type){var valid;var expectedType=getType(type);if(expectedType==='String'){valid=(typeof value==='undefined'?'undefined':_typeof2(value))===(expectedType='string');}else if(expectedType==='Number'){valid=(typeof value==='undefined'?'undefined':_typeof2(value))===(expectedType='number');}e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
shows hint page and then the given next page as param
function showHintPage(hintPage, nextPage) { try { // show hint page $.mobile.changePage('#' + hintPage, {transition: "flip"}); if (nextPage !== 'null') { // then show next page setTimeout(function () { $.mobile.changePage('#' + nextPage, {trans...
[ "function callNextPage()\n{\n\tvar pageHref;\n\t\t\n\t// If there is a href\n\tif (arguments.length > 0)\n\t{\n\t\t// Get the href from the arguments\n\t\tpageHref = arguments[0];\n\t\t\n\t\t// If there are more results\n\t\tif (arguments.length > 1)\n\t\t{\n\t\t\t// Add the results to the results array\n\t\t\tfor ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a container element, return an object with the pixel values of the left/right scrollbars. Left scrollbars might occur on RTL browsers (IE maybe?) but I have not tested. PREREQUISITE: container element must have a single child with display:block
function getScrollbarWidths(container) { var containerLeft = container.offset().left; var containerRight = containerLeft + container.width(); var inner = container.children(); var innerLeft = inner.offset().left; var innerRight = innerLeft + inner.outerWidth(); return { left: innerLeft - containerLeft, right...
[ "function horizontalScrollbarPos() {\n\t\tvar left = offset.x + width * pixelSize;\n\t\tvar right = canvas.width - offset.x;\n\t\treturn [(left / (left + right)) * (canvas.width - 100), canvas.height - 15];\n\t}", "function findGlobalPosX(obj, container)\n{\n var curtop = 0;\n if (document.getElementById ||...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Displays chart and search results
function displaySearchData(data) { // Set search form textfield value to term searched $('#form-text-term').val(data.term) // Slidedown as chart is created--animation is cool $('#stats').slideDown('fast', function() { $('#highcharts').highcharts({ chart: { type: 'column' }, title: { ...
[ "function renderResults() {\n resultsSection.innerHTML = '<button id=\"view-results\">View Results</button>';\n let viewResults = document.getElementById('view-results');\n viewResults.addEventListener('click', function() {\n makeChart();\n resultsSection.innerHTML = '';\n let h2 = document.createElemen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper functions for loading newest tweets. __________________________________________ Get the OAuth credentials in order to fetch an Access Key.
function getTwitterAuth() { // Settings for requesting OAuth. var twitterCredentials = config.twitterCredentials; var key = twitterCredentials.key; var secret = twitterCredentials.secret; var reqUrl = 'https://api.twitter.com/'; var reqPath = 'oauth2/t...
[ "function getAccessToken( verifier ){\n console.log('Requesting access token from Twitter..');\n client.fetchAccessToken( verifier, function( token, data, status ){\n if( ! token ){\n console.error('Twitter failure: status '+status+', failed to obtain access token');\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called when a player clicks the pass button: if a pass is allowed, the information is sent over the server.
pass() { // in progress: getting the canPass functionality to work. // send info to server --> fact that player did not play cards //if (this.canPass) { //} //;else (document.getElementById("error_message_game").innerHTML = "you cannot pass on the first turn"); document.get...
[ "function pass() {\n ch_push_guess(\"pass\");\n setGuess(\"\");\n }", "onPassPhase1Clicked(callback) {\n \tdocument.getElementById('passPhase1').addEventListener('click', callback);\n }", "function showPass() {\n const password = document.getElementById('password');\n const rePassword = document....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Recursively searches the route tree for a matching route pieces: an array of url parts, ['users', '1', 'edit'] esc: the function used to url escape values i: the index of the piece being processed rules: the route tree params: the computed route parameters (this is mutated), and is a stack since we don't have fast immu...
function recurseUrl(pieces, esc, i, rules, params) { if (!rules) { return; } if (i >= pieces.length) { return { cb: rules['@'], params: params.reduce(function(h, kv) { h[kv[0]] = kv[1]; return h; }, {}), }; } var piece = esc(pieces[i]); v...
[ "match(path, params={}) {\n params.router = this;\n params.route = this.routes.find(({ re }) => {\n const match = re.exec(path);\n if (match) {\n params.length = 0;\n re.keys.forEach((key, i) => {\n params[key.name] = match[i + 1];...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the window for rendering incoming video
function videoWindow() { return hRenderWindow = hRenderWindow || getWindow('GetRenderWindow'); }
[ "liveWindow() {\n const liveCurrentTime = this.liveCurrentTime();\n\n if (liveCurrentTime === Infinity) {\n return Infinity;\n }\n\n return liveCurrentTime - this.seekableStart();\n }", "function getApiWindow()\n{\n // popup launch:\n // SCORM API related to current window(player.html)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ARG is a scale or notes array RETURN should be an array of scales that have N1 amount of matching notes AND N1 amount of notes. Meaning [C,E,G] might return [[C, G], [E,G], [C,E], etc...] USE user can see all the different ways of viewing their scale through the subsets
async function getSubscalesFromScale(scale, numberOfNotesToAlterBy = 1 , numberOfMatchingNotesToLeaveOut = 1 ) { let notes = formatLookupInput(obj); let notesListString = '("' + notes.join('","') + '")'; let noteslength = notes.length - numberOfNotesToAlterBy; let sql = `SELECT s.scale_name, s.s...
[ "function genScale(rootNote, scale)\n{\n if ((rootNote instanceof Note) === false)\n rootNote = new Note(rootNote);\n\n var rootNo = rootNote.noteNo;\n\n // Get the intervals for this type of chord\n var intervs = scaleIntervs[scale];\n\n assert (\n intervs instanceof Array,\n 'i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds event handler to the cancel and submit button of the upload dialog
function dialogAddEventHandler() { $("#dialog-cancel-load").click(cancel); $('#dialog-submit-button').click(function () { AJS.dialog2("#upload-dialog").hide(); }); }
[ "preUpload(e){\n e.target.closest('.text').querySelector('input[type=\"file\"]').click()\n }", "uploadClick (){\n this.upload.click();\n }", "upload(e){\n if(e.target.files.length) this.handleFile(e.target.files[0])\n }", "function uploadProg() {\r\n\r\n // The fileUpload input bo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
console.log(insideStars); // not accessible
function stars() { var insideStars = "stars"; var age = 20; console.log(`age inside the stars function is ${age}`); console.log("***********"); console.log(name); //accessible console.log(age); //accessible }
[ "function getPets(){\n shelterFinder();\n}", "function list() { console.log(students); }", "display_hand() {\n console.log(\"\\n\\n\");\n console.log(\"My hand:\");\n console.log(this.mycards);\n console.log(\"\\n\\n\");\n console.log(\"My points:\");\n console.log(t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Counts the clicks happened in the time difference
function clickCounter() { if (startTimer) { if (timeDifference() > 3) { reSetTimer(); } } clickCount += 1; if (clickCount == 1) { startTimer = Date.now(); } }
[ "function clickMe() {\n let count = 0;\n function nowCount(){\n count += 1;\n}\n return nowCount;\n}", "_updateUIForTotalClickCounter() {\n console.log(\"Current cLick counter = \" + this.totalClickCounter);\n $('#turns').html(\"Turns: \" + this.totalClickCounter);\n }", "function countClic...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Setup password compare check. Html format: datacheckpasswords = "pass1_id|Passwords do not match|scopeCondition" or datacheckpasswordsmessage = "Invalid phone format" datacheckpasswordsrepeat = "pass1_id" datacheckpasswordsif = "scopeCondition"
function setupPasswords() { var short = $attrs['checkPasswords']; // 'pass1id|Введенные пароли отличаются' var shorts = short ? short.split('|') : []; var repeat = shorts[0] || $attrs['checkPasswordsRepeat']; var message = shorts[1] || $a...
[ "function checkPasswords(name1, name2, pwdLen) {\n\n var elem1 = eval(\"'input[name=\" + name1 + \"]'\");\n var elem2 = eval(\"'input[name=\" + name2 + \"]'\");\n\n elem1 = $(elem1)[0];\n var pwd1 = elem1.value;\n\n elem2 = $(elem2)[0];\n var pwd2 = elem2.value;\n\n var saveEl = $('input#btnSub...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if the user ends in the end point. Regarding to the actual part of the letter.
function LetterB_checkEnd(x, y) { if (this.start) { var tmp = 0; for ( var c = 0; c < this.controlNr.length; c++) { if (this.controlNr[c]) { tmp++; } } if (tmp == this.controlNr.length) { if (x >= this.pt_end_x[0] && x <= this.pt_end_x[0] + this.radius && y >= this.pt_end_y[0] && y <= ...
[ "isEnd(editor, point, at) {\n var end = Editor.end(editor, at);\n return Point.equals(point, end);\n }", "function solution(str, ending){\n let sub = str.substring(str.length - ending.length)\n return sub === ending ? true : false\n\n // return str.endsWith(ending);\n}", "function solution(str, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete all Test Cases in a folder
function deleteAllTestCases(deleteFolder) { let promises = []; getChildTestCases(deleteFolder.id).then((res) => { let question = { type: 'confirm', name: 'toBeDeleted', message: `Are you sure you want to delete all ${ res.length } test cases from ${ deleteFolder.name }`, default: false } return...
[ "function folderCleanUp() {\n DriveApp.getFoldersByName('test1').next().setTrashed(true);\n DriveApp.getFoldersByName('test2').next().setTrashed(true);\n}", "async function clearAllTestData() {\n await User.deleteMany({name: /^\\*test_/}).exec();\n await Section.deleteMany({name: /^\\*test_/}).exec();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function that creates array with y ticks
createYTicks() { var labelsArray = []; for (let i = this.yDomainArray[0]; i <= this.yDomainArray[1]; i += this.yStep) { labelsArray.push(this.roundFloat(i)); } this.yTicksArray = labelsArray; }
[ "function createAxisDataY(){\n const obesityAxis = new axisData(\n dataColumns.obesity, \n \"Obesity (%)\"\n );\n obesityAxis.setScalarMin(.9);\n obesityAxis.setScalarMax(1.05);\n\n const smokeAxis = new axisData(\n dataColumns.smokes,\n \"Smokes (%)\"\n );\n smokeAx...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check ifs rover can move. If there's a rover, an obstacle or a wall (end of board), displays a message.
function checkPos(roverNum, d) { const rover = roversArray[roverNum]; futurePosX = rover.x; futurePosY = rover.y; if (d === 'f') { switch (rover.direction) { case 'N': futurePosY = rover.y - 1; break; case 'S': futurePosY = rover.y + 1; break; case 'E': ...
[ "function valid_move(who,dr,dc,r,c,board){\n var other;\n if(who === 'd'){\n other = 'l';\n }\n else if(who === 'l'){\n other = 'd';\n }\n else{\n log('Houston, we have a color problem: '+who);\n return false;\n }\n if( (r+dr < 0) || (r+dr > 7) ){\n return false;\n }\n if( (c+dc < 0) || (c+...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Execute the instructions dictated by code tokens
function executeTokens(tokens, context) { var i; var j; var s0; var token; var tokenStr; var args; var frame; var value = undefined; var valueParent = context[0]; var state; var callee; var parsedStr = ""; var stack = [ [context[0]] ]; var __function = "function"; var __illegalCall = ...
[ "exec(text) {\n\t\tif (text.length === 0) return;\n\t\tthis.prog = text.split(/\\s+/).reverse();\n\t\tthis.prog = this.prog.map((el) => { return el.toLowerCase(); });\n\t\twhile (this.prog.length) {\n\t\t\tlet tok = this.next_cmd(true);\n\t\t\tthis.operate(tok);\n\t\t}\n\t\t//console.log(this.stack);\n\t}", "func...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Turn this motor on indefinitely
turnOnForever() { this.status = BoostMotorState.ON_FOREVER; this._turnOn(); }
[ "controlViaOnOff() {\n console.log(\"entrou ONOFF\")\n this.output = this.getTemp() < this.setpoint ? 1023 : 0;\n this.board.pwmWrite(19 , 0, 25, 10, this.output);\n }", "toggleLoop() {\r\n this.setLoop(!this._loop);\r\n }", "function Motorcycle() {}", "startMoving () {\r\n this._is...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This class encapsulates all state within Three.js
function ThreeJsState() { // create the renderer this.renderer = new THREE.WebGLRenderer({ antialias : true, // to get smoother output preserveDrawingBuffer : true // to allow screenshot }); this.renderer.setClearColor( 0x000000, 1 ); this.renderer.setSize( innerWidth...
[ "constructor(params) {\n // times\n this.time = new THREE.Clock(true);\n this.timeNum = 3;\n this.timeScale = 2;\n\n this.scale = params.scale;\n\n // parameters\n this.sketch = params.sketch;\n this.size = params.size;\n this.dist = params.dist;\n this.iIndex = para...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set Apps Folder Paths
function setAppsFolderPaths() { if (this.applicationType) return; this.appsFolderPaths = []; for (let i = 0; i < this.appsFolders.length; i++) { const path = this.destinationPath(this.directoryPath + this.appsFolders[i]); this.appsFolderPaths.push(path); } }
[ "function onFileSystemSuccess(fileSystem){\t\n\t\tfroot = fileSystem.root;\n\t\t var fail = failCB('GetAppDir');\n\t\t \n\t\t //starting in root directory\n\t fileSystem.root.getDirectory('applications', {create: true, exclusive: false},\n\t goToAppDirectory, fail);\n\t}", "setupDirs() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
can retrieve an Auto Clicker count
get autoClickerCount(){ return this._autoClickerCount; }
[ "function recordAutoClickerCount(){\r\n widgetMaker._autoClickerCount++;\r\n }", "function clickCountLossToAutoClickerPurchase() {\r\n if(widgetMaker._clickCount>=widgetMaker.autoClickerCost){\r\n widgetMaker._clickCount-=widgetMaker.autoClickerCost;\r\n recordAutoClickerCount(widge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resets this subset (i.e. empties out the vertex, edge, and face sets)
reset() { this.vertices = new Set(); this.edges = new Set(); this.faces = new Set(); }
[ "resetIndexes()\n {\n const self = this;\n self[_reducedIndexes] = null;\n self[_optimizedIndexes] = null;\n self[_naiveIndex] = null;\n self[_keyStatistics] = null;\n }", "reset() {\n /**\n * The overall error.\n */\n this.globalError = 0;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register a saga to run inside the stepper task.
function addSaga (saga) { stepperSagas.push(saga); }
[ "function rootSaga() {\n return _Users_konouvang_Documents_Prime_07WeekSolo_KTJ_inventory_prime_solo_project_master_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function rootSaga$(_context) {\n while (1) {\n switch (_context.prev = _...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
make image.data a data URI
function makeDataURI(image) { if (image.mime && image.data) { image.data = 'data:' + image.mime + ';base64,' + image.data; } }
[ "static blobToImage(data)\n\t{\n\t\tvar URLObj = window['URL'] || window['webkitURL'];\n\t\tvar src = URLObj.createObjectURL(data);\n\t\tvar img = new Image();\n\t\timg.src = src;\n\t\treturn img;\n\t}", "function imageData2dataURL(imageData){\n var c = document.createElement('canvas');\n c.width = imageDat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function to sum layout values to derive total height for a single interval track
getTrackHeight() { return this.layout.track_height + this.layout.track_vertical_spacing + (2 * this.layout.bounding_box_padding); }
[ "function calculateHeight() {\n\t\treturn (val / capacity) * bottleHeight;\n\t}", "_calculateHeight() {\n\t\tif (this.options.height) {\n\t\t\treturn this.jumper.evaluate(this.options.height, { '%': this.jumper.getAvailableHeight() });\n\t\t}\n\n\t\treturn this.naturalHeight() + (this.hasScrollBarX() ? 1 : 0);\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
build a cell for a row that only allows one selection
function buildSingleSelectCell(control, columnIndex) { // only one selection - selected is single index var $cell = buildControlCell(control, columnIndex); if (control.selected === columnIndex) { $cell.addClass(SELECTED_CLASS); } setSelectedText($cell, control, columnIndex); // only add...
[ "function buildRow(countySelection) {\n \n for (let j = 0; j < database.length; j++ ) {\n \n if(database[j].content.$t.includes(countySelection) && database[j].gs$cell.col == 1) {\n let sameRow = database[j].gs$cell.row\n //will iterate through the 26...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Functions to open and close news inside portal
function openNews(lien, p) { var resume = p.parent().parent(); var div=resume.parent(); // Custom UTT //resume.hide(); resume.children(".article-block").children("a").hide(); div.children(".contenuArticle:first").each(function(){ if ($(this).hasClass("articleCharge"))...
[ "function CloseArticleInfoWindow ()\n {\n CloseWindow ( wInfo );\n }", "get newsTab() {return browser.element(\"~News & Videos\");}", "_openMetaData() {\n api.router.getNewsItem(this.props.node.uuid, 'x-im/image')\n .then(response => {\n\n this.extendState({ metadat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find all of the tooltips in the given container and tooltipify them.
function activateTooltips(container) { if (container.tooltip) { container.find('span[rel="tooltip"]').tooltip(); } }
[ "function ActivateTooltips(container) {\n if (container && container.tooltip) {\n container.find('span[rel=\"tooltip\"]').tooltip();\n }\n }", "function addTooltips() {\n\t$('#article-text span').each(function() {\n\t\tvar term = $(this).text().toLowerCase();\n\n\t\t$(this).mouseover(function() {\n\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function scrolls the graphical output down.
function scrollDown(){ startY -= 15; createSVGOutput(); }
[ "function scrollUp(){\n startY += 15;\n createSVGOutput();\n}", "function scrollDownPage() {\n window.scrollBy(0, 10000000);\n postToBox(\"Clear Requests \\n Scrolling…\");\n}", "function scrollToEnd() {\r\n\twindow.scrollTo(0,chatBox.scrollHeight);\r\n}", "function graphScroll() {\n document.getEl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Right sibling will be parent node's right sibling's first child
function find_right_sibling(node) { if (node === null) { return; } var current = node.right; var rightSibling = null; while (current != null) { if (current.children.length > 0) { rightSibling = current.children[0]; break; } else { curren...
[ "function create_right_sibling(node)\n{\n if (node === null) \n {\n return;\n }\n \n var numberOfChildren = node.children.length;\n \n var queue = [];\n for (var i=0; i < numberOfChildren ; i++)\n {\n if (node.children[i].right === null && node.children[i+1])\n {\n node.children[i].right = n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
gets all current rate data relative to base
static async getAllRates() { return new Promise((resolve, reject) => { oxr.latest(function() { // You can now use `oxr.rates`, `oxr.base` and `oxr.timestamp` let data = { rates: oxr.rates, base: oxr.base, tim...
[ "async dsBlockRate() {\n return await this.baseJsonRpcRequest('GetDSBlockRate');\n }", "function getCalc10HoureBase(){\n updateCalcUpdate();\n\n return base10time;\n}", "function findCurrencyRate (currency, data) {\nconsole.log(currency)\nlet currencyDataList = data.bpi;\nconsole.log(currencyDataList)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Toggles divs display with option to load a function and/or hide menu Example: toggleDiv('notificationPanel', InfoStats.notifications, true);
function toggleDiv(id, func, menu) { var d = document.getElementById(id); if (d.style.display === 'none') { d.style.display = 'block'; if (func !== undefined) { console.log(func); func(); } } else { d.style.display = 'none'; } if (menu) { ...
[ "function toggleDivs(elementToHide, elementToShow)\n{\n elementToHide.style.display = \"none\";\n elementToShow.style.display = \"block\";\n}", "function toggleDiv(statement, divName) {\n\n var element = document.getElementById(divName);\n\n if(statement != 0) {\n\n element.classList.remove(\"invis...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new effect Kind, and returns its constructor function. `kindName` will be used to look up handlers for effects of this kind. The remaining arguments are the names of the effect parameters.
function createKind(kindName /* , ...params */) { let params = Array.prototype.slice.call(arguments, 1); function ctor() { let eff = Object.create(ctor.prototype); for (let i = 0; i < params.length; ++i) { let name = params[i]; eff[name] = arguments[i]; } return eff; } inherits(ctor,...
[ "function _new_handlerx( effect_name, reinit_fun, return_fun, finally_fun,\n branches0, handler_kind, handler_tag, wrap_handler_tag)\n{\n // initialize the branches such that we can index by `op_tag`\n // regardless if the `op_tag` is a number or string.\n const branches = new Array(branch...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Joins the channel and plays the given audio link Expects the class variables message and commandParameters to be up to date
ProcessPlayTestCommand() { var ytLink = this.commandParameters[0]; this.audioPlayer.client = this.client; this.audioPlayer.channelId = this.message.member.voice.channelID; //this catches if a user is in a voice channel and defaults to their channel //catch a null case if the user ...
[ "function sendAudioMessage(recipientId,senderId,audioUrl){var messageData={recipient:{id:recipientId},message:{attachment:{type:\"audio\",payload:{url:SERVER_URL+audioUrl}}}};return callSendAPI(messageData,senderId);}", "function JoinCommand(channelName) { \r\n var voiceChannel = GetChannelByName(channelNa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Applies a viewport to a List or Carousel.
function viewportDecorator(settings) { return function (base) { var self = this, slidingWindow = this.$element, viewportStartIndex = 0, // Settings pageSize = settings.viewport.pageSize || 1, // number of elements to show in the viewport slidingThreshold = settings.viewport.slidingT...
[ "set viewport(toSet) {\n this.minX = toSet[0];\n this.maxX = toSet[1];\n this.minY = toSet[2];\n this.maxY = toSet[3];\n this.currentXRange = [this.minX, this.maxX];\n this.currentYRange = [this.minY, this.maxY];\n }", "function makeVisible() {\r\n for (var i = 0; i < items.length; i++) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function that will handle the recursion givenStr = passed string curInd = where we are in the string in terms of an index builtStr = currently built string recursively solArr = solution array
function rStrSubsets(givenStr,curInd,builtStr,solArr) { solArr.push(builtStr); // Pushes the currently built string into the solution array // Loop through all the characters remaining - then build recursively for (var k = curInd+1; k < givenStr.length; k++) { rStrSubsets(givenStr,k,builtStr+givenSt...
[ "function solve(str,idx){\n var left = 1\n var right =0\n var place = str.charAt(idx);\n if (place != '(') {\n return -1;\n };\n for (i=idx+1; i< str.length; i++){\n if (str.charAt(i)==='('){\n left++\n };\n if (str.charAt(i)===')'){\n right++\n };\n if (left===right){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loads the previouslyset volume.
function loadVolume() { chrome.storage.local.get('volume', function(cfg) { setVolume(cfg['volume'] || 1); }); }
[ "function updateVolume(){\r\n\t\r\n\t\tMopidyService.getVolume().then(function( volume ){\r\n\t\t\t$scope.volume = volume;\r\n\t\t});\r\n\t}", "function saveVolume() {\n chrome.storage.local.set({'volume': fmRadio.getVolume()});\n }", "get ConeVolume() {}", "function load() {\n _data_id = m_data.load(F...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
endregion region welcome panel /Comportamiento de los welcome panel
function WelcomePanel() { Panel.call(this, document.createElement('section')); var container = this.element; container.className = 'welcome'; var title = document.createElement('h2'); container.appendChild(title); var welcomeText = document.createTextNode('Welcome, '); title.appendChild(w...
[ "function showWelcome() {\n\n\tconst welcomeHeader = `\n\n=================================================================\n|| ||\n| Employee Summary Generator |\n|| ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION NAME : newServerPop AUTHOR : Krisfen G. Ducao DATE : March 12, 2014 MODIFIED BY : REVISION DATE : REVISION : DESCRIPTION : PARAMETERS :
function newServerPop() { addEvent2History("SideBar Server > NewServer"); //add event to history var h = $(window).height() - 100; $( "#newserverPopup" ).dialog({ modal: true, autoResize:true, width: "auto", closeOnEscape: false }); $( "#newserverPopup" ).empty().load('pages/ConfigEditor/NewServer.html',fu...
[ "function serverCreateChangePort()\n\t{\n\t\tvar instanz\t\t=\t$('#serverCreateServerCopy').val();\n\t\t\n\t\tif(instanz != 'nope')\n\t\t{\n\t\t\tvar dataString \t\t= \t'action=getTeamspeakPorts&instanz='+instanz;\n\t\t\t\n\t\t\t$.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: \"functionsTeamspeakPost.php\",\n\t\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
dump the local cache with all users to IPFS
dumpUsers() { let users = {}; db.createReadStream() .on("data", data => { if (data.key.startsWith("user-")) { users[data.key] = JSON.parse(data.value); } }) .on("error", err => { console.log("Oh my!", err); }) .on("end", () => { console.log...
[ "function archiveSessionStorageToLocalStorage() {\n var backup = {};\n\n for (var i = 0; i < sessionStorage.length; i++) {\n backup[sessionStorage.key(i)] = sessionStorage[sessionStorage.key(i)];\n }\n\n localStorage[\"sessionStorageBackup\"] = JSON.stringify(backup);\n sessionStorage.clear();\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Trims excess edges of the nine patch... any pixels that are the same as the topleft most pixel color. Same as Photoshop's Trim feature.
trimEdges(stage) { if (!stage.srcCtx) { return; } const srcData = stage.srcCtx.getImageData(0, 0, stage.srcSize.w, stage.srcSize.h); // Always trim by top-left pixel color const trimPixel = getPixel_(stage, srcData, 0, 0); let insetRect = {l:0, t:0, r:0, b:0}; let x, y; // Trim...
[ "function cleanIntersected() {\n\n while ( intersections.length ) {\n\n let object = intersections.pop();\n object.material.emissive.r = 0;\n\n }\n\n}", "function trimExcessPanes()\n {\n if(settings.maxPanes !== -1) {\n while(settings.maxPanes > settings.panes.length) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Bundles before form is edited.
function preEditBundles() { var bundles = []; if (profileData.contact.bundle && profileData.contact.bundle.length) { bundles = bundles.concat(profileData.contact.bundle); } if (profileData.contact.protectedBundles && profileData.contact.protectedBundles.length) { bundles = bundles.concat(pro...
[ "function postEditBundles() {\n var bundles = [];\n if ($scope.profile.bundle && $scope.profile.bundle.length) {\n bundles = bundles.concat($scope.profile.bundle);\n }\n if ($scope.selectedProtectedBundles && $scope.selectedProtectedBundles.length) {\n bundles = bundles.concat($scope.selectedP...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a listener to call before quit.
addQuitListener(handler) { if (!handler || !(typeof handler == 'function')) { throw new Error('Handler is not a function!'); } this._quitHandlers.push(handler); }
[ "function setListener() {\n $(window).on(\"repoDownloaded\", function (evt, which) { // which: stringa che identifica chi ha scatenato l'evento\n downloaded.push(which);\n console.log(\"evento repoDownloaded catturato: \" + downloaded);\n if (downloaded.length == 2) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the web certificate hash for the specified domain
function getWebCertFullHash(domain) { const hash = parent.webCertificateFullHashs[domain.id]; if (hash != null) return hash; return parent.webCertificateFullHash; }
[ "static hashDomain(domain) {\n const domainFields = [];\n for (const name in domain) {\n if (domain[name] == null) {\n continue;\n }\n const type = domainFieldTypes[name];\n (0, index_js_4.assertArgument)(type, `invalid typed-data domain key: ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Single product zoom image (sticky gallery)
function casano_sticky_details_product_zoom_img() { if (typeof wc_single_product_params !== 'undefined') { if (!$('.single-product .sticky_detail').length) { return false; } var $target = $('.single-product .sticky_detail .woocommerce-...
[ "function zoomCurrentImage(mode, mousePos){\n\t\t\n\t\tvar slides = g_parent.getSlidesReference();\n\t\tvar objImage = slides.objCurrentSlide.find(\"img\");\n\t\tvar scaleMode = getFitScaleMode();\n\t\t\n\t\tg_objParent.trigger(g_parent.events.ZOOM_START);\n\t\t\n\t\t//flag if the images zoomed\n\t\tvar isZoomed = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Neon obstacle shoot bullet
function neonObstacleShootBullet(){ if(bullet1Group.isTouching(neonObstacleGroup)&&ammoMode==="unlimited"){ neonObstacleGroup.destroyEach(); bullet1Group[0].destroy(); neonObstacleDieSound.play(); neonObstacleDieSound.setVolume(1.2); } }
[ "spawnAndShoot()\n {\n var newBullet = cc.instantiate(this.bullet);\n newBullet.setPosition(this.node.getChildByName('player').position.x, this.node.getChildByName('player').position.y + 50);\n this.node.addChild(newBullet);\n\n var action = cc.moveTo(4, cc.v2(this.node.getChildByName...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Used mainly to toggle one set of options off, and then pass in the function to toggle the other set on. Will calculate the cost only once a callback isn't passed, indicating that there are no more options that need to be faded in and out.
function toggleContactOptions(state, callback, callbackParam) { var state = (state) ? true : false; if(state === true) { $("#contactBonusToRoll").fadeIn(); $("#contact-options").fadeIn(function() { $('.contact-control').prop('disabled', false); if(typeof callback === "function") { callback(callbackParam...
[ "function toggleOptions(predicate, idListToShow, idListToHide) {\n\tvar selectorToShow = idListToShow.join(',');\n\tvar selectorToHide = idListToHide.join(',');\n\tif (predicate) {\n\t\t$(selectorToShow).show();\n\t\t$(selectorToHide).hide();\n\t} else {\n\t\t$(selectorToShow).hide();\n\t\t$(selectorToHide).show();...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unit test for getAwardedPoints().
function testGetAwardedPoints() { Logger.log('Testing getAwardedPoints...'); if (!checkAwardedPoints(11, '11 pts.')) { return false; } if (!checkAwardedPoints(30, '10 pts./15 min.', '45 minutes')) { return false; } if (!checkAwardedPoints(40, '10 pts./15 min.', '1 hour')) { return f...
[ "function calculateRandomPlayPoints () { //expected points earned by picking A or B randomly\n\n\t\t\trandomPoints = [];\n\t\t\tfor (var i = 0; i <= game.maxturn-1; i++) {\n\t\t\t\trandomPoints[i] = .5*pDry[i]*game.discrete.payoutAdry + .5*pWet[i]*game.discrete.payoutAwet +\n\t\t\t\t .5*pDry[i]*game.discrete.payout...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called when pressed the sensitivity button. Change the view to calibration.
function goToChangeSensitivity(){ clientValuesFactory.setActiveWindow(windowViews.changeSensitivity); }
[ "function calibrate(){\n calibrateX();\n calibrateY();\n calibrateZ();\n \n}", "function continentalView() {\n\n document.getElementById(\"ixplevelcontrol\").style.display = \"none\";\n document.getElementById(\"radiobuttons\").style.display = \"initial\";\n\n resetLevelComponent();\n\n resetZoom();\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function that totals everything in bank.txt.
function total(){ //Reading what's in the bank.txt file and handling errors, if any, and the data. fs.readFile("bank.txt", "utf8", function(error, data){ if (error) { return console.log(error); } //Taking the data and separating it into an array on every comma space. ...
[ "function withdraw(){\n fs.appendFile(\"bank.txt\", `, - ${number}`, function(error){\n if (error){\n return console.log(error);\n }\n else {\n //Tells the user what they wrote as the fourth input in the CLI and then tells the user their newly calculated total.\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Saves values into local storage for table and timer
function saveToLocalStorage() { localStorage.setItem("startTime", startTime); localStorage.running = running; localStorage.paused = paused; localStorage.tableSize = tableSize; localStorage.setItem("historyTable", historyTable.innerHTML); localStorage.setItem("timeDisplay", timeDisplay.innerHTML); localSto...
[ "function saveData() {\n var self = this;\n\n try {\n localStorage.setItem(\n self.data.name,\n JSON.stringify(self.getArrayOfData())\n );\n } catch (e) {\n console.err...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION: detectSizeForStreaming() DESCRIPTION: detect the size for .flv (rtmp) and initialize the width and height ARGUMENTS: the url (rtmp) RETURNS: nothing.
function detectSizeForStreaming() { var sourceURL = VIDEO_SERVER_URI.value; if(/\s*rtmp:\/\/([^\/]+)\/([^\/]+\/[^\/]+)/i.test(sourceURL) && !((sourceURL.indexOf("*") != -1) || (sourceURL.indexOf("?") != -1) || (sourceURL.indexOf("<") != -1) || (sourceURL.indexOf(">") != -1) || (sourceURL.indexOf("|") != -1) || ...
[ "function detectCodecIDForStreaming()\n{\n\tvar dom = dw.getDocumentDOM();\n\tvideoObj = dom.getSelectedNode();\n\n\tvar sourceURL = VIDEO_SERVER_URI.value; \n\tif(/\\s*rtmp:\\/\\/([^\\/]+)\\/([^\\/]+\\/[^\\/]+)/i.test(sourceURL) && !((sourceURL.indexOf(\"*\") != -1) || (sourceURL.indexOf(\"?\") != -1) || (sou...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setStateChangeDialogValues is called when the state change dialog has rendered. We need to make a few updates based on the current stateInfo
function setStateChangeDialogValues() { var FlowState = w2ui.propertyForm.record.FlowState; var si = 0; var s = ""; if (stateChangeFormRedrawInProgress) { console.log("LOOP: stateChangeForm redraw in progress"); return; } stateChangeFormRedrawInProgress = true; for (var i =...
[ "handleUIStateChange(key, value){\n\t this.props.setPGTtabUIState({\n\t\t[key]: {$set: value}\n\t });\n\t}", "static bindState () {\n for (const j in this.state) {\n if (this.state.hasOwnProperty(j)) {\n observe.watch(this.state, j, (newValue, oldValue) => {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if the number is allowed, false otherwise
isNumAllowed(num) { return this.allowedNums.has(num); }
[ "function isUserNumberValid(v) {\n return v <= 100 && v >= 1 && v != NaN && v % 1 == 0;\n}", "function isNumber() {\n\t\tif (screenDown.innerHTML.charCodeAt(screenDown.innerHTML.length-1)>47&&screenDown.innerHTML.charCodeAt(screenDown.innerHTML.length-1)<58) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the AWS CloudFormation Stack information
static async getStackInfo(stackName) { var client = new AWS.CloudFormation(); var stacks = await client.describeStacks({ StackName: stackName }).promise(); return stacks['Stacks'][0]; }
[ "function getStack() {\n return settings.getStack();\n}", "function Stack(props) {\n return __assign({ Type: 'AWS::CloudFormation::Stack' }, props);\n }", "async function getResourceStackAssociation() {\n templates = {};\n\n await sdkcall(\"CloudFormation\", \"listStacks\", {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }