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
string > [[str name, str addr]... ]
function stringToStringTuples (str) { const tuples = [] const parts = str.split('/').slice(1) // skip first empty elem if (parts.length === 1 && parts[0] === '') { return [] } for (let p = 0; p < parts.length; p++) { const part = parts[p] const proto = protocols(part) if (proto.size === 0) { tuples.push([part]) continue } p++ // advance addr part if (p >= parts.length) { throw ParseError('invalid address: ' + str) } tuples.push([part, parts[p]]) } return tuples }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function combine_ipaddr(ipaddr_name) {\n\tvar obj;\n\tvar ip = \"\";\n\tfor (i=0;i<4;i++) {\n\t\tobj = get_by_name(ipaddr_name)[i];\n\t\tip += obj.value;\n\t\tif (i<3)\n\t\t\tip += \".\";\n\t}\n\tif (ip == \"...\") \n\t\tip = \"\";\n\treturn ip;\n}", "function stringToStringTuples(str) {\n const tuples = [];\...
[ "0.61670023", "0.611367", "0.59880495", "0.59880495", "0.59880495", "0.59880495", "0.59880495", "0.59607935", "0.56252503", "0.55841464", "0.5477685", "0.5477685", "0.5477685", "0.5477685", "0.5394429", "0.52247036", "0.52212423", "0.5213422", "0.5211407", "0.52101266", "0.52...
0.6081265
4
[[str name, str addr]... ] > string
function stringTuplesToString (tuples) { const parts = [] map(tuples, function (tup) { const proto = protoFromTuple(tup) parts.push(proto.name) if (tup.length > 1) { parts.push(tup[1]) } }) return '/' + parts.join('/') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function combine_ipaddr(ipaddr_name) {\n\tvar obj;\n\tvar ip = \"\";\n\tfor (i=0;i<4;i++) {\n\t\tobj = get_by_name(ipaddr_name)[i];\n\t\tip += obj.value;\n\t\tif (i<3)\n\t\t\tip += \".\";\n\t}\n\tif (ip == \"...\") \n\t\tip = \"\";\n\treturn ip;\n}", "function nameAddr() {\n return wrap('name-addr', and(o...
[ "0.6510328", "0.60950327", "0.60950327", "0.60950327", "0.60950327", "0.5971983", "0.5971923", "0.59304994", "0.5918348", "0.5918348", "0.5918348", "0.5918348", "0.5918348", "0.5845686", "0.5845686", "0.5845686", "0.5845686", "0.5845686", "0.5636138", "0.5516671", "0.54219544...
0.52569395
28
[[str name, str addr]... ] > [[int code, Buffer]... ]
function stringTuplesToTuples (tuples) { return map(tuples, function (tup) { if (!Array.isArray(tup)) { tup = [tup] } const proto = protoFromTuple(tup) if (tup.length > 1) { return [proto.code, convert.toBuffer(proto.code, tup[1])] } return [proto.code] }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", ...
[ "0.57672274", "0.57672274", "0.57672274", "0.57672274", "0.57672274", "0.5761242", "0.5761242", "0.5761242", "0.5761242", "0.5761242", "0.5761242", "0.5761242", "0.5761242", "0.5761242", "0.5761242", "0.57588613", "0.57588613", "0.57517624", "0.57404816", "0.57404816", "0.574...
0.0
-1
[[int code, Buffer]... ] > [[str name, str addr]... ]
function tuplesToStringTuples (tuples) { return map(tuples, function (tup) { const proto = protoFromTuple(tup) if (tup.length > 1) { return [proto.code, convert.toString(proto.code, tup[1])] } return [proto.code] }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", ...
[ "0.574281", "0.574281", "0.574281", "0.574281", "0.574281", "0.5728729", "0.5728729", "0.5717919", "0.5717919", "0.5717919", "0.56506675", "0.56506675", "0.56506675", "0.56506675", "0.56506675", "0.56506675", "0.56506675", "0.56506675", "0.56506675", "0.56506675", "0.55715626...
0.45948574
96
[[int code, Buffer ]... ] > Buffer
function tuplesToBuffer (tuples) { return fromBuffer(Buffer.concat(map(tuples, function (tup) { const proto = protoFromTuple(tup) let buf = new Buffer(varint.encode(proto.code)) if (tup.length > 1) { buf = Buffer.concat([buf, tup[1]]) // add address buffer } return buf }))) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n }", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map...
[ "0.64548796", "0.64548796", "0.64548796", "0.64548796", "0.64548796", "0.64548796", "0.6404874", "0.6284827", "0.6284827", "0.6284827", "0.6284827", "0.6284827", "0.62748003", "0.62655306", "0.62655306", "0.62655306", "0.62046844", "0.62046844", "0.6171525", "0.6149373", "0.6...
0.628175
12
Buffer > [[int code, Buffer ]... ]
function bufferToTuples (buf) { const tuples = [] let i = 0 while (i < buf.length) { const code = varint.decode(buf, i) const n = varint.decode.bytes const p = protocols(code) const size = sizeForAddr(p, buf.slice(i + n)) if (size === 0) { tuples.push([code]) i += n continue } const addr = buf.slice(i + n, i + n + size) i += (size + n) if (i > buf.length) { // did not end _exactly_ at buffer.length throw ParseError('Invalid address buffer: ' + buf.toString('hex')) } // ok, tuple seems good. tuples.push([code, addr]) } return tuples }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", ...
[ "0.61813927", "0.61813927", "0.61813927", "0.61813927", "0.61813927", "0.61727864", "0.61727864", "0.61582136", "0.61582136", "0.61582136", "0.6007641", "0.60009056", "0.59825116", "0.5975244", "0.5960132", "0.595582", "0.595582", "0.595582", "0.595582", "0.5950382", "0.59503...
0.57656384
64
Month is 1 based
function days_in_month(month, year) { return new Date(year, month, 0).getDate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "M (date) {\n return date.getMonth() + 1\n }", "MM (date) {\n return pad(date.getMonth() + 1)\n }", "monthof(m) { \n switch (m) {\n case 1: return 31;\n break;\n case 2: return 28;\n break;\n case 3: return 31;\n ...
[ "0.7786311", "0.7703898", "0.7547115", "0.75340724", "0.7453067", "0.7355903", "0.7351552", "0.7320615", "0.72682405", "0.72482646", "0.7202675", "0.7167751", "0.7167113", "0.71666676", "0.71666116", "0.704", "0.704", "0.7037979", "0.7037979", "0.7014996", "0.6994625", "0.6...
0.0
-1
Function to make the password visible
showPassword(e) { if(e){ var x = document.getElementById("exampleInputPassword1"); if (x.type === "password") { x.type = "text"; } else { x.type = "password"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showPassword() {\n\tvar x = document.getElementById(\"password\");\n\tif (x.type === \"password\") {\n\t x.type = \"text\";\n\t} else {\n\t x.type = \"password\";\n\t}\n}", "function showPassword(displayPassword) {\n document.getElementById(\"password\").textContent = displayPassword;\n}", "functio...
[ "0.80083334", "0.7949548", "0.7917727", "0.78051215", "0.7754011", "0.77374643", "0.75374913", "0.752406", "0.74986297", "0.74875414", "0.7483927", "0.74505216", "0.7416016", "0.7405581", "0.74018633", "0.7365755", "0.73456156", "0.7333719", "0.73046505", "0.727083", "0.72253...
0.7691288
6
Render Search History to the side bar
function renderHistory() { keys = Object.keys(localStorage); renderWeather(); keys.forEach((element) => { ///I use the local storage to save the last search recent so this is if (element !== "lastSearchedCity") { let history = $("<li>").text(element).addClass("recentHistory"); $("#recent-history").append(history); } }); city = localStorage.getItem("lastSearchedCity"); renderWeather(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderHistoryList() {}", "function renderSearchHistory() {\n var storedInitials = JSON.parse(localStorage.getItem(\"search\"));\n locationArr = storedInitials;\n\n for (var i = 0; i < locationArr.length; i++) {\n var searchHistoryList = document.createElement(\"li\");\n searchHistoryList.setAtt...
[ "0.7022282", "0.68599397", "0.6753106", "0.6540701", "0.64023733", "0.63515586", "0.6346039", "0.6341267", "0.6274871", "0.6132972", "0.611475", "0.6103948", "0.60996795", "0.60921645", "0.60869604", "0.608087", "0.6037994", "0.6031692", "0.6020746", "0.5986857", "0.59419715"...
0.6297695
8
FUnction to render the current weather
function renderCurrentWeather(dataCurrentWeather) { const weatherCityName = dataCurrentWeather.name; const weatherCondition = dataCurrentWeather.weather[0].main; const weatherTemp = dataCurrentWeather.main.temp; const weatherHumidity = dataCurrentWeather.main.humidity; const weatherWind = dataCurrentWeather.wind.speed; weatherLat = dataCurrentWeather.coord.lat; weatherLon = dataCurrentWeather.coord.lon; localStorage.setItem("lastSearchedCity", weatherCityName); ////////Storage Search City to local storage//// function saveCityToLocalStorage(item) { let localStorageMessage = $("#weather-search-bar").val().toUpperCase(); let inputbarParentID = $("#weather-search-bar").val().toUpperCase(); if (localStorage.getItem(localStorageMessage)) { //pass } else { localStorage.setItem(inputbarParentID, localStorageMessage); $("#recent-history").append( $("<li>").text(localStorageMessage).addClass("recentHistory") ); } } saveCityToLocalStorage(); ////////////////////////Append the information to the html/////////////// $("#current-weather-container") .children("h1") .html("You can viewing the weather report of: " + weatherCityName); $("#current-weather-container-condition").html( "Today weather condition is: " + weatherCondition ); $("#current-weather-container-temp").html( "Today tempature is: " + weatherTemp + " C" ); $("#current-weather-container-humidity").html( "Today humidity is: " + weatherHumidity ); $("#current-weather-container-wind").html( "Today windspeed is: " + weatherWind ); //////////////////////Because the UV is existing in another API, I need to call UV API////////////////////// //////////////////Now enjoy this spaghetti//////// const settings_1 = { url: "http://api.openweathermap.org/data/2.5/uvi?appid=c1f7f71746ba6e7fda1ac3eca46c4500&lat=" + weatherLat + "&lon=" + weatherLon, method: "GET", }; function renderUV(dataUV) { let weatherUV = dataUV.value; $("#current-weather-container-uv").html("Today UV is: " + weatherUV); if (weatherUV >= 0 && weatherUV < 3) { $("#current-weather-container-uv").css("background-color", "green"); } else if (weatherUV >= 3 && weatherUV < 6) { $("#current-weather-container-uv").css("background-color", "yellow"); } else if (weatherUV >= 6 && weatherUV < 8) { $("#current-weather-container-uv").css("background-color", "orange"); } else if (weatherUV >= 8 && weatherUV < 11) { $("#current-weather-container-uv").css("background-color", "red"); } else if (weatherUV >= 11) { $("#current-weather-container-uv").css("background-color", "purple"); } else { $("#current-weather-container-uv").html("ESCAPE FROM MOTHER EARTH!!"); } } $.ajax(settings_1).then(renderUV).catch(errorFunction); ////////////////////////////////////////////////////////////////////// }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderWeather(data) {\n\toutputLocation.textContent = data.name + \", \" + data.sys.country;\n\toutputTemp.textContent = Math.round(data.main.temp);\n\toutputDesc.textContent = \" \" + data.weather[0].description;\n\toutputMaxTemp.textContent = \" \" + Math.round(data.main.temp_max);\n\toutputMinTemp.text...
[ "0.73947626", "0.7280583", "0.72365373", "0.7206919", "0.71708155", "0.7163274", "0.71141857", "0.70769805", "0.7055402", "0.70539325", "0.70528114", "0.7048736", "0.7047533", "0.70363975", "0.7029938", "0.7001123", "0.69831103", "0.6956311", "0.6948383", "0.6945235", "0.6926...
0.0
-1
Storage Search City to local storage
function saveCityToLocalStorage(item) { let localStorageMessage = $("#weather-search-bar").val().toUpperCase(); let inputbarParentID = $("#weather-search-bar").val().toUpperCase(); if (localStorage.getItem(localStorageMessage)) { //pass } else { localStorage.setItem(inputbarParentID, localStorageMessage); $("#recent-history").append( $("<li>").text(localStorageMessage).addClass("recentHistory") ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function storeSearch() {\n localStorage.setItem('cities', JSON.stringify(allCities));\n}", "function storeLookupCity() {\n\n localStorage.setItem(\"SearchedCity\", JSON.stringify(searchedCity));\n}", "function saveCitySearch(city) {\n cityArr.push(city.toLowerCase());\n localStorage.setItem(\"c...
[ "0.8242157", "0.80308855", "0.7977705", "0.7835976", "0.77531713", "0.7630605", "0.76001495", "0.759969", "0.75666624", "0.7434485", "0.7381797", "0.73768234", "0.7357764", "0.73375696", "0.73187834", "0.7318287", "0.73105556", "0.72839904", "0.72810763", "0.72541094", "0.718...
0.6554526
57
used in componentWillReceiveProps to update patientHuddles, selectedPatientHuddle, and selectedPatientHuddlePatientInfo state
updateHuddles(patient, huddles, selectedDate) { let patientHuddles = getPatientHuddles(patient, huddles); let selectedPatientHuddle; if (patientHuddles != null) { selectedPatientHuddle = this.selectedPatientHuddle(selectedDate, patientHuddles); } let selectedPatientHuddlePatientInfo; if (selectedPatientHuddle != null) { selectedPatientHuddlePatientInfo = selectedPatientHuddle.patients.find((patient) => patient.id === this.props.patient.id); } this.setState({ patientHuddles, selectedPatientHuddle, selectedPatientHuddlePatientInfo }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentWillReceiveProps(nextProps) {\n console.log(\"SelectFromObject props\");\n console.log(nextProps);\n nextProps.selected ? this.setState({selected: nextProps.selected}) : '';\n }", "componentWillReceiveProps(nextProps) {\n // console.log(\"SelectFromObject props\");\n // console.log(nextP...
[ "0.5970631", "0.5964549", "0.59529996", "0.5948595", "0.5934879", "0.57891124", "0.577498", "0.57616746", "0.57463974", "0.56879246", "0.5653843", "0.56337166", "0.56114835", "0.5606435", "0.5602623", "0.5600986", "0.56008255", "0.55945164", "0.55933684", "0.5581502", "0.5564...
0.7381843
0
used in updateHuddles to select huddle for patient on the given selected date
selectedPatientHuddle(selectedDate, patientHuddles) { if (patientHuddles == null) { return null; } return patientHuddles.find((huddle) => moment(selectedDate).isSame(huddle.datetime, 'day')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateHuddles(patient, huddles, selectedDate) {\n let patientHuddles = getPatientHuddles(patient, huddles);\n\n let selectedPatientHuddle;\n if (patientHuddles != null) {\n selectedPatientHuddle = this.selectedPatientHuddle(selectedDate, patientHuddles);\n }\n\n let selectedPatientHuddlePatient...
[ "0.6580257", "0.6579635", "0.64281875", "0.6380845", "0.6345712", "0.62575346", "0.62260044", "0.6168415", "0.6167086", "0.6167086", "0.5992148", "0.5969233", "0.5962206", "0.595201", "0.5936758", "0.59136313", "0.5885128", "0.5880619", "0.58546716", "0.58458585", "0.58419317...
0.7555098
0
This function will empty all entries in the add Task form. The previous added Information will not be changed
function emptyFields() { document.getElementById("title").value = null; document.getElementById("urgency").value = "High Urgency"; document.getElementById("importance").value = "High Importance"; document.getElementById("date").value = null; document.getElementById("description").value = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearNewTaskRow(obj)\n{\n const kids = obj.children();\n const taskNameBox = $(kids[2]);\n const taskNameInput = $(taskNameBox.children()[1]);\n clearVal(taskNameInput);\n const spoon = kids.filter(\".spoon\");\n for (let i = 0; i < spoon.length; i++) {\n let spoonBox = $(spoon[i]);\n let spoo...
[ "0.73305076", "0.7067622", "0.704136", "0.7035703", "0.6992786", "0.69507784", "0.6939786", "0.69102806", "0.6820282", "0.67786145", "0.677821", "0.6775592", "0.676358", "0.6669147", "0.66587514", "0.66172826", "0.65853125", "0.65442747", "0.6533585", "0.6514466", "0.6506862"...
0.0
-1
creates the JSON 'task' which is used in the function addTask() for saving the data in the local storage
function gererateTaskObject() { let title = document.getElementById("title").value; let urgency = document.getElementById("urgency").value; let importance = document.getElementById("importance").value; let date = document.getElementById("date").value; let discription = document.getElementById("description").value; let task = { 'title': title, 'urgency': urgency, 'importance': importance, 'date': date, 'description': discription, 'created': new Date().getTime() //unix timestamp at the time of creating the task }; return task; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveTask(e) {\n let title = document.getElementById('title').value; /*el .value es el valor que esta dentro de la caja del input de ese id, osea lo que vos le escribas como titulo*/ \n let description = document.getElementById('description').value;/*y lo mismo pero para description osea la caja de abajo...
[ "0.75604033", "0.75434726", "0.7478239", "0.7440815", "0.74116105", "0.7353173", "0.7320234", "0.72908735", "0.72757107", "0.72400296", "0.7221497", "0.72191143", "0.72005016", "0.71956885", "0.7181239", "0.7180007", "0.71798396", "0.7177128", "0.7173657", "0.715233", "0.7142...
0.7582319
0
This function will add the entries in the add Task form to the JSON allTasks
function addTask() { let t = gererateTaskObject(); allTasks.push(t); document.getElementById('loading').classList.remove('d-none'); tasksString = JSON.stringify(allTasks); saveJSONToServer(allTasks) .then(function (result) { //then(function (variable vom server)) console.log('Laden erfolgreich!', result); document.getElementById('loading').classList.add('d-none'); load(); }) .catch(function (error) { // Fehler console.error('Fehler beim laden!', error); document.getElementById('loading').classList.add('d-none'); document.getElementById('error').classList.remove('d-none'); }); //localStorage.setItem('data', tasksString); disabled - the JSON is saved on the Server emptyFields(); /** * The following 5 lines would be a popup which shows the name and the category of the added Tast. * It has been replaced by the loading screen */ //let html = "<div id='popup' class='transparentgray'><div class='popup'><h5>A new Task with the Title " + t.title + " has been added!</h5>You have set " + t.importance + " and " + t.urgency + "!</div></div>"; //document.getElementById("mainWindow").insertAdjacentHTML('beforeEnd', html); //setTimeout(function () { // document.getElementById('popup').remove(); //}, 5000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addTask() {\n const input = qs('#addTask');\n saveTask(input.value, this.key);\n this.showList();\n }", "function addTask() {\n values={};\n values.task=$('#task').val();\n\n $.ajax({\n type: 'POST',\n url: '/task',\n data: values,\n success: function(){\n updateTaskLi...
[ "0.74009436", "0.73298407", "0.7279283", "0.71342075", "0.7107193", "0.70822555", "0.7081464", "0.69990146", "0.6975628", "0.6961249", "0.6958753", "0.69441974", "0.6937239", "0.6922008", "0.69003916", "0.6893678", "0.6887847", "0.6885101", "0.68815035", "0.68679476", "0.6863...
0.66647017
30
loads the JSON allTasks from local storage, if ther is no 'data' it will be created
function loadTasks() { load(); showMyJSON(); //if (localStorage.getItem('data') == null) { //if ther is no existing 'data' file in localStorage it will be created // localStorage.setItem('data', JSON.stringify([])); //} else { // let tasksString = localStorage.getItem('data'); // allTasks = JSON.parse(tasksString); //} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadData() {\n ul.innerHTML = \"\";\n taskList.loadFromJson(JSON.parse(localStorage.getItem(\"tasks\")) || []);\n taskList.getAllTasks().forEach(task => loadTask(task));\n}", "load() {\n if (localStorage.getItem('tasks')) {\n const tasksJson = localStorage.getItem('tasks');\n ...
[ "0.80026203", "0.7730027", "0.7722346", "0.7708222", "0.76990056", "0.76990056", "0.7509049", "0.74723417", "0.74707496", "0.74477684", "0.74283814", "0.73855597", "0.73526436", "0.7328146", "0.72697294", "0.7239915", "0.7232198", "0.7212441", "0.72117156", "0.7210158", "0.72...
0.8766415
0
lets date be minimum the date of today
function getToday() { let today = new Date(); let dd = today.getDate(); let mm = today.getMonth() + 1; let yyyy = today.getFullYear(); if (dd < 10) { dd = '0' + dd } if (mm < 10) { mm = '0' + mm } today = yyyy + '-' + mm + '-' + dd; document.getElementById("date").setAttribute("min", today); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function beginningOfToday(date)\r\n{\r\n // log(date.toString().replace(/..:..:../, '00:00:00'));\r\n return new Date(date.toString().replace(/..:..:../, '00:00:00'));\r\n}", "get minDate() { return this._minDate; }", "get minDate() { return this._minDate; }", "get minDate() { return this._minDate; }", "...
[ "0.71951675", "0.7100402", "0.7100402", "0.7100402", "0.7100402", "0.7100402", "0.7100402", "0.7100402", "0.7100402", "0.7095181", "0.6978378", "0.6918838", "0.69152147", "0.69152147", "0.6909236", "0.6876167", "0.68493015", "0.6843313", "0.6829618", "0.6700222", "0.668252", ...
0.74183327
0
Loads myJSON from Server
function load() { document.getElementById('loading').classList.remove('d-none'); loadJSONFromServer() .then(function (result) { //then(function (variable vom server)) console.log('Laden erfolgreich!', result); allTasks = JSON.parse(result); document.getElementById('loading').classList.add('d-none'); }) .catch(function (error) { // Fehler console.error('Fehler beim laden!', error); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _loadJSON(path, callback) { \n var xhr = new XMLHttpRequest();\n xhr.overrideMimeType(\"application/json\");\n xhr.open('GET', path, false);\n xhr.onreadystatechange = function () {\n if (xhr.readyState == 4 && xhr.status == \"200\") {\n callback(xhr...
[ "0.7167346", "0.708768", "0.70452756", "0.70082563", "0.6996618", "0.69458365", "0.69410115", "0.6849939", "0.68459904", "0.6840019", "0.6833021", "0.6815813", "0.681503", "0.67908573", "0.67872316", "0.6786793", "0.67764145", "0.6774145", "0.6771716", "0.67575264", "0.675694...
0.0
-1
This function open the responsive Menu
function showMenu(){ document.getElementById("overlay-menu").classList.add("show-overlay-menu"); document.getElementById("burger-menu").classList.add("d-none"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openNav_responsive() {\n options.jq.contentWell.css({\n position : 'absolute',\n top : 0,\n left : 0,\n height : '100%',\n overflow : 'hidden'\n });\n options.jq.navContainer.animate({marginLeft: 0}, animConfig());\n options.jq.contentWell.animate({left: '10...
[ "0.75090635", "0.74564654", "0.74564654", "0.7387518", "0.7352951", "0.7333574", "0.72990775", "0.7268785", "0.72237355", "0.71683425", "0.71355635", "0.7081245", "0.7050028", "0.7031337", "0.70153886", "0.700344", "0.69877833", "0.6938438", "0.6930763", "0.6930763", "0.69197...
0.0
-1
This function close the responsive menu
function closeMenu() { document.getElementById("overlay-menu").classList.remove("show-overlay-menu"); document.getElementById("burger-menu").classList.remove("d-none"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeMobileNav(){\n if (window.innerWidth >= 750){\n closeMobileMenu();\n deactivateScrollMenu();\n mobileMenuIsOpen = false;\n }\n }", "function closemenu(){\n\t\t\tif ( $menu && timer ){\n\t\t\t\t$menu.children('a').removeClass( settings.parentMO ).siblings('ul')[ s...
[ "0.80568814", "0.7969944", "0.79092", "0.77921027", "0.7748819", "0.768107", "0.766475", "0.76574033", "0.764836", "0.7645062", "0.76220834", "0.7577997", "0.7572837", "0.7534751", "0.75058335", "0.7495968", "0.74687433", "0.7468362", "0.746368", "0.7455816", "0.7433187", "...
0.77642536
4
for optional properties skip the logTrace
function tryAssertHas(ctx, types) { try { assertHas(ctx,types); return true; } catch(e) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TraceOnly(...args) { this.do_log(\"TRACE\", args, false); }", "function debuglog(){\n if(false)\n console.log.apply(this,arguments)\n}", "function xxxdebugProperties(jo){\n\tconsole.log('\\n\\n' + jo.data['xath' ] + '\\n\\n' + jo.data['cod']\n\t + '\\n\\n' + jo.data['idn' ] + '\\n\\n' + j...
[ "0.59166044", "0.5436627", "0.53226537", "0.53183687", "0.52871853", "0.5271416", "0.52030814", "0.5189277", "0.51804507", "0.5174211", "0.5123445", "0.5122996", "0.5087792", "0.50668544", "0.5062562", "0.50464076", "0.50464076", "0.5046063", "0.5008581", "0.49955177", "0.499...
0.0
-1
assert ctx os an object if types supplied, properties of ctx are of type specified in values
function assertHas(ctx, types) { if (typeof (ctx) !== 'object') { throw new Error('invalid context: ' + typeof (ctx)); } // ctx.assert(types); if (typeof (types) === 'object') { for (var i in types) { if (typeof (ctx[i]) !== types[i]) { throw new Error('assertion ' + i + ' requires ' + types[i] + ', given ' + typeof (ctx[i])); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ArgumentsOfCorrectType(context) {\n return {\n Argument: function Argument(node) {\n var argDef = context.getArgument();\n if (argDef) {\n var errors = (0, _isValidLiteralValue.isValidLiteralValue)(argDef.type, node.value);\n if (errors && errors.length > 0) {\n contex...
[ "0.54763657", "0.5453822", "0.5323058", "0.5274446", "0.51881903", "0.5146345", "0.5023472", "0.49863532", "0.49738187", "0.49738187", "0.49738187", "0.49626344", "0.49513006", "0.48599276", "0.48473272", "0.48060852", "0.4801074", "0.47916186", "0.4789198", "0.47888517", "0....
0.6307882
0
this function should be called once at script load time to see if a previous session had connection issues and send all the data
function checkSendBufferCache() { var keys = GM_listValues(); if (keys == null) return; var key = keys[0]; for (var i=0; key != null; key=keys[i++] ) { if(key.match(/^sendBuffer:(.*?):/)) { var route = key.match(/^sendBuffer:(.*?):(.*?):/)[1]; var cbString = key.match(/^sendBuffer:(.*?):(.*?):/)[2]; console.log('sendbuffer post route:' + route); var postData = GM_getValue(key); var data = JSON.parse(postData); GM_deleteValue(key); ctxSendToServer({data:data, route:route, ondispatch:cbString}); } /* if (key.match(/^setting:/)) { GM_deleteValue(key); } if (key.match(/^starMap:/)) { GM_deleteValue(key); } if (key.match(/^sendQ:/)) { GM_deleteValue(key); } */ } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function safeSendData(){\n \n var date = new Date();\n if(webSock.bufferedAmount == 0 && ((date.getTime() - timeOfLastMessage) > 100))\n {\n timeOfLastMessage = date.getTime();\n sendData();\n }\n }", "function initialRequests() {\n socket...
[ "0.6048791", "0.585011", "0.57902473", "0.57587487", "0.5641806", "0.5622303", "0.5621419", "0.5603418", "0.5593114", "0.55830985", "0.55806816", "0.5567789", "0.5564455", "0.5550888", "0.5543147", "0.5539069", "0.55349106", "0.5525175", "0.5518297", "0.5511732", "0.54953563"...
0.0
-1
ripped from ae common return true if a variable exists (is defined)
function exists (obj){ if (typeof (obj) != "undefined" && obj != null) return true; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exists(variable) {\n\treturn typeof(variable)!=\"undefined\";\n}", "function isdefined( variable)\r\n{\r\n return (typeof(window[variable]) == \"undefined\")? false: true;\r\n}", "function isDefined(variable){\n/* 609 */ \t\treturn (!(!( variable||false )));\n/* 610 */ \t}", "function isset(aV...
[ "0.83497834", "0.8342925", "0.7958818", "0.78828263", "0.7874305", "0.7874305", "0.7786021", "0.7782281", "0.7746712", "0.7704927", "0.74311316", "0.74018747", "0.7356111", "0.7339193", "0.7277225", "0.72046244", "0.7199952", "0.7199952", "0.7199952", "0.7199952", "0.7199952"...
0.66280466
80
return an element by id, or object reference
function getElement(obj){ if (typeof(obj) == "string"){ if (document.getElementById == undefined || !document.getElementById) return false; obj = document.getElementById(obj); } if (obj == undefined || !obj) return false; return obj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get(id) {\r\n\tvar element = getEle(id);\r\n\treturn element;\r\n}", "function elem(id) {\n return document.getElementById(id);\n }", "function ElemId(id){\n\treturn document.getElementById(id);\n}", "function getObj(id) {\n\treturn $(id);\n}", "function ele(id) {\n\treturn document.getE...
[ "0.8033818", "0.77471775", "0.7696049", "0.7679374", "0.767635", "0.7629426", "0.75938314", "0.7581182", "0.75788766", "0.75246036", "0.74996924", "0.74773407", "0.7472821", "0.74595946", "0.7456551", "0.7442757", "0.74243855", "0.7423062", "0.7413727", "0.73944885", "0.73718...
0.6995231
79
curGalReg is the element where scanRegion takes it's region from while moving around in the map, this element will take the currently selected galaxy/region TODO: get off the halfsecond timer for an update
function updateGalaxyRegion () { var curGalReg = document.getElementById('curGalReg'); if (curGalReg == null) { console.log('curGalReg is null!'); return; } var region = unsafeWindow.mapCurrentRegion; var galaxy = unsafeWindow.starsGalaxy; if (region == null) { if (document.URL.match(/([A-Za-z][0-9]{2}):([0-9]{2})/)) { var gr = document.URL.match(/([A-Za-z][0-9]{2}):([0-9]{2})/); galaxy = gr[1]; region = gr[2]; } else { return; } } curGalReg.innerHTML = galaxy; if (region != null) { curGalReg.innerHTML += ":" + region; } var getLoc = document.getElementById('getLocation'); var changeRegion = function(){ updateGalaxyRegion(); }; if (getLoc != null && getLoc.value.match(/[A-Za-z][0-9]{2}:[0-9]{2}$/)) { curGalReg.innerHTML = getLoc.value.match(/[A-Za-z][0-9]{2}:[0-9]{2}$/)[0]; registerEvent(getLoc, "change", changeRegion); } var t = window.setTimeout(updateGalaxyRegion, 500); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setGranRegion(){\n\tfor(var reg of fe_regiones)\n\t\treg.fCollapse();\n\tchoroInfo.update(choropleth_objects[currSource].r_max_val, \"región\");\n}", "function setReg(d) {\n d.region = region.get(d.id) || 0;\n return d.region;\n}", "setNextRegionCoord(number, maxIndex, coordsArray) {\n let index ...
[ "0.5154362", "0.5144067", "0.49987295", "0.49775556", "0.4908449", "0.4902646", "0.49025935", "0.4856827", "0.4855172", "0.48125374", "0.4805899", "0.4790259", "0.47886318", "0.4782783", "0.47629595", "0.47497466", "0.47337413", "0.473354", "0.47050133", "0.4699439", "0.46969...
0.6779426
0
display a countdown until server time becomes elThen.title time
function displayTimeCountdown(elThen) { var thenTime = elThen.getAttribute("title"); var mThen = new moment( thenTime ); elThen.innerHTML = mThen.format("YYYY/MM/DD HH:mm:ss"); mCST = CurrentServerTime(); var diff = moment.duration(mThen.diff( CurrentServerTime() )); var msgClass = "debugMsg"; if (diff.asSeconds() < 10) { msgClass = "panicMsg"; } else if (diff.asSeconds() < 60) { msgClass = "errMsg"; } else if (diff.asSeconds() < 120) { msgClass = "infoMsg"; } elThen.innerHTML += '<br><span class="'+msgClass+'"><b>'+ diff.format("h [hrs] m [min] s [sec]") + "</b></span>"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countdown(t) {\r\n display_element.querySelector('#rpm-feedback').innerHTML = '<p>'+t+'</p>';\r\n }", "function countItDown(){\n startTime -= 1\n $el.text(startTime);\n App.doTextFit('#hostWord');\n\n if( startTime <= 0 ){\n ...
[ "0.7420303", "0.71929115", "0.70546097", "0.69996226", "0.6976374", "0.6950918", "0.6945093", "0.6835363", "0.6823945", "0.6818996", "0.6782317", "0.67627025", "0.6715363", "0.6680051", "0.667312", "0.66572106", "0.6640387", "0.6617218", "0.6613649", "0.6613233", "0.66110957"...
0.78963125
0
restore visiblity style settings if cached and class
function restoreToggle(id) { var value; value = GM_getValue("setting:hidden:"+id, 0); // logTrace(id + ":" +value); if (value) { $("#"+id).hide(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function restoreAppearance()\n {\n this.style.color = \"black\";\n this.style.border = \"2px solid black\";\n \n }", "restoreDefaultVisibility(){\n\t\t\tthis.properties.forEach(function(entry){\n\t\t\t\tvar isVisible = ( isNone(entry['hidden']) || !entry['hidden'] ) ? true : false;\n\t\t\t...
[ "0.6772449", "0.64971673", "0.63446516", "0.63246584", "0.63173926", "0.63173926", "0.6295325", "0.62056214", "0.6165277", "0.61460143", "0.60404474", "0.60404474", "0.60404474", "0.60404474", "0.603744", "0.6021813", "0.5941101", "0.59381515", "0.5912644", "0.5905503", "0.58...
0.0
-1
ae data parsing functions
function matchFirstPos(string, re) { if (string == null || re == null) { return null; } var m = string.match(re); if (m != null && m.length > 0) { return m[1]; } else { return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_parseAPIData(data) {\n\t throw new Error('_parseAPIData should not be called on base view');\n\t }", "function parseData( linkStr ) {\n\t\t\tthis.dataid = linkStr.substring(0, 5);\n\t\t\tif( this.dataid == \"/issu\" ) {\n\t\t\t\tthis.is_issued = false;\n\t\t\t\tthis.dataid = \"00000\";\n\t\t\t\tthis.i...
[ "0.635364", "0.62993324", "0.6051874", "0.60458535", "0.6011031", "0.6003248", "0.5898246", "0.585114", "0.58487767", "0.580468", "0.57391065", "0.57249844", "0.57207775", "0.56698793", "0.56681895", "0.5656121", "0.5645805", "0.5634945", "0.5634591", "0.563181", "0.55931866"...
0.0
-1
have to actually load the resources specified in header
function doResources() { var css = ['aegis.css', 'jquery-ui.css']; css.forEach(function(el, i, a) { var res = GM_getResourceText(el); GM_addStyle(res); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadResources(res) {\n var monitor,\n tag;\n monitor = createMonitor(res);\n for (var i = 0, i_len = res.res.length; i < i_len; i++) {\n tag = createTag(res.res[i], monitor);\n if (tag) head.appendChild(tag);\n }\n }", "function loadResourc...
[ "0.69140846", "0.66232824", "0.64752793", "0.63766056", "0.6335159", "0.6328017", "0.63004965", "0.6165346", "0.6106171", "0.6106171", "0.6099534", "0.6084527", "0.6032862", "0.5956885", "0.59459025", "0.5901989", "0.5895496", "0.58668923", "0.5849764", "0.58409894", "0.58389...
0.60454416
12
Register a new user
async create(req, res) { try { validateUser(req.body); await userRepository.create(req.body); res.json('User registered successfully.'); } catch (err) { res.json({ 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}", "function register(req, res, next) {\n U...
[ "0.83520013", "0.8306033", "0.8103047", "0.78591985", "0.78367496", "0.7781775", "0.7781775", "0.7746846", "0.773446", "0.76466674", "0.7638227", "0.7611044", "0.7586086", "0.7553099", "0.7551185", "0.7507968", "0.7505681", "0.74828196", "0.74784523", "0.7478244", "0.74609697...
0.72955656
36
User adds topic to their list of tracked topics Delete user profile
async delete(req, res) { try { const id = await userRepository.delete(req.params.id); res.json('deleted user. redirect to website landing page'); } catch (err) { console.log('error', err); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pushTopic() {\n $('#userInput').click(function() {\n topics.push($('#userAdded').val());\n renderButtons();\n });\n }", "function addTopicToSelected(topic) {\n // if the there are too many topics selected, tell the user\n if (topics.full()) {\n alert(\"You may only select up to 10 ...
[ "0.63320595", "0.610518", "0.6047354", "0.5901316", "0.5898591", "0.58916134", "0.57216436", "0.5681172", "0.56433547", "0.5642202", "0.5641545", "0.56403744", "0.5631555", "0.5629372", "0.5617408", "0.55946326", "0.55941594", "0.558389", "0.5568373", "0.55626214", "0.5561351...
0.0
-1
renderTable renders the ufoSIghtings dataSet to the tbody
function renderTable() { $tbody.innerHTML = ""; for (var i = 0; i < ufoSightings.length; i++) { // Get get the current sightings object and its fields var sightings = ufoSightings[i]; var fields = Object.keys(sightings); // Create a new row in the tbody, set the index to be i + startingIndex var $row = $tbody.insertRow(i); for (var j = 0; j < fields.length; j++) { // For every field in the sightings object, create a new cell at set its inner text to be the current value at the current sightings field var field = fields[j]; var $cell = $row.insertCell(j); $cell.innerText = sightings[field]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderTable() {\n $tbody.innerHTML = \"\";\n console.log(\"rendering\")\n\n for (var i = 0; i < tableData.length; i++) {\n // Get get the current UFO info object and its fields\n var ufoinfo = tableData[i];\n var field = Object.keys(ufoinfo);\n // Create a new row in the tbody...
[ "0.78701717", "0.7688644", "0.7636133", "0.75650454", "0.7376295", "0.73651195", "0.7322073", "0.7317811", "0.72682583", "0.72570944", "0.72521484", "0.72020453", "0.70617634", "0.7043836", "0.701574", "0.7003929", "0.698321", "0.6895242", "0.6884901", "0.6883634", "0.6862673...
0.71965265
12
function to handle Search by Shape
function handleSearchButtonClickShape() { // Format the user's search by removing leading and trailing whitespace var filterShape = $shapeInput.value.trim().toLowerCase(); // Set ufoSightings to an array of all dataSet whose "date" matches the filter ufoSightings = dataSet.filter(function(sightings) { var sightingShape = sightings.shape.toLowerCase(); // If true, add the sighting to the filterState, otherwise don't add it to filterState return sightingShape === filterShape; }); renderTable(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findShape(event) {\n // debugger;\n\n var p = project.activeLayer.globalToLocal(event.point);\n shapes.shapeIds().forEach(function(key) {\n var shape = shapes.get(key);\n if (shape.outline.hitTest(p)) {\n ui.setCurrentShape(shape.id);\n // console.log(outline);...
[ "0.62603474", "0.6091198", "0.60504466", "0.59820247", "0.59375817", "0.59040976", "0.5898056", "0.57619214", "0.5753749", "0.5680645", "0.5606921", "0.5598741", "0.5593221", "0.556642", "0.55538446", "0.55425775", "0.5516636", "0.5514312", "0.55117923", "0.54939526", "0.5484...
0.69796854
0
function to handle search by State
function handleSearchButtonClickState() { // Format the user's search by removing leading and trailing whitespace var filterState = $stateInput.value.trim().toLowerCase(); // Set ufoSightings to an array of all dataSet whose "date" matches the filter ufoSightings = dataSet.filter(function(sightings) { var sightingState = sightings.state.toLowerCase(); // If true, add the sighting to the filterState, otherwise don't add it to filterState return sightingState === filterState; }); renderTable(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "searchByText(event) {\n this.state[event.target.query] = event.target.value;\n //this.props.SearchItems(this.state);\n }", "handleSearchClick(event, passedState) {\n\t\tif(passedState) {\n\t\t\tthis.loadSearchResults(passedState);\n\t\t} else {\n\t\t\tthis.loadSearchResults(this.state);\n\t\t}\n\t\t\n\t}"...
[ "0.76675767", "0.7386061", "0.7250629", "0.7220179", "0.7214401", "0.71855944", "0.71477973", "0.70581025", "0.7055681", "0.7055681", "0.70479727", "0.6995786", "0.69919586", "0.6974798", "0.6969081", "0.6960766", "0.69603825", "0.6951622", "0.6951567", "0.6946523", "0.694606...
0.72544533
2
function to handle Search by Date
function handleSearchButtonClickDate() { // Format the user's search by removing leading and trailing whitespace var filterDate = $dateInput.value.trim().toLowerCase(); // Set ufoSightings to an array of all dataSet whose "date" matches the filter ufoSightings = dataSet.filter(function(sightings) { var sightingDate = sightings.date.toLowerCase(); // If true, add the sighting to the filterState, otherwise don't add it to filterState return sightingDate === filterDate; }); renderTable(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchDate(evt) {\n\t\t\t\t\tvar date,\n\t\t\t\t\t\tkey = evt.keyCode ? evt.keyCode : evt.which,\n\t\t\t\t\t\tdateStr = evt.currentTarget.value;\n\n\t\t\t\t\tdate = (_h.isISOString(dateStr) && _h.isValidDate(dateStr)) ? _h.constructDate(dateStr) : null;\n\n\t\t\t\t\tif (date && key === 13) {\n\t\t\t\t\t\t...
[ "0.7209805", "0.70610374", "0.6977224", "0.69260305", "0.68615276", "0.6859402", "0.6801849", "0.6791086", "0.6791086", "0.67344105", "0.6629149", "0.6601612", "0.6543571", "0.65352726", "0.6511577", "0.6441816", "0.64414483", "0.64088637", "0.6330055", "0.632979", "0.631156"...
0.76074237
0
function to handle Search by City
function handleSearchButtonClickCity() { // Format the user's search by removing leading and trailing whitespace var filterCity = $cityInput.value.trim().toLowerCase(); // Set ufoSightings to an array of all dataSet whose "date" matches the filter ufoSightings = dataSet.filter(function(sightings) { var sightingCity = sightings.city.toLowerCase(); // If true, add the sighting to the filterState, otherwise don't add it to filterState return sightingCity === filterCity; }); renderTable(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchCity(savedCity){\n \n getCurrentWeather( savedCity);\n getForecastWeather( savedCity);\n \n}", "function searchCity(event) {\n event.preventDefault();\n var input = userInput.value;\n if (!input || input == \"\") return;\n addToSearchHistory(input);\n createListItem(inpu...
[ "0.7724174", "0.75796634", "0.73582375", "0.73442787", "0.72965163", "0.72839326", "0.7275037", "0.72639036", "0.7254467", "0.72539014", "0.7252551", "0.7240956", "0.7237662", "0.721005", "0.71844906", "0.71435875", "0.7139418", "0.7124022", "0.7105823", "0.706064", "0.697539...
0.7460447
2
function to handle Search by Country
function handleSearchButtonClickCountry() { // Format the user's search by removing leading and trailing whitespace var filterCountry = $countryInput.value.trim().toLowerCase(); // Set ufoSightings to an array of all dataSet whose "date" matches the filter ufoSightings = dataSet.filter(function(sightings) { var sightingCountry = sightings.country.toLowerCase(); // If true, add the sighting to the filterState, otherwise don't add it to filterState return sightingCountry === filterCountry; }); renderTable(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function search(country) {\n \n searchFunnyVideos(country);\n searchAboutVideos(country);\n \n}", "function searching(){\r\n const REST_URL = \"https://restcountries.eu/rest/v2/name/\";\r\n\r\n let url = REST_URL;\r\n\r\n let country = document.querySelector(\"#searchterm\").value;\r\n countrySho...
[ "0.73724514", "0.7269201", "0.7154021", "0.7081818", "0.70135707", "0.7005278", "0.68958056", "0.67829365", "0.67517054", "0.6714325", "0.666597", "0.6632361", "0.6628928", "0.65981025", "0.6586485", "0.6584458", "0.6550702", "0.65276533", "0.64858663", "0.6476013", "0.645502...
0.72667724
2
gkhead.src = ' ball.src = ' Adds ctx.getTransform() returns an SVGMatrix Adds ctx.transformedPoint2(x,y) returns an SVGPoint
function trackTransforms(ctx){ var svg = document.createElementNS("http://www.w3.org/2000/svg",'svg'); var xform = svg.createSVGMatrix(); ctx.getTransform = function(){ return xform; }; var savedTransforms = []; var save = ctx.save; ctx.save = function(){ savedTransforms.push(xform.translate(0,0)); return save.call(ctx); }; var restore = ctx.restore; ctx.restore = function(){ xform = savedTransforms.pop(); return restore.call(ctx); }; var scale = ctx.scale; ctx.scale = function(sx,sy){ xform = xform.scaleNonUniform(sx,sy); return scale.call(ctx,sx,sy); }; var rotate = ctx.rotate; ctx.rotate = function(radians){ xform = xform.rotate(radians*180/Math.PI); return rotate.call(ctx,radians); }; var translate = ctx.translate; ctx.translate = function(dx,dy){ xform = xform.translate(dx,dy); return translate.call(ctx,dx,dy); }; var transform = ctx.transform; ctx.transform = function(a,b,c,d,e,f){ var m2 = svg.createSVGMatrix(); m2.a=a; m2.b=b; m2.c=c; m2.d=d; m2.e=e; m2.f=f; xform = xform.multiply(m2); return transform.call(ctx,a,b,c,d,e,f); }; var setTransform = ctx.setTransform; ctx.setTransform = function(a,b,c,d,e,f){ xform.a = a; xform.b = b; xform.c = c; xform.d = d; xform.e = e; xform.f = f; return setTransform.call(ctx,a,b,c,d,e,f); }; var pt = svg.createSVGPoint(); ctx.transformedPoint = function(x,y){ pt.x=x; pt.y=y; return pt.matrixTransform(xform.inverse()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateShape(point) {\n model.context.clearRect(0, 0, model.cnv.width, model.cnv.height);\n model.cnv.width = model.cnv.width;\n\n var width = model.width;\n var height = model.height;\n\n model.context.setTransform(1, 0, 0, 1, 0, 0);\n\n let dx = point.xAxis + 0.5 * width;\n let dy = ...
[ "0.57145226", "0.55936563", "0.5480124", "0.54265463", "0.5383592", "0.5357276", "0.5333491", "0.53179806", "0.5276212", "0.5258207", "0.525569", "0.524423", "0.5243946", "0.52437055", "0.52372134", "0.5233655", "0.5183811", "0.5183225", "0.51782054", "0.51588917", "0.5149008...
0.0
-1
CAN 2 var gkhead = new Image; var ball = new Image; gkhead.src = ' ball.src = ' Adds ctx2.getTransform() returns an SVGMatrix Adds ctx2.transformedPoint2(x,y) returns an SVGPoint
function trackTransforms2(ctx2){ var svg = document.createElementNS("http://www.w3.org/2000/svg",'svg'); var xform = svg.createSVGMatrix(); ctx2.getTransform = function(){ return xform; }; var savedTransforms = []; var save = ctx2.save; ctx2.save = function(){ savedTransforms.push(xform.translate(0,0)); return save.call(ctx2); }; var restore = ctx2.restore; ctx2.restore = function(){ xform = savedTransforms.pop(); return restore.call(ctx2); }; var scale = ctx2.scale; ctx2.scale = function(sx,sy){ xform = xform.scaleNonUniform(sx,sy); return scale.call(ctx2,sx,sy); }; var rotate = ctx2.rotate; ctx2.rotate = function(radians){ xform = xform.rotate(radians*180/Math.PI); return rotate.call(ctx2,radians); }; var translate = ctx2.translate; ctx2.translate = function(dx,dy){ xform = xform.translate(dx,dy); return translate.call(ctx2,dx,dy); }; var transform = ctx2.transform; ctx2.transform = function(a,b,c,d,e,f){ var m2 = svg.createSVGMatrix(); m2.a=a; m2.b=b; m2.c=c; m2.d=d; m2.e=e; m2.f=f; xform = xform.multiply(m2); return transform.call(ctx2,a,b,c,d,e,f); }; var setTransform = ctx2.setTransform; ctx2.setTransform = function(a,b,c,d,e,f){ xform.a = a; xform.b = b; xform.c = c; xform.d = d; xform.e = e; xform.f = f; return setTransform.call(ctx2,a,b,c,d,e,f); }; var pt = svg.createSVGPoint(); ctx2.transformedPoint2 = function(x,y){ pt.x=x; pt.y=y; return pt.matrixTransform(xform.inverse()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createImage(source, blob) {\n var pastedImage = new Image();\n //clear gcode\n pastedImage.onload = function() {\n Potrace.loadImageFromFile(blob);\n Potrace.info.alphamax = getvalue(\"smooth\");\n Potrace.process(function() {\n //displayImg();\n //displ...
[ "0.5820746", "0.58085644", "0.57708234", "0.56357783", "0.5591145", "0.5534578", "0.5527548", "0.55242527", "0.5520508", "0.54811585", "0.5479532", "0.54640794", "0.545736", "0.54514194", "0.54355514", "0.543411", "0.5372253", "0.5359912", "0.53531057", "0.53495383", "0.53492...
0.5571364
5
import BeeBackground from "../images/BeeBackground.png"
function FunFacts() { return ( <Layout> <SEO title="Fun Facts" /> <HeroHeader img={EducationBee} text={"fun facts"} /> <FunBeeFacts backgroundImage="BeeBackground"/> </Layout> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n super(...arguments)\n this.bgURL = \"static/assets/images/bg.png\"\n this.groundURL = \"static/assets/images/ground.png\"\n this.avatarURL = \"static/assets/images/avatar.png\"\n this.squircleURL = \"static/assets/images/squircle.png\"\n this.squircleFillURL = \"static/assets/im...
[ "0.6361169", "0.63168746", "0.62622833", "0.6197714", "0.60879225", "0.60377544", "0.60124695", "0.60029346", "0.5992274", "0.59776103", "0.59751046", "0.59337294", "0.5919151", "0.59070796", "0.5904742", "0.5903038", "0.58848983", "0.587727", "0.58322966", "0.5831913", "0.58...
0.5610486
60
Initialize visualization (static content, e.g. SVG area or axes)
initVis() { let vis = this; vis.margin = {top: 20, right: 50, bottom: 20, left: 50}; vis.width = $("#" + vis.parentElement).width() - vis.margin.left - vis.margin.right; vis.height = $("#" + vis.parentElement).height() - vis.margin.top - vis.margin.bottom; vis.marginLegend = {top: 0, right: 0, bottom: 100, left: 0}; vis.widthLegend = $("#" + vis.legendElement).width() - vis.marginLegend.left - vis.marginLegend.right; vis.heightLegend = $("#" + vis.legendElement).height() - vis.marginLegend.top - vis.marginLegend.bottom; vis.svg = d3.select("#" + vis.parentElement).append("svg") .attr("width", vis.width + vis.margin.left + vis.margin.right) .attr("height", vis.height + vis.margin.top + vis.margin.bottom) .append("g") .attr("transform", "translate(" + vis.margin.left + "," + vis.margin.top + ")") .style("overflow", "visible"); vis.svg2 = d3.select("#" + vis.legendElement).append("svg") .attr("width", vis.widthLegend + vis.marginLegend.left + vis.marginLegend.right) .attr("height", vis.heightLegend + vis.marginLegend.top + vis.marginLegend.bottom) .append('g') vis.svg3 = d3.select("#" + vis.textElement).append("svg") .attr("width", vis.widthLegend + vis.marginLegend.left + vis.marginLegend.right) .attr("height", vis.heightLegend + vis.marginLegend.top + vis.marginLegend.bottom) .append('g') vis.svg.append("g") .attr("fill", "none") .attr("stroke", "steelblue") .attr("stroke-width", 1.5) .attr("stroke-linejoin", "round") .attr("stroke-linecap", "round") vis.xScale = d3.scaleLinear() //.domain([d3.min(vis.data,d=>d.date), d3.max(vis.data,d=>d.date)]) //.domain(d3.extent(vis.data, d=> d.date.getFullYear())) .range([0,vis.width]); vis.xAxis = d3.axisBottom() .scale(vis.xScale); vis.yScale = d3.scaleLinear() //vis.yScale = d3.scaleLog() .range([vis.height, 0]); vis.yAxis = d3.axisLeft() .scale(vis.yScale) vis.svg.append("text") //.attr("transform", "rotate(-90)") .attr("y",-5) .attr("x",20) .attr("dy", "1em") .style("text-anchor", "left") .text("Cumulative Flights"); vis.svg.append("g") .attr("class", "axis axis--x") //.call(vis.xAxis.tickFormat(d3.format("d"))) vis.yAxis_Pointer = vis.svg.append("g") .attr("class", "axis y-axis"); vis.xAxis_Pointer = vis.svg.append("g") .attr("class", "axis x-axis"); // Save master data vis.master = vis.data; vis.myCountries = ["USA", "China", "Russia", "Japan", "Israel", "New Zealand", "Iran", "France", "India", "Mexico", "Kazakhstan", "North Korea", "Brazil", "Kenya", "Australia"] //console.log(vis.master) // create legend item vis.legend = vis.svg2.append("g") .attr("class", "FlightLegend") vis.textbox = vis.svg3.append("g") .attr("class", "TextBox") vis.legendData = []; // (Filter, aggregate, modify data) vis.wrangleData(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initialize() {\n\t\t\n\t\tsvg = scope.selection.append(\"svg\").attr(\"id\", scope.id).style(\"overflow\", \"visible\").attr(\"class\", \"vizuly\");\n\t\tbackground = svg.append(\"rect\").attr(\"class\", \"vz-background\");\n\t\tdefs = vizuly2.util.getDefs(viz);\n\t\tplot = svg.append('g');\n\t\t\n\t\tsco...
[ "0.7639817", "0.7542079", "0.72371054", "0.7231575", "0.7094303", "0.699649", "0.69529426", "0.693976", "0.68060863", "0.67857355", "0.674591", "0.6708347", "0.6640099", "0.66310173", "0.6592338", "0.6517857", "0.6500487", "0.6497647", "0.64901495", "0.6443745", "0.6397952", ...
0.0
-1
This condition will checks the prime numbers.
checkPrime(s1, s2) { var count = 0, flag = 0, k = 0; var array = []; for (var i = s1; i <= s2; i++) { for (var j = 2; j < i; j++) { if (i % j == 0) { flag = 0; count++; break; } else { flag = 1; } } if (flag == 1) { array[k++] = i; } } return array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function primeChecker (num) {\n \n if (num < 1) return false;\n \n var newNum = Math.floor(Math.sqrt(num));\n \n for (var i = 2; i <= newNum; i++)\n {\n if (num % i === 0)\n {\n return false;\n }\n }\n \n return true;\n }", "function isPrime(num...
[ "0.78270507", "0.7769947", "0.7639214", "0.761437", "0.7585566", "0.7584158", "0.7576208", "0.75541", "0.75500673", "0.75442046", "0.75348085", "0.7533379", "0.75116426", "0.75111496", "0.75037444", "0.75028056", "0.7493262", "0.7489319", "0.7480578", "0.74717724", "0.7470428...
0.0
-1
It will used to find the Anagram numbers in Prime Numbers
findAnaPrime(ii, jj) { var primes = this.findPrime(ii, jj); var n = primes.length; var anaPrimes = []; var h = 0; for (let i = 0; i < n - 1; i++) { for (let j = i + 1; j < n - 1; j++) { if (this.checkAnagram2(primes[i], primes[j])) { anaPrimes[h++] = primes[i]; anaPrimes[h++] = primes[j]; } } } return anaPrimes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findAnaPrime(x, y) {\n var prime = this.findPrime(x, y);\n var n = prime.length;\n\n var anaPrime = [];\n\n for (let i = 0; i < n ; i++) {\n for (let j = i + 1; j < n ; j++) {\n if (this.isAnagram(prime[i].toString(), prime[j].toString())) {\n ...
[ "0.7457507", "0.734992", "0.6955697", "0.68699193", "0.68043065", "0.66622263", "0.6628819", "0.66139394", "0.66139394", "0.66139394", "0.6597109", "0.6526698", "0.6408619", "0.64051884", "0.6383834", "0.6381831", "0.637035", "0.6370068", "0.63697565", "0.6345368", "0.6345114...
0.7211629
2
It will used to check the Anagram Numbers
checkAnagram2(str1, str2) { let unsortedStr1 = "" + str1; let unsortedStr2 = "" + str2; if (unsortedStr1.length != unsortedStr2.length) { return false; } sortedStr1 = this.sort1(unsortedStr1); sortedStr2 = this.sort1(unsortedStr2); let b = this.check(sortedStr1, sortedStr2); if (b == true) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkAnagram(a = '', b = '') {\n var array = {};\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n let res = a.charCodeAt(i) - 97;\n console.log('res', res);\n array[res] = (a...
[ "0.7745038", "0.7705903", "0.75967216", "0.75532055", "0.7515445", "0.7515445", "0.7515445", "0.7497276", "0.7480104", "0.7466251", "0.7387331", "0.73166096", "0.72766626", "0.7249045", "0.72319037", "0.72086513", "0.7199069", "0.7198323", "0.7177884", "0.7151432", "0.7150425...
0.716067
19
It will used to find Prime Numbers
findPrime(s1, s2) { var count = 0, flag = 0, k = 0; var prime = []; for (var i = s1; i <= s2; i++) { for (var j = 2; j < i; j++) { if (i % j == 0) { flag = 0; count++; break; } else { flag = 1; } } if (flag == 1) { prime[k++] = i; } } return prime; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function primenum(){\n var num=+prompt('Enter a number');\n if(num<3){\n console.log('Not a prime number');\n } else {\n checkPrimenum();\n }\n\n function checkPrimenum() {\n for (var a=2;a<num;a++) {\n for (var b=2;b<a;b++) {\n if (a%b == 0) break;\n ...
[ "0.7559418", "0.7433733", "0.7407744", "0.74072254", "0.73666185", "0.7259035", "0.72511977", "0.72162956", "0.72153944", "0.71979624", "0.71897966", "0.7165928", "0.7163561", "0.7150123", "0.7146827", "0.7132259", "0.71286863", "0.71257406", "0.71123326", "0.7095039", "0.708...
0.0
-1
It will used to checks the item length
check(s1, s2) { for (let i = 0; i < s1.length; i++) { if (s1.charAt(i) != s2.charAt(i)) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isFull() {\n return this.items.length == this.maxItems;\n }", "get length() {\n\t\treturn this.items.length;\n\t}", "hasItem() {\n return this.size > 0\n }", "function listLength(){\n\treturn item.length;\n}", "function listLength() {\n return item.length;\n}", "get length() {\n r...
[ "0.7566723", "0.729179", "0.7223443", "0.7103082", "0.70947486", "0.7092027", "0.7012876", "0.6960686", "0.6781206", "0.6768775", "0.675496", "0.6721194", "0.67148685", "0.6703809", "0.6666471", "0.6663264", "0.66553223", "0.66301084", "0.66029966", "0.65893716", "0.65891606"...
0.0
-1
It will used to sort the Items
sort1(str) { let ch = str.split(''); for (let i = 0; i < str.length; i++) { for (let j = i + 1; j < str.length; j++) { if (ch[i] > ch[j]) { let t = ch[i]; ch[i] = ch[j]; ch[j] = t; } } } var sortedStr = ""; for (let i = 0; i < ch.length; i++) { sortedStr += ch[i]; } return sortedStr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _sortItems() {\n\t\t\tthis.items.sort(_itemSortOrder);\n\t\t}", "itemsToSort() {\n return [];\n }", "sortedItems() {\n return this.childItems.slice().sort((i1, i2) => {\n return i1.index - i2.index;\n });\n }", "sortListItems() {\n let sor...
[ "0.80443954", "0.75165844", "0.7428703", "0.7377399", "0.7350056", "0.73243546", "0.72168475", "0.71424717", "0.71039855", "0.7026434", "0.7000534", "0.6972711", "0.6957353", "0.69409835", "0.69165134", "0.6905147", "0.6879739", "0.68567854", "0.6843812", "0.6803581", "0.6801...
0.0
-1
Check if the validation functions were ok, if so go to the next page.
function handleClickEnter() { if(validEmail==true && validName==true) { //navigate into ChooseHelp screen navigation.navigate("ChooseHelp", { userName: nameText, userEmail: emailText, }); } else // in case the validation fail we pop up alert { Alert.alert("שגיאה","אנא הזן שם ואימייל תקניים",[{text:"אישור"}]) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function next(){\n\tvalidate();\n}", "function next(){\n\tvalidate();\n}", "function next(){\n validate();\n}", "function next(){\n validate();\n}", "function stepNext() {\n\t$(\"#signupBtn\").click(function(e) {\n\t\te.stopPropagation();\n\t\tvalidateFormOnClick();\n\t});\n\n\t$(\"#nextBtn1\").click...
[ "0.71317196", "0.71317196", "0.7058191", "0.7058191", "0.6951164", "0.6631861", "0.6607814", "0.6533495", "0.6413473", "0.64059114", "0.6386095", "0.63504255", "0.6330983", "0.6321142", "0.6263472", "0.62310755", "0.62258863", "0.61797196", "0.61787224", "0.61752063", "0.6163...
0.0
-1
check for valid mail
function emailValidation() { let re = /\S+@\S+\.\S+/; if (re.test(emailText)==false) { setErrorEmail("אנא הזן אימייל תקין"); setValidEmail(false); } else { setErrorEmail(""); setValidEmail(true); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkmail(){\r\n\tif((/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(compMail.val())))\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function checkMail()\n {\n email = $('#ftven_formabo_form_email').val();\n var emailPattern = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0...
[ "0.8023664", "0.7806133", "0.77738947", "0.77203655", "0.7699831", "0.7600315", "0.7530985", "0.7529407", "0.75201476", "0.751663", "0.75128525", "0.7510788", "0.7491818", "0.7486242", "0.7466248", "0.7463119", "0.74416625", "0.7432805", "0.743129", "0.7430499", "0.7429546", ...
0.7249135
32
check for valid name
function nameValidation() { if (nameText == password) { navigation.navigate("AdminAuth"); } else{ let re = /^[\u0590-\u05FF]*$/; if(re.test(nameText)==false) { setErrorName("שם לא תקין (אנא הזן שם בעברית)"); setValidName(false); } else { setErrorName(""); setValidName(true); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static isNameValid (name) {\n return /^\\w+$/.test(name)\n }", "function isValidName(str) { return NAME_PATTERN.test(str); }", "function isValidName(str) { return NAME_PATTERN.test(str); }", "function isNameValid(name) {\n return /^[A-Za-z0-9_]+$/.test(name)\n}", "static isNameValid(newName) {\n ...
[ "0.8717828", "0.84375066", "0.84375066", "0.8429613", "0.8240088", "0.8238637", "0.8213514", "0.81875825", "0.8180992", "0.8180992", "0.81525606", "0.8141352", "0.8132209", "0.8125066", "0.81192434", "0.8115598", "0.79977965", "0.79930735", "0.7978189", "0.7973492", "0.789924...
0.7266709
71
Tracks coverage objects and writes results by listening to events emitted from wct test runner.
function Listener(emitter, pluginOptions) { this.map = istanbulCoverage.createCoverageMap(); this.istanbulConfig = config.loadFile(pluginOptions.configFile, pluginOptions.configOverrides); this.reporter = createReporter(this.istanbulConfig); this.validator = new Validator(pluginOptions.thresholds); this.reporter.addAll(pluginOptions.reporters) pluginOptions.npm = pluginOptions.npm || emitter.options.npm; emitter.on('sub-suite-end', function (browser, data) { if (data && data.__coverage__) { Object.keys(data.__coverage__).forEach(filename => { this.map.addFileCoverage(data.__coverage__[filename]) }); } middleware.cacheClear(); }.bind(this)); emitter.on('run-end', function (error) { if (error && pluginOptions.onlyWriteSuccess) { throw Error('Tests failed. Not writing coverage report.'); } const mapStore = libSourceMaps.createSourceMapStore({}); const transformed = mapStore.transformCoverage(this.map); // Log a new line to not overwrite the test results outputted by WCT console.log('\n'); this.reporter.write(transformed.map); mapStore.dispose(); if (!validator.validate(transformed.map)) { throw Error('Coverage failed'); } }.bind(this)); emitter.hook('define:webserver', function (app, assign, options, done) { const newApp = express(); newApp.use(middleware.middleware(emitter.options.root, pluginOptions, emitter)); newApp.use(app); assign(newApp); done(); }.bind(this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runCoverage(callback) {\n\tconsole.log(\"Run Coverage:\");\n\tvar numTests = testsToRun.length;\n\tconsole.log(\"Number of tests to run: \" + numTests);\n\t//for each test move it back and run cobertura\n\tasync.whilst(areTestsToRun, runTest, function (err) {\n\t\tif (err) {\n\t\t\tconsole.log(\"Coverage ...
[ "0.5422264", "0.5340424", "0.5225791", "0.5195218", "0.5153757", "0.5134406", "0.50448984", "0.49608773", "0.49254733", "0.48867014", "0.48514178", "0.48264694", "0.4826133", "0.4797085", "0.475698", "0.47049302", "0.46799612", "0.4679131", "0.4669305", "0.46680975", "0.46537...
0.55255824
0
get all the workouts done
async getAll(){ return await conn.query("SELECT * FROM Fitness_Workouts"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getWorkouts(){\n $.ajax({\n method: \"GET\",\n url: \"/api/workout\"\n }).then( resp => {\n console.log(resp)\n allWorkouts = resp;\n populateWorkouts();\n })\n }", "function getWorkouts() {\n\t\t\t\tworkout.getWorkouts().then(function(result) {\n\t\t\t\t\t// returned ...
[ "0.7685858", "0.74962", "0.7266663", "0.7128185", "0.6585461", "0.6556664", "0.64830023", "0.63982046", "0.6372542", "0.6093816", "0.60836196", "0.59818107", "0.59263635", "0.58761317", "0.5863386", "0.5841633", "0.5841422", "0.5840251", "0.5803869", "0.574553", "0.56637937",...
0.5757452
19
get a certain workout by person id
async get(input){ const data = await conn.query("SELECT * FROM Fitness_Workouts INNER JOIN Fitness_Exercises ON Fitness_Workouts.Fitness_Exercises_exercise_id=Fitness_Exercises.exercise_id WHERE Fitness_Persons_person_id=?", input.Fitness_Persons_person_id); if(!data) { throw Error('No workouts have been added') } return data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getWorkout(req, res) {\n Workout.findById({})\n .then(data => {\n res.json(data);\n });\n }", "function get_work(req, id){\n console.log(\"INSIDE GET_WORK\");\n const key = datastore.key([WORK, parseInt(id,10)]);\n return datastore.get(key).then( result => {\n var w...
[ "0.65335226", "0.64334565", "0.63468903", "0.59582907", "0.5888346", "0.56193024", "0.5587572", "0.5584204", "0.55033445", "0.5471064", "0.5466124", "0.5449083", "0.5441754", "0.5431003", "0.54215634", "0.5418158", "0.5396519", "0.5390639", "0.5386139", "0.53400433", "0.53358...
0.58097047
5
delete a specific part of a workout by person id and exercise id
async delete(id) { return await conn.query("DELETE FROM Fitness_Workouts WHERE workout_id=?", id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteById(id) {\n id = parseInt(id)\n let exercise = findById(id);\n\n if (!exercise) \n throw new Error(`No exercise for id: ${id}`);\n\n exercises.delete(id)\n\n return exercise;\n}", "function deleteExercise(id) {\n $.ajax({\n method: \"DELETE\",\n ...
[ "0.6628909", "0.66095704", "0.66004413", "0.64749366", "0.6391989", "0.6390155", "0.6269487", "0.62081164", "0.61809963", "0.6055215", "0.6025428", "0.5984895", "0.5974039", "0.5972364", "0.59668887", "0.59131026", "0.58881885", "0.5886198", "0.58828473", "0.5863798", "0.5824...
0.6402676
4
program will take three commandline arguments: m (month), d (day), and y (year). For m use 1 for January, 2 for February, and so forth. For output print 0 for Sunday, 1 for Monday, 2 for Tuesday, and so forth.
function day(date, month, year) { d = date; m = month; y = year; y0 = y - parseInt((14 - m) / 12); x = (y0 + parseInt(y0 / 4) - parseInt(y0 / 100) + parseInt(y0 / 400)); m0 = m + 12 * parseInt((14 - m) / 12) - 2; d0 = ((d + x + parseInt(31 * m0 / 12)) % 7); array = ['Sunday', 'Monday', 'tuesday', 'wednsday', 'thursday', 'friday', 'saturday']; console.log(array[d0]); return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function date (d, m, y) {\n return month[m-1]+\" \"+d+\", \"+y;\n }", "function daysInMonth(y, m) {\r\n var date = new Date();\r\n date.setDate(1);\r\n date.setFullYear(y);\r\n date.setMonth(m); // month after what we want (months start at 0 in js)\r\n date.setDate(0);\r\n return ...
[ "0.64971524", "0.57353896", "0.5728766", "0.5725707", "0.5725707", "0.5711261", "0.5647535", "0.56106144", "0.5603918", "0.5572516", "0.55444974", "0.5543262", "0.5528608", "0.55201995", "0.55159676", "0.5487437", "0.5484534", "0.54623497", "0.5448292", "0.5421737", "0.538599...
0.5980034
1
N is a variable for storing the length of input string bubblesortstr is a user defind fucntion which takes the original string and sort it
function bubblesortstr(string1) { var N = string1.length; array1 = string1.split(""); for (i = 0; i < N; i++) { for (j = 0; j < N; j++) { if (array1[j + 1] < array1[j]) // comparing the adjacent element { temp = array1[j + 1]; array1[j + 1] = array1[j]; // interchanging the element array1[j] = temp; } } } console.log(array1); // prinring the sorted array return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sort1(str) {\n let ch = str.split('');\n for (let i = 0; i < str.length; i++) {\n for (let j = i + 1; j < str.length; j++) {\n if (ch[i] > ch[j]) {\n let t = ch[i];\n ch[i] = ch[j];\n ch[j] = t;\n }\n }\n }\n var sortedStr = \"\";\n for (let i = 0; ...
[ "0.64325565", "0.6428913", "0.6418866", "0.6244005", "0.62376136", "0.6189806", "0.61884594", "0.61314595", "0.6126883", "0.6090425", "0.60602653", "0.604549", "0.6025641", "0.6012491", "0.5975277", "0.59749675", "0.5952824", "0.5949403", "0.59107333", "0.590172", "0.58840454...
0.73217493
0
c is a variable storing temperature in celsius
function convert(T, choice) { f = T; if (choice == 1) { f = (c * 9 / 5) + 32; console.log(`Temperature in Fahrenheit: ${f}`); } else if (choice == 2) { c = (f - 32) * 5 / 9; console.log(`Temperature in celsius: ${c}`); } else console.log("You have enter a wrong input"); return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FtoC(temperature) {\n let celcius = Math.floor(((temperature - 32) * 5) / 9);\n return celcius;\n}", "function Celsius(celsius){\n\tthis.celsius = celsius;\n\tthis.getFahrenheitTemp = function(){\n\t\treturn 1.8 * this.celsius + 32; \n\t}\n\tthis.getKelvinTemp = function(){\n\t\treturn 273 + this.cels...
[ "0.74577415", "0.73127854", "0.7241598", "0.7183572", "0.7109102", "0.7104077", "0.70803005", "0.70607823", "0.70607823", "0.7046159", "0.70111895", "0.6950953", "0.6857308", "0.68371004", "0.68325955", "0.68131256", "0.68075746", "0.6807091", "0.6749704", "0.6694397", "0.667...
0.0
-1
var c = 0;
function squareroot(c) { // c = number; // var epsilon = 10-15; t = 0.0001; //c=((c/t)+t)/2; while (Math.abs(t*t - c) >= Math.pow(10,-15) ) { t = ((c / t) + t) / 2; } console.log(`square Root of ${c} is ${t}`); return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function c() {\n return 55;\n }", "function zero(){ return 0;}", "function n$c(){return [0,0,0,0]}", "function c(e,t){0}", "function num(){ var x = 0}", "function i(t, e) {\n 0;\n }", "function c() {\n}", "value() {return 0}", "function pgZero (){\n pgNumber=0;\n\n}", ...
[ "0.7166016", "0.6914711", "0.68134135", "0.6456734", "0.6372262", "0.6208078", "0.61331266", "0.6121612", "0.61194474", "0.6090367", "0.6078152", "0.607674", "0.60729736", "0.5954399", "0.5936286", "0.5891074", "0.5891074", "0.58887684", "0.58874583", "0.58646065", "0.5850146...
0.0
-1
Creates a grid of a specified size by creating divs and appending them to a container div
function createGrid (num) { for( var i = 0; i < (num * num); i++) { var $grid = $('<div></div>'); $('#container').append($grid); } //Sets grid === to height and width of container //2 is used to account for the margin around the boxes. $('div div').height($('#container').height() / num - 2); $('div div').width($('#container').width() / num - 2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createGrid(numBox){\n var box = '<div class=\"box\"></div>';\n for(var i = 1; i <= numBox; i++){\n for(var j = 1; j <= numBox; j++){\n $('#container').append('<div class=\"box\"></div>');\n }\n }\n var size = (400 - (numBox * 2)) / numBox;\n $('.box').css({'height': size, '...
[ "0.8303914", "0.8190042", "0.81818837", "0.81466657", "0.81367475", "0.80813336", "0.79506373", "0.7898219", "0.78980774", "0.7878136", "0.78282315", "0.78186977", "0.7719341", "0.77045834", "0.76863253", "0.7686205", "0.76425236", "0.7623618", "0.7623051", "0.7609457", "0.75...
0.7976004
6
Creates a color changing effect when the mouse enters one of the divs created in createGrid.
function changeColor() { $('div div').mouseenter(function() { $(this).toggleClass('hover'); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createGrid() {\nfor (i = 0; i < slider.value * slider.value; i++) {\n const gridItem = document.createElement('div');\n gridItem.classList.add('gridBox');\n gridItem.addEventListener('mouseenter', function(e) {\n e.target.style.backgroundColor = chosenColor;\n gr...
[ "0.72700113", "0.7229293", "0.7220416", "0.71599734", "0.7148597", "0.7084653", "0.7040883", "0.7030561", "0.6970183", "0.69432956", "0.6924782", "0.6906458", "0.6903233", "0.6825146", "0.6822529", "0.6722741", "0.67190933", "0.6675205", "0.6655725", "0.66504765", "0.66392636...
0.64983207
26
Prompts the user for a grid size when they click on the Create Grid button.
function gridPrompt() { var gprompt = prompt("Enter a number between 1 & 100 to create a grid." + " For example, 60 will create a 60 x 60 grid."); //If the user hits cancel, exits the prompt. if ( gprompt === null) { return; } else if ( gprompt > 100 || gprompt < 1 || isNaN(gprompt) === true) { alert("Please enter a number between 1 & 100"); gridPrompt(); } else { //Removes previous grid $('div div').remove(); createGrid(gprompt); changeColor(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gridSize() {\n size = prompt(\"What size do you want the grid?\");\n createGrid(size, size);\n\n}", "function changeGridSize() {\n $(\"#gridSize\").click(function() {\n userDimension = prompt(\"Enter the grid size (i.e. enter 10 for a 10x10 grid)\")\n while (isNaN(userDimension) =...
[ "0.8320363", "0.79700446", "0.78062344", "0.7760569", "0.7658037", "0.7616819", "0.7501996", "0.7445124", "0.7361827", "0.7321994", "0.71696794", "0.7148174", "0.7117558", "0.70880324", "0.7057192", "0.7000555", "0.695037", "0.66914827", "0.6577477", "0.65454835", "0.6498492"...
0.6791367
17
Prime Number Cruncher Bilangan prima adalah sebuah bilangan dimana hanya bisa habis dibagi oleh angka 1 dan angka itu sendiri. 7 adalah bilangan prima, karena hanya habis dibagi angka 1 dan 7. 22 BUKAN bilangan prima, karena habis dibagi 1, 2, 11, dan 22. PROBLEM: Disediakan sebuah function primeNumberCruncher yang menerima sebuah parameter berupa number, dan mengembalikan kumpulan angka prima yang lebih besar dari ratarata kumpulan angka prima dari inputan parameter tersebut. Contoh 1: input: 10 proses: kumpulan deret array prima sampai `input`: [ 2, 3, 5, 7 ] 2 + 3 + 5 + 7 = 17 AVERAGE: 17/4 = 4.25 output: [5, 7] Contoh 2: input: 44 proses: kumpulan deret array prima sampai `input`: [ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43 ] 2 + 3 + 5 + 7 + 11 + 13 + 17 + 19 + 23 + 29 + 31 + 37 + 41 + 43 = 281 AVERAGE: 281/14 = 20.07 Output: [ 23, 29, 31, 37, 41, 43 ] Contoh 3: input: 23 proses: kumpulan deret array prima sampai `input`: [ 2, 3, 5, 7, 11, 13, 17, 19, 23 ] 2 + 3 + 5 + 7 + 11 + 13 + 17 + 19 + 23 = 100 AVERAGE: 100/9 = 11.11 output: [ 13, 17, 19, 23 ] RULES DILARANG MENGGUNAKAN BUILTIN FUNCTION JS APAPUN SELAIN .push
function numberPrimeCruncher(angka) { var arrPrime = []; var arrTemp = []; var total = 0; var newArrPrime = []; for (let i = 2; i <= angka; i++) { var counter = 0; for (let j = 0; j <= i; j++) { if (i % j == 0) { counter++; } } if (counter == 2) { arrPrime.push(i); } } for (let l = 0; l < arrPrime.length; l++) { total += arrPrime[l]; } var median = total / arrPrime.length; for (let m = 0; m < arrPrime.length; m++) { if (arrPrime[m] > median) { newArrPrime.push(arrPrime[m]); } } return newArrPrime; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkPrime(number){\n //var faktor = [];\n var jumlahFaktor = 0;\n for(let i=1; i<=number; i++){\n if(number%i === 0){\n //faktor.push(i);\n jumlahFaktor++;\n }\n }\n if(jumlahFaktor === 2){\n return true;\n } else {\n ret...
[ "0.67275953", "0.66603035", "0.646349", "0.64058435", "0.6398311", "0.63615626", "0.6356677", "0.6275163", "0.62634337", "0.62393194", "0.61949515", "0.61657083", "0.6152941", "0.6138274", "0.6123141", "0.6123005", "0.61131954", "0.6098964", "0.6090424", "0.60766906", "0.6053...
0.66310185
2
BASIC UTILITY FUNCTIONS return string of date in mm/dd format
function formatDate1(someDate) { var month = someDate.getMonth() + 1; var day = someDate.getDate(); return month + "/" + day; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDateString() {\n var now = new Date();\n var day = (\"0\" + now.getDate()).slice(-2);\n var month = (\"0\" + (now.getMonth() + 1)).slice(-2);\n return (month) + \"/\" + (day) + \"/\" + now.getFullYear();\n }", "getDateString() {\n return this.month.toString().pad...
[ "0.82993793", "0.77656925", "0.77281773", "0.7691523", "0.7672199", "0.7632734", "0.76053065", "0.7560484", "0.75602794", "0.75567645", "0.75267583", "0.751916", "0.75036496", "0.7499108", "0.7477243", "0.7433282", "0.74329376", "0.74120045", "0.7333313", "0.7299341", "0.7295...
0.0
-1
return string of date in database format
function formatDate2(someDate) { var year = someDate.getYear() + 1900; var month = someDate.getMonth() + 1; var day = someDate.getDate(); return year + "-" + month + "-" + day; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createDateStrForDBRequest(date){\n var year = date.getFullYear().toString();\n var tmpMonth = date.getMonth() + 1; \n var month = tmpMonth>9 ? tmpMonth.toString() : ('0'+tmpMonth.toString());\n var tmpDay = date.getDate();\n var day = tmpDay>9 ? date.getDate().toString() : ('0'+tmpDay.toString());\n ...
[ "0.7463057", "0.7463057", "0.7377157", "0.73541224", "0.7159952", "0.7125878", "0.71021456", "0.6971029", "0.69398516", "0.692364", "0.69203913", "0.68943876", "0.68784356", "0.68719685", "0.68438876", "0.6840694", "0.6828152", "0.6817267", "0.67385846", "0.67385846", "0.6690...
0.0
-1
database time format to userfriendly time format
function convertTime(dbTime) { var timeString; var timeSplit = dbTime.split(":"); var timeSplitInt = []; var i; for (i = 0; i < timeSplit.length; i++) timeSplitInt[i] = parseInt(timeSplit[i]); if (timeSplitInt[0] == 0) timeString = "12:" + timeSplit[1] + "a"; else if (timeSplitInt[0] > 12) timeString = (timeSplitInt[0] - 12) + ":" + timeSplit[1] + "p"; else timeString = timeSplitInt[0] + ":" + timeSplit[1] + "a"; return timeString; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "timeFormatter (time) {\n var timeArr = time.split('T');\n var finalTime = timeArr[1].slice(0,2) + ':' + timeArr[1].slice(2,4);\n return finalTime;\n }", "function timeFormat(time) {\n return time < 10 ? \"0\"+time : time;\n }", "function formatTime(time) {\n if (time < 10) {\n ...
[ "0.7111784", "0.7035722", "0.701806", "0.7015446", "0.6978149", "0.6962987", "0.69178194", "0.6897171", "0.6858877", "0.68575776", "0.6834045", "0.6794033", "0.6760297", "0.6755594", "0.6745924", "0.67353153", "0.6732504", "0.6726982", "0.67036015", "0.6696584", "0.669474", ...
0.7018312
2
DB OBJECT CONSTRUCTORS task object constructor
function task(id, name, building, tasktime, taskdate, notes) { console.log("idk"); this.id = id; this.name = name; this.building = building; this.tasktime = tasktime; this.taskdate = taskdate; this.notes = notes; /* var startSplit = startTime.split(":"); var endSplit = endTime.split(":"); var startSplitInt = [] var endSplitInt = []; var i; // general properties this.startTimeDB = startTime; this.endTimeDB = endTime; this.id = id; this.details = details; this.notes = notes; this.startDate = startDate; this.endDate = endDate; this.dayOfWeek = dayOfWeek; this.location = location; this.course = course; this.taskType = taskType; // frontend-specific properties this.startTime = convertTime(startTime); this.endTime = convertTime(endTime); this.startMinute = startSplit[0] * 60 + startSplit[1]; this.endMinute = endSplit[0] * 60 + endSplit[1]; */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Task(task) {\n\n // Populate taskmodel\n\n for (var prop in task) {\n if (task[prop] !== undefined) this[prop] = task[prop]\n }\n\n if (task !== undefined) this.createId()\n\n // Register model with Barricane\n\n process.db.registerInstance(this)\n}", "constructor() {\n super(new Task())...
[ "0.77144617", "0.7128225", "0.70270175", "0.6940322", "0.6909471", "0.6855991", "0.67991585", "0.6749561", "0.6727759", "0.669997", "0.66901433", "0.6498637", "0.6453899", "0.64496416", "0.6424196", "0.6343823", "0.6320438", "0.63035214", "0.62650985", "0.6259209", "0.6246738...
0.68739855
5
CLASSES TAB HTML CONTROL
function buildCourseHTML() { var courses = getCourses(); $('#courseCards').empty(); courses.forEach(function(course) { $('#courseCards').append(` <div class="card mt-3" id="course` + course.id + `"> <div class="card-header"> <div class="d-flex align-items-center"> <span class="font-weight-bold mr-auto" style="font-size:16px;">` + course.courseName + `</span> <button class="btn float-right" id="editCourse` + course.id + `" style="background-color:transparent;" data-toggle="modal" data-target="#classForm"> <i class="fa fa-pen"></i> </button> </div> </div> <div class="container mt-2 mb-2"> <div class="row"> <div class="col text-right">Pattern: </div> <div class="col-8" name="1">` + course.meetPattern + `</div> </div> <div class="row"> <div class="col text-right">Time: </div> <div class="col-8">` + course.startTime + ` - ` + course.endTime + `</div> </div> <div class="row"> <div class="col text-right">Location: </div> <div class="col-8">` + course.building + ' ' + course.room + `</div> </div> </div> </div> `); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tab_code(elem) {\n console.log(\"===TODO===\", 'tab', elem);\n}", "function Tabs(ide) {\n var tbs = this;\n ide = getObj(ide);\n this.tabs = null;\n\n\tvar active = 0;\n var blocks = gtn(ide, 'blockquote');\n\n\tthis.setDefault = function(a) {\n\t\tactive = a;\n\t};\n\n this.init = funct...
[ "0.65874857", "0.64853036", "0.64562833", "0.63400596", "0.62931657", "0.6292885", "0.6218058", "0.6187638", "0.6186259", "0.6170682", "0.61666864", "0.61550856", "0.61520565", "0.61491317", "0.6142118", "0.61413676", "0.609032", "0.60798675", "0.60660666", "0.6054934", "0.60...
0.0
-1
TO DO TAB HTML CONTROL update carousel when moved
function carouselSlid(e) { if (e.direction == "right") { nextWeek.setDate(nextWeek.getDate() - 7); shownWeek.setDate(shownWeek.getDate() - 7); lastWeek.setDate(lastWeek.getDate() - 7); console.log(lastWeek); console.log(shownWeek); console.log(nextWeek); switch(carouselPosition) { case "#week1slide": carouselPosition = "#week3slide"; buildWeekHTML(lastWeek, "#week2slide"); break; case "#week2slide": carouselPosition = "#week1slide"; buildWeekHTML(lastWeek, "#week3slide"); break; case "#week3slide": carouselPosition = "#week2slide"; buildWeekHTML(lastWeek, "#week1slide"); break; } } else { nextWeek.setDate(nextWeek.getDate() + 7); shownWeek.setDate(shownWeek.getDate() + 7); lastWeek.setDate(lastWeek.getDate() + 7); console.log(lastWeek); console.log(shownWeek); console.log(nextWeek); switch(carouselPosition) { case "#week1slide": carouselPosition = "#week2slide"; buildWeekHTML(nextWeek, "#week3slide"); break; case "#week2slide": carouselPosition = "#week3slide"; buildWeekHTML(nextWeek, "#week1slide"); break; case "#week3slide": carouselPosition = "#week1slide"; buildWeekHTML(nextWeek, "#week2slide"); break; } } $("#shownWeekHeader").text("WEEK OF " + formatDate1(shownWeek)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveCarousel() {\n let transformValue = carouselItemsActiveIndex * carouselWrapWidth;\n carouselList.style.transform =\n \"translate3d(-\" + transformValue + \"px, 0px, 0px)\";\n addActiveToItem();\n addTransition();\n setActivePagination();\n setButtonAttr();\n}", "_changeActive(index){\n /...
[ "0.7001379", "0.6867026", "0.67441565", "0.6599086", "0.65585494", "0.6520129", "0.6443169", "0.6415866", "0.6347934", "0.62898755", "0.6287182", "0.6287031", "0.6278506", "0.620447", "0.6165814", "0.61608285", "0.6141605", "0.6119438", "0.6109617", "0.6105422", "0.60960144",...
0.0
-1
These functions determine age on each planet
earthAge(birthday) { let today = new Date(); let myAge = (today - birthday); return Math.floor(myAge / 3.154e+10); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "calculateGalacticAge(){\n const MercuryMax = 21.12;\n const VenusMax = 54.56;\n const MarsMax = 165.44;\n const JupiterMax = 1043.68;\n if(this.planet == \"Mercury\"){\n this.planetAge = this.getMercuryAge();\n this.remainPlanetYears = Math.ceil(MercuryMax - this.planetAge);\n return...
[ "0.78215367", "0.7088235", "0.69984317", "0.69855535", "0.69116414", "0.6895201", "0.68357295", "0.67922795", "0.6781478", "0.6771395", "0.6771395", "0.6740703", "0.6733545", "0.6719946", "0.671888", "0.67046946", "0.67045563", "0.67045563", "0.670068", "0.6685058", "0.668432...
0.6462526
38
These functions calculate how much time left the user would have if they lived on other planets
mercuryTimeLeft() { let timeLeftMercury = this.timeLeft / 0.24; return timeLeftMercury; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_time_left() {\n return (escrow_amount / price_per_second) - time_spent;\n}", "function culcTimeLeftStore1() {\n let totalTime = 120;\n\n let distanceToStore1 = 10;\n\n let myHome = 0;\n\n let distanceFromMeToStore1 = myHome + distanceToStore1 * 2 + 5;\n\n let result = totalTime - distanceFrom...
[ "0.70369065", "0.6747363", "0.6678641", "0.6579432", "0.6384992", "0.6375195", "0.6345107", "0.60752106", "0.6072048", "0.60105014", "0.6001674", "0.59913903", "0.5972084", "0.59233034", "0.5914371", "0.59119654", "0.5882657", "0.5853839", "0.58407074", "0.5823879", "0.582233...
0.64239883
4
These functions determine how much life a person has left on Earth based on their current age, gender and what continet they live on. If 'male' is true use avg age on left If 'male' is false, use age on right
earthLifeExpectancy() { switch(this.continent) { case "North America": return this.gender === "male" ? 77 : 81; case "South America": return this.gender === "male" ? 73 : 79; case "Europe": return this.gender === "male" ? 75 : 82; case "Asia": return this.gender === "male" ? 71 : 74; case "Africa": return this.gender === "male" ? 61 : 64; case "Oceania": return this.gender === "male" ? 76 : 80; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "yearsLeft(smoker, age) {\n let that = this;\n let result;\n\n if (that.lifeExpectancy(smoker) - age > 0) {\n result = that.lifeExpectancy(smoker) - age;\n } else {\n result = \"You are living over your life expectancy. Are you sure you are not dead?\";\n }\n return result;\n }", "fun...
[ "0.65848184", "0.65011257", "0.61647964", "0.6149521", "0.6143316", "0.61390984", "0.6117361", "0.60235834", "0.6019571", "0.6010498", "0.6003112", "0.60013705", "0.5992602", "0.59862417", "0.5975699", "0.59644043", "0.59555", "0.5947848", "0.5943127", "0.5942912", "0.5937562...
0.6541262
1
Return url to query opencop database for table name. If the need strikes you, you can throw a CQL_FILTER on the end.
function jsonUrl(tableName) { var url = "/geoserver/wfs" url += "?request=GetFeature" url += "&version=1.1.0" url += "&outputFormat=JSON" url += "&typeName=opencop:" url += tableName return url }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUrlTable() {\r\n return _urlTable;\r\n}", "function getUrlTable() {\r\n return _urlTable;\r\n}", "function getUrlTable() {\n return _urlTable;\n}", "tablename(context) {\n switch (context) {\n case \"select\":\n case \"selectOne\":\n return \"(select * from ta...
[ "0.6198736", "0.6198736", "0.61935323", "0.59674555", "0.59411687", "0.56809366", "0.567474", "0.5619201", "0.5613646", "0.56016505", "0.5578619", "0.54963696", "0.5492505", "0.5479175", "0.54001516", "0.5371615", "0.5347333", "0.5295303", "0.52872294", "0.5283839", "0.527119...
0.56059414
9
Get data from a geoserver table. These tables are slightly weird in the way that you have to parse the JSON afterwards.
function getGeoserverTable(url, success, failure) { Ext.Ajax.request({ url : url, success : _.compose(success, parseGeoserverJson), failure : failure }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTableDataFromJSON() {\n\n }", "function jsonUrl(tableName) {\n var url = \"/geoserver/wfs\"\n url += \"?request=GetFeature\"\n url += \"&version=1.1.0\"\n url += \"&outputFormat=JSON\"\n url += \"&typeName=opencop:\"\n url += tableName\n return url\n }", "getData(table)...
[ "0.7149704", "0.6655172", "0.64652574", "0.6449949", "0.61625606", "0.61189616", "0.60623544", "0.60524595", "0.6038257", "0.5977487", "0.59531814", "0.59130573", "0.59113157", "0.59020644", "0.58984786", "0.58950853", "0.5885923", "0.58554006", "0.5847307", "0.5823865", "0.5...
0.7328256
0
Call callback with list of all iconjointable objects that exist in the namespace_name
function getIconInfo(namespace_name, success) { var filter = "&CQL_FILTER=layer='" + namespace_name + "'" var url = jsonUrl("iconmaster") + filter getGeoserverTable(url, success) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function register_iconlist_callback() {\n var icons = document.querySelectorAll(\".icon-list-item img\");\n for (var i=0; i<icons.length; i++) {\n icons[i].addEventListener(\"click\", load_icon);\n }\n}", "buildIcons(){\n for(var i=0; i<this.popUpFltImgs.length; i++){\n this.bui...
[ "0.5754351", "0.54076743", "0.50904495", "0.50842637", "0.5080745", "0.5014423", "0.49508548", "0.4943572", "0.4821361", "0.48196003", "0.48114815", "0.4809634", "0.4809634", "0.4772146", "0.4755873", "0.47359955", "0.4733905", "0.47324297", "0.47245473", "0.472149", "0.47081...
0.5647813
1
Load layers that are not part of the GetCapabilities
function getAdditionalLayers(layerGroupId, success, failure) { var filter = "&CQL_FILTER=layergroup='" + layerGroupId + "'" var url = jsonUrl("layer") + filter getGeoserverTable(url, success, failure) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preloadGmxLayers(mapConfig) {\n var ids = [];\n\n function rWalk(node) {\n if (node.type === 'gmxVector' && node.gmxId) {\n ids.push(node.gmxId);\n }\n\n node.children && node.children.map(function(child) {\n rWalk(child);\n ...
[ "0.6625302", "0.64319044", "0.6393501", "0.63875425", "0.6341155", "0.61690897", "0.6113296", "0.60826665", "0.60141975", "0.5985674", "0.5939575", "0.59233296", "0.5913019", "0.5906488", "0.5893629", "0.5853021", "0.5853021", "0.5846863", "0.5842979", "0.5834298", "0.5827821...
0.54632145
79
Take a geoserver ajax response object and convert it into what you'd expect: a list of javascript objects. Pulls the response out of the FeatureCollection
function parseGeoserverJson(response) { function parseId(idStr) { return idStr.match(/\d*$/)[0] // ex: "layergroup.24" -> "24" } var features = Ext.util.JSON.decode(response.responseText).features return _(features).map(function(feature) { return _(feature.properties).defaults({ id : parseId(feature.id) }) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processResults() {\n var results = JSON.parse(this.responseText);\n if (results.list.length > 0) {\n for (var i = 0; i < results.list.length; i++) {\n geoJSON.features.push(convertToGeoJson(results.list[i]));\n }\n map.data.addGeoJson(geoJSON);\n }\n}", "function...
[ "0.6901172", "0.6388696", "0.6012852", "0.6001298", "0.58722615", "0.57966226", "0.5773272", "0.5745927", "0.5685376", "0.56702584", "0.5646436", "0.5639588", "0.5618963", "0.5588468", "0.5580618", "0.55773145", "0.5541827", "0.55210596", "0.55192965", "0.55164355", "0.551035...
0.693679
0
pmY = []//len =8 sig = []//len=8 N = pmY.length N=32 xs = 200; ys = 220;; //starting coods xx = []; // xposition holder eps = 10; // tolerance backgnd = [255, 255, 0] foregnd = [255, 0, 0] var x = [0] Xcos = []; Xsin = []; Xmag = []; Xph = [] ========================= ===== setup() ==========
function setup() { createCanvas(800,600); backgnd = [255, 255, 0] foregnd = [255, 0, 0] var x = [0] Xcos = [];sig=[] Xsin = []; Xmag = []; Xph = [] pmY=[];sig=[] xx = []; // xposition holder eps = 10; // tolerance N=9 xs=-width/2.1;ys=-height/4 //xs=0;ys=0 angleMode(DEGREES) background(backgnd) initSig() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setup() {\n createCanvas(1820,540);\n //colorMode(RGB, 255, 255, 255, 100);\n w = width + 16;\n\n for (var i = 0; i < maxwaves; i++) {\n amplitude.push(random(100, 400));\n var period = random(500,800); // How many pixels before the wave repeats\n dx.push((TWO_PI / period) * xspacing/2);\n }...
[ "0.64494294", "0.63659894", "0.62416935", "0.6105618", "0.60917175", "0.60842156", "0.6002999", "0.6001506", "0.6000426", "0.59567475", "0.5905112", "0.59018993", "0.5877671", "0.58366585", "0.5824098", "0.5822342", "0.5808477", "0.5807973", "0.5806658", "0.57956123", "0.5791...
0.7679951
0
======================== ========== draw() =======================================
function draw() { translate(width/2, height/2) dispSig() myDFT(sig) print('Xmag= ' + Xmag) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {}", "function draw() {}", "draw() { }", "draw() { }", "draw() { }", "Draw(){\n\t\tthis.context.beginPath();\n\t\tthis.context.fillRect(this.posX, this.posY, this.width, this.height);\n\t\tthis.context.closePath();\n }", "draw() {}", "draw() {}", "draw() {}", "draw() {}", "dr...
[ "0.83454597", "0.83454597", "0.80180675", "0.80180675", "0.80180675", "0.7879257", "0.78359646", "0.78359646", "0.78359646", "0.78359646", "0.77732784", "0.77507496", "0.77258193", "0.7713859", "0.7688569", "0.7684257", "0.7600444", "0.7577968", "0.7570521", "0.7551823", "0.7...
0.0
-1
end of function draw() =================================================
function dispSig() { mY = (mouseY - (height / 2)) if (mY < -358) { mY = -358 } //restrict height within graph if (mY > -82) { mY = -82 } // restrict height within graph //print('mY='+mY) mx = mouseX - width / 2; for (i = 0; i < N; i++) { xx[i] = xs + i * 30 // hori spacing ellipse(xx[i], ys, 5) line(xx[i], ys, xx[i], ys - 140) //vert lines up line(xx[i], ys, xx[i], ys + 140) //vert lines down line(xs, ys - 20 * i, xs + N * 26, ys - 20 * i) //horiz lines up line(xs, ys + 20 * i, xs + N * 26, ys + 20 * i) //horiz lines dn }; //end of for loop for plotting small circles for (i = 0; i < N; i++) { dx = abs(xx[i] - mx) if (dx < eps) { ellipse(xx[i], ys, 10); push() strokeWeight(9); //did the trick! stroke(backgnd) line(xx[i], ys, xx[i], pmY[i]) //signal bar pop() push() stroke(foregnd) strokeWeight(4) line(xx[i], ys, xx[i], mY) //signal bar pop() pmY[i] = mY; // y decreses upwords ! sig[i] = -(mY - ys); }; // end of if block }; //end of for loop }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {}", "function draw() {}", "draw() { }", "draw() { }", "draw() { }", "draw() {}", "draw() {}", "draw() {}", "draw() {}", "function draw() {\n \n}", "function draw(){\n\t\t// Needed to comply with Tool Delegate design pattern\n\t}", "function draw() {\r\n \...
[ "0.85384756", "0.85384756", "0.81735563", "0.81735563", "0.81735563", "0.7963708", "0.7963708", "0.7963708", "0.7963708", "0.79450506", "0.7942093", "0.7939449", "0.785113", "0.7849154", "0.7826705", "0.7826705", "0.7826705", "0.7826705", "0.7826705", "0.775753", "0.7747478",...
0.0
-1
end of function dispSig()
function initDFT() { for (i = 0; i < N; i++) { Xcos[i] = 0; Xsin[i] = 0; Xmag[i] = 0; }; // end of for loop }//end of function initDFT()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Disp() {\r\n}", "function showSignature() {\r\n print(\"Showing signature\");\r\n window.sigCtl.GetSignature(onGetSignature);\r\n function onGetSignature(sigCtlV, sigObjV, status) {\r\n if (window.sdkPtr.ResponseStatus.OK == status) {\r\n var outputFlags = ...
[ "0.61839", "0.5971244", "0.5869338", "0.5776047", "0.57388234", "0.5496641", "0.53882456", "0.535788", "0.53080934", "0.5279114", "0.52421707", "0.51038384", "0.5100492", "0.50479966", "0.49850985", "0.49465784", "0.49396953", "0.49311787", "0.49122626", "0.49115998", "0.4891...
0.0
-1
Gives a score on quality of match
function rateUser(userData, matchData, callback) { const userRoles = userData.roles || []; const userSkills = userData.skills || []; const matchRoles = matchData.roles || []; const matchSkills = matchData.skills || []; var rating = 0; // find matched roles async.forEachOf(userRoles, (role, index, next) => { // increase rating if match if (matchRoles.includes(role)) rating++; next(); }, err => { if(err) return callback(null); // find matched skills async.forEachOf(userSkills, (skill, index, next) => { // increase rating if match if (matchSkills.includes(skill)) rating++; next(); }, err => { if(err) return callback(null); else return callback(rating); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matchQuality (text, query) {\n const terms = tokenize(query)\n const termsLength = terms.map(term => term.length).reduce((x, y) => x + y, 0)\n\n const quality = termsLength / text.length\n // Add bonus points if the query matches text at the very start.\n const bonus = startsWith(text, terms[0]) ? 1 ...
[ "0.7092915", "0.6878535", "0.658132", "0.6563475", "0.6543055", "0.65254724", "0.6443714", "0.6440338", "0.64390355", "0.636438", "0.63287157", "0.62749505", "0.6272122", "0.62667716", "0.6263273", "0.6245607", "0.62451166", "0.6234905", "0.6227321", "0.6214549", "0.617666", ...
0.0
-1
Sort matches based on quality and timestamp
function sortMatches(matches, callback) { callback(matches.sort((x, y) => { // sort by rating in descending order, then by timestamp in ascending order return (y.rating - x.rating || x.ts - y.ts); })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sorted(matches) {\n // sort on i primary, j secondary\n return matches.sort((m1, m2) => (m1.i - m2.i) || (m1.j - m2.j));\n }", "function sortMatches(x, y) {\n // Sort two matching results, first by rankOrder, and second by rankPos.\n // Multiplier should be larger than rankPos (char id...
[ "0.69574136", "0.66316885", "0.6457013", "0.63573706", "0.60483915", "0.6035465", "0.57600826", "0.571879", "0.5708793", "0.5631702", "0.5618308", "0.56176496", "0.56160194", "0.5583195", "0.55749035", "0.55486107", "0.5534604", "0.5517065", "0.5511828", "0.5500277", "0.54967...
0.7520447
0
Complements the application of 'pred`
function complement(pred) { return function(/* arguments */) { return !pred.apply(null, _.toArray(arguments)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filter(pred) {\n return function(xs) {\n return Z.filter (pred, xs);\n };\n }", "function filter(pred) {\n return function(rf) { // <- buildArray for example, but also the function in map on line 82\n return function(result, item) {\n if(pred(item))\n return rf(result, item)\...
[ "0.6705718", "0.65874404", "0.65270615", "0.6463311", "0.6463311", "0.61922604", "0.58999133", "0.5811592", "0.5677635", "0.5664593", "0.5558659", "0.5535481", "0.5527944", "0.5503125", "0.546129", "0.54492134", "0.54168695", "0.53777325", "0.5288122", "0.5233991", "0.5202936...
0.6928306
0
Draw Piece Offset allows us to move the piece
function drawMatrix(matrix, offset) { matrix.forEach((row, y) => { row.forEach((value, x) => { if (value !== 0) { context.fillStyle = colors[value]; context.fillRect(x + offset.x, y + offset.y, 1, 1); } }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rePosition(){\r\n piece.pos.y = 0; // this and next line puts the next piece at the top centered\r\n piece.pos.x = ( (arena[0].length / 2) | 0) - ( (piece.matrix[0].length / 2) | 0);\r\n }", "function drawPiece(context, piece, pos, maxHeight){\n var drawX, drawY;\n context.fillStyle = piece.col...
[ "0.6511581", "0.65115803", "0.64742166", "0.6404337", "0.62690616", "0.6197641", "0.6186632", "0.61701274", "0.6094864", "0.60929704", "0.60718167", "0.6066706", "0.6045832", "0.6033441", "0.6007734", "0.5976015", "0.59749305", "0.59620893", "0.5957712", "0.5938316", "0.59006...
0.0
-1
Copy values from player into arena
function merge(arena, player) { player.matrix.forEach((row, y) => { row.forEach((value, x) => { if (value !== 0) { arena[y + player.pos.y][x + player.pos.x] = value; } }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function merge(arena, player) { //merge function puts the last position of the piece on the arena, so that we maintain the status of the pieces that have been played previously\n player.matrix.forEach((row, y) => {\n row.forEach((value, x) => {\n if (value !== 0) {\n arena[y + p...
[ "0.720134", "0.715486", "0.70767826", "0.7059706", "0.70479363", "0.7023856", "0.6843925", "0.6343385", "0.6198291", "0.6040673", "0.5898057", "0.58365566", "0.58083683", "0.5783554", "0.576863", "0.57621264", "0.5730956", "0.5677256", "0.56510913", "0.5630383", "0.5581915", ...
0.70673656
3
Move player and prevent leaving screen
function playerMove(dir) { player.pos.x += dir; if (collide(arena, player)) { player.pos.x -= dir; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function movePlayer() {\n screenWarping(\"player\");\n playerX += playerVX;\n playerY += playerVY;\n}", "function still_player() {\n player.moving_frame.visible = false;\n player.still_frame.visible = true;\n\n }", "function movePlayer() {\n if (game.press[k.w]) {\n var top = parseI...
[ "0.7208134", "0.7113066", "0.7053531", "0.704011", "0.7022556", "0.6979572", "0.69367415", "0.6926459", "0.68889135", "0.6854903", "0.6846287", "0.6826073", "0.6813539", "0.6756581", "0.6738945", "0.6720834", "0.67069733", "0.66970855", "0.66930366", "0.6692491", "0.6685604",...
0.64742136
39
Random Piece each spawn
function playerReset() { const pieces = 'ILJOTSZ'; player.matrix = createPiece(pieces[pieces.length * Math.random() | 0]); // center new player position player.pos.y = 0; player.pos.x = (arena[0].length / 2 | 0) - (player.matrix[0].length / 2 | 0); // End game if (collide(arena, player)) { arena.forEach(row => row.fill(0)); player.score = 0; updateScore(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function spawnNewPiece() {\r\n // Create random number between 0 and 6\r\n let r = randomN = Math.floor(Math.random() * PIECES.length)\r\n // Return a newly created piece\r\n return new Piece(PIECES[r][0], PIECES[r][1]);\r\n}", "function randomPiece(){\n let r = randomN = Math.floor(Math.random() ...
[ "0.8273004", "0.7953681", "0.78579986", "0.78180224", "0.7641173", "0.75563353", "0.752768", "0.74774486", "0.74278593", "0.74239033", "0.7291698", "0.72174346", "0.7075895", "0.7065599", "0.70552313", "0.70097184", "0.69829094", "0.6976428", "0.69734263", "0.6973126", "0.696...
0.0
-1
Rotate Pieces Transpose + Reverse = Rotation
function rotate(matrix, dir) { for (let y = 0; y < matrix.length; ++y) { for (let x = 0; x < y; ++x) { // switch tuple [ matrix[x][y], matrix[y][x], ] = [ matrix[y][x], matrix[x][y], ]; } } if (dir > 0) { matrix.forEach(row => row.reverse()); } else { matrix.reverse(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rotateImage(a) { \n let len = a.length\n for (i = 0; i < len; i++, len--) { \n let end = len - 1; \n for ( j = i; j < end; j++) { \n let tail = a.length - j - 1; \n\n let temp = a[i][j]; \n a[i][j] = a[tail][i]; \n a[tail][i] = a[end][tail]; \n a[end][tail] =...
[ "0.69100225", "0.6869165", "0.6861636", "0.6829192", "0.66337055", "0.66081953", "0.6542658", "0.64877194", "0.64826256", "0.6479962", "0.64549613", "0.64304155", "0.6406593", "0.6367505", "0.6362512", "0.63218117", "0.6317425", "0.6273963", "0.62404317", "0.6222802", "0.6190...
0.6054628
42
Update positions every 1 second
function update(time = 0) { const deltaTime = time - lastTime; lastTime = time; dropCounter += deltaTime; if (dropCounter > dropInterval) { playerDrop(); } draw(); requestAnimationFrame(update); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "#updatePosition() {\n this.interval = setInterval(\n () => this.#setNewPosition(),\n this.intervalTime\n );\n }", "loopUpdate(){\n setInterval(()=>{\n this.updateNow();\n },updateSecs*1000);\n }", "update() {\n\n\n this.i++;\n\n if (this.i === this.update_inte...
[ "0.76198995", "0.69008255", "0.68367946", "0.6768665", "0.6717541", "0.67137736", "0.66935706", "0.66866016", "0.6676544", "0.6668463", "0.6637737", "0.66039634", "0.6599757", "0.65874505", "0.65778065", "0.6545341", "0.6429563", "0.6427938", "0.6425734", "0.6414184", "0.6404...
0.0
-1
Get list of all user via l'ApiAdmin
GetAllUsers(Data, res, User, UserId){ this.LogAppliInfo("Call ApiAdmin GetAllUsers", User, UserId) const Query = {} const Projection = { projection:{ _id: 1, [this._MongoVar.LoginUserItem]: 1}} const Sort = {[this._MongoVar.LoginUserItem]: 1} this._Mongo.FindSortPromise(Query,Projection, Sort, this._MongoVar.UserCollection).then((reponse)=>{ if(reponse.length == 0){ res.json({Error: false, ErrorMsg: "No user in BD", Data: null}) } else { res.json({Error: false, ErrorMsg: "User in DB", Data: reponse}) } },(erreur)=>{ this.LogAppliError("ApiAdminGetAllUsers DB error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "DB Error", Data: ""}) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getAllUsers() {\n return Api.get(\"/admin/user-list\");\n }", "listUsers(aud) {\n return this.user._request('/admin/users', {\n method: 'GET',\n audience: aud,\n });\n }", "function listUsers(api, query) {\n return api_1.GET(api, '/users', { query })\n}", "async list() {\n\t\tre...
[ "0.8715179", "0.78477544", "0.76506615", "0.76285285", "0.75700396", "0.75625867", "0.7552312", "0.75437176", "0.753086", "0.75252706", "0.74641365", "0.74345386", "0.7430963", "0.7417482", "0.7381625", "0.73374724", "0.73360103", "0.7333996", "0.7296271", "0.72877705", "0.72...
0.0
-1
Get list of user data via l'ApiAdmin
GetUserData(Data, res, User, UserId){ this.LogAppliInfo("Call ApiAdmin GetUserData, Data: " + JSON.stringify(Data), User, UserId) let MongoObjectId = require('./Mongo.js').MongoObjectId // Definition de la Query de Mongo const Query = {'_id': new MongoObjectId(Data.UsesrId)} // Definition de la projection de Mongo en fonction du type de user let Projection = {projection:{}} // Find de type Promise de Mongo this._Mongo.FindPromise(Query,Projection, this._MongoVar.UserCollection).then((reponse)=>{ if(reponse.length == 0){ this.LogAppliError("Wrong UserId", User, UserId) res.json({Error: true, ErrorMsg: "Wrong UserId", Data: null}) } else { // les password sont effacés de la réponse reponse[0][this._MongoVar.LoginPassItem]="" reponse[0][this._MongoVar.LoginConfirmPassItem]="" // la reponse est envoyée res.json({Error: false, ErrorMsg: "User data in DB", Data: reponse}) } },(erreur)=>{ this.LogAppliError("ApiAdminGetUserData DB error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "DB Error", Data: null}) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getAllUsers() {\n return Api.get(\"/admin/user-list\");\n }", "getUserList(data){\nreturn this.post(Config.API_URL + Constant.USER_GETUSERLIST, data);\n}", "listUsers(aud) {\n return this.user._request('/admin/users', {\n method: 'GET',\n audience: aud,\n });\n }", "function listUs...
[ "0.8103539", "0.76670825", "0.7582745", "0.73830926", "0.73292035", "0.72673535", "0.7210796", "0.72069913", "0.7201222", "0.7175564", "0.7160537", "0.71472794", "0.71344733", "0.70957536", "0.70705056", "0.7059214", "0.7046257", "0.70367396", "0.7034164", "0.7029558", "0.702...
0.0
-1
Delete d'un user via l'ApiAdmin
DeleteUser(Data, res, User, UserId){ // Log this.LogAppliInfo("Call ApiAdmin DeleteUser, Data: " + JSON.stringify(Data), User, UserId) // Execute action before delete the user if (this._OnDeleteUser){ this._OnDeleteUser(Data.UsesrId, Data.UserLogin, User, UserId).then(()=>{ // Delete de type Promise de Mongo this._Mongo.DeleteByIdPromise(Data.UsesrId, this._MongoVar.UserCollection).then((reponse)=>{ if (reponse.deletedCount==1) { res.json({Error: false, ErrorMsg: "User deleted in DB", Data: null}) } else { this.LogAppliError("User not found in DB", User, UserId) res.json({Error: true, ErrorMsg: "User not found in DB", Data: null}) } },(erreur)=>{ this.LogAppliError("ApiAdminDeleteUser DB error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "DB Error", Data: null}) }) }, ()=>{ this.LogAppliError("ApiAdminDeleteUser error during OnDeleteUser function", User, UserId) res.json({Error: true, ErrorMsg: "Error during OnDeleteUser function", Data: null}) }) } else { // Delete de type Promise de Mongo this._Mongo.DeleteByIdPromise(Data.UsesrId, this._MongoVar.UserCollection).then((reponse)=>{ if (reponse.deletedCount==1) { res.json({Error: false, ErrorMsg: "User deleted in DB", Data: null}) } else { this.LogAppliError("User not found in DB", User, UserId) res.json({Error: true, ErrorMsg: "User not found in DB", Data: null}) } },(erreur)=>{ this.LogAppliError("ApiAdminDeleteUser DB error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "DB Error", Data: null}) }) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteUser(req, res) {\n var id = req.params['id'];\n typeModel.deleteAdmin(id)\n .then(res.sendStatus(200))\n }", "deleteUser(id) {\n return axios\n .delete(this.apiUrl() + `/users/${id}/`, {\n headers: this.authHeader(),\n })\n }", "async deleteUser({...
[ "0.798736", "0.75837684", "0.75565934", "0.7535612", "0.750912", "0.7506246", "0.74991506", "0.7435927", "0.7434023", "0.74170935", "0.73923606", "0.738169", "0.73793507", "0.73753256", "0.7358291", "0.73351187", "0.73185575", "0.73119456", "0.7309403", "0.7297454", "0.728814...
0.0
-1
Update d'un user (meme fonction pour Api et ApiAdmin)
UpdateUser(Data, res, User, UserId){ this.LogAppliInfo("Call Api"+ Data.UserType + " UpdateUser, Data: " + JSON.stringify(Data), User, UserId) // changement du password que si il est different de vide if (Data.Data[this._MongoVar.LoginPassItem] == ""){ delete Data.Data[this._MongoVar.LoginPassItem] delete Data.Data[this._MongoVar.LoginConfirmPassItem] } // Update de type Promise de Mongo this._Mongo.UpdateByIdPromise(Data.UsesrId, Data.Data, this._MongoVar.UserCollection).then((reponse)=>{ if (reponse.matchedCount==1) { res.json({Error: false, ErrorMsg: "User Updated in DB", Data: null}) } else { this.LogAppliError("User not found in DB", User, UserId) res.json({Error: true, ErrorMsg: "User not found in DB", Data: null}) } },(erreur)=>{ this.LogAppliError("UpdateUser DB error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "DB Error", Data: null}) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateUser(user) {\n return {\n type: 'UPDATE_USER',\n user\n }\n}", "function updateUser(req, res) {\n var userId = req.params.id;\n var update = req.body;\n // borrar propiedad password\n delete update.password;\n if (userId != req.user.sub) {\n return res.status(500).sen...
[ "0.7920331", "0.79172826", "0.79161614", "0.78971666", "0.7865937", "0.7849261", "0.78067315", "0.7787112", "0.77540714", "0.7749123", "0.77196485", "0.7712259", "0.77062917", "0.76975983", "0.76549727", "0.7621919", "0.76131445", "0.76001054", "0.75998116", "0.75970757", "0....
0.72020036
74
Get de la structure d'un user
GetUserDataStructure(Data, res, User, UserId){ this.LogAppliInfo("Call ApiAdmin GetUserDataStructure, Data: " + Data, User, UserId) let reponse=[] // Data strucutre d'un user reponse.push(this._MongoVar.LoginUserItem) reponse.push(this._MongoVar.LoginFirstNameItem) reponse.push(this._MongoVar.LoginLastNameItem) reponse.push(this._MongoVar.LoginPassItem) reponse.push(this._MongoVar.LoginConfirmPassItem) reponse.push(this._MongoVar.LoginAdminItem) res.json({Error: false, ErrorMsg: "User data structure", Data: reponse}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUser () {return user;}", "function getUser() {\n return {\n name: 'Awotunde',\n handle: '@egunawo33', \n location: 'Orun, Aye'\n }\n}", "function getUser(){\n return user;\n }", "function getUser() {\n return user;\n }", "get user() {\n return this....
[ "0.75604975", "0.7419943", "0.7322997", "0.72530115", "0.7200763", "0.7119125", "0.69848484", "0.69580483", "0.6933814", "0.69336545", "0.69181216", "0.68031347", "0.6796717", "0.6768122", "0.6750585", "0.6750421", "0.67411184", "0.6722475", "0.66981834", "0.6684873", "0.6671...
0.0
-1
Creation d'un nouvel user
NewUser(Data, res, User, UserId){ this.LogAppliInfo("Call ApiAdmin NewUser, Data: " + JSON.stringify(Data), User, UserId) let DataToDb = { [this._MongoVar.LoginUserItem]: Data.Data[this._MongoVar.LoginUserItem], [this._MongoVar.LoginFirstNameItem]: Data.Data[this._MongoVar.LoginFirstNameItem], [this._MongoVar.LoginLastNameItem]: Data.Data[this._MongoVar.LoginLastNameItem], [this._MongoVar.LoginPassItem]: Data.Data[this._MongoVar.LoginPassItem], [this._MongoVar.LoginConfirmPassItem]: Data.Data[this._MongoVar.LoginConfirmPassItem], [this._MongoVar.LoginAdminItem]: Data.Data[this._MongoVar.LoginAdminItem]} // Insert de type Promise de Mongo this._Mongo.InsertOnePromise(DataToDb, this._MongoVar.UserCollection).then((reponse)=>{ res.json({Error: false, ErrorMsg: "User added in DB", Data: null}) },(erreur)=>{ this.LogAppliError("ApiAdminNewUser DB error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "DB Error", Data: null}) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createUser() {}", "function createUser() {\n var newUser = {\n username: $usernameFld.val(),\n password: $passwordFld.val(),\n firstName: $firstNameFld.val(),\n lastName: $lastNameFld.val(),\n role: $roleFld.val()\n };\n try {\n...
[ "0.8000366", "0.766553", "0.7545109", "0.75274885", "0.7477783", "0.73052883", "0.7298886", "0.72558606", "0.7185484", "0.71478766", "0.71478766", "0.7132831", "0.711105", "0.71082383", "0.70794857", "0.7060106", "0.7052198", "0.7050467", "0.7050409", "0.7005526", "0.6987585"...
0.0
-1
Get My Data of a connected user (meme fonction pour Api et ApiAdmin)
GetMyData(App, res, User, UserId){ this.LogAppliInfo("Call ApiAdmin ApiGetMyData, Data: App=" + App, User, UserId) let MongoObjectId = require('./Mongo.js').MongoObjectId // Definition de la Query de Mongo const Query = {'_id': new MongoObjectId(UserId)} // Definition de la projection de Mongo en fonction du type de user let Projection = { projection:{ _id: 0, [this._MongoVar.LoginUserItem]:0, [this._MongoVar.LoginAdminItem]:0}} // Find de type Promise de Mongo this._Mongo.FindPromise(Query,Projection, this._MongoVar.UserCollection).then((reponse)=>{ if(reponse.length == 0){ this.LogAppliError("Wrong UserId", User, UserId) res.json({Error: true, ErrorMsg: "Wrong UserId", Data: null}) } else { // les password sont effacés de la réponse reponse[0][this._MongoVar.LoginPassItem]="" reponse[0][this._MongoVar.LoginConfirmPassItem]="" // la reponse est envoyée res.json({Error: false, ErrorMsg: "User data in DB", Data: reponse}) } },(erreur)=>{ this.LogAppliError("ApiGetMyData DB error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "DB Error", Data: null}) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getUserDetails() {\n return this.api.send('GET', 'user');\n }", "getUserInfo() {\n if (this.infos && this.infos.length > 0)\n return;\n this.client.request(\"GET\", \"users/current\").then((response) => {\n this.infos = response.body;\n this.connect();\n ...
[ "0.72843176", "0.7184237", "0.7150534", "0.71446437", "0.7125706", "0.7111886", "0.71086353", "0.70529735", "0.704693", "0.70374095", "0.7031903", "0.69895524", "0.6976439", "0.6976439", "0.6976439", "0.6976439", "0.69638866", "0.69608456", "0.69565874", "0.6942832", "0.69393...
0.7348648
0
Get des log de l'application
GetLog(Data, res, User, UserId){ this.LogAppliInfo("Call ApiAdmin GetLog, Skip data value: " + JSON.stringify(Data), User, UserId) // Si Data.LogInfoType = All alors tous les type const LogfInfoType = (Data.LogInfoType == "All") ? '.*' : Data.LogInfoType // Data.LogUser value const LogUser = Data.LogUser // Data.LogMessage value const LogMessage = Data.LogMessage let Query = {} // Si les date et heure sont vide if ((Data.LogDate == "") && (Data.LogHeure == "")){ Query = {$and:[{[this._MongoVar.LogAppliType]:{$regex:".*" + LogfInfoType + ".*"}},{[this._MongoVar.LogAppliUser]:{$regex:".*" + LogUser + ".*"}},{[this._MongoVar.LogAppliValeur]:{$regex:".*" + LogMessage + ".*"}}]} } else { if(Data.LogDate != ""){ let Ijour = parseInt(Data.LogDate.substring(0, 2)) let Imois = parseInt(Data.LogDate.substring(3,5))-1 let Iannee = parseInt(Data.LogDate.substring(6)) //let jour = Data.LogDate.substring(0, 2) //let mois = Data.LogDate.substring(3,5) //let annee = Data.LogDate.substring(6) let date = "" if (Data.LogHeure == ""){ let isoDate1 = new Date(Iannee, Imois, Ijour, 0, 0, 0, 0).toISOString() let isoDate2 = new Date(Iannee, Imois, Ijour, 23, 59, 59, 999).toISOString() date = { $gte:new Date(isoDate1), $lt:new Date(isoDate2) } //date = { $gte:new Date(annee+'-' + mois + '-' + jour +'T00:00:00.000Z'), $lt:new Date(annee+'-' + mois + '-' + jour +'T23:59:59.999Z') } } else { let Iheure = parseInt(Data.LogHeure.substring(0, 2)) let Iminute = parseInt(Data.LogHeure.substring(3)) let isoDate1 = new Date(Iannee, Imois, Ijour, Iheure, Iminute, 0, 0).toISOString() let isoDate2 = new Date(Iannee, Imois, Ijour, Iheure, Iminute, 59, 999).toISOString() date = { $gte:new Date(isoDate1), $lt:new Date(isoDate2) } //date = { $gte:new Date(annee+'-' + mois + '-' + jour +'T' + heure +':' + minute +':00.000Z'), $lt:new Date(annee+'-' + mois + '-' + jour +'T' + heure +':' + minute +':59.999Z') } } Query = {$and:[{[this._MongoVar.LogAppliType]:{$regex:".*" + LogfInfoType + ".*"}},{[this._MongoVar.LogAppliUser]:{$regex:".*" + LogUser + ".*"}},{[this._MongoVar.LogAppliValeur]:{$regex:".*" + LogMessage + ".*"}},{[this._MongoVar.LogAppliNow]:date}]} } else { Query = {$and:[{[this._MongoVar.LogAppliType]:{$regex:".*" + LogfInfoType + ".*"}},{[this._MongoVar.LogAppliUser]:{$regex:".*" + LogUser + ".*"}},{[this._MongoVar.LogAppliValeur]:{$regex:".*" + LogMessage + ".*"}}]} } } let mongocollection = this._MongoVar.LogAppliCollection const Projection = {} const Sort = {[this._MongoVar.LogAppliNow]: -1} this._Mongo.FindSortLimitSkipPromise(Query,Projection, Sort, 20, parseInt(Data.LogCursor), mongocollection).then((reponse)=>{ if(reponse.length == 0){ res.json({Error: false, ErrorMsg: "No Log in BD", Data: null}) } else { res.json({Error: false, ErrorMsg: "Log in DB", Data: reponse}) } },(erreur)=>{ this.LogAppliError("ApiAdminGetLog DB error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "DB Error", Data: ""}) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getLog() {\n\t\treturn this.log;\n\t}", "get log() {\n return this.config.log.logger\n }", "getClientLog() {\n\n }", "get log() {\n\t\treturn this._log;\n\t}", "getLog() {\n const { runtime, message, assert, expected } = this.opts;\n\n if (\n runtime === 'inabox' ||\n message.include...
[ "0.7300941", "0.6929417", "0.6873043", "0.686987", "0.6788415", "0.6558146", "0.65255064", "0.65127575", "0.6496837", "0.63672733", "0.62746775", "0.62260556", "0.6224749", "0.6206399", "0.6093701", "0.6072589", "0.6063998", "0.60445446", "0.6035631", "0.60073113", "0.5979771...
0.0
-1
Get des log de l'application
Backup(ApiData, res, GetJobSchedule, SetJobSchedule, User, UserId){ if (ApiData.Fct == "BackupNow"){ this.LogAppliInfo("Call ApiAdmin BackupNow", User, UserId) // Get GoogleKey this.GetDbConfig("BackupGoogle").then((reponse)=>{ res.json({Error: false, ErrorMsg: "", Data: "DB Backup Started, see log for end validation"}) let credentials = JSON.parse(reponse.GoogleKey) let folder = reponse.Folder let DbBackup = require('./DbBackup').DbBackup let MyDbBackup = new DbBackup(this._MongoVar.DbName,credentials,folder, this.LogAppliInfo.bind(this)) MyDbBackup.Backup().then((reponse)=>{ this.LogAppliInfo("Backup Now sucessfully ended", User, UserId) },(erreur)=>{ this.LogAppliError("Backup Now error: " + erreur, User, UserId) }) },(erreur)=>{ this.LogAppliError("BackupNow Get GoogleKey: "+ erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during BackupNow Get GoogleKey: "+ erreur, Data: ""}) }) } else if (ApiData.Fct == "RestoreNow"){ this.LogAppliInfo("Call ApiAdmin RestoreNow", User, UserId) // Get GoogleKey this.GetDbConfig("BackupGoogle").then((reponse)=>{ res.json({Error: false, ErrorMsg: "", Data: "DB Restore Started, see log for end validation and reload browser"}) let credentials = JSON.parse(reponse.GoogleKey) let folder = reponse.Folder let DbBackup = require('./DbBackup').DbBackup let MyDbBackup = new DbBackup(this._MongoVar.DbName, credentials,folder, this.LogAppliInfo.bind(this)) MyDbBackup.Restore().then((reponse)=>{ this.LogAppliInfo("Restore Now sucessfully ended", User, UserId) },(erreur)=>{ this.LogAppliError("Restore Now error: " + erreur, User, UserId) }) },(erreur)=>{ this.LogAppliError("RestoreNow Get GoogleKey: "+ erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during RestoreNow Get GoogleKey: "+ erreur, Data: ""}) }) } else if (ApiData.Fct == "GetSchedulerData"){ this.LogAppliInfo("Call ApiAdmin GetSchedulerData", User, UserId) let ApiReponse = new Object() ApiReponse.GoogleKeyExist = false ApiReponse.SchedulerData = null this.GetDbConfig("BackupGoogle").then((reponse)=>{ if((reponse.GoogleKey == "") || (reponse.Folder == "")){ res.json({Error: false, ErrorMsg: "Scheduler Data", Data: ApiReponse}) } else { // Get scheduler data let JobSchedule = GetJobSchedule() this.GetSchedulerData(JobSchedule).then((reponsedata)=>{ ApiReponse.GoogleKeyExist = true ApiReponse.SchedulerData =reponsedata res.json({Error: false, ErrorMsg: "Scheduler Data", Data: ApiReponse}) },(erreur)=>{ this.LogAppliError("GetSchedulerData error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during GetSchedulerData: "+ erreur, Data: ""}) }) } },(erreur)=>{ this.LogAppliError("GetSchedulerData error in get google key : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during GetSchedulerData, get google key: "+ erreur, Data: ""}) }) } else if (ApiData.Fct == "SaveConfig"){ this.LogAppliInfo("Call ApiAdmin SaveConfig", User, UserId) // Save nouvelle heure let BackupScheduler = new Object() BackupScheduler.JobScheduleHour = ApiData.Hour BackupScheduler.JobScheduleMinute = ApiData.Minute let JobSchedule = GetJobSchedule() if (JobSchedule == null){ BackupScheduler.JobScheduleStarted = false } else { BackupScheduler.JobScheduleStarted = true } let Data = new Object() Data.Value = BackupScheduler const Query = { [this._MongoVar.ConfigKey]: "BackupScheduler"} this._Mongo.UpdatePromise(Query, Data, this._MongoVar.ConfigCollection).then((reponse)=>{ if (reponse.matchedCount==1) { let JobSchedule = GetJobSchedule() if (JobSchedule != null){ let options = {minute: ApiData.Minute, hour: ApiData.Hour} JobSchedule.reschedule(options) SetJobSchedule(JobSchedule) } this.GetSchedulerData(JobSchedule).then((reponse)=>{ res.json({Error: false, ErrorMsg: "Scheduler Data", Data: reponse}) },(erreur)=>{ this.LogAppliError("SaveConfig error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during SaveConfig: "+ erreur, Data: ""}) }) } else { res.json({Error: true, ErrorMsg: "Upadte error : Key Value not found in config", Data: ""}) } },(erreur)=>{ this.LogAppliError("SaveConfig error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during SaveConfig: "+ erreur, Data: ""}) }) } else if (ApiData.Fct == "SchedulerSetStatus"){ this.LogAppliInfo("Call ApiAdmin SchedulerSetStatus", User, UserId) if (ApiData.Started){ let JobSchedule = GetJobSchedule() if (JobSchedule== null){ this.GetSchedulerData(JobSchedule).then((reponse)=>{ let SchedulerData = reponse var schedule = require('node-schedule') let options = {minute: SchedulerData.JobScheduleMinute, hour: SchedulerData.JobScheduleHour} // Get GoogleKey this.GetDbConfig("BackupGoogle").then((reponseGoogle)=>{ let credentials = JSON.parse(reponseGoogle.GoogleKey) let folder = reponseGoogle.Folder var me = this let JobSchedule = schedule.scheduleJob(options, function(){ let DbBackup = require('./DbBackup').DbBackup let MyDbBackup = new DbBackup(me._MongoVar.DbName,credentials,folder,me.LogAppliInfo.bind(me)) MyDbBackup.Backup().then((reponse)=>{ var now = new Date() me.LogAppliInfo(reponse, User, UserId) console.log(reponse + " " + now) },(erreur)=>{ me.LogAppliError("SchedulerSetStatus error : " + erreur, User, UserId) console.log("Error during SchedulerSetStatus: "+ erreur + " " + now) }) }) SetJobSchedule(JobSchedule) // Save nouveau status let BackupScheduler = new Object() BackupScheduler.JobScheduleHour = SchedulerData.JobScheduleHour BackupScheduler.JobScheduleMinute = SchedulerData.JobScheduleMinute BackupScheduler.JobScheduleStarted = ApiData.Started let DataS = new Object() DataS.Value = BackupScheduler const Query = { [this._MongoVar.ConfigKey]: "BackupScheduler",} this._Mongo.UpdatePromise(Query, DataS, this._MongoVar.ConfigCollection).then((reponseUpdateSatus)=>{ if (reponseUpdateSatus.matchedCount==1) { let JobSchedule = GetJobSchedule() BackupScheduler.JobScheduleNext = this.GetDateTimeString(JobSchedule.nextInvocation()) res.json({Error: false, ErrorMsg: "Scheduler Data", Data: BackupScheduler}) } else { this.LogAppliError("SaveConfig Status error : more than 1 entry in DB", User, UserId) res.json({Error: true, ErrorMsg: "Error during SaveConfig Status: more than 1 entry in DB", Data: ""}) } },(erreur)=>{ this.LogAppliError("SaveConfig Status error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during SaveConfig Status: "+ erreur, Data: ""}) }) },(erreur)=>{ this.LogAppliError("SchedulerSetStatus, get Google key error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during SchedulerSetStatus Get GoogleKey: "+ erreur, Data: ""}) }) },(erreur)=>{ this.LogAppliError("SchedulerSetStatus error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during SchedulerSetStatus: "+ erreur, Data: ""}) }) } else { this.LogAppliError("JobScheduler already exist", User, UserId) res.json({Error: true, ErrorMsg: "Error JobScheduler already exist", Data: ""}) } } else { let JobSchedule = GetJobSchedule() if ( JobSchedule == null){ res.json({Error: true, ErrorMsg: "Error no JobScheduler defined", Data: ""}) } else { JobSchedule.cancel() SetJobSchedule(null) // Save nouveau status this.GetSchedulerData(null).then((reponse)=>{ let BackupScheduler = new Object() BackupScheduler.JobScheduleHour = reponse.JobScheduleHour BackupScheduler.JobScheduleMinute = reponse.JobScheduleMinute BackupScheduler.JobScheduleStarted = ApiData.Started let DataS = new Object() DataS.Value = BackupScheduler const Query = { [this._MongoVar.ConfigKey]: "BackupScheduler"} this._Mongo.UpdatePromise(Query, DataS, this._MongoVar.ConfigCollection).then((reponse)=>{ if (reponse.matchedCount==1) { BackupScheduler.JobScheduleNext = "Scheduler not started" res.json({Error: false, ErrorMsg: "Scheduler Data", Data: BackupScheduler}) } else { this.LogAppliError("SaveConfig Status error : more than 1 entry in DB", User, UserId) res.json({Error: true, ErrorMsg: "Error during SaveConfig Status: more than 1 entry in DB", Data: ""}) } },(erreur)=>{ this.LogAppliError("SaveConfig Status error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during SaveConfig Status: "+ erreur, Data: ""}) }) },(erreur)=>{ this.LogAppliError("SchedulerSetStatus error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during SchedulerSetStatus: "+ erreur, Data: ""}) }) } } } else if (ApiData.Fct == "SaveGoogleKey"){ this.LogAppliInfo("Call ApiAdmin SaveGoogleKey", User, UserId) // Save Google Key let BackupGoogle = new Object() BackupGoogle.GoogleKey = ApiData.key BackupGoogle.Folder = ApiData.folder let Data = new Object() Data.Value = BackupGoogle const Query = { [this._MongoVar.ConfigKey]: "BackupGoogle"} this._Mongo.UpdatePromise(Query, Data, this._MongoVar.ConfigCollection).then((reponse)=>{ if (reponse.matchedCount==1) { res.json({Error: false, ErrorMsg: "SaveGoogleKey Data", Data: null}) } else { this.LogAppliError("Upadte error : Key Value not found in config", User, UserId) res.json({Error: true, ErrorMsg: "Upadte error : Key Value not found in config", Data: ""}) } },(erreur)=>{ this.LogAppliError("SaveGoogleKey error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during SaveGoogleKey: "+ erreur, Data: ""}) }) } else { this.LogAppliError("Backup: ApiData.Fct not found= "+ ApiData.Fct, User, UserId) res.json({Error: true, ErrorMsg: "Error during Backup: ApiData.Fct not found= "+ ApiData.Fct, Data: ""}) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getLog() {\n\t\treturn this.log;\n\t}", "get log() {\n return this.config.log.logger\n }", "getClientLog() {\n\n }", "get log() {\n\t\treturn this._log;\n\t}", "getLog() {\n const { runtime, message, assert, expected } = this.opts;\n\n if (\n runtime === 'inabox' ||\n message.include...
[ "0.7302095", "0.69298357", "0.6873926", "0.687113", "0.678862", "0.655895", "0.65263534", "0.6511791", "0.649703", "0.6369022", "0.6273575", "0.6227701", "0.62268627", "0.6204239", "0.6093538", "0.6074416", "0.60634863", "0.60444003", "0.6035557", "0.6006507", "0.5980677", ...
0.0
-1