query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
function to change the color of grandTotal when it is > 20,000
function greaterThanTwentyThousand () { if (salarySum >= 20000) { $('#grandTotal').css('color', 'red'); } }
[ "function changeToRed(red){\n if (red >= 20000){\n $('#monthlyBudget').addClass('makeRed');\n }\n }", "function GetTotal(){\n var commissionTotal = GetPriceOfShares() * GetNumberOfShares() * GetCommissionCost();\n var totalCost = GetPriceOfShares() * GetNumberOfShares();\n var...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Public: Returns a plaintext version of the message body using Chromium's DOMParser. Use with care.
computePlainText(options = {}) { if ((this.body || "").trim().length === 0) { return "" } if (options.includeQuotedText) { return (new DOMParser()).parseFromString(this.body, "text/html").body.innerText } const doc = this.computeDOMWithoutQuotes() return this.cleanPlainTextBody(doc.b...
[ "function getMessageBody() {\n // If selected message is a system message then returns the corresponding language json file entry\n if (props.message.examBodyMessageTypeId != null && props.message.examBodyMessageTypeId !== enums.SystemMessage.None) {\n return translatedMessageContents.conte...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
6. Create a function (not a method) to calculate the average of a given array of tips. HINT: Loop over the array, and in each iteration store the current sum in a variable (starting from 0). After you have the sum of the array, divide it by the number of elements in it (that's how you calculate the average)
function calcAverage (tips) { var sum = 0; for (var i = 0; i < tips.length; i++) { sum += tips[i]; } return sum / tips.length; }
[ "function calcAverage(tips){\n var sum = 0\n for(var i = 0; i < tips.length; i++){\n sum = sum + tips[i]\n }\n return sum / tips.length\n }", "function averageNumbers(array){\n let sum = 0;\n let avg;\n for ( let i = 0 ; i < array.length ; i++ ){\n sum = sum + array[i];\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Call this method with a map, mapping project names to lists of Yjs room names, and then these Yjs room names will be used for the online user list.
setOnlineUserListYjsRooms(mapProjectRooms) { this.projectsOnlineUser = {}; for(let projectName of Object.keys(mapProjectRooms)) { let roomNames = mapProjectRooms[projectName]; this.projectsOnlineUser[projectName] = []; for(let roomName of roomNames) { OnlineUserListHelper.loadListOfSy...
[ "function initUsers(userlist) {\n let online = document.getElementById('online');\n let offline = document.getElementById('offline');\n\n userlist.map(user => {\n let li = document.createElement('li');\n li.innerText = user.name;\n\n if (user.active) {\n online.appendChild(l...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
adds click handler to Cupcake edit button and displays single cupcake with edit form
function addEditClick() { $(".edit_btn").on("click", function (evt) { evt.preventDefault(); id = evt.target.id; const filtered = cupcakes.filter((c) => c.id == id); const cupcake = filtered[0]; $(".cupcake_list").html(""); $(".cupcake_side").css("width", "250px"); $...
[ "function goToEdit() {\n\thideCardContainer();\n\thideArrows();\n\thideFlashcard();\n\thideInput();\n\thideScoreboard();\n\n\tdisplayEditContainer();\n\tdisplayEditControls();\n\tupdateEditTable();\n\tupdateDeckName();\n}", "function Edit (view, clb) {\n\n view.on('edit', function () {\n\n var editNode ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the return value for the CustomVariable.
async setCustomVariable(map) { try { var price = Number(map.price) var discount = Number(map.discount) const value = Number(price - (discount * price) / 100) var response = await HMSDTMModule.setCustomVariable("varName", value + "") console.log("setCustomVariable res message:: " + JSO...
[ "set_powerOutput(newval)\n {\n this.liveFunc.set_powerOutput(newval);\n return this._yapi.SUCCESS;\n }", "callAssignAfter(variable_name){\n\t\tthis.assignValueAfter(variable_name, this.takeValue(variable_name));\n\t}", "set result(newResult) {\n this._result = newResult;\n setValue(`cm...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
(Internal) Gets a space separated list of the class names on the element. The list is wrapped with a single space on each end to facilitate finding matches within the list.
function classList(element) { return (' ' + (element.className || '') + ' ').replace(/\s+/gi, ' '); }
[ "function getClassNames(node) {\n\tif (node) {\n\t\tvar classAttrName = 'class';\n\t\tvar classNames = node.getAttribute(classAttrName) || \"\";\n\t\treturn classNames.split(/\\s+/).filter(function(n) {\n\t\t\treturn n != '';\n\t\t});\n\n\t}\n}", "function getClassNames() {\n\tvar names = [];\n\tfor (var name in ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return displayable mentions per party for the specified topic. If too many, a random sample of matching mentions is returned. Mentions are returned in chronological order.
function findMentions(topic) { return data.parties.map(function(party, i) { var mentions = topic.parties[i].mentions; if (mentions.length > maxMentions) { shuffle(mentions).length = maxMentions; mentions.sort(orderMentions); mentions.truncated = true; } return mentions; }); }
[ "async function loadPublicMemes() {\n const response = await fetch(url + '/api/memes/filter=public');\n if (response.ok) {\n const pubmemes = await response.json();\n return pubmemes.map(m => new Meme(m.id, m.title, url + m.url, m.sentence1, m.sentence2, \n m.sentence3, m.cssSentences...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Opens connection to MongoDB database, authenticates, logs successful connection.
function initializeDb() { mongoose.connection.on("open", function() { console.log("Connected to MongoDB successfully!");}); mongoose.connect("mongodb://" + loginCredentials + "@" + dbUrl + "/" + dbName); }
[ "function mongodbdata() {\n\t\n\tthis.getConnectionString = function (){\n\t\tvar result = \"127.0.0.1:27017/wardleymaps\";\n\t\t\n\t\t// if OPENSHIFT env variables are present, use the available connection info:\n\t\tif(process.env.OPENSHIFT_MONGODB_DB_PASSWORD){\n\t\t result = process.env.OPENSHIFT_MONGODB_DB_US...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A Shape is a kind of Vector
function Shape() { Vector.apply( this, arguments ); // call Vector's constructor this.age = 0 this.maxAge = 450 this.size = 0 this.color = "#00FFFF"; }
[ "function Shape(_type) {\n var type = _type;\n this.getType = function(){\n return type;\n }\n}", "add(shape) {\n // store shape offset\n var offset = shape.__position;\n\n // reset shapes list cache\n this.__shapes_list_c = void 0;\n\n // add shape to list of sh...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a local hitbox Only use this to do updates Returns null if no hitbox found
getHitbox(lookupID) { var hitboxLoc = this.hitboxLookups[lookupID]; var hitbox = this.hitboxCategories[hitboxLoc[0]][hitboxLoc[1]]; if (hitbox) { return hitbox; } else { return null; } }
[ "function new_Hitbox(hitbox)\n{\n\tif(null == hitbox)\n\t\treturn null;\n\treturn new Hitbox(hitbox.width, hitbox.height);\t\n}", "function getBoxFromMouseLocation() {\n\tfor(box in boxes) {if(boxes[box].sprite.position.x <= mouseX) {\n\t\t\tif(boxes[box].sprite.position.x + boxes[box].sprite.width > mouseX) {\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set's snapping mode Pass in boolean True=Snap on, False=Snap off
function SetSnapping(snap : boolean){ Snapping = snap; }//SetSnapping
[ "function toggleSnap() {\n if (snapping == 'on') {\n snapping = 'off'\n }\n else {\n snapping = 'on'\n }\n}", "function ToggleSnapping(){\n\tSnapping = !Snapping;\n}//ToggleSnapping", "function isSnapped() {\n return Windows.UI.ViewManagement.ApplicationView.value === Windows.UI.ViewManagement....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetch a list of ETH transactions for the user's wallet
static async getEthTransactions() { const walletAddress = await this.getWallet().then(wallet => wallet.getAddressString(), ); return fetch( `https://api.ethplorer.io/getAddressTransactions/${walletAddress}?apiKey=freekey`, ) .then(response => response.json()) .then(transactions ...
[ "function getTransactionsByAccount() {\n var account = document.getElementById(\"trxAccount\").value;\n var startBlockNumber = document.getElementById(\"startBlock\").value;\n var endBlockNumber = document.getElementById(\"endBlock\").value;\n \n if (endBlockNumber == \"\") {\n endBlockNumber = we...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Shows a page section. Assumes sectionName is the id of the DOM node and that visibility is controlled by the 'hidden' property of the node.
function showSection(sectionName, isVisible) { if (isVisible == null) isVisible = true; let section = document.getElementById(sectionName); if (section) { section.hidden = !isVisible; } else { console.warn('Import CSV: showSection on nonexistent section: ' + sectionName); } }
[ "showSection() {\n\n //close other sections\n shared.closeSections();\n\n //show \"my tickets\"\n $(\"#my_tickets_section\").css(\"display\", \"block\");\n\n //update nav bar\n navBar.setManageDisplay();\n\n navBar.setMenuItem(NAV_MY_TICKETS, true, true);\n na...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Pie chart presenting accidents split by severity Pie chart presents accident % split by severity level Function used to add up all accidents and group them by severity Function uses crossfilter reduceSum function to sum accidents Pie slices colors changed to express data categories better visually and highlight serious...
function showAccidentsSeverity(dataFor2017) { let dim = dataFor2017.dimension(dc.pluck("accident_severity")); let totalAccBySeverity = dim.group().reduceSum(dc.pluck("number_of_accidents")); dc.pieChart("#accidents-severity") .width(320) .height(360) .slicesCap(3) .innerRadi...
[ "function showAccidentsRoad(dataFor2017) {\n let dim = dataFor2017.dimension(dc.pluck(\"road_type\"));\n let totalAccByRoad = dim.group().reduceSum(dc.pluck(\"number_of_accidents\"));\n\n dc.pieChart(\"#rd-type-split\")\n .width(320)\n .height(360)\n .slicesCap(8)\n .innerRadius...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this will enable the place forms
function Enable_Place_Forms(){ $(".place").removeAttr('disabled'); }
[ "function onSubmit() {\n setShowFront(!showFront); // flip the quardrant card \n setEditAddress(null); // clear out any address that's there (if any)\n }", "function enableButtons() {\n $j(\"#open_item\").removeClass(\"disabled\");\n $j(\"#open_item\").addClass(\"enabled\");\n $j(\"#go...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the orientation of the source in 3d space.
setOrientation(x, y, z) { this.orientationX.value = x; this.orientationY.value = y; this.orientationZ.value = z; return this; }
[ "function initObjectOrientation() {\n\n config.cube.position = {\n x: -config.cube.dimensions.width / 2,\n y: 3,\n z: 0\n };\n config.bouncingSphere.position = {\n x: 20,\n y: config.bouncingSphere.dimensions.diameter / 2,\n z: 2\n };\n config.archingSphere.position = {\n x: (config.cube.p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns setter for msg or flow or global.
function getSetter(whatFor) { if (whatFor === "flow" || whatFor === "global") { return globalOrFlowSetter; } return commonImport.defaultSetter; }
[ "set (message) {\n this.message = message\n return Promise.resolve()\n }", "set value(_) {\n throw \"Cannot set computed property\";\n }", "setMessageID(messageID) { this._messageID = messageID; }", "set _socket( socket ) {\n this._propSocket = socket;\n }", "set(target, property, value...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add hint div that highlights kncell
function addKnCellHint(knCell){ var parentPosition = $(knCell).position(); var parentWidth = $(knCell).width(); var parentHeight = $(knCell).height(); var left = parentPosition.left - (parentWidth % 2) + 5; var top = parentPosition.top + 5; var knCellIndex = window.keynapse.knCells.indexOf(knCell); var label = ...
[ "function hintStyle() {\n \n document.getElementById(\"hint\").style.display = \"none\";\n document.getElementById(\"hintDisplay\").style.display = \"inherit\";\n document.getElementById(\"hintDisplay\").style.margin = \"90px 0px -64px 18px\";\n \n}", "function removeKnCellHint(){\n\t$(\"[kn-cell...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns all the neighbors of the finish node from the grid
function getUnvisitedNeighborsFinish(node, grid) { var neighbors = getAllFourNeighbors(node, grid); // keep neighbors that are unvisited OR visited by startNode return neighbors.filter( neighbor => neighbor.visitedByStart || !neighbor.visited ); }
[ "static neighbours(q, r) {\n return [[q + 1, r], [q, r + 1], [q - 1, r], [q, r - 1], [q + 1, r - 1], [q - 1, r + 1]];\n }", "function getNeighbors(cell) {\n let neighbors = [];\n\n // A cells neighbors is all vertically, horizontally, and\n // diagonally adjacent cells. To find all neighbors we need ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A type of addon, used by the UI to determine how to display different types of addons.
function AddonType(aId, aLocaleURI, aLocaleKey, aViewType, aUIPriority, aFlags) { if (!aId) throw new Error("An AddonType must have an ID"); if (aViewType && aUIPriority === undefined) throw new Error("An AddonType with a defined view must have a set UI priority"); if (!aLocaleKey) throw new Error("An...
[ "function AddElementType (type)\n{\n\treturn (doActionEx('MPEA_ADD_ELEMENT', 'ElementID', 'ElementType', type));\n}", "function extension(type) {\n const match = EXTRACT_TYPE_REGEXP.exec(type);\n if (!match) {\n return;\n }\n const exts = exports.extensions.get(match[1].toLo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
validarSeleccion(input,output) script que valida entradas de un formulario
function validarSeleccion(input,output){ if (input.value == "" ){ output.text(" * Escoja una opcion");// mensaje de error output.css("visibility", "visible"); return false; } else{ output.css("visibility", "hidden"); return true; ...
[ "function validarDados() {\n var mensagem = \"Preencha corretamente os seguintes campos:\";\n\n if (trim(document.formFormaPagamento.nome.value) == \"\") {\n mensagem = mensagem + \"\\n- Nome\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formFormaPagam...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Build an object that automatically includes the users socketId
function buildUserObj(obj) { var tmpObj = obj; // include users socketId tmpObj.socketId = user.get('socketId'); return tmpObj; }
[ "getUserBySocketID(socketID) {\n if (this.users.hasOwnProperty(socketID))\n return this.users[socketID];\n }", "function getSocketById(id){\n var count = openSockets.length;\n var socket = null;\n for(var i=0;i<count;i++){\n \n if(openSockets[i].id==id){\n socket = openS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
converts unicode character to string
function unicodeToChar(text) { return text.replace(/\\u[\dA-F]{4}/gi, function (match) { return String.fromCharCode(parseInt(match.replace(/\\u/g, ''), 16)); }); }
[ "function toStr(ch) {\r\n return String.fromCharCode(ch);\r\n}", "function convertUnicodeString(str) {\r\n\t\tvar convertedText = str.replace(/\\\\u[\\dA-Fa-f]{4}/g, function (unicodeChar) {\r\n\t\t\treturn String.fromCharCode(parseInt(unicodeChar.replace(/\\\\u/g, ''), 16));\r\n\t\t});\r\n\t\treturn convertedTe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
increment the sum by the temperature from stdin increment length by 1 and add the temp to data
function update(temp) { result.sum += parseFloat(temp); result.l++; result.data[result.data.length] = temp; }
[ "insert(temperature) {\n if (this.maxTemp === null || temperature > this.maxTemp) {\n this.maxTemp = temperature;\n }\n if (this.minTemp === null || temperature < this.minTemp) {\n this.minTemp = temperature;\n }\n\n // For mean\n this.numberOfReadings++;\n this.totalSum += temperatur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns the diameter of circle based on window size
function determineDiameter() { var height = square_div_array[0].clientHeight; var width = square_div_array[0].clientWidth; // how to return most correct size circle? return (lessThan(height, width)-5)+'px'; }
[ "function circleDiameter(ratio) {\n return ratio * 2;\n}", "function radius(e)\n{\n return 4*Math.sqrt(e.size);\n}", "function squareAreaToCircle(size){\n return +(Math.PI * size / 4).toFixed(8);\n}", "function calculateCirclePerimeter() {\n return this.radius * 2 * Math.PI;\n}", "function perimet...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Wrap exec command in Promise
function execCommand(command) { console.log('Executing command: ', command); return new Promise((resolve, reject) => { exec(command, (error, stdout, stderr) => { console.log('Command finished with following output:'); console.log('--- stdout ---'); console.log(stdout); console.log('--- ...
[ "function execProm(cmd) { // string => Promise of { stdout: string, stderr: string }\n return new Promise((resolve, reject) => {\n exec(cmd, (err, stdout, stderr) => {\n if (err) {\n reject( { err, stdout, stderr });\n } else {\n resolve({ stdout, stderr });\n }\n });\n });\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Match Images to Events > need to change to artists
function matchImageswithEvents(images, id) { for (let i = 0; i < images.length; i++) { if (id === images[i].id) { let artistImage = images[i].url; return artistImage; } } }
[ "function clickPictures(){\r\n\tvar clickedElement = event.target;\r\n\r\n\tif (clickedElement.tagName === \"IMG\") {\r\n\tmagnifiedImage.src = clickedElement.src; //puts the clicked image into the image source\r\n\t}\t\r\n}", "function storyChange() {\n // The \"Finger Family\" is shown\n if (subscriberNumber ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Setup the Firebase config listeners.
async function _initConfigListeners() { const fbRoot = await FBHelper.getRootRefUnlimited(); const fbConfig = await fbRoot.child(`config/${APP_NAME}`); fbConfig.on('value', async (snapshot) => { const newConfig = snapshot.val(); try { _parseConfig(newConfig); } catch (ex) { log.exception(L...
[ "function setupFirebaseConfig(){\n var config = {\n apiKey: \"AIzaSyCYDlrU2O3OT4jaJnaCF5krqCbof67yTWU\",\n authDomain: \"findmefuel-3c346.firebaseapp.com\",\n databaseURL: \"https://findmefuel-3c346.firebaseio.com\",\n storageBucket: \"findmefuel-3c346.appspot.com\",\n messag...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Write a function called checkCoupon to verify that a coupon is valid and not expired. If the coupon is good, return true. Otherwise, return false. A coupon expires at the END of the expiration date. All dates will be passed in as strings in this format: "June 15, 2014"
function checkCoupon(coupon) { // console.log("==checkCoupon=="); // set a limit to the expiration date of the coupon var expirationDate = new Date(coupon); expirationDate.setHours(23); expirationDate.setMinutes(59); expirationDate.setSeconds(59); // checking if the coupon's date exceeds the END of the date by setting ...
[ "function checkCoupon(enteredCode, correctCode, currentDate, expirationDate){\n console.log(enteredCode + ' ' + correctCode + ' ' + currentDate + ' ' + expirationDate)\n console.log(enteredCode.length);\n if(enteredCode.toString().length < 3 || enteredCode.toString() != correctCode.toString() || enteredCode == '')...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
opens name input dialog, creates new Libraryobject and adds it to the current project
createLibrary(event) { const controller = event.data.controller; InputDialog.type = 'createLibrary'; const dialog = new InputDialog((input) => { if (null == controller.createLibrary(input)) { InfoDialog.showDialog('A library' + ' with this name alr...
[ "function addProject(){\n\n\t\t\t\tvar addProjWindow = new Window(\"palette\", \"Add Project\");\n\n\t\t\t\t// group for custom project\n\t\t\t\tvar customProjGroup = addProjWindow.add(\"group\");\n\t\t\t\t\tcustomProjGroup.orientation = \"column\";\n\t\t\t\t\tcustomProjGroup.alignChildren = ['left', 'fill']\n\n\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculates total daily revenue with STATIC rates.
calculateTotalDailyRevenue(revenueArray){ let revenue = 0; for(let i=0; i<24; i++){ revenue += parseFloat(revenueArray[i]); console.log(revenue); } return revenue.toFixed(2); }
[ "calculate(initialAmount) {\n let total = 0.0;\n let options = {\n initialAmount: initialAmount, // initial amount assigned\n daysRented: this._rental.getDaysRented(), // get number of days the car rented\n mileage: this._rental.getMileage() // get mileage\n };\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the open state.
set open(state) { this.skeleton.open = state; }
[ "_onOpen(ev) {\n ev.getData().set(this._tree.getOpenProperty(), true);\n }", "function openNavDrawer(state) { //essa funcao serve para poder controlar a abartura e fechamendo do drawer podendo manejas se ele foi aberto pelo navBar ou pelo mouseEnter\n setOpen(state)\n setLock(state)\n onClearTime...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TO DO: Perimeter of Circle
function perimeterCircle (radius) { var circle_Perimeter = 2 * Math.PI * radius; return circle_Perimeter; }
[ "function calculateCirclePerimeter() {\n return this.radius * 2 * Math.PI;\n}", "function areaCircle (radius)\n{\n\t// var circle_Area = Math.PI * (radius * radius);\n\tvar circle_Area = Math.PI * (Math.pow(radius,2));\n\treturn circle_Area;\n}", "function areaCircle(d){\n var rad = d / 2;\n\n var areaC ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function TdFadeInOutAnimation params: duration: Duration of animation in miliseconds. Defaults to 150 ms. Returns an [AnimationTriggerMetadata] object with states for a fading animation.
function TdFadeInOutAnimation(duration) { if (duration === void 0) { duration = 150; } return _angular_animations.trigger('tdFadeInOut', [ _angular_animations.state('0', _angular_animations.style({ opacity: '0', display: 'none', })), _angular_animations.state('1',...
[ "function FadeInTransition() {}", "function TdCollapseAnimation(duration) {\n if (duration === void 0) { duration = 120; }\n return _angular_animations.trigger('tdCollapse', [\n _angular_animations.state('1', _angular_animations.style({\n height: '0',\n display: 'none',\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function to assert Base64 functions are available at runtime.
function assertBase64Available() { if (!__WEBPACK_IMPORTED_MODULE_0__platform_platform__["a" /* PlatformSupport */].getPlatform().base64Available) { throw new __WEBPACK_IMPORTED_MODULE_2__util_error__["b" /* FirestoreError */](__WEBPACK_IMPORTED_MODULE_2__util_error__["a" /* Code */].UNIMPLEMENTED, 'Blobs a...
[ "function b64arrays() {\n var b64s = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n b64 = new Array();\n f64 = new Array();\n for (var i = 0; i < b64s.length; i++) {\n b64[i] = b64s.charAt(i);\n f64[b64s.charAt(i)] = i;\n }\n}", "async base64(source, opts = {}) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
mark every selected email as read
function markSelectedAsRead() { let newRead = [...readEmails] for (let i = 0; i < selectedEmails.length; i++) { if (!newRead.includes(selectedEmails[i])) { newRead.push(selectedEmails[i]); } } setReadEmails(newRead); }
[ "function markSelectedAsUnread() {\n let newRead = [...readEmails]\n newRead = newRead.filter((id) => !selectedEmails.includes(id));\n setReadEmails(newRead);\n }", "function markAsRead(emailID) {\n let newRead = readEmails;\n if (!newRead.includes(emailID)) {\n newRead.push(emailID);\n }\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function for removing filter (needed to be initialised in document.ready of page with callback function
function remove_filter(callback_fn) { $('.filter_block').on('click', '.remove_filter', function() { if( $(this).parents('.inner_filter_block').find('.inner_filter').length == 1) { if( $(this).parents('.applied_filter_block').find('.inner_filter_block').length == 1 ) { $(this).parents('.inner_filter_...
[ "function removeFilter(){\r\n \t\r\n \tvar idx = -1;\r\n \tangular.forEach( ctrl.filters, function(filter,index){ if( filter === ctrl.currentFilter ) idx = index; });\r\n \tif( idx >=0 ){ \r\n \t\tctrl.filters.splice( idx,1 ); \t \r\n \t\tctrl.currentFilter = (ctrl.filters.length >= 0 )? ctrl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
SHOWENDSLTRIALS: shows the page right at the end of both SL trials
function showEndSLTrials() { hideElements(); ind = 0; onPC = false; onPR = false; onSL = false; onSLtest = false; onPFtaskA = true; $('#instructions').show(); $('#instructions').load('html/pfinstructions.html'); $('#next').show(); $('#next').click(showPFInstructionChecks); }
[ "function _showTrials(trials, start) {\n\tvar trial_list = $('#trial_list');\n\tif (!start || 0 == start) {\n\t\ttrial_list.empty();\n\t}\n\t$('#show_more_trials').remove();\n\t$('#g_map_toggle').show();\n\t\n\t// no trials to show\n\tif (!trials || 0 == trials.length || start >= trials.length) {\n\t\tif (trials.le...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draws the board and any tokens that have been stored in board. Token colour is done based on player association in board.
function drawBoard() { $("#canvas").empty(); //$("#canvas").replaceWith(jQuery("<div>", {id: "canvas"})); $("#canvas").css("background-color", boardC); var svg = $(makeSVG(580, 580)); var sqLen = Math.round(500 / (board.length - 1)); //Draw the lines of the Go board for (var i = 0;...
[ "draw(ctx) {\r\n if (this.isDistanced) {\r\n this.distanceGraph();\r\n }\r\n // draw all nodes and store them in grid array\r\n this.nodeList.forEach(node => {\r\n node.draw(ctx);\r\n storeNodeAt(node, node.x, node.y);\r\n });\r\n\r\n // draw all edges\r\n this.edgeList.forEach(e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
adding element from saved websitesToTrack
function addElement(website) { var li = document.createElement("li"); var t = document.createTextNode(website); li.appendChild(t); if (website === '') { return; } else { document.getElementById("myUL").appendChild(li); } var span = document.createElement("SPAN"); var txt = document.createTextNode("\u00D7...
[ "function addTrack() {\n SC.get('/tracks/' + track).then(function(player) {\n\n trackList.push({\n id: player.id,\n trackName: player.title,\n url: player.stream_url,\n artist: player.user.username\n });\n\n if (trac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Liefert die Funktionsaufruf zur Option als String opt: Auszufuehrende Option isAlt: Angabe, ob AltAction statt Action gemeint ist value: Ggfs. zu setzender Wert type: EventTyp fuer , z.B. "click" fuer "onclick=" serial: Serialization fuer StringWerte (Select, Textarea) memory: __OPTMEM.normal = bis Browserende gespeich...
function getFormActionEvent(opt, isAlt = false, value = undefined, type = "click", serial = undefined, memory = undefined) { const __ACTION = getFormAction(opt, isAlt, value, serial, memory); return getValue(__ACTION, "", ' on' + type + '="' + __ACTION + '"'); }
[ "function genOpzione(tipi, selezione) {\n //GEN OPZIONE\n let opzione = '';\n tipi.forEach((tipo) => {\n //AGGIUNGIAMO UN PO' DI HTML IN MODO DA MODIFICARE LE OPZIONI IN BASE AL type\n opzione += `<option value=\"${tipo}\">${tipo}</option>`; \n });\n //UTILIZZIAMO IL '+=' IN MODO TALE D...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function to sync drawn sites
function draw_sites(sites) { // Add markers for new sites for (var i = 0; i < sites.length; ++i) { var site = sites[i]; if (site_index[site.id] === undefined) { var marker = L.circleMarker([site.location.lat, site.location.lng], SITE_OPTIONS) .bindPopup(site_popup, ...
[ "function SyncColorsFromServer(){\n for(var i=0;i<STATION_COUNT;i++){\n SetColors(i,0,colors[i]);\n }\n}", "function sync()\n{\n\tvar c = widget.preferenceForKey(createInstancePreferenceKey(\"clocker\"));\n\tvar uname = widget.preferenceForKey(createInstancePreferenceKey(\"username\"));\n\tvar pw = w...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parses an import statement WAST: import: ( import ) imkind: ( func ? ) ( global ? ) ( table ? ) ( memory ? ) global_sig: | ( mut )
function parseImport() { if (token.type !== _tokenizer.tokens.string) { throw new Error("Expected a string, " + token.type + " given."); } var moduleName = token.value; eatToken(); if (token.type !== _tokenizer.tokens.string) { throw new Error("Expected a string, " + toke...
[ "visitImport_stmt(ctx) {\r\n console.log(\"visitImport_stmt\");\r\n if (ctx.import_name() !== null) {\r\n return this.visit(ctx.import_name());\r\n } else {\r\n return this.visit(ctx.import_from());\r\n }\r\n }", "removeTypeBindings() {\n this.tokens.copyExp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Todo: make the game object move around
moveAround() { }
[ "move() {\n this.change = this.mouthGap == 0 ? -this.change : this.change;\n this.mouthGap = (this.mouthGap + this.change) % (Math.PI / 4) + Math.PI / 64;\n this.x += this.horizontalVelocity;\n this.y += this.verticalVelocity;\n }", "turnAround() {\n this.left(180);\n }", "move() {\n //t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return a query to retrieve period, group, and electron configuration information
function genPartOfAndElectronConfQuery(elements) { var elementSet = getElementWDSet(elements); var query = ` SELECT ?element ?anum ?pofLabel ?electronConfig WHERE { ?element wdt:P31 wd:Q11344; wdt:P361 ?pof; wdt:P8000 ?electronConfig; wdt:P1086 ?anum. ...
[ "async queryContainer() {\n console.log(`Querying container:\\n${config.container.id}`)\n \n // query to return all children in a family\n // Including the partition key value of lastName in the WHERE filter results in a more efficient query\n const querySpec = {\n query: 'SELECT...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Produces a list of duration options with the specified default value.
function DurationOptions({ defaultValue, minuteOptions }) { // <FormattedMessage> can't be used inside <option>. const intl = useIntl() const options = minuteOptions.map((minutes) => ({ text: minutes === 60 ? intl.formatMessage( { id: 'components.TripNotificationsPane.oneHour' }, ...
[ "function summarizeDuration(duration, options={}) {\n\tlet oneElement = \"oneElement\" in options ? options.oneElement : false;\n\tlet stripZeroes = \"stripZeroes\" in options ? options.stripZeroes : true;\n\tlet shortenDurationNames = \"shortenDurationNames\" in options ? options.shortenDurationNames : true;\n\tle...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Answer: You could have a method where you will pass a function and it will internally maintain a cache object where calculated value will be cached. When you will call the function with same argument, the cached value will be served.
function cacheFn(fn) { var cache = {}; return function(arg) { if (cache[arg]) { return cache[arg]; } else { cache[arg] = fn(arg); return cache[arg]; } }; }
[ "function cached(fn) {\n\t var cache = new Map();\n\t return function cachedFn() {\n\t var key = arguments.length <= 0 ? undefined : arguments[0];\n\t if (!cache.has(key)) cache.set(key, fn.apply(void 0, arguments));\n\t return cache.get(key);\n\t };\n\t }", "function wrap (key) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function for calculating the elastic collision
function elasticCollisionCalculation(scope) { /**v1 is calculated using the formula v1=(Cm2(u2-u1)+m1u1+m2u2)/(m1+m2), here c is the coeff of restitution and is taken as 1 by default,u1 is the velocity of Object A, u2 is the velocity of Object B,m1 is the mass of Object A and m2 is the mass of Object B*/ elastic_...
[ "function inelasticCollisionCalculation(scope){\n\t/**v1 is calculated using the formula v1=(Cm2(u2-u1)+m1u1+m2u2)/(m1+m2), here c is the coeff of restitution,\n\tu1 is the velocity of Object A,\tu2 is the velocity of Object B,m1 is the mass of Object A and \n\tm2 is the mass of Object B*/\n\tinelastic_v1=(coeff_re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a set of schedules of busy time ranges, return the time range of availabilities common to all schedules..
function getOverlaps(schedules) { var res = []; return schedules.reduce((openSlots, schedule) => { var open = getOpenSlots(schedule); return intersectSchedules(openSlots, open); }, [['09:00', '20:00']]); }
[ "function intersectSchedules(schedule1, schedule2) {\n var res = [];\n \n schedule1.forEach(r1 => {\n schedule2.forEach(r2 => {\n var intersection = findIntersection(r1, r2);\n \n if (intersection) {\n res.push(intersection);\n }\n });\n });\n \n return res;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
===== EPISODES =====// get the episodes for episodes in a season table rendering (ajaxCall)
function getAdminEpisodes(show_id, season_num) { ajaxCall("GET", "../api/Episodes?show_id=" + show_id + "&season_num=" + season_num, "", getAdminEpisodes_success, getAdminEpisodes_error); }
[ "function getAdminEpisodes_success(episodesData) {\n // save the episodes for global usage\n episodes = episodesData;\n\n // if the table does not exit yet (hasnt been rendered yet), than render it.\n if (episodesTbl == null)\n renderEpisodesTable(episodes);\n else // else redraw the table fro...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
opens modal for the new todo form
function toggleNewModal() { let modal = document.querySelector('.new-todo'); let form = modal.querySelector('form'); modal.classList.toggle('modal-active'); populateProjectOptions(form, projects) }
[ "function openModalNewResponsableMedicion() {\n\tabrirCerrarModal(\"modalAsignaPersonas\");\n\tsetFirstInput();\n}", "function open_add_ntf_modal() {\n $(\"#resModal\").modal(\"show\");\n $(\"#resContent\").html(\"\");\n $(\"#resSpan\").html(\"\");\n $(\"#resTitle\").html(\"Add New Notification\");\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Will fail if project has trouble looking up remotes, or if remotes are not empty.
async assertLocalOnlyGitRepository() { // make sure, git command succeeds const errResult = (await this.execGitCaptureErr(`remote -v`)).trim(); if (errResult) { throw new Error(`"git remote -v" failed - "${errResult}"`); } const result = (await this.execCaptureOut(`${this.gitCommand} remote -v...
[ "async function validateRepository() {\n const projectRepo = await targetProjectRepo();\n const ENSURE_REMOTE_PROJECT = projectRepo.url;\n\n if (!projectRepo || !(projectRepo.type !== 'gitlab' || projectRepo.type !== 'git' || projectRepo.type !== 'bitbucket' || projectRepo.type !== 'stash')) {\n console.log(`...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the toggle's HTML and appends it to the container
render() { templateSettings.interpolate = /{{([\s\S]+?)}}/g; const temp = document.querySelector(`#${SETTINGS.Id.TOGGLE_TEMP}`).innerHTML; const tempFn = template(temp); const markup = tempFn({ data: this.data }); this.container.insertAdjacentHTML('beforeend', markup) }
[ "render() {\n const html = `<label id=\"${this.target.replace('#', '')}\" class=\"btn btn-primary text-light \" title=\"${this.hoverText}\">\n <input type=\"radio\" name=\"options\" autocomplete=\"off\"> ${this.iconStr()}\n </label>`;\n $(this.target).replace...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Response of getting quiz points
function processQuizPoints(){ if (Quiz.readyState<4){ console.log('Loading Quiz now'); } else if(Quiz.readyState===4){ if(Quiz.status>=200 && Quiz.status<300){ QuizPoints=Quiz.responseText; QuizLayer(QuizPoints); } } }
[ "function getQuestion() {\n \n \n }", "static create_quiz(title, course_code, description){\n axios.post(this.url, {\n title,\n course_code,\n description,\n })\n .then(function (response) {\n // handle success\n // ret...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find all pieces of color atkColor that attack the given square / Note: Even if a piece attacks a square it may not be able to move there / Note: En passant captures are not considered by this function
function getAttackers(toRow, toCol, atkColor) { var atkSquare = new Array(); /* check for knights first */ for (var i = 0; i < 8; i++) { // Check all eight possible knight moves var fromRow = toRow + knightMove[i][0]; var fromCol = toCol + knightMove[i][1]; if (isInBoard(fromRow, fromC...
[ "function findVulnerability(areas_black, areas_white, chess) {\n\n areas_white = [\n [0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function Name: checkRadioArray Arguments: radioButtons Returns: true if one of the radio buttons is checked false otherwise
function checkRadioArray(radioButtons){ for (var i=0; i < radioButtons.length; i++) { if (radioButtons[i].checked) { return true; } } return false; }
[ "function anyRadioButtonsUnchecked()\n{\n\tvar traceChecked = radChecked(\"#traceYes\") || radChecked(\"#traceNo\");\n\tvar handChecked = radChecked(\"#chooseLeft\") || radChecked(\"#chooseRight\");\n\t\n\treturn traceChecked == false || handChecked == false;\n}", "async getCheckedStatus() {\r\n let dxpRad...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION: generateDynamicDataRef DESCRIPTION: Returns a dynamic binding string for the given source and binding ARGUMENTS: sourceName the name of a data source bindingName the name of a binding within that source RETURNS: Returns a dynamic binding string
function generateDynamicDataRef(sourceName,bindingName,dropObject) { var retVal = ""; var sbObjs = dwscripts.getServerBehaviorsByTitle(sourceName); if (sbObjs && sbObjs.length) { var paramObj = new Object(); paramObj.bindingName = bindingName; retVal = extPart.getInsertString("", "CFStoredProc_Data...
[ "function generateDynamicSourceBindings(sourceName)\n{\n var retList = new Array();\n\n // find the sbobj for the stored proc\n var sbObjs = dwscripts.getServerBehaviorsByTitle(sourceName);\n if (sbObjs && sbObjs.length)\n {\n // Add a binding for the status code if it is returned.\n var statusCodeVarNam...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Animation for removing cards from deck
function removeFromDeck() { var name = "count_" + deckCounter; showImage('deckImage', name, 'deckHolder'); }
[ "function animateRemoval() {\n if (N > 1) {\n game.add.tween(chairSprites[index]).to({\n alpha: 0\n }, 1000, Phaser.Easing.Linear.None, true);\n game.add.tween(textSprites[index]).to({\n alpha: 0\n }, 1000, Phaser.Easing.Linear.None, true);\n }\n game.time....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
addPitch used to add chord and pitch by piano widget
toggleAddPitch(pitch) { const pitches = []; let exists = false; this.pitches.forEach((o) => { if (o.letter !== pitch.letter || o.octave !== pitch.octave || o.accidental !== pitch.accidental) { pitches.push(o); } else { exists = true; } }); this.pitch...
[ "function setPitchAndBearing(pitch=0,bearing=0){\n map.setPitch(pitch);\n map.setBearing(bearing);\n}", "function createPitch() {\n ctx.beginPath();\n ctx.moveTo(boardWidth/2,0);\n ctx.lineTo(boardWidth/2,boardHeight);\n ctx.closePath();\n ctx.lineWidth = 8;\n ctx.s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The archive code tells us when it is starting to archive messages. This is different from hinting about deletion because it will also tell us when it has completed its mass move. The UI goal is that we do not immediately jump beyond the selected messages to the next message until all of the selected messages have been ...
hintMassMoveStarting() { this.hintAboutToDeleteMessages(); this._massMoveActive = true; }
[ "updateNextMessageAfterDelete() {\n this.hintAboutToDeleteMessages();\n }", "onMessagesRemoved() {\n FolderDisplayListenerManager._fireListeners(\"onMessagesRemoved\", [this]);\n\n let handled = this.messageDisplay.onMessagesRemoved();\n this._deleteInProgress = false;\n if (handled) {\n retu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function submit all the test cases after the question has been created!
function submitTestCases(question_key){ var primary_key = question_key['items'][0]['primary_key'] var fields = {"question_id":primary_key} for (var i=0;i<=testCasesKeeper;i++){ var input = document.getElementById("input_"+i).value; var output = document.getElementById("output_"+i).value; var fields = { "q...
[ "function setUpTests()\n {\n// var fullInteractionData = $.parseJSON(app.scorm.scormProcessGetValue('cmi.interactions.0.learner_response'));\n var fullInteractionData;\n if(app.scorm.scormProcessGetValue('cmi.suspend_data') !== ''){\n fullInteractionData = $.parseJSON(app.scorm.scormProcessGetValue('cmi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the current domain.
setCurrentDomain(tabIndex) { this.currentDomain = this.dictionary.domains[tabIndex].key; }
[ "function setDomains( domains, callback ) {\n\tchrome.storage.sync.set( {\n\t\tdomains: domains\n\t}, callback );\n}", "function saveDomain() {\n getCurrentUrl().then(function(url){\n var domain,\n protocol,\n full;\n\n domain = TOCAT_TOOLS.getDomainFromUrl(url);\n protocol = TOCAT...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Node has a value and an adjacency list of connected nodes
constructor(value) { this.value = value; this.adjacents = []; // Adjacency List }
[ "addNode(value) {\r\n // create a new node\r\n const node = new Node(value)\r\n // add node to the nodes map\r\n this.nodes.set(node, new Map())\r\n // return the new node\r\n return node;\r\n }", "addAdjacent(node) {\n this.adjacents.push(node);\n }", "constructor(idNode, value) {\n t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get compiler version from compiler contract object This is used to redirect the user to specific version of Solidity documentation
function getCompilerVersion(contractFiles) { let version = 'latest'; const fileNames = Object.keys(contractFiles); const contracts = contractFiles[fileNames[0]]; const contractNames = Object.keys(contracts); const contract = contracts[contractNames[0]]; // For some compiler/contract, metadata is "" if (co...
[ "function getVersion() {\n var contents = grunt.file.read(\"formulate.meta/Constants.cs\");\n var versionRegex = new RegExp(\"Version = \\\"([0-9.]+)\\\";\", \"gim\");\n return versionRegex.exec(contents)[1];\n }", "get toolVersion() {\n return '0.2.0'\n }", "function getVersion(page...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
draw a single piston offset X, Y, Z and delta Pitch, Roll, Yaw
function drawPiston ( oX, oY, oZ, dP, dR, dY ) { const engineRotationAngle = dR + rotationSpeedEngine; const rodLength = rodFactor*engineSize; const rodJournalY = Math.sin( engineRotationAngle )*engineSize/4; const rodJournalZ = Math.cos( engineRotationAngle )*engineSize/4; const zPiston = rodJou...
[ "function drawParticles() {\n // Orb (ellipse) figures that trail, used a for loop to run the code frequently.\n for (var i = 0; i < orbs.length; i++) {\n// Incorporated methods such as move and display for the orbs to move at a constant while being displayed in various colors.\n orbs[i].move();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Diff Match and Patch Copyright 2018 The diffmatchpatch Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under t...
function diff_match_patch() { // Defaults. // Redefine these in your program to override the defaults. // Number of seconds to map a diff before giving up (0 for infinity). this.Diff_Timeout = 1.0; // Cost of an empty edit operation in terms of edit characters. this.Diff_EditCost = 4; // At what point i...
[ "function formatDiffPatch(patch) {\n return patch.split(os_1.EOL)\n .slice(4)\n .map(formatDiffLine)\n .filter(Boolean)\n .join(os_1.EOL);\n}", "function getMatchingDiff(fileChangeJSON, data) {\n if ($.isArray(data.diffs) && data.diffs.length) {\n var matchingDiff ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Used to get the opened tooltip close button. Works only when `isSticky` is enabled
getTooltipPopupCloseButton() { return this.selector(`[id^="${this.id}_"] > div.e-icons.e-tooltip-close`); }
[ "function TdeCtrl_OnToolTipCloseBt() \n{\n LabelOpObj.RemoveToolTip();\n}", "function toggleHelpAbsoluteFrench(obj, a_id) {\n\tvar content = document.getElementById(obj);\n\tvar opener = document.getElementById(a_id);\t\n\t\n\ticonState = opener.lastChild.alt;\n\ticonState = iconState.replace(\"R\\u00E9duire\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the boolean values of the specified Property from a [[Thing]]. If the Property is not present, returns an empty array. If the Property's value is not of type boolean, omits that value in the array.
function getBooleanAll(thing, property) { internal_throwIfNotThing(thing); const literalStrings = getLiteralAllOfType(thing, property, xmlSchemaTypes.boolean); return literalStrings .map(deserializeBoolean) .filter((possibleBoolean) => possibleBoolean !== null); }
[ "function filter(obj, prop, val) {\n\tvar arr = []\n\tfor (var k in obj) {\n\t\tvar v = obj[k]\n\t\tif (v[prop] === val)\n\t\t\tarr.push(v)\n\t}\n\treturn arr\n}", "function arr_filter_out(arr, prop, val) {\n\treturn arr.filter(function (v) { return v[prop] !== val })\n}", "function arr_filter(arr, prop, val) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
On Request we execute the requestIndividualMove workflow rule and we open the examine form in a dialog box.
function onRequest(cmdContext) { // we first run the workflow rule and then // hide the request button and change the move status to Requested var form = cmdContext.command.getParentPanel(); var mo_id = form.getFieldValue('mo.mo_id'); try { var result = Workflow.callMethod('AbMoveManagement-MoveService...
[ "botMoveRequest()\r\n {\r\n if(!scene.gameInProgress)\r\n return;\r\n\r\n let bot = game.players[game.currentPlayer];\r\n let difficulty = bot.substring(3,bot.length);\r\n\r\n if(difficulty == \"Easy\")\r\n scene.getPrologRequest(\"bot_move(\" + game.board + \",\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ham set event cho btn nextMonth
function btnNextMonthClick() { erase(); monthCheck = monthCheck + 1; if (monthCheck > 11) { monthCheck = 0; yearCheck = yearCheck + 1; } console.log(monthCheck); setData(); setMonths(); setYears(); }
[ "function nextMo() {\n showingMonth++;\n if (showingMonth > 11) {\n showingMonth = 0;\n showingYear++;\n }\n update();\n closeDropDown();\n //console.log(\"SHOWING MONTH: \" + showingMonth);\n}", "add_chgMonBtn_handler() {\n var prevbtn = document.getElementById(\"prev-month...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called on every game update(), updates the counters for ingame seconds, elapsed time, and milliseconds. Important because the time variables are used in game physics calculations.
function update_timer() { seconds = Math.floor(game.time.time / 1000); milliseconds = Math.floor(game.time.time); elapsed = game.time.time - starting_time; }
[ "update() {\n let frameStart = (performance || Date).now();\n // track wall time for game systems that run when the ECS gametime\n // is frozen.\n let wallDelta = this.lastFrameStart != -1 ?\n frameStart - this.lastFrameStart :\n Constants.DE...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
private // the reason that we want to buildUniqueViewEventTypes is that when unbind or undelegate the viewEventTypes, we want to the viewEventTypes as unique as possible, check the unsubscribe method input: getUniqueViewEventTypes("click dblClick", viewWithViewId3, "customer") output: "click.__via.3.customer dblClick._...
function buildUniqueViewEventTypes ( originalEventTypes, publisherView, subscriberModelPath ) { var publisherViewId = $( publisherView ).viewId(); /* if original viewEvents is "click dblClick", and it bind to path "firstName", it will convert to click.__via.firstName dblClick.__via.firstName, the reason is ...
[ "function onViewType(e)\n{\n\tvar viewtype = $F($('viewtype')); // 0: autodetect, 1:table;\n\tclickTree(oidview._oid, oidview._idx, viewtype, column_names);\n}", "clearEventSubscriptions(eventType) {\n this.events.delete(eventType);\n }", "viewWasClicked (view) {\n\t\t\n\t}", "handlers(event_type, a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete a term with id. DELETE terms/:id
async destroy({ params, response }) { const { id } = params; const term = await Term.getTerm(id); const result = await term.delete(); if (!result) { return response .status(400) .send( errorPayload( errors.RESOURCE_DELETED_ERROR, antl('error.resource.resourceDeletedError'), ), ...
[ "deleteAction(req, res) {\n Robot.remove({ _id: req.params.id }, (err, robot) => {\n if (err)\n this.jsonResponse(res, 400, { 'error': err });\n\n this.jsonResponse(res, 204, { 'message': 'Deleted successfully!' });\n });\n }", "deleteById(id) {\n return th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
========================================================================= / / sigaction()
function sigaction ( sig, act, oact ) { /// Describe the space of inwarding returns. return syscall(SYS_SIGACTION, sig, act, oact); }
[ "function sigsuspend ( sigset_mask ) {\n /// Contract the facts of the case.\n var sigset_tmp;\n\n sigprocmask(SIG_SETMASK, sigset_mask, &(sigset_tmp));\n pause();\n sigprocmask(SIG_SETMASK, &(sigset_tmp), NULL);\n return -1;\n}", "function shakeEventDidOccur () {\n\n //put your own code here etc.\n r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
builds all the circles for all the keywords
function makeAllCircles(keywords){ var circleColor; d3.select('body').append('svg').attr('height', 1000).attr('width', 1000); keywords.map(function(each){ var allReviews = []; //assign circle color depending how many times the keyword showed up if (each.frequency < 100) { circleColor = 'green...
[ "function getKeywords (place) {\n let labels = `<div class=\"labels\">`;\n let keywords = ``;\n // If place has keywords, display them:\n\n // Create html structure for keywords:\n if (place.keywords && place.keywords.length > 0) {\n place.keywords.map(e => { keywords = keywords.concat(`\\n <div class=\"ke...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION NAME : setDeviceInformation AUTHOR : Juvindle Tina DATE : December 6, 2013 MODIFIED BY : REVISION DATE : REVISION : DESCRIPTION : store device information PARAMETERS : devPath
function setDeviceInformation(devPath,model,src,manufac,ostyp,prdfmly,ipadd,prot,hostnme,devtype){ // var devtype = getDeviceType(model); if(manufac){ var manu = manufac; }else{ var manu = getManufacturer(model); } var myPortDev = []; if(globalInfoType == "JSON"){ setDevicesInformationJSON("",devtype,devPath...
[ "set deviceName(value) {}", "function addDevice(data) {\n try {\n if (data.id === \"SenseMonitor\" || data.id === 'solar') { //The monitor device itself is treated differently\n deviceList[data.id] = data;\n } else {\n\n //Ignore devices that are hidden on the Sense app (u...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
fetches the json data and then calls countrydropdownmenu function
async function callCountryData() { const response = await fetch('land.json') const countryData = await response.json() countryDropDownMenu(countryData); }
[ "function countryChange() {\n country = document.getElementById(countryName + \"-select\").value;\n updateData();\n }", "function showcity() {\n let CS = document.getElementById(\"coutriesSelect\");\n let selectedCountry = CS.options[CS.selectedIndex].innerHTML;\n let selecte...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Service to monitor and cull size of the IDP API Collection
function idpRestApiCollectionMonitor(req, resp) { var maxItemCount = MAX_API_RECORDS; var collName = COL_API_CALLS; var fName = entryLog(arguments.callee.name, 'triggered with max item count: ' + maxItemCount); ClearBlade.init({request:req}); var col = ClearBlade.Collection({collectionName:collName}); var ...
[ "static getStatistics(){\n\t\tlet kparams = {};\n\t\treturn new kaltura.RequestBuilder('partner', 'getStatistics', kparams);\n\t}", "function getAllOptionsCount(response, numItems, offset) {\n var sql = \"SELECT COUNT(*) FROM options\";\n\n connectionPool.query(sql, function(err, result) {\n\n if (er...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns boolean of whether turret can be placed at a grid spot
function canPlaceTurret(i, j) { return map[i][j] === 0; }
[ "canMove(tile) {\r\n if (abs(tile.mapX - this.mapX) <= this.info.movement &&\r\n abs(tile.mapY - this.mapY) <= this.info.movement) {\r\n if (tile.unit) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n return false;\r\n }", "function checkShipPlacement() {\n if (isHorizo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Hide Geo Location Tooltip
function hideGeoLocationTooltip() { self.locationTooltip .removeClass("active") .hide(); }
[ "function verticesTooltipHide() {\n vis.verticesTooltip.style(\"opacity\", 0);\n }", "function hideLabel() { \n marker.set(\"labelVisible\", false); \n }", "function hideGeoportalView() {\n var gppanel= viewer.getVariable('gppanel');\n gppanel.style.visibility= 'hidden';\n gppanel.st...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Render method contains header button such as adding a user and search (passed in as a property) Contains a add user modal and form
render() { return ( <section className="ui center aligned basic segment"> {/*Buttons for user*/} {/*Add user button*/} <AddUserModal button={<Button circular color='blue' icon='add user'/>} form={<AddUserForm addUserList={this.props.addUserList.bind(this)} />} ...
[ "addHeader() {\n let\n xPos = 0,\n yPos = 0\n\n this.formHeader = new Element(this.scene, {hasOutline: false}),\n this.formHeader.width = this.width\n this.formHeader.height = this.form.submitButton.height + this.styles.padding.top + this.styles.padding.bottom\n this.formHeader.setPosition(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns URLs to thumbnail sized and full sized image files
function getURLs(imageFile) { var full = path.join('images', querystring.escape(imageFile)); var thumb = path.join('thumbnails', querystring.escape(imageFile)); return { thumbnail: thumb, fullsize: full }; }
[ "function getBigThumbUrl(galleryId, fileName) {\n return `${getBaseUrl(cdn.getBasePrefix(true))}/bigtn/${galleryId}/${fileName}.jpg`;\n}", "function GoogleThumbSetSizes(level, startI, tn, data, kind ) {\r\n var sizes=['xs','sm','me','la','xl'];\r\n \r\n for(var i=0; i<sizes.length; i++ ) {\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Args: two strings of words + spaces Return: an integer score TODO: refactor so it returns an object that is array of orphans, array of found words, and integer number of original words
function oneWayScore(list1, list2) { let tempString1 = list1.toString(), tempString2 = list2; if (tempString1 === tempString2) return 1; // local copy const oneWay = {}; oneWay.wordsI = makeLocal(list1); oneWay.wordsJ = makeLocal(list2); oneWay.orphans = []; oneWay.founds = []; for (...
[ "function scorePhrases(phrases, freqWords){\n var phraseScores = []\n \n for(var i=0; i < phrases.length; i++){\n var score = 0;\n for(w in freqWords){\n if(phrases[i].indexOf(freqWords[w][0]) != -1){\n // count up how many times it appears;\n var coun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
IMPORTANT: this action overwrites the standard popover evenhandler function for showing or hiding the informative popovers ELEMENT elem, the html element to be toggled returns, VOID
function togglePopOver(elem) { id = $(elem).data('bs.popover').tip.id popover = $("#" + id) if (popover.hasClass('hidden')) { popover.removeClass('hidden') } else { popover.addClass('hidden') } }
[ "function popOverDisplay() {\n\t$('.rnav').hide();\n\tpform = $('.popover-form').first();\n\tif (pform.length == 0) {\n\t\tpform = $('form').first();\n\t}\n\t$('[type=\"submit\"]', pform).hide();\n\t$('<input>').attr({\n\t\ttype: 'hidden',\n\t\tname: 'fw_popover_process'\n\t}).val(parent.$('#popover-frame').data('p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the base markup for the calendar
function renderBase() { const markupHeaderPrevious = `<a class="${settings.classMonthPrevious}" href="#" title="Previous month" role="button">&lsaquo;</a>`; const markupHeaderNext = `<a class="${settings.classMonthNext}" href="#" title="Next month" role="button">&rsaquo;</a>`; const markupHeader = `<header>...
[ "render() {\n\t\t\tthis.containerElement.fullCalendar(\"removeEvents\");\n\t\t\tthis.containerElement.fullCalendar(\"addEventSource\", [].concat(this.state.schedule));\n\n\t\t\tthis.setDateItemColor();\n\t\t}", "_overlayTemplate() {\n // TODO: add performance optimization to only render the calendar if needed\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Enable or disable visual mode.
function setVisual(enabled) { _visual = enabled; }
[ "function activateDrawMode() {\n \"use strict\";\n inDrawMode = true;\n inEraseMode = !inDrawMode;\n console.log(\"activated DrawMode\");\n}", "function showHideTLeditPanel(){\n if(trafficLightControl.isActive){ // close panel\n trafficLightControl.isActive=false; //don't redraw editor panel\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Recolecta los parametros base para cualquiera de las opciones: str: frase introducida del1: un delimitador pos1: posicion del delimitador en la frase
function param1() { do { str = prompt("Introduzca una frase con 2 delimitadores: "); } while (!str); do { del1 = prompt("Introduzca un delimitador: "); } while (!del1); pos1 = str.indexOf(del1)!=-1?str.indexOf(del1)+del1.length+1:-1; }
[ "function Phrase(options) {\r\n\r\n\tthis.lire = function () {\r\n\t\treturn this.corps;\r\n\t};\r\n\r\n\tthis.__assembler = function (texte) {\r\n\t\tvar resultat = texte.join(\" \");\r\n\t\tvar point = probaSwitch(Grimoire.recupererListe(\"PF\"), this.PROBA_POINT_FINAL);\r\n\t\tresultat = resultat.replace(/ \\,/g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Pivot positions also indicate columns of bound variables. Solve homogeneous system for nontrivial solutions (a.k.a find nontrivial null space/kernel of operator)
function solveHomogeneous() { // No free variables - so we've got only trivial solution if(boundVariables.length == n) return null; // Get basis vectors corresponding to free variables var basis = []; for(var x = 0, i = 0; x < n; x++) { // Since boundVari...
[ "function solveNormalizedSystem(coeffMatrix, n) {\n var intermVector = [], solVector = [], max, pivot, i, j, k;\n\n /* The Doolittle Decomposition Algorithm. With it, we transform the\n * system A * x = b to L * U * x = P * b, given the lower diagonal L,\n * the upper diagonal U, and t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
filter the response by age groups
function filterByAgeGroup(response) { response['centers'] = response['centers'].filter(center => { for (let sessionIndex = 0; sessionIndex < center['sessions'].length; sessionIndex++) { if (center['sessions'][sessionIndex].min_age_limit == document.querySelector('#age').value) ...
[ "function filterDataByRangeAge(minAge, maxAge) {\n emptyUITable();\n let result = originalData.filter(animal => animal.age >= minAge && animal.age <= maxAge);\n displayArray(result);\n }", "function filterAge(minAge, maxAge) {\n return _.filter(users, function (user) {\n return _...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set timer to turn off training menu (delayed turn off)
function hideTrainingMenu() { trainingTimeoutId = window.setTimeout("turnOffMenu('" + trainingMenu + "')", 60 * 3); }
[ "function hideTutorialsMenu()\n{\n\ttutorialsTimeoutId = window.setTimeout(\"turnOffMenu('\" + tutorialsMenu + \"')\", 60 * 3);\n}", "nowLoggedOff() { this.pauseTimer(); this.loggedOff = true; if (this.isSearchUI()) MySearchUI.nowLoggedOff(); }", "function hideResourcesMenu()\n{\n\tresourcesTimeoutId = window.s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate a beautiful loopable palette with random start color. Subsequent colors will be generated by adding golden ratio to hue value, which creates nices contrasts.
_generatePaletteRandom( palette, firstHue ) { let colorHsv = { h : firstHue, s : this._options.palette.saturation, v : this._options.palette.brightness, a : 1 // alpha }; const bgToFgFunction = z42easing[ this._options.palette.easeFunctionBgToFg ]; const fgToBgFunction = z42easing[ t...
[ "function startColor () {\n\t\treturn {\n\t\t\tr: 255,\n\t\t\tg: 255 * Math.random(),\n\t\t\tb: 75\n\t\t};\n\t}", "function randomColorGenerator() {\n\t\treturn Math.floor(Math.random() * backgroundColors.length);\n}", "function color() {\n let hue = Math.round(Math.random()*360);\n let matches = this.sty...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if a path is exactly equal to another.
equals(path, another) { return path.length === another.length && path.every((n, i) => n === another[i]); }
[ "equals(path, another) {\n return path.length === another.length && path.every((n, i) => n === another[i]);\n }", "function approximatelyEqual(path1, path2) {\n // convert to numbers and letters\n const path1Items = pathToItems(path1);\n const path2Items = pathToItems(path2);\n const epsilon = 0.001;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given the number of items per page and the HTML container selector, initializes all the required components and events.
constructor(itemsPerPage, parentSelector) { this.itemsPerPage = itemsPerPage; this.currPage = 0; let parentContainer = document.querySelector(parentSelector); this.components = { grid: parentContainer.querySelector('.coll-grid'), paginationContainer: parentContainer.querySelector('.coll-pagination'...
[ "function preparePage() {\n links = [];\n\n $(\".js-scroll-indicator\").each(function(index, link) {\n prepareIndicator( $(link) );\n });\n }", "initAddons() {\n this.createFilterList();\n this.domUtil.createSortingOptions(e => this.sortingChangeListener(e));\n this.domUtil.createPaginatio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
It creates a "delete" event listener on the view document to handle cases when the Delete or Backspace is pressed and the fake caret is currently active. The fake caret should create an illusion of a real browser caret so that when it appears before or after a widget, pressing Delete or Backspace should remove a widget...
_enableDeleteIntegration() { const editor = this.editor; const editingView = editor.editing.view; const model = editor.model; const schema = model.schema; this._listenToIfEnabled( editingView.document, 'delete', ( evt, domEventData ) => { // This event could be triggered from inside the widget but we are ...
[ "function delete_function() {\r\n\tvar delete_end_char = textarea_element.selectionEnd;\r\n\tif (delete_end_char < textarea_element.value.length && delete_end_char == textarea_element.selectionStart) {\r\n\t\tdelete_end_char++;\r\n\t}\r\n\ttextarea_element.setRangeText(\"\", textarea_element.selectionStart, delete_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Do a expect that verify toast name
function expectToastToEqual( toastMessage ){ var locator = by.css('.md-toast-text'); var timeout = 3000; var EC = protractor.ExpectedConditions; browser.ignoreSynchronization = true; browser.wait(EC.visibilityOf(element( locator )), timeout).then(function () { expect(element( locator ).getText()).toEqual...
[ "function checkName(name) {\n it('Name is defined: ' + name, function() {\n expect(name).toBeDefined();\n expect(name.length).not.toBe(0);\n });\n it('Name is a string', function() {\n expect(name).toEqual(jasmine.any(String));\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
deleteTableRow This function deletes a given item from the database. It is called whenever the user presses onerror of the delete buttons in the data tables. It sends a DELETE request to the server to delete a particular item from a particular table. Arguments: id: the ID of the element that is being deleted tablID: th...
function deleteTableRow(id, tableID) { //Create a new HTTP request var req = new XMLHttpRequest(); //Contruct a URL that sends a GET request to /delete with the id and tableID value var url = "http://flip2.engr.oregonstate.edu:" + port + "/delete-" + tableID + "?id=" + id; //Make the call req.open...
[ "'comparison.deleteRow' (rowId) {\n check(rowId, String);\n\n Row.remove(rowId);\n }", "function DeleteJDTRow(id, event, TableId, Jsonurl) {\n if (confirm(\"Are you sure you want to delete this record...?\")) {\n //var row = $(this).closest(\"tr\");\n oTable = $('#' + TableId).Da...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Toggles on/off the information panel of a supergroup, group or indicator.
toggleInfo(code) { this.dictionary.indicators[code].isInformationPanelVisible = !this.dictionary.indicators[code].isInformationPanelVisible; // TODO: RESIN - This code is needed if we need to show a tooltip over the help button. // let l = (this.currentTab === 'supergroups' ? 'sg' : (this.cur...
[ "function toggleDetailModule() {\n\td3.select(\"button#panel-close\").on(\"click\", function() {\n\t\td3.selectAll(\"circle\").classed(\"active\", false);\n\t\t\n\t\tcleanDetail();\n\t\tclosePanelDetail();\n\t})\n}", "function toggle_info() {\n toggle_button = document.getElementById(\"dialogue_toggle\");\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Opens a dialog from a template.
openFromTemplate(template, config) { config = this._applyConfigDefaults(config); if (config.id && this.getById(config.id) && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw Error(`Dialog with id "${config.id}" exists already. The dialog id must be unique.`); } const ...
[ "function open_answers(page_template) {\n\t\tanswer_window = window.open(page_template, \"Antworten\", \"width=800,height=600,scrollbars=yes\");\n\t\tanswer_window.focus();\n\t}", "openLinkDialog () {\n if (!this.view) {\n this.initDialog();\n }\n\n this.view.open();\n }", "fu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO sequence should allow `return promisable` as well as `this.fulfill` TODO sequence should accept function or promise A model might be something such as Contacts The providers might be methods such as: all(), one(id), some(ids), search(key, params), search(func), scrape(template)
function modelify(key) { return function () { var args = Array.prototype.slice.call(arguments), result = providers[key].apply(context || providers[key], args), sequence = Futures.sequence(); if ('function' !== typeof(result.when)) { throw new Futures.exception('"chainify"...
[ "buildResource(name, model) {\r\n console.log(`buildResource: \"${name}\"`);\r\n\r\n // find\r\n this.router.get('/' + name, (req, res, next) => {\r\n try {\r\n model.find(req.body, (err, docs) => {\r\n if (err) {\r\n res.json(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }