query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Computes the SLerp (spherical linear interpolation) with the given fraction T of the second and third of the given rotation quaternion vectors, and assigns the result to the first of the given vectors.
static slerpQV(qv, qa, qb, T) { var ONE, T_COMP, cosOmega, doLinear, omega, qb_, sA, sB, sinOmega, sinSqOmega; //------- ONE = 1; T_COMP = ONE - T; // Omega is the angle of the interval (on the unit hypersphere) // over which we are to interpolate. cosOmega = this.innerProductQV(qa, qb); // Adjust if necessary to ensur...
[ "function slerp()\n{\n\t/*Loop through each spline*/\n\tfor(var i = 0; i < splineRotations.length; i += 1)\n\t{\n\t\t/*loop through each control point in that spline*/\n\t\tfor(var j = 0; j < splineRotations[i].length; j += 1)\n\t\t{\n\t\t\t/*between each control point, loop the proper number of times based on the ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
DESCR: 5 selects the dialog box's DIV & makes it fade out
dialogFadeOut() { $('#dialog').fadeOut() }
[ "function fadeDialog(flag, dialogboxid) \n{\n var dialog = document.getElementById(dialogboxid);\n var value;\n if(flag>0) {\n value = dialog.alpha + DIALOG_SPEED;\n } else {\n value = dialog.alpha - DIALOG_SPEED;\n }\n\n dialog.alpha = value;\n dialog.style.opacity = (value / 100);\n dialog.style.fil...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
apFirst :: Apply f => (f a, f b) > f a . . Combines two effectful actions, keeping only the result of the first. . Equivalent to Haskell's `( apFirst ([1, 2], [3, 4]) . [1, 1, 2, 2] . . > apFirst (Identity (1), Identity (2)) . Identity (1) . ```
function apFirst(x, y) { return lift2 (constant, x, y); }
[ "function apFirst(x, y) {\n return lift2(constant, x, y);\n }", "function apSecond(x, y) {\n return lift2(constant(identity), x, y);\n }", "function ap(applyF, applyX) {\n return Apply.methods.ap(applyX)(applyF);\n }", "function apSecond(x, y) {\n return lift2 (constant (identity), x, y);\n }"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This takes a messageQueue as input and returns a queue with old messages removed. As part of the ack handling, once a message receives an ack from every connection it is sent to the ctime is set. This checks each message in the queue and if the ctime exists and is more than 10000ms old than it removes the message from ...
function pruneMessageQueue(inQueue) { inQueue = inQueue || []; let token = false if($tw.browser && localStorage) { token = localStorage.getItem('ws-token'); } // We can not remove messages immediately or else they won't be around to // prevent duplicates when the message from the file syst...
[ "_cleanQueue () {\n const now = Date.now();\n let lastDocumentIndex = -1;\n\n if (this.queueTTL > 0) {\n this.offlineQueue.forEach((query, index) => {\n if (query.ts < now - this.queueTTL) {\n lastDocumentIndex = index;\n }\n });\n\n if (lastDocumentIndex !== -1) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
remove all route on map
function removeRoute() { if (listRoute && listRoute.length) { for (let route of listRoute) { map.removeObject(route); } listRoute = []; } }
[ "function deleteAllRoute() {\n for (let i = 0; i < markerArray.length; i++) {\n map.removeLayer('route' + i);\n map.removeSource('route' + i);\n }\n markerArray = [];\n }", "function clearMapRoute () {\n selectedRoute.setMap(null);\n}", "function removeRoute() {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
gets stat hash's, item name and icon
function getIcon(itemHash, type, itemInstanceId){ axios({ method: 'GET', url:"https://www.bungie.net/Platform/Destiny2/Manifest/DestinyInventoryItemDefinition/" + itemHash, headers:{ 'X-API-Key': 'd3c3718995fb464ca66ddba314dc183a', 'Content-Type': 'application/json' ...
[ "function item_info(item) {\n return parent.G.items[item.name];\n}", "function encodeStat(name, statObj, itempath) {\n var modestr = '';\n if (statObj.isDirectory()) {\n modestr += 'd';\n }\n if (statObj.mode & 00400) {\n modestr += 'r';\n }\n if (statObj.mode & 00200) {\n modestr += 'w';\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fade function when hovering over chord
function fadeOnChord(d) { var chosen = d; wrapper.selectAll("path.chord") .transition() .style("opacity", function(d) { if (d.source.index == chosen.source.index && d.target.index == chosen.target.index) { return opacityDefault; } else { return opacityLow; }//else }); }//fadeOnChord
[ "function fadeOnChord(d) {\n var chosen = d;\n if (Names[chosen.source.index] === \"\") {\n return 0;\n }\n wrapper.selectAll(\"path.chord\")\n .transition()\n .style(\"opacity\", function(d) {\n return d.source.index === chosen.source.index && d.target.index === chosen.t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return a plugins object using the `validatorjs` package to enable Declarative Validation Rules
plugins() { return { dvr: dvr({ package: validatorjs, extend: ({ validator, form }) => { const messages = validator.getMessages('en'); messages.between = 'Comments must be between :min and :max characters'; v...
[ "plugins() {\n\t\treturn {\n\t\t\tdvr: dvr(validatorjs),\n\t\t};\n\t}", "plugins() {\n return { dvr: validatorjs };\n }", "plugins() {\n return { dvr: validatorjs };\n }", "plugins() {\n return {\n dvr: dvr(validatorjs),\n };\n }", "plugins() {\n return {\n dvr: dvr(val...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reset the inline geometry and rect cache for the given widget
function resetGeometry(widget) { var rect = getRect(widget); var style = widget.node.style; rect.top = NaN; rect.left = NaN; rect.width = NaN; rect.height = NaN; style.top = ''; style.left = ''; style.width = ''; style.height = ''; }
[ "function resetGeometry(widget) {\n\t var rect = rectProperty.get(widget);\n\t var style = widget.node.style;\n\t rect.top = NaN;\n\t rect.left = NaN;\n\t rect.width = NaN;\n\t rect.height = NaN;\n\t style.position = '';\n\t style.top = '';\n\t style.le...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice', 'unshift') and notify the listener AFTER the array has been altered. Listeners are called on the 'onData' callbacks (e.g. onDataPush, etc.) with same arguments.
function listenArrayEvents(array, listener) { if (array._chartjs) { array._chartjs.listeners.push(listener); return; } Object.defineProperty(array, '_chartjs', { configurable: true, ...
[ "function hookedArray(arr, binding, descriptor) {\n if (!Array.isArray(arr)) {\n return arr;\n }\n\n arr.reverse = function () {\n Array.prototype.reverse.apply(arr);\n descriptor.set.bind(binding)(arr);\n };\n\n arr.sort = function (compareFunction) {\n Array.prototype.reverse.apply(arr, [compareF...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
helper funtion to render all dogs
function renderDogsToPage(dogs){ dogs.map(renderSingleDogToPage).join('') }
[ "function renderDogBar(dogs) {\n dogs.forEach(addDogToDogBar)\n }", "function renderDog (dog){\n\nconst titleEl = document.createElement(\"h2\")\ntitleEl.innerText = dog.name\n\nconst imgEl = document.createElement(\"img\")\nimgEl.setAttribute(\"src\", dog.image)\nimgEl.setAttribute(\"alt\", \"dog.name\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Lightweight plugin requirement checking. The main intent is to notify the user when a plugin won't work as expected.
checkPluginRequirements(opts = {}) { for (const plugin of this._plugins) { for (const requirement of plugin.requirements) { if (opts.context === 'launch' && requirement === 'headful' && opts.options.headless) { console...
[ "checkPluginRequirements (opts = {}) {\n for (const plugin of this._plugins) {\n for (const requirement of plugin.requirements) {\n if ((opts.context === 'launch') && (requirement === 'headful') && opts.options.headless) {\n console.warn(`Warning: Plugin '${plugin.name}' is not supported in ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deploys selected response recipe on Reconfigurator Page
function deployResponseRecipe(rrid) { $.getJSON( _lcarsAPI + "responserecipes/" + rrid, function (data, status) { if (status === "success") { deployResponseRules(data); } } ); }
[ "function addSuccess(response) {\n Notification.success({ message: '<i class=\"glyphicon glyphicon-ok\"></i> Add recipe successful!' });\n recipe._id = response._id;\n }", "function presb_commitRecipe() {\n\tvar name = document.getElementById(\"recipeNameText\").value.trim();\n\tvar tags = $('#...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if City Needs to be added to recCities array
function pushCheck (city, check) { // If the request was submitted from recent searches button, don't add the city to the DOM if (check === 0) { return; } // Add the value of city to recCities array recCities.push(city); // Send recCities array to local stora...
[ "function cityInMem(city, array) {\n for (let i = 0; i < array.length; i++) {\n if (array[i].Name === city) {\n return true;\n }\n }\n return false;\n }", "isCity (index) {\n return (this.cities.indexOf(index) != -1);\n }", "function addCity(city)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
creating ball using canvas
function createBall() { canvasContext.beginPath(); canvasContext.arc(initialValueX, initialValueY, radiusOfBall, 0, Math.PI * 2); canvasContext.fillStyle = "#DE4B39"; canvasContext.fill(); canvasContext.closePath(); }
[ "function createBall() {\n\t\t//our beginPath is where the creating of the ball starts.\n\t\t//It will end this function at our closePath()\n\t\tctx.beginPath();\n\t\t//the below line took a while. I used mdn\n\t\t//and found this link, that explained using PI due tot he fact the ball is circular\n\t\t//https://dev...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Copyright (c) Microsoft Corporation. Licensed under the MIT license. Generate a range string. For example: "bytes=255" or "bytes=0511"
function rangeToString(iRange) { if (iRange.offset < 0) { throw new RangeError(`Range.offset cannot be smaller than 0.`); } if (iRange.count && iRange.count <= 0) { throw new RangeError(`Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end.`); ...
[ "function rangeToString(iRange) {\n if (iRange.offset < 0) {\n throw new RangeError(\"Range.offset cannot be smaller than 0.\");\n }\n if (iRange.count && iRange.count <= 0) {\n throw new RangeError(\"Range.count must be larger than 0. Leave it undefined if you want a range from offset to the...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the AWS CloudFormation properties of an `AWS::IoTEvents::AlarmModel.SimpleRule` resource
function cfnAlarmModelSimpleRulePropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnAlarmModel_SimpleRulePropertyValidator(properties).assertSuccess(); return { ComparisonOperator: cdk.stringToCloudFormation(properties.comparisonOperator), ...
[ "renderAlarmRule() {\n return `ALARM(${this.alarmArn})`;\n }", "renderAlarmRule() {\n return `ALARM(\"${this.alarmArn}\")`;\n }", "function cfnAlarmModelAlarmRulePropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnAlarmMod...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to create secondary dominants based on chosen key
buildSecondaryDominants(scale, key) { let secondaryDominants = []; if (key.split("").includes("m")) { for (let i = 0; i < scale.length; i++) { if (i === 0 || i === 1 || i === 3 || i === 4) { secondaryDominants.push(`${scale[i]}7`) } ...
[ "function updateKey() {\n\n if((currentViz == vizTypes.AUTHOR_COLLAB || currentViz == vizTypes.SIMILARITY) && just_school == false) {\n var a = [[multiColour(inSchoolColour), \"school member\"], [multiColour(nonSchoolColour), \"non school member\"]];\n }\n\n // If just school members are displ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Indicates if a bookmark is a folder
function isFolder (bookmarkInfo) { if (bookmarkInfo.hasOwnProperty('type')) { return (bookmarkInfo.type !== undefined && bookmarkInfo.type === 'folder') } else { return (bookmarkInfo.hasOwnProperty('children')) } }
[ "function bookmarkIsFolder(bookmarkInfo) {\n let isFolder = false;\n if (\n Object.prototype.hasOwnProperty.call(bookmarkInfo, 'type') &&\n bookmarkInfo.type === 'folder'\n ) {\n isFolder = true;\n } else if (\n !Object.prototype.hasOwnProperty.call(bookmarkInfo, 'url') ||\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Runs a chain of `[[fun, args]]` by calling `fun(args)`, logs emoji, and returns whether all the functions returned `true`.
async function run(funsAndArgs) { console.log('😌'); let result = false; try { for (const [fun, args] of funsAndArgs) { console.log(`🙋 ${fun.name} ${args.join(' ')}`); if (!await fun(args)) { console.log(`🙅 ${fun.name}`); return; } console.log(`🙆 ${fun.name}`); }...
[ "async function run(funsAndArgs) {\n console.log('😌');\n let result = false;\n try {\n for (let [fun, args] of funsAndArgs) {\n console.log(`🙋 ${fun.name}`);\n if (!await fun(args)) {\n console.log(`🙅 ${fun.name}`);\n return;\n }\n console.log(`🙆 ${fun.name}`);\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Defines what kind of Object/function that funcRef can reference , in this case a function that takes one argument as a number and returns a number
function numfunc(num) { // Defines a function - with one arguement that ust be a number and must returna number return num + 1; }
[ "function FunctionType() {\n}", "function definiteFunctionType(returnType,args,extra){return _functionType(true,returnType,args,extra);}", "function funcType (funcname) {\n if (funcname === 'reduce' || funcname === 'vars' || funcname === 'math' || funcname === 'parse' || funcname === 'placeholder' || funcname ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
open audio select dialog
function openAudioDialog(title, onInsert, isMultiple){ openNewMediaDialog(title, onInsert, isMultiple, "audio"); }
[ "function showAudioMultiChoice() {\n \n }", "function escucharAudio(select){\n var id_select = $(select).attr(\"id\");\n var codigo_inspector = $(select).val();\n var nombre_audio = $('#'+id_select+' option:selected').text(); //tomamos el texto seleccionado\n $(\"#audio\").remove(); //se elimina el div po...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns size in pixels for measured value
measureSize(value) { return DomHelper.measureSize(value, this.subGrid ? this.subGrid.element : undefined); }
[ "get pixelSize() {\n let [w, h] = this.baseSize;\n return [w * this.scale.x, h * this.scale.y]\n }", "measureSize(value) {\n return DomHelper.measureSize(value, this.subGrid ? this.subGrid.element : undefined);\n }", "function pixels(value) {\n const inch = 90; // p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function that adds majority party to the region objects
function addMajorityProperty() { for(var i = 0; i < counties.length; ++i) { counties[i].properties["majority"] = findMajorityByRegion(counties[i].properties.name); } }
[ "addDefaultParty() {\n\n this.addPartyMember({\n Name: \"Barbara\",\n Level: 7,\n Class: \"Barbarian\",\n STR: 20,\n DEX: 11,\n CON: 18,\n INT: 8,\n WIS: 14,\n CHA: 10\n });\n\n this.addPartyMembe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
update global variable of selectedJSON from app.mapN.geojson.eachLayer
function updateSelectedGeoJSON(mIDX) { app.selectedGeoJSON = {"type":"FeatureCollection", "features":[]}; app[mIDX].geojson.eachLayer(function(layer) { app.selectedGeoJSON.features.push(layer.feature); }) }
[ "function updateMap(geojson) {\n // get the current layer you're showing the markers on and update its data\n map.getSource('markers').setData(geojson);\n // gray out the inactive buttons\n updateActiveButton();\n }", "function setGeoJson () {\n \tscope.objects.addTo(scope.map);\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Makes a request to save the lists to the FHIR server. When called, a 5 second delay is kicked off before the save actually happens. If another call to requestSave happens before the timeout, the delay is reset.
requestSave() { if (!this.state.isUnsaved) this.setState({isUnsaved: true}); if (this.saveBackoff) { clearTimeout(this.saveBackoff); } this.saveBackoff = setTimeout(() => { this.saveToFHIR(); this.setState({isUnsaved: false}); }, 5 * 1000); }
[ "function waitAndDo(times) {\n\t\tif(times > requestList.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetTimeout(function() {\n\t\t\tconsole.log('\\n******* Doing request '+times+' *******');\n\t\t\treadAndSend(times);\n\t\t\twaitAndDo(times+1);\n\n\t\t}, interval);\n\t}", "function saveRequests(requests){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate and draw branch objects
function generateBranchObjects(dir, startx, starty) { x = startx - rb4.width * 0.33; y = starty + rb4.height * 0.05; let img; if (dir == 'right') { x += rb2.width * 1.5; y += rb2.height * 0.3; img = rb2_r; stem_objects.push(new Unit(img, x, y)); const nbranch = Math.floor(random(0, 4)); ...
[ "function superSimpleTreeDraw(x,y,angle, numBranches){\n var xL2, yL2;\n var xR2, yR2;\n var branchSize = 1.0;\n \n //we create an angleL and angleR so our tree can start\n //its growth vertically\n var angleL = angleR = angle;\n \n for(var i=0; i < numBranches; i++){\n if(i === 0){\n currentBranch...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Registers a portal containing action buttons with the datepicker.
registerActions(portal) { if (this._actionsPortal && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw Error('A MatDatepicker can only be associated with a single actions row.'); } this._actionsPortal = portal; }
[ "function setDateButton(dteFieldId)\n\t{\n\t\tvar onclickAction = '';\n\n\t\tif (asPopupDateWindow)\n\t\t{\n\t\t\tonClickAction = 'calShowAsWindow(document.getElementById(\\'' + dteFieldId + '\\'),document.getElementById(\\'' + dteFieldId + BUT_WIDGET + '\\'));';\n\t\t}\n\t\telse\n\t\t{\t\t\n\t\t\tif( isUXP())\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get form values, calculate & update display.
function getFormValuesAndDisplayResults() { getFormValues(); let monthlyPayment = calcMonthlyPayment(principle, loanYears, interest); document.getElementById("calc-monthly-payment").innerHTML = monthlyPayment; }
[ "function getFormValuesAndDisplayResults() {\n}", "function getFormValuesAndDisplayResults() {\n // part 1: getting our form values (we did all the work above)\n let formValues = getFormValues();\n let { amount, termInYears, annualRate } = formValues;\n const monthlyPayment = calcMonthlyPayment(amount, termIn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Let a parent Entry know that one of its children may be dirty.
function reportDirtyChild(parent, child) { // Must have called rememberParent(child) before calling // reportDirtyChild(parent, child). assert(parent.childValues.has(child)); assert(mightBeDirty(child)); if (!parent.dirtyChildren) { parent.dirtyChildren = emptySetPool.pop() || new Set; }...
[ "function reportDirtyChild(entry, child) {\n // Must have called rememberParent(child) before calling\n // reportDirtyChild(parent, child).\n assert(entry.childValues.has(child));\n assert(mightBeDirty(child));\n\n if (! entry.dirtyChildren) {\n entry.dirtyChildren = emptySetPool.pop() || new Set;\n\n } el...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load historical price data from selected tickers
function loadSelectedTickersHistory(tickers, fromDate, toDate) { MainService.getTickersHistory(tickers, fromDate, toDate) .then(function (queryResult) { var tickersHistory = _ .chain(queryResult.datatable.data) .groupBy(_.first) .map(function (tickerHistory, t...
[ "function loadHistoricalData() {\n if (dailyTimer) clearInterval(dailyTimer);\n dailyTimer = setInterval(loadDailyStats, 180000);\n loadDailyStats();\n\n loader.transition().style('opacity',1);\n status.html(\"\");\n\n var end = moment().utc().endOf('day');\n var start = moment().utc().startOf...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Repaint the entire maze. This can be used when colors have been changed.
repaint() { this.fill_color = background_color; this.wall_color = wall_color; maze_buff.strokeCap(SQUARE); maze_buff.background(this.fill_color); // Go over all cells in the grid and repaint their left and top walls for (let row = 0; row < this.row_count; ++row) { ...
[ "function repaint (){\n\t\tfor (var i = 0; i < shapes.length; i++) {\n\t\t\tdrawShapeAt(shapes[i], i + 1);\n\t\t}\n\t}", "function paint() {\n\n\t\t\tpaintStones();\n\n\t\t\t// Tag the current move\n\t\t\tif (goMap.currentMoveIndex > 0) {\n\t\t\t\tpaintCurrentMove();\n\t\t\t}\n\n\t\t\tif (displayNum) {\n\t\t\t\tp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
PART 6 Define a function with the identifier "findMaxNumber" Parameters: "numberArray" (number array) with all the elements being positive integers Definition: Returns the maximum integer from within the elements of the array Return type: number Example: [1, 2, 6, 10, 4] > 10
function findMaxNumber(numberArray) { let maxNumber = 0; for (let i = 0; i < numberArray.length; i++) { if (numberArray[i] > maxNumber) { maxNumber = numberArray[i]; } } return maxNumber; }
[ "function getLargestNum(numArray) {\n return Math.max.apply(null, numArray);\n}", "function maxNumber(array){\n\tvar max=array.reduce((max,cu)=>{return (max > cu)?max :cu });\n\treturn max\n\n}", "function maxNumber(array) {\n return Math.max.apply(null, array);\n}", "function findMax(array) {\n}", "fun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a single string containing all SeSt preferences, to be saved in localstorage, or possibly exported/imported. Each SeSt preference string contains a CSS selector, the name of the CSS property to be modified, and the value of the SeSt input(s). Note that the value of the SeSt input is not necessarily a valid CSS ...
function outputSeStPrefs() { var output = ''; // Get individual SeSt input fields. var $fields = $("#sest-form input.sest-field"); for (let i = 0; i < $fields.length; i++) { var $f = $($fields[i]); // e.g. '.header-block/background/131313' output += $f.data('sel') + '/' + $f.dat...
[ "function saveStyles() {\n\t\t\tvar styleAttr = $html.attr( 'style' ),\n\t\t\t\tstyleStrs = [],\n\t\t\t\tstyleHash = {};\n\t\n\t\t\tif( !styleAttr ){\n\t\t\t\treturn;\n\t\t\t}\n\t\n\t\t\tstyleStrs = styleAttr.split( /;\\s/ );\n\t\n\t\t\t$.each( styleStrs, function serializeStyleProp( styleString ){\n\t\t\t\tif( !st...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loads a command into the collection and lexes the instructions.
function load(command) { const file = readFileSync(`./commands/${command}.bf`, "utf8"); commands.set(command, { name: command, instructions: lex(file) }); }
[ "loadCommand(commandPath, commandName) {\r\n // Try to:\r\n\t\ttry {\r\n\r\n // Get the file\r\n const file = new(require(`.${commandPath}/${commandName}`))(this);\r\n \r\n // Check if the file is init \r\n if(file.init) file.init(this);\r\n\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reset all the radio buttons they are in same group (equal name)
function ui_resetAllRadios(str_radioName){ var _radios = ui_getObjsByName(str_radioName); for (var i=0; i<_radios.length; i++){ _radios[i].checked = false; } }
[ "resetRadioGroup() {\n this.radioButtonchecked = '';\n }", "function resetRadioButtons(optionset) {\n optionset.find(\"input[type=radio]\").each(function () {\n $(this).prop('checked', false);\n });\n }", "function cleanGroupSelected() {\n\tvar allRadios = document.getElement...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Change the image size selectbox to the last used size
function imageSelector(imageSize){ var defaultImageSize = 'Medium'; _('Cached image size: ', imageSize); if (imageSize && imageSize !== defaultImageSize){ // If the requested value does not exist, use the largest option available if (!imageSiz...
[ "function selectImage(size) {\n images.map(function(item) {\n for (var i = 0; i < item.size.length; i++) {\n if (item.size[i].width > size) {\n item.selectedImg = item.size[i].url;\n break;\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determines appropriate date selection based on parameter date object values. Parameters: date: Object Object with year, month, and day attributes Return: selection: Object Object that contains selection for Mongoose query
async function getSelection(date) { let selection; if ((date.year > 0) && (date.month <= 0) && (date.day <= 0)) { selection = {'date.year': date.year}; } else if ((date.year > 0) && (date.month > 0) && (date.day <= 0)) { selection = {'date.year': date.year, 'date.month': date.month}; } e...
[ "function selectDate(day, month, year) {\r\n date = { day: day, month: month, year: year };\r\n data.selectedDates.push(date);\r\n showAsSelected(day, month, year);\r\n }", "static _extractDateParts(date){return{day:date.getDate(),month:date.getMonth(),year:date.getFullYear()}}", "functi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
POST /events (create event via form)
function createEvent(req, res){ var newActivity = new db.Activity({ name: req.body.activityname }); var newEvent = new db.Event({ name: req.body.name, date: req.body.date, votingAllowed: req.body.votingAllowed, activity: newActivity }); newEvent.save(function handleDBSave(err, data){ ...
[ "function postEvent(req, res) {\n //Creates a new event\n var newEvent = new Event(req.body);\n //Save it into the DB.\n newEvent.save((err,event) => {\n if(err) {\n res.send(err);\n }\n else { //If no errors, send it back to the client\n res.json({message: \"E...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
just like arrayToMap except the arr value is used as the key and the index is used as the value (used for mapping the maps to eachother)
function arrayToIndexMap (arr) { const result = new Map() arr.forEach((value, index) => result.set(value, index)) return result }
[ "function arrayToMap (arr) {\n const result = new Map()\n arr.forEach((value, index) => result.set(index, value))\n return result\n}", "function arrToMap(arr){\n\t\tvar ret = {};\n\t\tfor(i in arr){\n\t\t\tret[arr[i]]=true;\n\t\t}\n\t\treturn ret;\n\t}", "function get_map(arr){\t\t\t\t\t\t\t\t\r\n\tlet map =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transforms the given SituationAware Choreography Model to a SituationAware Collaboration Model within the Editor
_transformModel(sitawareChorModel) { console.log('Received following model:'); console.log(sitawareChorModel); // the elements of the situation-aware choreography model let sitawareChorModelDefinitions = sitawareChorModel['bpmn2:definitions']; let cliMethods = this._getMethods(this.cli); let b...
[ "computeModelMatrixFromTransformationTraits(modelMatrix) {\n let scale = Matrix4.getScale(modelMatrix, new Cartesian3());\n let position = Matrix4.getTranslation(modelMatrix, new Cartesian3());\n let orientation = Quaternion.fromRotationMatrix(Matrix4.getMatrix3(modelMatrix, new Mat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Makes sure lazyload is done for other sections in the viewport that are not the active one.
function lazyLoadOthers() { var hasAutoHeightSections = $(AUTO_HEIGHT_SEL)[0] || isResponsiveMode() && $(AUTO_HEIGHT_RESPONSIVE_SEL)[0]; //quitting when it doesn't apply if (!options.lazyLoading || !hasAutoHeightSections) { return; } //making sure to lazy load auto-height sections that are in...
[ "function lazyLoadOthers() {\n var hasAutoHeightSections = $(AUTO_HEIGHT_SEL)[0] || isResponsiveMode() && $(AUTO_HEIGHT_RESPONSIVE_SEL)[0]; //quitting when it doesn't apply\n\n if (!getOptions().lazyLoading || !hasAutoHeightSections) {\n return;\n } //making sure to lazy load auto-height secti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Patches the provided dictionary of instances of googlemap.Marker.
function patch(markers) { // No patch at the moment. Example: // setPlaceId('betahaus', 'ChIJqQFHjS1OqEcR8d99mafShxY'); function setComment(id, comment) { try { markers[id].setComment(comment); } catch(e) { console.error('Error patching ' + id + "'s comment: " + e); } } function setP...
[ "static updateMarker(markerId) {\n }", "function updateMarkers() { //B3\n if (map && scope.markers) {\n\n // clear old markers\n if (currentMarkers !== null) {\n for (var i = 0; i < currentMarkers.length; i++) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Captures the current email address as an EmailMatch if it's valid, and resets the state to read another email address.
function captureMatchIfValidAndReset() { if (currentEmailMatch.hasDomainDot) { // we need at least one dot in the domain to be considered a valid email address var matchedText = text.slice(currentEmailMatch.idx, charIdx); // If we read a '.' or '-' char that ended the e...
[ "function captureMatchIfValidAndReset() {\n if (currentEmailAddress.hasDomainDot) { // we need at least one dot in the domain to be considered a valid email address\n var emailAddress = text.slice(currentEmailAddress.idx, charIdx);\n // If we read a '.' or '-' char that ende...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
takes care of escaping '.' and ':' characters in an ID string and places a "" at the beginning of the string
function idEscape(myid) { return '#' + myid.replace(/(:|\.)/g,'\\$1'); }
[ "function escapeId(id) {\n return id.replace(/\\./gi, \"\\\\.\").replace(/\\:/gi, \"\\\\:\");\n}", "function ID(myid) {\n return $.trim(\"#\" + myid.replace(/(:|\\.|\\/|\\[|\\]|,)/g, \"\\\\\\\\$1\"));\n}", "function escapeID(myid) {\n return \"#\" + myid.replace(/(:|\\.|\\[|\\]|\\%|\\<|\\>|,)/g, \"\\\\$1...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts an RGBA color to an ARGB Hex8 string Rarely used, but required for "toFilter()"
function rgbaToArgbHex(r, g, b, a) { var hex = [pad2(convertDecimalToHex(a)), pad2(mathRound(r).toString(16)), pad2(mathRound(g).toString(16)), pad2(mathRound(b).toString(16))]; return hex.join(""); } // `equals`
[ "function rgbaToArgbHex (r, g, b, a) {\r\n\t const hex = [pad2(convertDecimalToHex(a)), pad2(mathRound(r).toString(16)), pad2(mathRound(g).toString(16)), pad2(mathRound(b).toString(16))];\r\n\r\n\t return hex.join('')\r\n\t }", "function rgbaToArgbHex(r,g,b,a){var hex=[pad2(convertDecimalToHex(a)),pad2(mat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function contains a try block with no catch block, but it does have a finally block. Try to evaluate expressions that do and do not throw exceptions.
function TrySomething( expression, throwing ) { innerFinally = "FAIL: DID NOT HIT INNER FINALLY BLOCK"; if (throwing) { outerCatch = "FAILED: NO EXCEPTION CAUGHT"; } else { outerCatch = "PASS"; } outerFinally = "FAIL: DID NOT HIT OUTER FINALLY BLOCK"; try { try { eval( expression ); }...
[ "function evaluateTryStatement({ node, evaluate, environment, reporting, statementTraversalStack }) {\n const executeTry = () => {\n setInLexicalEnvironment({ env: environment, reporting, newBinding: true, node, path: TRY_SYMBOL, value: true });\n // The Block will declare an environment of its own...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
renders a new form for garden
function renderNewGardenForm(){ main.appendChild(gFormDiv) }
[ "function showNewForm(request, response) {\n //respond to the request made by the user by rendering the \"new\" handlebars in the views/user folder\n response.render(\"user/new\");\n}", "static newForm(){\n return(\n `<form id=\"newNoteForm\">\n ${Note.renderSelectInput()}\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function may serve as a callback to your video ad, when it ends. Assuming that you may want to reward the user with some coins, it adds 20 coins to user's account. After adding the coins it plays a sound effect to let the user know about it. It is currently unused, you should read your ad provider's documentation ...
function videoAdComplete(scene){ if(scene.hintController){ let count = 20; let targetValue = scene.hintController.getRemainingCoins() + count; scene.hintController.setCoinCount(targetValue); if(scene.introHud) scene.introHud.coinMeter.setCount(targetValue); if(scene.gam...
[ "collectCoins(player, coins) {\n coins.disableBody(true, true);\n // Add and update the score\n this.score += 10;\n this.scoreText.setText(\"Score: \" + this.score);\n this.coinSound.play();\n}", "function end() {\n\tdocument.getElementById('unmute').style.backgroundColor = 'rgb(36, 59, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Look for the byte that indicates the start of data (0xFB or 0xF8). Various floppy disk documentation specify an exact number here, but I've seen a variety of values, so just search.
findDataIndex() { for (let i = 7; i < 55; i++) { const byte = this.track.floppyDisk.binary[this.track.offset + this.offset + i]; if (byte === 0xFB || byte === 0xF8) { // Maybe also check that the previous three bytes are 0xA1. return i + 1; } ...
[ "findDataIndex() {\n for (let i = 7; i < 55; i++) {\n const byte = this.track.floppyDisk.binary[this.track.offset + this.offset + i];\n if (byte === 0xFB || byte === 0xF8) {\n // Maybe also check that the previous three bytes are 0xA1.\n return i + 1;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Toll cost object (toll info)
function CostTce() { this.name = ""; this.linkIds = []; // String array this.conditions = []; // TceConditon array this.tollStructures = []; // TollStructure array }
[ "function CostObject(taxCA, taxME, shipping, price_liveAmerican, price_tailAmerican, price_liveRock, price_tailRock) {\n this.shipping = shipping;\n this.taxCA = taxCA;\n this.taxME = taxME;\n this.price_liveAmerican = price_liveAmerican;\n this.price_tailAmerican = price_tailAmerican;\n this.pric...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Safely close a nsISafeOutputStream.
function closeSafeOutputStream(aFOS) { if (aFOS instanceof Ci.nsISafeOutputStream) { try { aFOS.finish(); return; } catch (e) { } } aFOS.close(); }
[ "function closeSafeOutputStream(fos) {\n if (fos instanceof Components.interfaces.nsISafeOutputStream) {\n try {\n fos.finish();\n }\n catch (e) {\n fos.close();\n }\n }\n else\n fos.close();\n}", "close() {\n if (this._stream) {\n this._stream.end('');\n }\n\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
2 Write a script that compares two char arrays lexicographically (letter by letter).
function compare2CharArrays() { var firstArray = ['A', 'E', 'D', 'G', 'J', 'B']; var secondArray = ['A', 'E', 'D', 'G', 'J', 'B']; var areEqual = true; var index = 0; var result = ""; if (firstArray.length === secondArray.length) { while (areEqual) { if (firstArray[index] !=...
[ "function compareTwoCharArrays(a, b) {\n var len = a.length < b.length ? a.length : b.length;\n for (var i = 0; i < len; i += 1) {\n if (a[i] === b[i]) continue;\n if (a[i] < b[i]) return -1;\n return 1;\n }\n if (a.length === b.length) return 0;\n if (a.length < b.length) return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this function sets the all text elements according to the chosen language.
function setLang() { // first update text fields based on selected mode var selId = $("#mode-select").find(":selected").attr("id"); setText("text-timedomain", "Zeitbereich: " + lang_de.text[selId], "Time domain: " + lang_en.text[selId]); setText("text-headline-le...
[ "function apply_text_to_elements_with_language_attribute() {\n const elements_to_modify = document.querySelectorAll(\"[language]\")\n for (let i = (elements_to_modify.length-1); i > -1; i--) {\n const current_element = elements_to_modify[i]\n const attribute = current_element.getAttribute(\"lang...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draws the previous season triangle
function drawLeftTri () { var tip = "Previous Year"; drawAnImage (barPadding, svgHeight - arrowSize-barPadding, arrowSize, arrowSize, "../Resources/arrows/LeftArrow.png") .attr("cursor", "pointer") .on('click', function(){ d3.event.stopPropagation(); year = year - 1; perSeason(); }); }
[ "function paintPrevious() {\n\tif (parseInt(cur_time) - step > 0) {\n\t cur_time = parseInt(cur_time) - step;\n\t\tcur_real_time = time_map[cur_time];\n\t\tconsole.log(\"current time id: \" + \n\t\t\tcur_time.toString() + \n\t\t\t\"\\ncurrent real time: \" +\n\t\t\tcur_real_time.toString());\n\t\tpaintWithTimeId(c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method that pushes operation function to the stack. Simple method that pushes operation function to the stack.
function pushOpFunc(func) { if (typeof func != 'function') { throw 'Passed operation is not a function'; } opFuncStack.push(func); }
[ "function PushOp() {}", "function pushOp() {\n\t\tconst op = ops.pop();\n\t\tconst opNode = new Node(op);\n\t\tfor (let i = 0; i < op.arity; i++) {\n\t\t\topNode.addChild(output.pop());\n\t\t}\n\t\toutput.push(opNode);\n\t}", "push(x){\r\n this.stack.push(x);\r\n this.size++;\r\n }", "functio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get all favorite players by user id
async function getFavoritePlayers(user_id) { const player_ids = await DButils.execQuery( `select player_id from dbo.FavoritePlayers where user_id='${user_id}'` ); return player_ids; }
[ "async function getFavoritePlayers(user_id) {\r\n const player_ids = await DButils.execQuery(\r\n `select player_id from fav_players where user_id='${user_id}'`\r\n );\r\n return player_ids;\r\n}", "async function getFavoritePlayers(user_id) {\r\n const player_ids = await DButils.execQuery(`select playerId...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Normalize responseXML property across browsers.
__normalizeResponseXML() { // BUGFIX: IE // IE does not recognize +xml extension, resulting in empty responseXML. // // Check if Content-Type is +xml, verify missing responseXML then parse // responseText as XML. if ( qx.core.Environment.get("engine.name") == "mshtml" && ...
[ "function Ajax_getResponseXML () {\n\treturn this.responseXML;\n}", "cleanupXML(xml) {\n\t\txml = xml.replace(/\\x00/g, ''); // Remove any hexadecimal null characters\n\t\txml = xml.replace(/&shy;/g, '');\n\t\treturn xml;\n\t}", "function resolveResponseXML(request) {\n let ret = new mona_dish_1.XMLQuery((0,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns already created skin instance from skin, for use on the rootBone ref count of existing skinInstance is increased
static getCachedSkinInstance(skin, rootBone) { let skinInstance = null; // get an array of cached object for the rootBone const cachedObjArray = SkinInstanceCache._skinInstanceCache.get(rootBone); if (cachedObjArray) { // find matching skin const cachedObj = ca...
[ "static getCachedSkinInstance(skin, rootBone) {\n\n let skinInstance = null;\n\n // get an array of cached object for the rootBone\n const cachedObjArray = RenderComponent._skinInstanceCache.get(rootBone);\n if (cachedObjArray) {\n\n // find matching skin\n const ca...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Dispose the event. NavigationEvent shall be disposed after being emitted by `NavigationEventEmitter`.
dispose(): void { invariant(!this._disposed, 'NavigationEvent is already disposed'); this._disposed = true; // Clean up. this.target = null; this.eventPhase = NavigationEvent.NONE; this._type = ''; this._currentTarget = null; this._data = null; this._defaultPrevented = false; /...
[ "unsubscribe() {\n window.removeEventListener(\n \"vaadin-router-go\",\n this.__navigationEventHandler\n );\n }", "unsubscribe(){window.removeEventListener(\"vaadin-router-go\",this.__navigationEventHandler)}", "unsubscribe() {\n window.removeEventListener('vaadin-router-go', this.__navi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Radio button down handler.
_downHandler(event) { const that = this, target = that.enableShadowDOM ? event.originalEvent.composedPath()[0] : event.originalEvent.target; if (that.disabled || that.readonly || that.checkMode === 'input' && target !== that.$.radioButtonInput || that.checkMode === '...
[ "_downHandler(event) {\n const that = this,\n target = that.enableShadowDOM ? event.originalEvent.composedPath()[0] : event.originalEvent.target;\n\n if (that.disabled || that.readonly ||\n that.checkMode === 'input' && target !== that.$.radioButtonInput ||\n that.chec...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
private Garbage collection uncache elements/purge listeners on orphaned elements so we don't hold a reference and cause the browser to retain them
function garbageCollect() { if (!Ext.enableGarbageCollector) { clearInterval(Element.collectorThreadId); } else { var eid, d, o, t; for (eid in EC) { if (!EC.hasOwnProperty(eid)) { co...
[ "function garbageCollect(){\n if(!Ext.enableGarbageCollector){\n clearInterval(El.collectorThread);\n } else {\n var eid,\n el,\n d;\n\n for(eid in El.cache){\n el = El.cache[eid];\n d = el.dom;\n // ----------------------------------...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return a function that tells whether a given key matches a lower bound
getLowerBoundMatcher (query) { // No lower bound if (!Object.prototype.hasOwnProperty.call(query, '$gt') && !Object.prototype.hasOwnProperty.call(query, '$gte')) return () => true if (Object.prototype.hasOwnProperty.call(query, '$gt') && Object.prototype.hasOwnProperty.call(query, '$gte')) { if (this...
[ "function lower_bound(arr, key) {\n var s = 0;\n var e = arr.length - 1;\n while (s <= e) {\n let mid = s + Math.floor((e - s) / 2);\n if (arr[mid] >= key) {\n e = mid - 1;\n } else {\n s = mid + 1;\n }\n }\n return s;\n}", "function before(key, ran...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Pairfantasyland/reduce :: Pair a b ~> ((c, b) > c, c) > c . . `reduce (f) (x) (Pair (v) (w))` is equivalent to `f (x) (w)`. . . ```javascript . > S.reduce (S.concat) ([1, 2, 3]) (Pair ('abc') ([4, 5, 6])) . [1, 2, 3, 4, 5, 6] . ```
function Pair$prototype$reduce(f, x) { return f (x, this.snd); }
[ "function sortReduce(pairs) {\n\tpairs.sort((a,b) => (a[0] < b[0] ? -1 : (a[0] > b[0] ? 1 :\n\t\t\t\t\t\t(a[1] < b[1] ? -1 : (a[1] > b[1] ? 1 : 0)))));\n\tlet i = 0; let j = 1;\n\twhile (j < pairs.length) {\n\t\tif (pairs[j][0] != pairs[i][0] || pairs[j][1] != pairs[i][1])\n\t\t\tpairs[++i] = pairs[j];\n\t\tj++;\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function that creates an ear of the wolf No inputs, Returns an ear mesh
function createWolfEar(){ var earGeom = new THREE.CylinderGeometry(wolfParams.bottomEarRadius, wolfParams.topEarRadius, wolfParams.earHeight); var earMaterial = new THREE.MeshPhongMaterial({color:0x7F7770, ...
[ "function createEar(params, side) {\n var earGeometry = new THREE.SphereGeometry(params.earRadius,params.sphereDetail, params.sphereDetail);\n var ear = new THREE.Mesh(earGeometry, params.brownMaterial);\n ear.castShadow = true;\n ear.receiveShadow = true;\n \n // Flattens...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Contains common functions re Moodle Cloze Questions Function to check parent classes of element Returns true if the element or one of its parents has the class classname Used because no direct access to input boxes Source:
function hasSomeParentTheClass(element, classname) { if (element.className.split(' ').indexOf(classname)>=0) return true; try { return element.parentNode && hasSomeParentTheClass(element.parentNode, classname); } catch(Typeerror){return false;} }
[ "function hasParentSelector(el, tag, classes)\n {\n tag = tag.toUpperCase();\n var found = false;\n while (el.parentNode && !found)\n {\n el = el.parentNode; // Check parent\n if (el && el.tagName == tag) {\n for (var i = 0; i < classes.length; i++)\n {\n if (!el.cl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
==================== Function: InitNav Note: InitNav must be called after menu list is created. Purpose: Assigns classes to certain events for Internet Explorer 6. (IE6 does not fully support CSS standards.) Input: Output: Assumptions: History: 200512 Code from htmldog.com 200512 RW Turned into a function for nicer mod...
function InitNav(strListID) { sfHover = function() { var sfEls = document.getElementById(strListID).getElementsByTagName("LI"); for (var i=0; i < sfEls.length; i++) { sfEls[i].onmouseover=function() { this.className+=" sfhover"; } sfEls[i].onmouseo...
[ "function initNav()\n{\n\n\tvar i = 0;\n\t// Find the unordered list that contains the navigtion links\n\tvar navUL = findNonFeaturedUL();\n\t// Get all ULs within this one\n\tvar allULs = navUL.getElementsByTagName(\"ul\");\n\t// We will loop through the array of anchors in this UL\n\tvar alist = navUL.getElements...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ProbabilityVector class invoke addprobo method with note numbers and counts for each note invoke calc_ratios() to prep it invoke pick_note() to get note numbers
function ProbabilityVector() { this.reset(); }
[ "makeProbs() {\n for (let [hypo, odds] of this.items()) {\n this.set(hypo, probability(odds));\n }\n }", "function createPercentage (mm) {\n var totTimes; //how much times the note has been used\n var nextNoteTimes;\n var noteOctave;\n var currNote;\n var nextNote;\n var firstT...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the match details from a given matchId Returns the json object of the match
function getMatch(matchId) { var url = 'https://' + getInfo('region') + '.api.riotgames.com/lol/match/v3/matches/'+ matchId + '?api_key=' + getInfo('api_key'); var response = UrlFetchApp.fetch(url, {muteHttpExceptions: true}); var status = checkStatusError(response); if(!status) { var json = response.getCon...
[ "async function getMatchByIdFullDetails(matchId) {\n const matches = await DButils.execQuery(\n `select * from matches where matches.matchId=${matchId}`\n );\n\n return matches;\n}", "getMatchByMatchId(region, matchId, callback) {\n const url = this.generateUrl({\n region,\n path: `/lol/match/v...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
parseWithLib :: Object of functions > String > Function Convenient function to parse and use `withLib`.
function parseWithLib(lib,src){ return withLib(lib,parse(src)); }
[ "function parsePromiseLib(lib) {\r\n if (lib) {\r\n var promise;\r\n if (lib instanceof main.PromiseAdapter) {\r\n promise = function (func) {\r\n return lib.create(func);\r\n };\r\n promise.resolve = lib.resolve;\r\n promise.reject = lib.r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
domain check fix for when viewing on local file system vs. web server (links point to openended directory, no index.html)
function checkDomain(oLink,useHash) { var o = oLink.toString(); if ((!document.domain || !window.location.protocol.match(/http/i)) && o.indexOf('index.html')==-1) oLink.href=(useHash?o.substr(0,o.lastIndexOf('#')):o)+'index.html'+(useHash?(o.substr(o.lastIndexOf('#'))):''); }
[ "function onDomain() {\n if (window.location.href.indexOf('https://junn3r.github.io/') != -1) {\n return true;\n } else {\n return false;\n }\n }", "function checkDomain(oLink,useHash) {\r\n var o = oLink.toString();\r\n if ((!document.domain || !window.location.pro...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Binding function. Returns the event handler function to show the dropdown menu within the expander of the event target.
toggleMenuShow() { return event => { if (event.target.matches(".bbmChatHeaderMenuExpander") || event.target.matches(".bbmOptionsMenuButton")) { event.stopPropagation(); this.closeDropdowns(); var expander = event.currentTarget; var dropdown = expander.que...
[ "get expandEvent() {\n return this._getOption('expandEvent');\n }", "function dropdown_handler(e) {\n var target_element = e.target.getAttribute(\"aria-controls\");\n var the_dropdown = document.getElementById(target_element);\n the_dropdown.classList.toggle(\"show\");\n}", "_expandedChanged(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds the incident list using results from the database data
function populateIncidents(result) { for (let i = 0; i < result.length; i++) { $("#incident-list") .append( $("<div class=\"incident\" id=\"" + result[i]['incidentId'] + "\" onclick=\"incidentZoom(this)\">") .append( $("<div class=\"sta...
[ "async function getIncidents() {\n const incidents = await db('incidents')\n .innerJoin('sources', 'incidents.id', 'sources.incident_id')\n .select(['incidents.*', db.raw('json_agg(sources.*) as sources')])\n .groupBy('incidents.id');\n\n return incidents;\n}", "static async getIncidentAll(id) {\n c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Freeze current tetromino and draw a new one
function freeze() { if (current.some(index => squares[currentPosition + index + width].classList.contains('taken'))) { current.forEach(index => squares[currentPosition + index].classList.add('taken')) currentPosition = INITIAL_POSITION currentRotation = INITIAL_ROTATION ...
[ "function freezeTetromino() {\n const movedDown = currentTetromino.map(position => position + width)\n if (wouldLeaveGrid(movedDown) || wouldOverlapPiece(movedDown)) {\n currentTetromino.forEach(position => {\n cells[currentPosition + position].classList.add('occupied')\n cells[currentPosit...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes `element` from `array` (if it exists) and then inserts `element` at `index`. If `index` is not provided, it will insert `element` at the end of `array`.
function replace(array, element, index) { // check if exists var ind = array.indexOf(element); // remove if exists if (ind !== -1) { array.splice(ind, 1); } // add to end if index is not set if (!_Type__WEBPACK_IMPORTED_MODULE_1__["isNumber"](index)) { array.push(element); ...
[ "function replace(array, element, index) {\n // check if exists\n var ind = array.indexOf(element); // remove if exists\n\n if (ind !== -1) {\n array.splice(ind, 1);\n } // add to end if index is not set\n\n\n if (!$type.isNumber(index)) {\n array.push(element);\n } // add to indicated place if index is...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
HTML DOM CONVENIENCE FUNCTIONS ////////////////////////////////////////////////// Creates a DOM element of the specified type, and adds it to the specified node. Also, adds parameters to the element as specified. Returns the new element.
function addElement(node, type, params) { var newguy = document.createElement(type); if (params != undefined) { var index = 1; while (index < params.length) { newguy[params[index-1]] = params[index]; index += 2; } } node.appendChild(newguy); return newguy; }
[ "function newElement(type, id, cl) {\n\tvar e = document.createElement(type);\n\tif(id) e.setAttribute(\"id\", id);\n\tif(cl) e.setAttribute(\"class\", cl);\n\t\n\treturn e;\n}", "function elt(type) {\r\n var node = document.createElement(type);\r\n for (var i = 1; i < arguments.length; i++) {\r\n va...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a price level and information about the visualization's current zoom level, calculates the index of the band that the price level is a part of.
function getBandIndex( vizState: {maxPrice: number, minPrice: number, priceGranularity: number}, price: number ): number { // price range between the bottom and top of each band const bandPriceSpan = (+vizState.maxPrice - +vizState.minPrice) / vizState.priceGranularity; if(price == vizState.maxPrice) { ret...
[ "function GetPriceBand(nPrice) {\n var sPriceBandId = '-1'; // set to default band\n var mapPriceBands = gMapFilters['PR']; // get the priceband filters\n for (var sPriceId in mapPriceBands) {\n var nMinPrice = mapPriceBands[sPriceId].m_nMin;\n var nMaxPrice = mapPriceBands[sPriceId].m_nMax;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the title for the view more/less button.
getButtonTitle(){ if(this.state.expanded){ return 'View Less'; } return 'View More'; }
[ "function getPageTitle () {\n return title;\n }", "title() {\n if (this.name !== '') {\n return this.name;\n }\n return this.url;\n }", "async getTitle() {\n return this.page.title();\n }", "getTitle() {\n\t\treturn this.title;\n\t}", "get title() {\n return this.remote.get...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Cada vez que se renderiza el componente, se obtiene el estado actual de la alerta asociada al usuario
componentDidUpdate() { const {Escuela} = this.props.drizzleState.contracts; if (!Escuela || !Escuela.initialized) return; const instance = this.props.drizzle.contracts.Escuela; let changed = false; let {alertaKey} = JSON.parse(JSON.stringify(this.props.estado)); if (!alertaKey) { alertaKey = instance.metho...
[ "renderAlert() {\n if (this.props.error == 'success') {\n setTimeout(() => {\n Alert.alert(\n 'Account Created Successfully',\n 'You Can now Login',\n [\n { text: 'OK', onPress: () => Actions.login({ typ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the root step of the flow chart
getRoot() { return this.canvas.flow.rootStep; }
[ "function GetStep()\n{\n\treturn m_step;\n}", "getStep() {\n return this.step;\n }", "getCurrentStep() {\n const steps = this.getSteps();\n let currentStep;\n if (this.activeStepIndex < steps.length) {\n currentStep = steps[this.activeStepIndex];\n }\n ret...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
is bounds of five maps are all same without INC
function isAllBoundsEqual_withoutINC() { var bounds = []; for (var i=0; i<app.m; i++) { var mapN = "map" + i; if (app[mapN].item.startsWith('INC')) continue; bounds.push(app[mapN].map.getBounds()); } var j = 0; var isAllSameBounds = true; for (var i=1; i<bounds.length; i++) { if (!boundsEqual(bounds[i], b...
[ "function isAllBoundsEqual() {\n\tvar bounds = [];\n\tfor (var i=0; i<app.m; i++) {\n\t\tvar mapN = \"map\" + i;\n\t\tbounds.push(app[mapN].map.getBounds());\n\t}\n\tvar j = 0;\n\tvar isAllSameBounds = true;\n\tfor (var i=1; i<bounds.length; i++) {\n\t\tif (!boundsEqual(bounds[i], bounds[0])) {\n\t\t\tisAllSameBoun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checks to see if the slots between start index and end index in the schedule of certain DAY is free if so it return true otherwise false the function takes as input the start index, end index and schedule of a day (1d array)
function checkAvailable(endIndex, schedule, startIndex) { for (var counter = startIndex; counter <= endIndex; counter++) { if (schedule[counter] != 0) return false; } return true; }
[ "function checkAvailability(schedule, currentTime) {\n let scdArr = [];\n let curArr = currentTime.split(':');\n\n for (let i = 0; i < schedule.length; i++) {\n let temp = [];\n temp.push(schedule[i][0].split(':'));\n temp.push(schedule[i][1].split(':'));\n scdArr.push(temp);\n }\n\n if (scdArr.len...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function resets the state and numbers displayed on spinners.
function reset() { i = 0; j = 1; $('p[id="times"]').text(j); $('p[id="freq"]').text(DWMspinner[i]); $('button[data-type="plus"][data-field="times"]').removeClass('disabled'); $('button[data-type="minus"][data-field="times"]').removeClass('disabled'); $('button[data-type="plus"][data-field="freq"]').remove...
[ "function resetSpin(){\n\t\t$(\"#xpGainedContainer\").show();\n\t\tsetTimeout(function(){$(\"#xpGainedContainer\").fadeOut();},3000);\n\t\tcanSpin = true;\n\t\t$(\"#spinButton\").attr(\"disabled\",false);\n\t\titemsSpun = [];\n\t\tupdateBeer();\n\t}", "reset() {\r\n this.changeState(\"normal\");\r\n }",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
AccountSelect is a dropdown of all accounts available onChange is called to send the selected value "up" to the parent component
function AccountSelector({ accountName, onChange }) { const styles = useStyles(); const { accounts } = useWalletSelector(); const [address, setAddress] = useState(""); const [validationError, setValidationError] = useState(true); const _onChange = (e) => { if(e.target.value.length > 0) { ...
[ "selectedBankAccount (e, account) {\n let { withdraw } = this.state\n let { bankAccountId } = this.props.withdraw\n withdraw.form['account'] = account\n withdraw.form[bankAccountId] = account.id\n this.setState({\n withdraw,\n listBankAccounts: { ...this.state.listBankAccounts, show: false ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check method only allow GET
function checkMethod(req, res, next) { // If the method is GET then do something with it if (req.method === 'GET') { next(); } // Any other method give correct HTTP code and informative JSON message else { res.json(405, { 'error': 'Method not allowed' }); } ...
[ "get isGet() {\n return (this.method == \"GET\");\n}", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return /^(GET|HEAD|OPTIONS|TRACE)$/.test(method)\n}", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
parse a single SQL query and return what kind of query it is (select/insert/update/delete)
function queryType(sql) { var ast = sqliteParser(sql) if (!(ast && ast.statement)) return null if (ast.statement.length !== 1) return null // only one SQL statement per SQL object return ast.statement[0].variant.toLowerCase() }
[ "function parseSQL() {\n var query = $scope.SQLTextArea.toLowerCase().split(/[ ,]+/);\n checkDisableInputs(query);\n $scope.queryType = checkQueryType(query);\n arrSelectedClassForJoin = checkQueryClasses(query);\n arrSelectedClassForJoin = deleteIrrelevantClasses(arrSelectedClassForJoin);\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sort the solutions by fitness
sort() { // Calculate the fitness of all the solutions. // We must do this for all because any could have experienced // a mutation that could change its fitness score. const fitnessSnapshot = this.solutions.map(solution => this.calculateFitness(solution)); this.solutions.sort((a,b) => { ...
[ "sortByFitness() {\n this.individuals.sort((i0, i1) => {\n if (i0.fitness < i1.fitness) {\n return 1;\n } else if (i0.fitness === i1.fitness) {\n return 0;\n }\n\n return -1;\n });\n }", "sort_by_fitness() {\n this.members.sort((firstEl, secondEl) => {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add question into question array
function pushquestion() { for (var i = 0; i < Questions.length; i++) { questionarray.push(Questions[i]); } }
[ "function addToQuestionsArray() {\n let questionObject = {\n question: question,\n answers: [answer1, answer2, answer3, answer4],\n correct: correctAnswer,\n imageId: imageId\n }\n let temp = questionsArray\n temp.push(questionObject)\n setQuestionsArray(temp)\n alert.show(\"Qu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
renders a set of links for paging through the list of items, index is the current item for the top of the page
function renderPagerStartingAt(elem$, pager$, data, index, pageSize) { if (data && data.items && index < data.items.length) { // render pager pager$.empty(); var pagerHtml = '| '; var pages = Math.floor(data.items.length / pageSize); var currentPage = Math.floor(index / pageSize); var i = 0; var ...
[ "goTo( index ) {\n this.pageIndex = index;\n this.getEntries();\n }", "function renderItemsStartingAt(elem$, data, index) {\n\t\tif (data && data.items && index < data.items.length) {\n\t\t\t// render items\n\t\t\telem$.empty();\n\t\t\tvar opt = elem$.data('gw2items_options') || {}...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draws arc after component updating.
componentDidUpdate() { this.drawArc(); }
[ "componentDidMount() {\n this.drawArc();\n }", "function draw() {\n updateCounter();\n\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.save();\n\n var time = new Date();\n\n ctx.translate(originX, originY);\n ctx.rotate(\n ((2*Math.PI)/30) * time.getSeconds() +\n ((2*Math...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get previous word offset from field begin
getPreviousWordOffsetFieldBegin(fieldBegin, selection, indexInInline, type, isInField, isStarted, endSelection, endPosition) { let startOffset = fieldBegin.line.getOffset(fieldBegin, 0); let endOffset = startOffset + fieldBegin.length; if (endPosition.offset === endOffset) { endPosit...
[ "getPreviousWordOffset(inline, selection, indexInInline, type, isInField, isStarted, endSelection, endPosition) {\n if (inline instanceof TextElementBox) {\n // tslint:disable-next-line:max-line-length\n this.getPreviousWordOffsetSpan(inline, selection, indexInInline, type, isInField, i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Focuses the active cell after the microtask queue is empty.
_focusActiveCell() { this._matCalendarBody._focusActiveCell(); }
[ "function beginTask() {\n if (environment.isOwnTask()) {\n shared.skipTask();\n return;\n }\n refreshTabs();\n util.attention(ref.addDataButton0, 0, 'focus');\n util.attention(ref.editButton0, 0, 'focus');\n util.attention(ref.creative, 0, 'scrollIntoView');\n }", "f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes user from the blacklist
function unblacklistUser(author, user, guild){ let specs = utils.getSpecifics(guild); if (isBlacklistedUser(user, guild)){ const index = specs.blacklist.indexOf(user); specs.blacklist.splice(index, 1); } utils.writeSpecifics(guild, specs); return sendBlacklist(author, guild); }
[ "function unblock_user() {\n var username = $(this).data(\"username\"), target_idx = bad_users.indexOf(username);\n if (target_idx !== -1) {\n bad_users.splice(target_idx, 1);\n }\n refresh_user(username);\n save_users();\n}", "function unbanUser(store, sr, uname) {\n if(store.sitewide[una...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Save the metadata and level data to a text file that will be used in the game.
function saveLevel(filename, data){ fs = require('fs'); fs.writeFile(filename, data, "ascii", function (err) { if (err) return console.log(err); console.log("save successfully"); }); }
[ "function saveGameData() {\n\n\t// tell the user what we're doing\n\tconsole.log(chalk.bold.yellow(\"Saving New Gamedata\"));\n\n\t// Go throughall the gamedata we loaded\n\tloadlist.gamedata.forEach(function(file) {\n\n\t\t// make it into a nice json string\n\t\tvar datastring = JSON.stringify(data.gamedata[file],...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get layers from mapN .map_layer
function getLayersfromMaps() { var layers = []; for (var i=0; i<app.m; i++) { var mapN = "map" + i; var layer = $("#"+mapN+" select[name=ACSdata]").val(); layers.push(layer); } return layers; }
[ "getLayersOnMap() {\n return this.map.getStyle().layers;\n }", "getLayers() {\n return this.mapLayers;\n }", "function getGlobalLayerfromMaps() {\n\tvar layers = Array.from(new Set(getLayersfromMaps())); // get unique layers from #mapN .map_year\n\tvar layer = \"none\";\n\tif (layers.len...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
automatically change platform after 4000ms
function switchPlatform(){ setInterval(function(){ i++; if(i===4) i = 0; showPlatform(allplatforms[i]); }, 4000); }
[ "_definePlatform() {\n const ua = window.navigator.userAgent\n const md = new MobileDetect(ua);\n\n client.platform.isMobile = (md.mobile() !== null); // true if phone or tablet\n client.platform.os = (function() {\n const os = md.os();\n\n if (os === 'AndroidOS')\n return 'android';\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
retrieve the shopping and bought items lists from the local storage, compare the clicked item with the shopping list and remove it from that list and add it to the bought items list
function boughtItem(BoughtItem){ var chosenBoughtList = localStorage.getItem("chosenBoughtList"); var boughtList = localStorage.getItem(chosenBoughtList); if(boughtList == null){ boughtList = []; } else{ boughtList = JSON.parse(boughtList); boughtList = convertObjArrayToItemArray(boughtList); } ...
[ "function retrieveBoughtShoppingListItems(){\n var chosenBoughtList = localStorage.getItem(\"chosenBoughtList\");\n var boughtList = localStorage.getItem(chosenBoughtList);\n if(boughtList != null){\n boughtList = JSON.parse(boughtList);\n for (var i =0; i < boughtList.length; i++){\n $(\"#BoughtItems...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
filter books to different shelves
filterBooks(shelf){ const { books } =this.props return books.filter((book) => book.shelf === shelf) }
[ "function booksOnShelf (shelf){\n return books.filter(book => book.shelf === shelf.key)\n }", "filterBooks() {\r\n let currentlyReading = this.state.allBooks.filter(book => book.shelf === \"currentlyReading\");\r\n let wantToRead = this.state.allBooks.filter(book => book.shelf === \"wantToRead\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds pct change from initial price; sold and bought dummies as properties to data
function enhanceData(data) { var initialPrice = data[0].close; var updatedData = data.map(function(data) { return { date: data.date, close: data.close, pctClose: (data.close - initialPrice) / initialPrice * 100, sold: 0, bought: 0 }; }); return updatedData; }
[ "getChangePercent(prevPrice, currentPrice) {\n let change = (currentPrice - prevPrice) / prevPrice;\n let isPositive = !change.toString().includes('-');\n let removedSymbols = parseFloat(change.toString().replace('-', \"\"));\n change = Number(removedSymbols.toFixed(3)); //NOTE: This doe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
visit nodes finding exported classes
function visit(node) { // Only consider exported nodes if (!isNodeExported(node)) return; if (node.kind === ts.SyntaxKind.EnumDeclaration) { var enNode = node; var symbol = checker.getSymbolAtLocation(enNode.name); if (!!symbol && generateDts) { ...
[ "function visit(node) {\n // Only consider exported nodes\n if (!isNodeExported(node) && false) {\n return;\n }\n\n if (ts.isModuleDeclaration(node) || ts.isModuleBody(node)) {\n // This is a namespace, visit its children\n ts.forEachChild(node, visit);\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }