query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
return annotations as JSON object
function annotationJSON() { // function to adjust precision of numbers when converting to JSON function twoDigits(key, val) { if (val != undefined) return val.toFixed ? Number(val.toFixed(2)) : val; } var blob = new Blob( [ JSON.stringify( storage, twoDigi...
[ "function annoDump() {\n var p=myAnno.getAnnotations();\n var len=p.length;\n var alist=[];\n for(var i=0; i < len; i++) {\n alist.push(annoJSON(p[i]));\n }\n var tmp = { \"annoList\" : alist };\n return tmp;\n}", "function getAnnotation() {\n return annotate;\n}", "listAnnotations() {}", "func...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The ModalDialog object contains information about the aspects of how the modal dialog will be created and what actions will take place. Depending on how the variables are set, the modal can flex based on the consumers needs. Customizable options include the following; size, modal title, onClose function, modal body con...
function ModalDialog(modalId) { //The id given to the ModalDialog object. Will be used to set/retrieve the modal dialog this.m_modalId = modalId; //A flag used to determine if the modal is active or not this.m_isModalActive = false; //A flag to determine if the modal should be fixed to the icon used to activate t...
[ "function ModalDialog(modalId) {\r\n\t//The id given to the ModalDialog object. Will be used to set/retrieve the modal dialog\r\n\tthis.m_modalId = modalId;\r\n\t//A flag used to determine if the modal is active or not\r\n\tthis.m_isModalActive = false;\r\n\t//A flag to determine if the modal should be fixed to th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the AWS CloudFormation properties of an `AWS::Serverless::SimpleTable.SSESpecification` resource
function cfnSimpleTableSSESpecificationPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnSimpleTable_SSESpecificationPropertyValidator(properties).assertSuccess(); return { SSEEnabled: cdk.booleanToCloudFormation(properties.sseEnabled), ...
[ "function tableResourceSSESpecificationPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n TableResource_SSESpecificationPropertyValidator(properties).assertSuccess();\n return {\n SSEEnabled: cdk.booleanToCloudForm...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
version_description computed: true, optional: false, required: false
get versionDescription() { return this.getStringAttribute('version_description'); }
[ "requireVersion(_version){\n requiredVersion = _version;\n }", "version(){\n return('Version von ' + this.meta.spezListVersion.slice(0,10) + \" (generiert am \" + this.meta.dateGenerated.slice(0,10) + ')');\n }", "validateVersionInfo () {\n\t\t// we don't expect any version info\n\t}", "async ge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert midi pitch to a frequency.
function convertMidiToFrequency(midiNumber) { let e = (midiNumber - 69)/12 return (2 ** e)*440 }
[ "function convertMidiToFreq(note) {\n return 440 * Math.pow(2, (note - 69) / 12);\n}", "function pitchToFrequency(pitch) {\n // 69 = A4 = A above middle C = 440Hz\n return Math.pow(2, (pitch - 69) / 12) * 440;\n}", "toFrequency() {\n return mtof(this.toMidi());\n }", "toFrequency() {\n ret...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a Tower element to the scene, the lists and assign its position.
function addToList(tower){ mainScene.add(tower.mesh); /* Add a new variable to the mesh itself - its position in the tower array */ tower.mesh.towerArrayPosition = towerMeshList.length; towerList.push(tower); towerMeshList.push(tower.mesh); }
[ "addTothis(towerParent, x, y, towerName) {\n var towerSelect = towerParent._scene.add.sprite(x, y, \"tower_base\").setInteractive({ cursor: 'grab' });\n towerSelect.turret = towerParent._scene.add.sprite(x, y, towerName);\n towerSelect.turret.depth = UI_TEXT_DEPTH;\n\n // Clicking on a t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
neighbouringCells :: Cell > Cell[]
function neighbouringCells(cell) { var x = getX(cell); var y = getY(cell); return [ createCell((x - 1), (y - 1), false, true), createCell((x ), (y - 1), false, true), createCell((x + 1), (y - 1), false, true), createCell((x - 1), (y ), false...
[ "_neighbouringUnvisitedCells(cell) {\n\n let cells = [];\n const {y: yCoordinate, x: xCoordinate} = cell;\n\n // If neighbouring cell exists, add neighbouring to cells array if it is unvisited.\n if (yCoordinate + 1 < this.height) {\n if (!this.grid[yCoordinate + 1][xCoordinat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parse people match people ids w/ people
function parsePeople2Dict(rawPeopleArray) { if (collaborators == null) // TODO: wrap into Person obj anyway return rawPeopleArray; var parsed = {}; var i = 0, j = 0, p, len = collaborators.length; // match up with main node first var mainNode = JazzMap.ui.network.getMainNode(); for ...
[ "function PeopleFound(peopleFound, id)\n{\n const PEOPLE_FOUND = 'PEOPLE_FOUND'\n return {\n type: PEOPLE_FOUND,\n status: 'PEOPLE_FOUND',\n peopleFound: peopleFound,\n 'id': id,\n }\n}", "function searchById(people){\n idSearch = promptFor(\"What is the ID number you searching for?\", autoValid)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
constructor for creating ZipArchive instance
function ZipArchive() { if (CRC32TABLE.length === 0) { ZipArchive.initCrc32Table(); } this.files = []; this.level = 'Normal'; _syncfusion_ej2_file_utils__WEBPACK_IMPORTED_MODULE_1__["Save"].isMicrosoftBrowser = !(!navigator.msSaveBlob); }
[ "function ZipArchive() {\n _classCallCheck(this, ZipArchive);\n\n this.files = [];\n this.level = 'Normal';\n Save.isMicrosoftBrowser = !!navigator.msSaveBlob;\n }", "function ZipArchive() {\n if (CRC32TABLE.length =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
============================================== TOPBAR FIXED ===============================================
function navFixed() { var heightNav = $('.topbar-fixed').outerHeight(); var heightTopBar = $('.topbar-absolute').outerHeight(true); $('.topbar-absolute').parent().css('height', heightNav); var topHambu = parseInt($('.side-nav__boton-sideNav').css('top'), 10); var scrollPx = $(this).scrollTop(); var pxinit ...
[ "function setupTopBar() {\n \t\t// add the basics to the stickynotes top bar\n \t\t$(\"body\").prepend(\"<div class='openbijbeltoolbar'></div>\");\n\n \t\topenBijbelToolBar = $(\".openbijbeltoolbar\");\n\n \t\t// build the basic content of the toolbar\n \t\tvar toolbarContent = \n\t\t\t'<div class=\"openbijbelverta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check are there any allowed objects in collider trigger
function OnTriggerEnter (other : Collider) { if (!objectInTrigger) if (allowedTags.Length == 0) objectInTrigger = other.gameObject; else for (var i=0; i < allowedTags.Length; i++) if (other.gameObject.tag == allowedTags[i]) { objectInTrigger = other.gameObject; bre...
[ "checkTriggerEvents() {\n let possibleTriggers = FudgeCore.Physics.world.getTriggerList(); //Get the array from the world that contains every trigger existing and check it with this body\n let event;\n //ADD - Similar to collision events but with overlapping instead of an actual col...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Takes a partially filledin grid and attempts to assign values to all unassigned locations in such a way to meet the requirements for Sudoku solution (nonduplication across rows, columns, and boxes)
solveSudoku(grid) { // If the sudoku grid has been filled, we are done let [row, col] = this.getUnassignedLocation(grid); if (row === 10 || col === 10) { return true; } // Consider digits 1 to 9 for (let num = 1; num <= 9; num++) { // If placing the current number in the current ...
[ "function solvegrid(grid){\n\n\nif(unassigned(grid) === true){\nreturn true;\n}\n\nlet newrowcol=unassigned(grid)\n\nlet row=newrowcol[0];\nlet col=newrowcol[1];\n\nfor(let num=1;num<=9;num++){\n\t\nif(issafe(grid,row,col,num)==1){\n\n\tgrid[row][col]=num;\n\tconst flag = solvegrid(grid);\n\nif(flag){\n\treturn tru...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
store initials in local storage, pull when needed, and add initials to list
function init() { var storeInitials = JSON.parse(localStorage.getItem('initialsList')); if (storeInitials !== null) { initialsList = storeInitials; } }
[ "function populateDefault(){\n var initialList = {\n item3:\"Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\",\n item2:\"Aliquam tincidunt mauris eu risus.\",\n item1:\"Vestibulum auctor dapibus neque.\"\n };\n $.each(initialList, function(index, item){\n localStorage.setItem(index, item);...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
newHMLAttr: Not used from HMLGen newHMLComment: Not used from HMLGen
wrapperEl(tag, inner) { var wel; if (typeof lggr.trace === "function") { lggr.trace(`HML: wrapperEl(${tag})`); } wel = this.newHMLElement(tag); wel.appendChild(inner); return wel; }
[ "function CharbaJsMLHelper() {}", "createHeading(headingObj) {\n\n\n headingObj.size = headingObj.size < 0 ? 0 : headingObj.size;\n headingObj.size = headingObj.size > 5 ? 5: headingObj.size;\n\n let head = document.createElement(`h${parseInt(headingObj.size)}`);\n \n head.innerText = typeof headi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
test si la position en fonction de la direction est valide
directionIsValide(){ let max_x = window.innerWidth; let max_y = window.innerHeight; let new_x= this.dir.x*this.dir.vect+this.pos.x; let new_y= this.dir.y*this.dir.vect+this.pos.y; return (new_x>0 && new_y>0 && new_x<max_x && new_y<max_y ); }
[ "check_valid_move(direction){\n if (\n (direction === 'u' || direction === 'U' || direction === 'up')\n && this.poss[0] === 0) {\n return false;\n }else if (\n (direction === 'd' || direction === 'D' || direction === 'down')\n && this.poss[0] === this.field.length) {\n re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
archived version from way back machine url
function archivedURL(url) { const bashedUrl = encodeURIComponent(url, 26, true); axios .get(`http://archive.org/wayback/available?url=${bashedUrl}`) .then((response) => { if (response.data.archived_snapshots.length === 0) { console.log(`There is no archived version available for ${url}`); ...
[ "function downloadNewVersion() {\r\n\r\n\t\t\t// Create the variables:\r\n\t\t\tvar addr = fileUrl;\r\n\t\t\tvar url = new air.URLRequest(addr);\r\n\t\t\turlStream = new air.URLStream();\r\n\t\t\tdata = new air.ByteArray();\r\n\r\n\t\t\t// Add an event listener:\r\n\t\t\turlStream.addEventListener(air.Event.COMPLET...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Starts the rotation animation of the second rectangle.
function rotateRectangle2(){ document.querySelector("#rectangle2").style.animation = "rectangle2-anim 6s linear infinite"; }
[ "function rectAnimation() {\n var recL = 260;\n var recH = 70\n fill(100, 100, 100);\n rect(150, 110, recL, recH);\n\n recL = cos(millis() * 1);\n recH = cos(millis() * 1);\n}", "function startRotate() {\n\t\t\tcreateProgressBar();\n\t\t\tcreateNavigation();\n\t\t\tgoToImage(0,next,false);\n\t\t}", "anima...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Column_FLOAT extends NumericColumn =============================================================================
function Column_FLOAT() {}
[ "function Column_NUMERIC() {}", "function Column_DECIMAL() {}", "function Column_DOUBLE() {}", "function NumericColumn() {}", "function floatScalar(val){if(typeof val==='number'){return val;}if(typeof val==='boolean'){return val?1:0;}if(typeof val==='string'){return parseFloat(val);}if(val instanceof Char){...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the inner HTML for the testimonial container
function setTestimonialContainerHTML(row, employee) { row.querySelector('.testimonial-container').firstChild.innerHTML = ` <button type="button" class="close" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> <img class="starburst" src="${IMAGE_URL}/${employee.col...
[ "function populateTestimonialTemplate(t) {\n return `\n <div class=\"testimonial ${t.name.toLowerCase()}\">\n <div class=\"blurb\">${t.blurb}</div>\n <div class=\"profile\">\n <div class=\"name\">${t.name}, ${t.location}</div>\n <div class=\"photo\"><img src=\"${t.imgUrl}\" alt=\"${t.n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compiles and links a shader program with the given attribute and vertex list
function createShader( gl , vertSource , fragSource , uniforms , attributes) { //Compile vertex shader var vertShader = gl.createShader(gl.VERTEX_SHADER) gl.shaderSource(vertShader, vertSource) gl.compileShader(vertShader) if(!gl.getShaderParameter(vertShader, gl.COMPILE_STATUS)) { var errL...
[ "function createShader(\n gl\n , vertSource\n , fragSource\n , uniforms\n , attributes) {\n \n //Compile vertex shader\n var vertShader = gl.createShader(gl.VERTEX_SHADER)\n gl.shaderSource(vertShader, vertSource)\n gl.compileShader(vertShader)\n if(!gl.getShaderParameter(vertShader, gl.COMPILE_STATUS)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Combines multiple predicate functions to produce new OR predicate
function or () { var predicates = Array.prototype.slice.call(arguments, 0); if (!predicates.length) { throw new Error('empty list of arguments to or') } return function orCheck () { var values = Array.prototype.slice.call(arguments, 0); return predicates.some(function (predicate) { tr...
[ "function or(predicate1, predicate2) {\n return predicate1 || predicate2;\n}", "function or(...predicates) {\n return (x) => {\n let result = false;\n for (const predicate of predicates) {\n result = result || checkedPredicate('argument of or', predicate)(x);\n }\n return result;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Usable Ip Range This fuction will get the Paramater of the Network Adress and BroadCast Address
function calIpRange(netL,brL){ var lastOctet = [] ; // First Host IP of the Network lastOctet[1] = netL + 1; // Last Host Ip of the Network lastOctet[2] = brL - 1; return [lastOctet[1],lastOctet[2]]; }
[ "getIpRange (){\n return this.ipRange;\n }", "function getIPRange(firstHost, lastHost) {\n var hostRange = [];\n for(var i = firstHost; i < lastHost; i++) { \n var oc4 = (i>>24) & 0xff;\n var oc3 = (i>>16) & 0xff;\n var oc2 = (i>>8) & 0xff;\n var oc1 = i & 0xff;\n ho...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clears the information (name and current setting value) of the ORIGIN Line Item in the Config Sheet.
function clearOriginInfo_() { configSheet.getRange(ROW_ORIGIN_LI_NAME,2, ROW_ORIGIN_LI_VALUE - ROW_ORIGIN_LI_NAME + 1, 1).clearContent(); }
[ "clear() {\n let me = this;\n\n me.value = me.clearToOriginalValue ? me.originalConfig.value : null;\n me.fire('clear');\n }", "clear() {\n this._config = {};\n }", "function clearConfigValues() {\n\tlocalStorage.removeItem(\"skypebot_config\");\n\tfor (var key in configValues) {\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
type :: integer || float || boolean || text || decimal || identifier || enum options :: [String] min :: Number max :: Number maxlength :: Natural precision :: Natural scale :: Natural nullable :: Boolean unsigned :: Boolean foreign :: String
function parse (type) { // TODO warning when using too large number for JavaScript engine (e.g. bigint & longtext) var xs if (type === "tinyint(1)") { return {type:"boolean"} } // Signed integer if (/^tinyint(\([0-9]+\))$/.test(type)) { return {type:"integer", min:-128, max:127} } if (/^smallint(\([0-9]+\))...
[ "getSqType(fieldObj, attr) {\r\n const attrValue = fieldObj[attr];\r\n if (!attrValue.toLowerCase) {\r\n console.log(\"attrValue\", attr, attrValue);\r\n return attrValue;\r\n }\r\n const type = attrValue.toLowerCase();\r\n const length = type.match(/\\(\\d+\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates labels for user data points that are 3600 seconds apart Avoids over crowdiing xaxis with labels
function handleLabels(json) { // Sort json according time as labels are sorted by time. json.users.sort(function(a,b) { return a.time - b.time }) var last_unix_time = -3600 for (i in json.users) { var date = new Date (json.users[i].time*1000) if (json.users[i].time - last_unix_time >= 3600) { ...
[ "function populate_x_axis_labels(full_date_range, x_time_taken) {\n\tvar x_label_values = []\n\tvar cycle_count = 1;\n\tvar count = 0;\n\tvar days_of_the_week = [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"];\n\tfor (var i = 0; i < full_date_range.length; i++) {\n\t\t// define to individual variables for simplic...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
xpi = Array for InstallTrigger exclusive = see above
function startInstall(xpi, exclusive) { if (!browserOK(exclusive)) return; gxpi = xpi; for (i in xpi) { numxpi++; } InstallTrigger.install(xpi,statusCallback); }
[ "function build_xpi() {\n if ( system.os.name == 'windows' ) {\n // TODO: fill in real Windows values here (the following line is just a guess):\n childProcess.execFile( 'cmd' , [ 'cd build\\firefox-addon-sdk ; bin\\activate ; cd ../Firefox ; cfx xpi'], null, finalise_xpi ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the list of column names of a row of result of a statement.
'getColumnNames'() { return __range__(0, sqlite3_data_count(this.stmt), false).map((i) => sqlite3_column_name(this.stmt, i)); }
[ "columns() {\n if (this._done) {\n throw new error_ts_2.default(\n \"Unable to retrieve column names as transaction is finalized.\",\n );\n }\n const columnCount = this._db._wasm.column_count(\n this._db._id,\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Satellite constructor. The developer must define the priority order for the Satellite's stages here.
constructor () { // define satellite load priority. this.loadPriority = 10 }
[ "constructor(latura) {\n super(latura, latura, latura, 'echilateral');\n }", "function Satellite(_catNo, _rnxStr, _imgStr, _description) {\n\tthis.catNo = _catNo;\n\tthis.rnxStr = _rnxStr;\n\tthis.imgStr = _imgStr;\n\tthis.description = _description;\n}", "function createSatellite (options) {\n\n\t// ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check to see if options is a destroy command
function isDestroyCommand(options) { /* var command = ""; for(var i=0; i<=$.akita.DESTROY_COMMAND.length; i++) { if(!options.hasOwnProperty(i)){ break; } command += options[i]; } return command == $.akita.DESTROY_COMMAND; */ ...
[ "function isDestroyCommand(options) \r\n\t {\r\n\t \tvar command = \"\";\r\n\t \tfor(var i=0; i<=$.cftoaster.DESTROY_COMMAND.length; i++)\r\n\t \t{\r\n\t \t\tif(!options.hasOwnProperty(i)){\r\n\t \t\t\tbreak;\r\n\t \t\t}\r\n\t \t\tcommand += options[i];\r\n\t \t}\r\n\t \treturn command...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to generate Date column for list view control
function loadDateColumn(cellValue, rowObject, width, nIndex, event) { "use strict"; oGridConfig.nColumnCounter++; var sCurrentValue = $.trim(cellValue) ? cellValue : "NA" , orignalDateValue = sCurrentValue; var sDate = "NA" !== sCurrentValue ? oListView.formatDate(sCurrentValue) : "NA"; var sGen...
[ "function dateTimeView() {\n var dateRowCol = \" \";\n var dateHTML = [];\n var rowCount = 2;\n var today = new Date();\n var todaysDate = today.format(dateFormat.masks.mediumDate);\n var yesterday = new Date(new Date().setDate(new Date().getDate() - 1));\n var yeste...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
maxCharLength: max number of character before shortening occurs
function shortenText (longText, maxCharLength) { const charLength = longText.length if (charLength > maxCharLength) { // If text is too long, then return the amount const splitArray = longText.split(' ') let charCounter = 0 let i = 0 for (i = 0; i < splitArray.length; i++) { if (charCount...
[ "function maxChar(str) {}", "function maxCharacter(str) { }", "function LimitChars() {\r\n\t\tintCharLimit = 1800;\r\n\t\tstrAgendaText = txtAgendaItems.val();\r\n\r\n\t\tif (strAgendaText.length > intCharLimit) {\r\n\t\t\ttxtAgendaItems.val(strAgendaText.substr(0, intCharLimit));\r\n\r\n\t\t\tshowWarning(resou...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
END DATE FUNCTIONS //////////////////////////////////////////////////////////////////////// ////////////////////////////////// Section4: START TABBER FORMATTING FUNCTIONS ///////////////////////////////////////////////////////// / To check data in a tab. Arguments: 1) Tab object. Sample Call var tabObject = $("mcPage_0...
function SP_IsTabContainData(tabObj) { var isDataExist = false; tabObj.find("input").each(function(indexInput){ if($(this).attr("type") != "hidden" && $(this).attr("type") != "button") { if($(this).attr("value") != "") if(("checkbox" == $(this).attr("type") && $(this).attr("checked")) || ("radio" == $(th...
[ "function SP_IsTabContainData(tabObj)\n{\n var isDataExist = false;\n \n tabObj.find(\"input\").each(function(indexInput){\n if($(this).attr(\"type\") != \"hidden\" && $(this).attr(\"type\") != \"button\")\n {\n if($(this).attr(\"value\") != \"\")\n if((\"checkbox\" ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
drawPrey() Draw the prey (the piece of trash) as the current image assigned from the array
function drawPrey(img) { image(img, preyX, preyY, preySize, preySize); }
[ "function drawPrey() {\n image(preyImage,preyX,preyY,50,50)\n}", "function drawPrey() {\n tint(preyFill.x,preyFill.y,preyFill.z,preyHealth);\n image(prey,preyX,preyY,preyRadius,preyRadius);\n push();\n}", "function drawPrey() {\n tint(255, preyHealth);\n image(preyGhost, preyX, preyY, preyRadius * 2, prey...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return pathpoint's index. when the argument is out of bounds, fixes it if the path is closed (ex. next of last index is 0), or return 1 if the path is not closed.
function parseIdx(p, n){ // PathPoints, number for index var len = p.length; if(p.parent.closed){ return n >= 0 ? n % len : len - Math.abs(n % len); } else { return (n < 0 || n > len - 1) ? -1 : n; } }
[ "getPathIndex() {\n \t\tvar coordinates = this.Mover.getMapCoordinates();\n \t\tvar i;\n \t\tfor (i = 0; i < this.path.length; i++) {\n var pos = this.Mover.parsePosition(this.path[i]);\n \t\t\tif (coordinates.x == pos.x && coordinates.y == pos.y) {\n \t\t\t\treturn i;\n \t\t\t}\n \t\t}\n \t\tthis.is...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This voice plays a buffer / sample, and it's capable of regenerating the buffer source once noteOff has been called TODO set a base note and use it + noteOn note to play relatively pitched notes
function SampleVoice(audioContext, options) { var that = this; options = options || {}; var loop = options.loop !== undefined ? options.loop : true; var buffer = options.buffer || audioContext.createBuffer(1, audioContext.sampleRate, audioContext.sampleRate); var nextNoteAction = options.nextNoteAction || 'cut...
[ "play (note) {\n if (this.note) {\n this.output.send('noteoff', this.note)\n }\n\n if (note) {\n const send = {\n note,\n velocity: VELOCITY,\n channel: this.channel\n }\n this.output.send('noteon', send)\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create entry in urlVisits DB object If entry already exists, increment by one
function increaseCounterForUrl(short_url) { if(!databases.urlVisits[short_url]){ databases.urlVisits[short_url] = {}; databases.urlVisits[short_url].visits = 0; } databases.urlVisits[short_url].visits += 1; }
[ "setVisitedIncrement()\n {\n this.visitedUrls.push(true);\n }", "static async storeRouteCount(req) {\n const db = new Database();\n\n let query = `SELECT * FROM routeStats WHERE method = ? AND endpoint = ?`;\n\n const routeInfo = await db.queryDatabase(query, [req.method, req.routeURL]);\n\n if (...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check if a pixel is likely a part of antialiasing; based on "Antialiased Pixel and Intensity Slope Detector" paper by V. Vysniauskas, 2009
function antialiased(img, x1, y1, width, height, img2) { var x0 = Math.max(x1 - 1, 0), y0 = Math.max(y1 - 1, 0), x2 = Math.min(x1 + 1, width - 1), y2 = Math.min(y1 + 1, height - 1), pos = (y1 * width + x1) * 4, zeroes = 0, positives = 0, negatives = 0, ...
[ "function antialiased(img, x1, y1, width, height, img2) {\n var x0 = Math.max(x1 - 1, 0),\n y0 = Math.max(y1 - 1, 0),\n x2 = Math.min(x1 + 1, width - 1),\n y2 = Math.min(y1 + 1, height - 1),\n pos = (y1 * width + x1) * 4,\n zeroes = 0,\n positives = 0,\n negatives = 0,\n min = 0,\n max =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checks if two elements are colliding abstracted from:
function isColliding(a, b) { return a.left < b.right && a.right > b.left && a.top < b.bottom && a.bottom > b.top; }
[ "function collision (element1, element2)\n{\n var element1Left = Math.round(element1.getBoundingClientRect().left),\n element1Top = Math.round(element1.getBoundingClientRect().top),\n element1FullHeight = Math.round(element1.getBoundingClientRect().height),\n element1FullWidth = Math.round(element1....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function to redirect to the login page when a component load error occurs
function handleLoadComponentError() { setTimeout(function() { loadPageComponent('login'); },2000); throw new Error("Invalid component: Components must be grouped in folders with all relevant scripts." + " Click here to visit the setup page: "+getServerRootPath()+"divblox/" + "Will redirect to login page in 2s"...
[ "function onSecurityCheckFail() {\n log.debug('security check failed redirecting...');\n response.sendRedirect('/console/login');\n }", "function authOnNavigate() {\n // If authenticated, navigate\n // Else, be taken to ERROR page with button to Login page\n}", "function redirectToLogin()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The abstract operation ComputeExponent computes an exponent (power of ten) by which to scale x according to the number formatting settings. It handles cases such as 999 rounding up to 1000, requiring a different exponent. NOT IN SPEC: it returns [exponent, magnitude].
function ComputeExponent(numberFormat, x, _a) { var getInternalSlots = _a.getInternalSlots; if (x === 0) { return [0, 0]; } if (x < 0) { x = -x; } var magnitude = utils_1.getMagnitude(x); var exponent = ComputeExponentForMagnitude_1.ComputeExponentForMagnitude(numberFormat, m...
[ "function ComputeExponent(numberFormat, x, _a) {\n var getInternalSlots = _a.getInternalSlots;\n if (x === 0) {\n return [0, 0];\n }\n if (x < 0) {\n x = -x;\n }\n var magnitude = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"d\" /* getMagnitude */])(x);\n var expon...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
SWAP[] SWAP the top two elements on the stack 0x23
function SWAP(state) { var stack = state.stack; var a = stack.pop(); var b = stack.pop(); if (DEBUG) console.log(state.step, 'SWAP[]'); stack.push(a); stack.push(b); }
[ "function SWAP(state) {\n\t var stack = state.stack;\n\n\t var a = stack.pop();\n\t var b = stack.pop();\n\n\t if (exports.DEBUG) { console.log(state.step, 'SWAP[]'); }\n\n\t stack.push(a);\n\t stack.push(b);\n\t}", "function SWAP(state) {\n var stack = state.stack;\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get all book categories
function getBookCategories() { bookCategoryService.getBookCategories().then(function(categories) { $scope.categories = categories $scope.selectedCategory = $scope.categories[0]; }); }
[ "async getAllCategories() {\n return await apiService.get('categories');\n }", "async getAllCategories(){\n\t\tconst categories = await this.models.Category.findAll();\n\t\treturn categories;\n\t}", "async getAllCategories() {\n const data = await this.get('jokes/categories');\n return data;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
bundleArgs parameters: fn, args1, args2 to argsn fn is the function to get args bundled with it args1, args2 to argsn any number of args that will automatically get filled in when the output function is used return: a version of fn that will take any number of parameters, but prefills the first n parameters with the ar...
function bundleArgs(fn, ...args) { return function(...otherArgs) { return fn(...args, ...otherArgs); }; }
[ "function fn(...args1) {\n   const args = [];\n   args.push(...args1);\n   console.log(args);\n   return function fb(...args2) {\n     args.push(...args2);\n     console.log(args);\n     return fb;\n   }\n}", "function callWithArgs(fn) {\n\n}", "function callWithArgs(fn) {\n}", "function commandBundle(args, d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
word: word to search for index: current position within word path: current path under consideration row: current row col: current col drow: how many rows to change in each search step dcol: how many columns to change in each search step returns true if the search is successful. otherwise false.
function search2(searchword, index, path, row, col, drow, dcol) { if (searchword.length == index) { searchResults[searchResults.length] = new Result(searchword, path.slice()); // alert("match " + searchResults.length); return true; // if we made it this far, a complete match was found. } // check for out of b...
[ "function directionalSearch(x, y, term, direction) {\n\n // check for end conditions \n if (term.length === 0) {\n return true;\n } // word match\n \n if (typeof board[y] === 'undefined' || typeof board[y][x] === 'undefined') {\n return false;\n } // out-of-bounds\n\n // if current ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
groups genre for chart 1
function makeGroups() { var x = 400, y = 0 for (var i = 0, len = genres.length; i < len; i++) { categoriesXY[genres[i]] = [ y , x ] y += 125 if( i + 1 == Math.ceil(len/2) ) { y = 0 x += 400 } } }
[ "function getGenres(data) {\n var genreSet = [];\n for (var i = 0; i < data.length; i++) {\n var genres = data[i].genre;\n for (var j = 0; j < genres.length; j++) {\n if (genreSet.indexOf(genres[j]) == -1) {\n genreSet.push(genres[j]);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Enables to set HTML of the header DIV of the modal.
setHeader(html){ this.header.html(html); }
[ "function setContectToModal(headerTitle, modalBody){\n $('#common-modal-header').text(headerTitle)\n $(\".common-modal-body\").html(modalBody)\n $(\"#common-modal\").modal('show')\n}", "createHeader() {\n var $text = $('<h4>')\n $text.attr('id', 'modal-title')\n $text.text(this.form....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Invoke virtual alexa with constructed skill request
call(skillRequest, skill/*, skillInteractor*/) { console.log("skillRequest: " + JSON.stringify(skillRequest.json(), null, 2)); //this._interactor = skillInteractor; return this._interactor.callSkill(skillRequest, skill); }
[ "request() {\n return new SkillRequest(this._context);\n }", "function AlexaSkill(appId) { this._appId = appId; }", "function createIntent(name,templates,userSays,answer,method){\n var options = { method: 'POST',\n url: 'https://api.api.ai/v1/intents',\n qs: { v: '20150910' },\n headers: \...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Frees the specified pages from the page blob.
async clearPages(offset = 0, count, options = {}) { var _a; options.conditions = options.conditions || {}; const { span, updatedOptions } = createSpan("PageBlobClient-clearPages", options); try { return await this.pageBlobContext.clearPages(0, Object.assign({ abortSignal: opt...
[ "free() {\n if (this.memoryManager && this.allocated) {\n this.memoryManager.free(this.page, this.offset, this.size);\n this.allocated = false;\n }\n }", "destroy() {\n this.page.close();\n this.page = null;\n }", "function handlePages(page) {\n try {\n va...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
retrieves single mandate by id
getMandate(id) { const path = `/mandates/${id}`; const method = 'GET'; const options = buildOptions(this.token, this.endPoint, path, method, null); return goCardlessRequest(options); }
[ "static async getSingleEstablishment(id) {\n return this.query().where('id', id);\n }", "static getOneloan(req, res) {\n const { id } = req.params;\n const findloan = model.findOne(id);\n\n if (findloan) {\n return res.status(200).json({\n status: 400,\n message: 'one loan found',\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if multiuser is enabled
async multiuser_is_enabled() { var enabled = await this.settings.get('core', 'multiuser:enabled', false); if (String(enabled) == "true") return true; else return false; }
[ "userIsMultiFacilityAdmin(state, getters, rootState) {\n return getters.isSuperuser && rootState.core.facilities.length > 1;\n }", "function inMultiMode() {\n if($('#grid').attr('data-multi')==\"true\"){\n return true;\n } else {\n return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts intermediate batches data to drawCalls.
buildDrawCalls() { var TICK = ++BaseTexture_1.BaseTexture._globalBatch; for (var i = 0; i < this.drawCalls.length; i++) { this.drawCalls[i].textures.length = 0; GraphicsGeometry.DRAW_CALL_POOL.push(this.drawCalls[i]); } this.drawCalls.length = 0; var uvs =...
[ "buildDrawCalls() {\n let TICK = ++BaseTexture._globalBatch;\n for (let i2 = 0; i2 < this.drawCalls.length; i2++)\n this.drawCalls[i2].texArray.clear(), DRAW_CALL_POOL.push(this.drawCalls[i2]);\n this.drawCalls.length = 0;\n const colors = this.colors, textureIds = this.textureIds;\n let current...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clears the search text
function clear () { self.searchTerm = ''; search(); }
[ "function clearSearchString()\r\n{\r\n\tif(search)\r\n\t{\r\n\t\tsearch.clearSearchString();\r\n\t}\r\n}", "function clearSearchText() {\n\tgetStore().setValue({field: \"searchText\", value: \"\"})\n}", "function clearSearchContents() {\n\tconsole.log(\"**> ClearSearchContents\");\n\tsearchInput.value = \"\";\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to call areacv and html2pdf options
function generateResume() { html2pdf(areaCV, opt); }
[ "function generateResume(){\n html2pdf(areaCv, opt)\n}", "function generateResume() {\n html2pdf(areaCv, opt)\n}", "function generateResume() {\r\n html2pdf(container, opt)\r\n}", "function doConversion() {\n var options;\n // Apply required HTML changes.\n if (!indiciaData.htmlPreparedForPd...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get the key of the currently selected item
function getVariantSelectionKey() { return oTemplatePrivateModel.getProperty(getPropertyPath(PATH_TO_SELECTED_KEY)); }
[ "getKeyForSelectedItem(item) {\n if (this.props.getKeyForSelectedItem) return this.props.getKeyForSelectedItem(item);\n return \"\"+item;\n }", "function getVariantSelectionKey() {\n\t\t\t\treturn oTemplatePrivateModel.getProperty(PATH_TO_SELECTED_KEY);\n\t\t\t}", "get() {\n if (this.isSetToDefaultSta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
t: trigger( id: string, width: int, height: int, image: image) fsm: Finite State Machine object group: int to group trigger so you know when to show them (0: everytime)
addTrigger(t, fsm) { var img = new Image(); // Add clickable image trigger if(img.tagName == t.image.tagName) { // Create id this.triggers.push('triggerImg'+t.id); if(this.idS1 === "") { this.idS1 = t.id; } els...
[ "function FSM() {}", "function update(event){\n gStateMachine.update();\n}", "function StateMachine(description, elementToAttach ) {\r\n\r\n// storing all the elements that need event listeners in an array (assumes the user \r\n// passed in more than two arguments) \r\nvar elements = [];\r\nfor (var i =1; i ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns 0 if there is no win, Returns 1 if player 1 is the winner, Returns 2 if player 2 is the winner. boardstate shoudld be an array where: [[] [] [] [] [] [] []] Each of the minielemets should contain a value: 0 if unoccupied 1 if owned by player 1 0 1 2 3 4 5 6 2 if owned by player 2 v v v v v v v [ ] / var board =...
function checkForWin(boardstate){ var result = 0; var success = false; for(var i = 0; i < 7 && !success; i++){ for(var j = 0; j < boardstate[i].length && !success; j++){ result = checkAtSpot(boardstate, i, j, boardstate[i][j]); if(result){ success = true; console.log("Player", result, "has won the ga...
[ "testForWin(board) {\n //iterate over the state of the board\n for (var i = 0; i < board.length; i++) {\n for (var j = 0; j < board[0].length; j++) {\n //if the current item is a value that matches the currentPlayer in state\n if (board[i][j] === this.state.currentPlayer) {\n //tes...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get get a cached key and change the stats Parameters: `key` ( String | Number ): cache key `[cb]` ( Function ): Callback function `[errorOnMissing=false]` ( Boolean ) return a error to the `cb` or throw it if no `cb` is used. Otherwise the get will return `undefined` on a miss. Example: myCache.get "myKey", ( err, val ...
get( key, cb, errorOnMissing ){ // handle passing in errorOnMissing without cb let err; if (typeof cb === "boolean" && arguments.length === 2) { errorOnMissing = cb; cb = undefined; } // handle invalid key types if ((err = this._isInvalidKey( key )) != null) { if (cb != null) { cb( err ); ...
[ "function _get(key) {\n\tif (!key) {\n\t\tthrow new Error('InputArgumentsError');\n\t}\n\tif (!this.isExistKey(key)) {\n\t\tthrow new Error('NotExistKeyError');\n\t}\n\treturn this.cache[key].value;\n}", "function getter (key) {\n return key ? get(this.cache, key) : this.cache\n}", "function get(key){\n if(ca...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Params: baseURI path: If this is set, this path will be normalized. Otherwise the request path will be normalized.
function GetNormalizedPath() { }
[ "function pathWithBase(path){\n path = lodash.toPath(path)\n if(lodash.isEmpty(path)) return base\n if(lodash.isEmpty(base)) return path\n return lodash.concat(base,path)\n }", "normalize(base, globPath) {\n const gpSet = utils.isset(globPath);\n if (!gpSet) {\n globPath = ba...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function: get a name for a rebuild branch. Format: rebuild_mm_dd_yyyy.
function getRebuildBranchName() { var date = new Date(); var mm = date.getMonth() + 1; // Month, 0-11 var dd = date.getDate(); // Day of the month, 1-31 var yyyy = date.getFullYear(); return 'rebuild_' + mm + '_' + dd + '_' + yyyy; }
[ "function getRebuildBranchName() {\r\n var date = new Date();\r\n var mm = date.getMonth() + 1; // Month, 0-11\r\n var dd = date.getDate(); // Day of the month, 1-31\r\n var yyyy = date.getFullYear();\r\n return 'rebuild_' + mm + '_' + dd + '_' + yyyy;\r\n}", "function getRCBranchName() {\n var date = new D...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
on mobile we are going to update the friends scores every time a user clicks on the leaderboard so .. we use this function to determine if we should update it in other flows basically if web always update if mobile then only if we are showing it!!!
function WeAreCurrentlyShowingFriendsLeagueTable() { var CurrentlyShowingFriendsTable = false; if (displaymode == "m") { //movile view if (($('#panel3').is(":visible") == true) && ($('.FriendsLeaderboard').css('display') == "block")) { CurrentlyShowingFriendsTable = true; } } ...
[ "function handleFriendScoreSwitch(){\n\tvar targetImage = '';\n\tvar notificationOptionValue = 0;\n\tif(getNotificationOption(NOTIFICATION_OPTION_FRIEND_SCORE) == 1){\n\t\ttargetImage = IMAGE_PATH+'settings/off.png';\n\t\tnotificationOptionValue = 0;\n\t} else {\n\t\ttargetImage = IMAGE_PATH+'settings/on.png';\n\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this method fetches the results based on props.query.category
function getResults (props) { let email = UserStore.getUserDetails().email; let secretToken = UserStore.getUserDetails().secretToken; if (props.query.category) { // fetch either running or completed results AdhocQueryActions .getQueries(secretToken, email, { state: props.query.category }); } else...
[ "fetchCategorywiseNews(category, type) {\n // Set Init Value\n this.setState({ isLoadedCategory: true, categoryData: [] });\n fetch(\n `${process.env.REACT_APP_API_URL}?section=${category}&order-by=${type}&show-fields=headline,trailText,thumbnail&page-size=${this.state.articleNo}&api-key=${process.en...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Process Response Functions // each of the general questions are processed by this to insert user response into more tables
function processGeneralQResponse(session, response, questionID, questionnaireID){ // Gets timestamp information var botTimeFormatted = new Date(getBotMsgTime(session)); var userTimeFormatted = new Date(getUserMsgTime(session)); var timeLapseHMS = getTimeLapse(session); // inserts data into UserReponses table in...
[ "function insertGeneralQResponseData(interactionID, botTime, userTime, timeLapse, questionID, userID, userResponse, questionnaireID){\n\tconsole.log(\"InteractionID: \" + interactionID);\n\tconsole.log(\"BotTime: \" + botTime);\n\tconsole.log(\"UserTime: \" + userTime);\n\tconsole.log(\"TimeLapse: \" + timeLapse);\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this converts the first letter of a string to lowercase
function lowercaseFirstLetter(string) { return string.charAt(0).toLowerCase() + string.slice(1); }
[ "function lowercaseFirstLetter(string){\n return string[0].toLowerCase() + string.slice(1);\n}", "function autoEd_first2lower(str) {\n if (str != \"\") {\n var letter = str.substr(0, 1);\n return letter.toLowerCase() + str.substr(1, str.length);\n } else {\n return \"\";\n }\n}", "function toLowerFirst(st...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new measure tooltip
function createMeasureTooltip() { if (measureTooltipElement) { measureTooltipElement.parentNode.removeChild(measureTooltipElement); } measureTooltipElement = document.createElement('div'); measureTooltipElement.className = 'tooltip tooltip-measure'; measureTooltip = n...
[ "function createMeasureTooltip() {\n if (measureTooltipElement) {\n measureTooltipElement.parentNode.removeChild(measureTooltipElement);\n }\n measureTooltipElement = document.createElement('div');\n measureTooltipElement.className = 'tooltip tooltip-measure';\n measure...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generate one number which is either 2 or 4, and add it to a randompicked free position on the board return: ture if success false otherwise
function addOneNumber() { randNum = Math.random() > 0.5 ? 4 : 2; var position = generatePosition(); if (position !== false) { [x, y] = position; all_numbers[x][y] = randNum; showTile(x, y, randNum); return true; } }
[ "function randomNum(){\n return Math.floor(Math.random() * (1 + 4 - 1) + 1);\n }", "function getNewPiece() {\n\treturn random(7)+1;\n}", "function addNewNumber()\r\n{\r\n caseBoitesRemplies++; // Update du chiffre de caseBoitesRemplies (+1)\r\n var x, y; // Positions x et y aleatoires\r\n\r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Shop Zones Related Methods
function getZonesByShopId(shopId) { var userZoneDetails; if (parseVariable(shopId) && String(shopId).indexOf(',') == -1) { getAllShopRequiredFieldsForCurrUser(); if (parseVariable(userZones, true)) { var selectedZones = $.grep(userZones, function (obj, idx) { re...
[ "getCostByZone (totalZonesTraversed, isZoneOneTraversed) {\n if(totalZonesTraversed == 1 && isZoneOneTraversed) { \n return new Costs('Anywhere in Zone 1').cost.price; \n }\n\n if(totalZonesTraversed == 1 && !isZoneOneTraversed) { \n return new Costs('Any one zone outside ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Exit a parse tree produced by LUFileParsernameIdentifier.
exitNameIdentifier(ctx) { }
[ "exitParse(ctx) {\n\t}", "exitNamedExpression(ctx) {\n\t}", "exitCompilationUnit(ctx) {\n\t}", "exitIdentifier(ctx) {\n\t}", "exitDeclarationSpecifier(ctx) {\n\t}", "exitDeclaration(ctx) {\n\t}", "exitLabel_declaration(ctx) {\n\t}", "function translator_terminate()\n{\n this.parser.terminate();\n}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unselect all the bubbles (called by the button)
function unselectAll() { for (i = 0; i < bubbles.length; ++i) { if (bubbles[i].isClicked) removeFromHistorical(bubbles[i].name); bubbles[i].yearClick = -1; bubbles[i].isClicked = false; document.getElementById("entity[" + [bubbles[i].name] + "]").checked = false; } ...
[ "function unselectAll() {\n\tfor (var i = 0; i < ALL_WALLS.length; i++) {\n\t\tALL_WALLS[i].isSelected = false;\n\t}\n\tfor (var j = 0; j < ALL_POINTS.length; j++) {\n\t\tALL_POINTS[j].isSelected = false;\n\t}\n\tredraw();\n}", "function unselectAll() {\n resetAllStrokes();\n resetAllBackgrounds();\n selected_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
migrate a single company
async migrateCompany (company) { return this.migrationHandler.migrateCompany(company); }
[ "async handleMigration () {\n\n\t\t// look for any companies the user is in that are not yet migrated\n\t\t// (or get the manually set company)\n\t\tlet companyIds, companies;\n\t\tif (this.companyId) {\n\t\t\tconst company = await this.data.companies.getById(this.companyId.toLowerCase());\n\t\t\tif (!company) {\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetches and updates state shelfBooks
updateShelfBooks() { const updater = async () => { try { const shelfBooks = await getAll(); this.setState(() => ({shelfBooks})); } catch (error) { console.log(error); } }; updater(); }
[ "onChangeShelf(book, newShelf){\n book.shelf = newShelf;\n\n BooksAPI.update(book, newShelf).then(() => {\n this.setState((state) => ({\n books: state.books.filter((b) => b.id !== book.id).concat([book])\n }))\n });\n }", "getAllShelves() {\n \t\tthis.props.model.getShelves((shelves) =>...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if the given old identifer has already been assigned a new identifier.
hasId(old) { return (old in this.existing); }
[ "hasId(old) {\n return this._existing.has(old);\n }", "hasId(old) {\n return old in this.existing;\n }", "function ExistID(newID) {\n for (var i = 0; i < medicationRecords.length; i++) {\n if (medicationRecords[i].id == newID) {\n return (true);\n }\n }\n return (false)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
load QR code modal data
function loadQrCodeModal (link) { document.querySelector('#QRcodeModalLabel').innerHTML = link; document.querySelector('#qr-code-download').download = link + '.jpg' generateQrCode(link); }
[ "onQRPress() {\n this.showModal('qrScanner');\n }", "onQRPress() {\n this.showModal('qr');\n }", "function showQRCode() {\n var url = getPillboxURL();\n if (url) {\n $('#qrcode').attr(\"href\", url);\n $('#qrlen').html(//\"<small>(\" + url.length + \" chars in QR code)</s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initialize the "dsCDND" with child datasets (dsCredits, dsDebits & dsNet) based on the user's checkbox selections.
function InitCDNDDataset() { dsCDND = [[], [], []]; choiceContainer.find("input:checked").each(function() { var key = parseInt($(this).attr("name")); switch (key) { case 0: dsCDND[key] = dsCredits; break; case 1: dsCDND[key] = dsDebits; ...
[ "function init() {\n let selector = d3.select('#selDataset');\n d3.json(url).then((data)=>{\n let idData = data.names\n idData.forEach((id)=>{\n selector\n .append(\"option\")\n .text(id)\n .property('value', id);\n });\n\n co...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register all necessary hooks.
registerHooks() { this.addLocalHook('click', () => this.onClick()); this.addLocalHook('keyup', event => this.onKeyup(event)); }
[ "declarePreProcessHooks(hooks) {\n }", "_initHooks() {\n for (let hook in this.opts.hooks) {\n this.bind(hook, this.opts.hooks[hook]);\n }\n }", "bindHooks() {\n //\n }", "assignHooks () {\n this.assignBeforeHook()\n this.assignBeforeEachHook()\n this.assignAfterHoo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Temporary function that allows for a stringbased property name to be obtained from an indexbased property identifier. This function will be removed once the new styling refactor code (which lives inside of `render3/styling_next/`) replaces the existing styling implementation.
function getBindingNameFromIndex(stylingContext, offset, directiveIndex, isClassBased) { var singleIndex = getSinglePropIndexValue(stylingContext, directiveIndex, offset, isClassBased); return getProp(stylingContext, singleIndex); }
[ "function getPropertyID(index)\n\t{\n\t\tassert(0 <= index && index < propertyNames.length);\n\t\treturn propertyIDs[index];\n\t}", "function getPropertyName(prop) {\n const key = prop.key;\n // {foo: bar} // note that `foo` is not quoted, so it's an identifier\n if (!prop.computed && babel.isIdentifier(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
7. Calculate the diameter of a circle given a radius
function diameterofaCircle(radius) { return radius*2; }
[ "function diameterOfCircle(radius) {\n return 2 * radius;\n}", "function getCircumferenceOfCircle(radius){\n let circumference = 2 * 3.14 * radius;\n return(circumference);\n}", "function calculateCircleValues(radius){\n var pi = Math.pi();\n\n var diameter = 2 * radius;\n var circumference = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GregorianCalendar class. no arguments: Constructs a default GregorianCalendar using the current time in the default time zone with the default locale. one argument locale: Constructs a GregorianCalendar based on the current time in the default time zone with the given locale.
function GregorianCalendar(loc) { var locale = loc || defaultLocale; this.locale = locale; this.fields = []; /* * The currently set time for this date. * @protected * @type Number|undefined */ this.time = undefined; /* * The timezoneOffset in minutes used by this date. * ...
[ "function GregorianCalendar(locale) {\n locale = locale || defaultLocale;\n\n this.locale = locale;\n\n this.fields = [];\n\n /**\n * The currently set time for this date.\n * @protected\n * @type Number|undefined\n */\n this.time = undefined;\n /**\n * The timezoneOffset in minutes used by this dat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetching categories information from the breweries database api
async function fetchCategories() { checkBreweryAPIConfiguration(); const apiUrl = `${BREWERY_DB.API_ENDPOINT}/categories?key=${BREWERY_DB.API_KEY}`; return rp({ uri: apiUrl, json: true }); }
[ "function fetchMealCategories() {\n let searchUrl = \"https://themealdb.p.rapidapi.com/categories.php\";\n\n fetch(searchUrl, fetchParams)\n .then(response => response.json() )\n .then(responseJson => {\n parseCategoryResponse(responseJson);\n })\n .catch(err => {\n displayErrorMessage();\n console...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
API CALL TO PLAY A SONG
playSong(){ spotifyApi.play({}); }
[ "sendPong() {\n let json = {type: \"PONG\"}\n this.send(json)\n }", "function play(device_id) {\n\t$.ajax({\n\t\turl: \"https://api.spotify.com/v1/me/player/play?device_id=\" + device_id,\n\t\ttype: \"PUT\",\n\t\tdata: '{\"uris\": [\"spotify:track:0OlltePKpgAgOB1SLmfLIE\", \"spotify:track:1xDRRWdTWa9Kfw30T...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if any password is input Returns boolean
function is_password(password) { return password.length > 0; }
[ "function isValidPassword(password) {\n var passLength = password.length;\n var passcontainWord = password.includes('password');\n \n // if (passLength > 8 && !passcontainWord) {\n // return true\n // } else {\n // return false;\n // }\n\n return passLength > 8 && !passcontainWord...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
cancel close timer (this is when mouse hovers out of theKey on to theObj applicable for drop down menus doesn't work on tool tip
function cancelclosetime() { if (closetimer) { window.clearTimeout(closetimer); closetimer = null; } }
[ "function mmCancelCloseTime() {\n if (closeTimer) {\n window.clearTimeout(closeTimer);\n\tcloseTimer = null;\n }\n if (menuParent) {\n menuParent.className = 'sel';\n }\n}", "function cancelTimer() {\n\t\t\thoverTimer = clearTimeout(hoverTimer);\n\t\t}", "function cancelTimer() {\n\t\t\thoverTimer = c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reset the health bar.
function healthBarReset() { oldHealth = maxHealth; healthDif = 0; if (intervalVar !== undefined) { clearInterval(intervalVar); } }
[ "function healthBarReset() {\r\n oldHealth = maxHealth;\r\n healthDif = 0;\r\n if (intervalVar !== undefined) {\r\n clearInterval(intervalVar);\r\n }\r\n}", "resetHP () {\n this._damage = 0;\n }", "restoreHealth() {\n this.health = 20;\n alert('You have been healed by ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
API call to remove a person from the Frequent Casher list
@action RemoveFrequentCasher(firstName, lastName, ssn) { const player = { firstName: firstName, lastName: lastName, ssn: ssn } let url = `${config.SERVER_BASE_URL}/v1/player/remove-frequent-casher`; fetch(url, { method: 'POST', ...
[ "function remove(id, name, surname){\n //changing data to JSON\n data = JSON.stringify({'ID': id, 'Name': name + ' ' + surname})\n num_patients--;\n removedPatient.push(data);\n}", "function removePerson(element, name) {\n // delete from table\n element.parentElement.parentElement.remove();\n // de...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
25.4.1.5 NewPromiseCapability ( C )
function NewPromiseCapability(c) { // To keep Promise hermetic, this doesn't look much like the spec. return CreatePromiseCapabilityRecord(undefined, c); }
[ "function NewPromiseCapability (c) {\n // To keep Promise hermetic, this doesn't look much like the spec.\n return CreatePromiseCapabilityRecord(undefined, c)\n }", "function NewPromiseCapability ( C ) {\n var promise;\n if ( !IsConstructor(C) ) {\n throw TypeError();\n }\n try {\n pr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
To short mobile number format
function toShortMobileNumberFormat(mobileNumber) { if ( mobileNumber == null || ! isValidMobileNumber( mobileNumber ) ) { throw new Error("Invalid mobile number"); } return "0" + toStandardMobileNumberFormat(mobileNumber).substring(3); }
[ "function formatMobile(mobile) {\n return mobile.replace(/(\\d{4})(\\d{3})(\\d{3})/, '$1 $2 $3')\n }", "function formatPhone(phone) {\n var str = String(phone).replace(/ /g, '');\n str = str.replace(/O/g, '0');\n str = str.replace(/-/g, '');\n return str;\n}", "function formatPhoneNumber(n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
accept to sponsor quest
function acceptSponsorQuest() { questSetupCards = []; allQuestInfo = []; document.getElementById('sponsorQuest').style.display = 'none'; var serverMsg = document.getElementById('serverMsg'); serverMsg.value += "\n> you are sponsor, setting up quest..."; sponsor = PlayerName; var data = JSON.stringify({ 'name' ...
[ "function acceptQuestParticipate() {\n\tdocument.getElementById(\"merlin\").style.display = \"none\";\n\tstageCounter = 0;\n\tdocument.getElementById('acceptQuest').style.display = \"none\";\n\tvar data = JSON.stringify({\n\t\t'name' : PlayerName,\n\t\t'participate_quest' : true\n\t});\n\tsocketConn.send(data);\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Populates the tab strip.
_populateTabStrip() { const that = this, documentFragment = document.createDocumentFragment(), tabLabelContainers = [], groups = [], groupLabels = []; let selectedTabLabelContainer = null; for (let i = 0; i < that._tabs.length; i++) { ...
[ "function rerenderTabstrip () {\n empty(tabContainer)\n for (var i = 0; i < tabs.length; i++) {\n tabContainer.appendChild(createTabElement(tabs[i]))\n }\n}", "_populateTabStrip() {\n const that = this,\n documentFragment = document.createDocumentFragment(),\n tabLabelContainers...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Insert the given characters into the CRDT for the given textbufferproxy ID and emit the relevant events.
async _localInsertAndEmitEvents(bufferProxyId, characters, startPos) { const logObj = { bufferProxyId: bufferProxyId, characters: characters, startPos: startPos, }; log.debug('Doing local insert and then event emission: ', logObj); let [_, crdt] = this._getTextBufferProxyAndCRDT(buffe...
[ "async _remoteInsert(hostBufferProxyId, charObj) {\n const logObj = {\n hostBufferProxyId: hostBufferProxyId,\n charObj: charObj,\n value: charObj.getValue(),\n };\n log.debug('Doing remote insert: ', logObj);\n\n // Get text-buffer-proxy and CRDT\n let bufferProxy;\n let crdt;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete the tree: START FOR each item in the array to delete: 1. Check predecessor in the array: IF it doesn't exist, THEN GO TO to step 2. with success IF it exists, THEN: 1. A. Walk the tree and make `GetAll` on that predecesor for all instances of its parent. 2. IF no instances of the predecessor exist, THEN GO TO st...
function deleteTree(root, countVus, waitDelete, secondsToWaitForPredecessorDeletion) { if (__VU > countVus) { console.log(`VU ${__VU} > total VUs ${countVus}, doing nothing`); return; } let shouldCheckPredecessorStatus = true; let predecessorsDeleted = true; walkTree("postorder", 0, 1, root, (data, customData)...
[ "function waitForTreeItemsToDisappear(root, getItemsCount, secondsToWaitForPredecessorDeletion, callbackData = null) {\n\tlet status = {\n\t\tareDeleted: false,\n\t\tinstancesLeft: 0,\n\t\tsleepTime: 10,\n\t\twaitCycles: null,\n\t};\n\tstatus.waitCycles = Math.ceil(secondsToWaitForPredecessorDeletion / status.sleep...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Type checking function that determines if an object is a SmartBufferOptions object.
static isSmartBufferOptions(options) { const castOptions = options; return castOptions && (castOptions.encoding !== undefined || castOptions.size !== undefined || castOptions.buff !== undefined); }
[ "static isSmartBufferOptions(options) {\n const castOptions = options;\n return (castOptions &&\n (castOptions.encoding !== undefined || castOptions.size !== undefined || castOptions.buff !== undefined));\n }", "function hasOptions(obj) {\n if (obj!=null && obj.options!=null) { retu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Save collection on objects to permanent storage
persistCollection(name, collection) { this.validateCollection(name); this.storage.setItem(name, JSON.stringify(collection)); }
[ "save() {\n localStorage.setItem(this.localStorage_key, JSON.stringify(this.collection));\n }", "save() {\n debugger;\n localStorage.setItem(this.localStorage_key, JSON.stringify(this.collection));\n }", "save() {\n localStorage.setItem(this.localStorage_key, JSON.stringify(this.collecti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
update pivot view after "select all" or "clear all"
updateSelectOrClearView (name) { this.ctrl.isPvTickle = !this.ctrl.isPvTickle if (name === ATTR_DIM_NAME) { this.filterState = Puih.makeFilterState(this.otherFields) } // update pivot view rows, columns, other dimensions this.dispatchMicrodataView({ key: this.routeKey, ...
[ "updateSelectOrClearView (name) {\n this.ctrl.isPvTickle = !this.ctrl.isPvTickle\n\n // update pivot view rows, columns, other dimensions\n this.dispatchTableView({\n key: this.routeKey,\n rows: Pcvt.pivotStateFields(this.rowFields),\n cols: Pcvt.pivotStateFields(this.colFields),...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Rotates page numbers based on maxSize items visible. Currently selected page stays in the middle: Ex. for selected page = 6: [5,6,7] for maxSize = 3 [4,5,6,7] for maxSize = 4
_applyRotation() { let start = 0; let end = this.pageCount; let leftOffset = Math.floor(this.maxSize / 2); let rightOffset = this.maxSize % 2 === 0 ? leftOffset - 1 : leftOffset; if (this.page <= leftOffset) { // very beginning, no rotation -> [0..maxSize] ...
[ "formatPages() {\n const pagesMaxSize = 6;\n const firstPageNumber = 1;\n const maxPage = Math.ceil(this.state.requests.length / 10);\n var pages = [];\n var i = this.state.page > 2 ? this.state.page - 2 : firstPageNumber;\n\n for (; i <= maxPage && pages.length < pagesMaxSize; i ++) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
rotates the block, passed as a matrix, in the specified direction
function rotate(matrix, dir) { for(let y = 0; y < matrix.length; y++) { for (let x = 0; x < y; x++) { [matrix[x][y], matrix[y][x]] = [matrix[y][x], matrix[x][y]]; } } if (dir>0) { matrix.forEach(row => row.reverse()); } else { matrix.reverse(); } }
[ "function matrixRotation(matrix, r) {}", "function rotateMatrix(matrix) {\n\n}", "function rotate(block, dir) {\n var c_x = tetromino.center[0];\n var c_y = tetromino.center[1];\n var offset_x = tetromino.cells[block][0] - c_x;\n var offset_y = tetromino.cells[block][1] - c_y;\n offset_y = -offse...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
update(props) This function filters input props and creates an array of tasks which are executed in .start() Each task is allowed to carry a delay, which means it can execute asnychroneously
update(args) { //this._id = n + this.id if (!args) return this; // Extract delay and the to-prop from props const _ref = interpolateTo(args), _ref$delay = _ref.delay, delay = _ref$delay === void 0 ? 0 : _ref$delay, to = _ref.to, props = Object(_babel_runtime_helpers_...
[ "update(args) {\n //this._id = n + this.id\n if (!args) return this; // Extract delay and the to-prop from props\n\n const _ref = interpolateTo(args),\n _ref$delay = _ref.delay,\n delay = _ref$delay === void 0 ? 0 : _ref$delay,\n to = _ref.to,\n props = Object(_babel_run...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
makes an aggregate score from all the scores and weightings
getAggregateScore(scores) { // this adds a weighted score to each score object var scoresMultiplied = scores.map((item) => { item.weightedScore = item.score * item.weight return item }) // get the sum of all weighted scores var sumOfWeightedScores = 0 scores.map((item) => { su...
[ "function gradeOverall(subscores, weights) {\n console.log(\"GRADING OVERALL:\");\n let totalWeight = 0;\n let totalValue = 0;\n\n const subscoreWeights = [[\"performance\", 0.6], [\"growth\", 0.4]];\n\n // go through each subscore and add it and its weight if wanted\n subscoreWeights.forEach(sw =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handles rendering the new image preview when the image picker option has changed.
function onImagePickerOptionChange(pickerOption) { $('#projectImagePreview').attr('src', $(pickerOption.option[0]).data('img-src')); }
[ "function updatePickerImage() {\n if (getEditor() != editor) return;\n let sheet = editor.selectedSheet;\n let image = sheet.paint(\n arkham.sheet.RenderTarget.PREVIEW,\n sheet.templateResolution\n );\n picker.image = image;\n }", "change(option) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
NOTE: args can be either a string which will be appended as is to url or an object of name>values
function addUrlArgs (url, args){ if (!args) return url; if (url.indexOf('?') < 0) url += '?'; else if (url.substr(url.length-1) != '&') url += '&'; if (matTypeof(args == 'object')) return url + implodeUrlArgs (args); return url + args; }
[ "function addUrlArgs (url, args){\n if (!args)\n return url;\n if (url.indexOf('?') < 0)\n url += '?';\n else if (url.substr(url.length-1) != '&')\n url += '&'; \n if (matTypeof(args == 'object'))\n return url + implodeUrlArgs (args); \n return url + args;\n}", "setUrlArgs(arg, value) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Serializes a passed session object to a JSON object with a slightly different structure. This is necessary because the Sentry backend requires a slightly different schema of a session than the one the JS SDKs use internally.
function sessionToJSON(session) { return utils.dropUndefinedKeys({ sid: `${session.sid}`, init: session.init, // Make sure that sec is converted to ms for date constructor started: new Date(session.started * 1000).toISOString(), timestamp: new Date(session.timestamp * 1000).toISOString(), stat...
[ "function sessionToJSON(session) {\n return dropUndefinedKeys({\n sid: `${session.sid}`,\n init: session.init,\n // Make sure that sec is converted to ms for date constructor\n started: new Date(session.started * 1000).toISOString(),\n timestamp: new Date(session.timestamp * 1000).toISOS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given table name, perform a fetchandadd on its key counter reference, and return the new value. To perform FAA atomically, this function will start a new transaction by default, unless called from inside another transaction (given that the current API doesn't allow nested transaction). In that case, all operations will...
function fetchAddPrimaryKey(remote, table_name) { return kv.runT(remote, function(tx) { return incrKey(tx, table_name).then(_ => getCurrentKey(tx, table_name)); }); }
[ "function getAutoIncCacheForTable(table) {\n if(table.per_table_ndb) {\n table.autoIncrementCache = new NdbAutoIncrementCache(table);\n }\n}", "function increaseStatsCounter(counterKey, docClient, done, hashKey) {\n// Increase counters...\n var params = {\n TableName: 'dnaStats',\n Key: {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }