Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Utility function to generate the html label for a userPref based on if it is required or not
function generatePrefLabelMarkup(userPref) { var markup = []; var prefLabel = (userPref.required) ? "* " + userPref.displayName : userPref.displayName; markup.push("<td class='"); markup.push(WIDGET_PREFS_LABEL_CLASS); if (userPref.required) { markup.push(" "); markup.push(WIDGET_PREFS_LABEL_REQUIRED_CLASS); } markup.push("'>"); markup.push(prefLabel); markup.push("</td>"); return markup.join(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generatePrefInputClassMarkup(userPref) {\n var markup = [];\n markup.push(WIDGET_PREFS_INPUT_CLASS);\n if (userPref.required) {\n markup.push(\" \");\n markup.push(WIDGET_PREFS_INPUT_REQUIRED_CLASS);\n }\n return markup.j...
[ "0.6330865", "0.61747205", "0.61295223", "0.580869", "0.5763793", "0.5747451", "0.57332486", "0.5725752", "0.5665497", "0.5649104", "0.558894", "0.5561425", "0.5547449", "0.5540915", "0.5517936", "0.54994637", "0.54948455", "0.5455702", "0.5447712", "0.54466766", "0.5428423",...
0.8082545
0
Utility function to generate the css class(es) of a userPref input field based on if it is required or not
function generatePrefInputClassMarkup(userPref) { var markup = []; markup.push(WIDGET_PREFS_INPUT_CLASS); if (userPref.required) { markup.push(" "); markup.push(WIDGET_PREFS_INPUT_REQUIRED_CLASS); } return markup.join(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "inputClass () {\n let klass = ''\n\n if (this.state.focus) {\n klass += ' usa-input-focus'\n }\n\n if (this.state.valid) {\n klass += ' usa-input-success'\n }\n\n if (this.state.checked) {\n klass += ' selected'\n }\n\n return klass.trim()\n }", "labelClass () {\n let k...
[ "0.684388", "0.6082944", "0.6043315", "0.6038432", "0.58463854", "0.5785473", "0.5770614", "0.57303566", "0.57255924", "0.57164735", "0.5619832", "0.557445", "0.5556102", "0.55518055", "0.5519978", "0.5514215", "0.5513528", "0.5507767", "0.5443522", "0.5426768", "0.5426207", ...
0.7445592
0
Utility function to validate a userPref input element
function validatePrefInput(element) { var isValid = true; var jqEl = $(element); // if the input is required verify it's trimmed input length is > 0 if (jqEl.hasClass(WIDGET_PREFS_INPUT_REQUIRED_CLASS)) { isValid = $.trim(jqEl.val()).length > 0; } return isValid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkElement(element)\r\n{\r\n var isRequired = element.getAttribute(\"isRequired\");\r\n var inputValue = element.value;\r\n if (inputValue == \"无权限查看\")\r\n return true;\r\n\r\n var validChar = GetValidChar(element.getAttribute(\"validEnum\"));\r\n\r\n //过滤特殊字符\r\n if (inputValu...
[ "0.625641", "0.62227505", "0.6090967", "0.5930259", "0.58690655", "0.5840207", "0.5833624", "0.5761783", "0.5758281", "0.5725038", "0.5719227", "0.570561", "0.5668139", "0.56507987", "0.5622217", "0.56155854", "0.5614728", "0.56125677", "0.5596227", "0.5595975", "0.55951035",...
0.7807044
0
Applies styling to the several buttons in the widget toolbar
function styleWidgetButtons(widgetId) { var widget = rave.getRegionWidgetById(widgetId); // init the widget minimize button which is hidden by default // and only renders when widget is in maximized view $("#widget-" + widgetId + "-min").click({id: widgetId}, rave.minimizeWidget); // init the collapse/restore toggle // conditionally style the icon and setup the event handlers var $toggleCollapseIcon = $("#widget-" + widgetId + "-collapse"); $toggleCollapseIcon.html((widget.collapsed) ? WIDGET_TOGGLE_DISPLAY_COLLAPSED_HTML : WIDGET_TOGGLE_DISPLAY_NORMAL_HTML); $toggleCollapseIcon .click({id:widgetId}, toggleCollapseAction) .mousedown(function (event) { // don't allow drag and drop when this item is clicked event.stopPropagation(); }); $('#widget-' + widgetId + '-toolbar').mousedown(function(event) { // don't allow drag and drop when this item is clicked event.stopPropagation(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function InsertButtonsToToolBar()\n{\n//Strike-Out Button\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/c/c9/Button_strike.png\",\n \"speedTip\": \"Strike\",\n \"tagOpen\": \"<s>\",\n \"tagClose\": \"</s>\",\n \"sampleText\": \"Strik...
[ "0.6848476", "0.67644095", "0.65586317", "0.6547209", "0.6473002", "0.6473002", "0.6393089", "0.6262251", "0.6152703", "0.60909927", "0.6077904", "0.607606", "0.6042236", "0.6038369", "0.60128576", "0.5982865", "0.5976774", "0.5976658", "0.5974836", "0.5974748", "0.5965876", ...
0.6461761
6
Toggles the display of the widget collapse/restore icon.
function toggleCollapseWidgetIcon(widgetId, collapsed) { var $toggleIcon = $("#widget-" + widgetId + "-collapse"); if (collapsed) { $toggleIcon.html(WIDGET_TOGGLE_DISPLAY_COLLAPSED_HTML); } else { $toggleIcon.html(WIDGET_TOGGLE_DISPLAY_NORMAL_HTML); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hideShowExpandToggle() {\n if (minWidth) {\n setExpandedWidth(\"60%\");\n } else {\n setExpandedWidth(\"80%\");\n }\n\n if (isExpanded) {\n setExpanded(false);\n } else {\n setExpanded(true);\n }\n }", "toggle() {\n...
[ "0.70135665", "0.69897556", "0.69897556", "0.686293", "0.68112946", "0.6808528", "0.67870665", "0.6741469", "0.6725679", "0.6628447", "0.66143376", "0.65889484", "0.65522915", "0.65255564", "0.65252", "0.6519703", "0.6473483", "0.64279777", "0.6405912", "0.63805467", "0.63708...
0.731999
0
Displays the "empty page" message on the page
function displayEmptyPageMessage() { $("#emptyPageMessageWrapper").removeClass("hidden"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayEmpty() {\n var emptyCase = `\n <div class = \"alert alert-warning\" role = \"alert\">\n <h5>No new articles available.</h5>\n </div>`;\n articleContainer.append(emptyCase);\n }", "function EmptyPage() {\n return <div>Empty page</div>;\n}", ...
[ "0.6837556", "0.6818285", "0.681492", "0.6773253", "0.67297196", "0.6642752", "0.6617391", "0.6607315", "0.6561375", "0.65374064", "0.6446165", "0.6436086", "0.6409814", "0.63900256", "0.634226", "0.6312254", "0.62965447", "0.6273451", "0.6268011", "0.623355", "0.62277764", ...
0.7388173
0
Utility function to determine if a javascript object is a function
function isFunction(obj) { return (typeof obj == "function"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isFunction(object) { return typeof object === 'function'; }", "function isFunction( obj ){\n return Object.prototype.toString.call( obj ) == \"[object Function]\";\n }", "function isFunction(obj) {\n return typeof obj === \"function\";\n}", "function isFunction(obj) {\n return typeof...
[ "0.87275076", "0.85716516", "0.84731215", "0.84731215", "0.84659374", "0.84659374", "0.8413471", "0.8400714", "0.8271588", "0.8271588", "0.82297206", "0.82297206", "0.81895155", "0.818057", "0.8168735", "0.8164996", "0.81547797", "0.79345363", "0.7929563", "0.7900477", "0.787...
0.826689
10
Determines if a page is empty (has zero widgets)
function isPageEmpty() { return $.isEmptyObject(widgetByIdMap); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPaginationEmpty(block) {\n\t return block === void 0 || block === null || block.length <= block.perPage;\n\t}", "get empty() {\n if(this.children.length === 0) {\n return true\n } else {\n return false\n }\n }", "isEmpty() {\n\t\treturn this.size === ...
[ "0.67035246", "0.6671512", "0.64998066", "0.64573294", "0.6448146", "0.64434016", "0.6433765", "0.6409741", "0.64053875", "0.6402961", "0.6402961", "0.6370084", "0.6370084", "0.6370084", "0.6370084", "0.6370084", "0.63637847", "0.6327837", "0.63211155", "0.6304488", "0.629139...
0.87860894
0
Removes a regionWidgetId from the internal widget map
function removeWidgetFromMap(regionWidgetId) { delete widgetByIdMap[regionWidgetId]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove_widget(widget_id) {\n delete this.data[widget_id];\n }", "function removeWidget(widget) {\r\n storage.get(\"tiles\", function(storage_data) {\r\n var widgets = storage_data.tiles;\r\n\r\n delete widgets[widget];\r\n\r\n storage.set({\"tiles\": widgets})\r\n });\r\n}", "function deleteWidg...
[ "0.7151344", "0.6785963", "0.6577708", "0.6394485", "0.6382265", "0.6328557", "0.62226796", "0.6040211", "0.5929866", "0.5923567", "0.5807613", "0.5766515", "0.5722185", "0.57135826", "0.5709486", "0.56413305", "0.5630386", "0.5606092", "0.5505306", "0.5474496", "0.5463774", ...
0.8964363
0
Logs to a console object if it exists
function log(message) { if (typeof console != "undefined" && console.log) { console.log(message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ovverideConsole() {\n console.log = (message, args = []) => {\n const pattern = /^\\[bot\\.(info|error|plugin)\\](.*)/;\n const matches = message.match(pattern);\n\n if (!matches) {\n logger.log(message, ...args);\n return;\n }\n\n if (matches.length > 1) {\n const method = ...
[ "0.7528249", "0.73931277", "0.719233", "0.7014647", "0.6815774", "0.676632", "0.6712763", "0.6712387", "0.6710047", "0.668018", "0.6677263", "0.6676313", "0.66670454", "0.66303664", "0.6629112", "0.6618885", "0.66159666", "0.66011435", "0.6598733", "0.65965366", "0.65939385",...
0.6602824
17
Hiermee doe ik de menu knop open en dicht
function myFunction() { document.getElementById("myDropdown").classList.toggle("show"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openMenu() {\n g_IsMenuOpen = true;\n}", "function openMenu() {\n vm.showMenu=!vm.showMenu;\n }", "function onOpen() {\n createMenu();\n}", "function openMenuBar() {\n setOpen(!open)\n }", "function handleOpenMenu() {\n setOpenMenu(!openMenu);\n }", "function manageMenu() {\n...
[ "0.7982476", "0.7686112", "0.75871783", "0.74780846", "0.7346505", "0.7304437", "0.7216212", "0.7133257", "0.71231824", "0.7083501", "0.69914055", "0.6989825", "0.6935601", "0.6925134", "0.6914193", "0.691408", "0.6895226", "0.68763447", "0.6825789", "0.6811059", "0.6806017",...
0.0
-1
EURO TO DOLLAR CONVERT FUNCTION
function euroTodollar() { var euro2dollar = 1.10; var bedrag = document.querySelector("#bedrag").value; document.getElementById("convert").value = (bedrag * euro2dollar).toFixed(2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dollarToeuro() {\n var dollar2euro = 0.91;\n var bedrag = document.querySelector(\"#bedrag\").value;\n\n document.getElementById(\"convert\").value = (bedrag * dollar2euro).toFixed(2);\n\n }", "function pond2euro() {\n var pond2euro = 1.17;\n var bedrag = document.querySelector(\"#bedrag...
[ "0.7358444", "0.67566913", "0.672828", "0.6651549", "0.6607016", "0.63641584", "0.63308567", "0.62846744", "0.6241035", "0.6185155", "0.6164351", "0.61156285", "0.6078811", "0.6071066", "0.6067765", "0.6011564", "0.6007596", "0.59942394", "0.59901863", "0.59857875", "0.598211...
0.68504477
1
Dollar To Euro CONVERT FUNCTION
function dollarToeuro() { var dollar2euro = 0.91; var bedrag = document.querySelector("#bedrag").value; document.getElementById("convert").value = (bedrag * dollar2euro).toFixed(2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function euroTodollar() {\n var euro2dollar = 1.10;\n var bedrag = document.querySelector(\"#bedrag\").value;\n\n document.getElementById(\"convert\").value = (bedrag * euro2dollar).toFixed(2);\n\n }", "function toCurrency(){\n\n}", "function convertToCurrency(num) {\n return \"AUD \" + num.toFixed(2...
[ "0.7718889", "0.75523186", "0.7517815", "0.75133", "0.7273224", "0.7204205", "0.70954895", "0.7047062", "0.69806165", "0.69283384", "0.69272465", "0.69200283", "0.6892008", "0.68343306", "0.68201447", "0.681075", "0.6803525", "0.67761314", "0.6742312", "0.6741504", "0.6740030...
0.8191923
0
Euro To Pond CONVERT FUNCTION
function euroTopond() { var euro2pond = 0.85; var bedrag = document.querySelector("#bedrag").value; document.getElementById("convert").value = (bedrag * euro2pond).toFixed(2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pond2euro() {\n var pond2euro = 1.17;\n var bedrag = document.querySelector(\"#bedrag\").value;\n\n document.getElementById(\"convert\").value = (bedrag * pond2euro).toFixed(2);\n\n }", "function dollarToeuro() {\n var dollar2euro = 0.91;\n var bedrag = document.querySelector(\"#bedrag\"...
[ "0.7509184", "0.70787", "0.69346756", "0.66679895", "0.66138965", "0.6537474", "0.64933497", "0.63803834", "0.63189256", "0.6294522", "0.62887555", "0.6285561", "0.62005484", "0.6194006", "0.61798245", "0.6174534", "0.6166513", "0.6156343", "0.61549664", "0.6137713", "0.61114...
0.7094993
1
Pond To Euro CONVERT FUNCTION
function pond2euro() { var pond2euro = 1.17; var bedrag = document.querySelector("#bedrag").value; document.getElementById("convert").value = (bedrag * pond2euro).toFixed(2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function euroTopond() {\n var euro2pond = 0.85;\n var bedrag = document.querySelector(\"#bedrag\").value;\n\n document.getElementById(\"convert\").value = (bedrag * euro2pond).toFixed(2);\n\n }", "function dollarToeuro() {\n var dollar2euro = 0.91;\n var bedrag = document.querySelector(\"#bedrag\...
[ "0.7081263", "0.70436895", "0.6820045", "0.65416956", "0.65415627", "0.6422886", "0.6411635", "0.62857646", "0.628178", "0.6262123", "0.621799", "0.61933947", "0.6176558", "0.6171094", "0.61676157", "0.6163205", "0.6142973", "0.61243206", "0.6101886", "0.609606", "0.60783726"...
0.74830157
0
UI EVENTS onSubmit onChange
onSubmit(event) { event.preventDefault(); // Validate the form this.step.validate(); // Set a timeout due to the setState function of react setTimeout(() => { const valid = this.step.isValid(); if (valid) { if (this.state.step === this.state.stepLength && !this.state.submitting) { // Start the submitting this.setState({ submitting: true }); // Set the request // Send the request const xmlhttp = new XMLHttpRequest(); const xmlhttpOptions = { type: (this.state.dataset && this.state.layer) ? 'PATCH' : 'POST', authorization: this.state.form.authorization, contentType: 'application/json', omit: ['authorization'] }; xmlhttp.open(xmlhttpOptions.type, `${process.env.WRI_API_URL}/dataset/${this.state.dataset}/layer/${this.state.layer || ''}`); xmlhttp.setRequestHeader('Content-Type', xmlhttpOptions.contentType); xmlhttp.setRequestHeader('Authorization', xmlhttpOptions.authorization); xmlhttp.send(JSON.stringify({ // Remove unnecesary atributtes to prevent 'Unprocessable Entity error' layer: omit(this.state.form, xmlhttpOptions.omit) })); xmlhttp.onreadystatechange = () => { if (xmlhttp.readyState === 4) { // Stop the submitting this.setState({ submitting: false }); if (xmlhttp.status === 200 || xmlhttp.status === 201) { const response = JSON.parse(xmlhttp.responseText); const successMessage = `The layer "${response.data.id}" - "${response.data.attributes.name}" has been uploaded correctly`; console.info(response); console.info(successMessage); alert(successMessage); // Go back to first step and set the dataset // This will trigger the PATCH function this.setState({ step: 1, layer: response.data.id }); } else { console.info('Error'); } } }; } else { this.setState({ step: this.state.step + 1 }, () => console.info(this.state)); } } }, 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onSubmit() {\n console.log(\"submit form\");\n }", "async handleSubmit(evt) {}", "onSubmit (e) {\n e.preventDefault(); // Don't refresh page\n this.props.onSubmit(this.state.value);\n }", "function onSubmit(ev) {\n ev.preventDefault()\n console.log(`Iniciando submit`)\n\n if (...
[ "0.71524733", "0.70684963", "0.70531464", "0.6934514", "0.6842213", "0.6828775", "0.67651504", "0.67651504", "0.6764502", "0.6713403", "0.67049795", "0.6698204", "0.6695863", "0.66804487", "0.6624674", "0.661544", "0.6574098", "0.656762", "0.6548952", "0.6540871", "0.6532958"...
0.0
-1
randomly change the light
function changeLight() { if (OrangeCounter > 0) { LIGHT = "Orange"; OrangeCounter -= 1; } else if (random() < ChangeProb) { newLIGHT = ((LIGHT == "Red") ? "Green" : "Red"); OrangeCounter = OrangeTime; } else if (OrangeCounter <= 0) { OrangeCounter = 0; LIGHT = newLIGHT; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fakeLight(){\n pntLight = false;\n}", "function randomStopLight() {\n var randomNumber = Math.floor(Math.random() * 10);\n if (randomNumber < 3) {\n return \"Red\";\n } else if(randomNumber >= 3 && randomNumber <= 6) {\n return \"Yellow\";\n } else {\n return \"Green\...
[ "0.73495024", "0.7308613", "0.7187673", "0.6919768", "0.6912044", "0.6880123", "0.6871698", "0.6805461", "0.6795812", "0.671041", "0.6692147", "0.6655923", "0.6650478", "0.66353744", "0.6598286", "0.6590681", "0.6583609", "0.6563177", "0.6562443", "0.65593904", "0.6536377", ...
0.7821203
0
this image handler is for experience
function imageHandler_discuss() { const input = document.createElement('input'); input.setAttribute('type', 'file'); input.click(); input.onchange = () => { var file = input.files[0]; var image_file = new FormData(); image_file.append("image", file); $.ajax({ url : 'http://127.0.0.1:8000/post/save_user_discuss_post_image/', type : "POST", data: image_file, contentType: false, headers: { "X-CSRFToken": csrftoken }, processData: false, success : function(response_data) { insertToEditor_discuss(response_data["image_url"]); }, error : function(xhr,errmsg,err) { console.log(xhr.status + ": " + xhr.responseText); } }); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function image_display() {\r\n\r\n}", "function C999_Common_Achievements_ShowImage(ImagePath) {\n C999_Common_Achievements_Image = ImagePath;\n}", "function getImageInfo() {\n\n}", "function imageHandler(e) {\n fileName = e.target.files[0];\n mpImg = new MegaPixImage(fileName);\n setTimeout(prese...
[ "0.6447416", "0.62845635", "0.6281084", "0.62159145", "0.621066", "0.6153429", "0.61533403", "0.6094539", "0.60593873", "0.60593694", "0.6036751", "0.60072666", "0.59906185", "0.5980346", "0.59531915", "0.590552", "0.59044224", "0.58976215", "0.58701044", "0.5860727", "0.5857...
0.0
-1
angular .module(appName) .filter(name, pagination)
function pagination() { return function (input, pageth, elPerPage) { if (!input || !input.length) return; // var videoPerPage = window.constants.VIDEO_PER_PAGE; // elPerPage = parseInt(elPerPage); pageth = parseInt(pageth); elPerPage = parseInt(elPerPage); let numEl = input.length; let start = (pageth - 1) * elPerPage; let end = start + elPerPage; // //console.log('==========') // //console.log(`num ele ${numEl}`); // //console.log(`page: ${pageth}`); // //console.log(`elperpage: ${elPerPage}`); // //console.log(`start: ${start}`); // //console.log(`end: ${end}`); // if (pageth > numEl / elPerPage + 1) return; // pageth > num pages return input.slice(start, end); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pagination() {\r\n\t\t\t\t$scope.pageSize = $scope.shownoofrec;\r\n\t\t\t\t\r\n\t\t\t\t$scope.currentPage = 0;\r\n\t\t\t\t$scope.totalPages = 0;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$scope.nextDisabled = false;\r\n\t\t\t\t$scope.previousDisabled = true;\r\n\t\t\t\t\r\n\t\t\t\tif(self.Filtervehicles.length <...
[ "0.61229646", "0.6085161", "0.59750646", "0.59750646", "0.59553766", "0.59512067", "0.5924951", "0.58912855", "0.58912855", "0.58519495", "0.5836397", "0.5797054", "0.57962877", "0.57875603", "0.57799774", "0.5751559", "0.5743671", "0.57076985", "0.5661386", "0.5651151", "0.5...
0.0
-1
This function is in charge of loading up all the cupcakes we have in the db so we can display them on the page. The function calls the getCupcakes() method of Class CupcakeList and stores the instance in our cupcakes global variable like mentioned above. The function also calls the createHTML function that will generate the list element with the cupcake information We add eventlisteners to each individual delete button as well
async function loadCupcakes() { let response = await CupcakeList.getCupcakes(); cupcakes = response; console.log(cupcakes) $cupcakeList.empty(); for (let cc of cupcakes.cupcakes) { console.log(cc) const html = createHTML(cc); $cupcakeList.append(html); let delBtn = document.getElementById(`del-btn-${cc.id}`); delBtn.addEventListener("click",deleteCupcake); let editBtn = document.getElementById(`edit-btn-${cc.id}`); editBtn.addEventListener("click",showEditForm); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateAndAppendCupcakeHtml(cupcake) {\n let html = `\n <li>\n Flavor:${cupcake.flavor}, \n Rating: ${cupcake.rating}, \n Size: ${cupcake.size}\n </li>\n <img src=${cupcake.image}><img>\n `;\n $updateCupcakeList.append(html);\n}", "async ...
[ "0.70023316", "0.68733466", "0.6830285", "0.6762316", "0.6643639", "0.65214336", "0.65027267", "0.6493298", "0.6473084", "0.64505863", "0.63219684", "0.6290712", "0.58831215", "0.57692075", "0.5597494", "0.5576444", "0.5563202", "0.55607176", "0.5525044", "0.5514034", "0.5389...
0.8008406
0
This function does what its name implies, creates HTML for a given cupcake. It creates a list element,a button for deleting, and an image to hold the img of the cupcake
function createHTML(cupcake) { const cupcakeHTML = $(` <div class="card col-3 m-3 card-${cupcake.id}"> <h1 class="text-center">${cupcake.flavor}</h1> <img src="${cupcake.image}" class="card-img-top" id="cupcake-image"> <div class="card-body d-flex justify-content-center flex-column"> <h3>Size: <span class="h3-size ms-2">${cupcake.size}</span></h3> <h3>Rating: <span class="h3-rating ms-2">${cupcake.rating}</span></h3> <div class="d-flex flex-row"> <button class="btn btn-sm btn-success ms-2" id="edit-btn-${cupcake.id}" data-id="${cupcake.id}">Edit</button> <button class="btn btn-sm btn-danger ms-2" id="del-btn-${cupcake.id}" data-id="${cupcake.id}">X</button> </div> </div> </div> `); return cupcakeHTML; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateCupcakeHTML(cupcake) {\r\n return `\r\n <div data-cupcake-id=${cupcake.id}>\r\n <li>\r\n ${cupcake.flavor} / ${cupcake.size} / ${cupcake.rating}\r\n <button class=\"delete-button\">X</button>\r\n </li>\r\n <img class=\"Cupcake-img\"\r\n src=\"${cupcake.i...
[ "0.77532405", "0.767045", "0.62606305", "0.6174829", "0.6156835", "0.60523254", "0.60271835", "0.5993952", "0.5938058", "0.5921592", "0.58983594", "0.5883417", "0.588202", "0.58751285", "0.5870688", "0.58662444", "0.5864301", "0.58614475", "0.58340585", "0.58247584", "0.58226...
0.7386581
2
this is a function we use for creating a cupcake. This createCupcake function calls the createCupcake method of the CupcakeList class and passes in the values from our form. We then call the loadCupcakes function again to load the page with the newly created cupcake
async function createCupcake() { let flavor = $flavor.val(); let size = $size.val(); let rating = $rating.val(); let image = $ccImage.val(); let newCupcake = {flavor,size,rating,image} await CupcakeList.createCupcake(newCupcake) await loadCupcakes(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function makeCupcake() {\n\t// Get values\n\tconst flavor = $('#flavor').val();\n\tconst size = $('#size').val();\n\tconst rating = $('#rating').val();\n\tconst image = $('#image').val() ? $('#image').val() : null;\n\t// API POST Request\n\tif (image !== null) {\n\t\tconst response = await axios.post(BASE_UR...
[ "0.7346524", "0.685683", "0.6635601", "0.632516", "0.62356895", "0.62309295", "0.58870226", "0.58545685", "0.5793856", "0.57675123", "0.5728257", "0.5715081", "0.56606233", "0.5653223", "0.5548992", "0.54937255", "0.5357425", "0.53390926", "0.5289341", "0.52825797", "0.523701...
0.7673387
0
This function does what its name implies, deletes a given cupcake It calls the deleteCupcake method of class CupcakeList and stores the updated CupcakeList object into the global cupcakes variable so we have an updated frontend object list to work with without making another get request.
async function deleteCupcake() { let $id = $(this).data('id'); let response = await CupcakeList.deleteCupcake($id,cupcakes); cupcakes = response; console.log(cupcakes) $(this).parent().parent().parent().remove(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function loadCupcakes() {\r\n let response = await CupcakeList.getCupcakes();\r\n cupcakes = response;\r\n console.log(cupcakes)\r\n $cupcakeList.empty();\r\n\r\n for (let cc of cupcakes.cupcakes) {\r\n console.log(cc)\r\n const html = createHTML(cc);\...
[ "0.64524615", "0.58138084", "0.5637916", "0.5599224", "0.54098934", "0.53802365", "0.5373107", "0.53454834", "0.53035015", "0.5276876", "0.5218314", "0.51598454", "0.5117401", "0.50604266", "0.5028493", "0.5021291", "0.5000801", "0.49943683", "0.49820977", "0.49787343", "0.49...
0.8137888
0
to reset all boxes after all filled
function reset() { for (var i = 1; i <= 9; i++) { document.getElementById('box' + i).innerHTML = ""; } // turn.innerHTML="X-turn" x.style.background = "green"; x.style.color="#fff" o.style.background = "#fff"; o.style.color="#000"; count = 1; //set the value of count to 1 after reset }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetGame() {\n // Clear the main boxes and the minimap boxes\n for(var rIndex = 0; rIndex < NUM_ROWS; rIndex++) {\n for(var cIndex = 0; cIndex < NUM_COLS; cIndex++) {\n // Clear main boxes\n boxes[rIndex][cIndex].classList.remove(xClass, oClass);\n ...
[ "0.75381696", "0.73891705", "0.738151", "0.73590696", "0.73221654", "0.73040706", "0.71595556", "0.71354365", "0.7122732", "0.7103897", "0.71007913", "0.7097022", "0.7090489", "0.7086114", "0.70860475", "0.7076454", "0.7058642", "0.7058642", "0.7049226", "0.70392424", "0.7003...
0.6835746
36
A streetview gets loaded for each marker upon a click
function getStreetView(data, status) { if (status == google.maps.StreetViewStatus.OK) { var nearStreetViewLocation = data.location.latLng; var heading = google.maps.geometry.spherical.computeHeading( nearStreetViewLocation, marker.position); var panoramaOptions = { position: nearStreetViewLocation, pov: { heading: heading, pitch: 30 } }; var panorama = new google.maps.StreetViewPanorama( document.getElementById('pano'), panoramaOptions); } else { infowindow.setContent('<div>' + marker.title + '</div>' + '<div>No Street View Found</div>'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadMap(){\n var fenway = {lat: 42.345573, lng: -71.098326};\n \n const map = this.map = new google.maps.StreetViewPanorama(\n document.getElementById('street-view'), {\n position: fenway\n \n });\n }", "function initMap() {\n // Constructor creates a new map - only ...
[ "0.7010471", "0.69724476", "0.6891523", "0.6786451", "0.67828614", "0.6757561", "0.668425", "0.6681528", "0.6676856", "0.66703945", "0.664944", "0.66344696", "0.6634468", "0.6628166", "0.6620713", "0.66052043", "0.65706676", "0.65585935", "0.652304", "0.65160793", "0.6514925"...
0.6221404
91
Extension of EventEmitter that represents an offset in a Place heirarchy. Stores references to all child nodes in the heirarchy.
function OffsetEventEmitter() { EventEmitter.call(this); this._children = {}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PlaceEventEmitter() {\n this._root = new OffsetEventEmitter();\n}", "function offsetTree(t, offset, offsetFunction) {\n for (var i = 0; i < t.length; i++) {\n var offsetpaths = offsetFunction(t[i], offset);\n if (offsetpaths.length == 1) {\n // replace array items in place\n...
[ "0.6935553", "0.51984113", "0.5137182", "0.50804555", "0.5039342", "0.49131727", "0.47989413", "0.4793834", "0.4783685", "0.47726554", "0.47673708", "0.46785817", "0.46739691", "0.46738926", "0.46738812", "0.46596697", "0.4644038", "0.46140343", "0.4613553", "0.4611032", "0.4...
0.69467854
0
Wrapper around OffsetEventEmitter to allow for listening and firing on instances of Place. Not an extension of EventEmitter, so not all of the original methods are necessarily supported.
function PlaceEventEmitter() { this._root = new OffsetEventEmitter(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OffsetEventEmitter() {\n EventEmitter.call(this);\n this._children = {};\n}", "function EventEmitter(){}// Shortcuts to improve speed and size", "function EventEmitter() {} // Shortcuts to improve speed and size", "function LokiEventEmitter() {}", "function LokiEventEmitter() {}", "function Lo...
[ "0.7669674", "0.6133002", "0.60935825", "0.6057339", "0.6057339", "0.5927509", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "...
0.8410292
0
Load the Google Analytics client library
function queryAccounts() { gapi.client.load('analytics', 'v3').then(function() { gapi.client.analytics.management.accounts.list().then(handleAccounts); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadGoogleAnalytics() {\n (function (i, s, o, g, r, a, m) {\n i['GoogleAnalyticsObject'] = r;\n i[r] = i[r] || function () {\n (i[r].q = i[r].q || []).push(arguments);\n }, i[r].l = 1 * new Date();\n a = s.createElement(o), m = s.getElementsByTagName(o)[0];\n a.async = 1;\n a.src =...
[ "0.723606", "0.70999223", "0.70138323", "0.6891897", "0.6887332", "0.67694545", "0.6648956", "0.64875066", "0.64681953", "0.64357466", "0.6371802", "0.6335416", "0.62964493", "0.6280137", "0.62377876", "0.6216007", "0.621135", "0.6210494", "0.61803883", "0.6161596", "0.616008...
0.0
-1
Insert User in Google Analytics Accounts
function insertUser() { var profiledata; var email = document.getElementById('email'); //Email Input Field var id = document.getElementById('account-id'); //Account ID input Field if( email.value == '' || id.value == '' ){ alert('Please fill out the field!!'); return; } else { var request = gapi.client.analytics.management.webproperties.list({ 'accountId': id.value }) request.execute(function (response) { if(response.code == 400 || response.code == 403 || response.code == 500){ alert('Invalid'); return; } else { profiledata = response; if (profiledata.result.items && profiledata.result.items.length) { var propertyId = profiledata.result.items[0].id; var accountId = id.value; var profileId = profiledata.result.items[0].defaultProfileId; var request = gapi.client.analytics.management.profileUserLinks.insert({ 'accountId': accountId, 'webPropertyId': propertyId, 'profileId': profileId, 'resource': { 'permissions': { 'effective': [ 'COLLABORATE', 'READ_AND_ANALYZE' ], 'local': [ 'COLLABORATE', 'READ_AND_ANALYZE' ] }, 'userRef': { 'email': email.value } } }); request.execute(function (response) { if(response.code == 400 || response.code == 403 || response.code == 500){ console.log(response); alert('Invalid'); return; } else { alert('User has been added succesfully'); console.log(response); return; } }); } } }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addUser() {\n var user = {\n primaryEmail: 'liz@example.com',\n name: {\n givenName: 'Elizabeth',\n familyName: 'Smith'\n },\n // Generate a random password string.\n password: Math.random().toString(36)\n };\n user = AdminDirectory.Users.insert(user);\n Logger.log('User %s cr...
[ "0.6451452", "0.6419818", "0.6313721", "0.6161532", "0.61206234", "0.6060208", "0.6040147", "0.6021", "0.5988509", "0.59821326", "0.5913855", "0.5874089", "0.5868384", "0.5868384", "0.5868341", "0.5867974", "0.5854902", "0.58396184", "0.5795388", "0.57788146", "0.5764151", ...
0.6815875
0
Init line chart button listeners
initLineChartButtons() { // add the Line chart buttons to the feature panel for (let i = 0; i < this.swarm_features.length; i++) { let capitalized_feature_string = this.swarm_features[i].split('_').join(' '); capitalized_feature_string = capitalized_feature_string.charAt(0).toUpperCase() + capitalized_feature_string.slice(1); $('#line-chart-feature-checkboxes') .append('<tr><th> <div class="pretty p-switch p-fill p-bigger"><input type="checkbox" class="line-chart-check-box" id="draw-' + this.swarm_features[i] + '" data="#' + this.swarm_features[i] + 'Line" /><div class="state"><label>' + capitalized_feature_string + '</label></div></div></th></tr>'); } $('.line-chart-check-box').change(function() { let checkbox = $(this); if (checkbox.prop('checked')) { $(checkbox.attr('data')).show(); } else { $(checkbox.attr('data')).hide(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SVGLineChart() {\r\n }", "_addEventsXAxis(btnDecrease, btnIncrease){\n $(btnDecrease).click(() => { this.zoomXAxis(false); });\n $(btnIncrease).click(() => { this.zoomXAxis(true); });\n }", "function initLine() {\n console.log(\"Initializing line chart...\");\n\n // Get current pdf dat...
[ "0.6141154", "0.60903716", "0.6055163", "0.5978363", "0.5973254", "0.5958651", "0.5955628", "0.5910048", "0.5902986", "0.58939797", "0.5872552", "0.5857542", "0.58491594", "0.5827673", "0.5817656", "0.581118", "0.5796051", "0.5764969", "0.5758807", "0.57560277", "0.5739931", ...
0.67187685
0
Function to do text to speech
function synthVoice(text) { const synth = window.speechSynthesis; const utterance = new SpeechSynthesisUtterance(); utterance.text = text; synth.speak(utterance); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function texttospeech(textinput){\n // make it audioble using text to speech API - SpeechSynthesis\n var msg = new SpeechSynthesisUtterance(textinput);\n //msg.lang = 'en-US';\n msg.lang = select_dialect.value;\n \n window.speechSynthesis.speak(msg);\n msg.onend = function(e) {\n console....
[ "0.8181406", "0.81332964", "0.79626274", "0.78283453", "0.7802613", "0.75878954", "0.7458771", "0.7454734", "0.74527", "0.74448675", "0.73685783", "0.73363554", "0.7334401", "0.731504", "0.73092526", "0.7304495", "0.72811794", "0.7266842", "0.7246536", "0.72378933", "0.723596...
0.7294766
16
Handle the press of the next button.
nextPressed(){ //Update the user info object with the information on the lat and longs this.props.userInfo.homeLat = this.state.markerLat; this.props.userInfo.homeLong = this.state.markerLong; //Move on to the transport type page (passing the userinfo object) Actions.TransportType({userInfo: this.props.userInfo}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_nextButtonClickHandler() {\n const that = this;\n\n that.next();\n }", "function onNext() {\n\n\t\tif (step < 3) {\n\t\t\tdispatch(INCREMENT_STEP());\n\t\t}\n\n\t\t// update button state\n\t\tsetBackButtonDisabled(false);\n\t}", "function handleNext(e){\n if (chapterArray[currentChapterIndex...
[ "0.81973", "0.78442276", "0.7823173", "0.75852627", "0.75563633", "0.7535408", "0.75259036", "0.7436728", "0.74147516", "0.73893315", "0.7380784", "0.73127246", "0.72318184", "0.714882", "0.7146532", "0.71094126", "0.7106592", "0.70834196", "0.70612025", "0.705877", "0.704045...
0.0
-1
/ ObjectObserver provides concrete observer independent source and target synchronization / functionality for a particular object source with related user interface / interactive capabilities. / ObjectObserver extends from ActivityObserver and for information about activity / functions refer here.
function ObjectObserver(options) { var instance = (options.instance !== null && options.instance !== undefined) ? options.instance : this; var extender = new InstanceExtender(); instance = extender.extendFieldObserver({ 'instance': instance, 'field': 'InputObject', 'observer': options.observer }); instance = extender.extendFieldObserver({ 'instance': instance, 'field': 'OutputObject', 'observer': options.observer }); if (options.observer !== null && options.observer !== undefined) { if (typeof (options.observer) === "string") { //select and initializes observer. if (options.observer === "kn") { instance.Observer = new ObjectKNObserver(options); } } else { //if observer is provided it is selected. instance.Observer = options.observer; } } else { //if observer is not provided a default observer is initialized and selected. instance.Observer = new ObjectKNObserver(options); } if (options.instance === null || options.instance === undefined) { instance = extender.extendNewInstance({ 'instance': instance, 'newparameter': instance.Observer, 'options': options}); } instance = extender.extendContentObserver({'instance': instance, 'observer': instance.Observer }); instance = extender.extendObserverInterface({'instance': instance, 'observer': instance.Observer }); //extend from activity observer instance = ActivityObserver({'instance': instance, 'observer': instance.Observer}); /// <summary>Gets the type of the function construct.</summary> instance.getType = function () { return "ObjectObserver"; }; /// <summary>Sets form observer object with optional original key.</summary> instance.setFormObject = function (data) { instance.getObserver().setFormObject(data); }; /// <summary>Gets form object.</summary> instance.getFormObject = function () { return instance.getObserver().getFormObject(); }; /// <summary>Gets observable form object.</summary> instance.getObservableFormObject = function () { return instance.getObserver().getObservableFormObject(); }; /// <summary>Gets form's stringified JSON object.</summary> instance.getFormStringifiedObject = function () { return instance.getObserver().getFormStringifiedObject(); }; /// <summary>Gets form's JSON object.</summary> instance.getFormJSONObject = function () { return instance.getObserver().getFormJSONObject(); }; /// <summary>Validate form object.</summary> instance.validateFormObject = function () { return instance.getObserver().validateFormObject(); }; /// <summary>Resets form object and view mode.</summary> instance.resetForm = function () { instance.getObserver().resetForm(); }; if (options.instance !== null && options.instance !== undefined) { return Object.create(instance); } return instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Observer() {}", "function Observer() {\n this.update = function () {\n // /* ... */\n };\n}", "function Observer(){\n this.update = function(){\n // ...\n };\n}", "function ObserverSet(hostObject) {\n\t\tvar _observers = {};\n\t\t/** .add registers a *property name*, to notify an *...
[ "0.6643939", "0.6363023", "0.635718", "0.62948453", "0.6239872", "0.62268287", "0.61886686", "0.6037796", "0.6037796", "0.6008519", "0.5995865", "0.5980973", "0.5956034", "0.5950164", "0.58681566", "0.5849587", "0.5827112", "0.58248043", "0.5750588", "0.56799453", "0.56287414...
0.73092365
0
Demo 1. VisualBlock (selection + insert) 2. Selection + Commands :'norm A;
function Stuff() { var foo = 1 var bar = 'a' var me = 'm' var foobar = foo + bar + me }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cxcommand(event, val) {\n\n if (val === undefined) val = event.currentTarget.id;\n\n var diagram = myDiagram;\n let nodeArray = diagram.findPartAt(diagram.toolManager.contextMenuTool.mouseDownPoint, false).Ud;\n switch (val) {\n case \"cut\": diagram.commandHandler.cutSelection(); break...
[ "0.57468754", "0.5725755", "0.55267805", "0.5523348", "0.54878247", "0.5474703", "0.54729706", "0.54729706", "0.54729706", "0.5450901", "0.54365885", "0.54100114", "0.5386975", "0.5386975", "0.5369358", "0.53533083", "0.5340448", "0.5322874", "0.5317607", "0.5278826", "0.5277...
0.0
-1
Sets node data when the component mounts.
componentDidMount() { this.setNodeData(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assignData(node, data) {\n node.__data__ = data;\n}", "setNodeData() {\n const curNode = this.props.node;\n this.setState({\n ref: curNode.getRef(),\n fetching: true,\n asserts: [],\n invAsserts: [],\n elemClass: '',\n });\n\n API.getElemClass(curNode).then((elemC...
[ "0.6853854", "0.6525394", "0.6380003", "0.58837354", "0.5823948", "0.58108044", "0.5785606", "0.5751807", "0.5751807", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0....
0.7599304
0
Loads data to display for the node passed in through props. This includes fetching the remote data from DC KG for the node.
setNodeData() { const curNode = this.props.node; this.setState({ ref: curNode.getRef(), fetching: true, asserts: [], invAsserts: [], elemClass: '', }); API.getElemClass(curNode).then((elemClass) => { this.setState({elemClass: elemClass}) }); curNode.fetchRemoteData().then(() => { this.setState({ asserts: curNode.assertions, invAsserts: curNode.invAssertions, fetching: false, }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadData() {\n fetch(postLink)\n .then(e => e.json())\n .then(showData);\n}", "fetchData() {\n this.initLoading();\n this.setAndGetInstanceFromSandBox(this.view, this.qs_url).then(instance => {\n this.setLoadingSuccessful();\n th...
[ "0.63887864", "0.62658745", "0.6116985", "0.6116985", "0.6087423", "0.6078085", "0.60705453", "0.60364324", "0.60280925", "0.60215825", "0.5931188", "0.5851568", "0.5842261", "0.5831163", "0.582115", "0.5817434", "0.5814318", "0.57825", "0.5770251", "0.57541513", "0.573615", ...
0.5885292
11
Renders the DisplayNode component.
render() { return ( <div> <br/> <h1 className='inline'>Currently Viewing: </h1> <span title={colorLegend[this.state.elemClass]}> <h1 className={'inline ' + this.state.elemClass}>{this.state.ref}</h1> </span> <br/> <LoadingSpinner loading={this.state.fetching} msg='...fetching triples...'/> <br/> <h3 className='inline padded'>Node Properties</h3> <p className='inline'> - current node is source</p> <br/> <TriplesTable triples={this.state.asserts} inverse={false} goToId={this.props.goToId}/> <br/> <h3 className='inline padded'>Incoming Properties from Other Nodes</h3> <p className='inline'> - current node is target</p> <br/> <TriplesTable triples={this.state.invAsserts} inverse={true} goToId={this.props.goToId}/> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "displayScene() {\n // entry point for graph rendering\n //TODO: Render loop starting at root of graph\n //console.log(this.nodes)\n this.components[this.idRoot].display();\n }", "displayScene() {\n\n //Process all component nodes\n this.processNode(this.idRoot, null, ...
[ "0.6781303", "0.6655281", "0.6471556", "0.63667333", "0.635982", "0.635937", "0.6335179", "0.6240191", "0.622651", "0.62119114", "0.62117696", "0.61996084", "0.6193583", "0.6189599", "0.6164148", "0.61471826", "0.6103389", "0.60972273", "0.6088896", "0.60766846", "0.6046236",...
0.0
-1
tht function will get the arguments before destructuring see the difference below
function add() { var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, _ref2$x = _ref2.x, x = _ref2$x === undefined ? 1 : _ref2$x, _ref2$y = _ref2.y, y = _ref2$y === undefined ? 2 : _ref2$y; //the process below run like this: //first get arugments ,but in this case ,the aruments is null ,so it gets nothing //then destructuring the default,({x = 1, y = 2} = {}), //it means let x = 1;let y = 2; return x + y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $t(t,e){Object.keys(t).forEach(function(n){return e(t[n],n)})}", "function boo({first=\"10\", second=\"true\"}) {\n\n}", "function myFunc(...opts) {\n let t = opts[0];\n}", "function f1(t) {\n var {...a} = t;\n return a;\n}", "function f3(t) {\n var a, rest;\n ({a, ...rest} = t);\n}...
[ "0.60052025", "0.59543365", "0.5931069", "0.5901413", "0.5858622", "0.5728245", "0.5723525", "0.57099426", "0.57094055", "0.5687095", "0.56847155", "0.5638061", "0.5539837", "0.55193925", "0.55153036", "0.5504558", "0.54962385", "0.549054", "0.54818654", "0.5476089", "0.54422...
0.0
-1
FUNCTION CHANGE BACKGROUND IMAGE FIRST MENU
function changeImage(){ if (a>=30){ a=1; } var stringURL = "MEDIA/IMAGES/Best_Shots/" + a + ".jpg"; imagenFondo.style.backgroundImage="url('" + stringURL + "')"; a+=1; setTimeout(function(){changeImage();},8000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function background()\n {\n var images =\n [\n './menuJapanBG.gif',\n './menuJapanBG2.gif',\n './menuJapanBG3.gif',\n './menuSpaceBG4.gif',\n './menuSpaceBG5.gif',\n './menuOPMerryBG6.gif',\n ];\n\n var randomImage = M...
[ "0.6935859", "0.66484636", "0.6559671", "0.6503491", "0.64723575", "0.6451667", "0.64357305", "0.6414318", "0.63924176", "0.6323575", "0.632252", "0.6309622", "0.6304023", "0.6293899", "0.62816525", "0.6264104", "0.62595457", "0.6252126", "0.62521183", "0.6240928", "0.6229405...
0.0
-1
Use Yarn if available, it's much faster than the npm client. Return the version of yarn installed on the system, null if yarn is not available.
function getYarnVersionIfAvailable() { let yarnVersion; try { // execSync returns a Buffer -> convert to string yarnVersion = ( execSync('yarn --version', { stdio: [0, 'pipe', 'ignore'], }).toString() || '' ).trim(); } catch (error) { return null; } return yarnVersion; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUpdateCommand() {\n if (YARN_INSTALL_METHOD === 'tar') {\n return 'curl -o- -L https://yarnpkg.com/install.sh | bash';\n }\n\n if (YARN_INSTALL_METHOD === 'homebrew') {\n return 'brew upgrade yarn';\n }\n\n if (YARN_INSTALL_METHOD === 'deb') {\n return 'sudo apt-get update && sudo apt-get...
[ "0.6483819", "0.626947", "0.5778673", "0.5402558", "0.53739995", "0.53731817", "0.5348117", "0.5348117", "0.5253786", "0.51260597", "0.5035994", "0.49301445", "0.48574874", "0.48516303", "0.48436052", "0.48392144", "0.48259783", "0.47912624", "0.4769956", "0.47394714", "0.462...
0.86356133
0
When a user successfully logs in, this function updates the `user` property in state to that particular user
onLoggedIn(authData) { console.log('Auth Data User', authData.user); this.setState({ user: authData.user }); localStorage.setItem('token', authData.token); localStorage.setItem('user', JSON.stringify(authData.user)); localStorage.setItem('favoriteMovies', authData.user.FavoriteMovies); window.location.pathname = '/'; this.getMovies(authData.token); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "authenticate(user) {\n\t\tthis.setState({\n\t\t\tuser: user\n\t\t});\n\n\t\t// updating user's details\n\t\tlocalStorage.setItem(config.localStorageKey, JSON.stringify(user));\n\t}", "updateUser(userObject) {\n this.setState(userObject);\n console.log(\"state changed for user but not propgated \" + this.st...
[ "0.7474876", "0.7374913", "0.72785753", "0.71775514", "0.7150576", "0.71292275", "0.711933", "0.7117941", "0.7104763", "0.7096332", "0.7087405", "0.70682013", "0.706351", "0.70008224", "0.69604653", "0.68995374", "0.68968594", "0.68622303", "0.68582445", "0.68509525", "0.6828...
0.0
-1
make a GET request to heroku.
getMovies(token) { axios .get('https://kumi-movie-index.herokuapp.com/movies', { headers: { Authorization: `Bearer ${token}` } }) .then(response => { // #1 this.props.setMovies(response.data); }) .catch(function (error) { console.log(error); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function http_get(req_url){\n request.get(\n bal_query,\n function(error, response, body) {\n console.log(\"Clickatell GET:\")\n node.send(\"Clickatell GET:\");\...
[ "0.6763127", "0.6589341", "0.65172577", "0.64695376", "0.6399705", "0.63736755", "0.63736755", "0.63736755", "0.63736755", "0.63736755", "0.6349234", "0.6338461", "0.6289691", "0.62016225", "0.61545515", "0.610552", "0.60756874", "0.60604453", "0.6045518", "0.6045518", "0.603...
0.0
-1
When a movie is clicked, this function is invoked and updates the state of the `selectedMovie` property to that movie
onMovieClick(movie) { this.setState({ selectedMovie: movie, }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setSelectedMovie(movie) {\n this.setState({\n selectedMovie: movie\n });\n }", "selectedMovie(movie) {\n // Display selected movie\n this.displaySingleMovie(movie)\n }", "selectMovie(id) {\n this.movieById(movie => {\n this.selectedMovie(movie)\n }, id)\n ...
[ "0.7750631", "0.7736081", "0.7163471", "0.67256916", "0.6488958", "0.64247245", "0.6397385", "0.63854253", "0.6332612", "0.6308762", "0.63058543", "0.6278801", "0.6277684", "0.62595034", "0.6229581", "0.62176365", "0.6200571", "0.6186401", "0.6181037", "0.61073023", "0.609806...
0.8339763
0
If there is a table at any of the affected pixels return false
function overlaps (xCord, yCord, size) { for (i = 0; i < size; i++) { for (j = 0; j < size; j++) { if (!currentMap[yCord + i][xCord + j] == 0) { return true } } } return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isConflict(){\n let conflict = false; \n if( this.x < 0 || (this.x + this.width )> this.tableWidth ) conflict=true;\n if( (this.y - this.height + 1) < 0 ) conflict=true;\n if(conflict) this.undo();\n }", "function checkOccupied(cell){\n if(cell.querySelector(\"img\")) return true;\n else re...
[ "0.6437961", "0.6231199", "0.6218072", "0.62143695", "0.6204761", "0.6143639", "0.61342883", "0.6094799", "0.60892373", "0.6084203", "0.6016757", "0.5995122", "0.5964048", "0.59461534", "0.587144", "0.5869155", "0.58678436", "0.58664525", "0.58664525", "0.5850165", "0.5800257...
0.0
-1
Adds a table of size "size" at "xCord","yCord" with id "id" then redraws the map
function addTable (xCord, yCord, size, id) { for (i = 0; i < size; i++) { for (j = 0; j < size; j++) { if (yCord + i < dimension && xCord + j < dimension) { currentMap[yCord + i][xCord + j] = id } } } draw(currentMap) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapResize(newSize){\r\n\r\n // Get current position\r\n var map_x = unsafeWindow.mapX;\r\n var map_y = unsafeWindow.mapY;\r\n var map_s = unsafeWindow.mapSize;\r\n\r\n // Calculate new X and Y\r\n var delta = parseInt((map_s - newSize) / 2);\r\n\r\n // Overwrite values\r\n ...
[ "0.65854883", "0.63076633", "0.6164537", "0.615061", "0.60348946", "0.6024019", "0.5992851", "0.5977376", "0.5976345", "0.5932729", "0.5929121", "0.58895046", "0.5881419", "0.5801246", "0.57981557", "0.5783472", "0.5775159", "0.577508", "0.577232", "0.57554066", "0.5744306", ...
0.8765483
0
Converts 2Darray to String for database storage
function mapToString (map) { var jsonString = '' map.forEach(function (row) { jsonString += JSON.stringify(row) + '|' }) return jsonString }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function serialize_array_2d(arr) {\n// {{{\n\tvar str='';\n\tvar i = 0;\n\tstr += '' + arr[i][0];\n\tfor (var j = 1; j < arr[i].length; ++j) {\n\t\tstr += ',' + arr[i][j];\n\t}\n\n\tfor (var i = 1; i < arr.length; ++i) {\n\t\tstr += '|';\n\t\tstr += '' + arr[i][0];\n\t\tfor (var j = 1; j < arr[i].length; ++j) {\n\...
[ "0.76576245", "0.6971339", "0.68766296", "0.6825946", "0.67475617", "0.6708025", "0.6658892", "0.66103774", "0.6514228", "0.64866453", "0.64840454", "0.64628834", "0.6404085", "0.63432866", "0.6264638", "0.6248481", "0.6239691", "0.619287", "0.61865664", "0.6184741", "0.61753...
0.0
-1
Reverses the conversion for database retrieval
function stringToMap (mapString) { var array = mapString.toString().split('|') var map = [] var i = 0 array.forEach(function (row) { map[i] = (row.substring(1, row.length - 1)).split(',') i++ }) return map }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reverseConvert() {\n\n }", "inverse() {\n this.transformType = 'inversed';\n const rgbValues = [...this.colorTable].map(a => {\n return [a.slice(0, 2), a.slice(2,4), a.slice(4, 6)].map(b => {\n const rgbValue = (255 - parseInt(b, 16)).toString(16);\n return rgbValue.length === 1 ? `0$...
[ "0.7745531", "0.6292661", "0.6172164", "0.6052386", "0.60404193", "0.603734", "0.5937914", "0.59252733", "0.59230417", "0.58855826", "0.5844509", "0.58030623", "0.57887006", "0.56212085", "0.56128436", "0.5587698", "0.55811447", "0.5567177", "0.5548188", "0.5546536", "0.55304...
0.0
-1
get popular films from API DB
async fetchPopularFilms() { let popularFilms = 'trending/movie/week?'; try { const response = await axios.get( BASE_URL + popularFilms + API_KEY + '&language=en-US&page=' + `&page=${this.localService.getPaginationPage()}`, ); this.localService.setLocalTotalCards(response.data.total_results); this.localService.setPaginationPage(response.data.page); return response.data; } catch (error) { return error; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getAllFilms() {\n const responseData = await fetch(\"https://ghibliapi.herokuapp.com/films\");\n\n const response = await responseData.json();\n\n return response;\n }", "function getPopularMovies(){\n var url = \"https://api.themoviedb.org/3/movie/popular?api_key=\" + api_key + \"&language=fr\"...
[ "0.7264159", "0.6814281", "0.67827076", "0.651927", "0.63706785", "0.6318846", "0.6297376", "0.62494904", "0.6239027", "0.61255807", "0.6123391", "0.6102843", "0.60699", "0.60353565", "0.6029459", "0.60192186", "0.5958336", "0.595364", "0.5898756", "0.5896913", "0.5889747", ...
0.77615607
0
get searched movies by name(query)
async fetchQueriedFilms() { try { const response = await axios.get( // need to verify request's url (url ok) BASE_URL + this.endPoint + API_KEY + '&language=en-US&page=' + `${this.localService.getPaginationPage()}&query=${this.query}`, ); return response.data; } catch (error) { return error; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static search(query, callback) {\n const path = `/?type=movie&s=${query}`;\n\n return makeOmdbRequest(path, (err, response) => {\n if(response) {\n // If there was no error, only return the movies array\n response = response.Search;\n }\n\n callback(err, response);\n });\n }"...
[ "0.76910764", "0.7593642", "0.73987556", "0.7372445", "0.72973067", "0.7281578", "0.7260962", "0.7255223", "0.7186294", "0.7126738", "0.71258336", "0.712157", "0.6943218", "0.6934262", "0.6927708", "0.6858158", "0.6839239", "0.68186855", "0.6815793", "0.67871207", "0.6786041"...
0.0
-1
============fetch film by ID============
async fetchFilmById() { try { const response = await axios.get( `${BASE_URL}movie/${this.movieId}?${API_KEY}&language=en-US`, ); return response.data; } catch (error) { return error; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async findById(id) {\n return Film.findById(id);\n }", "async function getMovieInfo(id) {\n let response = await fetch('https://swapi.dev/api/films/');\n let json = await response.json();\n let selectedFilm;\n json.results.forEach((film) => {\n if (film.episode_id == id) {\n selectedFilm = ...
[ "0.7347444", "0.73301363", "0.7255389", "0.7101248", "0.7083853", "0.7045656", "0.7039282", "0.6974049", "0.6932695", "0.6926925", "0.6774918", "0.6694562", "0.6688595", "0.6535794", "0.65275955", "0.65091807", "0.6498809", "0.648325", "0.6456127", "0.6449105", "0.643445", ...
0.6900725
10
================fetch trailer by ID==============
async fetchTrailerById() { try { const response = await axios.get( `${BASE_URL}movie/${this.movieId}/videos?${API_KEY}&language=en-US`, ); return response.data.results; } catch (error) { return error; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTrailer(mID, cb) {\n return $.ajax({\n type: 'GET',\n url: '/api/trailer',\n data: {\n id: mID\n },\n dataType: 'json',\n success: function(data) {\n cb(data.result);\n },\n error: function(err) {\n cb(null);\n currentTrailer = null;\n console.log(err.r...
[ "0.71374357", "0.66372436", "0.65327764", "0.618922", "0.6118345", "0.6107566", "0.6033754", "0.602162", "0.6006127", "0.5993829", "0.5944225", "0.59165883", "0.59071666", "0.5898653", "0.5877318", "0.5862976", "0.5845037", "0.5840162", "0.5780638", "0.57175267", "0.5688476",...
0.7265544
0
Only change code below this line
function urlSlug(title) { var arrTitle = [...title]; var newTitle = ''; for(let i=0;i<arrTitle.length;i++){ newTitle = newTitle + (arrTitle[i]); } return newTitle .split(/\W/) .filter(obj => { return obj !== ""; }) .join("-") .toLowerCase(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected internal function m252() {}", "private internal function m248() {}", "private public function m246() {}", "transient private protected internal function m182() {}", "transient final protected internal function m174() {}", "transient private internal function m185() {}", "transient protected i...
[ "0.68709457", "0.67526597", "0.65493727", "0.6521837", "0.6354909", "0.6270197", "0.62660617", "0.61954707", "0.5806521", "0.5790502", "0.5773313", "0.575885", "0.57579", "0.57178414", "0.5706308", "0.56971264", "0.56926125", "0.56757665", "0.56499755", "0.56336206", "0.56300...
0.0
-1
TeamDetailController Team Detail controller use detail.html view
function TeamDetailController($scope, $timeout, $stateParams, RestFul) { if (!$stateParams.ud) { return; } $scope.teamDetailLoading = true; RestFul.error( {"action": "Account:TeamDetail", "params": {"team": $stateParams.ud}}, function(response) { if (!response) { return; }; if (response.hasOwnProperty('message') && response.hasOwnProperty('data')) { $scope.team = response.data; $timeout(function() { $scope.teamDetailLoading = false; }, 300) } else { $timeout(function() { $scope.teamDetailLoading = false; }, 300) } } ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showTeamDetails(context) {\n context.loggedIn = sessionStorage.getItem('authtoken') !== null;\n context.username = sessionStorage.getItem('username');\n context.teamId = context.params._id.substring(1);\n context.isOnTeam = sessionStorage.getItem('teamId') !== \"undefined\"\n ...
[ "0.6645024", "0.6386735", "0.6361377", "0.594887", "0.5912718", "0.58985436", "0.5890389", "0.57476956", "0.5669936", "0.56580126", "0.56304306", "0.5623452", "0.5599954", "0.5529331", "0.5481744", "0.54762566", "0.5456242", "0.5450122", "0.5447499", "0.5447481", "0.54187036"...
0.66104364
1
Monkey patching filesaver and html2canvas
function monkeyPatch() { return { transform: (code, id) => { const file = path.parse(id).base; // Only one define call per module is allowed by requirejs so // we have to remove calls that other libraries make if (file === 'FileSaver.js') { code = code.replace(/define !== null\) && \(define.amd != null/g, '0') } else if (file === 'html2canvas.js') { code = code.replace(/&&\s+define.amd/g, '&& define.amd && false') } return code } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addPolyfills(){// Polyfill for canvas.toBlob().\nif(!HTMLCanvasElement.prototype.toBlob){Object.defineProperty(HTMLCanvasElement.prototype,'toBlob',{value:function(callback,type,quality){var binStr=atob(this.toDataURL(type,quality).split(',')[1]);var len=binStr.length;var arr=new Uint8Array(len);for(var i=0;i<len;...
[ "0.6206442", "0.58366096", "0.5816326", "0.5688424", "0.5676449", "0.56013495", "0.55822086", "0.5444166", "0.5323304", "0.5279519", "0.5212804", "0.51723444", "0.5165379", "0.5152642", "0.5143034", "0.5131296", "0.512579", "0.51093173", "0.50984883", "0.5091003", "0.5090299"...
0.54754424
7
Rollup removes local variables unless used within a module. This plugin makes sure specified local variables are preserved and kept local. This plugin wouldn't be necessary if es2015 modules would be used.
function rawjs(opts) { opts = opts || {} return { transform: (code, id) => { var variable = opts[id.split('/').pop()] if (!variable) return code var keepStr = '/*rollup-keeper-start*/window.tmp=' + variable + ';/*rollup-keeper-end*/' return code + keepStr }, transformBundle: (code) => { for (var file in opts) { var r = new RegExp(opts[file] + '\\$\\d+', 'g') code = code.replace(r, opts[file]) } var re = /\/\*rollup-keeper-start\*\/.*\/\*rollup-keeper-end\*\//g return code.replace(re, '') } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cleanContextForImports () {\n __define = global.define\n try {\n global.define = undefined\n } catch (_) {\n console.warn('IXO Keysafe - global.define could not be deleted.')\n }\n}", "function pruneExportedFunctions (body, options) {\n var newBody = []\n , wanted = options.wanted\n\n fun...
[ "0.53870076", "0.5314278", "0.5276699", "0.5224326", "0.5140773", "0.5140009", "0.5133236", "0.5044251", "0.49828306", "0.4943855", "0.49427938", "0.49379557", "0.49250337", "0.49080613", "0.48930615", "0.4850101", "0.4823939", "0.4816564", "0.4810062", "0.4808998", "0.479808...
0.43849525
100
middleware allows you to do https
function getJSON(url, callback) { //replacement for $.getJSON https.get(url, (response) => { var body = ''; response.on('data', function(d) { body += d; }); response.on('end', function() { callback(null, JSON.parse(body)); }); }).on('error', function(e) { //e is a common convention for error, which is why the functino is named e callback(e); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function https(ctx, next){\n if (window.location.protocol[4] == 's') return next();\n else window.location.href = format('https://%s', hostname);\n next();\n}", "function checkHttps(req, res, next){\n if(req.get('X-Forwarded-Proto').indexOf(\"https\")!=-1){\n return next()\n } else {\n res.redirect('h...
[ "0.79086655", "0.75939727", "0.7393396", "0.73186237", "0.7176339", "0.6907513", "0.6646805", "0.6548563", "0.64782864", "0.64768726", "0.64257205", "0.6335271", "0.6189638", "0.6168532", "0.6163034", "0.6147502", "0.61321795", "0.60296875", "0.60231704", "0.598694", "0.59574...
0.0
-1
As a user I want to participate into a colormez by clicking on participate button I can go to colorme view
participate(useruid, colormezid) { this.$state.go('colorme', { useruid: useruid, colormezid: colormezid }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function joined(e) {\n userId = e.id;\n $('#controls').show();\n startPrompts();\n}", "getResult(userId, colormezId) {\n this.$state.go('outro');\n }", "function reply() {\r\n var fromWhere = JSON.parse(localStorage.getItem(\"emailToView\")).fromWhere;\r\n if (fromWhere == FROM_ADMIN_INBOX) ...
[ "0.6197418", "0.6117911", "0.5996526", "0.590721", "0.58773685", "0.5848359", "0.5722655", "0.56414956", "0.56211436", "0.5587096", "0.5571765", "0.5542437", "0.5498132", "0.5498008", "0.54924893", "0.5484999", "0.54826796", "0.5481697", "0.54814404", "0.547902", "0.54433036"...
0.75869477
0
As a user I want to see the result of a colormez
getResult(userId, colormezId) { this.$state.go('outro'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUsernameColor(){\n\t\tvar colore;\n\t\tvar nmCasuale = function (){\n\t\t\tvar j = Math.floor( Math.random() * 255);\n\t\t\treturn j;\n\t\t}\n\t\tcolore = \"rgb(\"+nmCasuale()+\",\" +nmCasuale()+ \",\" +nmCasuale()+\")\";\n\t\treturn colore;\n\t}", "function convertColor() {\n var colorEntry =...
[ "0.61485434", "0.6098682", "0.59763724", "0.596199", "0.59580344", "0.59469306", "0.5903203", "0.58860654", "0.5870233", "0.58403987", "0.5826559", "0.5819501", "0.57843626", "0.5783196", "0.57649446", "0.5746544", "0.5746544", "0.5746544", "0.5746544", "0.5746544", "0.574654...
0.5494445
64
hack moved from itemdetails controller end
function toggleProrate() { $scope.isProrate = !$scope.isProrate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onItemSelect(item) {\n // handle action to render the new page!\n\n Actions.editdetails({text: item});\n }", "openItemDetails(item){if(!this._isDetailsOpened(item)){this.push(\"detailsOpenedItems\",item)}}", "function trapItemDetails() {\n\n console.log(GM_info.script.name + ': trapIt...
[ "0.70145565", "0.68789303", "0.6768766", "0.63184226", "0.6291037", "0.61602044", "0.61037314", "0.6078139", "0.6070692", "0.60560954", "0.6024116", "0.60155594", "0.6015305", "0.60104316", "0.5976696", "0.5973291", "0.5960391", "0.59586275", "0.5946677", "0.5944019", "0.5926...
0.0
-1
Functions: Loads list of available website crawlers.
function loadCrawlers(e) { var datalist = document.getElementById('website-crawlers'); var country = $('input[name=country]:checked').val(); var crawlers = { uk: [ 'Yell.com' ], us: [ 'Citysearch.com', 'Yellowpages.com', 'Restaurant.com', 'Tripdavisor.com', 'Yelp.com' ] } var crawler; if (country == 'United States') { crawler = crawlers['us']; } else if (country == 'United Kingdom') { crawler = crawlers['uk']; } if (datalist.hasChildNodes()) { while (datalist.firstChild) { datalist.removeChild(datalist.firstChild); } } for (var i = 0; i < crawler.length; i++) { var option = document.createElement('option'); option.value = crawler[i]; datalist.appendChild(option); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDeslideSupportedSites() {\n return { \n 'about.com': '*.about.com', 'accessatlanta.com': '*.accessatlanta.com', 'answers.com': '*.answers.com', 'aol.com': '*.aol.com', 'askmen.com': '*.askmen.com', 'bleacherreport.com': '*.bleacherreport.com', 'cafemom.com': '*.cafemom.com', 'cbslocal.com': '...
[ "0.59339124", "0.59148914", "0.5872807", "0.58536553", "0.5815739", "0.566842", "0.56557167", "0.5648528", "0.56320465", "0.5626788", "0.56198066", "0.56151825", "0.5570971", "0.55442506", "0.54660624", "0.54622036", "0.545772", "0.5441777", "0.5440059", "0.54212856", "0.5410...
0.7160564
0
Loads location data depending on selected radio button.
function loadLocations(e) { var country = $('input[name=country]:checked').val(); var datalist = document.getElementById('json-locations'); var input = document.getElementById('location'); var req = new XMLHttpRequest(); var jsonUrl = 'https://raw.githubusercontent.com/David-Haim/CountriesToCitiesJSON/master/countriesToCities.json'; var placeholder = 'Loading options...'; if (country == 'United States') { jsonUrl = 'https://raw.githubusercontent.com/David-Haim/CountriesToCitiesJSON/master/countriesToCities.json'; placeholder = 'e.g. New York'; } else if (country == 'United Kingdom') { jsonUrl = 'https://raw.githubusercontent.com/David-Haim/CountriesToCitiesJSON/master/countriesToCities.json'; placeholder = "e.g. Glasgow"; } else { jsonUrl = ''; placeholder = "Couldn't load datalist options..."; } req.onreadystatechange = function(res) { if (req.readyState === 4) { if (req.status === 200) { var json = JSON.parse(req.responseText); var jsonOptions = json[country]; if (datalist.hasChildNodes()) { while (datalist.firstChild) { datalist.removeChild(datalist.firstChild); } } jsonOptions.forEach(function(item) { var option = document.createElement('option'); option.value = item; datalist.appendChild(option); }); input.placeholder = placeholder; } else { input.placeholder = "Couldn't load datalist options..."; } } }; input.placeholder = "Loading options..."; req.open('GET', jsonUrl, true); req.send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setLocationTypeFromSelectedButton() {\n var locationTypeValue = $(\"input[name='locationGroup']:checked\").val();\n\n if (locationTypeValue == 'Centered') {\n locationType = objectLocationEnum.Centered;\n }\n else if (locationTypeValue == 'Random') {\n locationType = objectLocati...
[ "0.64060116", "0.6314692", "0.5714211", "0.56883925", "0.56702596", "0.5663481", "0.5657399", "0.5613464", "0.5580586", "0.55533725", "0.5550602", "0.5527472", "0.5522393", "0.54881865", "0.54725707", "0.5420816", "0.54161906", "0.54078484", "0.5383186", "0.537499", "0.535995...
0.58521175
2
Start scraper function on button click.
function scrapeThis(e) { var categories = $('#category').val().split('\n'); var parameters = { country: $('input[name=country]:checked').val(), location: $('#location').val(), category: '' }; var source = $("#search-results").html(); var dataTemplate = Handlebars.compile(source); results = $('#results') // newAlert("Please Wait!", "We're still scraping..."); for (var i = 0; i < categories.length; i++) { parameters.category = categories[i]; $.get('/searching', parameters, function(data) { if (data instanceof Object) { results.append(dataTemplate({ page: data })); } else { results.append(data); }; showModal(parameters, data.business.length); data.business = filterArray(data.business, filterD121); scrapedData.push(data); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function start(){\n\tautoCompleteSearch();\n\tsubmitButton();\n\tsubmitButtonRandom();\n\tnewSearch();\n\trandomChar();\n\thideCarouselNav();\n}", "function initialize() {\n var element = document.getElementById('test_button');\n if (element) {\n element.onclick = getSkyscraper;\n }\n getSkysc...
[ "0.65427864", "0.6397667", "0.630328", "0.62931603", "0.6190501", "0.59563357", "0.5943898", "0.5915941", "0.5898462", "0.5895757", "0.5863409", "0.58391345", "0.58354515", "0.5759803", "0.5753381", "0.5740157", "0.5735754", "0.5723695", "0.56968147", "0.569484", "0.56813973"...
0.55119276
43
Filter specified array to remove matched values.
function filterArray(data, filters) { var filteredData, predicates = [ function removeNames(data) { for (var i = 0; i < filters.name.length; i++) if (data.name.indexOf(filters.name[i]) != -1) return false; return true; }, function removePhone(data) { for (var i = 0; i < filters.phone.length; i++) if (data.phone.indexOf(filters.phone[i]) != -1) return false; return true; }, function removeCategories(data) { for (var i = 0; i < filters.category.length; i++) if (data.category.indexOf(filters.category[i]) != -1) return false; return true; } ]; if (!filters) { filteredData = data; } else { filteredData = $.grep(data, function(el, index) { for (var i = 0; i < predicates.length; i++) { if (!predicates[i](el)) return false; } return true; }); } return filteredData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function destroyer(arr) {\n\n var args = [].slice.call(arguments);\n args.shift();\n\n arr = arr.filter(function (item) {\n\n for (var i = 0; i < args.length; i++) {\n if (item == args[i]) {\n return false;\n }\n }\n return true;\n\n });\n // Remove all the values\n return arr;\n}",...
[ "0.7574417", "0.7433165", "0.74022347", "0.73726577", "0.7341717", "0.73310256", "0.73045075", "0.7284859", "0.7282253", "0.7273527", "0.7254378", "0.7249966", "0.7208459", "0.7185359", "0.71179324", "0.71144724", "0.71015394", "0.70648265", "0.70500576", "0.7048427", "0.7047...
0.0
-1
Add dynamic alert on page.
function newAlert(header, message) { $("#alert-area").append($("<div class='alert alert-warning alert-dismissible show' role='alert'>" + "<button type='button' class='close' data-dismiss='alert' aria-label='Close'>" + "<span aria-hidden='true'>&times;</span></button>" + "<strong>" + header + "</strong> " + message + "</div>")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertAlertBox() {\n $( 'body' ).append( '<div id=\"alert-container\"></div>' );\n }", "function addAlert(type, msg) {\n var div = document.createElement(\"div\");\n var content = document.createTextNode(msg);\n div.appendChild(content);\n\n var classes = \"alert alert-dismissable \";\n s...
[ "0.7186714", "0.6650776", "0.6647169", "0.66401476", "0.6581142", "0.65043974", "0.64429706", "0.64120877", "0.6397162", "0.6377098", "0.63721734", "0.63676316", "0.63612646", "0.63413566", "0.63305", "0.6327843", "0.6325178", "0.6295787", "0.62591", "0.6252838", "0.6231003",...
0.6415643
7
Show modal with results.
function showModal(parameters, count) { var msg = "Scraped " + count + " " + parameters.category + " from " + parameters.location + "."; $('#scraperModal').modal('show'); $('.modal-msg').text(msg); $(".alert").delay(3000).fadeOut("slow", function() { $(this).first().remove(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showResults(results) {\n resultHead.innerHTML = results[0];\n resultDesc.innerHTML = results[1];\n\n body.classList.add('animated');\n modal.classList.add(results[2]);\n modal.classList.remove('hidden');\n modal.classList.add('slideInLeft');\n}", "function showResults () {\n $('...
[ "0.749011", "0.71826243", "0.71291447", "0.70521724", "0.6952331", "0.6876237", "0.6872094", "0.6848317", "0.68167204", "0.67512393", "0.67352414", "0.67282534", "0.6716301", "0.66508466", "0.663857", "0.65957177", "0.65520453", "0.6546719", "0.6540798", "0.6518099", "0.64950...
0.65969133
15
Clase principal de servidores, aqui nos armara la estructura principal de la vista servidores
function Conexiones() { const [modalShow, setModalShow] = React.useState(false); return ( <div className="Container" id="divServidores"> <Col xs="12"> <Col xs="10"> <h1 className="text-center">CONEXIONES</h1> </Col> <Col xs="12"> <Col xs="2"> <label></label> </Col> <Col xs="8"> <Col xs="8"> <DataTableConexiones/> </Col> <Col xs="4"> <Col xs="6" className="controller-crud"> <ButtonToolbar> <Button className="buttons boutton-crud Agregar" onClick={() => setModalShow(true)}> Agregar </Button> <FuncModalWizard show={modalShow} onHide={() => setModalShow(false)} /> <Button className="buttons boutton-crud Eliminar" id="Eliminar" disabled="disabled" onClick={() => setModalShow(true)}> Eliminar </Button> {/*<FuncModalAgregar show={modalShow} onHide={() => setModalShow(false)} />*/} </ButtonToolbar> </Col> </Col> </Col> <Col xs="2"> <label></label> </Col> </Col> </Col> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function serVivo(especie) {\n //this.especie = especie;\n this.especie = especie;\n }", "function Servicio(nombre, precio, caracteristica,imagen){\n\tthis.nombre = nombre\n\tthis.precio = precio\n\tthis.caracteristica = caracteristica\n\tthis.imagen = imagen\n}", "constructor(servico, codigoRa...
[ "0.6683689", "0.6656582", "0.589316", "0.5799897", "0.5788539", "0.57455665", "0.56433046", "0.56360793", "0.56105834", "0.558008", "0.54947966", "0.5478322", "0.54645425", "0.54297626", "0.54112715", "0.53648216", "0.53526634", "0.5309353", "0.530708", "0.530462", "0.5290143...
0.0
-1
funcThatReturnsPromise('foo', 1000) .then(foo => console.log(foo)) .catch(err => console.error(error))
async function someFunc() { try { const arr = [ funcThatReturnsPromise('some other shit', 1000), funcThatReturnsPromise('some other shit', 1000), funcThatReturnsPromise('some other shit', 1000) ]; const res = await Promise.all(arr); console.log(res); } catch (error) { console.error(error); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DoSomething() {\n return new Promise((resolve) => {\n throw new Error('boom');\n }).catch(console.log);\n}", "function showPromise(error){\n console.log(error);\n}", "function myFn() {\n return Promise.resolve(\"Hello\");\n}", "async function executeMpromise(){\n \n try{\n cons...
[ "0.70482194", "0.6861789", "0.683348", "0.68021506", "0.678471", "0.66927874", "0.65978503", "0.65958655", "0.6539224", "0.6511096", "0.6489543", "0.6472888", "0.6464713", "0.6403899", "0.6394366", "0.63557816", "0.63242114", "0.6312535", "0.629118", "0.62504953", "0.62149304...
0.5747561
89
Initializes JSDOM environment for the application run
async function _initJSDom() { const content = await _getIMAResponseContent(); // SPA jsdom interpreter const jsdom = new JSDOM(content, { pretendToBeVisual: true, url: `${config.protocol}//${config.host}/`, }); // Setup node environment to work with jsdom window const { window } = jsdom; global.window = window; global.jsdom = jsdom; global.document = window.document; // Extend node global with created window vars Object.defineProperties(global, { ...Object.getOwnPropertyDescriptors(window), ...Object.getOwnPropertyDescriptors(global), }); // set debug before IMA env debug global.$Debug = true; // Mock dictionary global.$IMA.i18n = generateDictionary(imaConfig.languages, config.locale); // Mock scroll for ClientWindow.scrollTo for ima/core page routing scroll global.window.scrollTo = () => {}; // Replace window fetch by node fetch global.window.fetch = global.fetch; // Required for JSDOM XPath selectors global.console.assert = assert; // eslint-disable-line no-console // Call all page scripts (jsdom build-in runScript creates new V8 context, unable to mix with node context) const pageScripts = jsdom.window.document.getElementsByTagName('script'); if (typeof config.pageScriptEvalFn === 'function') { for (const script of pageScripts) { config.pageScriptEvalFn(script); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _initJSDom() {\n const jsdom = new JSDOM(\n `<!doctype html><html id=\"main-html\"><body><div id=\"${config.masterElementId}\"></div></body></html>`\n );\n const { window } = jsdom;\n\n global.window = window;\n global.document = window.document;\n global.navigator = {\n userAg...
[ "0.7300619", "0.7234803", "0.71088403", "0.6857795", "0.6655088", "0.66008264", "0.6544503", "0.6498687", "0.6404788", "0.6388635", "0.6317405", "0.6258173", "0.6236334", "0.62126374", "0.6196394", "0.6183878", "0.61270326", "0.6125514", "0.6119928", "0.6117193", "0.61096746"...
0.7142691
2
Wraps the global timer methods to collect their return values, which can be later cleared in clearImaApp function
function _installTimerWrappers() { global.setInterval = (...args) => { let timer = setIntervalNative(...args); timers.push({ timer, clear: () => global.clearInterval(timer) }); return timer; }; global.setTimeout = (...args) => { let timer = setTimeoutNative(...args); timers.push({ timer, clear: () => global.clearTimeout(timer) }); return timer; }; global.setImmediate = (...args) => { let timer = setImmediateNative(...args); timers.push({ timer, clear: () => global.clearImmediate(timer) }); return timer; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timerWrapper () {}", "function Timer() {}", "clearAllTimers() {\n for (let status of ROUND_TIMED_STATUSES) {\n this.clearFlag(status);\n }\n }", "function xTimerMgr()\r\n{\r\n this.tmr = null;\r\n this.timers = new Array();\r\n}", "function checkTimers(){\n createTimerCallback(ama...
[ "0.7024895", "0.6216643", "0.6178682", "0.6061379", "0.6042539", "0.60242134", "0.6019928", "0.59608024", "0.59482926", "0.593258", "0.59140414", "0.5906312", "0.5891599", "0.58909", "0.588722", "0.58843887", "0.5851347", "0.5840052", "0.5838455", "0.57992816", "0.57936734", ...
0.681154
1
Alert the server validation messages
function _returnServerMsgs(response, postdata) { var response_txt = response.responseText; if (response_txt) { var aor = $.parseJSON(response_txt); return [aor.success, aor.message, aor.new_id]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showValidationNotification() {\n //TODO: We need to make the validation UI much better, there's a lot of inconsistencies in v8 including colors, issues with the property groups and validation errors between variants\n\n //need to show a notification else it's not clear there was an error.\n ...
[ "0.69753385", "0.69753385", "0.6909447", "0.68662524", "0.6840733", "0.6718147", "0.6549251", "0.64947903", "0.6448691", "0.6434383", "0.6373157", "0.6369466", "0.6366853", "0.63605", "0.62822455", "0.6277431", "0.62709796", "0.62673295", "0.62484187", "0.62299794", "0.621168...
0.0
-1
custom destroyAll watcher TODO: check this has been merged then use native destroyAll method see:
destroyAllWatchers(){ let watchers = scrollMonitor.watchers, eventTypes = scrollMonitor.eventTypes; for (var w = 0, x = watchers.length; w < x; w++) { for (var i = 0, j = eventTypes.length; i < j; i++) { watchers[w].callbacks[eventTypes[i]].length = 0; } } watchers.length = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "beforeDestroy () {\n unwatchAll(this);\n }", "removeAll() {\n this.listeners.forEach(listener => listener.destroy());\n this.listeners = [];\n }", "removeAllEvents() {\n this.destroy();\n }", "destroyAll(...data) {\n return Promise.resolve().then(() => {\n const _de...
[ "0.76400393", "0.6712945", "0.6694455", "0.6648352", "0.66223437", "0.6534911", "0.65277785", "0.65277785", "0.6472088", "0.64587104", "0.64398474", "0.64390737", "0.64331716", "0.64135945", "0.6378474", "0.6375794", "0.63658154", "0.6304516", "0.628469", "0.62536114", "0.625...
0.69550574
1
L.control.navbar().addTo(map); get color depending on confirmed cases value
function getColor(d) { return d > 30 ? '#cc0000': d > 25 ? '#e60000': d > 20 ? '#ff0000': d > 15 ? '#ff4000' : d > 10 ? '#ff8000' : d > 5 ? '#ffbf00' : d >= 1 ? '#ffff00 ': 'green'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function colour_map(data){\n\n map.selectAll(\".marker\")\n .style(\"background-color\", function(d){\n if (d == data)\n {\n return \"red\"\n }\n else if (d.searched_house == true)\n {\n return \"yellow\"\n }\n else if (barchart_data.inde...
[ "0.64145184", "0.6322334", "0.62599945", "0.6129551", "0.60858077", "0.6075484", "0.6028389", "0.60264945", "0.60257953", "0.59919906", "0.59911585", "0.59821683", "0.59800786", "0.5961653", "0.5956643", "0.5930514", "0.5917089", "0.58963925", "0.5892792", "0.5885355", "0.588...
0.0
-1
Areas Under GCQ and ECQ
function highlightFeature_GCQ(e) { var layer = e.target; layer.setStyle({ weight: 1.0, color: 'black', fillOpacity: 0.1 }); if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) { layer.bringToFront(); } info.update(layer.feature.properties); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_$getArea() {\n return null;\n }", "function getAreas() {\n\tlet scalingFactor = Math.min(clientWidth / 1200, clientHeight / 1000);\n\t// Change the blocks' size according to the input surface area\n\tlet size1 = Math.min(48, 5 + Math.sqrt(area1) * scalingFactor * 8) + \"px\";\n\tlet size2 = Math.min(4...
[ "0.60596704", "0.58371097", "0.56422263", "0.5617519", "0.55617994", "0.55419743", "0.55101913", "0.54888785", "0.53994966", "0.53806525", "0.5378721", "0.5356613", "0.5294486", "0.52935606", "0.5276249", "0.52520597", "0.52451074", "0.52410257", "0.52273333", "0.5223333", "0...
0.0
-1
Barangay with Extreme Enchanced Community Quarantine
function highlightFeature_eecq(e) { var layer = e.target; layer.setStyle({ weight: 1.0, color: 'black', fillOpacity: 0.1 }); if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) { layer.bringToFront(); } info.update(layer.feature.properties); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isOtherThanBRA(state) {\r\n let isBra = state.case.charges.map(charge =>\r\n charge.isBRAFelony ? true : false\r\n );\r\n let braArr = [];\r\n state.case.charges.forEach(charge => {\r\n if (charge.isBRAFelony) {\r\n braArr.push(charge);\r\n }\r\n });\r\n if (!braArr[0]) {\r\n isACon...
[ "0.5487233", "0.54343534", "0.52585953", "0.523609", "0.5132479", "0.51283264", "0.5125833", "0.51216155", "0.5119371", "0.5100923", "0.5069158", "0.5052284", "0.50436556", "0.50053144", "0.49657872", "0.4920144", "0.49094117", "0.48811063", "0.48749164", "0.48537454", "0.483...
0.0
-1
Areas Under ECQ and GCQ until may 31
function resetHighlight_GCQ(e) { Areas_ECQ_GCQ.resetStyle(e.target); info.update(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inAirOpRange(startZone) {\n var zonesOut = searchGrid.zoneDistance(startZone, selectedZone);\n if (zonesOut <= (AIROP_RANGE / 2)) {\n return true; // able to return from whence they came\n } else {\n for (var i = 0; i < landingZones.length; i++) {\n var zonesBack = sea...
[ "0.56376505", "0.55505455", "0.5550223", "0.54685915", "0.5453922", "0.5362113", "0.5336347", "0.5293685", "0.5285651", "0.5245172", "0.521086", "0.5208417", "0.5207057", "0.52017367", "0.5175408", "0.5164273", "0.5159959", "0.51523805", "0.51486635", "0.51447725", "0.5142255...
0.0
-1
Barangay with Extreme Enhanced Community Quarantine
function resetHighlight_eecq(e) { eecq.resetStyle(e.target); info.update(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bandages() {\n var addon = selectAddOn(\"Bandages\", [\"Add 6 charges to medkit.\"], \"Common\", \"Add 6 charges to medkit.\", \"IconAddon_bandages.png\", \"First Aid Kit\", [\"extra\"]);\n return addon;\n}", "function getBrakeEngAlert(vid){\n var returnstr = \"\";\n if (trucks[vid].symptoms.bra...
[ "0.5229341", "0.51830786", "0.5130248", "0.5112303", "0.5026638", "0.50118566", "0.50016296", "0.4960514", "0.4946861", "0.4927928", "0.49121603", "0.49102452", "0.49008927", "0.48996022", "0.48678687", "0.48556027", "0.48491016", "0.48409015", "0.48268452", "0.48157492", "0....
0.0
-1
Set the active event to 0 to not have any event marked as active This function also gets called from the child component
unClickEvent() { this.setState({activeEvent: 0}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "activate() {\n this.active = true;\n }", "clearActive() {\n this.handleMenuItemChange(\"active\");\n }", "function handleActive(e) {\r\n //REMOVE ACTIVE CLASS\r\n e.target.parentElement.querySelectorAll(\".active\").forEach((el) => {\r\n el.classList.remove(\"active\");\r\n });\...
[ "0.65781116", "0.6545466", "0.6515821", "0.6304341", "0.627972", "0.6235652", "0.62111646", "0.6155374", "0.6117066", "0.61030644", "0.6091726", "0.60815614", "0.6068617", "0.60581005", "0.6040956", "0.60160506", "0.60120153", "0.5998196", "0.5996773", "0.5992884", "0.5961184...
0.717747
0
convert hash query to string query
insert(h_query) { // ref insert list let a_inserts = h_query.insert; // prep list of rows that have been observed from first element let a_keys = Object.keys(a_inserts[0]); // build columns part of sql string let s_keys = a_keys.map(s_key => `"${s_key}"`).join(','); // build values part of sql string let a_rows = []; // each insert row a_inserts.forEach((h_row) => { // list of values to insert for this row let a_values = []; // each key-value pair in row for(let s_key in h_row) { // key is missing from accepted values section if(-1 === a_keys.indexOf(s_key)) { return local.fail('new key "${s_key}" introduced after first element in insert chain'); } // append to values a_values.push(valuify(h_row[s_key])); } // push row to values list a_rows.push(`(${a_values.join(',')})`); }); // let s_tail = ''; // if(h_query.conflict_target && h_query.conflict_action) { s_tail += `on conflict ${h_query.conflict_target} ${h_query.conflict_action}`; } // prep sql query string return `insert into "${h_query.into}" (${s_keys}) values ${a_rows.join(',')} ${s_tail}`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function queryStringToHash(queryString) {\n\tif (typeof(queryString) == 'undefined') {\n\t\tvar queryString = window.location.search;\n\t}\n\tvar ret = new Array;\n\tif (bs_isEmpty(queryString)) return ret;\n\tqueryString = queryString.substr(1);\n\tif (bs_isEmpty(queryString)) return ret;\n\tvar junks = queryStri...
[ "0.73245263", "0.7226638", "0.7149432", "0.6999926", "0.6999926", "0.68673104", "0.68180364", "0.67756045", "0.66980606", "0.66126424", "0.66116464", "0.657492", "0.657492", "0.657492", "0.657492", "0.657492", "0.657492", "0.65685713", "0.65685713", "0.6560455", "0.6539242", ...
0.0
-1
start of an insert query
into(s_table) { return qb_insert({ into: s_table, }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function agenda_insert() {\n\tdb.transaction(agenda_insert_db, errorDB, successDB);\n}", "function insertQueries() {\n\n }", "function pet_insert() {\n\tdb.transaction(pet_insert_db, errorDB, successDB);\n}", "Insert() {\n\n }", "function queryInsert(sql, cb) {\n con.query(sql, (err, _) => {\n ...
[ "0.72735673", "0.71691996", "0.6970055", "0.6831853", "0.6661928", "0.66453105", "0.6612026", "0.65692514", "0.6568245", "0.6527007", "0.6500624", "0.6465245", "0.6329449", "0.6270268", "0.6253986", "0.6243559", "0.61918265", "0.61777174", "0.6168875", "0.61491907", "0.612672...
0.5755236
71
let us assume that string only contains characters from 'a' to 'z'
function isUniqueWithNoExtraStorage (str) { if(typeof(str) !== "string") { return false; } if(!str) { return false; } if(str.length > 32) { return false; } let storage = 0; for(let i =0; i < str.length; i++){ let index = str.charCodeAt(i) - 'a'.charCodeAt(0); if(1<< index & storage) { return false; } else { storage = 1<< index | storage; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isNotAlphabets(str)\n{\n\tfor (var i = 0; i < str.length; i++)\n\t{\n\t\tvar ch = str.substring(i, i + 1);\n\t\tif((ch < \"a\" || \"z\" < ch) && (ch < \"A\" || \"Z\" < ch)) \n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function isValidString(str, alphabet){ \n\tfor(var i=0;i<str.length;...
[ "0.7532353", "0.7496568", "0.74933034", "0.7476335", "0.7476335", "0.7439635", "0.7435552", "0.74275845", "0.73877275", "0.73806024", "0.73805004", "0.7379312", "0.73296547", "0.7302216", "0.72913516", "0.7246581", "0.72460794", "0.72419465", "0.7227598", "0.72075033", "0.718...
0.0
-1
let correct = 0;
function renderQuestions() { $("#quiz").empty(); questions.forEach(function (question, index) { let $question = $("<div>").addClass("form-group cm-form-group-fix"); let $label = $("<h4>") .text(question.question) .appendTo($question); for (let i = 0; i < question.choices.length; i++) { let $choice = $('<div>'); $choice.addClass('form-check form-check-inline'); let $radio = $('<input>'); $radio .attr({ type: "radio", value: question.choices[i], name: index, class: "form-check-input" }) .appendTo($choice); let $choiceLabel = $('<label>'); $choiceLabel .text(question.choices[i]) .addClass('form-check-label') .appendTo($choice); $choice.appendTo($question); } $("#quiz").append($question); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isCorrect(){\n score++;\n setScore();\n}", "function correctAnswer(){\n\t\tcorrect++;\n\t\talert(\"You are Right! Good job!\");\n\t}", "function answerIsCorrect() {\n let oldScore = parseInt(document.getElementById('correct').innerText);\n document.getElementById('correct').innerText = ++o...
[ "0.6652573", "0.6593515", "0.65899086", "0.6519545", "0.64537036", "0.6420076", "0.6401835", "0.6399222", "0.6399222", "0.6399222", "0.63940066", "0.6361975", "0.6358245", "0.6355916", "0.6337303", "0.6306715", "0.630107", "0.6295742", "0.6269993", "0.62416685", "0.62411934",...
0.0
-1
using recursive function// ////////////////////////// factorial of 4 equal 4321
function factorial(number) { if(number==1){ return number; }else{ return factorial(number-1)*number; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function factorial(number) { // Recibe un valor entero positivo\n if (number < 0) // Si es valor es un numero negativo entonces devuelve un -1 para hacer saber al usuario que se ingreso un valor invalido\n return -1; // retorno de valor invalido \n else if (number == 0) // Si el valor es 0, por defin...
[ "0.78629273", "0.78231925", "0.76976013", "0.76195735", "0.7604576", "0.7569123", "0.75613326", "0.7536435", "0.74763966", "0.74760556", "0.7475171", "0.74713326", "0.7468622", "0.7466194", "0.7460911", "0.74593997", "0.7449934", "0.7422034", "0.74133015", "0.7409681", "0.740...
0.74490494
17
Function for products query
function queryAllProducts (){ connection.query("SELECT * FROM products", function(err, res){ for (var i = 0; i < res.length; i++) { console.log("Id: " + res[i].id + " | " + res[i].productName + " | " + "$" + res[i].price); } console.log("---------------------------------------------------"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "oneProduct(_, args) {return queryOneProduct(args.id)}", "getProducts() {}", "getProducts(options) {\n console.log('inside getProducts');\n\n // array to hold parameters that may be entered in the query\n const queryParams = [];\n\n // array to hold each query filter\n const filters = [...
[ "0.73962647", "0.73643893", "0.68109643", "0.68078536", "0.6698783", "0.66950345", "0.66331095", "0.66074383", "0.65538865", "0.6545692", "0.65297914", "0.6522555", "0.6496191", "0.64943016", "0.6490232", "0.64896196", "0.64842534", "0.6476202", "0.64423096", "0.643867", "0.6...
0.6705419
4
JavaScript function to match (and return) the video Id of any valid Youtube Url, given as input string.
function ytVidId(url) { var p = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/; return (url.match(p)) ? RegExp.$1 : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function youtubeid(url) {\n var myregexp = /(?:youtube\\.com\\/(?:[^\\/]+\\/.+\\/|(?:v|e(?:mbed)?)\\/|.*[?&]v=)|youtu\\.be\\/)([^\"&?\\/ ]{11})/i;\n var videoID = url.match(myregexp);\n // var ytid = url.match(\"[\\\\?&]v=([^&#]*)\");\n videoID = videoID[1];\n return videoID;\n }", "f...
[ "0.8164787", "0.79034585", "0.7896262", "0.78761065", "0.7724001", "0.7724001", "0.76488304", "0.7587809", "0.7558441", "0.7558441", "0.7544206", "0.75279033", "0.751879", "0.74991196", "0.7475294", "0.74361944", "0.7383298", "0.7362106", "0.7272688", "0.72520703", "0.7207101...
0.75970274
7
var sliderRadio = document.getElementsByName("slider");
function fun1() { var rad = document.getElementsByName('slider'); if (rad[0].checked) { firstSlider(); } else if (rad[1].checked) { secondSlider(); } else { thirdSlider(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSelectedRadioButton(name){\r\n let selectedChoice;\r\n let btnSelectedRadioChoice = document.getElementsByName(name);\r\n for (let i=0; i<btnSelectedRadioChoice.length; i++){\r\n if (btnSelectedRadioChoice[i].checked){\r\n selectedChoice = btnSelectedRadioChoice[i].value;\r\n...
[ "0.7278999", "0.7228973", "0.6977543", "0.6874135", "0.6763068", "0.67446333", "0.67372566", "0.66435915", "0.6580368", "0.65603334", "0.6536415", "0.649925", "0.6492477", "0.6432202", "0.63721454", "0.6327714", "0.6324131", "0.62857306", "0.62799", "0.6268393", "0.626769", ...
0.6932882
3
Load My Books Shelf
function loadMyBookShelf(myBooks) { $.getJSON(myBooks, function(json) { var myBooks = ""; for (i in json.items) { myBooks+="<div class='col-xs-6 col-md-3'>"; myBooks+="<img class='book image image-center' id='"+ json.items[i].id +"' "; myBooks+="src='"+ json.items[i].volumeInfo.imageLinks.smallThumbnail +"'>"; myBooks+="</div>"; } $("#my-books").html(myBooks); $(".book").on('click', function() { loadBooksDetails($(this).attr('id')); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initBookshelf() {\n addBooksFromStorage();\n const bookshelf = document.querySelector(\".bookshelf\");\n library.forEach(element => {\n addBookToDOM(element);\n });\n}", "function booksInBookshelf(id) {\n// var db = ScriptDb.getMyDb();\n var dbShelf = ParseDb.getMyDb(applicationId, ...
[ "0.7119343", "0.6735765", "0.65465796", "0.6500821", "0.6448958", "0.6407286", "0.63830596", "0.63589615", "0.63476473", "0.63476473", "0.6267452", "0.6245941", "0.6199073", "0.6169264", "0.6160215", "0.60977536", "0.60872465", "0.6084712", "0.6007998", "0.59898984", "0.59421...
0.66200936
2
Initialize stores for the db
initializeStores() { this.stores.forEach((store) => { let [ver, storeDef] = store; console.log('Registering version %s of stores:\n%s', ver, Object.keys(storeDef).join(', ')); this.db.version(ver).stores(storeDef); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setup_stores()\n{\n\t// Init Files \n\tmodels['Files'] = new IDBStore({\n\t storeName: 'Files',\n\t keyPath: 'id',\n\t dbVersion: site.config.indexeddb.Files.version,\n\t storePrefix: '',\n\t autoIncrement: true,\n\t\tindexes: site.config.indexeddb.Files.indexes,\t \n\t onStoreReady: get_files_data...
[ "0.7627842", "0.74474126", "0.7218285", "0.7168389", "0.7030366", "0.6853619", "0.6839941", "0.6811335", "0.67141503", "0.668069", "0.66200006", "0.6615841", "0.65716076", "0.64706916", "0.64464134", "0.64430267", "0.6414425", "0.63931113", "0.6374085", "0.63714373", "0.63645...
0.82220805
0
================================================================== ========================SELECTIONSORT============================= ================================================================== / The following selection sort code implementation can be found here
*selectsortGenerator(array) { for (var i = 0; i < array.length; ++i){ let min = i; for (var j = i + 1; j < array.length; ++j){ if (array[min] > array[j]){ min = j; } } if ( i !== min){ [array[i], array[min]] = [array[min], array[i]]; yield array; } } return array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createSelectionSort(){\n\t \n\tvar that = {},\n\t\tspec = {};\n\t \n\t/**\n\t * Swaps two values in an array.\n\t * @param {Array} items The array containing the items.\n\t * @param {int} firstIndex Index of first item to swap.\n\t * @param {int} secondIndex Index of second item to swap.\n\t * @return {vo...
[ "0.7714516", "0.7663314", "0.7590758", "0.7446182", "0.7402852", "0.73973596", "0.73851514", "0.7351114", "0.7350713", "0.7346228", "0.73411345", "0.7283086", "0.7277667", "0.72674704", "0.7259008", "0.7248383", "0.72382843", "0.72318846", "0.72291154", "0.7228415", "0.720720...
0.0
-1
Each enemy object is initially positioned off the grid (x) has a (y) position based on the argument that is passed in when Enemy is created has random speed shares the same visual asset
constructor(y) { this.x = -101; this.y = y; this.speed = Math.floor(Math.random() * 500) + 100; this.sprite = 'images/enemy-bug.png'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "spawn() {\n this.x = getRandomInt(0, 25) * this.grid;\n this.y = getRandomInt(0, 25) * this.grid;\n }", "constructor() {\n this.sprite = 'images/enemy-bug.png';\n this.x = 0;\n this.ranNumForLocation = Math.floor(Math.random() * 3);\n this.initialLocationArray = [48, 131, 214]\n t...
[ "0.782654", "0.7731306", "0.75026274", "0.74053746", "0.73715824", "0.73372144", "0.7180224", "0.7119952", "0.70719016", "0.7048314", "0.7031732", "0.6995857", "0.69722766", "0.694108", "0.693902", "0.6909294", "0.6909294", "0.6904129", "0.6901393", "0.6895686", "0.688524", ...
0.71820265
6
draw the enemy on the screen
render(){ ctx.drawImage(Resources.get(this.sprite), this.x, this.y); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawEnemy(EnemyX,EnemyY){\n image(Enemy,EnemyX,EnemyY,50,50);\n}", "draw() {\n ctx.fillStyle = this.color\n ctx.shadowColor = this.color\n ctx.shadowBlur = 30\n ctx.fillRect(this.pos.x, this.pos.y, this.size.w, this.size.h)\n\n if (this.color === this.hitColor) {\n setTimeout(() => ...
[ "0.7704279", "0.76720333", "0.75942516", "0.75852585", "0.7545957", "0.73656297", "0.7299305", "0.7139672", "0.7126999", "0.710894", "0.7098004", "0.7076215", "0.70599836", "0.703447", "0.69608325", "0.6957194", "0.69456416", "0.69164747", "0.69161505", "0.6909478", "0.689721...
0.0
-1
Player object is positioned at specified location
constructor() { this.x = 202; this.y = 395; this.sprite = 'images/char-boy.png'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setPosition(id, x, y) {\n var player = this.players.find((p) => p.id === id);\n player.x = x;\n player.y = y;\n }", "setPosition() {\r\n if (!this.object) return;\r\n this.updatePosition();\r\n }", "updatePos() {\n if (this.x != this.player.x || this.y != this.player.y) {\n ...
[ "0.73699987", "0.7334482", "0.713046", "0.704099", "0.69819117", "0.6965149", "0.6963683", "0.6925274", "0.6876897", "0.68697155", "0.6784495", "0.6746055", "0.6725345", "0.66893023", "0.66869664", "0.66675293", "0.6663048", "0.6660678", "0.6611956", "0.66019565", "0.6578146"...
0.0
-1
draw the enemy on the screen
render() { ctx.drawImage(Resources.get(this.sprite), this.x, this.y); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawEnemy(EnemyX,EnemyY){\n image(Enemy,EnemyX,EnemyY,50,50);\n}", "draw() {\n ctx.fillStyle = this.color\n ctx.shadowColor = this.color\n ctx.shadowBlur = 30\n ctx.fillRect(this.pos.x, this.pos.y, this.size.w, this.size.h)\n\n if (this.color === this.hitColor) {\n setTimeout(() => ...
[ "0.7704279", "0.76720333", "0.75942516", "0.75852585", "0.7545957", "0.73656297", "0.7299305", "0.7139672", "0.7126999", "0.710894", "0.7098004", "0.7076215", "0.70599836", "0.703447", "0.69608325", "0.6957194", "0.69456416", "0.69164747", "0.69161505", "0.6909478", "0.689721...
0.0
-1
defines arrow key control for the player and does not allow player move off the grid
handleInput(key) { if (this.x > 0 && key === 'left') { this.x -= 101; } if (this.x < 404 && key === 'right') { this.x += 101; } if (this.y > 0 && key === 'up') { this.y -= 83; } if (this.y < 395 && key === 'down') { this.y += 83; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function keyControl(event) {\n if (event.keyCode == 37 && buttonPressed != true && gameOver != true) {\n keyPressed = true;\n p.moveLeft();\n } else if (event.keyCode == 38 && buttonPressed != true && gameOver != true) {\n keyPressed = true;\n p.rotate();\n...
[ "0.7242808", "0.7226124", "0.7189559", "0.718607", "0.7185699", "0.7132175", "0.7127608", "0.7122507", "0.7108894", "0.7100371", "0.709188", "0.7053857", "0.70507723", "0.7040564", "0.7033617", "0.70234364", "0.69897056", "0.69830483", "0.69816273", "0.69790155", "0.6967903",...
0.0
-1
Given a position in the DOM, look for children elements which comprise a boolean expression. Using all of those found with content, return a filter string which represents them.
function walkTreeForFilterStrings(basicNode) { var groupValues, node = $(basicNode); if (node.hasClass("filter-value") && node.val().length > 0) { return node.attr('name') + ' eq "' + node.val().replace('"', '\\"') + '"'; } else if (node.hasClass("filter-group")) { groupValues = _.chain(node.find(">.form-group>.filter-value, >.filter-group")).map(walkTreeForFilterStrings).filter(function (value) { return value.length > 0; }).value(); if (groupValues.length === 0) { return ""; } else if (groupValues.length === 1) { return groupValues[0]; } if (node.hasClass("filter-or")) { return "(" + groupValues.join(" OR ") + ")"; } else { return "(" + groupValues.join(" AND ") + ")"; } } else { return ""; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function elementChildren(children, predicate = () => true) {\n return react__WEBPACK_IMPORTED_MODULE_0__[\"Children\"].toArray(children).filter(child => /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__[\"isValidElement\"])(child) && predicate(child));\n}", "function elementChildren(children, predicate) {\...
[ "0.57309383", "0.5620076", "0.5612424", "0.5503472", "0.52730006", "0.51587266", "0.50474477", "0.50065356", "0.49436894", "0.49398923", "0.49030387", "0.49030325", "0.48921373", "0.4891908", "0.4878014", "0.4878014", "0.4878014", "0.4878014", "0.4878014", "0.48445186", "0.48...
0.0
-1
videoListUp controls theatre mode effect and animations
function videoListUp(){ $('.listUpWrap').hide(); $('.listDropWrap').slideDown(); $('.videoRowWrapper').velocity({ 'height': '60%' }, 600); $('#listContentWrap').velocity({ 'height': '40%' }, 600); $('.videoListRowWrapper').fadeIn(500, ()=>{ $('#text-carousel').slideDown(800); $('.thRow').fadeIn(700); $('.listDropWrap').slideDown(700); }); $('#mainVideo').velocity({ 'width': '98vh', 'height': '55vh' }, 600); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function overVideoControl() {\n videoCtrlTl.reverse();\n }", "function WeBack(theMode) {\n Mode = theMode;\n ModeCheck(Mode);\n\n areAnimated = [false, false, false, false];\n document.getElementById(\"nextVid\").style.display = \"none\";\n Learn_video.currentTime = 0;\n Learn_video.src = a...
[ "0.63554186", "0.6338707", "0.6247146", "0.6129791", "0.60924506", "0.60314065", "0.5993365", "0.59597695", "0.593787", "0.59194374", "0.5875801", "0.5864315", "0.58640885", "0.5816547", "0.578954", "0.57855105", "0.57586527", "0.5750631", "0.57198644", "0.57128775", "0.56889...
0.7239287
0
Click handler to console log search results
function clickHandler() { $('.listUpButton').on('click tap', ()=>{ videoListUp(); }); $('.listDropButton').on('click tap', ()=>{ videoListDown(); }); $('#myLinkButton').on('click tap',()=>{ clipBoard('linkGhost'); }); $('#userLinkModal').on('hidden.bs.modal',()=>{ if($('.linkCopyArea').css('display')==='block'){ history.pushState({},'','/'); } }); $('.channelDropDown').on('click tap', '.dropdownChannelLiLoad', () => { browsingMode = false; dropOpened = false; returnToPageOne(); compileSelectedChannelsFromDropdown(); clearVideoList(); if (window.innerWidth < 767) { closeChannelDrop(); } else { $('mainNav-option').removeClass('in') .attr('aria-expanded', 'false'); $('.channelDropDown').removeClass('open'); } var numUpdated = 0; for(var i = 0; i<clientSelectedChannelObjects.length; i++){ $.ajax({ url:'./script/api_calls_to_db/access_database/access.php', method:'post', dataType:'JSON', data:{ action:'update_video_list', youtube_channel_id:clientSelectedChannelObjects[i].youtube_channel_id, last_channel_pull:clientSelectedChannelObjects[i].last_channel_pull }, success: function (data) { numUpdated++; if(numUpdated === clientSelectedChannelObjects.length){ returnToPageOne(); loadSelectedChannels(); } }, errors: function (data) { } }) } }); $(".dropdownChannelLiAll").on("click tap", function () { browsingMode = false; clientSelectedChannelIds = deepCopy(clientSubscribedChannelIds); clientSelectedChannelObjects = deepCopy(clientSubscribedChannelObjects); // returnToPageOne(); renderChannelSelectionDropdown(); clearVideoList(); if (window.innerWidth < 767) { closeChannelDrop(); } else { $('mainNav-option').removeClass('in') .attr('aria-expanded', 'false'); $('.channelDropDown').removeClass('open'); dropOpened = false; } var numUpdated = 0; for(var i = 0; i<clientSubscribedChannelObjects.length; i++){ $.ajax({ url:'./script/api_calls_to_db/access_database/access.php', method:'post', dataType:'JSON', data:{ action:'update_video_list', youtube_channel_id:clientSubscribedChannelObjects[i].youtube_channel_id, last_channel_pull:clientSubscribedChannelObjects[i].last_channel_pull }, success: function (data) { numUpdated++; if(numUpdated === clientSubscribedChannelObjects.length){ returnToPageOne(); loadSelectedChannels(); } }, errors: function (data) { } }) } }); $('#channelCategoryUl').on('click tap', '.channelLiChannel, .dropdownChannelLi input', (e) => { if ($(e.target).is('input')) { return; } else { let input = $(e.target).children('input'); if (input[0].checked == true) { input[0].checked = false; } else if (input[0].checked == false) { input[0].checked = true; } } }); $('a.dropdown-toggle').on('click tap', () => { $('.channelDropDown').toggleClass('open'); if (dropOpened) { dropOpened = false; } else { setTimeout(() => { dropOpened = true; }, 300); } }); //category submit button $('.channelCategoryButton').on('click tap', (e)=>{ e.preventDefault(); $('.channelCategoryForm').submit(); }); $('.channelCategoryForm').submit((e)=>{ e.preventDefault(); let categoryStr = ''; categoryStr = $(e.target).find('input').val(); if($(e.target).closest('.modal').attr('id') === "userLinkModal"){ changeCategory(categoryStr); } else{ var isUncategorized = true; for(var cat in clientCategories){ if(clientCategories[cat].indexOf(channelIdOfCategorySet) !== -1){ isUncategorized = false; } } if(isUncategorized){ changeCategory(categoryStr); } else{ changeCategory(categoryStr, true); } } $(e.target).find('input').val(''); $(e.target).closest('.modal').modal('hide').on('hidden.bs.modal',()=>{ // toastMsg('Channel Added', 2000); }); }); $('.existingCategoryButton').on('click tap', (e)=>{ let categoryStr = ''; categoryStr = $(e.target).closest('.existingCategorySelect').find('select option:selected').val(); if($(e.target).closest('.modal').attr('id') === "userLinkModal"){ changeCategory(categoryStr); } else{ var isUncategorized = true; for(var cat in clientCategories){ if(clientCategories[cat].indexOf(channelIdOfCategorySet) !== -1){ isUncategorized = false; } } if(isUncategorized){ changeCategory(categoryStr); } else{ changeCategory(categoryStr, true); } } $(e.target).closest('.existingCategorySelect').find('select option:selected').prop('selected', false); $(e.target).closest('.existingCategorySelect').find('select option:disabled').prop('selected', true); $(e.target).closest('.modal').modal('hide').on('hidden.bs.modal',()=>{ // toastMsg('Channel Added', 2000); }); }); //Search Button $('.channelSearchForm').on('click tap', '.channelSearchButton', (e) => { e.preventDefault(); $('.channelSearchForm').submit(); }); function channelSearchWorked() { for (var i = 0; i < 10; i++) { renderChannelSearchStats(i) } } function channelSearchFailed(message) { console.log('console.log("CHANNEL SEARCH FAILED")', message); } $(".channelSearchForm").submit(function (event) { event.preventDefault(); let inputStr = ''; if ($(event.target).find('input').val() === "") { return; //prevent empty input } else { inputStr = $(event.target).find('input').val(); } $(".navbar-collapse").collapse('hide'); searchChannelsByName(inputStr).then(channelSearchWorked, channelSearchFailed); if($('.contentPlaceholderWrapper').css('display')!=='none'){ $('.contentPlaceholderWrapper').fadeOut(1000, function () { $('#text-carousel, .videoHeader, .listDropWrap').slideDown(1100); }); } }); //Browse Button $('.browseChannelButton').on("click tap", handleBrowseButton); //Add Buttons $('.addChannelButton').on("click tap", handleAddButton); $(".tdPlaylistButton").on("click tap", handleAddToPlaylist); $('.ui-autocomplete').on('click tap','.ui-menu-item-wrapper', function (event){ event.stopPropagation(); let autocompleteValue = $(event.target).text(); $('.channelSearchInput').val(autocompleteValue); $('.channelSearchButton').click(); // searchChannelsByName(autocompleteValue).then(channelSearchWorked, channelSearchFailed); }); /*************************************************************************************************** * click handlers for table rows that are untouched * @params none */ $(".tdTitle, .tdChannel, .tdUpDate").on("click tap", function () { if (!$(this).parent().hasClass('selectedTd')) { $(".tdTitle, .tdChannel").unbind("mouseup"); $('.tdTitle i.fa').remove(); //Table List Row Title that is selected $(".tdTitle").mouseup(function () { if ($(this).parent().hasClass('selectedTd')) { // $("#videoStats").focus().click() $("#videoStats").trigger('focus') } }); //Table List Row Channel that is selected $(".tdChannel").mouseup(function () { if ($(this).parent().hasClass('selectedTd')) { // $("#channelInfo").focus().click() $("#channelInfo").trigger('focus') } }); currentlySelectedVideoID = $(this).parent().attr('videoID'); var channelID = $(this).parent().attr('channelID'); updateMidNavText(); // $('.fa-play-circle-o').remove(); $('.fa-circle-o-notch').remove(); var playSymbol = $('<i>') // .addClass("fa fa-play-circle-o") .addClass('fa fa-circle-o-notch fa-spin fa-fw circleSpinner') .css({ "margin-right": '5px', 'color': 'green' }); $(this).parent().find(".tdTitle>span").prepend(playSymbol); $('.tdList').removeClass('selectedTd'); $(this).parent().addClass("selectedTd"); if (getAutoPlayValue()) { player.loadVideoById(currentlySelectedVideoID); } else { player.cueVideoById(currentlySelectedVideoID); } //update video stats popover updateVideoInfoPopover(currentlySelectedVideoID); //update channel stats popover updateChannelInfoPopover(channelID); } }); /*************************************************************************************************** * click handlers for bottom carousel slides * @params none */ $('#rightArrowIcon').on('click tap',carouselRightArrow); $('#leftArrowIcon').on('click tap',carouselLeftArrow); /*************************************************************************************************** * click handler for 'watch order' function and arrow icon * @params none */ $("#playOrderArrow").on('click', function(){ reversePlayDirection = !reversePlayDirection; if(reversePlayDirection === false){ $("i").removeClass('up') }else{ $("i").addClass('up') } }); /*************************************************************************************************** * click handlers for theatre controls * @params none */ $('.fastForwardButton').on('click tap', fastForwardVideo); $('.rewindButton').on('click tap', rewindVideo); $('.playButton').on('click tap', playYtVideo); $('.lastVideoButton').on('click tap',playPrevYTVideo); $('.nextVideoButton').on('click tap', playNextYTVideo); /*************************************************************************************************** * fastForwardVideo - moves video forward in time 15s * @params none */ function fastForwardVideo() { var fastForward = player.getCurrentTime(); var add15Seconds = fastForward + 15; player.seekTo(add15Seconds); } /*************************************************************************************************** * playTYVideo - pause and play functionality with tooltip and icon changes * @params none */ function playYtVideo() { player.playVideo(); if (this.classList.value === playFaClass) { $('.playButton').tooltip('hide') $('.playButton').removeClass(playFaClass).toggleClass(pauseFaClass); $(this).attr('data-original-title','Pause') } else { $('.pauseButton').tooltip('hide'); $('.pauseButton').removeClass(pauseFaClass).toggleClass(playFaClass); $(this).attr('data-original-title','Play') player.pauseVideo() } } /*************************************************************************************************** * rewindVideo - moves video back in time 15s * @params none */ function rewindVideo() { var fastForward = player.getCurrentTime(); var minus15Seconds = fastForward - 15; player.seekTo(minus15Seconds); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function watchResultClick() {\n $(document).on('click', '.result-name', function(event) {\n event.preventDefault();\n\n const queryTarget = $(event.currentTarget);\n const queryTerm = (queryTarget.html());\n\n $('.search-results-section').prop('hidden', true);\n\n retrieveJSON(queryTerm, displayMar...
[ "0.7064954", "0.6880764", "0.66768646", "0.66062427", "0.6478713", "0.6472322", "0.64366", "0.6415114", "0.639487", "0.6392921", "0.6390435", "0.63857293", "0.63739496", "0.63557416", "0.6340277", "0.63195914", "0.62942517", "0.62883085", "0.6281115", "0.62702334", "0.6262430...
0.0
-1
fastForwardVideo moves video forward in time 15s
function fastForwardVideo() { var fastForward = player.getCurrentTime(); var add15Seconds = fastForward + 15; player.seekTo(add15Seconds); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fastForward() {\n target = this.classList[1] - 1;\n\n shownMedia[target].currentTime += 5;\n\n // If fast forward exceeds video length, goes back to beginning of video and pauses\n if(shownMedia[target].currentTime >= shownMedia[target].duration) {\n shownMedia[targe...
[ "0.77340055", "0.7658001", "0.6955349", "0.69523954", "0.68846303", "0.6644918", "0.66411155", "0.661723", "0.65360624", "0.6456723", "0.6333538", "0.6300024", "0.6300024", "0.62600034", "0.622176", "0.6207095", "0.6189372", "0.618286", "0.6170801", "0.60887", "0.6076027", ...
0.858113
0
playTYVideo pause and play functionality with tooltip and icon changes
function playYtVideo() { player.playVideo(); if (this.classList.value === playFaClass) { $('.playButton').tooltip('hide') $('.playButton').removeClass(playFaClass).toggleClass(pauseFaClass); $(this).attr('data-original-title','Pause') } else { $('.pauseButton').tooltip('hide'); $('.pauseButton').removeClass(pauseFaClass).toggleClass(playFaClass); $(this).attr('data-original-title','Play') player.pauseVideo() } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function action_toggle_play() {\n if (video.paused) {\n video.play();\n change_icon('play'); \n } else {\n video.pause();\n change_icon('pause'); \n }\n delay = delay_value;\n}", "function playVideo() {\r\n video.play();\r\n play.innerHTML = '<i class=\"fas fa-pause fa-2x\"></i>';\r\n}", ...
[ "0.75403845", "0.72437173", "0.7180169", "0.7180067", "0.710993", "0.7079209", "0.70605505", "0.69493806", "0.69403315", "0.68844175", "0.68768364", "0.6874432", "0.6864135", "0.6862987", "0.6852703", "0.6849988", "0.679399", "0.6791494", "0.6780978", "0.6716388", "0.6700786"...
0.81265557
0
rewindVideo moves video back in time 15s
function rewindVideo() { var fastForward = player.getCurrentTime(); var minus15Seconds = fastForward - 15; player.seekTo(minus15Seconds); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rewindVideo(increment) {\n player.currentTime -= increment;\n}", "function fastForwardVideo() {\n var fastForward = player.getCurrentTime();\n var add15Seconds = fastForward + 15;\n player.seekTo(add15Seconds);\n }", "function restoreTime () {\n const restoreT...
[ "0.7942025", "0.7152836", "0.7088374", "0.69246083", "0.67662406", "0.6706276", "0.66731083", "0.6651095", "0.6614244", "0.65366465", "0.6421747", "0.64172256", "0.6397", "0.6352967", "0.63216233", "0.62962365", "0.62938714", "0.62787235", "0.6264922", "0.6215699", "0.6154194...
0.858974
0
carouselLeftArrow carousel controls on bottom
function carouselLeftArrow(){ $(".carousel").carousel('prev'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function slideLeft() {\n var parent = $(this).closest('.carousel');\n var items = $.makeArray(parent.find('.item:not(.hidden)'));\n if (items.length == 1) {\n //already at the end\n return;\n }\n var item = $(items.shift());\n item.animate({'margin-left': item.width()*-1, opacity: '0%'}, 'slow', 'linea...
[ "0.6882294", "0.6827787", "0.67363364", "0.6665643", "0.6549694", "0.6548015", "0.65184164", "0.65014553", "0.64959544", "0.6490066", "0.6479246", "0.6466931", "0.64633083", "0.64388466", "0.64321345", "0.63685733", "0.63685733", "0.6358446", "0.6349347", "0.6349347", "0.6319...
0.7947538
0