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
! moment.js locale configuration
function t(e,t,n,r){var i={s:["थोडया सॅकंडांनी","थोडे सॅकंड"],ss:[e+" सॅकंडांनी",e+" सॅकंड"],m:["एका मिणटान","एक मिनूट"],mm:[e+" मिणटांनी",e+" मिणटां"],h:["एका वरान","एक वर"],hh:[e+" वरांनी",e+" वरां"],d:["एका दिसान","एक दीस"],dd:[e+" दिसांनी",e+" दीस"],M:["एका म्हयन्यान","एक म्हयनो"],MM:[e+" म्हयन्यानी",e+" म्हयने"],y:["एका वर्सान","एक वर्स"],yy:[e+" वर्सांनी",e+" वर्सां"]};return r?i[n][0]:i[n][1]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t){var n=e.split("_");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var i={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?i[n][0]:i[n][1]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82627255", "0.80355096", "0.7878359", "0.75476736", "0.72037613", "0.71981734", "0.71757025", "0.7170814", "0.71322805", "0.7130772", "0.7044428", "0.667163", "0.667163", "0.6334324", "0.6292554", "0.62773275", "0.62773275", "0.62773275", "0.62773275", "0.62090504", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var i={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?i[n][0]:i[n][1]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var i={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?i[n][0]:i[n][1]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var i={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return t?i[n][2]?i[n][2]:i[n][1]:r?i[n][0]:i[n][1]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
Creates a User in the Database If the User exists, return error if it exists
static createUser(req, res){ // Form validation const { errors, isValid } = validateRegisterInput(req.body); // Check validation if (!isValid) { return res.status(400).json(errors); } User.findOne({ username: req.body.username }) .then(user => { if (user) { return res.status(400).json({ username: "Username already exists" }); } const newUser = new User({ username: req.body.username, password: req.body.password, //privileges : req.body.privileges, admin_creator: req.body.admin_creator, isAdmin: req.body.isAdmin, isNetIDLogin: req.body.isNetIDLogin, comment: req.body.comment, }); // Hash password before saving in database bcrypt.genSalt(10, (err, salt) => { bcrypt.hash(newUser.password, salt, (err, hash) => { if (err) throw err; newUser.password = hash; newUser .save() .then(user => res.json(user)) .catch(err => console.log(err)); }); }); } ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createUser(){\n let username = getUsername();\n let password = getPassword();\n\n if (username.length != 0){\n if (allUsers.has(username)){\n throw new Error(\"User with us\");\n }\n allUsers.set(username, password);\n console.log(\"User added: \" + username...
[ "0.7957954", "0.7681373", "0.7451359", "0.74320155", "0.7305778", "0.7285215", "0.7270234", "0.7251168", "0.7222616", "0.7220852", "0.71930665", "0.7150304", "0.7131933", "0.71188504", "0.70968115", "0.7096152", "0.70905375", "0.70550555", "0.7050348", "0.70347613", "0.701384...
0.6661426
63
Gets all Users in the database
static getAllUsers(req, res){ User.find((err, users) => { if (err) return res.json({ success: false, error: err }); return res.json({ success: true, data: users }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUsers() {\n User.query(function(data){\n return self.all = data.users;\n });\n }", "function getAllUsers() {\n var allUsers = User.find(function (err, users) {\n if (err) return handleError(err);\n return users\n })\n return allUsers\n}", "function getAllUsers() {\n...
[ "0.8435582", "0.8349404", "0.83219576", "0.8249574", "0.8212433", "0.81940216", "0.8186476", "0.8135862", "0.8112837", "0.8103327", "0.80638486", "0.8045837", "0.802963", "0.8028524", "0.7982804", "0.7960093", "0.7951227", "0.7908858", "0.7899927", "0.7897573", "0.7848452", ...
0.7113229
95
function to parse data from the api and convert it to a form in which is useful to the user
function renderData(data){ let k=JSON.parse(data) let goodData=''; for(let i=0;i<k.count;i++){ goodData+= `<ul>` + `<a href=${k.recipes[i].source_url} target="_blank"> `+ `<li> ` + `<img src=${k.recipes[i].image_url} alt=you style="width:300px;height:300px;">` + `</li>` + `<div class ="content">` + `<h1> ${k.recipes[i].title} </h1>` + `</div>` + `</ul>` } return goodData }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dataParser() {\n let response = JSON.parse(this.responseText);\n window.fields = response.fields;\n window.rules = response.rules;\n\n generateForm();\n generateRules();\n}", "function parseData(response){ \n //if no result domain not registered\n if(response.results.length == 0){\...
[ "0.6147708", "0.6057458", "0.59431505", "0.5918124", "0.5896365", "0.5892593", "0.57999253", "0.57798105", "0.57762975", "0.5774819", "0.5749179", "0.5745772", "0.57094795", "0.5703986", "0.5682805", "0.56591755", "0.56447613", "0.5608455", "0.56069785", "0.55969113", "0.5595...
0.0
-1
Main Controller for the Parker Bank internation staff profile App.
function StaffController(StaffService, loggerFactory, $mdSidenav, $mdToast, $window) { var vm = this; vm.staffMembers = []; vm.appointment = {}; vm.selectedMember = null; vm.isFabOpen = false; vm.isSelected = false; vm.selectedMemberIndex = 0; vm.selectStaffMember = selectStaffMember; vm.toggleMemberList = toggleMemberList; vm.toggleSelection = toggleSelection; vm.openSideMenu = openSideMenu; vm.navigateTo = navigateTo; vm.desiredDate = new Date(); vm.currentTime = new Date().getTime(); activate(); /** * Initial execution function on page load. */ function activate() { return StaffService.getAllStaffMembers().then(function (data) { vm.staffMembers = data; vm.selectedMember = data[0]; loggerFactory.info('Staff Members: ', data); }, function (err) { loggerFactory.error('Get Staff Members: ', err); }); } /** * Select the current staff member. * @param memberId */ function selectStaffMember(member, index) { vm.isSelected = false; vm.selectedMemberIndex = index; vm.selectedMember = angular.isDefined(member) ? member : vm.staffMembers[0]; if (!$mdSidenav('left').isLockedOpen()) { $mdSidenav('left').close(); } } /** * Hide or Show the 'left' SideNav when small screen. */ function toggleMemberList() { $mdSidenav('left').toggle(); } function toggleSelection() { vm.isSelected = !vm.isSelected; if(vm.isSelected){ showFavoriteToast(); } } /** * Open the side menu when small screen. */ function openSideMenu($mdMenu, event) { $mdMenu.open(event); } /** * Open favorite selected tooltip. */ function showFavoriteToast() { $mdToast.show({ hideDelay: 3000, position: 'top right', controller: 'ToastController', controllerAs: 'toast', templateUrl: 'fav_toast_template.html', bindToController: true }); } /** * Go to requested URL.. * @param url */ function navigateTo(url){ $window.open(url, '_blank'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CommitteeHomeController(siteInfo, fellowResidents, $routeParams) {\n this.siteInfo = siteInfo;\n this.fellowResidents = fellowResidents;\n this.$routeParams = $routeParams;\n this.canManage = false;\n }", "function MainController() {\n\n }", "funct...
[ "0.5955003", "0.5948213", "0.59005713", "0.58052117", "0.579127", "0.57029706", "0.56436056", "0.5578276", "0.55665636", "0.5540938", "0.5484071", "0.5446754", "0.53985465", "0.53375816", "0.5337507", "0.5332887", "0.53163147", "0.5307199", "0.53036565", "0.53007305", "0.5291...
0.4870267
99
Initial execution function on page load.
function activate() { return StaffService.getAllStaffMembers().then(function (data) { vm.staffMembers = data; vm.selectedMember = data[0]; loggerFactory.info('Staff Members: ', data); }, function (err) { loggerFactory.error('Get Staff Members: ', err); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n // THIS IS THE CODE THAT WILL BE EXECUTED ONCE THE WEBPAGE LOADS\n }", "function init() {\n\t\t$(document).on('pageBeforeInit', function (e) {\n\t\t\tvar page = e.detail.page;\n\t\t\tload(page.name, page.query);\n\t\t});\n }", "function alwaysRunOnload () {\n\t\n\t}", "function alw...
[ "0.7887568", "0.7398014", "0.737307", "0.72839206", "0.7278023", "0.7210524", "0.72056454", "0.7181718", "0.6919903", "0.69168234", "0.6903555", "0.6847969", "0.6831464", "0.68242145", "0.68108845", "0.6780811", "0.6777718", "0.67721826", "0.67433655", "0.67056125", "0.668506...
0.0
-1
Select the current staff member.
function selectStaffMember(member, index) { vm.isSelected = false; vm.selectedMemberIndex = index; vm.selectedMember = angular.isDefined(member) ? member : vm.staffMembers[0]; if (!$mdSidenav('left').isLockedOpen()) { $mdSidenav('left').close(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fnselectMember(){\r\n\tastrMemberName=fngetElementsByClass('btn_assign_unassign',document,'div'); \r\n\tfnteamStatus();\r\n}", "function select ( menuId ) {\r\n // self.selected = angular.isNumber(menuId) ? $scope.users[user] : user;\r\n self.toggleList();\r\n }", "function activate() {...
[ "0.6085138", "0.60093236", "0.5921727", "0.5857276", "0.5638627", "0.5568501", "0.551495", "0.5491164", "0.54646754", "0.5442988", "0.5425162", "0.54168624", "0.5379206", "0.53753644", "0.5370801", "0.53613", "0.5348411", "0.5306193", "0.52819854", "0.523915", "0.5230852", ...
0.71720594
0
Hide or Show the 'left' SideNav when small screen.
function toggleMemberList() { $mdSidenav('left').toggle(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showNav()\n\t{\n\t\tmobileNav = !mobileNav;\n\t\tif(mobileNav)\n\t\t{\n\t\t\t$(\"#side_nav\").addClass('show-nav');\n\t\t\t$('html,body').css('overflow','hidden');\n\t\t} else {\n\t\t\t$('#side_nav').removeClass('show-nav');\n\t\t\t$('html,body').css('overflow','auto');\n\t\t}\n\t}", "function hideMenuO...
[ "0.72464377", "0.69647926", "0.69525725", "0.6914184", "0.68763477", "0.6858389", "0.6832779", "0.6817373", "0.674658", "0.6658307", "0.66300434", "0.6626138", "0.66064495", "0.6568991", "0.6566908", "0.655616", "0.654815", "0.65414965", "0.653671", "0.6535922", "0.65217125",...
0.63271326
49
Open the side menu when small screen.
function openSideMenu($mdMenu, event) { $mdMenu.open(event); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggleMenuInMobile () {\n try {\n const windowWidth = window.innerWidth\n if (windowWidth > MENU_HIDE_WIDTH) return\n const toggleEle = document.getElementsByClassName('sidebar-toggle')\n toggleEle[0].click()\n } catch (error) {}\n }", "function OpenSideMenu() {\n if ($(\"body\").ha...
[ "0.7585324", "0.7527829", "0.74937093", "0.73204434", "0.7317244", "0.71583384", "0.71583384", "0.71209353", "0.71030855", "0.7095385", "0.707023", "0.70572174", "0.70569587", "0.70569587", "0.6974056", "0.697311", "0.69715756", "0.69659543", "0.69659543", "0.6965252", "0.694...
0.71232843
7
Open favorite selected tooltip.
function showFavoriteToast() { $mdToast.show({ hideDelay: 3000, position: 'top right', controller: 'ToastController', controllerAs: 'toast', templateUrl: 'fav_toast_template.html', bindToController: true }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "tooltipClicked() {}", "function openTooltip(row, col, action) {\n\t\t\tconsole.log(\"tooltip opened\", row, col, action);\n\t\t}", "function positionFavToolTip(tipdiv, icon) {\n var likeSym = icon.attr('src');\n if (likeSym.indexOf('Yellow') === -1) {\n tipdiv[0].innerHTML = 'Unmark Favorite';\n ...
[ "0.6379989", "0.61024755", "0.59959525", "0.59472454", "0.59302825", "0.59131324", "0.58705443", "0.58630896", "0.5851942", "0.58032167", "0.573925", "0.5735299", "0.5717863", "0.5707356", "0.5691553", "0.56903785", "0.56903785", "0.56903785", "0.56903785", "0.56903785", "0.5...
0.0
-1
Go to requested URL..
function navigateTo(url){ $window.open(url, '_blank'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function goToUrl(url) {\n\tlocation.href = url;\n}//end goToUrl", "function gotoURL(location) {document.location=location;}", "function gotoURL(url){\r\n\tdocument.location.href = url;\r\n}", "function gotoURL(url){\n\twindow.location=url;\n}", "function gotoURL(url){\n\twindow.location=url;\n}", "functi...
[ "0.72707605", "0.7268128", "0.71793854", "0.71392524", "0.71392524", "0.70997506", "0.7072296", "0.7005128", "0.68039715", "0.66246307", "0.65706575", "0.6469302", "0.64624864", "0.64185584", "0.6386184", "0.6375138", "0.63592535", "0.63289505", "0.6302043", "0.6266948", "0.6...
0.0
-1
Checks for validity of common search params (non resource specific).
function validateCommonParams(params, onSuccess, onError) { var countRegExp = /^\d+$/; var errors = []; // validate _count if (params._count) { // _count should be an integer if (!countRegExp.test(params._count)) { errors.push(validationErrors.INVALID_COUNT); } } // FHIR _sort param takes different forms (_sort=propName, _sort:asc=propName, _sort:desc=propName) // this is reflected in the query as three different query parameters. if (hasMoreThanOneSortParameter(params)) { // FHIR supports multiple _sort parameters but JDS does not, so we allow only one _sort query parameter. errors.push(validationErrors.TOO_MANY_SORT_PARAMS); } if (errors.length > 0) { onError(errors); } else { onSuccess(); // all common parameters passed validation } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkSearchParam(search) {\n check(search, String);\n }", "function check_params(params){\n for(var i=0; i < params.length; i ++){\n if(!params_search[params[i]]){\n return false\n }\n }\n return true;\n }", "function ...
[ "0.7056248", "0.67399013", "0.6473527", "0.63690734", "0.63413846", "0.62511694", "0.62457293", "0.62457293", "0.62457293", "0.62457293", "0.62457293", "0.62457293", "0.62457293", "0.62457293", "0.62457293", "0.62457293", "0.62457293", "0.62457293", "0.62457293", "0.62457293", ...
0.7054256
1
Returns a date range query that includes the missing date specificity (if any). A date that specifies year, month, date but not time will search for a range within that day (from 00:00 to 23:59), a date that specifies year, month, but not date, will search for a range within that month (from 1st day to the last), and so forth. Note: JDS has a granularity of minutes. Ex. 20150126T01:23:45 Exact search 20150126 Between 20150126T00:00 and 20150126T23:59 (inclusive) 201501 Between 20150101T00:00 and 20150131T23:59 (inclusive) 2015 Between 20150101T00:00 and 20151231T23:59 (inclusive)
function buildImplicitDateRangeQuery(dateStr, jdsProperty, isNegated, ignoreTime, includeSeconds) { var query = ''; if (YYYY_MM_DD_HH_MM_SS_Regex.test(dateStr)) { // this is an exact match search query = getExactDateQuery(new Date(dateStr), jdsProperty, isNegated, ignoreTime, true); } else { query = getDateRangeQuery(getDateRange(dateStr), jdsProperty, isNegated, ignoreTime, includeSeconds); } return query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupDateQuery( params ) {\n if( 'all' !== params.dateFrom ) {\n // we will not always provide a time range\n if( !params.duration && !params.dateTo ) {\n params.duration = 'day';\n }\n\n if( 'now' === params.dateFro...
[ "0.60283846", "0.5931526", "0.5931526", "0.5898166", "0.5627309", "0.56107116", "0.5594415", "0.5552875", "0.5550687", "0.5550687", "0.5547632", "0.549748", "0.54855233", "0.53691137", "0.5366445", "0.53458875", "0.5334486", "0.53310484", "0.5328851", "0.5316035", "0.53124607...
0.68885946
0
Returns a date range where the start date is inclusive and the end date is exclusive.
function _getDateRange(dateStr, granularity) { var start = new Date(dateStr); var end = new Date(dateStr); switch (granularity) { case 'year': end.setUTCFullYear(end.getUTCFullYear() + 1); break; case 'month': end.setUTCMonth(end.getUTCMonth() + 1); break; case 'day': end.setUTCDate(end.getUTCDate() + 1); break; } return { inclusiveStart: start, exclusiveEnd: end }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DateRange(start, end) {\n if (start === void 0) {\n start = null;\n }\n if (end === void 0) {\n end = null;\n }\n this.start = start;\n this.end = end;\n }", "function $R(start, end, exclusive) {\n return new ObjectRan...
[ "0.7164459", "0.6706143", "0.6672647", "0.65351856", "0.65351856", "0.6472308", "0.6406881", "0.64038455", "0.636442", "0.6354096", "0.62863606", "0.62810355", "0.62770015", "0.6275293", "0.6262072", "0.6257856", "0.6240677", "0.6220563", "0.6194373", "0.6193076", "0.61842734...
0.5865899
36
Returns true if there's a sort parameter specified and its criteria has a mapped property.
function isSortCriteriaValid(params, fhirToJDSSortMap) { if (nullchecker.isNotNullish(params._sort)) { return nullchecker.isNotNullish(fhirToJDSSortMap[params._sort]); } else if (nullchecker.isNotNullish(params['_sort:asc'])) { return nullchecker.isNotNullish(fhirToJDSSortMap[params['_sort:asc']]); } else if (nullchecker.isNotNullish(params['_sort:desc'])) { return nullchecker.isNotNullish(fhirToJDSSortMap[params['_sort:desc']]); } else { return true; // there's no _sort parameter, thus it is not invalid } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isSortingRequired() {\n const entriesType = this.getEntriesType();\n const { isSortingRequired = false } = this.props.state.entries[entriesType];\n\n return isSortingRequired;\n }", "_isSorted() {\n return this._sort.active == this.id &&\n (this._sort.direction === 'asc'...
[ "0.6573961", "0.6372966", "0.6372966", "0.59564346", "0.5885027", "0.569908", "0.5341275", "0.53161395", "0.52838004", "0.5260939", "0.51858646", "0.5172329", "0.51653075", "0.51653075", "0.51466787", "0.51355976", "0.51302564", "0.51179063", "0.510106", "0.5091016", "0.50770...
0.6775237
0
Post / Router CB
function getBanMain (req, res){ res.send("메인배너"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "post(...args) {\n this.route('post', ...args);\n }", "post(uri, action) {\n\n this.route('POST', uri, action);\n }", "function POST(){\n \n}", "function Post() {}", "function postRESTlet(datain) {\n\n}", "handleSubmit(val) {\n val.id = uuid()\n val.timestamp = Date....
[ "0.68558985", "0.6849009", "0.6802756", "0.6722503", "0.65469474", "0.6508485", "0.64831126", "0.64621675", "0.64328134", "0.6425097", "0.6380548", "0.62980235", "0.6257236", "0.6250193", "0.6210722", "0.61699176", "0.6166567", "0.6133692", "0.6129557", "0.60990965", "0.60826...
0.0
-1
Delete All Items with Sweet Alert Library
function del_all_item(){ Swal.fire({ title: 'Are you sure?', text: "You Want to Delete Whole TODO List!", icon: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'Yes, delete it!' }).then((result) => { if (result.value) { li.innerHTML=""; Swal.fire( 'Deleted!', 'Your TODO List Has Been Deleted.', 'success' ) } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function postDelete() {\n console.log('item deleted');\n swal({\n title: \"Dare Approved!\",\n icon: \"success\",\n button: \"Done\"\n })\n .then( () => {\n location.reload();\n })\n }", "handleDeleteButtonClick() {\n Alert.alert(\"Hold on!\", \"Are you sure you want to cle...
[ "0.6923511", "0.6760819", "0.6533076", "0.65206444", "0.6511105", "0.6489903", "0.6449423", "0.6402988", "0.6351242", "0.6327346", "0.63090575", "0.62964463", "0.62917703", "0.6267454", "0.6261281", "0.6260393", "0.6259438", "0.6249951", "0.62380636", "0.62273246", "0.6222594...
0.8119842
0
Delete a Single li
function delete_li(rm){ rm.parentNode.remove() sweetAlertSuccessMsg("Deleted Successfully") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteListItem(){\n \t\t$(this).parent().remove();\n \t}", "function deleteListItem(li){\n\t\tli.classList.add(\"delete\")\n\t\tsaveData();\n\t}", "function deleteListItem() {\n\tthis.parentNode.remove();\n}", "function deleteListItem(){\n\t\tli.classList.add(\"delete\")\n\t\tsaveData();\n\t}", "f...
[ "0.81266326", "0.805042", "0.7907465", "0.7817413", "0.780877", "0.77975583", "0.77823526", "0.7739577", "0.7581431", "0.7575069", "0.7570064", "0.7533381", "0.7494372", "0.7482356", "0.7442627", "0.74157596", "0.7361855", "0.7302598", "0.73001176", "0.7259684", "0.72549087",...
0.7640191
8
AnalyticalForm has the form for adding/editing an analytical method
function AnalyticalForm(props) { const { id } = props.match.params; const defaultState = { id: '', residueType: '', reason: '', }; const [state, setState] = useState(defaultState); useEffect(() => { setState(id ? Get(id) : state) }, []); const classes = formStyle(); const handleChange = name => event => { const newState = { ...state, [name]: event.target.value, } if (!newState.id || (newState.id && newState.id.length === 0)) { newState.error = 'Must provide an ID' } else { newState.error = null; } setState(newState); }; const handleChangeID = event => { const newId = event.target.value; const newState = { ...state, id: newId, error: Get(newId) ? 'ID Already Taken' : null, } setState(newState); } const inputLabel = useRef(null); const [labelWidth, setLabelWidth] = useState(0); useEffect(() => { setLabelWidth(inputLabel.current.offsetWidth); }, []); return ( <Card className={classes.card}> <CardContent className={classes.content}> <FormControl className={classes.formControl}> <TextField required label={state.error ? state.error : 'Analytical Method Id'} className={clsx(classes.textField, classes.dense)} onChange={handleChangeID} margin="dense" disabled={id ? true : false} error={state.error ? true : false} variant="outlined" value={state.id} inputProps={{ name: 'id', id: 'analytical-method-id', }} /> </FormControl> <FormControl variant="outlined" className={classes.formControl}> <InputLabel ref={inputLabel} htmlFor="residue-type"> Target Residue Type</InputLabel> <Select native required onChange={handleChange('residueType')} labelWidth={labelWidth} value={state.residueType} inputProps={{ name: 'residueType', id: 'analytical-residue-type', }} > <option value="" /> <option value={ResidueTypes.API}>API</option> <option value={ResidueTypes.CLEANINGAGENT}>Cleaning Agent</option> <option value={ResidueTypes.BIOBURDEN}>Bioburden</option> <option value={ResidueTypes.ENDOTOXIN}>Endotoxin</option> </Select> </FormControl> {state.residueType === ResidueTypes.API && ( <Api onChange={handleChange(ResidueTypes.API)} passedState={state[ResidueTypes.API]} /> )} {state.residueType === ResidueTypes.CLEANINGAGENT && ( <Api onChange={handleChange(ResidueTypes.CLEANINGAGENT)} passedState={state[ResidueTypes.CLEANINGAGENT]} /> )} {state.residueType === ResidueTypes.BIOBURDEN && ( <BioBurden onChange={handleChange(ResidueTypes.BIOBURDEN)} passedState={state[ResidueTypes.BIOBURDEN]} /> )} {state.residueType === ResidueTypes.ENDOTOXIN && ( <BioBurden onChange={handleChange(ResidueTypes.ENDOTOXIN)} passedState={state[ResidueTypes.ENDOTOXIN]} /> )} <FormControl className={classes.formControl}> <TextField label="Reason" required className={clsx(classes.textField, classes.dense)} margin="dense" variant="outlined" onChange={handleChange('reason')} value={state.reason} inputProps={{ name: 'reason', id: 'analytical-reason', }} /> </FormControl> </CardContent> <CardActions className={classes.footer}> <CancelButton /> <AddButton state={state} id={id} setState={setState} /> </CardActions> </Card> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initalizeForm() {\n const self = this;\n\n self.annotonPresentation = self.getAnnotonPresentation(this.annoton);\n\n }", "function showAddCommitmentForm() {\n vm.form.data = {\n category: null,\n question: null,\n name: null,\n descrip...
[ "0.60106176", "0.598269", "0.596071", "0.58828056", "0.57380515", "0.5691426", "0.56898594", "0.56729406", "0.5641293", "0.56308436", "0.5615289", "0.5585626", "0.5571221", "0.55293334", "0.5523767", "0.55224425", "0.5509165", "0.55056524", "0.54985416", "0.54963344", "0.5489...
0.0
-1
This function sends queries to the database.
static sendQuery(querySql, values) { // if (!PRODUCTION) console.log(querySql); // console.log(querySql, values); return new Promise((conResolve, conReject) => { Database.pgPool .connect() .then((client) => { client .query(querySql, values) .then((res) => { client.release(); if (typeof res === 'undefined') conReject(DBerror(UndefinedResponseFromDBerror(querySql))); else conResolve(res); }) .catch((err) => { client.release(); conReject(DBerror(err)); }); }) .catch((err) => conReject(DBerror(err))); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startDatabaseQueries() {\n \n}", "function insertQueries() {\n\n }", "function sendToDb(query, res) {\r\n db.query(query, function(err, result, fields) {\r\n if (err) throw err;\r\n res.send(JSON.stringify(result));\r\n });\r\n}", "function dataSend() {\n let db;\n cons...
[ "0.66073716", "0.6598347", "0.65592563", "0.63509196", "0.63233113", "0.63177323", "0.6280197", "0.62481683", "0.6143666", "0.6129651", "0.6128728", "0.6120145", "0.6045701", "0.5949512", "0.59222364", "0.58208126", "0.58044523", "0.5800562", "0.5779704", "0.57695174", "0.576...
0.6212807
8
USERS This function authenticates a user.
static authenticate(email, password) { return new Promise((resolve, reject) => { // if (!PRODUCTION) console.log('==> AUTHENTICATING: ' + email); Database.sendQuery('SELECT * FROM Users WHERE( email = $1);', [email]) .then((result) => { if (typeof result !== 'undefined' && result.command === 'SELECT') { if (result.rows.length > 0 && bcrypt.compareSync(password, result.rows[0].password)) { // if (!PRODUCTION) console.log('==> AUTHENTICATION: succesful'); delete result.rows[0].password; result.rows[0].apikey = Authentication.generateApiKey(); resolve(result.rows[0]); } else { // if (!PRODUCTION) console.log('==> AUTHENTICATION: failed'); resolve(false); } } else { // if (!PRODUCTION) console.log('==> AUTHENTICATION: error'); reject(result); } }) .catch((err) => reject(err)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function authenticateUser(users) {\n\t\tvar inputtedUsername = logInInput.value;\n\t\tvar inputtedPassword = passwordInput.value;\n\n\t\tvar user = users[inputtedUsername];\n\n\t\tif (!user) {\n\t\t\t//console.log('this user doesnt exist');\n\t\t\tlogInInput.style.border = \"2px solid red\";\n\t\t\treturn;\n\t\t} ...
[ "0.7231724", "0.64866996", "0.64795846", "0.64740604", "0.64390206", "0.6410017", "0.6328083", "0.62993395", "0.629543", "0.62654674", "0.6264083", "0.6243453", "0.61715597", "0.61701363", "0.6115361", "0.6088407", "0.6069733", "0.60605156", "0.60404867", "0.6008794", "0.5990...
0.0
-1
This function registers a user.
static register(fname, lname, email, password) { password = bcrypt.hashSync(password, bcrypt.genSaltSync(saltRounds)); // if (!PRODUCTION) console.log('==> REGISTER: ' + email + ' |' + apikey); return new Promise((resolve, reject) => { Database.sendQuery('INSERT INTO Users (email,firstname,lastname,password) VALUES($1,$2,$3,$4) RETURNING email,firstname,lastname;', [email, fname, lname, password]) .then((response) => { // if (!PRODUCTION) console.log('REGISTER RESPONSE'); if (response.rows.length > 0) { response.rows[0].apikey = Authentication.generateApiKey(); resolve(response.rows[0]); } else reject(response); }) .catch((err) => { // console.log(err); reject(err); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function registerUser() {\n addUser()\n }", "function register() {\n User.register(self.user, handleLogin);\n }", "function registerNewUser() {\n USER_NAME = buildNewName();\n USER_PWD = buildNewPassword();\n register(USER_NAME, USER_PWD);\n}", "async registerUser(userInfo) {}", "_re...
[ "0.8637759", "0.80544025", "0.7889753", "0.781563", "0.76923877", "0.755642", "0.7521202", "0.74518263", "0.7437121", "0.7423133", "0.7374457", "0.737361", "0.72567236", "0.72340685", "0.72155195", "0.71614724", "0.7154832", "0.7154334", "0.7154334", "0.7149961", "0.71461034"...
0.0
-1
DATA SOURCE This function is to get a list of data sources
static async getDataSourceList(email) { return new Promise((resolve, reject) => { Database.sendQuery('SELECT id,email,sourceurl,sourcetype,sourcename,islivedata FROM datasource WHERE ( email = $1);', [email]) .then((result) => resolve(result.rows)) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findDynamicSources()\r\n{\r\n var retList = new Array();\r\n\r\n var siteURL = dw.getSiteRoot()\r\n\r\n if (siteURL.length)\r\n {\r\n var bindingsArray = dwscripts.getListValuesFromNote(siteURL, \"URL\");\r\n if (bindingsArray.length > 0)\r\n {\r\n retList.push(new DataSource(MM.LABEL_UR...
[ "0.69505996", "0.68402463", "0.67220104", "0.664959", "0.6577464", "0.65631235", "0.6468408", "0.64209497", "0.6339844", "0.63275266", "0.63094187", "0.62313014", "0.6183113", "0.61714923", "0.6161989", "0.603945", "0.6023517", "0.5970847", "0.59579223", "0.5919348", "0.59132...
0.6550305
6
This function is to add a data source
static async addDataSourceRemote(email, sourceURL, sourceType, sourceName, isLiveData) { return new Promise((resolve, reject) => { Database.sendQuery('INSERT INTO datasource (email, sourceurl, sourceType, sourceName, isLiveData) VALUES ($1,$2,$3,$4,$5) RETURNING *;', [ email, sourceURL, sourceType, sourceName, isLiveData, ]) .then((result) => { if (result.rows.length > 0) resolve(result.rows[0]); else reject(result); }) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addSource(source) {\n this._data.source = source;\n }", "function addSource(data) {\n return fetch({\n url: 'source/create',\n method: 'POST',\n data\n });\n}", "function dwscripts_popupDataSource(dsFileName, argument)\n{\n // call the addDynamicSource function in the given file\n var co...
[ "0.7715312", "0.6631875", "0.648013", "0.6473448", "0.6449389", "0.6397218", "0.63915396", "0.6384654", "0.63092446", "0.62554806", "0.62409955", "0.6171082", "0.612293", "0.6070355", "0.59991163", "0.59757817", "0.58698124", "0.5828819", "0.58213776", "0.5820316", "0.5810261...
0.61579573
12
This function is to add a data source
static async addDataSourceLocal(email, sourceURL, sourceType, sourceName, sourceMeta, sourceData) { if (sourceType === 3) { sourceData = Buffer.from(sourceData).toString('base64'); } else { sourceData = JSON.stringify(sourceData); } // console.log(sourceData); return new Promise((resolve, reject) => { Database.sendQuery('INSERT INTO datasource (email, sourceurl, sourceType, sourceName, sourceMeta, sourceData, isLiveData) VALUES ($1,$2,$3,$4,$5,$6,$7) RETURNING *;', [ email, sourceURL, sourceType, sourceName, JSON.stringify(sourceMeta), sourceData, false, ]) .then(async (result) => { if (result.rows.length > 0) resolve(result.rows[0]); else reject(result); }) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addSource(source) {\n this._data.source = source;\n }", "function addSource(data) {\n return fetch({\n url: 'source/create',\n method: 'POST',\n data\n });\n}", "function dwscripts_popupDataSource(dsFileName, argument)\n{\n // call the addDynamicSource function in the given file\n var co...
[ "0.7715312", "0.6631875", "0.648013", "0.6473448", "0.6449389", "0.63915396", "0.6384654", "0.63092446", "0.62554806", "0.62409955", "0.6171082", "0.61579573", "0.612293", "0.6070355", "0.59991163", "0.59757817", "0.58698124", "0.5828819", "0.58213776", "0.5820316", "0.581026...
0.6397218
5
This function is to update a data source
static async updateDataSource(email, dataSourceID, dataSourceName) { return new Promise((resolve, reject) => { Database.sendQuery('UPDATE datasource SET sourceName=$3 WHERE ( email = $1) AND ( ID = $2) RETURNING *;', [email, dataSourceID, dataSourceName]) .then((result) => { if (result.rows.length > 0) resolve(result.rows[0]); else reject(result); }) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refreshSourceDatas() {\n sourceDataService.findSourceData(\"\").then(\n // Success\n function(response) {\n sourceDatas = response.sourceDatas;\n refreshSourceDataTable();\n });\n }", "function refreshSourceDataTable() {\n console.debug('Refreshing table with values', sourceDat...
[ "0.7457908", "0.7315093", "0.7036375", "0.7018", "0.6795442", "0.66365325", "0.6502029", "0.64686435", "0.6458288", "0.6449679", "0.6440337", "0.6422515", "0.6419076", "0.6399757", "0.63748085", "0.63710153", "0.62837553", "0.6238089", "0.6229691", "0.62223595", "0.61925745",...
0.5790509
56
This function is to remove a data source
static async removeDataSource(email, dataSourceID) { return new Promise((resolve, reject) => { Database.sendQuery('DELETE FROM datasource WHERE ( email = $1) AND ( ID = $2);', [email, dataSourceID]) .then((result) => resolve(result.rows)) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeSource(source) {\n const sourceIdx = this._sources.findIndex((s) => s === source);\n if (sourceIdx > -1) {\n arrayRemoveAt(this._sources, sourceIdx);\n source.dispose();\n }\n }", "function deleteSource(oid)\n{\n $.parse.delete('sources/' + oid, function(jso...
[ "0.6923161", "0.63919204", "0.62256336", "0.62021405", "0.6170509", "0.6117001", "0.607311", "0.60380137", "0.6021545", "0.6016487", "0.5956192", "0.5955829", "0.5945504", "0.59348667", "0.5897498", "0.5897498", "0.5660677", "0.5658116", "0.5651361", "0.5644043", "0.5628527",...
0.647706
1
==================DASHBOARDS=============== This function is to get a dashboard list
static async getDashboardList(email) { return new Promise((resolve, reject) => { Database.sendQuery('SELECT * FROM Dashboard WHERE (email = $1);', [email]) .then((result) => resolve(result.rows)) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDashboardData(){\n var _serviceURI = '';\n $.each(DATA_METRICS_ARR, function(_index, _dataset){\n if((DATA_METRICS_ARR[_index] !== 'NA')){\n objloadedArr.push(DATA_METRICS_ARR[_index]);\n _serviceURI = DATA_SERVICE_URI + \"?dataset=\" + _dataset + ...
[ "0.67525214", "0.6546999", "0.63813317", "0.6291129", "0.62032723", "0.61814374", "0.61624265", "0.61431384", "0.61088717", "0.6051023", "0.6049563", "0.6040764", "0.6038037", "0.59621084", "0.5952256", "0.5867129", "0.584752", "0.58171797", "0.5793114", "0.57908624", "0.5776...
0.62269497
4
This function adds a dashboard.
static async addDashboard(email, name, desc, metadata) { return new Promise((resolve, reject) => { Database.sendQuery('INSERT INTO Dashboard (Name,Description,email,metadata) VALUES ($1,$2,$3,$4) RETURNING *;', [name, desc, email, JSON.stringify(metadata)]) .then((result) => { // console.log(result); if (result.rows.length > 0) resolve(result.rows[0]); else reject(result); }) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newDashboard() {\r\n\t\t\treturn $izendaRsQuery.query('newcrs', ['DashboardDesigner'], {\r\n\t\t\t\tdataType: 'json'\r\n\t\t\t},\r\n\t\t\t// custom error handler:\r\n\t\t\t{\r\n\t\t\t\thandler: function () {\r\n\t\t\t\t\treturn 'Failed to create new dashboard';\r\n\t\t\t\t},\r\n\t\t\t\tparams: []\r\n\t\t\...
[ "0.6828042", "0.65590954", "0.64667284", "0.6252167", "0.6248012", "0.61539525", "0.61025417", "0.60104656", "0.5931182", "0.58997107", "0.58325845", "0.58136743", "0.5784717", "0.5781746", "0.57746947", "0.5765361", "0.57632524", "0.5677169", "0.5582797", "0.55572206", "0.55...
0.5208261
29
This function removes a dashboard.
static async removeDashboard(email, dashboardID) { return new Promise((resolve, reject) => { Database.sendQuery('DELETE FROM Dashboard WHERE ( email = $1 ) AND ( ID = $2);', [email, dashboardID]) .then((result) => resolve(result.rows)) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearDashboard() {\n \n while (dashboard.firstChild) {\n dashboard.removeChild(dashboard.firstChild);\n }\n}", "function deleteCreation(id){\n $(\"#currentCreation\").remove();\n $(\"#making\").slideUp(\"slow\");\n var widget=GetWidget(id);\n var idPanel= widget.panel;\n var panel=G...
[ "0.7051651", "0.6123528", "0.6077937", "0.5962638", "0.5910711", "0.5885954", "0.5751077", "0.57187843", "0.56767976", "0.5627682", "0.56218934", "0.5583366", "0.5539705", "0.5539109", "0.5530348", "0.5530348", "0.5527614", "0.55030346", "0.5488734", "0.5474143", "0.5470423",...
0.74165434
0
This function update a dashboard.
static async updateDashboard(email, dashboardID, fields, data) { data = data.map((item, i) => (i < fields.length && fields[i] === 'metadata' ? JSON.stringify(item) : item)); return new Promise((resolve, reject) => { Database.sendQuery(`UPDATE Dashboard SET ${fieldUpdates(fields, data, 2)} WHERE ( email = $1 ) AND ( ID = $2) RETURNING *;`, [email, dashboardID, ...data]) .then((result) => { // console.log(result); if (result.rows.length > 0) resolve(result.rows[0]); else reject(result); }) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateDashboard() {\n request\n .get(\"https://dsrealtimefeed.herokuapp.com/\")\n .end(function(res) {\n console.log(\"Pinged Dashboard, \" + res.status)\n if(res.status != 200) {\n stathat.trackEZCount(config.STATHAT, 'dsrealtime-feed-cant_ping', 1, function(status, response){});\...
[ "0.70669836", "0.6812702", "0.6804895", "0.6512717", "0.6503218", "0.6297381", "0.6210645", "0.62055343", "0.60833675", "0.6001562", "0.591717", "0.5841518", "0.5799417", "0.5745279", "0.5697702", "0.5694805", "0.5665971", "0.56610817", "0.5621063", "0.5595451", "0.5594273", ...
0.6045793
9
GRAPHS This function is used to get a list of graphs.
static async getGraphList(email, dashboardID) { return new Promise((resolve, reject) => { Database.sendQuery('SELECT g.* from graph as g join (SELECT * from dashboard as d WHERE (d.email = $1) AND (d.id = $2)) as de on (g.dashboardid=de.id);', [email, dashboardID]) .then((result) => resolve(result.rows)) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawAllGridGraphs() {\n // bucket the grid graphs by number of edges\n var gg_list = []\n for (var i=0; i<=6; i++) {\n gg_list[i] = [];\n }\n \n for (var i=0; i<64; i++) {\n var edges_on = computeGridGraphNoEdges(i);\n var n_edges = edges_on.length;\n gg_list[n_edges].push(i);\n }\n \n...
[ "0.62509817", "0.62508154", "0.61527437", "0.6102442", "0.60972035", "0.57372195", "0.567425", "0.5500317", "0.53657454", "0.5306064", "0.5238956", "0.51961464", "0.5181526", "0.5177458", "0.5127694", "0.5091358", "0.5087445", "0.50514096", "0.5047456", "0.5043607", "0.503444...
0.5222326
11
This function is used to add a graph to a dashboard.
static async addGraph(email, dashboardID, title, options, metadata) { let query = 'INSERT INTO GRAPH as g (dashboardid, title, metadata, options) (SELECT $1,$2,$3,$4 WHERE EXISTS (SELECT $5 FROM dashboard AS d WHERE (d.email = $5) AND (d.ID = $1)) ) RETURNING g.*'; return new Promise((resolve, reject) => { Database.sendQuery(query, [dashboardID, title, JSON.stringify(metadata), JSON.stringify(options), email]) .then((result) => { // console.log(result); if (result.rows.length > 0) resolve(result.rows[0]); else reject(result); }) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addToGraphs() {\n if (data.getNumberOfRows() >= 5) {\n\t\tdata.removeRow(0);\n\t\tdataViaAjax();\n\t\tdrawChart();\n\t }\n\t }", "function updateDashboard() {\n setGraph1();\n setGraph2();\n setGraph3();\n}", "function createGraph()\n\t{\n\t\tgraph = that.add('graph', {\n\t\t\tw: that....
[ "0.6496089", "0.6370459", "0.6365461", "0.6352829", "0.6338957", "0.63205457", "0.6247306", "0.6183056", "0.6176735", "0.6126419", "0.606333", "0.604698", "0.6016476", "0.59790146", "0.59727335", "0.5968875", "0.59336907", "0.59187734", "0.58724236", "0.58718795", "0.5847641"...
0.63741547
1
This function is used to remove a graph from a dashboard
static async removeGraph(email, dashboardID, graphID) { let query = 'DELETE FROM Graph as g WHERE (g.dashboardid in ( SELECT d.id from dashboard as d WHERE (d.email = $1) AND (d.id = $2))) AND (g.ID = $3);'; return new Promise((resolve, reject) => { Database.sendQuery(query, [email, dashboardID, graphID]) .then((result) => resolve(result.rows)) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dashboard_clear() {\n d3.select(\"#dashboard\").selectAll(\"svg\").remove();\n}", "function removeChart() {\n chart.destroy();\n }", "function removePlots() {\n d3.selectAll(\".nodes\").remove();\n d3.selectAll(\".link\").remove();\n d3.selectAll(\".axis-label...
[ "0.7502893", "0.74222326", "0.73481625", "0.7343071", "0.7281553", "0.71578777", "0.7153525", "0.714955", "0.7134828", "0.7095677", "0.7078533", "0.7078533", "0.70490766", "0.70324016", "0.70142543", "0.69382024", "0.6936596", "0.68561965", "0.6814677", "0.6782755", "0.672783...
0.66567785
22
This function is used to remove a graph from a dashboard
static async updateGraph(email, dashboardID, graphID, fields, data) { data = data.map((item, i) => (i < fields.length && (fields[i] === 'metadata' || fields[i] === 'options') ? JSON.stringify(item) : item)); let query = `UPDATE Graph as g SET ${fieldUpdates(fields, data, 3)} WHERE ( g.dashboardid in ( SELECT d.id from dashboard as d WHERE (d.email = $1) AND (d.id = $2)) ) AND (g.ID = $3) RETURNING *;`; return new Promise((resolve, reject) => { Database.sendQuery(query, [email, dashboardID, graphID, ...data]) .then((result) => { // console.log(result); if (result.rows.length > 0) resolve(result.rows[0]); else reject(result); }) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dashboard_clear() {\n d3.select(\"#dashboard\").selectAll(\"svg\").remove();\n}", "function removeChart() {\n chart.destroy();\n }", "function removePlots() {\n d3.selectAll(\".nodes\").remove();\n d3.selectAll(\".link\").remove();\n d3.selectAll(\".axis-label...
[ "0.75021344", "0.7423443", "0.7348459", "0.73439497", "0.72818744", "0.7158423", "0.715423", "0.71490955", "0.71360075", "0.7096893", "0.7078999", "0.7078999", "0.7049256", "0.70321274", "0.7014823", "0.6938647", "0.6936166", "0.68575794", "0.6815849", "0.678256", "0.67288655...
0.0
-1
This function is used to convert lists of fields and data into comma seperated field=data pairs
function fieldUpdates(fields, data, offset) { offset = offset || 0; let index = -1; fields = fields.filter((field, i) => { if (field === 'email') { index = i; return false; } else return true; }); if (index >= 0) data.splice(index, 1); let output = ''; for (let i = 0; i < fields.length && i < data.length; i++) { const d = i + offset + 1; output = output + ' ' + fields[i] + ' = $' + d + (i < fields.length - 1 && i < data.length - 1 ? ', ' : ''); } return output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "formatFields(fields, data) {\n let formattedData = [];\n // For every data returned from Neo4j\n for(let i = 0; i < data.length; i++) {\n let obj = {};\n // For every fields\n for(let j = 0; j < data[i]._fields.length; j++) {\n let key = fields[j...
[ "0.6792498", "0.6451665", "0.6414086", "0.6320202", "0.6320202", "0.6308459", "0.6308459", "0.6308459", "0.6308459", "0.6308459", "0.5914448", "0.5824572", "0.579258", "0.57868624", "0.57794344", "0.5776861", "0.57339877", "0.5732398", "0.56852293", "0.56807995", "0.56510323"...
0.5865172
11
This function is used to return a error if any custom errors occurs.
function UndefinedResponseFromDBerror(querySql) { return { table: undefined, code: 99999, routine: 'undefinedResponseFromDatabase', hint: undefined, detail: 'Query Sent: ' + querySql, }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CustomError() {}", "get hasError() {\n return this._customError == null ? this._getDefaultError() : this._customError;\n }", "defineCustomErrors() {\n this.restifyErrors.InvalidTokenError = this.restifyErrors.makeConstructor('InvalidTokenError', {\n statusCode: 404,\n ...
[ "0.8013928", "0.6957574", "0.6607771", "0.6607448", "0.6607448", "0.6575326", "0.6575326", "0.64419395", "0.6425787", "0.63371867", "0.6332238", "0.6323492", "0.6323492", "0.6323492", "0.6323492", "0.6322886", "0.62674284", "0.6251813", "0.62160426", "0.62103516", "0.62058824...
0.0
-1
! vuex v3.4.0 (c) 2020 Evan You
function i(t){var e=Number(t.version.split(".")[0]);if(e>=2)t.mixin({beforeCreate:r});else{var n=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[r].concat(t.init):r,n.call(this,t)}}function r(){var t=this.$options;t.store?this.$store="function"===typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFieldVuex() {\n return store.getters.dataField;\n }", "getProfileVuex() {\n return store.getters.dataProfile;\n }", "function vuexInit(){var options=this.$options;// store injection\n\tif(options.store){this.$store=options.store;}else if(options.parent&&options.parent.$store){this.$store=options.par...
[ "0.67712444", "0.66986936", "0.66612864", "0.6331386", "0.63084495", "0.6247302", "0.6247302", "0.6247302", "0.62384593", "0.6236988", "0.61336607", "0.6127329", "0.606848", "0.60579044", "0.60579044", "0.60579044", "0.60579044", "0.60579044", "0.6051181", "0.60426307", "0.60...
0.0
-1
A callback function for logging out the current user
signOut() { /* Sign out the user, and update the state */ console.log('Signing out'); firebase.auth().signOut(); this.updateParent({ currentUser: null, points: '', name: '' }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "logOut() {\n authContextApi.logOut();\n }", "function _onLogout() {\n\t sitools.userProfile.LoginUtils.logout();\n\t}", "logoutUser() {\n // Only call change user if the elevio library has been loaded.\n this._callIfElevioIsLoaded('logoutUser');\n }", "logOutCurrentUser() {\n v...
[ "0.78584677", "0.78573793", "0.7797249", "0.774198", "0.769203", "0.7674748", "0.76706636", "0.76639867", "0.7661032", "0.76554364", "0.7653651", "0.76401776", "0.7607831", "0.7564663", "0.7535144", "0.75282425", "0.7520898", "0.7500509", "0.7499519", "0.74872684", "0.7484931...
0.0
-1
500 algo fatal 404 no se encotro 200 exitoso
function index(req,res){ const stat = fs.statSync('./index.html') res.writeHead(200,{ "Content-Type":"text/html", "Content-Lenght":stat.size }) const readStream = fs.createReadStream('./index.html'); readStream.pipe(res) //res.write("index"); //res.end(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function f404(data,res) {\n res.setHeader('Content-Type', 'application/json');\n res.status(404);\n res.end(JSON.stringify({\"error\":-1,\"message\":\"404\"}));\n}", "function notFound() {\n statusCode = 404;\n outputFile = \"404.html\";\n }", "function handle404(request, ...
[ "0.74265224", "0.73839957", "0.71973926", "0.7029802", "0.70157045", "0.6952865", "0.69446653", "0.69146496", "0.6905965", "0.68862236", "0.687699", "0.6872372", "0.6809381", "0.68077534", "0.68045896", "0.67982876", "0.67867714", "0.6784783", "0.6783668", "0.67831796", "0.67...
0.0
-1
update only on end
onFinishChange ( f ) { if( this.isSpace ) return; this.callback = null; this.endCallback = f; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update(){}", "update(){}", "update(){}", "async update() {}", "updated() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "function update() {}", "update(startingData) {}", "afterUpdate() {}",...
[ "0.75757736", "0.75757736", "0.75757736", "0.7292816", "0.71981156", "0.7174234", "0.7174234", "0.7174234", "0.7174234", "0.7174234", "0.7174234", "0.7174234", "0.7174234", "0.7174234", "0.7042504", "0.70152956", "0.6973664", "0.69539815", "0.6872313", "0.67903", "0.676963", ...
0.0
-1
! vuex v3.4.0 (c) 2020 Evan You
function r(t){var e=Number(t.version.split(".")[0]);if(e>=2)t.mixin({beforeCreate:r});else{var n=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[r].concat(t.init):r,n.call(this,t)}}function r(){var t=this.$options;t.store?this.$store="function"===typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFieldVuex() {\n return store.getters.dataField;\n }", "getProfileVuex() {\n return store.getters.dataProfile;\n }", "function vuexInit(){var options=this.$options;// store injection\n\tif(options.store){this.$store=options.store;}else if(options.parent&&options.parent.$store){this.$store=options.par...
[ "0.67712444", "0.66986936", "0.66612864", "0.6331386", "0.63084495", "0.6247302", "0.6247302", "0.6247302", "0.62384593", "0.6236988", "0.61336607", "0.6127329", "0.606848", "0.60579044", "0.60579044", "0.60579044", "0.60579044", "0.60579044", "0.6051181", "0.60426307", "0.60...
0.0
-1
Based on createExtBadge() in ../../utils/common.js.
renderBadge() { return html` <div class="TWPT-badge"> <md-icon>repeat</md-icon> </div> `; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bsBadge(){return _callWithEmphasis(this, oj.span, 'badge', 'default', arguments)}", "function badges(badge) {\r\n return e('img', {\r\n key: badge.id\r\n , src: badge.image\r\n , className: 'badge'\r\n , alt: badge.name\r\n , style: { width: '25px', height: '25px' }...
[ "0.72280043", "0.6696833", "0.6563537", "0.65335816", "0.6476954", "0.6445614", "0.63880754", "0.6345181", "0.631854", "0.6311262", "0.63029355", "0.6267263", "0.6238235", "0.6208521", "0.620324", "0.62012196", "0.61797166", "0.6177162", "0.6149762", "0.61466306", "0.6139552"...
0.6456855
5
async/await syntax for promises
async function checkUserExists(req, res, next) { try { const user = await UsersService.getById( req.app.get("db"), req.params.user_id ); if (!user) return res.status(404).json({ error: `User doesn't exist` }); res.user = user; next(); } catch (error) { next(error); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function myPromise (){\n return \"This is my promise\"\n}", "async function ej3() {\n var res = await prom();\n console.log(res);\n}", "async function asyncAwait() {\n const a = await promise1;\n const b = await promise2;\n\n return [a, b];\n}", "async function asyncFuncExample(){\n ...
[ "0.72386634", "0.69835025", "0.69809437", "0.6958902", "0.6888303", "0.6882806", "0.6815461", "0.68067724", "0.680313", "0.67948866", "0.6715514", "0.6714994", "0.67125434", "0.66478854", "0.6603291", "0.65852815", "0.6578061", "0.6571049", "0.6568094", "0.65576184", "0.65276...
0.0
-1
A middleware providing ActiveRules Authorization. Built on top of Passport.
function middleware(app, settings) { return function (conn) { return conn.call(app); }; // End the main return function }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function authMiddleWare() {\n return function(req, res, next) {\n console.log(req.headers);\n if (req.headers['authorization']) {\n let token = req.headers['authorization'];\n\n try {\n let verifed = JWT.verify(token, SECRET);\n\n if (verifed.username === 'santRaju') {\n nex...
[ "0.66901636", "0.64889306", "0.6415423", "0.6407284", "0.63963217", "0.6231911", "0.62131715", "0.61843795", "0.61745197", "0.6152839", "0.6151388", "0.61328274", "0.6114872", "0.61108834", "0.61013573", "0.6083041", "0.60803026", "0.60414076", "0.60403216", "0.60398936", "0....
0.0
-1
Render the 2D grid of pixels, given a div as input (appends an svg inside the div) Returns a function which allows you to update it
function renderGrid(s, transition) { var sampleSVG = s.style("display", "block") .style("margin-left","auto") .style("margin-right","auto") .style("width", "920px") .append("svg") .attr("width", 920) .attr("height", 150) /* Render discretization of 2D Laplacian*/ sampleSVG.selectAll("rect") .data(V) .enter().append("rect") .style("fill", function(d,i) { return "white" }) .attr("height", 7.7) .attr("width", 7.7) .attr("x", function(d, i){return d[0]*8+ 10}) .attr("y", function(d, i){return d[1]*8 + 10}) /* display a function on the laplacian using colormap map*/ var display = function (x, map) { if (transition === undefined){ sampleSVG.selectAll("rect").style("fill", function(d,i) { return map(x[i]) }) } else { sampleSVG.transition() .duration(transition) .selectAll("rect") .style("fill", function(d,i) { return map(x[i]) }) } } return display }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawGrid(number){\n\tfor (var i = 0; i < number*number; i++) {\n\t\t$(\"#container\").append('<div class=\"pixel\"></div>');\n\t}\n\n\t$(\".pixel\").height($(\"#container\").height()/number);\n\t$(\".pixel\").width($(\"#container\").width()/number);\n\t$(\".pixel\").css({\"float\": \"left\", \"background-...
[ "0.6823166", "0.6325612", "0.62825996", "0.6255605", "0.6157618", "0.60907245", "0.6087567", "0.607411", "0.6071256", "0.60576814", "0.60312384", "0.60074204", "0.6003403", "0.5990763", "0.59757036", "0.59583867", "0.59556204", "0.5950396", "0.5915684", "0.59137803", "0.59047...
0.5939573
18
Game Over pop up
function gameOver() { popup.classList.remove('hide'); document.querySelector('.final-move').innerHTML = document.querySelector('.moves').innerHTML; document.querySelector('.final-time').innerHTML = document.querySelector('.timer').innerHTML; document.querySelector('.final-star').innerHTML = document.querySelector('.stars').innerHTML; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gameOver() {\n\tstopClock();\n\twriteModalStats();\n\ttoggleModal();\n}", "function showGameOverDialog() {\n alert(\"Game Over!!\");\n }", "function gameOver() {\n\tstopClock();\n\twriteModalStats();\n\ttoggleModal();\n\tmatched=0;\n}", "function gameOver() {\n stopClock();\n writeMo...
[ "0.82198364", "0.816292", "0.80010164", "0.7988407", "0.78447586", "0.78089464", "0.7792189", "0.77468866", "0.7729106", "0.76778334", "0.7653985", "0.7651026", "0.76345164", "0.7621238", "0.7610905", "0.7604168", "0.7603355", "0.75707686", "0.75689733", "0.7557001", "0.75497...
0.0
-1
stateless component: received data as props and presents that data, sometimes as a list every class must have a render function it's recommended that you start with a functional based component and only refactor to a class when you need some added functionality
function SearchResults (props) { return axios.get('api/events', { params: { title: props.value//TODO: grab event's whose titles have the word passed in as any of the words in the title } }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n const { name, code } = this.props\n return (\n <div>\n <h1>This is a Class Components</h1>\n <p>I am {name}, and I love {code}</p>\n </div>\n )\n }", "render() {\n // in class components as in function component we can ac...
[ "0.7040937", "0.6760913", "0.67469466", "0.6670974", "0.66335297", "0.65529585", "0.64397043", "0.64300007", "0.64294136", "0.6419273", "0.63870054", "0.6351749", "0.6336235", "0.6325579", "0.63154984", "0.6313294", "0.62951326", "0.6285804", "0.62676775", "0.62588984", "0.62...
0.0
-1
a render method needs to be a pure function, no ajax calls, etc it should just receive state and props and render a UI
render() { return ( <form onSubmit={this.handleSubmit}> <input type="text" value={this.state.value} onChange={this.handleChange} /> <input type="submit" value="Submit" /> </form> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n if (this.props) return this.renderWithProps();\n if (this.store) return this.renderWithStore();\n }", "render (props) {\n if (this.state.error) return this.renderDefaultError(props)\n return this.renderContent(props)\n }", "render() {\n if (this.state.error) {\n return this.r...
[ "0.7374528", "0.7365574", "0.72897464", "0.70920694", "0.702981", "0.702981", "0.7027581", "0.7027581", "0.7027581", "0.7027581", "0.7027581", "0.7027581", "0.7027581", "0.7004238", "0.69955593", "0.6952057", "0.6931295", "0.6907774", "0.68666524", "0.6843598", "0.6843598", ...
0.0
-1
limit the number of events per second
function throttle(callback, delay) { var previousCall = new Date().getTime(); return function () { var time = new Date().getTime(); if (time - previousCall >= delay) { previousCall = time; callback.apply(null, arguments); } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateTimerLimit(limit) {\n\ttimerLimit = limit;\n}", "minTimeBetweenSimilarHistoryEvents() { return 400; }", "function limitedRepeat() {\n let counter = 0;\n let repeat = setInterval( function(){\n console.log('hi for now');\n counter++;\n\n if(counter === 5){\n clearInterval(repeat);...
[ "0.62983847", "0.61174566", "0.5928281", "0.589216", "0.5866947", "0.584249", "0.58241105", "0.5796132", "0.57956105", "0.5787924", "0.5739298", "0.5708903", "0.56735647", "0.56702447", "0.5667123", "0.56582093", "0.56417125", "0.554792", "0.5539374", "0.55283046", "0.5528304...
0.5164907
71
make the canvas fill its parent
function onResize() { // We execute the same script as before let vh = window.innerHeight * 0.01; document.documentElement.style.setProperty("--vh", `${vh}px`); canvas.width = window.innerWidth; canvas.height = window.innerHeight; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fillCanvas() {\n // Clear the previous elements\n ctx.clearRect(0, 0, canvas.width, canvas.height)\n\n addBackground();\n addUFO(); \n}", "setFill() {\n const fill = new PIXI.Graphics();\n fill.beginFill(0xffffff);\n fill.drawRect(0, 0, canvas.dimensions.width, canvas.dimensions.height);\n ...
[ "0.70171833", "0.68119013", "0.67252463", "0.66741735", "0.6660765", "0.66560096", "0.66532516", "0.6634007", "0.66007406", "0.656795", "0.65208054", "0.63870007", "0.6386884", "0.6366845", "0.62956166", "0.6262411", "0.62279254", "0.62278765", "0.62194324", "0.6218293", "0.6...
0.0
-1
============================================== Smmoth Scroll Navigation ===============================================
function scrollNav() { $('.nav a').click(function(){ //Toggle Class $(".active").removeClass("active"); $(this).closest('li').addClass("active"); var theClass = $(this).attr("class"); $('.'+theClass).parent('li').addClass('active'); //Animate $('html, body').stop().animate({ scrollTop: $( $(this).attr('href') ).offset().top - 30 }, 1000); return false; }); $('.scrollTop a').scrollTop(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function navScroll() {\n // init controller\n height = window.innerHeight;\n var controller = new ScrollMagic.Controller();\n\n // build scenes\n new ScrollMagic.Scene({triggerElement: \"#intro\"})\n .setClassToggle(\"#nav\", \"bg-sienna\") // add class toggle\n .addTo(controller);\n}", "f...
[ "0.7460926", "0.6954371", "0.6928883", "0.67696565", "0.6713572", "0.66679347", "0.66178805", "0.655814", "0.6512086", "0.65032536", "0.6481224", "0.64692056", "0.6465416", "0.64551944", "0.6419625", "0.64136887", "0.641122", "0.64104104", "0.639461", "0.6390729", "0.63702226...
0.0
-1
to be used to show the os buttons which just remove the 'hidden' class
function show(id) { document.querySelectorAll(id).forEach((element) => { element.classList.remove("hidden"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "show() {\n this.button.removeClass(\"hidden\");\n }", "function _hideOtherButtons(hide){\n\t\t\t$('.btn_addremove').show();\n\t\t\t$('.btn_download').show();\n\t\t\t$('.btn_delete').show();\n\t\t\t\n\t\t\t/*if (hide) {\n\t\t\t\t$('.btn_addremove').hide();\n\t\t\t\t$('.btn_download').hide();\n\t\t\t\t$('.btn_...
[ "0.71597713", "0.7149847", "0.69949055", "0.69526863", "0.68610835", "0.6848672", "0.68109757", "0.67959195", "0.67907095", "0.6773016", "0.67519385", "0.6699986", "0.66837823", "0.66500396", "0.66240895", "0.66235036", "0.6618629", "0.6614034", "0.65944606", "0.6588004", "0....
0.0
-1
do what it says
function read() { fs.readFile("random.txt", "utf8", function(err, data) { if (err) { return console.log(err); } var output = data.split(","); value = output[1]; commands(output[0], value); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "execute(message,args){\n // bot replys good bye\n message.reply('Good bye Friend !!! :(')\n }", "function BOT_onTell() {\r\n\tvar thebotobject = eval(BOT_theBotId);\r\n\tvar thebottopicid = thebotobject.topicId;\r\n\tif(BOT_theReqTopic == thebottopicid) { BOT_reqSay(false,\"ANGRY\",\"NOFACTS...
[ "0.55687785", "0.5554342", "0.554594", "0.55365187", "0.5478175", "0.5469185", "0.54681426", "0.540565", "0.5401134", "0.5392705", "0.53839976", "0.5379608", "0.5363641", "0.5347159", "0.5344978", "0.5325285", "0.5314752", "0.529731", "0.52912796", "0.5269058", "0.5266312", ...
0.0
-1
Complete the hourglassSum function below.
function hourglassSum(arr) { let max = -Infinity for (let x = 0; x <= arr.length - 3; x++) { for (let y = 0; y <= arr.length - 3; y++) { // sum the top row let sum = arr[x][y] + arr[x][y + 1] + arr[x][y + 2] // sum the middle row sum += arr[x + 1][y + 1] // sum the bottom row sum += arr[x + 2][y] + arr[x + 2][y + 1] + arr[x + 2][y + 2] max = Math.max(max, sum) } } return max }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hourglassSum(arr) {\n let a = [...arr[0], ...arr[1], ...arr[2], ...arr[3], ...arr[4], ...arr[5]]\n\n let total;\n let i = 0;\n\n\n while (i < 32) {\n if ((i > -1 && i < 4) || (i > 5 && i < 10) || (i > 11 && i < 16) || (i > 17 && i < 22) || (i > 23 && i < 28) || (i > 29 && i < 34)) {\n ...
[ "0.73884106", "0.7219805", "0.7212039", "0.70581204", "0.6989196", "0.6941539", "0.69231576", "0.68983644", "0.68602854", "0.6853072", "0.684322", "0.6836446", "0.681284", "0.67920554", "0.6745531", "0.6712606", "0.6646706", "0.6636153", "0.65583897", "0.65434927", "0.6531547...
0.6380032
25
Utils a function to convert from miles/kilometers/feet to meters
function normalize(value, units) { switch(units) { case "mi": return value * 1609; case "km": return value * 1000; case "ft": return value / 3.281; case "m": return value; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function metersToMiles(meters) {\n return meters / 1609.344;\n }", "function milesToMeters(miles) {\n return miles * 1069.344;\n}", "function milesToMeters(miles) {\n return miles * 1069.344;\n}", "function milesToMeters(miles) {\n return miles * 1069.344;\n}", "function metersToMiles...
[ "0.8397667", "0.835207", "0.835207", "0.835207", "0.808114", "0.8035501", "0.8033715", "0.79948246", "0.7928369", "0.781191", "0.7796408", "0.77754235", "0.77565444", "0.77528155", "0.7701453", "0.7595433", "0.7583631", "0.75721693", "0.7423896", "0.7411904", "0.73843", "0....
0.66281724
81
Adapted from convertsourcemap (MIT)
function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; return '/*# ' + data + ' */'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extractSourceMap(fs, logger, file) {\n var inline = convert_source_map_1.commentRegex.test(file.text);\n var external = convert_source_map_1.mapFileCommentRegex.exec(file.text);\n if (inline) {\n var inlineSourceMap = convert_source_map_1.fromSource(file.text);\n ...
[ "0.69679236", "0.69377637", "0.67660517", "0.644171", "0.63287604", "0.62983114", "0.6256009", "0.6210124", "0.61941147", "0.61812603", "0.6174446", "0.6158444", "0.6158444", "0.6158444", "0.6154958", "0.60953784", "0.6039884", "0.5989862", "0.5980611", "0.5979347", "0.597915...
0.0
-1
Generate new random values for x and y until there is no overlapping
function generateXY(xy, objWidth, objHeight, updateCondition) { let x = xy[0]; let y = xy[1]; x = getRandomInt(0, game.canvas.width - objWidth); y = getRandomInt(0, game.canvas.height - objHeight); condition = updateCondition(x, y, objWidth, objHeight); if (condition) { return generateXY([x, y], objWidth, objHeight, updateCondition); // Recursion } else { return [x, y]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRandomPoints() {\n let count = 0,\n x = 0,\n y = 0,\n y_function = 0;\n\n while (count < cant_points) {\n x = Math.random() * (x_to - x_from) + x_from;\n y = Math.random() * (y_to - y_from) + y_from;\n\n y_function = evaluate(x, funcion);\n\n if (y > 0) {\n ...
[ "0.69807976", "0.66435057", "0.6626163", "0.6602893", "0.6568605", "0.6540433", "0.6518605", "0.65176606", "0.6514639", "0.6430906", "0.640136", "0.63774514", "0.6366932", "0.63449013", "0.6327585", "0.63002944", "0.62860495", "0.6279405", "0.622127", "0.6220236", "0.6201995"...
0.58433384
59
Update new Score to records
function updateRecord(newScore) { let data = localStorage.getItem("records"); let newScoreAdded = false; // Track if newScore has been added to records let records = []; if (data) { records = data.toString().split("\n"); records = records.map((x) => x.split(",")); // Add new Score to records for (let i = 0; i < records.length; i++) { if (parseInt(records[i][0]) < parseInt(newScore[0])) { records.splice(i, 0, newScore); newScoreAdded = true; break; } } } if (!newScoreAdded && records.length < 10) { records.push(newScore); } records = records.splice(0, 10); let newString = records.map((x) => x.join(",")); newString = newString.join("\n"); localStorage.setItem("records", newString); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateScores(score, index, id) {\n setDetails({ ...details, score });\n setUpdate({ score, index, id });\n }", "UpdateScore(newScore){\n this.currentScore += newScore;\n }", "updateScore(itemId, score = 0.5){\n return Score.findOrCreate({where: {itemId, questionId: this.id}})\n ...
[ "0.7361139", "0.7126007", "0.7011713", "0.6831168", "0.6710596", "0.67011744", "0.666821", "0.66526437", "0.66288877", "0.66243935", "0.66197747", "0.6612916", "0.6542168", "0.647161", "0.6461944", "0.64236385", "0.6371391", "0.6370845", "0.63697493", "0.6333554", "0.63209563...
0.624002
27
Run main functions repeatedly
function main() { if (game.level === evolveLevels[evolveIndex]) { menuPlayed = false; let cacheEvolveIndex = evolveIndex; if (game.level > 1 && !videoPlaying) { videoPlayed = false; game.canvas.style.display = "none"; // Hide game canvas let video = document.createElement("video"); video.width = 960; video.height = 540; video.autoplay = true; video.muted = true; video.src = gameMenu[evolveIndex].videoSource; document.getElementById("game-area").appendChild(video); video.addEventListener("ended", function () { videoPlayed = true; video.remove(); }); videoPlaying = true; video.play(); } if (videoPlayed) { videoPlaying = false; let menu = document.createElement("div"); game.canvas.style.display = "none"; // Show menu of current level menu = displayMenu(evolveIndex, menu); document.getElementById("game-area").appendChild(menu); evolveIndex += 1; } } if (menuPlayed) { game.canvas.style.display = "unset"; // Show canvas update(); render(); // End level if (enemies.filter((e) => e.hp > 0).length === 0) { score += game.level * 2 + game.duration - elapsedTime; if (game.level < LEVEL_DESIGN.enemyCommon.length) { enemies = []; blocks = []; initGame(game.level + 1); loadImages(); document.getElementsByTagName("canvas")[0].remove(); // Remove previous canvas startTime = Date.now(); // Restart timer } else { document.getElementsByTagName("canvas")[0].remove(); // Remove previous canvas win = true; updateRecord([score.toString(), playerName, game.level]); // Update score to records endGame(); // Game over: win return; } } if (game.duration - elapsedTime <= 0) { document.getElementsByTagName("canvas")[0].remove(); // Remove previous canva updateRecord([score.toString(), playerName, game.level]); // Update score to records endGame(); // Game over: lose return; } } requestAnimationFrame(main); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "function main() {\r\n mainLoop()\r\n}", "function init() {\r\n reset();\r\n lastTime = Date.now();\r\n main();\r\n }", ...
[ "0.7245325", "0.7245325", "0.723445", "0.7169174", "0.7153774", "0.7153774", "0.71489054", "0.71489054", "0.71489054", "0.71489054", "0.7111461", "0.7059618", "0.69930404", "0.6874546", "0.6868406", "0.67290676", "0.6677542", "0.66472757", "0.6643369", "0.6585214", "0.6561061...
0.0
-1
pattern to check postal code
async function check() { if (resetpw == "reset") { pw = bcrypt.hashSync(lname.toLowerCase() + hp.slice(0, 4), 10); // resets password to staff's last name and first 4 numbers of their phone number } else { User.findOne({ where: { staffId: req.params.id } }).then((user) => { pw = user.password // retrieves original password }).catch((err) => { console.log(err); res.redirect('/staff/error'); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isValidPostalcode(postalcode) {\n if (postalcode.search) {\n postalcode = removeSpaces(postalcode);\n if (postalcode.length == 6 && postalcode.search(/^[a-zA-Z]\\d[a-zA-Z]\\d[a-zA-Z]\\d$/) != -1) return true;\n else if (postalcode.length == 7 && postalcode.search(/^[a-zA-Z]\\d[a-zA-Z]-\\d...
[ "0.7870481", "0.78666735", "0.7866659", "0.7685849", "0.76836866", "0.76550883", "0.7566243", "0.75576675", "0.75057405", "0.74874306", "0.74854565", "0.74796134", "0.7398815", "0.73026824", "0.729508", "0.7231197", "0.7224124", "0.7078238", "0.7018291", "0.7014531", "0.70042...
0.0
-1
the router components to navigate through the pages
render() { return ( <Router> <div className="app"> <Switch> <Route path="/" exact render={() => <Home user={this.state.user} />} /> <Route path="/login" exact component={Login} /> <Route path="/register" exact component={Register} /> </Switch> </div> </Router> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initRouter() {\n Router.config(AppConfig.get('routes'));\n \n Router.onBeforeAction((r, p) => {\n const token = Accounts.getToken()\n if(!r.ignoreLogin && !token) Accounts.logout()\n })\n\n /** Login **/\n Router.on('login', (rota, req) => {\n ...
[ "0.6770864", "0.6618932", "0.659033", "0.6385987", "0.6341484", "0.6339623", "0.63270634", "0.6312558", "0.6305172", "0.61244", "0.60829824", "0.6074965", "0.60729057", "0.6071625", "0.60647833", "0.606295", "0.6051352", "0.6049778", "0.6042353", "0.603454", "0.60088986", "...
0.0
-1
the main init js file that will be used to start game
function start() { init(); game.start(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n\t\t// reset will display start game screen when screen is designed\n\t\treset();\n\n\t\t// lastTime required for game loop\n\t\tlastTime = Date.now();\n\n\t\tmain();\n\t}", "function init() {\n gameStart();\n}", "function init() {\n if (game.init())\n game.start();\n}", "func...
[ "0.7901488", "0.78569734", "0.76020956", "0.75799984", "0.7481812", "0.7478938", "0.7353873", "0.73514795", "0.7348657", "0.7345728", "0.73349124", "0.73041147", "0.72803766", "0.72484493", "0.72395545", "0.7238584", "0.7231932", "0.72291064", "0.72236586", "0.72208583", "0.7...
0.7455334
6
Constructor adds all the elements
constructor(index){ // Set the id for later access this.index = index $('#minigame-modal').attr('data-minigame-for',index) // Select the modal body for content (and empty both of them) var canvas = $('#minigame-modal').find('.modal-body').empty() var title = $('#minigame-modal').find('.modal-title').empty() // Add the the background and the title canvas.append('<img class="img-fluid" id="minigame-background" src='+locations[index].minigame_img+' alt="Minigame">') title.text("The stones of the well are marked...") // Create the table as a separate method this.createGrid() // If the puzzle has been completed, show the opened hiding place if (locations[index].complete == 1) { this.openHidingPlace() } // Show the modal $('#minigame-modal').modal('show') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n this.elements = new Object();\n this.____length = 0;\n }", "constructor(ele) {\n super(ele);\n }", "constructor(elemento) {\n super(elemento);\n }", "constructor (element) {\n super(element);\n }", "constructor() {\n super([\n new A...
[ "0.7436643", "0.71054757", "0.7023472", "0.6943673", "0.6933639", "0.686425", "0.6848717", "0.6708078", "0.66804093", "0.6673728", "0.6597897", "0.65545785", "0.64835674", "0.6453539", "0.6448183", "0.636233", "0.636233", "0.63551915", "0.635302", "0.6349339", "0.6343509", ...
0.0
-1
Function for creating a grid of stones
createGrid(){ var self = this // Get the canvas to work on var canvas = $('#minigame-modal').find('.modal-body') // Append a table canvas.append('<div class="well-grid-wrapper"></div>') $('.well-grid-wrapper').append('<table class="table-fixed" id="well-grid"></table') var tbody = $('#well-grid') tbody.append('<tbody id="well-grid-body"></tbody>') // Append 22 rows for (var i=0; i<80; i++) { var trow = $('<tr class="well-grid-col" id="well-grid-col-'+i+'"></tr>') for (var j=0; j<5; j++) { var tcell = $('<td class="well-grid-cell well-grid-col-'+i+' well-grid-row-'+j+'"></td>') var cell = $('<div class="well-grid-cell-wrapper"></div>') .attr('data-grid-row',i) .attr('data-grid-col',j) .attr('data-stone-clicked',0) var stone = $('<img class="img-fluid well-stone" src=assets/images/minigames/puzzles/well/well-stone-in0.jpg alt="Stone">') cell.append(stone) tcell.append(cell) trow.append(tcell) } tbody.append(trow) } // Add an on-click method for each cell, to move the stone in on click $('.well-grid-cell-wrapper').on("click",function(){self.moveStoneIn(this)}) // Add icons to the stones this.addIcons() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createGrid(n) {\n for (var i = 0; i < n; i++) {\n for (var j = 0; j < n; j++) {\n $('.container').append('<div class=\"square\"></div>');\n }\n }\n //set dimensions\n $('.square').css('height', 960 / n + 'px');\n $('.square').css('wid...
[ "0.69495034", "0.69487864", "0.6933928", "0.68922925", "0.6849623", "0.6837589", "0.68185705", "0.67937374", "0.6757577", "0.6692012", "0.666156", "0.6659617", "0.66583604", "0.6655502", "0.6650055", "0.6649327", "0.6645979", "0.664104", "0.6626312", "0.66250443", "0.6606446"...
0.0
-1
Method for applying icons to the labels
addIcons(){ // Icon sizes make the icon smaller as the stone moves in this.iconSizes = ['32px','30px','28px','26px','24px','22px'] // Add elements for all the icons var iconConifer = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-tree" id="icon-conifer"></span></div>') var iconScissors = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-cut" id="icon-scissors"></span></div>') var iconBell = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-bell" id="icon-bell"></span></div>') var iconCamera = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-camera" id="icon-camera"></span></div>') var iconFlag = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-flag" id="icon-flag"></span></div>') var iconHeadphones = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-headphones" id="icon-headphones"></span></div>') var iconSuitcase = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-lock" id="icon-suitcase"></span></div>') var iconClock = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-clock" id="icon-clock"></span></div>') var iconMusic = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-music" id="icon-music"></span></div>') var iconPencil = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-pen" id="icon-pencil"></span></div>') var iconEnvelope = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-envelope" id="icon-envelope"></span></div>') var iconHeart = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-heart" id="icon-heart"></span></div>') // Create a list of all their icons and positions this.iconsList = [{icon:iconConifer,id:"icon-conifer", col:1,row:51}, {icon:iconScissors,id:"icon-scissors", col:3,row:7}, {icon:iconBell,id:"icon-bell", col:1,row:49}, {icon:iconCamera,id:"icon-camera", col:4,row:36}, {icon:iconFlag,id:"icon-flag", col:0,row:30}, {icon:iconHeadphones,id:"icon-headphones", col:3,row:59}, {icon:iconSuitcase,id:"icon-suitcase", col:2,row:26}, {icon:iconClock,id:"icon-clock", col:0,row:13}, {icon:iconMusic,id:"icon-music", col:1,row:73}, {icon:iconPencil,id:"icon-pencil", col:1,row:74}, {icon:iconEnvelope,id:"icon-envelope", col:4,row:55}, {icon:iconHeart,id:"icon-heart", col:0,row:67} ] // Loop through all icons and add them for (var icon of this.iconsList) { // Get the row and column to add it to from the list of icons var iconRow = icon.row var iconCol = icon.col // Select the right stone var stone = $('.well-grid-cell-wrapper[data-grid-row="'+icon.row+'"][data-grid-col="'+icon.col+'"]') // Append the icon to the stone stone.append(icon.icon) // Set the font size of the icons $('.well-icon').css({"font-size":"32px"}) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function icons() {\r\n var arr = [], style = 'style=\"width:18px\"';\r\n if (iconMapper.map(link)) add(iconMapper.map(link));\r\n if (iconMapper.map(obj.Type)) add(iconMapper.map(obj.Type));\r\n if (reg !== 'Message' && iconMapper.map(reg)) add(iconMapper...
[ "0.6663002", "0.66136485", "0.6596557", "0.65442085", "0.64753056", "0.63725626", "0.6364859", "0.63052565", "0.63020056", "0.6298434", "0.62905854", "0.62519604", "0.6229002", "0.62243503", "0.6195375", "0.6185135", "0.6177914", "0.6159013", "0.612364", "0.6089255", "0.60671...
0.0
-1
Method for moving a stone's image 'in'
moveStoneIn(stone){ // Get the stone's depth, row and column var stoneDepth = $(stone).attr('data-stone-clicked') var stoneRow = $(stone).attr('data-grid-row') var stoneCol = $(stone).attr('data-grid-col') // Get the icon by searching the list var stoneIcon = puzzle.iconsList.find(function(entry){ return entry.row == stoneRow && entry.col == stoneCol }) // Update the depth var newStoneDepth = parseInt(stoneDepth) + 1 if (newStoneDepth == 6) {newStoneDepth = 0} // Update the stone, add the new icon $(stone).empty() var newStone = $('<img class="img-fluid well-stone" src=assets/images/minigames/puzzles/well/well-stone-in'+newStoneDepth+'.jpg alt="Stone">') $(stone).append(newStone) $(stone).attr('data-stone-clicked',newStoneDepth) // If the stone has an icon, add it if (stoneIcon) { var newIcon = stoneIcon.icon $(stone).append(newIcon) // Update the font size of the icon $('#'+stoneIcon.id).css({"font-size":puzzle.iconSizes[parseInt(newStoneDepth)]}) } // Whenever you move a stone in, check for completion this.checkComplete() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "makeMoveable($image){\n\n }", "move() {\n this.x += this.xdir * .5;\n this.y += this.ydir * .5;\n }", "move() {\n this.geometricMidpoint = this.setGeometricMidpoint();\n this.in.X = this.position.X - this.geometricMidpoint.X;\n this.in.Y = this.position.Y - this.geometricMidpoint.Y;\n }", "...
[ "0.6845299", "0.6717159", "0.6665342", "0.66635567", "0.6496797", "0.6470725", "0.6406895", "0.6402532", "0.63992864", "0.6322238", "0.6302872", "0.6297405", "0.6287569", "0.6286019", "0.6241229", "0.6234073", "0.620637", "0.61893684", "0.6175483", "0.6170292", "0.6156105", ...
0.6568766
4
Method for checking whether the puzzle is complete (needs to be called after dragging events)
checkComplete(){ console.log("Checking stones") // Get the depth of the five stones var stone1Depth = $('.well-grid-cell-wrapper[data-grid-row=6][data-grid-col=2]').attr('data-stone-clicked') var stone2Depth = $('.well-grid-cell-wrapper[data-grid-row=28][data-grid-col=1]').attr('data-stone-clicked') var stone3Depth = $('.well-grid-cell-wrapper[data-grid-row=46][data-grid-col=1]').attr('data-stone-clicked') var stone4Depth = $('.well-grid-cell-wrapper[data-grid-row=50][data-grid-col=0]').attr('data-stone-clicked') var stone5Depth = $('.well-grid-cell-wrapper[data-grid-row=67][data-grid-col=4]').attr('data-stone-clicked') // Use these if you want a quick test var tstone1Depth = $('.well-grid-cell-wrapper[data-grid-row="0"][data-grid-col="0"]').attr('data-stone-clicked') var tstone2Depth = $('.well-grid-cell-wrapper[data-grid-row="0"][data-grid-col="1"]').attr('data-stone-clicked') var tstone3Depth = $('.well-grid-cell-wrapper[data-grid-row="0"][data-grid-col="2"]').attr('data-stone-clicked') var tstone4Depth = $('.well-grid-cell-wrapper[data-grid-row="0"][data-grid-col="3"]').attr('data-stone-clicked') var tstone5Depth = $('.well-grid-cell-wrapper[data-grid-row="0"][data-grid-col="4"]').attr('data-stone-clicked') // Compare the depths to the targets // Real checks if ((parseInt(stone1Depth) == 1) && (parseInt(stone2Depth) == 2) && (parseInt(stone3Depth) == 3) && (parseInt(stone4Depth) == 4) && (parseInt(stone5Depth) == 5)) { // End of real checks // Testing checks //if ((parseInt(tstone1Depth) == 1) && // (parseInt(tstone2Depth) == 2)) { // End of testing checks nextHint = 'travel_well_volcano' // Set a timeout so that you can see the stone finish setTimeout(function(){ // Show a dialogue modal, describing the entry opening $('#dialogue-modal').find('.modal-title').text('The fifth stone slides back into the wall...') $('#dialogue-modal').modal('show') // Show the updated background and clues puzzle.openHidingPlace() },1000) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function completed() {\n var counter = 1;\n for(var row = 0; row < puzzle.length; row++) {\n for(var col = 0; col < puzzle[row].length; col++) {\n if(puzzle[row][col] == counter) counter++;\n else if (puzzle[row][col] == 0 && row == puzzleSize - 1 && col == puzzleSize - 1) return true;\n else r...
[ "0.78191257", "0.7178827", "0.70605934", "0.6985316", "0.6974004", "0.69584805", "0.6897251", "0.68743306", "0.6860256", "0.6758799", "0.6750744", "0.6711293", "0.6700705", "0.6688978", "0.6653361", "0.664123", "0.6631974", "0.6624163", "0.6531838", "0.6531636", "0.651817", ...
0.0
-1
This method replaces the background with one with an open hiding space
openHidingPlace(){ // Turn off the stone on-click method $('.well-grid-cell-wrapper').off("click") // Append a black div to the fifth stone $('.well-grid-cell-wrapper[data-grid-row="67"][data-grid-col="4"]') .empty() .append('<div class="well-stone" id="black-well-stone"></div>') // Append the clues var clue1 = $('<img class="img-fluid" id="volcano-clue" src=assets/images/clues/volcano-clue.jpg alt="Clue1">') .on("click",function(){zoom = new Zoom('assets/images/clues/volcano-clue.jpg','volcano-clue','A clue!',1)}) var clue2 = $('<img class="img-fluid" id="key-line-well" src=assets/images/clues/key-line-well.bmp alt="Clue2">') .on("click",function(){zoom = new Zoom('assets/images/clues/key-line-well.bmp','key-line-well','Another of those gold bars',2)}) $('.well-grid-cell-wrapper[data-grid-row="67"][data-grid-col="4"]').append(clue1).append(clue2) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hiddenCave(){\n\tcurrentBG = cave;\n\tbackground(cave);\n}", "function background() {\n\tif (ydup != 600) {\n\t\tydup = ydup + 1;\n\t\tdocument.getElementById(\"road\").style.backgroundPosition = \"0px \"\n\t\t\t\t+ ydup + \"px\";\n\t} else {\n\t\tydup = 0;\n\t}\n}", "function clos() {\r\n backgrou...
[ "0.69943565", "0.6600684", "0.6515199", "0.637931", "0.63593435", "0.63314945", "0.6308624", "0.6279169", "0.62636715", "0.62613344", "0.62583405", "0.62421757", "0.62114614", "0.62038684", "0.6201671", "0.6194917", "0.61461973", "0.6140948", "0.6122789", "0.61005884", "0.609...
0.0
-1
This is a modified version of the WoWWiki site version, in that it is designed for global.js use. Code adds a checkbox at the top of the Special:RecentChanges list, next to the header. Ticking it sets a cookie (should be individual to wikis) and starts updating the RC list. This occurs silently every 60 seconds without a full page reload occuring.
function setCookie(c_name, value, expiredays) { var exdate = new Date(); exdate.setDate(exdate.getDate() + expiredays); document.cookie = c_name + "=" + escape(value) + ((expiredays === null) ? "" : ";expires=" + exdate.toGMTString()) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updates() {\n var checked = $(\"#updates\").is(\":checked\");\n track('Options', 'Latest updates', 'Latest updates feature', checked);\n if (checked) {\n localStorage.feature_latestupdates = true;\n showMessage(\"Feature 'latest updates' enabled.\");\n } else {\n localStor...
[ "0.63113683", "0.617935", "0.6077299", "0.5957348", "0.5924308", "0.5871638", "0.58467174", "0.577893", "0.57757795", "0.57215005", "0.571079", "0.5691921", "0.56897974", "0.5677352", "0.5670097", "0.56255794", "0.56103647", "0.5593988", "0.5588799", "0.5584433", "0.558101", ...
0.0
-1
end of doc load
function parseXML(xml){ console.log("in parseXML"); $("h1").html("Final Project Assignment<br>" + "Kody Scharf, Andrew Lee<br>" + "991455754, 991457820<br>"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onloadend() {}", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageS...
[ "0.67227906", "0.66000533", "0.66000533", "0.66000533", "0.66000533", "0.6360187", "0.63119406", "0.62759095", "0.6209285", "0.6209285", "0.60802746", "0.607873", "0.6075449", "0.6064207", "0.6001037", "0.5996478", "0.59857166", "0.5929347", "0.5912549", "0.5852157", "0.58498...
0.0
-1
A submap node should be positioned in the place of average visibility and average evolution (!). The evolution is averaged from all the components included in submap, regardless of whether they are or are not visible. The visibility is calculated from components visible on a given map and is map specific. We do not want to make too much mess here.
function getSubmapPositions(mongooseObjects, nodeIds, impact) { let Node = mongooseObjects.Node; let positions = { evolutionSum: 0, evolutionCount: 0, maps: {} /* mapId : { nodeVisiblityCount : number, visibilitySum : number } */ }; // actually calculate submap position return Node.find({ _id: { $in: nodeIds } }).exec() .then(function(nodes) { // iterate over submapped nodes. Sum and count evolution of all nodes, // sum and count visibility *per map* for (let i = 0; i < nodes.length; i++) { let analysedNode = nodes[i]; for (let j = 0; j < analysedNode.visibility.length; j++) { // create a record if necessary if (!positions[analysedNode.visibility[j].map]) { positions.maps[analysedNode.visibility[j].map] = { nodeVisiblityCount: 0, visibilitySum: 0, }; } positions.maps[analysedNode.visibility[j].map].nodeVisiblityCount++; positions.maps[analysedNode.visibility[j].map].visibilitySum += analysedNode.visibility[j].value; } positions.evolutionSum += analysedNode.evolution; positions.evolutionCount++; } return positions; }) .then(function(position) { // normalise - calculate averages - we want to get a nice result let result = { evolution: (position.evolutionSum / position.evolutionCount), visibility: {} }; for (let key in position.maps) { if (position.maps.hasOwnProperty(key)) { result.visibility[key] = (position.maps[key].visibilitySum / position.maps[key].nodeVisiblityCount); } } return result; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "applyLayoutVisibility() {\n const { visible } = this;\n const { mbMap } = this.mapboxLayer;\n\n if (!mbMap) {\n return;\n }\n\n const style = mbMap.getStyle();\n\n if (!style) {\n return;\n }\n\n if (this.styleLayersFilter) {\n const visibilityValue = visible ? 'visible' : 'n...
[ "0.5155607", "0.5108502", "0.5017218", "0.4999723", "0.49637577", "0.49426314", "0.49350336", "0.4899641", "0.48742247", "0.48171225", "0.480886", "0.480886", "0.4788675", "0.47885686", "0.47782236", "0.47715354", "0.47700462", "0.47681093", "0.4760436", "0.4745325", "0.47267...
0.5816436
0
This methods form a submap by creating a new map, moving shifting there all the selected components, moving internal dependecies (got from impact).
function createASubmap(mongooseObjects, workspace, mapId, name, responsiblePerson, nodes, impact) { let Node = mongooseObjects.Node; let WardleyMap = mongooseObjects.WardleyMap; return workspace.createAMap({ name: name, responsiblePerson: responsiblePerson }, workspace.nowId, /*mark as submap */ true) .then(function(newlyCreatedMap) { //inSubmapDependencies those deps have to be copied //and nodes, of course return Node.find({ _id: { $in: nodes } }).exec().then(function(nodes) { let promises = []; for (let i = 0; i < nodes.length; i++) { let processedNode = nodes[i]; // for each node that was pushed to a submap //1. set parent map processedNode.parentMap = [getId(newlyCreatedMap)]; //2. adjust visibility - steal it from current map // if for some reason it is not missing, take the first available one let bestVisibility = processedNode.visibility[0]; for (let j = 0; j < processedNode.visibility.length; j++) { let analysedVisibility = processedNode.visibility[j]; if (getId(analysedVisibility.map).equals(getId(mapId))) { bestVisibility = analysedVisibility; } } bestVisibility.map = getId(newlyCreatedMap); processedNode.visibility = [bestVisibility]; //3. sort out dependencies, only those presented on a map will stay //for now, in the future we may have some cross maps dependencies possible processedNode.dependencies = []; for (let j = 0; j < impact.inSubmapDependencies.length; j++) { let processedDependency = impact.inSubmapDependencies[j]; if (getId(processedDependency.node).equals(getId(processedNode))) { processedNode.dependencies = processedNode.dependencies.concat(processedDependency.deps); } } // 3.a ensure dependencies are visible when they should be for (let j = 0; j < processedNode.dependencies.length; j++) { processedNode.dependencies[j].visibleOn = [getId(newlyCreatedMap)]; } //4. save, piece of cake promises.push(processedNode.save()); } return q.all(promises).then(function() { return WardleyMap.findById(getId(newlyCreatedMap)).populate('nodes').exec(); }); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "swapBasemap(toAdd) {\n this.currentSources = []\n this.currentLayers = []\n\n // First record which layers are currently on the map\n Object.keys(mapStyle.sources).forEach(source => {\n let isPresent = this.map.getSource(source)\n if (isPresent) {\n this.currentSources.push({\n ...
[ "0.6219127", "0.5920159", "0.57977664", "0.572624", "0.55668133", "0.55501395", "0.55453134", "0.5514503", "0.5485349", "0.54763526", "0.54755807", "0.5462223", "0.54497755", "0.53918785", "0.5387162", "0.53760314", "0.53584814", "0.5345959", "0.5322612", "0.5313737", "0.5306...
0.5689485
4
every node that depends on a node injected into the submap, has to switch dependency to a node representing that submap. Which should be as simple as: remove all deps (constistent across all submaps) Further required work: [ ] ensure consistency across all the maps
function replaceIncomingDependencies(mongooseObjects, targetNodeId, nodesThatDependOnFutureSubmap, nodesInSubmap) { let results = []; for (let i = 0; i < nodesThatDependOnFutureSubmap.length; i++) { let analysedNode = nodesThatDependOnFutureSubmap[i]; console.log('what about here', analysedNode); let atLeastOneMigrated = false; for (let j = analysedNode.dependencies.length - 1; j >= 0; j--) { let analysedDependency = analysedNode.dependencies[j]; let isForSubmappedNode = false; for (let k = 0; k < nodesInSubmap.length; k++) { if (getId(nodesInSubmap[k]).equals(getId(analysedDependency.target))) { isForSubmappedNode = true; } } if (isForSubmappedNode) { //we have to do something with current dependency if (atLeastOneMigrated) { // we have at least one dependency migrated earlier, we do not want to duplicate them, // so just discard it analysedNode.dependencies.splice(j, 1); j--; //index should be shifted after the number of dependencies is reduced } else { //blatantly switch the first dependency that can be switched analysedDependency.target = targetNodeId; atLeastOneMigrated = true; // j--; } } } if (atLeastOneMigrated) { console.log('being saved', analysedNode); results.push(analysedNode.save()); } } return q.allSettled(results); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createASubmap(mongooseObjects, workspace, mapId, name, responsiblePerson, nodes, impact) {\n let Node = mongooseObjects.Node;\n let WardleyMap = mongooseObjects.WardleyMap;\n return workspace.createAMap({\n name: name,\n responsiblePerson: responsiblePerson\n }, workspace.nowId, /*mark as ...
[ "0.6814995", "0.6181101", "0.6181101", "0.6181101", "0.6181101", "0.60917664", "0.60319054", "0.59357166", "0.59333426", "0.58866113", "0.586727", "0.5751134", "0.5572706", "0.55113435", "0.5486648", "0.5405267", "0.5387291", "0.538418", "0.53830135", "0.5381048", "0.537357",...
0.7088818
0
Forms a submap and returns a list of modified maps
function formASubmap(mongooseObjects, workspace, mapId, name, responsiblePerson, nodesInSubmap, impact) { let Node = mongooseObjects.Node; let Workspace = mongooseObjects.Workspace; let positionsAntipaternVariable = null; return getSubmapPositions(mongooseObjects, nodesInSubmap, impact).then(function(positions){ positionsAntipaternVariable = positions; return createASubmap(mongooseObjects, workspace, mapId, name, responsiblePerson, nodesInSubmap, impact) .then(function(submap){ return { positions: positions, submap: submap }; }); }) .then(function(arg) { return createSubmapNode(mongooseObjects, arg, impact, workspace, name, responsiblePerson); }) .then(function(node) { let nodeId = getId(node); // and the heavy part. get everyone depending on a submap to really depend on it return replaceIncomingDependencies(mongooseObjects, nodeId, impact.nodesThatDependOnFutureSubmap, nodesInSubmap).then(function(irrelevantStuff){ let changedMaps = []; for (let key in positionsAntipaternVariable.visibility) { if (positionsAntipaternVariable.visibility.hasOwnProperty(key)) { changedMaps.push(key); } } return changedMaps; }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function demo008(){\n var obj = {\n subObject: {\n subKey: 'subvalue',\n subSubObject: {\n subSubKey: 'subSubValue'\n }\n }\n } ;\n const originalMap = Immutable.fromJS(obj) ;\n const newMap = originalMap.setIn(['subObject','subKey'],'ha ha!') ;\n console.info(newMap.toJ...
[ "0.5581962", "0.5565545", "0.5322298", "0.53130573", "0.5299694", "0.520975", "0.51403564", "0.50976515", "0.50889266", "0.5065186", "0.5063049", "0.5063049", "0.5063049", "0.5063049", "0.5063049", "0.5055614", "0.50455725", "0.5003599", "0.50008327", "0.49989545", "0.4985788...
0.5777071
0
The actual plugin constructor
function Plugin( element ) { this.element = element; this.jqElement = $(element); this.isScaleActive = false; this._defaults = defaults; this._name = pluginName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n super();\n this._init();\n }", "constructor() {\n\t\t// ...\n\t}", "consructor() {\n }", "constructor() {\r\n super()\r\n this.init()\r\n }", "init() {\n }", "constructor()\n {\n this.init();\n }", "function contruct() {\n\n ...
[ "0.7422684", "0.7349132", "0.7314277", "0.73003334", "0.7299704", "0.7292701", "0.72775894", "0.72354233", "0.7233936", "0.7181569", "0.71798736", "0.71798736", "0.71798736", "0.71798736", "0.71798736", "0.71761876", "0.7157667", "0.71499527", "0.71496284", "0.71496284", "0.7...
0.0
-1
II. handle the gateway proxy response (called in http.request and https.request for proxy_clientReq request in I. above) define the gateway proxy_clientReq's responsehandler callback method Note: proxy_Res parameter is an instance of type http.IncomingMessage
function processRes(proxy_Res) { logger.trace(req.transactionId+'-Handling proxy response received, for proxy request sent with options: ', options); var proxyResponseStatusCode = proxy_Res.statusCode; logger.trace(req.transactionId+'-Proxy client request returned proxy response statusCode: ', proxyResponseStatusCode); var responseAttachmentAudit; var isResAuditInitialized = false; // get the file size from the http 'Content-Length' header received in proxy client response var uploadedSize = 0; var fileSizeStr = proxy_Res.headers['content-length']; var fileSize = 0; if (!_.isUndefined(fileSizeStr)) { fileSize = parseInt(fileSizeStr); } // if file buffering set for this configured route if (route.buffer) { try { // create write stream named 'tmpFile' to the temporary file in tmpdir // fs.createWriteStream() returns a new stream.Writable object var tmpFile = fs.createWriteStream(tmpPath); // where 'tmpFile' is a 'stream.Writable' instance, // if a tmpFile.write(chunk) call returns false, then the 'drain' event then emitted // will indicate when it is appropriate to begin writing more data to the stream. tmpFile.on('drain', function () { // begin writing more data to the stream proxy_Res.resume(); }); } catch (e) { logger.error(req.transactionId+'-tmpFile write stream creation section threw an error..., re-throwing...'); throw e; } } // handle proxy client response body when present proxy_Res.on('data', function (chunk) { logger.trace(req.transactionId+'-Response data is being written to proxy client, where chunk length (in bytes): ', chunk.length); //logger.trace('Data:', chunk.toString('utf8')); // first time - initialize and perform unstructured audit logging of the proxy response body file if config set if (!isResAuditInitialized && route.audit && route.audit.unstructured && route.audit.unstructured.auditResponse) { var key = req.transactionId + '-RES'; res.key = key; logger.trace('Unstructured response auditing with transactionId-based key: ', key); // initialize and write the first text logger.trace(req.transactionId+'-Initializing unstructured response body audit'); responseAttachmentAudit = initializeAudit(key, route.audit.unstructured.options); var type = getContentType(proxy_Res); var ext = getExtension(type); var beforeAttachmentText = getBeforeAttachment(key, key + '.' + ext, type); logger.trace(req.transactionId+'-Writing unstructured response before attachment text');//: ", beforeAttachmentText); responseAttachmentAudit.write(beforeAttachmentText, 'binary'); isResAuditInitialized = true; } else { logger.trace(req.transactionId+'-There is NO unstructured response auditing for this response'); } // continue the current unstructured audit logging of the proxy response body file if (!_.isUndefined(responseAttachmentAudit)) { logger.trace(req.transactionId+'-Writing unstructured response audit chunk... '); responseAttachmentAudit.write(chunk, 'binary'); } // keep track of the actual file size in bytes received for both // the optional file size verification and optional file // stream buffering when configured uploadedSize += chunk.length; // if file buffering set for this configured route if (route.buffer) { uploadProgress = (uploadedSize / fileSize) * 100; logger.trace(req.transactionId+'- '+Math.round(uploadProgress) + "%" + " downloaded\n"); // write some data (i.e. 'chunk') to the underlying system // the return value 'bufferStore' indicates if you // should continue writing right now or not: if the data had // to be buffered internally, then 'tmpFile.write()' will return false, else true. // Note: this return value is strictly advisory: it MAY continue // to write, even if it returns false; however, writes will be buffered // in memory, so it is best not to do this excessively. Instead, wait // for the 'drain' event (defined above) before writing more data. logger.trace(req.transactionId+'-Writing proxy response stream received to buffer... '); var bufferStore = tmpFile.write(chunk); if (bufferStore == false) { // pause writing to the stream to wait for internal memory buffering, // until the 'drain' event is emmitted to resume writing to the stream logger.trace(req.transactionId+'-Proxy response stream\'s buffer writing paused to wait for internal memory buffering... '); proxy_Res.pause(); } } else { // write the binary chunk of the received file without buffering, i.e. directly // to the gateway response logger.trace(req.transactionId+'-Proxy response stream writing directly... '); res.write(chunk, 'binary'); } }); // end handling of proxy client response body (when present) proxy_Res.on('end', function (data) { // stop unstructured audit logging of proxy response body if happening (if initialized) if (isResAuditInitialized && !_.isUndefined(responseAttachmentAudit)) { var endAttachmentText = getEndAttachment(res.key); logger.trace(req.transactionId+'-End unstructured response chunk write to Audit');//:', endAttachmentText); responseAttachmentAudit.end(endAttachmentText); } logger.trace(req.transactionId+'-End response chunk write to client, returning gateway response from proxy client'); var errState = false; // if file length verification is set for this configured route if (route.strictLength) { logger.trace(req.transactionId+'-Received file length comparison : Received HTTP header Content-Length value:' + fileSize + ' bytes, received actual file UploadedSize:' + uploadedSize + ' bytes'); // if HTTP header Content-Length value does not match the actual file size received if (fileSize != uploadedSize) { // return an error gateway response, set errState to true logger.error(req.transactionId+'-HTTP Header Content-Length does not match received file size, Content-Length:' + fileSize + ' bytes; Uploaded Size: ' + uploadedSize + ' bytes'); var resBodyTxt = 'HTTP 1.1 500/Internal Server Error: HTTP Header Content-Length value does not match received file size.'; var resLength = resBodyTxt.length; res.writeHead(500, 'HTTP Header Content-Length does not match received file size, Content-Length:' + fileSize + ' bytes; Uploaded Size: ' + uploadedSize + ' bytes', { 'Content-Type' : 'text/plain', 'Content-Length' : resLength }); res.end(resBodyTxt); resDateTime = moment().format(); errState = true; } } // if file buffering set for this configured route if (route.buffer) { if (!errState) { // write the buffered file received to the gateway response stream, // now that buffering has completed without error, and // pass through the proxy response headers received logger.trace(req.transactionId+'-Writing gateway response stream from buffer... '); res.writeHead(proxy_Res.statusCode, proxy_Res.headers); try { fs.createReadStream(tmpPath).pipe(res); } catch (e) { logger.error(req.transactionId+'-fs.createReadStream call threw an error..., re-throwing...'); throw e; } } // release the tmp file in the tmp directory fs.unlink(tmpPath, function (err) { if(err) { logger.error(req.transactionId+'-Could not unlink file:' + tmpPath + ", where error:",err, err.stack); } }); } else { // no file buffering // if no errors occurred if (!errState) { // mark the gateway response as complete logger.trace(req.transactionId+'-Marking gateway response as finished.'); res.end(); resDateTime = moment().format(); } } // perform gateway request, gateway response, proxy response structured audit logging if config set if (route.audit && route.audit.structured && route.audit.structured.auditRequestResponse) { logger.trace(req.transactionId+'-Structured auditing gateway request and response (and proxy client\'s proxy_Res)');//, req, res); audit(route.audit.structured.options, req, res, proxy_Res, reqDateTime, resDateTime, '', function(auditRes) {}); } }); // handle error experienced when processing proxy client response body (when present) proxy_Res.on('error', function (err) { logger.error(req.transactionId+'-Error emitted from proxy client response processing, where error: ', err, err.stack); logger.trace(req.transactionId+'-Returning 500/Internal Server Error gateway response due to proxy client response processing error'); var resBodyTxt = 'HTTP 1.1 500/Internal Server Error'; var resLength = resBodyTxt.length; res.writeHead(500, 'Internal Server Error', { 'Content-Type' : 'text/plain', 'Content-Length' : resLength }); res.end(resBodyTxt); resDateTime = moment().format(); // stop unstructured audit logging of proxy response attachment received if occurring if (isResAuditInitialized && !_.isUndefined(responseAttachmentAudit)) { logger.trace(req.transactionId+'-End unstructured response chunk write to audit service, where error:', err); //logger.trace('End response chunk write to Audit');//: ', endAttachmentText); var endAttachmentText = getEndAttachment(res.key); responseAttachmentAudit.end(endAttachmentText); } // perform gateway request, gateway response, proxy response, and proxy response processing error structured audit logging if config set if (route.audit && route.audit.structured && route.audit.structured.auditRequestResponse) { logger.trace(req.transactionId+'-Structured auditing gateway request and response (and proxy client\'s proxy_Res, and proxy client\'s response processing error)');//, req, res); audit(route.audit.structured.options, req, res, proxy_Res, reqDateTime, resDateTime, err, function(auditRes) {}); } // if file buffering set for this configured route if (route.buffer) { // release the tmp file in the tmp directory fs.unlink(tmpPath, function (er) { if(er) { logger.error(req.transactionId+'-Could not unlink file:' + tmpPath + ', where error: ',er, er.stack); } }); } }); // if file buffering set for this configured route if (route.buffer) { // Allow empty config } else { // no file buffering // write the gateway response headers using the proxy response headers logger.trace(req.transactionId+'-Writing gateway response (no-response-file-buffering) headers...'); if (!res.headersSent) { res.writeHead(proxy_Res.statusCode, proxy_Res.headers); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function proxy_reply(res, code, headers, ret) {\n\t\tif (headers) {\n\t\t\tres.set(t.deployer.copy_headers(headers));\t\t\t\t\t// copy headers for our response\n\t\t}\n\t\tif (!ret) {\n\t\t\treturn res.status(code).send();\n\t\t} else {\n\t\t\treturn res.status(code).send(ret);\n\t\t}\n\t}", "function Proxy () {...
[ "0.6411474", "0.63302225", "0.6319571", "0.6254568", "0.6204309", "0.60719407", "0.6065553", "0.6017493", "0.5974821", "0.5893247", "0.5864908", "0.5829232", "0.5816578", "0.58152676", "0.5791078", "0.57828575", "0.57771933", "0.5762546", "0.575762", "0.575564", "0.56961447",...
0.7489599
0
initialize unstructured audit logging
function initializeAudit(key, options) { logger.trace(key+'-Initializing unstructured audit client request for transactionId-based key: ', key); // requestAttachmentAudit is an instance of http.ClientRequest, and implements the stream.Writable interface // auditRes is an instance of http.IncomingMessage // these are the post options requestAttachmentAudit = http.request(getAttachmentAuditOptions(key, options), function(auditRes) { auditRes.on('data', function(chunk) { logger.trace(key+'-Received beginning of unstructured audit data response from audit service, with chunk length (in bytes): ', chunk.length); //logger.trace(key+'-Unstructured audit reponses chunk =',chunk.toString('utf8')); }); auditRes.on('end', function(data) { logger.trace(key+'-Received end of unstructured audit response from audit service'); }); auditRes.on('error', function(e) { logger.error(key+'-Error with unstructured audit service response, where error: ', e, e.stack); }); }); // set the request socket timeout value, after request is assigned to the socket, emitting the 'socket' Event // sets time-out value for socket after request assigned to socket (i.e. no data activity) // 'socket' is an instance of net.Socket requestAttachmentAudit.on('socket', function (socket) { logger.trace(key+'-Unstructured audit request data socket event emitted...'); if(options.timeout) { socket.setTimeout(options.timeout); } // set the request socket time-out event handler socket.removeAllListeners('timeout'); socket.on('timeout', function () { logger.error(key+'-Unstructured audit service client experienced a timeout to remote audit service!'); socket.destroy(); }); socket.on('close', function () { logger.trace(key+'-Unstructured audit service client experienced a socket close event to remote audit service!'); }); }); requestAttachmentAudit.on('finish', function () { logger.trace(key+'-End request attachment unstructured audit write to audit service'); requestAttachmentAudit.end(); }); requestAttachmentAudit.on('error', function (err) { logger.error(key+'-Error with unstructured audit client write request!, where error: ',err,err.stack); }); return requestAttachmentAudit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _initLog(){\n //Push the log header to an array\n currentAction.push(\"Timestamp\");\n currentAction.push(\"User Action\");\n currentAction.push(\"Time needed in s\");\n //Push the single action log to an array containing all action logs\n userActions[0] = currentAction;\n //Reset the...
[ "0.7099939", "0.616929", "0.59051645", "0.5846553", "0.5841246", "0.57970935", "0.5743371", "0.5742514", "0.57094747", "0.56751317", "0.56672806", "0.5659692", "0.56566083", "0.5607742", "0.56006205", "0.5588992", "0.55870265", "0.5572705", "0.5559805", "0.553346", "0.5524140...
0.5065988
63
'fix' security options in configOptions parameter
function configureOptions(configOptions) { logger.trace("Fixing server SSL options");//, configOptions); var options = {}; options.https = {}; logger.trace("Fixing SSL key: ", JSON.stringify(configOptions.https.key)); if (!_.isUndefined(configOptions.https.key) && _.isString(configOptions.https.key)) { logger.trace("Loading SSL key file: ", configOptions.https.key); options.https.key = fs.readFileSync(configOptions.https.key); } if (!_.isUndefined(configOptions.https.cert) && _.isString(configOptions.https.cert)) { logger.trace("Loading SSL cert file: ", configOptions.https.cert); options.https.cert = fs.readFileSync(configOptions.https.cert); } if (!_.isUndefined(configOptions.https.pfx) && _.isString(configOptions.https.pfx)) { logger.trace("Loading SSL pfx file: ", configOptions.https.pfx); options.https.pfx = fs.readFileSync(configOptions.https.pfx); } options.https.requestCert = configOptions.https.requestCert; options.https.rejectUnauthorized = configOptions.https.rejectUnauthorized; options.https.agent = configOptions.https.agent; if (!_.isUndefined(configOptions.https.ca) && Array.isArray(configOptions.https.ca)) { options.https.ca = []; for (var i = 0; i < configOptions.https.ca.length; i++) { logger.trace("Loading SSL ca file: ", configOptions.https.ca[i]); options.https.ca[i] = fs.readFileSync(configOptions.https.ca[i]); } } options.https.passphrase = configOptions.https.passphrase; return options; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initConfig(ctx) {\n return __awaiter(this, void 0, void 0, function* () {\n const isTrusted = stateUtils_1.getFromWorkspaceState(WORKSPACE_IS_TRUSTED_KEY, false);\n if (isTrusted !== defaultConfig.workspaceIsTrusted()) {\n defaultConfig.toggleWorkspaceIsTrusted();\n }\n ...
[ "0.58123785", "0.5586632", "0.5586632", "0.5542212", "0.554184", "0.55275524", "0.5465999", "0.54581815", "0.5453196", "0.5453196", "0.5453196", "0.5453196", "0.5453196", "0.5434075", "0.54136807", "0.54118866", "0.5411763", "0.5382656", "0.5382656", "0.53799045", "0.53791094...
0.59409773
0
define the structured audit logging function
function audit(options, req, res, proxyRes, reqDateTime, resDateTime, err, callback) { // auditService is an instance of http.ClientRequest, and implements the stream.Writable interface // auditRes is an instance of http.IncomingMessage var auditService = http.request(options, function(auditRes) { auditRes.on('data', function(chunk) { logger.trace(req.transactionId+'-Writing structured audit data from audit service, with chunk length (in bytes): ', chunk.length); }); auditRes.on('end', function(data) { logger.trace(req.transactionId+'-End of structured audit write response from audit service'); }); auditRes.on('error', function(e) { logger.error(req.transactionId+'-Error with structured audit write response from audit service, where error: ', e, e.stack); }); }); // set the request socket timeout value, after request is assigned to the socket, emitting the 'socket' Event // sets time-out value for socket after request assigned to socket (i.e. no data activity) // 'socket' is an instance of net.Socket auditService.on('socket', function (socket) { logger.trace(req.transactionId+'-Structured audit data socket event emitted...'); if(options.timeout) { socket.setTimeout(options.timeout); } // set the request socket time-out event handler socket.removeAllListeners('timeout'); socket.on('timeout', function () { logger.error(req.transactionId+'-Structured audit service client experienced a timeout to remote audit service!'); socket.destroy(); }); socket.on('close', function () { logger.trace(req.transactionId+'-Structured audit service client experienced a socket close event to remote audit service!'); }); }); // explicitly throw an descriptive error to be logged if auditService request has an Error event, e.g. can't connect to eCRUD Audit Service endpoint, or audit endpoint socket times out auditService.on('error', function (err) { logger.error(req.transactionId+'-Error with structured audit client request!, where error: ', err, err.stack); }); auditService.on('finish', function () { logger.trace(req.transactionId+'-End request structured audit write to audit service'); }); req = req ? req : {}; res = res ? res : {}; proxyRes = proxyRes ? proxyRes : {}; reqDateTime = reqDateTime ? reqDateTime : {}; resDateTime = resDateTime ? resDateTime : {}; // normalize the err into JSON to avoid cyclical // JSON object conversion errors and ecrud audit storage errors error = {}; error.errno = err.errno; error.message = err.message; error.stack = err.stack; var audit = {}; audit.transactionId = req.transactionId; audit.req = {}; audit.req.url = req.url; audit.req.parsedUrl = req.parsedUrl; audit.req.headers = req.headers; audit.req.method = req.method; audit.req.httpVersion = req.httpVersion; audit.req.trailers = req.trailers; audit.req.remoteAddress = req.connection.remoteAddress; audit.req.key = req.key; audit.req.datetime = reqDateTime; audit.res = {}; audit.res.headers = res.headers; if(!audit.res.headers) { audit.res.headers = res._headers; } if(!audit.res.headers) { audit.res.headers = res._header; } audit.res.statusCode = res.statusCode; audit.res.key = res.key; audit.res.datetime = resDateTime; audit.res.err = error; audit.proxyRes = {}; audit.proxyRes.headers = proxyRes.headers; audit.proxyRes.statusCode = proxyRes.statusCode; var auditStr = JSON.stringify(audit); logger.trace(req.transactionId+'-Structured Auditing string: ' + auditStr); auditService.write(auditStr, 'binary'); auditService.end(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _____INTERNAL_log_functions_____(){}\t\t//{", "function logger(event, payload) {\n let timestamp = new Date();\n console.log({ timestamp, event, payload });//considered a destructured object\n }", "function logSomething(log) { log.info('something'); }", "function log() {\n //log here\n...
[ "0.65858924", "0.6513655", "0.65098625", "0.6341113", "0.63210577", "0.6280865", "0.615962", "0.61504555", "0.6079212", "0.6047697", "0.5969082", "0.59559935", "0.59535676", "0.59328073", "0.5886105", "0.5879847", "0.587066", "0.5781276", "0.57782733", "0.5760878", "0.5754734...
0.0
-1
create and set the winston logger instance
function getLogger() { var consoleOptions = {"level": config.log.console.level,"silent": config.log.console.silent,"colorize": config.log.console.colorize,"timestamp": config.log.console.timestamp, "label": config.log.console.label}; var fileOptions = {"level": config.log.file.level,"silent": config.log.file.silent,"colorize": config.log.file.colorize,"timestamp": config.log.file.timestamp,"label": config.log.file.label,"filename": config.log.file.filename, "maxsize": config.log.file.maxSize,"maxFiles": config.log.file.maxFiles,"json": config.log.file.json}; var logger = new (winston.Logger)({ // set the custom log levels levels: config.logger.levels, transports: [ new (winston.transports.Console)(consoleOptions), new (winston.transports.File)(fileOptions) ] }); // set the custom log colors for the levels winston.addColors(config.logger.colors); return logger; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createLogger() {\n var winston = require('winston');\n\n var logger = new (winston.Logger)({\n transports: [\n new (winston.transports.Console)({\n timestamp: true\n }),\n new (winston.transports.File)({\n filename: 'api.log',\n ...
[ "0.7129485", "0.7122858", "0.6987306", "0.66949475", "0.66879934", "0.66537815", "0.662654", "0.6579134", "0.65747696", "0.65742296", "0.65371025", "0.6516548", "0.6446863", "0.6426438", "0.6426438", "0.6367178", "0.6347217", "0.6325583", "0.6295159", "0.6168651", "0.61472315...
0.69782764
3
TODO rotear o update e o destroy.
async update(req, res){ const id = req.params.id; const {name, bio, techs, latitude, longitude} = req.body; const location ={ type: 'Point', coordinates: [longitude, latitude] } const techsArray = parseStringAsArray(techs); let devUpdate = await Dev.findById(id); if(!devUpdate){ res.json({message: "Não foi encontrado usuário com o id requisitado"}); } devUpdate = await Dev.findByIdAndUpdate(id, { name, bio, techs:techsArray, location }, {new:true}); return res.json(devUpdate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update(){}", "update(){}", "update(){}", "update() {\n //Apply changes\n super.update()\n //Remove if expired\n if (this.cycle <= 0) {\n this.destroy()\n }\n }", "destroy() {\n return this.update();\n }", "de...
[ "0.66172093", "0.66172093", "0.66172093", "0.63162076", "0.6291264", "0.6274449", "0.6107854", "0.60586643", "0.60515946", "0.5969239", "0.59311575", "0.5893716", "0.5832892", "0.5818856", "0.5818856", "0.5818856", "0.5818856", "0.5818856", "0.5818856", "0.5818856", "0.581885...
0.0
-1
=== INTERNAL FUNCTION ===
function startNewMonth(lastMonthClosing, period) { const newMonth = {}; // sets the period of the new month and passes on the closing total of last month newMonth.period = period; newMonth.openingTotal = lastMonthClosing; return newMonth; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "transient private protected internal function m182() {}", "private public function m246() {}", "transient protected internal function m189() {}", "protected internal function m252() {}", "transient private internal function m185() {}", "transient final protected i...
[ "0.7372542", "0.72303957", "0.7228333", "0.71747947", "0.70473444", "0.7014209", "0.68316734", "0.65947413", "0.6515423", "0.64470327", "0.64438653", "0.64324856", "0.6422316", "0.6364594", "0.62563163", "0.6251298", "0.6226414", "0.61214155", "0.61149085", "0.6104029", "0.60...
0.0
-1
creates the summary object for the months changes
function aggregateMonthChanges(changes) { const updatedChanges = { add: 0, death: 0, theft: 0, sale: 0 }; // accumulate the different changes for the month changes.forEach(change => { if (!updatedChanges[change.reasonForChange]) { updatedChanges[change.reasonForChange] = change.animalsMoved; } else { updatedChanges[change.reasonForChange] += change.animalsMoved; } }); return updatedChanges; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CalculateTotalsMonthToDate() {\n //use temp variables to prevent multiple dom updates\n var wt = 0; //written total\n var dt = 0; //delivered total\n var gt = 0; //goals total\n for (var i = 0; i < vm.territorySalesNumbers.length; i++) {\n wt += vm.territoryWritten[i];\n ...
[ "0.63781214", "0.6243058", "0.6224361", "0.61561763", "0.6020074", "0.60071856", "0.59950596", "0.5955951", "0.5841789", "0.57974535", "0.57925195", "0.57576716", "0.57401246", "0.5680722", "0.5643301", "0.56413084", "0.55726916", "0.55608064", "0.5555992", "0.55387586", "0.5...
0.6885843
0
calculates the closing total
function getClosingTotal(monthsChanges, openingTotal) { let closingTotal = openingTotal; for (let i = 0; i < monthsChanges.length; i++) { closingTotal += monthsChanges[i].animalsMoved; } return closingTotal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function finalTotalAmountOfThisOrder()\n {\n return (nanCheck(parseFloat(subTotalWithoutShippingCost())) + nanCheck(parseFloat(shippingCostOfThisMainOrder()))).toFixed(2);\n }", "close(monowave) {\n\t\tthis.dateEnd\t= monowave.timeEnd;\n\t\tthis.valueEnd\t= monowave.valueEnd;\n\t\tvar de...
[ "0.6102411", "0.56489104", "0.5648566", "0.55740833", "0.5551331", "0.5542211", "0.5503885", "0.54976916", "0.54424524", "0.5420663", "0.5413911", "0.5407438", "0.5402365", "0.54008365", "0.53891134", "0.5364391", "0.53439355", "0.5342617", "0.5325134", "0.53202355", "0.53146...
0.66610575
0
updateUserType(): update type and company
async function updateUserHire(user, type, company) { user.type = type; user.company = company; return getParticipantRegistry('org.pow.app.User').then(function(registry) { return registry.update(user) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateUserType(userType) {\n \n }", "async function handleUserTypeValueSave() {\n updateIsSaving(true);\n\n await updateInstance({\n variables: {\n actionId: UPDATE_USER_TYPE_FOR_APP_SPEC_ACTION_ID,\n executionParameters: JSON.stringify({\n value: userTypeValue,\n ...
[ "0.8273181", "0.6726988", "0.66048133", "0.65727586", "0.6209959", "0.6169125", "0.60411185", "0.5779423", "0.57591254", "0.56994724", "0.5686445", "0.5627551", "0.5609914", "0.5605066", "0.55989826", "0.55763876", "0.5547815", "0.5544743", "0.55432266", "0.551386", "0.549086...
0.6883742
1
when the mode changes (players turn to pick card or vote ), notify the card so it can transition to the new mode
ngOnChanges(changes) { if (this.currMode !== undefined && changes.currMode) { console.log(`new mode: ${this.currMode}`); this.transitionToNewMode(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "transitionToNewMode() {\n console.log('transition');\n if (this.card != null) {\n switch (this.currMode) {\n case _entity_data_structures_card_modes__WEBPACK_IMPORTED_MODULE_1__[\"cardMode\"].voting: {\n this.cardText.nativeElement.textContent = \"\";\n ...
[ "0.7414258", "0.69916946", "0.6913078", "0.68663174", "0.67285115", "0.65880203", "0.6555028", "0.6534676", "0.6502349", "0.63831896", "0.6364362", "0.634549", "0.6335072", "0.63145643", "0.6262125", "0.62173915", "0.6210121", "0.61701095", "0.61609906", "0.6155178", "0.61353...
0.553447
94
modify the text and flip the cards as necessary to enter the new mode
transitionToNewMode() { console.log('transition'); if (this.card != null) { switch (this.currMode) { case _entity_data_structures_card_modes__WEBPACK_IMPORTED_MODULE_1__["cardMode"].voting: { this.cardText.nativeElement.textContent = ""; this.transitionCardToFace("front"); if (this.votingPhraseText == null) { this.cardText.nativeElement.textContent = "vote above !"; } else { this.cardText.nativeElement.textContent = this.votingPhraseText; } break; } case _entity_data_structures_card_modes__WEBPACK_IMPORTED_MODULE_1__["cardMode"].waiting: { this.cardText.nativeElement.textContent = ""; this.transitionCardToFace("front"); this.cardText.nativeElement.textContent = "waiting ..."; break; } case _entity_data_structures_card_modes__WEBPACK_IMPORTED_MODULE_1__["cardMode"].myTurn: { this.cardText.nativeElement.textContent = ""; this.transitionCardToFace("back"); this.cardText.nativeElement.textContent = this.cardData.card_text; break; } } this.disableCardChooseButton(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function flipCard(card) {\n //Change the question (for now)\n if (card.className !== \"card flipped\") {\n card.children[1].textContent = BTQuestions[counter++];\n if (counter === BTQuestions.length) {\n BTQuestions = shuffle(BTQuestions);\n counter = 0\n }\n }\n card.classList.toggle(\"flip...
[ "0.6693379", "0.6615352", "0.6580999", "0.65573806", "0.6531578", "0.644659", "0.6374866", "0.63484454", "0.6326378", "0.6326366", "0.62626284", "0.62561923", "0.6254042", "0.6251482", "0.6244136", "0.6243179", "0.6217477", "0.621517", "0.62074244", "0.6166291", "0.61537254",...
0.664673
1
disable the choice button to select a card when it is not a player's turn
disableCardChooseButton() { let choiceButtonIsDisabled = this.choiceButton.nativeElement.classList.contains('disabled'); if ((this.currMode == _entity_data_structures_card_modes__WEBPACK_IMPORTED_MODULE_1__["cardMode"].voting && !choiceButtonIsDisabled) || (this.currMode == _entity_data_structures_card_modes__WEBPACK_IMPORTED_MODULE_1__["cardMode"].myTurn && choiceButtonIsDisabled) || (this.currMode == _entity_data_structures_card_modes__WEBPACK_IMPORTED_MODULE_1__["cardMode"].waiting && !choiceButtonIsDisabled)) { this.choiceButton.nativeElement.classList.toggle('disabled'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectCard (card) {\n humanPlayer.hand.tradeIns[card] = !humanPlayer.hand.tradeIns[card];\n \n if (humanPlayer.hand.tradeIns[card]) {\n dullCard(HUMAN_PLAYER, card);\n } else {\n fillCard(HUMAN_PLAYER, card);\n }\n}", "function disableCorrectCards(){\n $(selectedCards[0]).f...
[ "0.68734705", "0.680857", "0.6636066", "0.6599548", "0.6596022", "0.6585438", "0.6512607", "0.650694", "0.64482456", "0.6443079", "0.6438787", "0.6417244", "0.63575923", "0.63459194", "0.6343458", "0.63352144", "0.6319061", "0.6315705", "0.6285187", "0.62676185", "0.6257512",...
0.7814878
0
flip a card over to the desired face side
transitionCardToFace(face) { let cardIsOnFace = this.card.nativeElement.classList.contains('flip'); //switch statement on which card face we would like to end up at after some fancy flipping switch (face) { case ("front"): { console.log('to front'); if (cardIsOnFace) { setTimeout(() => this.card.nativeElement.classList.toggle('flip'), this.cardFlipTime); this.card.nativeElement.classList.toggle('flip'); } else { this.card.nativeElement.classList.toggle('flip'); } break; } // NOTE: setTimeout is an asynchronous function, so toggling nativeElement outside of // a setTimeout will always execute faster regardless of position in code case ("back"): { console.log('to back'); if (cardIsOnFace) { this.card.nativeElement.classList.toggle('flip'); } break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "flipDown() {\n if (this.isActive && !this.isFaceDown) {\n // flip card face down\n this.queueVisualEffect(\n () => {\n this.el.classList.toggle('flip');\n },\n true\n );\n // make card clickable only when it is completely flipped face down\n this.queueVisua...
[ "0.7663158", "0.73939055", "0.7360192", "0.7335991", "0.7271707", "0.7264502", "0.7262538", "0.72207475", "0.7162209", "0.7128635", "0.71278775", "0.7118793", "0.70941424", "0.70846605", "0.70786315", "0.7062652", "0.70494026", "0.703777", "0.70366997", "0.7016113", "0.701430...
0.7276004
4
get list of all players excluding this current one
getAllOtherPlayersList(allPlayers) { console.log("all players: " + allPlayers); var output = []; allPlayers.forEach((player) => { if (player.Id != this.socket.id) { output.push(player); } }); console.log("all other players: " + output); return output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBluePlayers() {\r\n\treturn room.getPlayerList().filter(p => p.team == 2);\r\n}", "function getRedPlayers() {\r\n\treturn room.getPlayerList().filter(p => p.team == 1);\r\n}", "getAllPlayers() {\n return Player.find({}).exec();\n }", "function removeAllPlayers() {\n listPlayers.splic...
[ "0.660605", "0.6592557", "0.6487351", "0.64639515", "0.64142793", "0.636623", "0.6298725", "0.627018", "0.6214694", "0.61836666", "0.61701465", "0.61569387", "0.6130434", "0.61053574", "0.6086726", "0.6076323", "0.60375464", "0.59678966", "0.5960814", "0.59538", "0.5928698", ...
0.70125395
0
a round is cancelled if it is someone's turn to pick a card and collect votes, but they disconnect
getRoundIsCancelled() { let observable = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"](observer => { this.socket.on('roundCancelled', (idNextRoundHost) => { var isNewHost; isNewHost = false; if (this.socket.id == idNextRoundHost) { isNewHost = true; } observer.next(isNewHost); }); return () => { this.disconnectSocket(); }; }); return observable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancelMyBid() {\n\n}", "function cancelBids () {\n}", "function cancel() {\n transition(DELETE, true);\n\n props.cancelInterview(props.id)\n .then(response => {\n transition(EMPTY);\n })\n .catch(error => {\n transition(ERROR, true);\n })\n }", "function Cancellation() {...
[ "0.6405195", "0.6382384", "0.6030974", "0.5992885", "0.59616435", "0.59570885", "0.5893065", "0.58822864", "0.5874092", "0.5828822", "0.5714946", "0.5705814", "0.56973666", "0.5690748", "0.5683877", "0.5664352", "0.56468314", "0.5638386", "0.5623588", "0.5616252", "0.55944306...
0.0
-1
signal to the server that a card was picked
pickCard(card) { this.socket.emit('clientPickedCard', this.connectedRoom, card); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "moveCardFromHandToDiscard(card) {\n this.socket.emit(\"moveCardFromHandToDiscard\", card.uniqueName);\n }", "function playercardturn(player){\n //show cards\n //ask to select cards to play\n //push them into action slot\n }", "function selectCard(evt) {\n console.log(\"select card\", evt);\n ...
[ "0.6337688", "0.623733", "0.62235826", "0.6184626", "0.6156489", "0.5931886", "0.592926", "0.5880617", "0.5833592", "0.57898045", "0.5785704", "0.57522863", "0.5659242", "0.5627489", "0.5591926", "0.55628574", "0.5544106", "0.5543729", "0.5534355", "0.5523758", "0.5520991", ...
0.80335593
0
wait for the card picked by player with the turn
getPickedCard() { let observable = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"](observer => { this.socket.on('serverSendCardPicked', (cardObject) => { if (cardObject) { observer.next(cardObject.card_text); } else { observer.next(null); } }); return () => { this.disconnectSocket(); }; }); return observable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function selectCard(event) {\n let card = $(this);\n let invalidCard = card.attr('class') === 'card open show' || card.attr('class') === 'card match';\n // Will return if the card clicked is already opened or the game is already matching another pair of cards\n if (invalidCard || matching) {\n ...
[ "0.7446441", "0.72535795", "0.67397904", "0.67022634", "0.66978", "0.6647856", "0.6637127", "0.6608728", "0.6590938", "0.65778035", "0.6565351", "0.6546388", "0.6540696", "0.65369606", "0.6536344", "0.65274936", "0.64892983", "0.6469878", "0.6463676", "0.6457025", "0.6433829"...
0.0
-1
wait for the voting results for the round
getVoteResults() { let observable = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"](observer => { this.socket.on('serverSendVoteResults', (results, winners, cardVotingOn) => { observer.next([results, winners, cardVotingOn]); }); return () => { this.disconnectSocket(); }; }); return observable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function voting() {\n let chan = bot.guilds\n .get(get('config.discord.serverID'))\n .channels.find('name', get('config.discord.channelName'));\n chan\n .send(votestart('...', 'Loading...'))\n .then(message => {\n requ()\n .then(arr => {\n tweets = arr;\n round = get('ro...
[ "0.7091946", "0.6542191", "0.65351", "0.65130377", "0.6359948", "0.62800115", "0.62660664", "0.62589645", "0.6181286", "0.61379194", "0.6132812", "0.606086", "0.60488003", "0.6034855", "0.60305", "0.59969145", "0.5965054", "0.595701", "0.5953736", "0.5937811", "0.5917191", ...
0.0
-1