query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Return the total number of parts in this model, including parts in submodels
partCount(model) { if (!model || !Array.isArray(model.parts) || model.parts.length <= 0) { return 0; } return model.parts.reduce((acc, p) => { if (!p || !p.filename || !api.partDictionary[p.filename]) { return acc; } p = api.partDictionary[p.filename]; return (p.isSubModel ? p...
[ "size() {\n return _.size(this.models);\n }", "get subMeshCount() {}", "numProperties() {\n let count = 0;\n if (this.hasChildren) {\n for (const it = this.children; it.hasNext(); it.next()) {\n const child = it.item();\n switch (child.snapshotTyp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Brief: Initialize renderer Params: int width, height, the width and height of renderer Boolean useWebgl, the option for use WebglRenderer or CanvasRenderer
createRenderer(width, height, useWebgl){ if(useWebgl == true) this.renderer = new THREE.WebGLRenderer({antialias:true, alpha: true}); else this.renderer = new THREE.CanvasRenderer(); this.renderer.setPixelRatio( window.devicePixelRatio ); this.renderer.setSize(w...
[ "setupRenderer() {\n const settings = this.settings;\n const deviceScale = this.deviceScale;\n\n this.renderer = settings.webGLEnabled\n ? PIXI.autoDetectRenderer(settings.width * deviceScale, settings.height * deviceScale, settings)\n : new PIXI.CanvasRenderer(settings.width * deviceScale, s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
init([Event] evt) Called by each SVG file to initialize the panel. Each panel needs to provide a panelInitPreSocket(evt) function that it uses to initialize the specifics of that panel (namely, create each of the PanelTurnout objects)
function init(evt) { svgDocument=evt.target.ownerDocument; var desiredWinWidth = window.outerWidth - window.innerWidth + svgDocument.rootElement.scrollWidth; var desiredWinHeight = window.outerHeight - window.innerHeight + svgDocument.rootElement.scrollHeight; if(desiredWinWidth > screen.width) desiredWinWidth...
[ "function init() {\n createPalette();\n createActive();\n createCanvas();\n addEventHandlers();\n}", "_initSvgEls() {\n const _this = this;\n\n this.svgEls = {\n panel: document.createElementNS(this.SVG_NS, \"rect\"),\n sliders: [],\n sliderPanels: []\n };\n\n this._appendSvgEls();\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is a function for repositoriesWorkspaceRepoSlugHooksUidGet / Returns the webhook with the specified id installed on the specified repository.
repositoriesWorkspaceRepoSlugHooksUidGet(incomingOptions, cb) { const Bitbucket = require('./dist'); let defaultClient = Bitbucket.ApiClient.instance; // Configure API key authorization: api_key let api_key = defaultClient.authentications['api_key']; api_key.apiKey = incomingOptions.apiKey; // U...
[ "repositoriesWorkspaceRepoSlugHooksUidGet(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n let defaultClient = Bitbucket.ApiClient.instance;\n // Configure API key authorization: api_key\n let api_key = defaultClient.authentications['api_key'];\n api_key.apiKey = incomingOptions.apiKey...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
searches along line 'pk' for a point that satifies the wolfe conditions / See 'Numerical Optimization' by Nocedal and Wright p5960 / f : objective function / pk : search direction / current: object containing current gradient/loss / next: output: contains next gradient/loss / returns a: step size taken
function wolfeLineSearch(f, pk, current, next, a, c1, c2) { var phi0 = current.fx, phiPrime0 = dot(current.fxprime, pk), phi = phi0, phi_old = phi0, phiPrime = phiPrime0, a0 = 0; a = a || 1; c1 = c1 || 1e-6; c2 = c2 || 0.1; function zoom(a_lo, a_high, phi_lo) { for ...
[ "function wolfeLineSearch(f, pk, current, next, a, c1, c2) {\n\t var phi0 = current.fx, phiPrime0 = dot(current.fxprime, pk),\n\t phi = phi0, phi_old = phi0,\n\t phiPrime = phiPrime0,\n\t a0 = 0;\n\n\t a = a || 1;\n\t c1 = c1 || 1e-6;\n\t c2 = c2 || 0.1;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Print the given text. Most applications should not use this method. In particular, if possible, an application should format any line output internally and then invoke `println(line)`, where `line` is the result. If a logical message spans more than one line, the application should invoke `startMessage()` before printi...
print(text) { const output = this.#output; maybeStartLine(this, output); if (text === EOL) { maybeEndLine(this, output); } else { output.stream.write(text); } }
[ "function print() {\n\n var x = START_POINT_X;\n var y = START_POINT_Y + _carriage[0] * LINE_WIDTH;\n\n var text = arguments[0];\n for (var i = 1; i < arguments.length; i++) {\n var arg = arguments[i];\n var num_spaces = OFFSETS[i] - String(arg).length;\n text += spaces(num_spaces) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Indicates whether filename is delivered via file protocol (as opposed to http/https)
function isFileURI(filename) { return filename.startsWith("file://"); }
[ "function isFileURI(filename) {\n return filename.startsWith('file://');\n }", "function isFileURI(filename) {\n return filename.startsWith('file://');\n}", "isRemoteFile(url) {\n if (!url) {\n // current dir?\n return false;\n }\n if (url.indexOf('http') === 0) {\n return true;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
asks user for password criteria and returns a char set based on that
function getPasswordCriteria() { var isLowercase = confirm("Do you want lowercase characters?"); var isUppercase = confirm("Do you want uppercase characters?"); var isNumeric = confirm("Do you want numbers?"); var isSpecialChars = confirm("Do you want special characters?"); // if the user doesn't pick anythi...
[ "function passwordCharacterSet( ) { \n\n if (useUpperCase == true) { \n characterSet = upperCase;\n } \n if (useLowerCase == true) {\n characterSet += lowerCase; \n }\n if (useNumbers == true) {\n characterSet += numbers.toString(); \n }\n if (useSpecialCh...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
when the title of a VideoListEntry is clicked, that video is displayed in the player.
onVideoListEntryTitleClick(newCurrentVideo) { this.setState({ currentVideo: newCurrentVideo }); }
[ "clickOnTitle(clickedVideo) {\n this.setState({\n currentVideo: clickedVideo//data of the video we clicked\n });\n }", "function showVideos(e) {\n if (typeof e.index !== 'undefined' && e.index !== null) {\n whereIndex = e.index; // TabbedBar\n } else {\n whe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create the vertex, color and index data for a multicolored dodecahedron Input parameters: canvas context for webgl, vector for translation, vector for rotation Output parameter: dodecahedron object
function createDodecahedron(gl, translation, rotationAxis) { // Vertex Data let vertexBuffer; vertexBuffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); // Names of vertices assigned for better figure construction, after drawing it on Geogebra let verts = [ // F...
[ "function dodecahedronGeometry ( radius, detail ) {\n\n var t = ( 1 + Math.sqrt( 5 ) ) / 2;\n var r = 1 / t;\n\n var vertices = [\n 1, 1, 1, r, t, 0,\n -r, t, 0, -1, 1, 1,\n 0, r, t, 1, 1, -1,\n t, 0, r, 0, -r, t,\n -t, 0, r, -1, 1, -1,\n 1, -1...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
helper function to show current bot position inside view
function botPos(pos) { split = pos.toString(10).split("").map(function(t) { return parseInt(t) }); var x = split[0]; var y = split[1]; $scope.x = x; $scope.y = y; if (facing == 1) { console.log("Latest facing: west"); $scope....
[ "function showPosition() {\n}", "function PositionView(pos) {\n var grid = get_current_grid();\n var max_turns = grid.grid.max_turns;\n var tick_spacing = grid.grid.tick_spacing;\n for (var i = 0; i <= max_turns-1; i++) {\n var turn = document.createElement(\"div\");\n turn.className = \...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this function takes as an input an 2D array and the name of the data to write it into a csv string
function writeToCSV(data, name) { console.log("writing CSV for " + name + " of length " + data.length); if (data.length == 0) { return ""; } else if(typeof name == 'string') { var labels = ["Timestamp"]; for(var i = 1; i < data[0].length; i++) { if(data[0].length == 2) { label...
[ "function convertToCSV(arr){\n\n}", "function exportDataToCSV(){\n var arr = [['x', 'y']];\n for(var i = 1; i <= arrX.length; i++){\n arr.push([arrX[i-1], arrY[i-1]]);\n }\n var csv = [];\n for(var i = 0; i < arr.length; i++){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
internal : checks if an edge given by kx, ky is in tbEdges return index in tbEdges, or false
function edgeIsInTbEdges (kx, ky, edge) { let k; for (k = 0; k < tbEdges.length;k++) { if (kx == tbEdges[k].kx && ky == tbEdges[k].ky && edge == tbEdges[k].edge) return k; // found it } return false; // not found } // function edgeIsInTbEdges
[ "function edgeIsCommon (kx, ky, edge) {\n let k;\n switch(edge) {\n case 0 : ky--; break; // top edge\n case 1 : kx++; break; // right edge\n case 2 : ky++; break; // bottom edge\n case 3 : kx--; break; // left edge\n } // switch\n for (k = 0; k < tbCases.length;k++) {\n if (kx ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Makes the ducks move toward their target
function moveDucks() { for (i=0; i < ducks.length; i++) { var differenceX = ducks[i].targetX - ducks[i].posX; var differenceY = ducks[i].targetY - ducks[i].posY; ducks[i].posX = ducks[i].posX + differenceX/20; ducks[i].posY = ducks[i].posY + differenceY/20; } }
[ "function updateTargets() {\n\tfor (i=0; i < ducks.length; i++) {\n\t\tducks[i].targetX = Math.random() * (700-duckSize);\n\t\tducks[i].targetY = Math.random() * (550-duckSize);\n\t}\n}", "function ducksFly() {\n\tvar canvas = document.getElementById(\"game\");\n\n\tfor (i=0; i < ducks.length; i++) {\n\t\tducks[i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
_updateDebugTimer updates the Appdash debug timer in the lower lefthand corner of the page to represent the given duration (unix timestamps).
_updateDebugTimer(startTime: number, endTime: number) { let debug = document.querySelector("body>#debug>a"); const loadTimeSeconds = (endTime-startTime) / 1000; // $FlowHack if (debug) debug.text = `${loadTimeSeconds}s`; }
[ "function updateTimer() { // eslint-disable-line\n const difference = hunt.getTimeElapsed();\n const seconds = difference % (1000 * 60) / 1000;\n const minutes = difference % (1000 * 60 * 60) / (1000 * 60);\n const hours = difference % (1000 * 60 * 60 * 24) /\n (1000 * 60 * 60);\n document.getElementById(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks whether `element` is a React element of type `Component` (or one of the passed components, if `Component` is an array of React components).
function isElementOfType(element, Component) { var _element$props; if (element == null || ! /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__["isValidElement"])(element) || typeof element.type === 'string') { return false; } const { type: defaultType } = element; // Type override allows compone...
[ "function isElementOfType(element, Component) {\n if (element == null || !react__WEBPACK_IMPORTED_MODULE_0___default.a.isValidElement(element) || typeof element.type === 'string') {\n return false;\n }\n\n var type = element.type;\n var Components = Array.isArray(Component) ? Component : [Component];\n retu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
modify an existing templateEngine to work with string templates
function createStringTemplateEngine(templateEngine) { var orig = templateEngine.makeTemplateSource; templateEngine.makeTemplateSource = function(templateName) { if (typeof templates[templateName] !== 'undefined') { return new ko.templateSources.stringTemplate(templateName, templates[templateName]); } ...
[ "function templateEngine () { }", "function createStringTemplateEngine(templateEngine, templates) {\n templateEngine.makeTemplateSource = function (template) {\n return new ko.templateSources.stringTemplate(template, templates);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs a new Run.
constructor() { Run.initialize(this); }
[ "constructor() {\n\n V1Run.initialize(this);\n }", "function create(tests) {\n var instance = new TestRun();\n instance.init(tests);\n return instance;\n}", "function Runner() {\n return _super.call(this, 'Runner') || this;\n }", "constructor(state, start, end, parent=null, globalStyle=...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Send the requeste to edit user's password Verifies if the past password is correct and if the new passwords match
function editUser(){ const opsw = document.getElementById("opsw").value; const npsw = document.getElementById("npsw").value; const cpsw = document.getElementById("cpsw").value; if(opsw != user_psw){ alert("Wrong old password"); } else if(npsw==""){ alert("Password can't be empty") } else if(npsw != cpsw){ ...
[ "async changePassword() {\n \n // .......... authority judge\n \n \n const user = this.ctx.request.body;\n const result = await this.service.users.update(user);\n\n // user doesn't exist\n if (result.code >= 400) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Visualizes the excluded cells by blacking them out.
function blackOutExclusionsSVG(exclusions) { for (let x = 0; x < exclusions.length; x++) { for (let y = 0; y < exclusions[x].length; y++) { if (!(exclusions[x][y])) continue; let width = CELL_WIDTH_PIXELS * DENSITY; d3.select("#canvas").append("rect") .att...
[ "function unfilterMoodCells() {\n let cells = getFilterableMoodCells();\n for (let i = 0; i < cells.length; i++) {\n unhideMoodCell(cells[i]);\n }\n}", "function hideCells() {\n for (var i = 0; i < gGame.mines.length; i++) {\n var selector = '.cell-' + gGame.mines[i].i + \"-\" + gGame.mi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to save slider
function save(data){ const newSlider = new sliderModel({ image : data.image, category : data.category, status : data.status }) return newSlider.save(); }
[ "function saveSliderChoices() {\n\n for (var i = 0; i < 2; ++i) {\n var sliders = []; \n $(\"#sliders_\" + (i + 1) + \" .slider-box .ui-slider-handle\").reverse().each(function() { \n sliders.push($(this).html());\n });\n state.products[i].sliders = sliders;\n }\n nextPhase();\n\n}", "function...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ajax fetch tickit details
function ajaxFetchTickitDetails() { //this form is set to work with Prod as an example $.ajax({ crossDomain: true, url: 'http://www.pinpoint311.com/flippadoo/mobile/tickitService/888666555/fetchTickitDetails', type : 'get', async : true, ca...
[ "function ajaxFetchTickitDetails()\r\n{\r\n\t \r\n \t //this form is set to work with Prod as an example \t \r\n \t $.ajax({\r\n\t\t\tcrossDomain: true, \r\n \t\t\turl: 'http://www.pinpoint311.com/flippadoo/mobile/tickitService/888666555/fetchTickitDetails',\r\n \t\t\ttype : 'get',\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove hash on a URL.
function removeHash(url) { var link = url; if (!url.href) { link = document.createElement('A'); link.href = url; } return link.href.replace(link.hash, ''); }
[ "function stripHash(url) {\n return url.split('#')[1];\n }", "function stripHash(href) {\n return href.replace(/#.*/, '');\n }", "function removeHash() {\n window.location.hash = '!';\n }", "function stripURL(url) {\n var withoutQs = url.split(\"?\")[0];\n var withoutHash = withoutQs.spli...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks the current style is heading style.
isHeadingStyle(para) { let style = para.paragraphFormat.baseStyle; if (style !== undefined) { return isNullOrUndefined(this.tocStyles[style.name]) ? false : true; } return false; }
[ "function isHeading(node) {\n return node.type === 'heading';\n}", "function isHeading (element) {\n let headingNames = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n return (headingNames.indexOf(element.tagName) >= 0);\n}", "function isHeading(node)\n{\n\tif (!node.tagName) return false;\n\tif (node.tagName.matc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return the path of the talent's image
function getTalentImgPath(talentId, classId, spec) { if (!talentId) { return ''; } return '/images/talents/' + classId + '/' + spec + '/' + talentId + '.jpg'; }
[ "function talentImgPath() {\n return talentHelper.getTalentImgPath(scope.talentId, scope.classId, scope.specs[scope.classId][scope.tree]);\n }", "getPath() {\n let path = '' + this.theme+'-images'+ '/';\n return path;\n }", "function getImagePath(src) {\n const inde...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
retrieves all the links in the str
function getLinks(str) { var linkArray = new Array(); var done = false; while (done == false) { var webAddress = getSubStr(str, "\"", "\""); if (webAddress == null) { done = true; } else { linkArray.push(webAddress); st...
[ "function fetch_links(str){\n var links=[]\n var tmp=str.match(/\\[\\[(.{2,80}?)\\]\\](\\w{0,10})/g)//regular links\n if(tmp){\n tmp.forEach(function(s){\n var link, txt;\n if(s.match(/\\|/)){ //replacement link [[link|text]]\n s=s.replace(/\\[\\[(.{...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generate oauth header object
function generateOauthHeader(url, method, oauthToken = '', extraHeaders = {}, formData = {}) { if (!url || !method) { return ''; } const authObject = Object.assign({ oauth_consumer_key: process.env.TWITTER_CONSUMER_KEY, oauth_nonce: generateNonce(), oauth_signature_method: 'HMAC-SHA1', oauth_...
[ "function createOAuthHeader(data, ctx) {\n if (typeof data.options.tokenJSONpath !== 'string') {\n return {};\n }\n // Extract token\n const tokenJSONpath = data.options.tokenJSONpath;\n const tokens = JSONPath.JSONPath({ path: tokenJSONpath, json: ctx });\n if (Array.isArray(tokens) && tok...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Exit a parse tree produced by LUFileParserentityDefinition.
exitEntityDefinition(ctx) { }
[ "exitNewEntityDefinition(ctx) {\n\t}", "exitEntityDeclaration(ctx) {\n\t}", "exitNewEntitySection(ctx) {\n\t}", "exitNestedEntityMapping(ctx) {\n\t}", "exitEntitySection(ctx) {\n\t}", "exitNewEntityLine(ctx) {\n\t}", "exitImportDefinition(ctx) {\n\t}", "exitParse(ctx) {\n\t}", "exitEraDeclaration(ct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: can get rid of this Downloads CSV data.
downloadCSV(data, filename=`anudegree_${new Date().getTime()}`) { downloadFile(data,`${filename}.csv`, "data:text/csv;encoding-8"); }
[ "function downloadCsv() {\n\t\t\t\tvar today = new Date();\n\t\t\t\ttoday = formatDate(today);\n\t\t\t\tvar val1 = currentRecord.get();\n\t\t\t\tvar csv = val1.getValue({\n\t\t\t\t\tfieldId : 'custpage_table_csv',\n\t\t\t\t});\n\t\t\t\ttoday = replaceAll(today);\n\t\t\t\tvar a = document.createElement(\"a\");\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
List everyone and their reach (sum of of followers and of followers of followers) aka looking for all paths of length 2
function calculateReach() { let reach = {}; for (let user in pplThatFollowUser) { let final = pplThatFollowUser[user]; let arr; for (i = 0; i < pplThatFollowUser[user].length; i++) { arr = pplThatFollowUser[pplThatFollowUser[user][i]]; final = Array.from(new Set(arr.concat(final))); ...
[ "function listReach() {\n for (const elem in data) {\n var person = data[elem];\n var reach = 0;\n var out = \"\";\n\n out += person.name + \" has a reach of \";\n\n for (const elem in person.follows) {\n var follows = find(person.follows[elem]);\n reach++;\n\n for (const elem in foll...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compiles TS Files in TypeDoc theme directory
function compileTypeDocTheme() { console.log('Compile TypeDoc theme'); execSync( `${path.normalize( ENV_NODE )} ./node_modules/typescript/lib/tsc.js -p ${TYPEDOC_THEME_PATH}` ); }
[ "function compileAllFiles() {\n \n var files = fs.readdirSync(dir);\n \n console.log(\"Found %s template files to compile.\", files.length);\n \n files.forEach(function(file) {\n \n compileSingleFile(file);\n \n });\n \n}", "function watchTsFiles() {\n watch([\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
footer height = footerplaceholder height fix
function footerHeight() { $('.footer').addClass('active'); $('.footer_placeholder').height($('.footer').outerHeight()); }
[ "function setFooterHeight() {\n if ($(\".radio-player\").height() && $(\"footer\").height()) {\n var playerHeight = $(\".radio-player\").height();\n var footerPresentHeight = $(\"footer\").height();\n var footerFinalHeight;\n\n footerFinalHeight = footerPresentHeight + (playerHeight + 20);\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Takes a feature and opens the popup on the map. Is typically used when an item in the list is selected. Input: The feature that we want to open the popup for
function openFeaturePopup(feature){ map.infoWindow.setFeatures([feature]); map.infoWindow.show(feature.geometry); }
[ "function onFeatureSelect(evt) { \n var feature = evt.feature;\n var dom = $(feature.attributes.description); // build new dom for jquery\n var content = \"\"; // content of the popup\n var title = feature.layer.name;\n \n // if there are special labels set in the config, apply them\n if(fea...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Cocktail Shaker sorting algorithm
function cocktailShakerSort(array, delay){ var data = array.slice(); var swaps = 0; //Main loop for(var i = 0; i < data.length/2; i++){ var swapped = false; //Sorts next, unsorted largest-value for(var j = i; j < data.length - i - 1; j++){ if(data[j] > data[j...
[ "function shellSort (a) {\n for (var h = a.length; h = parseInt(h / 2);) {\n for (var i = h; i < a.length; i++) {\n var k = a[i];\n for (var j = i; j >= h && k < a[j - h]; j -= h)\n a[j] = a[j - h];\n a[j] = k;\n }\n }\n return a;\n}", "functi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function will say whether a "specific" team was selected (basically if the team isn't "all").
function isSpecificTeamSelected(){ var selectedTeams = getSelectedTeams(); if (selectedTeams.length > 1){ return false; } var selectedTeam = selectedTeams[0].value; if ('all' == selectedTeam){ return false; } return true; }
[ "function isSpecificPlayerSelected(){\n\t\n\tvar selectedPlayers = getSelectedPlayers();\n\t\n\tif (selectedPlayers.length > 1){\n\t\treturn false;\n\t}\n\t\n\tvar selectedPlayer = selectedPlayers[0].value;\n\t\n\tif ('all' == selectedPlayer){\n\t\treturn false;\n\t}\n\t\n\treturn true;\n}", "function _alreadySel...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if the string matches to a valid MIME type format If given value is not a string, then it returns false.
function isMimeType(value) { return typeof value === 'string' && validator_lib_isMimeType__WEBPACK_IMPORTED_MODULE_1___default()(value); }
[ "function isMimeType(value) {\n return typeof value === \"string\" && validator.isMimeType(value);\n}", "function isMimeType(value) {\n return typeof value === \"string\" && validator.isMimeType(value);\n }", "function isMimeType(value) {\n return (/^[-\\w]+\\/([-\\w]+|\\*)$/).test(value);\n}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given the fund `id` and date, find the running total, recurse for balance. TODO: Test this with unit testing!
dateSelector(state, id, date) { id = id || "all" // is_manual // -> has_fringe -> rate // -> has_indirect -> rate // !is_manual // -> is_fringe -> total // -> is_indirect -> total const payments = id === "all" ? records.groupBy(state, this.paymentSelector, "date").getArray(date) ...
[ "function getBalance(date){\n //Variables for initializing vacation days\n var balanceStart = new Date(2020,0,0,23,59); //Specifies the day that we want to start calculating the balance at\n var balance = 40; //in hours, intialize with the balance at the specified balanceStart\n var accR...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function for multiple worklists
function createWorklistHelper() { var pfs = { maxResults : $scope.clusterCt, startIndex : $scope.skipClusterCt, sortField : $scope.sortOrder }; // Create worklist workflowService.createWorklist($scope.selected.project.id, $scope.bin.id, $scope.clusterType, pfs).t...
[ "function fillWorkLists(){\n var listToUse;\n switch(currentType) {\n case \"all\":\n \n break;\n case \"haarwild\":\n listToUse = haarwildList;\n break;\n default:\n console.log(\"Error! Could not fill name list. Unknown currentType!...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Turns the motor "forwards" at speed ( default 100% )
forwards(speed) { if (speed === undefined) { this._speed = 100; } else { if (speed < 0 || speed > 100) { throw "Speed must be between 0 and 100" } this._speed = speed; } this._applySpeed(); }
[ "function set_motor_speed(index, value)\r\n{\r\n\tif (value == 0) {\r\n\t\tstop_motor(index);\r\n\t}\r\n\tvar prev_state = motor_states[index];\r\n\tif (value > 0 && prev_state != \"f\")\t\t\tset_motor_forward(index);\r\n\telse if (value < 0 && prev_state != \"r\")\tset_motor_reverse(index);\r\n\tsend_motor_noreply...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This captures all of the users thats applied to the post using the user service
ngOnInit() { this.userService.getApplyUsersByPost(this.post).subscribe(u => { this.setAppliedUsers(u); this.appliedLength = this.appliedUsers.length; this.userService.getPosterByPost(this.post).subscribe(u => { this.user = u; }); }); }
[ "getApplyUsersByPost(p) {\n return this.http.get(\"http://localhost:8080/api/users/appliedUsers/\" + p.id);\n }", "async getUsers () {\n\t\tlet userIds = this.posts.reduce((accum, post) => {\n\t\t\taccum = [...accum, post.get('creatorId'), ...(post.get('mentionedUserIds') || [])];\n\t\t\treturn accum;\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function used later in code to update the monthly databases current month.
function updateMonthlyDBMonth() { let output = client.getMonthlyScore.get(`MONTH`); //Get date info from OS... var date = new Date(); //Split into month with preceeding 0... var month = ("0" + (date.getMonth() + 1)).slice(-2); //Prepare database entry... if (!output) { input = { id: `MONTH`, ...
[ "function updateMonth() {\n updateCal(30);\n}", "function updateCurrentDates1(month, year){\n data.calendar.month = month;\n data.calendar.year = year;\n}", "function updateMonthlyPayment() {\n const currentValues = getCurrentUIValues();\n showUpdatedMonthly(monthlyFormula(currentValues));\n}", "func...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create preloader elements for the menu popup.
function createMenuPopupPreloader() { return $('<div>', { 'id': 'menu-popup-preloader', 'class': 'preloader-container menu-popup-preloader' }) .append($('<div>').addClass('preloader')) .appendTo($('body')) .on('click', function(e) { e.stopPropagation(); }) .hide(); }
[ "function _loadPreloadPanle() {\r\n if (options.showPreview)\r\n $(\".preloader\").show();\r\n if (options.showBlocker)\r\n $(\".preloader-blocker\").show();\r\n }", "function showPreloader(){\n\t\t//$('#main_preloader').show();\n\t\t//$('#main_overlay')....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle synchronous LED blink command with request and response payload.
function onBlink(request, response) { console.log('Received synchronous call to blink'); var responsePayload = { status: 'Blinking LED every ' + request.payload + ' seconds' } response.send(200, responsePayload, (err) => { if (err) { console.error(...
[ "function doBlinkCmd(doBlinkcommand) {\n //emmit command event to execute after its detection\n io.emit(\"doBlinkcommand\", {doBlinkcommand: doBlinkcommand});\n}", "actuateBell(req, res) {\n const command = getJSONCommand(req.body);\n const deviceId = 'bell' + req.params.id;\n\n if (IoTDevices.notF...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set the time period the options for the data are 'short', 'medium', and 'long'
setTimePeriod (state, data) { console.log("time period setter:" + data); state.timePeriod = data; }
[ "function fnSetPeriods() {\r\n\t\t\t\r\n\t\t\tvar startTime = new Date(properties.guiActivityStartController.getValue());\r\n\t\t\tvar endTime = new Date(properties.guiActivityEndController.getValue());\t\t\t\t\t\r\n\t\t\tvar interval = intervalController.getValue();\r\n\t\t\tvar aPeriods = [];\r\n\t\t\tfor ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return an array of all the skills that mentors are tagged with.
getAllSkills(): Array<string> { return Array.from(this._skillsToMentors.keys()); }
[ "function getAllSkills () {\n return skills;\n }", "function getSkills(mentors) {\n arrSkills = [];\n for (i = 0; i < mentors.length; i++) {\n arrSkills.push(mentors[i].skills.length)\n }\n return arrSkills;\n }", "function getSkills() {\n var data = [];\n for (var skillName in s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resolves the field on the given source object. In particular, this figures out the value that the field returns by calling its resolve function, then calls completeValue to complete promises, serialize scalars, or execute the subselectionset for objects.
function resolveField(exeContext, parentType, source, fieldNodes, path) { var _fieldDef$resolve; var fieldNode = fieldNodes[0]; var fieldName = fieldNode.name.value; var fieldDef = getFieldDef(exeContext.schema, parentType, fieldName); if (!fieldDef) { return; } var returnType = fieldDef.type; va...
[ "function resolveField(exeContext, parentType, source, fieldNodes, path) {\n var _fieldDef$resolve;\n\n var fieldNode = fieldNodes[0];\n var fieldName = fieldNode.name.value;\n var fieldDef = getFieldDef(exeContext.schema, parentType, fieldName);\n\n if (!fieldDef) {\n return;\n }\n\n var returnType = fie...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
save stats to storage
function saveStats(){ sessionStorage.setItem('stats', JSON.stringify(stats)); sessionStorage.setItem('statsinfo', JSON.stringify(statsinfo)); }
[ "async function saveStats() {\n if (statsPath == undefined) return\n if (saveStatsTimer) {\n clearTimeout(saveStatsTimer)\n saveStatsTimer = undefined\n }\n\n await ensureDir(dirname(statsPath))\n\n if (await exists(statsPath + \".old\"))\n await unlink(statsPath + \".old\")\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an NTFS "directory junction" on Windows operating systems; for other operating systems, it creates a regular symbolic link. The link target must be a folder, not a file. Behind the scenes it uses `fs.symlinkSync()`.
static createSymbolicLinkJunction(options) { FileSystem._wrapException(() => { return FileSystem._handleLink(() => { // For directories, we use a Windows "junction". On POSIX operating systems, this produces a regular symlink. return fsx.symlinkSync(options.linkTarge...
[ "createSymboliclink(target, link, done) {\n const commands = [\n 'mkdir -p ' + link, // Create the parent of the symlink target\n 'rm -rf ' + link,\n 'mkdir -p ' + utils.realpath(link + '/../' + target), // Create the symlink target\n 'ln -nfs ' + target + ' ' + li...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This class is for Subtitle operations. It works with Player
function Subtitle(srt, Player, target) { var _this = this; _classCallCheck(this, Subtitle); this.Player = Player; this.srt = srt; this.target = document.querySelector(target); _logger2.default.addLog('Player - Subtitle', 'create', 'Subtitle initialization started', this); this.set...
[ "function loadSubtitles(subtitlesURL) {\n /* Hide any previously uploaded subtitles */\n $('.subtitles').css(\"display\", \"none\");\n\n /* Initialize new bubbles instance */\n if (!subBubblesVideo) {\n subBubblesVideo = new Bubbles.video('sub-video');\n registerKeyboardListeners();\n }\n\n /* language ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
PUT /team/:id route to update an specific team.
function updateTeam(req, res) { Team.findById({_id: req.params.id}, (err, team) => { if (err) { res.send(err); } Object.assign(team, req.body).save((err, team) => { if (err) res.send(err); res.json({ message: 'Team successfully updated!', team }); }); }); }
[ "function updateTeam(req, res) {\n \n const { id } = req.params.id;\n console.log({ body: req.body, id });\n\n Team.findByIdAndUpdate(req.body._id, req.body)\n .exec()\n .then(() => \n res.status(200).send('team updated')\n )\n .catch(err => { throw err })\n}", "function editTeam(teamId) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Mark a post as flagged.
function flagPost() { // get flagged post let flagged; let posts = qsa(".card"); for (let post of posts) { if (!post.classList.contains("hidden")) { flagged = post; } } // add to database processFlag(flagged); // display message id("flag-message").classList.remo...
[ "function processFlag(post) {\n // get post information and build query string\n let id = post.id;\n let title = post.querySelector(\"h2.title\").textContent;\n let content = post.querySelector(\"p.content\").textContent;\n let queryString = \"id=\" + id +\n \"&title=\" + title +\n \"&conte...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get layer child analysis successor link count.
function getLayerSuccCount (ln) { return ln.children.values() .map(function (an) { return an.succLinks.size(); }) .reduce(function (acc, pls) { return acc + pls; }); }
[ "function getLayerPredCount (ln) {\n return ln.children.values()\n .map(function (an) {\n return an.predLinks.size();\n })\n .reduce(function (acc, pls) {\n return acc + pls;\n });\n }", "getCount() {\n this.info.linkCounter += 1;\n return this.i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates the Json object in which the form Builder will work on.
createFormJson() { const email = this.options.fields.filter(f => f.name === 'email'); const form = []; this.options.fields.forEach((f) => { if (f === 'email' || f.name === 'email') { return; } let name = ''; let type = 'text'; let label = ''; if (typeof f === 'st...
[ "function JSONBuilder() {\r\n\t\r\n\tvar jsonStructure = new Array();\r\n\t\r\n\tthis.addProperty = function(name, value) {\r\n\t\tif (jsonStructure[name] == undefined) {\r\n\t\t\tjsonStructure[name] = new Array();\r\n\t\t}\r\n\t\t\r\n\t\tjsonStructure[name].push(value);\r\n\t}\r\n\t\r\n\tthis.toJSONString = functi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the date from a timestamp.
function get_date_from_timestamp(timestamp) { return timestamp.substring(0, 10); }
[ "function getDateFromTimestamp (timestamp) {\n const month = timestamp.substring(0, 2);\n const day = timestamp.substring(2, 4);\n const year = timestamp.substring(4, 8);\n const hour = timestamp.substring(8, 10);\n const minute = timestamp.substring(10, 12);\n const second = timestamp.substring(1...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Populates Earth with passengers and houses.
function populate() { // mark houses for (var house in HOUSES) { // plant house on map new google.maps.Marker({ icon: "https://google-maps-icons.googlecode.com/files/home.png", map: map, position: new google.maps.LatLng(HOUSES[house].lat, HOUSES[house].lng...
[ "function populate()\n{\n\t// mark houses\n\tfor (var house in HOUSES)\n\t{\n\t\t// plant house on map\n\t\tnew google.maps.Marker({\n\t\t\ticon: \"http://google-maps-icons.googlecode.com/files/home.png\",\n\t\t\tmap: map,\n\t\t\tposition: new google.maps.LatLng(HOUSES[house].lat, HOUSES[house].lng),\n\t\t\ttitle: ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a serialized copy of the exported visual model
exportSerializedVisualModel() { let iv = this.i.ac(); return (iv); }
[ "exportSerializedVisualModel() {\n let iv = this.i.bt();\n return (iv);\n }", "exportSerializedVisualModel() {\n let iv = this.i.v();\n return (iv);\n }", "exportSerializedVisualModel() {\n let iv = this.i.bh();\n return (iv);\n }", "exportSerializedVisualMod...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The component is rendered based on the state (editing or not) and on the content (whether is empty), wile editing there's a big TextInput and on the right the two buttons for ok and delete (the first is there only if there's input, the second only when editing elements, not in the $new). When the element is idle, the d...
render(){ return this.state.edit ? ( <View style={styles().item}> <TextInput value={this.state.tmp} placeholder="Add new item" onChangeText={val=>this.setState({tmp:val})} autoFocus={true} autoCapitalize="none" style={[styles(...
[ "renderItems() {\n if (this.state.isEditing) {\n //renders editable note, replace \"p\" field with \"input\",\n //and add eventListener.------\n return (\n <div className=\"single-note align-center\">\n <div className=\"note-header\">\n <button\n onClick={()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transform the trick play data from the incoming manifest to the TrickPlay type and sort by size
function transformTrickPlayList() { var downloadables, trickplayList = []; // There should only be one trick play track with both the // large and small stream info. So get the downloadables of // the first trickplay track if (manifest['trickPlayTracks'] && manifest[...
[ "function sortTripManifest() {\n\ttripObject[\"tripManifests\"].sort(function (a, b) {\n\t\treturn parseFloat(a.order) - parseFloat(b.order);\n\t});\n}", "static sortSizes (sizes) {\n return sortBy(sizes, 'width')\n }", "_sortSkills(skills) {\r\n // Break down skills object into an array for sorting (I h...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
But maybe the number is already negative? Example: makeNegative(1); // return 1 makeNegative(5); // return 5 makeNegative(0); // return 0 makeNegative(0.12); // return 0.12 Notes: The number can be negative already, in which case no change is required. Zero (0) is not checked for any specific sign. Negative zeros make ...
function makeNegative (number) { if (number < 0) { return number } else { number = (number * -1); return number } }
[ "function makeNegative(num) {\n if (num >0)\n return -num;\n else\n return num;\n\n}", "function makeNegative(num) {\n if(num <= 0){\n return num\n }else if(num > 0){\n return num - num * 2\n }\n}", "function makeNegative(num) {\n // Code?\n if (num < 0){\n return num\n }\n els...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reduces down rider trips to those within some distance constraint of driver trip Constraint: Rider trip is less than MaxDriverDistanceDiff
function cutTripsByDistance(driverTrip, riderTrips) { let riderTripsDistance = []; if (typeof riderTrips === "undefined" || driverTrip === "undefined") { return []; } let newDriverRoute = driverTrip.tripRoute; riderTrips.forEach(function(riderTrip) { let newRiderRoute = riderTrip.tripRoute; let riderDista...
[ "function cutTripsByBearing(driverTrip, riderTrips) {\n\tif (typeof riderTrips === \"undefined\" || typeof driverTrip === \"undefined\" || riderTrips === []) {\n\t\treturn [];\n\t}\n\n\tlet newDriverRoute = driverTrip.tripRoute;\n\tlet driverBearing = LatLng.getLatLngBearing(newDriverRoute.routes[0].legs[0].start_l...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Because lessons are being stored in localStorage it is best that Laranotti cleans localStorage from watched lessons older that 1 week but only if the maximum number of lessons exceeds ~20 lessons.
cleanOldLessons() { if(this.lessons.length > this.lessonsToKeep) { // Get current date var currentDate = new Date(); // Subtract 7 days to current date. currentDate.setTime(currentDate.getTime() - 7 * 86400000); this.lessons = this.lessons.fil...
[ "checkIfLessonInThePast() {\n let today = new Date();\n\n for (let i = 0; i < this.state.lessons.length; ++i) {\n let temp = new Date(this.state.lessons[i].date);\n if (this.state.lessons[i].status === \"To_Give\" && temp < today) {\n this.lessonStatusChange(this.s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
PROTECTED Constructor The popup menu owned by the Map object. Since this popup menu is displayed only when a right click is detected over any element of the map that has a popup menu items list attached, by default this object has no items list to display. This list is inherited from the richt clicked object. The ident...
function PopupMenu() { this.id = "popupmenu"; this.items = null; this.attachListItems = attachListItemsToPopupMenu; this.write = writePopupMenu; this.show = showPopupMenu; this.hide = hidePopupMenu; this.allocate = allocatePopupMenu; }
[ "function emxUICorePopupMenu() {\n this.superclass = emxUIObject;\n this.superclass();\n delete this.superclass;\n this.cssClass = \"menu-layer\";\n this.emxClassName = \"emxUICorePopupMenu\";\n this.items = new Array;\n this.layer = null;\n this.innerLayer = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates data structure for drawing network with cytoscape.
toCytoscapeNetwork () { return [ // nodes ...new Array(this.state.network.numberOfNodes).fill(undefined).map((_, i) => ({ data: { id: i, label: i === 0 ? 's' : (i === this.state.network.numberOfNodes - 1 ? 't' : i) }, position: this.state.nodePositions[i], classes: `${this.state....
[ "function makeGraph() {\n \n }", "function createGraph(lines) {\n var data = [];\n lines.forEach(function (line) {\n line = line.replace(/(\\r\\n|\\n|\\r)/gm, \"\"); // remove all \\r \\n \n var parts = line.split(\" \");\n if (parts[0] == \"knoten\") {\n d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
load source code of svg image into place defined by tag div with defined id
function load_svg(id,filename){ xhr = new XMLHttpRequest(); xhr.open("GET",filename,false); // Following line is just to be on the safe side; // not needed if your server delivers SVG with correct MIME type xhr.overrideMimeType("image/svg+xml"); xhr.send(""); document.getElementById(id).appendChild(xhr.responseX...
[ "function loadMap(){\n var source = \"img/map.svg\";\n var div = document.getElementById('imgDiv');\n var elem = document.createElement('img');\n elem.setAttribute(\"src\", source);\n elem.setAttribute(\"height\", \"800\");\n elem.setAttribute(\"width\", \"650\");\n elem.setAttribute(\"id\",\"i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Open popup window for viewing a calc field's equation
function viewEq(field) { var metadata_table = (status > 0 && page == 'Design/online_designer.php') ? 'metadata_temp' : 'metadata'; $.get(app_path_webroot+'DataEntry/view_equation_popup.php', { pid: pid, field: field, metadata_table: metadata_table }, function(data) { if (!$('#viewEq').length) $('body').append('<...
[ "function viewEq(field, isDataCalc, isCalcText) {\r\n var metadata_table = (status > 0 && page == 'Design/online_designer.php') ? 'metadata_temp' : 'metadata';\r\n $.get(app_path_webroot+'DataEntry/view_equation_popup.php', { pid: pid, field: field, metadata_table: metadata_table, calcdate: isDataCalc, calcte...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Encrypt the selected file and display the data
function decryptFile() { var preview = document.getElementById('encrypt-display'); var file = document.querySelector('input[type=file]').files[0]; var reader = new FileReader() reader.onload = function(event) { passphraseEncrypt = document.getElementById('encrypt-password').value; var b...
[ "function encryptFile() {\n var file = document.querySelector(\"input[type=file]\").files[0];\n var reader = new FileReader();\n\n reader.onload = function (event) {\n var ciphertext = CryptoJS.AES.encrypt(event.target.result, passphrase).toString();\n document.getElementById(\"encrypt-display\").innerHTML...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
End of code Surface Area formulas Cube Surface Area
function surfaceAreaCube(side){ return -1; }
[ "function surfaceAreaCube(side){\n // let sixCube = (side * 6) * 2;\n // return sixCube;\n\n return Math.pow(side,3);\n}", "cubeSurfaceArea (){\n return 6 * (this.length * this.length)\n}", "function areaOfCube (l, w, h) {\n area = l * w * h\n return area;\n}", "getSurfaceArea() {\n const surf...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function: getPlace Return the parsed value of a number in a certain position in the target language. For example, if n = 123, getPlace(n, 1, 10) will return the equivalent of "twenty" in the target language, and getPlace(n, 1, 1) will return the equivalent of "two" in the target language.
function getPlace(n, which, scale) { return numbers[parseInt(n.toString()[which]) * scale]; }
[ "function getPlace(n, which, scale){\n return numbers[parseInt(n.toString()[which])*scale];\n }", "function getPosition(num, place) {\n return Math.floor(Math.abs(num) / Math.pow(10, place)) % 10;\n}", "function getDigit(num, place) {\n num = num.toString();\n\n if (place >= num.length) {\n re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if item has CST Enchant if lvl > 0 it will check also if enchant level >= lvl
function hasCSTEnchant(item, id, lvl=0) { var itemnbt = item.getNbt(); var cstenchs = nbtGetList(itemnbt, CSTENCH_TAG); for(var i in cstenchs as cstench) { if(cstench.getString("name") == id) { if(lvl > 0) { return parseInt(cstench.getShort("lvl")) >= lvl; } ...
[ "function hasCSTEnchant(item, id, lvl) {\n\tif(typeof(lvl) == typeof(undefined) || lvl === null) { lvl = 0; }\n var itemnbt = item.getNbt();\n var cstenchs = nbtGetList(itemnbt, CSTENCH_TAG);\n for(var i in cstenchs) {\nvar cstench = cstenchs[i];\n if(cstench.getString(\"name\") == id) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FIXME Do something (out in Skeleton/Character) to get a version of the final frame with all bones, so that when getPreviousFrame wraps back to the end of the animation, it can return the correct frame rather than frame 0 modified by the final CASFrame, which in general is partial. Moves the frame cursor back by one pos...
getPreviousFrame() { var f; f = this.fCur - 1; if (f < 0) { f = this.fCount - 1; } return this.setFrameAt(f); }
[ "getFrame(t) {\nvar NF, f, frame, resolved, was_complete;\n//-------\n// Allow for the possibility that the frame seqeuence is extended\n// while we are scanning it. In the case where our search apparently\n// hits the sequence limit this means (a) that we should check\n// whether new frames have been added, and (...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reads dimensions of panels. Returns true if total panel height is different from what was cached in state.
readPanelHeightsFromDom(dom) { const prevHeight = this.totalPanelHeight; this.panelHeights = []; this.totalPanelHeight = 0; const panels = dom.querySelectorAll('.panel'); logging.assertTrue(panels.length === this.attrs.panels.length); for (let i = 0; i < panels.leng...
[ "readPanelHeightsFromDom(dom) {\n const prevHeight = this.totalPanelHeight;\n this.panelPositions = [];\n this.totalPanelHeight = 0;\n const panels = dom.parentElement.querySelectorAll('.panel');\n logging.assertTrue(panels.length === this.attrs.panels.length);\n for (let i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Middleware for validating file format
function validate_format(req, res, next) { // If no files were selected if (!req.files) { return res.redirect('/') }; // Image/mime validation const mime = fileType(req.files.image.data); if(!mime || !accepted_extensions.includes(mime.ext)) return next(res.status(500).send('The uploaded file is ...
[ "function validate_format(req, res, next) {\n // For MemoryStorage, validate the format using `req.file.buffer`\n // For DiskStorage, validate the format using `fs.readFile(req.file.path)` from Node.js File System Module\n let mime = fileType(req.file.path);\n\n // if can't be determined or format not a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add sub add button on when Steak + Cheese is selected
function update_sub_add_on(){ // Update additional add on for Steak and Cheese let sub_add_on_div = document.querySelector("#sub_add_on_div"); let add_on_buttons = document.querySelectorAll('.add_on'); if (sub_select_name.value.trim() == "Steak and Cheese"){ // Steak and Cheese show 3 more add ons...
[ "function setSubToggleButtons() {\n // Add sub-menu toggle button\n $('.hb-menu > nav > ul > li > a.withSubmenu').after('<div class=\"hb-menu-subMenuToggle hide-selection\" id=toggle><i class=\"fa fa-fw fa-plus\" style=\"color: white;\"></i></div>');\n}", "addToSelected(e) {\n\n if (this.$el.hasClass('...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unlikes this item as the current user
unlike() { return this.clone(Item, "unlike").postCore(); }
[ "function dislike() {\n LikeService.delete(vm.user.username, $stateParams.id, vm.currentUser._id)\n .then(() => {\n // remove like from local array\n vm.likes.splice(vm.likes.findIndex(x => x._id == vm.currentUser._id), 1);\n\n vm.isLiked = false;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders Item status and color indicator. Status colors are set via CSS (layout.scss) dependent on the `datastatus` attribute.
parsedStatus(){ const { context } = this.props; if (!context || !context.status) return <div/>; return ( <div className="indicator-item item-status" data-status={ context.status.toLowerCase() } data-tip="Current Status"> { context.status } </div> ...
[ "function statusHtml(data, type, full, meta) {\n var status = \"<i class='fa \";\n switch (data.statusflg) {\n case 0:\n status += \"fa-h-square pointer' title='Hospital Project'></i>\";\n break;\n case 1:\n status += \"fa-archive poin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
draws strings and triangle flags
function drawStrings(){ noFill(); stroke(255); strokeWeight(1); smooth(); line(370,0,800,435); line(290,0,0,285); line(370,0,800,200); line(290,0,0,500); for(var i = -20; i < 1000; i = i + 60){ fill(255, 80, 80); noStroke(); smooth(); triangle(200 - i, 81 + i, 258 - i, 20 + i, 286 - i...
[ "draw(){\n push()\n textSize(this.size)\n if(this.leading){\n fill(192, 238, 191, this.opacity)\n text(this.text, this.x, this.y)\n }else{\n fill(55,170,66, this.opacity)\n text(this.text, this.x, this.y)\n }\n pop()\n }", "f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add tables you want to increment serial keys here
async function setNextSerialKeys() { const tableToKey = { "Users": "uid", "FTSchedules": "scheduleid", "Shifts": "shiftId", "Payout": "payId", "Address": "addrId", "Restaurants": "rid", "Promotions": "pid", "Orders": "oid", } for (const [table,...
[ "function addPrimaryKey() {\n for (table in model) {\n if (!(\"primaryKey\" in model[table]) && !(\"unique\" in model[table])) {\n model[table].primaryKey = \"id\"\n model[table].fields.id = dataTypes.int\n }\n }\n}", "function addNewRmRowTable(){\n\tcloneRmRowTableAutoIncrementNo();\n\tresetRmL...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This will contain a list of Contact objects and store entries in our address book. Instantiate new AddressBooks with a currentId property every time a new AddressBook is created, it will have a currentId property that begins at 0.
function AddressBook() { this.contacts = [], this.currentId = 0 }
[ "function AddressBook() {\n this.contacts = {};\n this.currentId = 0;\n}", "function AddressBook() {\n this.contacts = []\n this.idCounter = 0\n}", "function createContacts() {\n addressBook.Contacts.forEach(contact => {\n let newContact = new objects.Contact(\n contact.firstName,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show All Comments with Ajax request
function showComments( parent ) { $.ajax( { type: 'POST', url: 'bat/comments-form.php', success: function ( response ) { let commentsContent = $( parent ); let html = ''; let myJson = JSON.parse( response ); myJson.forEach( function ( comment ) { ...
[ "function getComments() {\n const postId= $(this).attr('id');\n $.ajax(commentsLink+\"?postId=\"+postId, {\n \"type\": \"get\",\n\n }).done(displayComments);\n}", "function loadComments() {\n let urlid = $('#new-comment-form').attr('URLid')\n let url = `/urls/${urlid}/comments`\n\n $('#commen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a Promise that sets the search config 'setup' to use the right target based on this build config. Any errors are expected to be caught by the caller's catch().
function configureSearch(state) { var configFile = state.environment.path.concat(['build', 'client', 'search', 'config.json']).join('/'); return fs.readJson(configFile, function (err, config) { var target = state.config.targets.deploy; config.setup = target; return fs...
[ "setup() {\n const projectPaths = AtomUtils.getProjectPaths();\n const projectConfigUrls = AtomUtils.getProjectConfigUrls(projectPaths);\n const projectSettings = Config.loadProjectSettings(projectConfigUrls);\n const configKeys = Object.keys(this.config);\n const userSettings = Config.loadUserSettin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
waitForKeyElements(): A handy, utility function that does what it says. Courtesy of stackoverflow user Brock Adams, taken from here:
function waitForKeyElements ( selectorTxt, /* Required: The jQuery selector string that specifies the desired element(s). */ actionFunction, /* Required: The code to run when elements are found. It is passed a jNode to the matched ...
[ "function waitForKeyElements(selectorTxt,\r\n/*\r\n * Required: The jQuery selector string that\r\n * specifies the desired element(s).\r\n */\r\nactionFunction,\r\n/*\r\n * Required: The code to run when elements are\r\n * found. It is passed a jNode to the matched\r\n * element.\r\n */\r\nbWaitOnce,\r\n/*\r\n * O...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
if clicked on symbol, the symbol is being attached to the mouses position and moves with it
function moveSymbol(_event) { if (move == true) { //false if left mouse button released on Canvas if (type == "rePosition") { selectedSymbol.x = _event.offsetX; //_event.offsetX is current position of mouse on canvas selectedSymbol.y = _event.offsetY; } ...
[ "function findSymbol(_event) {\n if (move == true) {\n move = false; //drop symbol on new position after edit\n }\n else {\n for (let i = 0; symbols.length > i; i++) { //goes through every symbol to check if clicked on\n if (symbols[i].name == \"cloud\") {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
traversal all the list and fn(list)
function traversal(list, fn) { var iterator = next(list); if (!iterator) { return; } var end = false; var done = function() { end = true; } while (iterator !== list) { var tmp = next(iterator); fn(iterator, done); if (end) { return; } iterato...
[ "function traversal(list, fn) {\n var iterator = next(list);\n if (!iterator) {\n return;\n }\n var end = false;\n var done = function() {\n end = true;\n }\n while (iterator !== list) {\n var tmp = next(iterator);\n fn(ite...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sample Standard Deviation = sqrt of sample variance
function sampleStdev(vals) { return Math.sqrt(sampleVariance(vals)) }
[ "get stDevSample(){\n return Math.sqrt(variance);\n }", "function stdev(vals) {\n return Math.sqrt(variance(vals))\n}", "standardDeviation () {\n return Math.sqrt(this.variance())\n }", "function stddev(variance) {\n var result = Math.sqrt(variance);\n console.log(\"The standard deviaiton...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all function nodes and names Return array of names and array of nodes
function get_functions(ast) { var names = []; var nodes = []; traverse(ast, (node) => { if (node.type === "FunctionDeclaration" && node.id !== null) { names.push(node.id.name); nodes.push(node); } if (node.type === "VariableDeclaration" && node.declarations[0].init !== null && node.declarations[0].init !...
[ "function getTopLevelFunctions (syntaxTree) {\n const fnNames = []\n for (let i = 0; i < syntaxTree.body.length; i++) {\n const itm = syntaxTree.body[i]\n if (itm.type === 'FunctionDeclaration') {\n fnNames.push(itm.id.name)\n }\n }\n return fnNames\n}", "function getNodes() {\n\t\treturn nodes;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ContextFixer, fixes a problem with the prototype based model When a method is called in certain particular ways, for instance when it is used as an event handler, the context for the method is changed, so 'this' inside the method doesn't refer to the object on which the method is defined (or to which it is attached), b...
function ContextFixer(func, context) { /* Make sure 'this' inside a method points to its class */ this.func = func; this.context = context; this.args = arguments; var self = this; this.execute = function() { /* execute the method */ var args = new Array(); // the fir...
[ "function ContextFixer(func, context) {\n /* Make sure 'this' inside a method points to its class */\n this.func = func;\n this.context = context;\n this.args = arguments;\n var self = this;\n \n this.execute = function() {\n /* execute the method */\n var args = new Array();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a tree to represent the linkage matrix and make it easy to compute distances between subtrees
function treeFromLinkageMatrix(data){ var N = data.labels.length, T = {}; data.Z.forEach(function(row, i){ T[N+i] = { children: [row[0], row[1]], weight: row[2], parent: null }; if (!(row[0] in T)) T[row[0]] = {}; T[row[0]].parent = N+i; if (!(row[1] in T)) T[row[1]] = {}; T[row[1]].paren...
[ "function create_hierarchy(lMerge) {\n var i=0, // Counter\n iSource = 0, // Index of source node (neg/pos)\n iTarget = 0, // Index of the target node\n fWeight = 0.0, // Weight of this combination (distance)\n iRow =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Group particular objects within an array of chart data
function groupCharts (chartData, groups) { let groupData = groups.map(g => { // indicatorId is a string, referencing chart IDs to be grouped, separated // by a '|' let chartsToGroup = g['indicatorId'].split('|') let groupData = chartsToGroup .map(groupInd => chartData.find(c => c.id === groupIn...
[ "formatDataSet(groups) {\n const dataset = []\n\n //extra counter used for colour assignment\n let i = 0\n\n //break down our groups into keys and values\n forEach (groups, (fuel_array, vehicle_key) => {\n\n //pull vehicle data based on matching vehicle_key to a vehicle url\n const vehicle ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
PRIVATE Gets the child items of the specified item. If any item is specified, all the parent items (those allocated inside the menu bar) are returned.
function getChildItems(fItem) { var item = (fItem == null) ? null : fItem; var list = new List(); for (var i = 0; i < this.items.getLength(); i++) { if (this.items.get(i).parentItem == item) { list.add(this.items.get(i)); } } return list; }
[ "function findItemChild(item){\n var arrayList=[];\n for(var i in allMenu){\n if(allMenu[i].parent == item.id){\n arrayList.push(allMenu[i]);\n }\n }\n return arrayList;\n }", "function findItemChild(item){\n var arrayList=[];\n for(v...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returned function converts a target layer feature id to multiple source feature ids TODO: option to join the source polygon with the greatest overlapping area TODO: option to ignore source polygon with small overlaps (as a percentage of the area of one or the other polygon?)
function getPolygonToPolygonFunction(targetLyr, srcLyr, mosaicIndex, opts) { var mergedToSourceIds = getIdConversionFunction(targetLyr.shapes.length, srcLyr.shapes.length); var selectMaxOverlap; if (opts.largest_overlap) { selectMaxOverlap = getMaxOverlapFunction(targetLyr, srcLyr, mosaicIndex); }...
[ "function calcIntersection(srcLayer, summaryColumn, features) {\r\n // TODO: need to come back and add logic to make sure that we actually have a drawing feature to work with\r\n var i, jstsReader, intersectFeature_albers, intersectGeomString, intersectGeomAlbers,\r\n intersectJ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
milesDriven = 0; public speed = 0; public
constructor() { this.milesDriven = 0; //you can prefix with _ to improve readability _mileDriven this.speed = 0; }
[ "function BonusSpeedShip() {\n speedSpatialShip += 1;\n}", "function Start() : void\n{\n\tprimaryAmmo \t= primaryMaxAmmo;\n \tsecondaryAmmo \t= secondaryMaxAmmo;\n}", "function mobstat() {\n health = 40\n armor = 20\n toughness = 20\n protection = 2\n resistance = 2\n}", "constructor(){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get /lists/points/follow follow lists in order of points (upvotesdownvotes)
function getFollowByOrder() { return db('lists') .select('*') .where('is_block_list', false) .where('public', true) .orderBy('list_points', 'desc') }
[ "function getFollowByOrder() {\n return db('lists')\n .select('*')\n .where('is_block_list', false)\n .orderByRaw('(list_upvotes - list_downvotes) desc')\n}", "getFollowerListings() {\n return _.chain(Meteor.user().following)\n .map((userId) => Items.find({userId: userId}).map((item) => ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the value of the "href" inside both "noneCrawledURLs" and "allTheLinksToBeReported" when "redirection" occures.
function UpdateMainArraysBasedOnNewURL() { for (var i=0; i<noneCrawledURLs.length; i++) { if (noneCrawledURLs[i].URL.toString() == URLToBeLoaded.toString()) { noneCrawledURLs[i].URL = curURL; break; } } for (var i=0; i<allTheLinksToBeReported.length; i++) { if (allTheLinksToBeReported[i].URL.toStrin...
[ "function updateLinks() {\r\n\tif (document.location.host === 'www.wikiwand.com') {\r\n\t\treturn;\r\n\t}\r\n\tif (document.location.host === 'www.quickiwiki.com') {\r\n\t\treturn;\r\n\t}\r\n\r\n\t//console.log('redirect state ',autoRedirectState);\r\n\tif (autoRedirectState==false || !autoRedirectState){\r\n\t\tre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
closeCard(item1, item2) function closes the cards if they don't match; clear the list of open cards.
function closeCard(item1, item2){ console.log("array1 " + item1 + openCardList[0].firstChild.getAttribute("class")); console.log(openCardList.length); if (openCardList.length>1){ item1.classList.remove("open","show"); item2.classList.remove("open","show"); openCardList = []; }; }
[ "function closeOpenCards() {\n openCards.forEach(card => {\n card.classList.add('fail');\n setTimeout(() => hideCard(card), 500);\n });\n openCards.length = 0;\n }", "function removeCardsFromOpenCards() {\n\topenCards.pop();\n\topenCards.pop();\n}", "function UnmatchedCards() {\n let ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calling this when an agent changes prevents lag when switching from a very fast agent to a slower agent.
handleAgentChange() { this.ludicrousBatchSize = this.config.initialGameTicksPerRender; }
[ "function reactivate() {\n enableIntervals();\n dynamicActivity = regularActivityMonitor;\n }", "function setAgentController(agent) {\n //Do the following on each tick of the simulation for the agent.\n agent.controller = function () {\n //Do this when the commute_ala...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Import an existing Kinesis Stream provided an ARN.
static fromStreamArn(scope, id, streamArn) { return Stream.fromStreamAttributes(scope, id, { streamArn }); }
[ "constructor ( ){ \n //this.wstream = fs.createWriteStream(OUTPUT_FILE);\n\n let params = {\n apiVersion: '2013-12-02',\n accessKeyId:accessKey,\n secretAccessKey:secretKey,\n region:region\n };\n\n\n this.kinesis = new AWS.Kinesis(\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generates all frequencie values, 440hz
function generateFrequencies() { for(var note = 0; note < 127; ++note) { const a = Math.pow(2,1.0/12.0); // comments pls FREQUENCIES[note] = 440 * Math.pow(a, note - 81); } }
[ "function getFreq(key) {\n return Math.pow(2, (key-49)/12) * 440;\n }", "function getFreq(key) {\n return Math.pow(2, (key-49)/12) * 440;\n }", "function getBassFreq() {\n analyzer.getFloatFrequencyData(analyzer_data);\n //return 0-250hz decibel values\n new_data = analyze...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Input is a string Output an object with percentage ratios of lowercase, uppercase and neither. Use regex to match lowercases, uppercases and neither. Take the length of matched arrays and divide by total number of characters multiplied by 100. Assign that value to respective object properties. Output always has 2 decim...
function letterPercentages(str) { var count = str.length; var lowercases = str.match(/[a-z]/g) || []; var uppercases = str.match(/[A-Z]/g) || []; var neithers = str.match(/[^a-z]/ig) || []; return { lowercase: (lowercases.length / count * 100).toFixed(2), uppercase: (uppercases.length / count * 100)....
[ "function letterPercentages(str) {\n let upperCaseCharacters = 0;\n let lowerCaseCharacters = 0;\n let otherCharacters = 0;\n\n for (let idx = 0; idx < str.length; idx++) {\n if (str[idx].match(/[a-z]/)) {\n lowerCaseCharacters += 1;\n } else if (str[idx].match(/[A-Z]/)) {\n upperCaseCharacters ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Depthfirst traversal that traverses all visible tiles and marks tiles for selection. If skipLevelOfDetail is off then a tile does not refine until all children are loaded. This is the traditional replacement refinement approach and is called the base traversal. Tiles that have a greater screen space error than the base...
executeTraversal(root, baseScreenSpaceError, frameState) { const {traversal} = this; const {stack} = traversal; stack.push(root); while (stack.length > 0) { traversal.stackMaximumLength = Math.max(traversal.stackMaximumLength, stack.length); const tile = stack.pop(); const add = tile...
[ "executeTraversal(root, frameState) {\n // stack to store traversed tiles, only visible tiles should be added to stack\n // visible: visible in the current view frustum\n const stack = this._traversalStack;\n\n stack.push(root);\n while (stack.length > 0) {\n // 1. pop tile\n const tile = s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
======================================================================== Internal functions processing from clipboard ======================================================================== Prepare the clipboard input button if the current environment allows reading image data from the clipboard, or hiding it if not.
function setupClipboardInput() { const func = 'setupClipboardInput'; // noinspection JSValidateTypes /** @type {PermissionDescriptor} */ const permission = { name: 'clipboard-read' }; navigator.permissions.query(permission).then(result => { let click = true, hover = t...
[ "function checkClipboard() {\n if (droppy.clipboard) {\n $(\".view\").each(function() {\n const view = $(this),\n button = view.find(\".paste-button\");\n button.addClass(\"in\").off(\"click\").one(\"click\", (event) => {\n event.stopPropagation();\n if (droppy.socketWait) return;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }