query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Takes ids from hidden field and clone li's
function cloneSelectedImages(site_img_div, attached_img_div) { var hidden_ids = jQuery(attached_img_div).prev().prev(), ids_array = (hidden_ids.val().length > 0) ? hidden_ids.val().split(",") : new Array(), img_ul = attached_img_div.find('.gallery_widget_attached_images_list'); img_ul.html('');...
[ "function refresh_ul_list_from_hidden(dom) {\n\n var fields = get_fields(dom);\n var names = $(fields.name_list).val().split(', ');\n var codes = $(fields.code_list).val().split(', ');\n\n $.each(names, function (i, name) {\n if (name !== '') {\n var code = codes[i];\n $(fie...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate an anchor url for the given reflection and all of its children.
static applyAnchorUrl(reflection, container) { if (!reflection.url || !DefaultTheme.URL_PREFIX.test(reflection.url)) { const anchor = DefaultTheme.getUrl(reflection, container, "."); reflection.url = container.url + "#" + anchor; reflection.anchor = anchor; reflec...
[ "static applyAnchorUrl(reflection, container) {\n if (!(reflection instanceof models_1.DeclarationReflection) && !(reflection instanceof models_1.SignatureReflection)) {\n return;\n }\n if (!reflection.url || !DefaultTheme.URL_PREFIX.test(reflection.url)) {\n const anchor ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parser tests are automatically generated from Processing files to call this.
function _checkParser() { eval(Processing(canvas, parserTest.body)); _pass(); }
[ "function _Parser() {\n\t}", "function Parser() {}", "beforeParse() {}", "function Parser() {\n}", "beforeStep () {\n this.firstPass()\n this.parser = new Parser(this.assemblyCode)\n return this.parser\n }", "_parseEntities() {\n this._parseAllTestFiles();\n this._parseFixtures();\n thi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
requestFunds function allows user to request funds from another user
function requestFunds() { console.log("\nREQUEST FUNDS"); console.log("-----------------------------"); console.log(user.name + ", (ID: " + user.id + ")"); console.log("Current balance: " + Math.floor(user.balance* 100) / 100); console.log("-----------------------------"); const requestTarget =...
[ "function fundRequests() {\n if (user.fundRequests.length === 0) {\n console.log(\"No-one has sent fund request to you, returning to menu.\");\n } else {\n console.log(\"\\nFUND REQUESTS\");\n console.log(\"-----------------------------\");\n console.log(user.name + \", (ID: \" + u...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function that copies resource files to choosen platform
function filesToCopy(obj, platform) { var srcFile, destFile, destDir; Object.keys(obj).forEach(function(key) { var filename = path.basename(obj[key]); srcFile = path.join(pluginRootDir, obj[key]); destFile = path.join(rootdir, platformIosPath, filename); con...
[ "function copyResources(platformName) {\r\n var resourcesFolder = __dirname + \"../../../\" + grunt.config.get('apps.resources');\r\n var appFolder = __dirname + \"../../../\" + grunt.config.get('apps.output.appsdir') + '/platforms/' + platformName;\r\n if (platformName === \"android\") {\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Attaches the RightPanel to a Right Panel.
attach() { if (!this.panel) { this.panel = atom.workspace.addRightPanel({item: this, visible: false, priority: -1000}); } }
[ "setRightPanel(panel)\n {\n this.addSubPanel(panel);\n this.rightPanel = panel;\n // TODO: Resize the panel!\n // TODO: Check that the right panel did not set before!\n }", "addToRightArea(widget, options) {\n if (!widget.id) {\n console.error('Widgets added to ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
============================== 38. Write a JavaScript function to check if a number is a whole number or has a decimal place. Note : Whole Numbers are simply the numbers 0, 1, 2, 3, 4, 5, ... (and so on). No Fractions! Test Data : console.log(number_test(25.66)); "Number has a decimal place." console.log(number_test(10...
function isWholeOrDecimal(num){ if (parseInt(num) === num){ return "whole num"; }else { return "decimal num"; } }
[ "function number_test(n)\r\n{\r\n var result = (n - Math.floor(n)) !== 0;\r\n\r\n if (result)\r\n return 'Number has a decimal place.';\r\n else\r\n return 'It is a whole number.';\r\n }", "function testWholeNumber(number) {\n let result = (number - Math.floor(number)) !== 0;\n result ? console...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a boolean telling if a macro exists
static hasMacro(name) { return !!this.getMacro(name); }
[ "has(e) {\n\t\t\te = insensitiveName(e);\n\t\t\treturn macroRegistry.hasOwnProperty(e);\n\t\t}", "function isDefinition(token) {\n return token == HABILIS.FUNCTIONS['define'];\n}", "function isMacroFile(fileName) {\r\n return /\\.iim$/i.test(fileName);\r\n}", "function functionExists( name ) {\n\treturn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display all text objects in a table
function printListTextobjects(textobjects) { logger(1, 'DEBUG: printing text objects list'); var text , body = '<div class="table-responsive">' + '<table class="table">' + '<thead>' + '<tr>' + '<th>' + MESSAGES[92] + '</th>' + '<th>' + MESSAGES...
[ "function printListTextobjects(textobjects) {\n logger(1, 'DEBUG: printing text objects list');\n var text,\n body =\n '<div class=\"table-responsive\">' +\n '<table class=\"table\">' +\n '<thead>' +\n '<tr>' +\n '<th>' +\n MESSAGES[92] +\n '</th>' +\n '<th>' +\n ME...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sort Section and Cache it...
doSortSection() { this.sortedSections = []; for (let [sectionId, sectionObject] of Object.entries(this.formData.sections)) { this.sortedSections.push(sectionObject) } this.sortedSections.sort((a, b) => { return a.sortOrder - b.sortOrder; ...
[ "function arrayDataInOrder() {\n sectionList.sort(relativeSectionOrder)\n\n console.log(sectionList)\n }", "function sortBySection(obj){\n const ordered = Object.keys(obj).sort().reduce(\n (object, key) => { \n object[key] = obj[key]; \n return object;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
var id_1=["inp_020","inp_030","inp_040","inp_050","inp_060","inp_070","inp_080","inp_090","inp_100","inp_110","inp_120","inp_130","inp_140","inp_150","inp_160","inp_170","inp_180","inp_190","inp_200"]; var var_1=["unit/dHdGlobal.gsHMIdata.sStep[2].eCmd","unit/dHdGlobal.gsHMIdata.sStep[3].eCmd","unit/dHdGlobal.gsHMIdata...
function Read(id) { if(id == "inp_014") { for(var i = 0; i < id_RealPosition.length; i++) { var tmpValue = document.getElementById(id_RealPosition[i]).value; //console.log(tmpValue); writeValueFN(tmpValue, var_014[i]); } ReadValue(id_014, var_014); } else if(id == "inp_024") { for(var i = 0;...
[ "function Read(id)\n{\n\tif(id == \"inp_014\")\n\t{$(\"#inp_011\").val($(\"#inp_X_Postion\").val());\n $(\"#inp_012\").val($(\"#inp_Y1_Postion\").val());\n $(\"#inp_013\").val($(\"#inp_Z1_Postion\").val());\n $(\"#y2_01\").val($(\"#inp_Y2_Postion\").val());\n $(\"#z2_01\").val($(\"#inp_Z2_Postion\").val...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clone and add prefixes for atrule
add(rule, prefix) { let prefixed = prefix + rule.name let already = rule.parent.some( i => i.name === prefixed && i.params === rule.params ) if (already) { return undefined } let cloned = this.clone(rule, { name: prefixed }) return rule.parent.insertBefore(rule, cloned) }
[ "add(rule, prefix) {\n let prefixeds = this.prefixeds(rule)\n\n if (this.already(rule, prefixeds, prefix)) {\n return\n }\n\n let cloned = this.clone(rule, { selector: prefixeds[this.name][prefix] })\n rule.parent.insertBefore(rule, cloned)\n }", "rewrite(turtle){\n var localPrefixMap ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Receives a callback that accepts (node, parent graph) and returns a value. This function is invoked recursively per scope (including scope nodes), unless the return value is false, upon which the subscope will not be visited. The function also accepts an optional postsubscope callback (same signature as `func`).
function traverse_sdfg_scopes(sdfg, func, post_subscope_func=null) { function scopes_recursive(graph, nodes, processed_nodes=null) { if (processed_nodes === null) processed_nodes = new Set(); for (let nodeid of nodes) { let node = graph.node(nodeid); if (node !==...
[ "function parentFunc() {\n var parentVar = 1;\n function childFunc () { // the inner function is a closure function\n var childVar = 2;\n return parentVar + childVar; // nested childFunc can access parent's variables\n }\n}", "function parentFunc(money){\n \n var parentsMoney = money\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checks that date and time supplied had not past returns true if the date is valid the date and time are in the future and false if the date and time are in the past //in order to allow to put in todays date as well added the time of the end of the day to the date supplied (if time was not supplied)
function checkDate(date, time) { let inputDate = new Date(date); if (time) { let hours = time.slice(0, 2); let minutes = time.slice(3, 5); inputDate.setHours(hours); inputDate.setMinutes(minutes); inputDate.setSeconds(99); } else { inputDate.setH...
[ "function isAppointmentInTheFuture(date, time){\n date.setHours(Number(time.split(\"-\")[1].split(\":\")[0]));\n date.setMinutes(Number(time.split(\"-\")[1].split(\":\")[1]));\n return new Date() < date;\n}", "function checkFutureTime(inTime){\n\tcheckTime(inTime);\n\tvar today = new Date();\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set all members to a zero(0) score. Returns a list off all members nulled. To remove all members, see empty.
function zero() { return client .zrevrangeAsync([board, 0, -1]) .then(function(list) { var multi = client.multi(); // When we have a list of all members set their scores // to zero(0) and return the list of members // list.forEach(fun...
[ "function SetNullScoresToZero(){\n for(let key in Scores){\n let score = GetScoreByName(key);\n if(score === null || score === undefined){\n SetScoreByName(key, 0);\n }\n }\n}", "function clearAbilityScores() {\n for (item of abilitiesArray) {\n item.score = 0;\n item....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to handle audio end event
function sound_ended() { if (context !== null) { sound_end_time = context.currentTime * 1000; } else { sound_end_time = Date.now(); } if (trial.ignore_responses_during_audio) { $(':button').prop('disabled',false); } if (trial.trial_ends_after_audio) { ...
[ "on_audio_end(evt){\n\n\t}", "onAudioEnd() {\n if (this.loop) {\n this.play();\n }\n else {\n this._listenerPool.invoke('onTrackEnd', { track: this });\n }\n }", "function handleEndAudio(mediaElement) {\r\n\t\t_playsStatus = \"notp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates and returns adapteraware SMART api. Not that while the shape of the returned object is well known, the arguments to this function are not. Those who override this method are free to require any environmentspecific arguments. For example in node we will need a request, a response and optionally a storage or stor...
getSmartApi() { return { ready: (...args) => (0, smart_1.ready)(this, ...args), authorize: options => (0, smart_1.authorize)(this, options), init: options => (0, smart_1.init)(this, options), client: state => new Client_1.default(this, state), options: this.options, utils: { ...
[ "getSmartApi() {\n return {\n ready: (...args) => smart_1.ready(this, ...args),\n authorize: options => smart_1.authorize(this, options),\n init: options => smart_1.init(this, options),\n client: state => new Client_1.default(this, state),\n options: this.options\n };\n }", "genera...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parse a l0r0 (That's how Menus align to their owning MenuItem) slign spec.
function parseAlign(alignSpec) { const parts = alignSpecRe.exec(alignSpec), myOffset = parseInt(parts[2] || 50), targetOffset = parseInt(parts[4] || 50); // Comments assume the Menu's alignSpec of l0-r0 is used. return { myAlignmentPoint: parts[1] + myOffset, // l0 myEdge: parts[1], // l myOf...
[ "function parseAlign(alignSpec) {\n const parts = alignSpecRe.exec(alignSpec),\n myOffset = parseInt(parts[2] || 50),\n targetOffset = parseInt(parts[4] || 50); // Comments assume the Menu's alignSpec of l0-r0 is used.\n\n return {\n myAlignmentPoint: parts[1] + myOffset,\n // l0\n myEdge: ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
f() : TOGGLELEFTMENU Animate the toggle apparition of the left menu
function toggleLeftMenu() { // Get ID of the left menu // --------------------------------------------------------------------------- var menu_Left = document.getElementById("leftMenu"); // Show / hide the left menu // --------------------------------------------------------------------------- if (menu_Lef...
[ "function toggleLeftMenu() {\n $mdSidenav('left').toggle();\n }", "function menuStuff() {\n if (toggle === 1) {\n menu.css('display', 'table');\n setTimeout(function() {\n // menu.css('opacity', 1);\n menu.stop().animate({opacity: 1}, 200);\n // menuLi.css('le...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
console.log(count(null, 1), 0) console.log(count(node1, 9), 1) console.log(count(node2, 17), 0) console.log(count(node2, 2), 2) / Find average of a list of integers
function average(node){ if(!node) return 0; let length = 0; let sum = 0; function helper(node):void{ if(!node) return; sum += node.value; length++; return helper(node.next); } return sum / length; }
[ "function aggregate_counts(node) {\n}", "average() {\n const length = this.length();\n let sum = 0;\n // this.traverse(function (node) {\n // sum += node.value;\n // });\n this.traverse(node => sum += node.value);\n\n return this.isEmpty() ? null : sum / length;\n }", "function sumNodeV...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Configures conversion pipelines to support upcasting and downcasting image captions.
_setupConversion() { const editor = this.editor; const view = editor.editing.view; const imageUtils = editor.plugins.get( 'ImageUtils' ); const t = editor.t; // View -> model converter for the data pipeline. editor.conversion.for( 'upcast' ).elementToElement( { view: element => matchImageCaptionViewElem...
[ "_setupConversion() {\n\t\tconst editor = this.editor;\n\t\tconst conversion = editor.conversion;\n\t\tconst imageUtils = editor.plugins.get( 'ImageUtils' );\n\n\t\tconversion.for( 'upcast' ).add( upcastPicture( imageUtils ) );\n\t\tconversion.for( 'downcast' ).add( downcastSourcesAttribute( imageUtils ) );\n\t}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
vResult = ConvertFontFormat(vFont, nInType, nRetType); Arguments: vFont pointer to LOGFONTW structure, handle to font, or array [sFontName, nFontStyle, nFontSize] nInType vFont type, nRetType vResult type: 1 pointer to LOGFONTW structure 2 handle to font 3 array [sFontName, nFontStyle, nFontSize]
function ConvertFontFormat(vFont, nInType, nRetType) { var nLFSize = 28 + 32 * 2; //sizeof(LOGFONTW) var lpLF = AkelPad.MemAlloc(nLFSize); var hFont; var hDC; var nHeight; var nWeight; var bItalic; var vRetVal; var i; if (nInType == 1) { for (i = 0; i < nLFSize; ++i) AkelPad.MemCopy(...
[ "function ConvertFontFormat(vFont, nInType, nRetType)\n{\n var nLFSize = 28 + 32 * 2; //sizeof(LOGFONTW)\n var lpLF = AkelPad.MemAlloc(nLFSize);\n var hFont;\n var hDC;\n var nHeight;\n var nWeight;\n var bItalic;\n var vRetVal;\n var i;\n\n if (nInType == 1)\n {\n for (i = 0; i < nLFSize; ++i)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
run fungsi imgInfo fungsi untuk validasi + meneruskan submit ke fungsi selanjutnya
function imgInfo(){ var jumImg = $('.imgTR:visible','#imgTB').length; //hitung jumlah gambar bkeg bukeg dalam form if(jumImg==0){// ksong $('#imgInfo').fadeIn(function(){ $('#imgInfo').html('minimal unggah 1 bukti kegiatan(scan/gambar)'); //notif eror =>harus browse gambar }); //efek un...
[ "async checkImageUpload () {\n I.waitForElement(this.form.frmPinBuilderDraft);\n const responseCode = await I.grabNumberOfVisibleElements(this.form.frmPinImage);\n if (responseCode < '1') {\n I.say('Image retrieved from coolImages library not found');\n I.click(this.button...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
2 Write a function `everyThird` that takes an array as an argument and returns a new array that contains every third element of the original array. everyThird(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']); returns ['c','f','i'] everyThird([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]) returns [ 3, 6, 9, 12 ]
function everyThird(array){ newArray= [] for (var i = 2; i<array.length ; i+=3){ newArray.push(array[i]) } return newArray }
[ "function everyThird (arr) {\n var newArr = []\n for (var i = 2; i < arr.length; i+= 3) {\n newArr.push(arr[i]) \n }\n return newArr\n}", "function everyThirdItem(arr) {\n let newArr = [];\n for (let i = 0; i < arr.length; i += 3) {\n newArr.push(arr[i]);\n }\n return newArr;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
delete all posts from cloud storage for postId NOTE: ALTERNATE METHOD TO RETURN PROMISE DONGT USE FOR NOPW No way to get post in there but not ne
function destroyAllPostPhotosFromGCS(uid, postId) { // You do not have to use Promise constructor here, just return async function // return new Promise((resolve, reject) => { return (async (resolve, reject) => { const bucket = admin.storage().bucket(); let folderRef = `/users/${uid}/posts/$...
[ "async delete() {\n // Removing feeds and getting all posts, we'll be assigning all the Posts we get back to posts\n let [, posts] = await Promise.all([removeFeed(this.id), getPosts(0, 0)]);\n\n // Filter out all posts which do not contain feed id of feed being removed\n posts = await Promise.all(posts....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a message and returns a promise which resolves to an Array of a new MessageBO Object.
createMessage(is_singlechat, thread_id, person, content) { return this.#fetchAdvanced(this.#createMessageURL(is_singlechat, thread_id, person, content), { method: 'POST', }).then((responseJSON) => { let responseMessageBO = MessageBO.fromJSON(responseJSON); return new Promise(function (resolve)...
[ "function createMessage(message) {\n\n\n var deferred = q.defer();\n\n MessageModel.create(message, function (err, dbMessage) {\n\n if(err){\n logger.error('Unable to create message.' + err);\n deferred.reject(err);\n } else {\n deferr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Start Display Functions Restyles the page
function restylePage() { logoToTrans(); allStyles(); }
[ "function displayToScreen() {\n\n\n\t}", "updateDisplay() {\n \n }", "display() {\n let currentTheme = this.gameOrchestrator.getCurrentTheme();\n currentTheme.displayScene();\n this.displayGameboard(currentTheme);\n }", "display() {\n this.gameOrchestrator.scene.getCur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new EventHubSender instance.
constructor(context, partitionId) { super(context, { name: context.config.getSenderAddress(partitionId), partitionId: partitionId }); /** * The unique lock name per connection that is used to acquire the * lock for establishing a sender link by an entity...
[ "static create(context, partitionId) {\n const ehSender = new EventHubSender(context, partitionId);\n if (!context.senders[ehSender.name]) {\n context.senders[ehSender.name] = ehSender;\n }\n return context.senders[ehSender.name];\n }", "function EventHubSender(amqpSender...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
leaderboard fetch function based on tour id
function loadLeaderboard(a) { setfetching("fetching"); fetch(`https://jason-11.herokuapp.com/pga-leaderboard?tourId=${a}`, { headers: { Accept: "application/json", "Content-Type": "application/json", "Access-Control-Allow-Origin": "", }, method: "get", mode: "cors...
[ "fetchInfo(id) {\n\t\tclient.db.query('SELECT id, title, msg, winners, guild_id, channel_id, message_id, winner_amount, ending FROM discord.lola_giveaway_info WHERE id = ?;', [id], function (err, res) {\n\t\t\tif(err) return console.log(err);\n\n\t\t\tfor (let i = 0; i < res.length; i++) {\n\t\t\t\tconst server = a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if the nav element has the class "opennav" or if the window is at a width of greater than 768px. If either condition applies, the nav links are placed in the tab index. If not, the links are removed from the tab order.
function setNavTabIndex() { const $navList = $(".nav-list").find("a"); if ($("nav").hasClass("open-nav") || window.innerWidth > 768) { $navList.attr("tabindex", "0"); } else { removeNav(); $navList.attr("tabindex", "-1"); } }
[ "function checkNav() {\n\t\tif(docWidth >= breakPoint) {\n\t\t\tnavControl.hide();\n\n\t\t\t//if nav is hidden, open it\n\t\t\tif(!nav.hasClass(\"open\")) {\n\t\t\t\tnav.find(\"ul\").first().css(\"display\", \"block\");\n\t\t\t\tnav.addClass(\"open\");\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tnavControl.show();\n\n\t\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
creates the icicles in the room. parameters (x,y,z,radius,height,segments, rotation) icicles are in order from left to right.
function initIcicles(){ // outer ring bottom createIcicle(0, 9, 90, 2, 18, 0); createIcicle(-24, 5, 72, 2, 10, 0); createIcicle(-25, 13, 70, 2, 26, 0); createIcicle(-27, 8, 68.5, 2, 16, 0); createIcicle(-63, 15, 55, 3, 30, 0); createIcicle(-70, 9, 35, 2, 18, 0); createIcicle(-80,...
[ "function pipeCircle(pos, width, w, h, beg, rot, itner,r,l){\r\n\tvar lines = new Array();\r\n\tfor(p=0;p<=itner;p++){\r\n\t\t\tlines = connectShapes(lines,pipe(\r\n\t\t\t[pos[0]+w*Math.cos(beg+rot/itner*p),pos[1]+h*Math.sin(beg+rot/itner*p),pos[2]],\r\n\t\t\t[pos[0]+w*Math.cos(beg+rot/itner*(p+1)),pos[1]+h*Math.si...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function tries to find the best matching locale. Locales should be given in the form "lang[COUNTRY]". If an exact match (i.e. both lang and country match) can be found, it is returned. Otherwise, a partial match based on the lang part is attempted. Partial matches without country are preferred over lang matches wi...
function getBestLocaleMatch(aPreferred, aAvailable) { aPreferred = aPreferred.toLowerCase(); var preferredLang = aPreferred.split("-")[0]; var langMatch = null; var partialMatch = null; for (var i = 0, current; current = aAvailable[i]; i++) { // Both lang and country match if (current.toLowerCase() ...
[ "matchLocale(req) {\n const hostname = req.hostname;\n const locales = self.filterPrivateLocales(req, self.locales);\n let best = false;\n for (const [ name, options ] of Object.entries(locales)) {\n const matchedHostname = options.hostname\n ? (hostname === options.h...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Funcion para mostrar los eventos del dia seleccionado
function showEvent(day,month,year){ dia_ult = day; mes_ult = month; ano_ult = year; showListCalen(4,day,month,year); }
[ "function date_click(event) {\n $(\".events-container\").show(250);\n $(\"#dialog\").hide(250);\n $(\".active-date\").removeClass(\"active-date\");\n $(this).addClass(\"active-date\");\n show_events(event.data.events, event.data.month, event.data.day);\n }", "showEvents() {\n this.showEventTime...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create single row of the go link table, with the given key and url. Args: key go shortcut url target of go shortcut.
function generateMapTableRow(key, url) { var line = $("<tr key='"+key+"'>"); line.append("<td>"+key+"</td>"); line.append("<td><a href='"+url+"'>"+url+"</a></td>"); var delete_btn = $("<button type='button'"+ " class='btn btn-xs btn-danger'>"+ "<span class='glyphicon glyphicon-remove'></span>"+ "</...
[ "function addLinksTableRow(table, key, value, index) {\n\tvar tr = document.createElement('tr');\n\n\tvar keyTd = document.createElement('td');\n\tkeyTd.appendChild(document.createTextNode(key));\n\ttr.appendChild(keyTd);\n\n\tvar valueTd = document.createElement('td');\n\tvalueTd.appendChild(document.createTextNod...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Cookie structure description1+price1+image1&description2+price2+image2&... The "&" simbol separe products and the "+" sign separe info.
function setCookie(description, price, image) { var cookie = description + "+" + price + "+" + image; var previousCookie = getCookie(); if (previousCookie == "") { // If cookie is empty just add the info. document.cookie = "products" + "=" + cookie + ";path=/"; } else { // I...
[ "function ppcUrlCookiePart1() {\r\n //setup list/array of parameters desired. names on right should match querystring names\r\n var param_names = new Array(\r\n 'ppcSource;utm_source',\r\n 'ppcMedium;utm_medium',\r\n 'ppcCampaign;utm_campaign',\r\n 'ppcKeyword;utm_term',\r\n );\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets connection from the connection manager. If connection name wasn't specified, then "default" connection will be retrieved.
function getConnection(connectionName) { if (connectionName === void 0) { connectionName = "default"; } return getConnectionManager().get(connectionName); }
[ "function getConnection(connectionName) {\n if (connectionName === void 0) { connectionName = \"default\"; }\n return getConnectionManager().get(connectionName);\n }", "get(name = \"default\") {\n const connection = this.connections.find(connection => connection.name === name);\n if...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns deadline of Project object
getDeadline() { return this.deadline; }
[ "get deadline(){\n\t\treturn this.deadline;\n\t}", "getNextDeadline() {\n return Math.min(this.newLayoutTime, this.newModuleTime);\n }", "function getFormDeadline (formName, term, referenceDate) {\n const formDates = getFormDatesForAllTerms(referenceDate);\n\n formName = formName.toLowerCase();\n t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get index of assignment with given id
function assignmentsGetIdxForId(id) { for (var i=0; i<assignments.length; i++) if (assignments[i].id == id) return i; return -1; }
[ "function assignmentsGetCurrentIdx() {\n\tvar asgnSelect = document.getElementById('assignment_select');\n\tif (asgnSelect.selectedIndex == -1) return -1;\n\tvar currentId = asgnSelect.options[asgnSelect.selectedIndex].value;\n\tfor (var i=0; i<assignments.length; i++)\n\t\tif (assignments[i].id == currentId)\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
drawYlabels is a function called by drawBarChart to draw the Y axis labels for a bar chart. The function takes in three parameters: data: object with four properties: values, labels, scale, and title (as defined for drawBarChart) chartHeight: positive integer representing the height of the chart area (excluding titles,...
function drawYlabels(data, chartHeight, element) { // extracts scale from data var scale = data.scale; // determines the maximum value to be displayed on the Y axis of the chart var maxY = findMaxY(data.values, scale); // creates the label area that the labels are rendered to var labelArea = $("<div>").a...
[ "function drawYAxis(barchart, height) {\n\n barchart.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(d3.axisLeft(y).tickFormat(function(n) { return n + \"%\"}))\n .append(\"text\")\n .attr(\"fill\", \"#000\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", -60)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Apply changes to set with given `setId`.
updateSet(setId, title, description, isDeleted) { const edits = [ title, description, isDeleted, setId ] return this.db.one(` UPDATE study_sets SET title = COALESCE($1, title), description = COALESCE($2, description), is_deleted = COALESCE($3, is_delete...
[ "updateSetReps(reps, id) {\r\n const sets = this.state.sets;\r\n sets[sets.findIndex(set => set.id === id)].reps = reps;\r\n\r\n this.setState({\r\n sets: sets\r\n });\r\n }", "updateSetWeight(weight, id) {\r\n const sets = this.state.sets;\r\n sets[sets.findIndex(set => set.id === id)].we...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Entry point for the script. This script will attempt to iterate over all un processed accounts and check them for any disapproved ads. A Drive folder is created each day in which to store Ads accountspecific spreadsheets containing any information on disapproved ads. The script will process as many accounts as possible...
function main() { var managerAccount = AdsApp.currentAccount(); var centralSpreadsheet = validateAndGetSpreadsheet(CONFIG.CENTRAL_SPREADSHEET_URL); validateEmailAddresses(CONFIG.RECIPIENT_EMAILS); var timeZone = AdsApp.currentAccount().getTimeZone(); var now = new Date(); centralSpreadsheet.setSpreadsheetT...
[ "function main() {\n var missingCount = 0;\n\n // Selector for all active campaigns\n var campaignIterator = AdsApp.campaigns()\n .withCondition(\"Status = ENABLED\")\n .withCondition(\"AdvertisingChannelType = SEARCH\")\n .get();\n\n // Iterate through all active campaigns\n while (campaignIterator.hasNext...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove all actions that are pushed after marked positions (using `setMark()`)
clearFromMark() { if (mark !== null) { stack.splice(mark); mark = null; } }
[ "function undoLastMark() {\r\n\tnewPaddockCoords.pop();\r\n\tmarkersArray.getAt(markersArray.getLength() - 1).setMap(null);\r\n\tmarkersArray.pop();\r\n}", "function clearNextMovesMarkers() {\n mapSquares(square => square.canBeNextMove = false);\n}", "unMarkAll() {\r\n\r\n for ( var i = 0; i < this.marked...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the events with type: empty
updateEmptyEvents() { if (this.isEmpty()) { this.updateEventsContainer('empty'); } }
[ "function clearEvents() {\n\t\tevents = [];\n\t\teventsById = {};\n\t\tduration = undefined;\n\t}", "function clearEvents(plot, type){\n\n\tfor (var i in this.events){\n\t\tvar ev = this.events[i];\n\t\tif (ev.plot == plot && ev.event == type){\n\t\t\tdelete this.events[i];\n\t\t}\n\t}\n\n\tthis.stateChange();\n}...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns HTML string for eBay results
function getEbayHTML(results) { var items = results.searchResult.item; var html = "<tr class='ebayResults'><td colspan='5'><h3>eBay results</h3><table><tbody>"; $(items).each(function(i){ var item = items[i]; var title = item.title; var pic = item.galleryURL; var viewitem = item.viewItemURL; var pr...
[ "function showWebResult(item)\n {\n var p = document.createElement('p');\n var a = document.createElement('a');\n a.href = item.Url;\n $(a).append(item.Title);\n $(p).append(item.Description);\n // Append the anchor tag and paragraph with the description to the results div.\n $('#results').app...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initiate account settings modal
function initAccountSettingsModal() { const template = require('./user-accounts-modal-settings.html'); $uibModal .open({ template, windowTopClass: 'uib-modal', ariaLabelledBy: 'dialog_label', controllerAs: 'modalCtrl', con...
[ "function initSettings() {\n\n\tvar settingsButton = document.getElementById('settings-button');\n\tvar settingsDialog = document.getElementById('settings-dialog');\n\n\tsettingsButton.addEventListener('click', function() {\n\t\topenDialog(settingsDialog, settingsButton);\n\t});\n\n}", "function showSettings(){\r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a group that will contain proxy elements. The group order is automatically updated according to the last group order keys. Returns the added group.
addGroup(groupKey, groupType, attributes) { const existingGroup = this.groups[groupKey]; if (existingGroup) { return existingGroup.groupElement; } const proxyContainer = this.domElementProvider.createElement(groupType); // If we want to add a role to the group, and st...
[ "addProxyElement(groupKey, target, attributes) {\n const group = this.groups[groupKey];\n if (!group) {\n throw new Error('ProxyProvider.addProxyElement: Invalid group key ' + groupKey);\n }\n const proxy = new ProxyElement(this.chart, target, group.type, attributes);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The interface for an adapter is simply a function that takes a [Socket.IO]( socket. When test events `testsstart`, `testresult`, `alltestresults` come in, the adapter is responsible for sending these events to the socket.
function customTestFrameworkAdapter(socket) { // Store all the tests in an array for simplicity of running. var tests = [] var started = false window.test = function test(name, fn){ tests.push([name, fn]) // assume all tests are added synchronously // so after the setTimeout, w...
[ "function qunitAdapter(socket) {\n var currentTest, currentModule;\n\n var id = 1;\n\n var results = {\n failed: 0,\n passed: 0,\n total: 0,\n tests: []\n };\n\n QUnit.log(function(details) {\n var item = {\n passed: details.result,\n message: details.message\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a modal according to the current portfolio item
function addPortfolioModal(element, number) { var modal = $("<div>", { id : 'portfolioModal' + number, class: 'portfolio-modal modal fade', tabindex : "-1", role : "dialog" }).attr( 'aria-hidden', 'true'); var modalContent = $('<div>', { class: 'modal-content'}); var lr = $('<div>', { ...
[ "function portfolioModal(projectID) {\n for (let i=0; i<portfolio.length; i++) {\n if (parseInt(projectID) === parseInt(portfolio[i].projectID)) {\n var project = portfolio[i];\n\n // update project title\n $(\"p.modalTitle\").text(project.projectName);...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Detects the API version that's been requested, either from the NApiVersion header or the URL parameters.
function detectApiVersionMiddleware(req, res, next) { const version = parseInt(req.headers["n-api-version"], 10) || parseInt(req.params.apiVersion, 10) || 0; req.apiVersion = res.apiVersion = version; next(); }
[ "function handleVersion(req, res, next) {\n\tvar version = req.params.version;\n\tif (validator.isValid(version, 'ApiVersion')) {\n\t\treq.api_version = version;\n\t\tnext();\n\t} else {\n\t\tvar error = {};\n\t\terror.msg = \"Bad ApiVersion: \" + req.originalUrl;\n\t\tnext(new ClientError(error));\n\t}\n}", "fun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
;; camRemoveDuplicates(array) ;; ;; Remove duplicate items from an array. ;;
function camRemoveDuplicates(array) { var prims = {"boolean":{}, "number":{}, "string":{}}; var objs = []; return array.filter(function(item) { var type = typeof item; if (type in prims) { return prims[type].hasOwnProperty(item) ? false : (prims[type][item] = true); } else { return objs.indexOf(it...
[ "function removeDuplicate(array) {\n\n}", "function removeDuplicateItems(arr) {}", "function removeDuplicates(array) {\n return array.filter((arr, index) => array.indexOf(arr) === index);\n }", "function removeDuplicates (array) {\n\treturn array.filter( (item, index) => \n\t\tarray.indexOf(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Injects socket id from the received request.
function SocketId() { return function (object, methodName, index) { var format = Reflect.getMetadata("design:paramtypes", object, methodName)[index]; var metadata = { target: object.constructor, method: methodName, index: index, type: ParamTypes_1.Para...
[ "function getSocketId() {\n const socketId = socket ? socket.id : 'none';\n\n return socketId || 'none';\n}", "get id() {\n return this.socket.id\n }", "registerVueRequestInterceptor() {\n Vue.http.interceptors.push((request, next) => {\n if (this.socketId()) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to send GCODE line in terminal
function sendGCodeLine() { let value = state.gCodeLine; if (!value) { return; } printerInterface.sendGCodeLine({ code: value }, function (err, res) { if (err) { setError(err); return; } state.gCodeResult = ""; if (res) { switch (typeof res) { ...
[ "function sendGCodeLine(event) {\n var value = _terminalInputValue;\n if (!value) {\n return;\n }\n _printerDialog.sendGCodeLine({ code: value }, function (err, res) {\n if (err) {\n setError(err);\n return;\n }\n _gcodeResult = \"\";\n if (res) {\n switch (...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
> DONE Return an array of Collection Objects for User requesting it
getUserCollections() { return axios.get(`/collections`); }
[ "function getCollection() {\n return datastore.getCollection(\"users\");\n}", "get users() {\n return this.collection;\n }", "async getCollectionItems(name) {\n const { fields, entries } = await this.cockpit.collectionGet(name);\n return { fields, entries, name };\n }", "getAll() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
external fits_int64: t > bool Provides: ml_z_fits_int64 Requires: bigInt
function ml_z_fits_int64(z1) { z1 = bigInt(z1) if (z1.compare(bigInt("9223372036854775807")) <= 0 && z1.compare(bigInt("-9223372036854775808")) >= 0) return 1 else return 0 }
[ "function ml_z_fits_int32(z1) {\n return ml_z_fits_int(z1);\n}", "function ml_z_fits_int(z1) {\n if(z1 == (z1 | 0)) return 1;\n else return 0;\n}", "function ml_z_fits_nativeint(z1) {\n return ml_z_fits_int(z1);\n}", "function ml_z_of_int32(i32) {\n return bigInt(i32);\n}", "function ml_z_testbit(z,p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to get polar coordinates of each spiral point. Do this once. Based on ideal formulas. Important: theta output in degrees from base function. Convert back to radians prior to storing, to be consistent with original Pullman papers. Input: none using existing userSpiral. Return: none stored in spiralPoint.
function toPolarCoordinates(inpt) { //Find origin point. var xorig=(inpt[0].xpos+inpt[1].xpos)/2; var yorig=(inpt[0].ypos+inpt[1].ypos)/2; //First reset the original point. We have done all of the reference spiral calculations at this point, so safe. inpt[0].r=Math.sqrt(Math.pow(inpt[0].xpos-xorig,2)+Math.pow(...
[ "function calculate_interspiral(decs) {\n\t//Set up a map of arrays to keep all unique degree values.\n\tvar degreeR = new Map();\n\tfor (var i=0; i<=360; i++) {\n\t\tdegreeR[i]=[];\n\t}\n\t//Now loop through every point and put it into its group.\n\tfor (var i=0; i<userSpiral.length;i++) {\n\t\t//Convert theta fro...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getCurrentBoardRowScores Find the current board scores to decide which row to go for returns: [Array] Array with the sum of row values
function getCurrentBoardRowScores() { var winningCombination = getCurrentBoardValues(); return winningCombination.map(combination => combination.reduce(add, 0)); }
[ "function getCurrentBoardValues() {\n var board = getCurrentBoardTokenPositions();\n var winningCombinationBoardValues = [];\n\n for (var boardRow = 0; boardRow < winningCombinationIndexes.length; boardRow++) {\n var valuesBoardRow = [];\n\n for (var boardSpaceIndex = 0; boardSpaceIndex < winningCombinatio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Vertical Timeline by CodyHouse.co
function VerticalTimeline( element ) { this.element = element; this.blocks = this.element.getElementsByClassName("cd-timeline__block"); this.images = this.element.getElementsByClassName("cd-timeline__img"); this.contents = this.element.getElementsByClassName("cd-timeline__content"); this.offset = 0.8; ...
[ "function VerticalTimeline( element ) {\r\n\t\tthis.element = element;\r\n\t\tthis.blocks = this.element.getElementsByClassName(\"cd-timeline__block\");\r\n\t\tthis.images = this.element.getElementsByClassName(\"cd-timeline__img\");\r\n\t\tthis.contents = this.element.getElementsByClassName(\"cd-timeline__content\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle when the list of tasks changes locally.
handleTaskListChange(tasks) { this.saveTasks(tasks); this.setState({tasks: tasks}); }
[ "onListContentsChanged() {\n this.generateListContents();\n this.saveTasksData();\n }", "function changeStatus(){\n if(list){\n activeTasksCounter = 0;\n tasksStatus = !tasksStatus;\n for(let i = 0 ; i < list.length; i++){\n tasksStatus == true ? changeTaskToCompleted(lis...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add new document with user information and FILE in Firestore 'requests' collection
function pushToDatabaseWithFile(name, email, message, fileURL) { let date = getDate(); db.collection("requests") .add({ to: "gsw2@lehigh.edu", message: { subject: "New CSB Capstone Request", html: "<div class=”body”><b>Name:</b> " + name + "<br><b>Email:...
[ "function addPhoto(file) {\n console.log(\n \"Adding photo: %s, for user: %s\",\n file.name,\n firebase.auth().currentUser.displayName\n );\n\n var userDocRef = firebase\n .firestore()\n .collection(\"users\")\n .doc(firebase.auth().currentUser.uid);\n\n // 1. add or update...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return a function which adds a "lane" to the board in the given position. This lane is just a reference to the worklist used to represent it.
function addLaneDetails(position) { return function(lane) { $scope.board.lanes.push({ board_id: $scope.board.id, list_id: lane.id, position: position }); }; }
[ "function addLaneEvent(lane) {\n myDiagram.startTransaction(\"addLane\");\n if (lane != null && lane.data.category === \"Lane\") {\n // create a new lane data object\n var shape = lane.findObject(\"SHAPE\");\n var size = new go.Size(shape.width, MINBREADTH);\n //size.he...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds 'buttons' based on array size divided by number of students to show
function buttonController(allStudents){ let colorLinks; $('.pagination').children().remove(); for (let j = 0; j < allStudents.length / studentsPerPage ; j ++ ){ ($('.pagination').append(`<li><a> ${(j + 1)} </a></li>`)); // Finds the current page number element if (j == currentPag...
[ "function loadStudents(x) {\nhideStudents();\nlet studentsPage = students.slice((x-1) * 10, x * 10);\n for (var i = 0; i < studentsPage.length; i++) {\n studentsPage[i].style.display='';\n }\n}", "function displayNav() {\n var studentNames = [];\n for (var i = 0; i < roster.length; i++) {\n studen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
toggle "last" class on selected column
function columnToggleLast(){ var column = '#constructColumn-' + containerPtr + '-' + columnPtrs[containerPtr]; $(column).toggleClass('last'); return false; }
[ "function columnToggleLast(){\r\n $('#construct .container.selected .column.selected').toggleClass('last');\r\n \r\n return false;\r\n}", "function addLastClass(dom_tree) {\n jQuery.jsComposer.checkColumnsIsEmpty();\n return jQuery.jsComposer.addLastClass(dom_tree);\n} // end jQuery.wpb_composer.addLastC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update the ratio of the camera. Most likely to happen when the windows is resized. Depends if the cam is ortho of persp.
updateRatio(w, h){ if(this._isPerspective){ this._camera.aspect = w / h ; this._camera.updateProjectionMatrix(); }else{ var wRatio = this._windowSize.width / window.innerWidth; var hRatio = this._windowSize.height / window.innerHeight; this._camera.left /= wRatio; this._cam...
[ "recalculateAspect() {\n this.aspect = this.clientWidth / this.clientHeight;\n this.camera.aspect = this.aspect;\n this.camera.updateProjectionMatrix();\n }", "resize() {\n var window = registry.components.window;\n this.camera.aspect = window.aspect;\n this.camera.updateProjectionM...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A function component for the Menu of Recipes
function RecipeMenu({ title, recipes }) { return ( <article> <header> <h1>{title}</h1> </header> <div className="recipes"> {recipes.map((recipe, i) => ( <Recipe {...recipe} key={i} /> ))} </div> </article> ); }
[ "function PopulateMenuComponent(){\n\n}", "function menuOptions() {}", "function Venus() {}", "addDishToMenu(dish) {\n //TODO Lab 1\n }", "onAddRecipeClick() {\n window.location.assign('/recipe/add');\n this.onMenuClose();\n }", "function AddRecipeToMenu() {\n console.log('add recipe to menu')...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Opens a modal and displays a random game in it
function randomModal() { fetch( `https://api.boardgameatlas.com/api/search?random=true&client_id=${bgAtlasApi}` ) .then(function (data) { return data.json(); }) .then(function (data) { document.getElementById("ranName").textContent = data.games[0].name; document .getElement...
[ "function showYouWin() {\n $(\"#modal-win\").modal(\"show\");\n win.play();\n GAMEOVER = true;\n }", "function gameWin() {\r\n modal(\"Congratulations!\",\"fa-trophy\");\r\n}", "function winGame() {\n stopMusic();\n win.play();\n modal.style.display = \"block\";\n modalContent.innerHTML = `<h1 ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a list of all items that have a file in the docs folder.
function getDocFolderItems(docFolderPath) { var result = {}; var items = fs.readdirSync(path.resolve(docFolderPath)); for (var i = 0; i < items.length; i++) { if (items[i].endsWith('.md')) { var nameNoSuffix = path.basename(items[i], '.md'); result[nameNoSuffix] = 1; ...
[ "function getFiles() {\n return fileList;\n}", "function getDocs(){\n var fs = require('fs');\n var files = fs.readdirSync('docs');\n var list = document.getElementById(\"docList\");\n for(var i = 0; i < files.length; i++){\n //Each folder needs to contain an info.json to interpret, with the file name, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert boolan values true/false (including 1/0 from MySQL) to strings 'true'/'false'. Any other values return undefined.
static boolToTrueFalse(value) { if (value === undefined) return undefined; if (value === null) return undefined; return value ? 'true' : 'false'; }
[ "function booleanToString(b){\n return b ? \"true\" : \"false\"\n}", "function booleanToString(b){\n // take input and convert to strings\n // return input as strings\n return b.toString()\n }", "function booleanToString(b){\n return b ? 'true' : 'false';\n}", "function booleanToString(b){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Evaluates, or attempts to evaluate, a GetAccessorDeclaration, before setting it on the given parent
function evaluateGetAccessorDeclaration({ node, environment, evaluate, stack, reporting, typescript, statementTraversalStack }, parent) { const nameResult = evaluate.nodeWithValue(node.name, environment, statementTraversalStack); const isStatic = inStaticContext(node, typescript); if (parent == null) { ...
[ "function evaluateSetAccessorDeclaration(options, parent) {\n const { node, environment, evaluate, statementTraversalStack, reporting, typescript } = options;\n const nameResult = evaluate.nodeWithValue(node.name, environment, statementTraversalStack);\n const isStatic = inStaticContext(node, typescript);\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the point in the user's environment that the anchor tracks from. The parameters passed in to this function correspond to the X, Y and Z coordinates (in camera space) of the point to track. Choosing a position with X and Y coordinates of zero, and a negative Z coordinate, will select a point on a surface directly i...
setAnchorPoseFromCameraOffset(x, y, z, orientation) { this._z.instant_world_tracker_anchor_pose_set_from_camera_offset(this._impl, x, y, z, orientation || zappar_cv_1.instant_world_tracker_transform_orientation_t.MINUS_Z_AWAY_FROM_USER); }
[ "function setupCamera(x, y, z) {\n camera.position.set(x, y, z)\n}", "setInitialCameraPosition() {\n\n\t\tlet target = this.getOption('target') || [0,0,0];\n\t\tthis.camera.target.set(...target);\n\n\t\t// If we don't find a position, we'll calculate the bounding box of \n\t\t// the entire scene.\n\t\tlet pos ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find game by gameid in games array
function getGame(gameid){ var i = 0; do{ if(games[i].gameid == gameid){ return games[i]; } i++; }while(i < games.length); return -1; }
[ "function findGame(id) {\n for (var i = 0; i < games.length; i++) {\n if (games[i].id == id) {\n return games[i];\n }\n }\n return null;\n}", "function searchingForGame(id){\n\tvar i;\n\tfor(i=0; i < games.length; i++){\n\t\tif(games[i].id === id){\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check whether a synchronous request was a success or not Taken from jQuery 1.4
function httpSuccess(xhr) { try { return !xhr.status && location.protocol === "file:" || xhr.status >= 200 && xhr.status < 300 || xhr.status === 304 || xhr.status === 1223; } catch (e) { } return false; ...
[ "function successfulRequest(request) {\n return request.readyState === 4 && request.status == 200;\n}", "function successfulRequest(request) {\r\n return request.readyState === 4 && request.status == 200;\r\n }", "function IsRequestSuccessful (httpRequest) {\n // IE: sometimes 1223 ins...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[MSPPT] 2.5 Slide Types / [MSPPT] 2.5.1 SlideContainer
function parse_SlideContainer(blob, length, opts) { var o = {}; recordhopper(blob, function rtslide(R, val) { switch(R.n) { case 'RT_SlideAtom': break; case 'RT_Drawing': o.drawing = val; break; case 'RT_ColorSchemeAtom': break; case 'RT_ProgTags': break; case 'RT_RoundTripContentMasterId12Atom': bre...
[ "function generateSlides() {\n const parentEle = document.querySelector('#container');\n currentQContent = [dataVizPage[state.q_id], ...sharedContent]\n\n currentQContent.forEach((slide, i) => {\n const slideElement = document.createElement('div');\n //element position absolute\n slide...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
initialize the fill filters. Generate a min and max div element that responds to mouse events that can slide within an area of 1/4th the width of the ctrldiv. Generate an interpolator to make and + values possible given the data in the fill column that we are filtering. Additional Limit closures are provided to special...
init() { // make a paragraph element that has the title of the fill col filter let para = document.createElement("p") para.id = "colfilterTitle" para.innerHTML = "Fill Color Filter" this.para = para this.ctrlDiv.append(para) // make a range slider that updates the...
[ "filter() {\n // calculate the actual min activity value\n let fillmin = this.interpolator.calc(this.min / this.width).toFixed(3)\n let fillmax = this.interpolator.calc(this.max / this.width).toFixed(3)\n // give this information to the paneOb,useful for tooltips\n /** The min val...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a div for each limit in the format of "current / max" and applies CSS classes based on how close it is to the limit.
function applyLimitClassDiv(current, max) { const remaining = max - current; let elClass = ''; if(remaining <= 0) { elClass = 'limit'; } else if(remaining <= char_limit_warning) { elClass = 'warning'; } return `<div class="${elClass}">${current} / ${max}</div>`; }
[ "function _renderLimitBar() {\n\n // Get UI elements\n var leftTag = _dataUsageLimitView.querySelector('dt.start');\n var leftValue = _dataUsageLimitView.querySelector('dd.start');\n var rightTag = _dataUsageLimitView.querySelector('dt.end');\n var rightValue = _dataUsageLimitView.querySelector('dd.e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load all of the dust templates from a given directory, storing them either in the string of client template information, or by passing them directly to the dust engine
function load_dust_templates(path, prefix, both_prefix, prepend) { var prefix_len = prefix.length; var both_len = both_prefix.length; prepend = prepend || ''; var files = fs.readdirSync(path); var that = this; _.each(files, function(v) { // Skip temporary/swap files (helps for running the server while editing...
[ "function loadTemplates() {\n for (var template in templates) {\n templates[template] = fs.readFileSync(templatePath + template + '.html').toString();\n }\n }", "function loadTemplates() {\n let templates = fs.readdirSync(options.templates);\n templates.forEach(functi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
============================================================================= loadData function Desc: Will request data from stream given a specific timeframe (start, end) =============================================================================
function loadData(start, end){ var filter = $('#filter').val(); if ($.isNumeric(filter) == false){ filter = 1; } isNewData = true; var rest_request_values = "/stream/getstreamdata?streamid="+streamId +"&startdate="+start.format('YYYY-MM-DD') +"&enddat...
[ "function getDataFromTimeRange(start, end, requestedUri, data) {\n if (!data || data.length === 0) {\n return null;\n }\n let startStrs = start.toString().split('-');\n let startDate = new Date(parseInt(startStrs[0]), parseInt(startStrs[1]) - 1, parseInt(startStrs[2]));\n let unixStart = start...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getIgnoreKeywords_allNumberWords_remainingDigits(args) Get the remaining digits to ignore. For example: one thousand, fifty five hundred, seventy eight million, etc..
function getIgnoreKeywords_allNumberWords_remainingDigits(args) { var onehundred = args.onehundred; var increments = getIgnoreKeywords_allNumberWords_remainingDigits_baseIncrements(); var allremainingnumbers = []; for(var i = 0; i < increments.length; i++) { var increment = increments[i]; for...
[ "function getIgnoreKeywords_allNumberWords() {\n\t\tvar allnumberwords = [];\n\t\t\n\t\tvar onehundred = [];\n\t\tonehundred = onehundred.concat(getIgnoreKeywords_allNumberWords_firstDigit());\n\t\tonehundred = onehundred.concat(getIgnoreKeywords_allNumberWords_upToTwenty());\n\t\tonehundred = onehundred.concat(get...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Changing background image as checklist
function checklist() { document.body.style.backgroundImage = "url('checkl.jfif')"; }
[ "function setBackGround() {\n let el = $('.currency li');\n for (var i = 0; i < el.length; i++) {\n let clas = el[i].className;\n\n $(el[i]).css('background-image', 'url(' + './flag-icon/'+ clas + '.png' +')');\n }\n}", "function backgroundChange() {\n\t\tvar backgrounds = document.getElementById(\"backg...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
pega a string formada na tela e computa o resultado
function mostrarResultado() { if (valorTela.value.includes("%")) { valorTela.value = eval(porcento()) } else if (valorTela.value.includes("!")) { valorTela.value = eval(fatorial()) } else if (valorTela.value.includes("mod")) { valorTela.value = eval(mod()) } else if (valorTela.value.includes("^")...
[ "function tempSilaba( str ) {\n var temp = \"\";\n var s=\"\";\n \n //las tres primeras letras de 'str'\n var x,y,z;\n \n if( str.length <3){\n if( str.length == 2){\n x = str.charAt(0);\n y = str.charAt(1);\n i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FINAL SUMMARY TOTAL LEFT
function generateSummaryLeftTableRow(doc, y, classhead, subtotal, disc, amount, sgst, cgst, gst, total, isIGST, igst) { doc.fillColor('#000000'); doc.fontSize(9).text(classhead, 24, y, { width: 40, align: 'left' }); if (subtotal === 'SUB TOTAL') { doc.text(subtotal, 64, y, { width: 50, align: 'right' }); } else {...
[ "calculateSummary(){\n let subtotal = 0\n this.cartItems.forEach(cartItem => {\n subtotal = subtotal + cartItem.price\n })\n this.setSummary(getFormatedPrice(subtotal),getFormatedPrice(shipping),getFormatedPrice(subtotal + shipping))\n }", "summary(){\n return work...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
6. Init Video Overlay
function initVideoOverlay() { if($('.video_overlay').length) { var overlay = $('.video_overlay'); $('.video_container_outer').on('click', function() { overlay.css('opacity', "0"); }) } }
[ "function initVideo() {\n if (platform.isFlash) {\n initFlashPlayer();\n } else {\n initVideoPlayer();\n }\n }", "function overVideoControl() {\n showVideoControl()\n }", "function videoBGInit() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($('.nectar...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creating the enum objects Call this in the set parameters function
function setEnumColor() { BLUE = new Color(); GREEN = new Color(); RED = new Color(); GREEN = new Color(); NO_COLOR = new Color(); BLUE.setBLUE(); RED.setRED(); GREEN.setGREEN(); NO_COLOR.setNO_COLOR(); console.log("Different colours created used for creating Enum"); }
[ "_parseEnum () {\n if (this._currentOriginalParam.enum) {\n if (this._currentOriginalParam.enum.length === 1) {\n this._currentParam.isSingleton = true\n this._currentParam.singleton = this._currentOriginalParam.enum[0]\n } else {\n let _enum = {\n name : _.upper...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set leds accoring to wind speed
function setWind(speed=0){ if(speed != 0){ windSpeed = speed; } clearDisplay() bit= Math.abs((windSpeed/20)); if(windSpeed >=140){ setBits(bit, true) } else if(windSpeed >=120){ setBits(bit, true) }else if(windSpeed >=100){ setBits(bit, true...
[ "function setSpeed() {}", "function updateLED() {\n\tledR.pwmWrite(actualColour[0]);\n\tledG.pwmWrite(actualColour[1]);\n\tledB.pwmWrite(actualColour[2]);\n}", "function updateLed() {\n GPIO.write(led, state.led ? LED_OFF : LED_ON);\n GPIO.write(relay, state.p5 ? LED_ON : LED_OFF);\n GPIO.write(reset, state....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
parse JS file, extract tags by traversing AST while tracking scopes
function generateTags(sourcefile,source) { sourcelines = source.split(/\r?\n/); //access text of a line from source file by index try { // var result = parse(source,{loc:true}); var result = parse(source,{ sourceType: moduleParseMode ? 'module' : 'script', plugins: [ ...
[ "function generateTags(sourcefile,source) {\n\n try {\n var result = parse(source,{loc:true});\n } catch (e) {\n console.error(\"parse error in \"+sourcefile,e);\n return;\n }\n\n var scopes = []; // stack of function body scopes\n\n function extractTags(node,children){\n var s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add facebook integration to the user object
static async addFacebookIntegration(userId, authResponse) { try { //get long token const longTermUserAuth = await FacebookLogic.extendAccessToken(authResponse.accessToken); //get the user const user = await DBManager.getUserById(userId); //if this is a new user if (!user) { //create default ...
[ "function addFacebook(user, profile, token, done) {\n\n console.log(profile.name);\n\n user.facebook.id = profile.id;\n user.facebook.token = token;\n user.facebook.name = profile.displayName;\n user.facebook.email = profile.emails[0].value;\n user.firstName = profile.name.givenName;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
DigitClassifier constructor, mirrors that of a NeuralNetwork, except output count is always
function DigitClassifier(inputCount, layers) { if (layers === void 0) { layers = []; } this.outputCount = layers.length > 0 ? layers[layers.length - 1].neuronCount : inputCount; this.neuralNetwork = new NeuralNetwork_1.NeuralNetwork(inputCount, layers); }
[ "constructor(inputCount, outputCount, innovationNumber) {\n\t\tthis._innovationNumber = innovationNumber;\n\t\tthis._inputCount = inputCount;\n\t\tthis._outputCount = outputCount;\n\t\tthis._genome = new HashMap();\n\t\tthis._values = [];\n\t\tthis._network = new NeuralNetwork(inputCount, outputCount);\n\t}", "co...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Attach to |aClient|'s tab whose title is |aTitle|; pass |aCallback| the response packet and a TabClient instance referring to that tab.
function attachTestTab(aClient, aTitle, aCallback) { getTestTab(aClient, aTitle, function (aTab) { aClient.attachTab(aTab.actor, aCallback); }); }
[ "function attachTestTabAndResume(aClient, aTitle, aCallback) {\n attachTestThread(aClient, aTitle, function(aResponse, aTabClient, aThreadClient) {\n aThreadClient.resume(function (aResponse) {\n aCallback(aResponse, aTabClient, aThreadClient);\n });\n });\n}", "function attachTestThread(aClient, aTi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ageOneYear should add one to the `age` property of `obj`
function ageOneYear (obj) { obj.age += 1 return obj }
[ "function ageOneYear (obj) {\n obj.age++\n}", "yearPasses() {\n return this.age + 1;\n }", "function increaseYearByOne(book){\n book.year+=1;\n}", "age(year){\n const y = new Date().getFullYear();\n if(year<y||year>2200){\n console.log(`Enter a valid year to return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update map based styling. Map based styling could be anything which contains more than one binding. For example `string`, or object literal. Dealing with all of these types would complicate the logic so instead this function expects that the complex input is first converted into normalized `KeyValueArray`. The advantag...
function updateStylingMap(tView, tNode, lView, renderer, oldKeyValueArray, newKeyValueArray, isClassBased, bindingIndex) { if (oldKeyValueArray === NO_CHANGE) { // On first execution the oldKeyValueArray is NO_CHANGE => treat it as empty KeyValueArray. oldKeyValueArray = EMPTY_ARRAY$3; ...
[ "function updateStylingMap(tView, tNode, lView, renderer, oldKeyValueArray, newKeyValueArray, isClassBased, bindingIndex) {\n if (oldKeyValueArray === NO_CHANGE) {\n // On first execution the oldKeyValueArray is NO_CHANGE => treat it as empty KeyValueArray.\n oldKeyValueArray = EMPTY_ARRAY$3;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GET /statuses/public Retrieve a list of all existing statuses. [Learn more on Dev Center]( `options` An object containing the search params. [See accepted params]( `callback` The callback function returning the results. An error object is passed as first argument and the result as last.
function public(options, callback) { core.api('GET', '/statuses/public', options, callback); }
[ "function all(options, callback) {\n core.api('GET', '/statuses', options, callback);\n }", "function twitterSearch() {\n var client = new Twitter(keys.twitter);\n var params = { screen_name: 'HwNode' };\n client.get('statuses/user_timeline', params, function (error, tweets, response) {\n if (...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Put default plotTile layouts here
function cloneLayoutOverride(tileClass) { var override; switch (tileClass) { case 'themes__thumb': override = { autosize: true, width: 150, height: 150, title: { text: '' }, showlegend: false, margin: { l: 5, r: 5, ...
[ "layoutTiles() {\n this.generateTileSet();\n this.updateTiles();\n }", "function layoutTiles() {\n var layout = scope.layout;\n\n if (layout) {\n if (singleColumnMode) {\n moveTiles...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
2. Read and parse file containing the feed URLs.
function readRSSFile (configFilename) { fs.readFile(configFilename, function(err, feedList) { if (err) return next(err); // convert list of feed URLs to a string and then into an array of feed URLs. feedList = feedList .toString() .replace(/^\s+|\s+$/g, '') ...
[ "function read_feed_links() {\n\tlet feeds = {}\n\treturn new Promise((resolve) => {\n\t\tglob(FEED_ROOT + \"/**/**/_feed_.json\", {}, (err, files) => {\n\t\t\tfiles.forEach((path, idx) => {\n\t\t\t\tconst json = JSON.parse(fs.readFileSync(path).toString())\n\t\t\t\tconst url = normUrl(json.url)\n\t\t\t\tfeeds[url...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get the most specific link available for the given Singly item:
function getPermalink(item){ // console.log('getPermalink:', item); switch(getService(item)) { case 'facebook': return 'https://www.facebook.com/photo.php?fbid='+item.data.id; // case 'foursquare': // return 'https://foursquare.com/ + ??? + /checkin/'+item.data.checkin.id...
[ "function getURL(link) {\n const items = [\n {\n name: 'Home',\n url: './index.php'\n },\n {\n name: 'Shopping Cart',\n url: './Assignments/week3/store.html'\n },\n {\n name: 'DB Setup',\n url: '#'\n },\n {\n name: 'DB Access',\n url: './Assignments/week...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Legacy route handler is defined in cocoapods.service.js.
static registerLegacyRouteHandler() {}
[ "routeFor(...args) {\r\n this.native.routeFor.apply(this.native, args)\r\n }", "function code() {\n server.route({\n method: 'GET',\n path: '/foobar',\n handler(request, reply) {\n reply({foo: 'bar'});\n },\n config: {\n description: 'foobar sample route',\n tags: ['api']\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Start the server on the specified port
start (port) { // Listen for and handle incoming HTTP requests this.server.on('request', (request, response) => { const res = new Response(response) this.handleRequest(request, res) }) this.server.listen(port) }
[ "function run(port) {\n const server = new Server(port);\n server.start();\n}", "function start(port) {\n var service = HTTP.createServer(handle);\n service.listen(port, 'localhost');\n console.log(\"Visit localhost:\" + port);\n}", "function start(port) {\n app.listen(port, () => {\n console.log...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Do not modify this file it is generated by m4 / $dollar_lib.m4.js
function getDollarNumber ( ) { 'use strict'; var __FUNCTION__ = "getDollarNumber"; this.dollar = {}; this.next_dollar = 1; this.data_saved = []; }
[ "set Dollar(value) {}", "function amount() {}", "protected internal function m252() {}", "function price() constant returns (uint){\n return 1 finney;\n }", "function centsInDollar() {\n return 100;\n}", "function MathUtils() {}", "function Package()\n{\n}", "_generateLibrary() {}", "func...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initialize a User from an idToken server response
static async _fromIdTokenResponse(auth, idTokenResponse, isAnonymous = false) { const stsTokenManager = new StsTokenManager(); stsTokenManager.updateFromServerResponse(idTokenResponse); // Initialize the Firebase Auth user. const user = new UserImpl({ uid: idTokenRespons...
[ "static async _fromIdTokenResponse(auth, idTokenResponse, isAnonymous = false) {\n const stsTokenManager = new StsTokenManager();\n stsTokenManager.updateFromServerResponse(idTokenResponse); // Initialize the Firebase Auth user.\n\n const user = new UserImpl({\n uid: idTokenResponse.localId,\n au...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FamiliesEvacuated textfield change event handler
function OnFamiliesEvacuated_Change( e , type ) { Alloy.Globals.AeDESModeSectionEight["FAMILIES_EVACUATED"] = $.widgetAppTextFieldAeDESModeFormsSectionEightFamiliesEvacuated.get_text_value() ; }
[ "onBlur() {\n ChromeGA.event(ChromeGA.EVENT.TEXT, this.name);\n this.fireEvent('setting-text-changed', this.value);\n }", "onFnaFieldValueChanged(value) {}", "onFieldChanged(control, controlName, currentValue) {}", "_handleFieldChange() {\n if (this.type === \"text\" || this.type === \"t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a payment method TODO: returns? Deferred resolved with ? TODO: data parameter ? what's the structure?
addPayment(data) { return null }
[ "addPaymentMethod(paymentMethod) {\n const pm = new PaymentMethod(paymentMethod);\n pm.customer = this.id;\n\n return pm.validate().then(() => new Promise((resolve, reject) => {\n Conekta.Customer.find(this.externalReference, (err, extCust) => {\n if (err) {\n reject(err);\n }\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
closing bracket for getRandomValue function function to display gifs in sidebar:
function sidebarGif(){ var sideBarGifCategories = ["soothing", "satisfying", "funny"]; queryURL = `https://api.giphy.com/v1/gifs/random?api_key=YH4MrA2S7hO4bt490OPWcfMSS4SQUtl1&tag=${getRandomValue(sideBarGifCategories)}`; //ajax call for gifs $.ajax({ url: queryURL, method: "GET", }).then(function (response) { /...
[ "function getRandomGif() {\n\t// Retrieve all possible gifs in an array\n\tlet allGifs = getGifs();\n\t// Use Math.random() to get a random index number and get the random gif file name\n\tlet randomGif = allGifs[Math.floor(Math.random() * allGifs.length)];\n\treturn randomGif;\n}", "function getRandomGifFile() {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }