query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
normalizeResponse converts any nonjson response to a json error Parses the JSON response and places it either in res.error or res.data.
_normalizeResponse(res){ let ct = res.headers.get('Content-Type'); if( ct != 'application/json' ){ return res.text().then( txt => { res.error = {error: `unexpected response type ${ct}`, body:txt} return res; }).catch( ex => { res.error = {error: `unexpected response type ${ct...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalizeResponse(data, error){\n\treturn {\n\t\tdata: data,\n\t\terror: error\n\t};\n}", "parseAndHandleErrors(response) {\n if (response.ok) {\n return response.json()\n }\n return response.json()\n .then((error) => {\n throw new Error(JSON.str...
[ "0.75286305", "0.6918869", "0.68932235", "0.66545326", "0.6632743", "0.6607988", "0.65563846", "0.65563846", "0.65563846", "0.65563846", "0.65563846", "0.6553241", "0.6553241", "0.65520674", "0.65366155", "0.65366155", "0.6515111", "0.6450267", "0.6445085", "0.6445085", "0.64...
0.78544027
0
maybeDeauthenticate checks for 403/401 responses and triggers the client to deauth before passing on the response unchanged
_maybeDeauthenticate(res){ if( res.status == 403 || res.status == 401 ){ this.deauthenticate(); } return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleInvalidCredentialsOrExpiredToken(response, deferred) {\n /**\n * Remove auth information,\n * deferred request\n * go to login page\n */\n deferred.reject(response.data);\n logoutUser();\n }", "function isUnauthorizedResponse(response) {\n return response.status === 40...
[ "0.6668545", "0.6431742", "0.63431036", "0.62713736", "0.62713736", "0.62713736", "0.62713736", "0.62713736", "0.62713736", "0.62713736", "0.62713736", "0.62713736", "0.62713736", "0.62713736", "0.62713736", "0.62713736", "0.62713736", "0.62713736", "0.62529975", "0.609006", ...
0.85244846
0
maybeReject converts error responses to rejections or returns the response unchanged
_maybeReject(emitter, res){ if( res.error ){ let err = res.error.error || res.error; emitter.emit('error', err); return Promise.reject(err); } return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reject(req, res) \n{\n\tvar method = req.method;\n\tvar url = req.url;\n\tvar da = new Date();\n\tvar d = da.toUTCString();\n\tvar i = findTranslationRequestIndex(req.params.id); // need to adapt to the real id!\n\tif (i != null)\n\t{\n\t\ttranslationRequests[i].translationRequest.status =\t\t\t\t\t\"reje...
[ "0.62621266", "0.6132926", "0.6015835", "0.5897163", "0.5847497", "0.5847497", "0.5847497", "0.5847497", "0.5847497", "0.5847497", "0.5847497", "0.5847497", "0.5847497", "0.5847497", "0.5847497", "0.5771587", "0.5725501", "0.56348675", "0.56348675", "0.55574375", "0.55430263"...
0.76687646
0
resize main menu item boxes
function resizeMainMenuItems(currentSize) { if (currentSize == "large") { $(".mainMenu a span").each(function() { spanWith = $(this).width(); if (spanWith > 104) { $(this).parent().css("width", spanWith); } else { $(this).parent().removeAttr("style"); } }); } else { $(".mainMenu a").removeAt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "add_menu(){\n mainPanel.resize(800,600);\n }", "function adjustMenuResize(){\n $('#menuOpenCloseBTN').css('top', currentHeight/2-$('#menuOpenCloseBTN').height()/2+'px');\n $('#menuItems').css('top', currentHeight/2-$('#menuItems').height()/2+'px');\n }", "function resizeMenu(){\n ...
[ "0.7250013", "0.7123755", "0.68946856", "0.6830661", "0.6634908", "0.65926194", "0.65776", "0.65114385", "0.64793414", "0.6406143", "0.63621825", "0.6360911", "0.6360321", "0.6326082", "0.6324228", "0.631926", "0.62919533", "0.62904495", "0.6285495", "0.6281256", "0.6269272",...
0.74401695
0
user input subract balance
function deposit(userInput, balance);{ return userInput + account.balance }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "balance(){}", "function balanceToReceive(){\r\n \tvar toTamount=$(\"#grandAmt\").val();\r\n \tif(toTamount.length === 0 || toTamount === '' || toTamount === null){\r\n \t\ttoTamount=\"0.00\";\t\t\t\r\n \t}\r\n \tvar receivdAmount=$(\"#amountreceiv\").val();\r\n \tif(receivdAmount.length =...
[ "0.68381065", "0.66545004", "0.65232927", "0.6507052", "0.63435704", "0.63407946", "0.63362783", "0.6317252", "0.6316273", "0.6315165", "0.62846786", "0.62767756", "0.62752134", "0.62707585", "0.62248385", "0.62209105", "0.6219704", "0.62189454", "0.62083596", "0.61976993", "...
0.74803877
0
here we are defining the filteredList(), which will contain posts that contain that keyword and this same filteredList will be used in the html file
filteredList() { //this is written in a long-hand method //the postList can use the filter method to filter out posts that meet a certain condition //make sure to include post as a parameter of the filter method return this.postList.filter((post) => { //th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "filterlist(){\n\n\t\t\t// filterlist object\n\t\t\t// returns a filter funtion over the constructed post\n\t\t\treturn this.postlist.filter((post)=>{\n\n\t\t\t\t// of an inculded array of title-toLowerCase matching any keyword-toLowerCase returned\n\t\t\t\treturn post.title.toLowerCase().includes(this.keyword.toLo...
[ "0.8053499", "0.8053499", "0.78441036", "0.7481411", "0.740035", "0.7200774", "0.7179797", "0.6831636", "0.6758256", "0.6727886", "0.6707972", "0.6636875", "0.648807", "0.6480748", "0.6476514", "0.6467261", "0.6440696", "0.6435758", "0.63288635", "0.63193965", "0.6317866", ...
0.84256154
0
Returns a url to the transcoded file
function transcodeFile (source) { // More simulation shenanigans console.log('If real transcoding were going on, you bet it would be here') return 'https://www.youtube.com/watch?v=dQw4w9WgXcQ' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get file() {\n let uri = this.config[this.language]\n return uri\n }", "function makeUrl(file) {\n return new Promise((resolve, reject) => {\n\n let reader = new FileReader();//este metodo parsea el archivo seleccionado\n\n reader.onload = () => {\n resolve(reader.result)//promesa exit...
[ "0.63136613", "0.62146014", "0.6175656", "0.61068755", "0.6058139", "0.6020993", "0.58843887", "0.582977", "0.57840014", "0.5781814", "0.57396317", "0.5659421", "0.5644737", "0.56413317", "0.5628595", "0.56194156", "0.55748135", "0.5561416", "0.553393", "0.5506511", "0.548472...
0.6783901
0
[END basic_write] initApp handles setting up UI event listeners and registering Firebase auth listeners: firebase.auth().onAuthStateChanged: This listener is called when the user is signed in or out, and that is where we update the UI. firebase.auth().getRedirectResult(): This promise completes when the user gets back ...
function initApp() { // Result from Redirect auth flow. // [START getidptoken] firebase.auth().getRedirectResult().then(function (result) { if (result.credential) { // This gives you a Google Access Token. You can use it to access the Google API. var token = result.credential...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initApp() {\r\n // [START authstatelistener]\r\n firebase.auth().onAuthStateChanged(function(user) {\r\n if (user) {\r\n // User is signed in.\r\n\t\t Redirect_home();\r\n }\r\n });\r\n }", "function initApp() {\n // Listen for auth state changes.\n firebase.a...
[ "0.80407417", "0.7856708", "0.7723237", "0.77130574", "0.76067907", "0.75479573", "0.74901426", "0.74592346", "0.7444861", "0.7385148", "0.7325671", "0.73079383", "0.72795093", "0.7247456", "0.7194766", "0.7131425", "0.7100241", "0.70106125", "0.70000947", "0.69828975", "0.69...
0.7992752
1
change the index of choices into alphabet
function getChoice(index){ var char="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; var mcChoice=""; if(index<26) mcChoice+=char[index]; else{ mcChoice+=getChoice(parseInt(index/26)-1)+getChoice(index%26); } return mcChoice; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getChoiceLabel(index){\n //if the index is between 0 and 25, simply return the proper letter\n if(index < this.choiceOrder.length){\n return this.choiceOrder[index];\n }\n //if the index is greater than 25, return a combination of letters (ex. AA, BB, etc)\n let repititions = Math.floor(index /...
[ "0.7569765", "0.68340623", "0.6611102", "0.6409666", "0.63614243", "0.60865957", "0.605977", "0.60509735", "0.6007461", "0.59806657", "0.59394616", "0.59327626", "0.5931384", "0.5918209", "0.591248", "0.59043926", "0.5900496", "0.58999205", "0.5878105", "0.587702", "0.587702"...
0.74265933
1
read the json file and display the questions into the DOM with id==domid
function readFile(domid){ fullmark=0; numOfQuestion=data.length; dom=domid; currentQ=0; score=0; $("#"+dom).empty(); $.each(data, function(i, v){ var newQ="<div class='Question card' style='display:none;' id="+i+">"; if(v['imageUrl']) newQ+="<img class='questi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_data() {\r\n fetch(\"./medium.json\")\r\n .then(function (resp) {\r\n return resp.json();\r\n })\r\n .then(function (data) {\r\n console.log(data.questions[i]);\r\n console.log(data.options[j]);\r\n var a = data.options[i];\r\n for(j = 0; j < 4; j++) {\r\n \r...
[ "0.70928824", "0.6562294", "0.64692694", "0.6465563", "0.64637756", "0.6399036", "0.6378923", "0.63591003", "0.6290209", "0.62901515", "0.6280089", "0.6275097", "0.62367314", "0.6235535", "0.61568063", "0.6148765", "0.61201143", "0.6116903", "0.6112094", "0.607363", "0.605881...
0.70048225
1
Diese private Methode sortiert die Monatslistensammlung (this._monatslisten) absteigend nach dem Jahr der Monatslisten und innerhalb des Jahres absteigend nach dem Monat der Monatslisten.
_monatslisten_sortieren() { this._monatslisten.sort((monatsliste_a, monatsliste_b) => { if (monatsliste_a.jahr() < monatsliste_b.jahr()) { return 1; } else if (monatsliste_a.jahr() > monatsliste_b.jahr()) { return -1; } else { i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortMonsters () {\n monstersArray.map((monster) => {\n monster.initiative = parseInt(document.getElementById(monster.monsterName).value)\n });\n \n monstersArray.sort(mySortFunction);\n setMonstersArray(monstersArray);\n }", "function sortMoments() {\n var mom...
[ "0.607453", "0.5796901", "0.57079947", "0.5693619", "0.5555316", "0.5534985", "0.5519329", "0.54946136", "0.5468532", "0.5458265", "0.5423899", "0.5366929", "0.5345373", "0.5333238", "0.5330739", "0.53197974", "0.529842", "0.5261128", "0.52485776", "0.5244946", "0.5227071", ...
0.87175137
0
Diese private Methode entfernt eine bereits bestehende Monatslistensammlung, wenn vorhanden.
_entfernen() { let monatslistensammlung = document.querySelector("#monatslisten"); if (monatslistensammlung !== null) { monatslistensammlung.remove(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_monatslisten_sortieren() {\n this._monatslisten.sort((monatsliste_a, monatsliste_b) => {\n if (monatsliste_a.jahr() < monatsliste_b.jahr()) {\n return 1;\n } else if (monatsliste_a.jahr() > monatsliste_b.jahr()) {\n return -1;\n } else {\n ...
[ "0.56848943", "0.53467333", "0.521011", "0.5167006", "0.50395155", "0.49962372", "0.4951478", "0.49255338", "0.492073", "0.49165273", "0.49158987", "0.49158987", "0.4914019", "0.48693743", "0.4855898", "0.48189956", "0.48185113", "0.47989756", "0.47867545", "0.47710723", "0.4...
0.53818095
1
Now every line needs at least one operator (as of current implementation). We use this fact to parse the line.
function getOperator(line) { //console.log(line); let op = OpSymbol.findOperators(line); return op; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseOperator() {\n if (this.peek().name == 'block-start') {\n return this.parseBlock();\n } else {\n return [this.parsePrimOp()];\n }\n }", "function maybeoperator(type){\n if (type == \"operator\") cont(expression);\n else if (type == \"(\") cont(pushlex(\")\"), expression, commas...
[ "0.66652614", "0.62309045", "0.6158894", "0.6048018", "0.60399127", "0.597593", "0.5972487", "0.5971307", "0.59472835", "0.5942514", "0.5923725", "0.59115905", "0.58082527", "0.5800963", "0.57860667", "0.57788944", "0.5765699", "0.5746114", "0.57420456", "0.573846", "0.571986...
0.6887012
0
Function to delete the current user and redirect to login
async function deleteUserAndRedirectToLogin() { await model.deleteUser(); browserHistory.push("/login"); const userPath = `gallang/${currentUser.uid}`; const userRef = DatabaseService.ref(userPath); if (userRef) { userRef.remove(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function logout(){\n localStorage.removeItem('user');\n window.location.href = \"/login\";\n }", "function deleteProfile() {\n UserService\n .deleteUser(userId)\n .success(function () {\n $location.url(\"/login\");\n })\n ...
[ "0.7557144", "0.73993295", "0.7291399", "0.7284257", "0.7262301", "0.72066164", "0.71763694", "0.7159502", "0.71439564", "0.71433824", "0.71407", "0.7140032", "0.7137158", "0.71197486", "0.71063536", "0.710635", "0.7084683", "0.70818657", "0.7072922", "0.70654875", "0.7065258...
0.82741135
0
This function gets called when the Student link in the nav bar is clicked. It shows all the records of appointments
function showAppointments() { //console.log('Show all appointments'); //Constant of the url const url = baseUrl_API + '/api/v1/appointments'; fetch(url, { method: "GET", headers: {"Authorization": "Bearer " + jwt} }).then(checkFetch) //check for errors .then(response => respons...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllAppointments() {\n getCurrentUser()\n $http.get('/api/calendar').then(\n function(appointments){\n if ($scope.events.length == 0){ //if the calendar is loaded for the first time\n for(let i = 0; i < appointments.data.length; i++){ //iterate through the ap...
[ "0.6454781", "0.6224674", "0.6127792", "0.61085707", "0.6044667", "0.5976083", "0.5972655", "0.59463865", "0.5924166", "0.5915344", "0.58572304", "0.5851896", "0.58469", "0.5831528", "0.5817663", "0.5800973", "0.5791047", "0.57512975", "0.5726227", "0.5724519", "0.57220334", ...
0.67557025
0
Edit Appointment This function gets called when a user clicks on the Edit button to make items editable
function editAppointment(appointment_id) { //Reset all items resetAppointment(); //select all divs whose ids begin with 'student' and end with the current id and make them editable $("div[id^='appointment-edit'][appointment_id$='" + appointment_id + "']").each(function () { $(this).attr('conten...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function enableAppointmentEdit(event, modalContainerName){\n\tvar inputContainer = document.getElementById(modalContainerName);\n\tvar modalContainer = document.getElementById(\"viewAppointmentModalContainer\");\n\tvar modalTitle = modalContainer.querySelector(\"#viewAppointmentTitle\");\n\tvar submitBtn = modalCo...
[ "0.6792899", "0.67789173", "0.6764775", "0.6669289", "0.66623473", "0.6652145", "0.66335183", "0.6630423", "0.6576374", "0.65609306", "0.654175", "0.6509292", "0.64748114", "0.6467662", "0.6466179", "0.64462185", "0.64403117", "0.64403117", "0.64403117", "0.64403117", "0.6440...
0.7996455
0
This function gets called when the user clicks on the Cancel button to cancel updating an appointment
function cancelUpdateAppointment(appointment_id) { showAppointments(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cancelAppointment(){\n\n\t}", "function cancel() {\n // before doing the delete request, switching to DELETING mode\n transition(DELETING, true);\n props.cancelInterview(props.id)\n // if cancelInterview was successful, showing empty appointment\n .then(() => transition(EMPTY))\n // else,...
[ "0.8025672", "0.7435114", "0.7314241", "0.7258648", "0.6972681", "0.69659066", "0.6932381", "0.69151396", "0.68961936", "0.6820395", "0.6785958", "0.67824185", "0.674903", "0.67399466", "0.6702198", "0.66859347", "0.6680781", "0.66796494", "0.6668843", "0.66627884", "0.665269...
0.85750353
0
Callback function that removes an appointment from the system. It gets called by the deleteAppointment function.
function removeAppointment(appointment_id) { //console.log('remove the appointment which id is ' + appointment_id); let url = baseUrl_API + '/api/v1/appointments/' + appointment_id; fetch(url, { method: "DELETE", headers: {"Authorization": "Bearer" + jwt} }) .then(checkFetch) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cancelAppointment(){\n\n\t}", "function deleteAppointment(id) {\n\t\tvar url = baseURL + \"/appointment/\" + id; // URL pattern of delete service\n\t\tvar settings = {\n\t\t\ttype : \"DELETE\"\n\t\t}; \n\t\t// options to the $.ajax(...) function call\n\t\t$.ajax(url, settings);\n\t} // end function", "deleteAp...
[ "0.6824148", "0.68194693", "0.679035", "0.66971415", "0.66502833", "0.6611389", "0.6575717", "0.65591824", "0.6395976", "0.6394917", "0.63431627", "0.62887937", "0.62500733", "0.62117857", "0.61861676", "0.61129856", "0.5910657", "0.5905238", "0.5902696", "0.58942646", "0.581...
0.69623655
0
Add Appointment This function shows the row containing editable fields to accept user inputs. It gets called when a user clicks on the Add New Appointment link
function showAddRow() { resetAppointment(); //Reset all items $('div#appointment-add-row').show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addAppointment() {\n // Evaluating all inputs\n if (!checkSelected()) {\n return;\n }\n var select = document.getElementById(\"selectAppointments\");\n var indexAvailableAppointment = getIndexByID(Number(select.value), availableAppointments);\n var currentBooked = bookedAppointmen...
[ "0.6903153", "0.6077426", "0.6067115", "0.605289", "0.5978527", "0.59695953", "0.595839", "0.59318215", "0.59180474", "0.59094983", "0.58937716", "0.5891958", "0.5890985", "0.5886082", "0.58664596", "0.5846976", "0.582944", "0.58258504", "0.5825332", "0.581728", "0.5804105", ...
0.69383085
0
Reset appointment section Reset appointment section: remove editable features, hide update and cancel buttons, and display edit and delete buttons
function resetAppointment() { // Remove the editable feature from all divs $("div[id^='appointment-edit-']").each(function () { $(this).removeAttr('contenteditable').removeClass('appointment-editable'); }); // Hide all the update and cancel buttons and display all the edit and delete buttons ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editingReset () {\n var typeKey;\n if (titleDivs[workID]) {\n for (typeKey in titleDivs[workID]) {\n titleDivs[workID][typeKey].style.display = 'none';\n }\n }\n if (mdps[workID]) {\n for (typeKey in titleDivs[workID]) {\n mdps[workID][typeKey].style....
[ "0.6196073", "0.6092107", "0.6055849", "0.6017214", "0.5976926", "0.59682626", "0.59678185", "0.5965548", "0.59610367", "0.5957643", "0.5955473", "0.58999693", "0.589262", "0.5885712", "0.5877142", "0.5860169", "0.5848803", "0.5847152", "0.58150727", "0.5809322", "0.57972133"...
0.822707
0
will get NaN error Here, I've created a simple function add that will add 2 numbers a and b. If, we execute the function without passing the second param, we get NaN. Before, defalt params were introduced we've to do something like this
function add (a, b) { b = typeof b !== 'undefined' ? b : 2; return a * b; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addNumbers(a, b) {\n if (isNaN(a) || isNaN(b)) {\n throw \"One of the parameters is not a number\";\n } else {\n return a + b;\n }\n}", "function add (a, b) {\n if (isNaN(a) || isNaN(b)) {\n console.log('NaN');\n } else {\n const sum = (parseInt(a) + parseInt(b));\n con...
[ "0.80274", "0.7903578", "0.77610075", "0.77339697", "0.7721873", "0.7694548", "0.76747245", "0.7668915", "0.76675147", "0.7629172", "0.7615453", "0.7593257", "0.75896204", "0.7550507", "0.75469553", "0.75417155", "0.75303954", "0.7525689", "0.7495826", "0.7488381", "0.7482515...
0.80591565
0
Focus the tree element at `index` if it starts with `char`
function _focusIfStartsWith(char, index) { const data = _uiNodeData.get(_liveNodeList[index]); if (data.shortName.startsWith(char)) { event.preventDefault(); _focusTreeElement(index); return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveNextChar(node, bIndex) {\n const wordRe = /[a-zA-Z]/\n const text = node.node.innerText\n const leftMin = h.options.leftMin\n const rightMin = h.options.rightMin\n let move = false\n\n function walkLeft(index) {\n if(!wordRe.test(text[index])) {\n move = true\n }\n ...
[ "0.61719793", "0.60558647", "0.60183805", "0.57945734", "0.57726336", "0.57726336", "0.57726336", "0.57232225", "0.5714204", "0.56348354", "0.56348354", "0.56348354", "0.5619257", "0.55677086", "0.55677086", "0.55677086", "0.55659246", "0.556396", "0.5526723", "0.5492657", "0...
0.7692376
0
Handle create edit window
function createEditWindow() { //Create new Window editWindow = new BrowserWindow({ title: "Plan bearbeiten", webPreferences: { nodeIntegration: true, enableRemoteModule: true } }); //Load html into window editWindow.loadFile(path.join(__dirname, 'ass...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "configureEdit () {}", "function Edit() {}", "handlerEdit() {\n\n }", "function handleNewButton() {\n\tif (true) {\n\t\tnewFile();\n\t\teditor.setValue('New plain text file...');\n\t\teditor.setCursor({line: 0, ch: 0});\n\t\teditor.setSelection({line: 0, ch: 0}, {line: 1, ch: 0});\t// Select line\n\t\tedit...
[ "0.6822639", "0.6741352", "0.66930497", "0.66764706", "0.654489", "0.65161854", "0.64571804", "0.645418", "0.635567", "0.63376546", "0.6324576", "0.63161224", "0.6281242", "0.6279507", "0.62684304", "0.62681645", "0.6240731", "0.62398654", "0.6228094", "0.618881", "0.6185233"...
0.6773119
1
createStopsArray: takes in allstops1004 and adds proper stops to stopsForAnalysis logic: if user checked the right box and the JSON contains 1 for that box, include in analysis.
function createStopsArray(features) { for (i = 0; i < features.length; i++) { if (otherIsChecked && features[i].properties.StBusStop == 1) { // adds the 'other' bus stops to the analysis object stopsForAnalysis.features.push(features[i]); } else if (mIsChecked && features[i].properties.M == 1) { // ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildBusStop1(){\r\n for(var i=0; i<length; i++){\r\n allData[i] = new busStop(stopName[i], stopId[i], stopLat[i], stopLon[i], 0);\r\n }\r\n }", "function buildBusStop2(){\r\n for(var i=0; i<length; i++){\r\n allData[i] = new busStop(...
[ "0.57935154", "0.55979735", "0.5472456", "0.54436874", "0.5429434", "0.5341225", "0.5327611", "0.5266147", "0.5201873", "0.51116186", "0.5039898", "0.50035775", "0.4980763", "0.49675268", "0.49566317", "0.49436927", "0.4874253", "0.4858751", "0.48565722", "0.48545313", "0.484...
0.7222442
0
Handler for Light Rail Data toggle sets defaults for when the toggle is switched on and off
function lightRailToggleHandler() { // when the toggle is switched execute if statement $("#lrCheck").click(function() { // data toggle is turned on if (document.getElementById("lrCheck").checked) { // default upon toggling data to "on" is that there is no filtering // all checkboxes will ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onToggle(){\n if ( value ) setOff()\n else setOn()\n }", "function attachOnOffHandlers() {\n\t$(\"#on\").click(function() {\n\t\tsetSelected(\"threeDModeLi\", \"on\");\n\t});\n\t$(\"#off\").click(function() {\n\t\tsetSelected(\"threeDModeLi\", \"off\");\n\t});\n}", "_toggle(...
[ "0.68913305", "0.617532", "0.61561364", "0.61503035", "0.61413336", "0.610797", "0.6063428", "0.6057796", "0.5999119", "0.5993311", "0.59776646", "0.59715694", "0.59417593", "0.591404", "0.58931047", "0.5889026", "0.5858931", "0.585628", "0.5854024", "0.58485353", "0.58465296...
0.6766323
1
Handler for Streetside Bus toggle sets defaults for when the toggle is switched on and off
function streetToggleHandler() { // executes the if statement upon toggle click $('#streetBusCheck').click(function() { // checks to see if toggle is checked if (document.getElementById('streetBusCheck').checked) { // turns on all filters as default $("#keyBusCheck").prop('checked', true)....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onToggle(){\n if ( value ) setOff()\n else setOn()\n }", "flipSwitch(){\n check if the value is on \n if(this.switchState === \"on\") {\n // if its on do switch off\n this.switchState = \"off\";\n } else {\n // but if its ...
[ "0.71371496", "0.6674394", "0.65636426", "0.64969283", "0.64958405", "0.6486619", "0.64316666", "0.63298404", "0.63105303", "0.62834674", "0.62688357", "0.6237752", "0.6214659", "0.6182636", "0.61308396", "0.61042595", "0.6097035", "0.60965496", "0.6092293", "0.607957", "0.60...
0.6724146
1
Takes an array of unsorted events, and returns a sorted array containing the same events, but with an additional style property. These styles will position the events similarly to Google Calendar. The algorithm will start by sorting the array, and then iterating over it. Starting at the first event, each of its sibling...
function getStyledEvents(_ref7) { var unsortedEvents = _ref7.events, startAccessor = _ref7.startAccessor, endAccessor = _ref7.endAccessor, min = _ref7.min, totalMin = _ref7.totalMin, step = _ref7.step; var OVERLAP_MULTIPLIER = 0.3; var events = sort(unsortedEvents, { startAccessor: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "styleEvents() {\n const events = Array.from(this.container.querySelectorAll(this.props.eventSelector));\n const markers = Array.from(this.container.querySelectorAll(this.props.markerSelector));\n\n const containerWidth = this.container.offsetWidth;\n const containerHeight = this.container.offsetHeight;...
[ "0.6291872", "0.59511626", "0.59079593", "0.57734627", "0.5472353", "0.5377758", "0.5377758", "0.5336421", "0.5336421", "0.5336421", "0.5336421", "0.53301257", "0.52156234", "0.52100813", "0.5203161", "0.5123655", "0.50641626", "0.50194675", "0.49778038", "0.49479884", "0.491...
0.6956392
1
return the first day of the week from the locale data. Defaults to 'world' territory if no territory is derivable from CLDR. Failing to use CLDR supplemental (not loaded?), revert to the original method of getting first day of week.
function firstOfWeek(culture) { try { var days = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat']; var cldr = locale(culture).cldr; var territory = cldr.attributes.territory; var weekData = cldr.get('supplemental').weekData; var firstDay = weekData.firstDay[territory || '001']; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firstOfWeek(culture) {\n try {\n var days = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];\n var cldr = locale(culture).cldr;\n var territory = cldr.attributes.territory;\n var weekData = cldr.get('supplemental').weekData;\n var firstDay = weekData.firstDay[territory || '00...
[ "0.8072399", "0.747076", "0.747076", "0.747076", "0.73458356", "0.73458356", "0.73458356", "0.73458356", "0.73458356", "0.73458356", "0.73458356", "0.73458356", "0.7330349", "0.7328464", "0.73282623", "0.73282623", "0.721784", "0.7006302", "0.6418565", "0.63601357", "0.628549...
0.8059393
1
Lists all Austrian districts
async getDistrictsInAustria() { const sparqlQuery = `SELECT ?item ?itemLabel WHERE { ?item p:P31 ?verwaltungseinheit. ?verwaltungseinheit ps:P31 wd:Q871419. FILTER NOT EXISTS { ?verwaltungseinheit pq:P582 ?x } FILTER NOT EXISTS { ?item wdt:P31 wd:Q667509 } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllDistrict($id_state)\n\t{\n\t\t$(\"#district\").html('<option value=\"0\">--selecciona--</option>');\n\t\t$(\"#neighborhood\").html('<option value=\"0\">--selecciona--</option>');\n\t\t$(\"#postalcode\").val(\"\");\n\n\t\t$.ajax({\n\t\t\turl : $basePath + \"/iofractal/addresses/getalldistrict\",\n\t\...
[ "0.66234976", "0.66234976", "0.6194841", "0.61448574", "0.61448574", "0.6010978", "0.596822", "0.59426826", "0.59426826", "0.59379125", "0.5759038", "0.575706", "0.57463413", "0.5741353", "0.57217205", "0.5703672", "0.56736994", "0.5671928", "0.5644311", "0.5623998", "0.56162...
0.6896046
0
gets newsheadline by date from the NewsHeadlines table Returns list of NewsHeadline
async function getNewsFromDB(date){ return new Promise(async resolve => { const query = 'select * from NewsHeadlines where publication_date="' + date + '";'; await connection.query(query, function(err, rows, fields) { if(err){ console.log("An error ocurred performing the query."); console.log(err);...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getHeadlines(source){\n const url= 'https://newsapi.org/v2/top-headlines?' +\n source + 'apiKey=acd435a3c73c4530a3dc729d9a356729';\n\n fetch(url).then(function(response) {\n if(response.ok) {\n return response.json();\n }else {\n console.log(\"There was a problem.\");\n ...
[ "0.62195534", "0.5912856", "0.5758789", "0.5711281", "0.5586876", "0.5544879", "0.5517655", "0.5445404", "0.5430572", "0.53756565", "0.536639", "0.5270459", "0.5261735", "0.5205695", "0.51946205", "0.51043", "0.50954676", "0.50788575", "0.5063447", "0.5055428", "0.50471985", ...
0.66102034
0
gets preferences of all employees Returns an object (key preference id, value list of Employees)
async function getPreferenceToEmployeeListDB(){ return new Promise(async resolve => { const query = 'select * from EmployeeNewsPreferences;'; await connection.query(query, function(err, rows2, fields) { if(err){ console.log("An error ocurred performing the query."); console.log(err); return; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAll(){\n return employeesData.employees;\n}", "findAllEmployees() {\n return this.connection.query(\n \"SELECT employee.id, employee.first_name, employee.last_name, role.title, department.name AS department, role.salary, CONCAT(manager.first_name, ' ', manager.last_name) AS manager FROM em...
[ "0.60369456", "0.5817898", "0.5774796", "0.5691308", "0.5624137", "0.56122607", "0.5553557", "0.5547209", "0.5496762", "0.54737353", "0.54590636", "0.5408768", "0.5404038", "0.53787893", "0.53514266", "0.5348438", "0.5348306", "0.5288687", "0.52737427", "0.5265966", "0.526530...
0.70190585
0
3. Permutation nPk = n! / (nk)!
function permutation(n , k){ const numerator = factorial(n) const denominator = factorial((n -k)) const result = numerator / denominator console.log(result) return result }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nPermutations(n) {\n return xs => {\n // implement and use state monad to store common state\n let permutations = [];\n\n (function permute(n, xs, permutation = []) {\n forEach((x, i) => {\n // removing the current element would remove same element duplication in permutation\n ...
[ "0.6919649", "0.6665329", "0.6530647", "0.64385134", "0.638456", "0.635", "0.63008773", "0.62683", "0.62140465", "0.6197716", "0.6186062", "0.6174696", "0.6161195", "0.6129929", "0.6045362", "0.6010756", "0.59851176", "0.59791905", "0.59700805", "0.5958718", "0.5957047", "0...
0.6982792
0
mark user as trusted by userid as id find user by id and add isTrusted attribute to item
mark (id) { var userItem = this.items.find((element) => { return id === element.id; }); userItem.isTrusted = !userItem.isTrusted; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set trusted(newValue) {\n const oldValue = this.trusted;\n if (oldValue === newValue) {\n return;\n }\n this.modelDB.setValue('trusted', newValue);\n }", "function updateUserPermission(id) {\n if (id) {\n var node = getNode(id);\n if ...
[ "0.5821452", "0.5606267", "0.559363", "0.54914594", "0.532418", "0.5296986", "0.52529985", "0.5219041", "0.5169474", "0.51185095", "0.5065547", "0.5065007", "0.50543565", "0.5048848", "0.50395787", "0.50317144", "0.5021702", "0.50057906", "0.50042254", "0.49653262", "0.495484...
0.8193786
0
display userlist and serach box and sorting filter components
render () { return ( <div> <h1>User List UI</h1> <div className="headerBar"> <SearchInput refreshList={this.refreshList} searchList={this.searchList} /> <Sort s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showUserList() {\n userListContainer.empty();\n userList.forEach(function (element) {\n if (element.email == user) {\n return;\n }\n var el = rowTemplateEl.clone();\n el.removeClass(\"hidden\");\n el.find(\"._user_email\")...
[ "0.6937457", "0.6593714", "0.64287335", "0.6379147", "0.63727206", "0.6364865", "0.6356654", "0.6355702", "0.63254076", "0.62951326", "0.6251064", "0.6218585", "0.62098247", "0.6207519", "0.6193752", "0.61747724", "0.6169633", "0.6155899", "0.6149328", "0.61316717", "0.612614...
0.66163486
1
Initialise Stripe.js with your publishable key. You can find your key in the Dashboard:
componentDidMount() { this.stripe = window.Stripe('pk_test_mY3NLC56g1V6hPgEWvGkzxlW', { betas: ['checkout_beta_4'], }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function initialize() {\n const response = await fetch(DOMAIN + '/create-payment-intent', {\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify({\n currency: 'eur',\n paymentMethodType: 'ideal,sofort,giropay',\n }),\n });\n const {clientSecret} =...
[ "0.63055164", "0.62223387", "0.61914843", "0.6102369", "0.59905154", "0.58859664", "0.58324695", "0.58324695", "0.58324695", "0.58324695", "0.58324695", "0.58324695", "0.58324695", "0.58324695", "0.58324695", "0.58057094", "0.57554364", "0.57056326", "0.5694423", "0.5646142", ...
0.6275084
1
Fetch all document resources
getDocumentResources(documentId, cb) { this.request('GET', '/api/entities/document/' + documentId, null, cb) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getDocumentResources(documentId, cb) {\n request('GET', '/api/entities/document/' + documentId, null, cb)\n }", "async function getAllDocuments()\n{\n //Query MongoDB for all stored documents\n const documents = await documentModel.find({}, { documentName: 1 });\n debug(`Found ${documents.length} do...
[ "0.73550206", "0.6837373", "0.6713257", "0.66548526", "0.6649651", "0.66046536", "0.659931", "0.6556293", "0.62972385", "0.62858135", "0.62557226", "0.62210983", "0.6206782", "0.6200335", "0.61940765", "0.617965", "0.6179289", "0.6178147", "0.61638904", "0.61523265", "0.61357...
0.7230624
1
Make jellybeans out of the short fruits Short fruits are fruits with 5 or less characters Jellybeans are fruits with ' Jellybeans' appended
function makeShortJellybeans(inFruits) { const jb = inFruits .filter(fruit => fruit.length < 6) // Call filter on inFruits .map(fruit => `${fruit} Jellybeans`); // Call map on the RESULT of filter console.log(jb); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function censorWord(str) {\nlet output='';\nsent = str.split(' '); //' ' creates space between 2 words and '' creates space between each letters\n for(var i = 0; i < sent.length; i++) {\n var count = sent[i].length;\n if (count > 4) {\n output = output + '*'.repeat(count) + ' '; //The...
[ "0.62747973", "0.6142531", "0.6002508", "0.5941757", "0.5916442", "0.5806098", "0.57739884", "0.5762285", "0.5737406", "0.57296", "0.5711835", "0.56750274", "0.56507427", "0.5650296", "0.5649458", "0.56381816", "0.559653", "0.55860144", "0.5585147", "0.55820084", "0.5575444",...
0.6703729
0
Write a function that creates 'smoothies' out of the ingredients provided. Only use ingredients that the user requests
function createSmoothies(ingredients, type) { // Get all the items of the type let filteredItems = ingredients.filter(item => item.type === type); // Create smoothies out of those items const smoothies = filteredItems.map((item, i, array) => { if (array[i + 1] !== undefined) { // Make sure the last o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateIngredient(){\n\treturn getSomething(ingredients);\n}", "function enoughIngredients(recipe, ingredients)\n{\n // TODO\n}", "function getMealIngredients(meal) {\n const ingredients = [];\n\n for (let i = 1; i <= 20; i++) {\n if (meal[`strIngredient${i}`]) {\n ingredients.push(\n ...
[ "0.6718551", "0.65185213", "0.60441476", "0.602894", "0.60020405", "0.59980685", "0.58401406", "0.58333874", "0.5796499", "0.57865393", "0.57728225", "0.5760335", "0.57530624", "0.57484", "0.57482105", "0.57433414", "0.5720637", "0.5711554", "0.5701667", "0.5659255", "0.56447...
0.7871129
0
Makes this chat window visible by swapping it with the last visible chat window, or do nothing if it is already visible.
makeVisible() { if (this.isVisible) { return; } const lastVisible = this.manager.lastVisible; this.manager.swap(this, lastVisible); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "showWindow(i){\n this.activeChat.messages_list[i].visibleWinDel = !this.activeChat.messages_list[i].visibleWinDel;\n }", "function setVisibleByUserDirectly(visible) {\n CZ.Tours.pauseTourAtAnyAnimation = false;\n if (CZ.Tours.tour != undefined && CZ.Tours.tour.state == \"play\")\n ...
[ "0.6576908", "0.6121843", "0.60378504", "0.5937144", "0.5870634", "0.58676225", "0.58675015", "0.5851958", "0.5813982", "0.5809155", "0.58039594", "0.5787035", "0.577892", "0.5775695", "0.5772819", "0.5741233", "0.571357", "0.5708861", "0.569996", "0.56880474", "0.56811124", ...
0.6674196
0
Shift this chat window to the right on screen.
shiftRight() { this.manager.shiftRight(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shiftWindow() {\n scrollBy(0, -100);\n}", "function moveRight(e){ \n e.xRec=e.xRec+10;\n e.dessineRectangle(); \n }", "function shiftRight() {\n\t// if there a place from right\n\tif(checkRight() === true) {\n\t\t// take current figure\n\t\tlet figureCells = selectFigure();\...
[ "0.6116414", "0.6082772", "0.5923802", "0.5880688", "0.5856322", "0.5829406", "0.5726726", "0.5697586", "0.5652082", "0.55760473", "0.54960203", "0.54891956", "0.5487474", "0.54787093", "0.54568243", "0.5443981", "0.5428949", "0.54103553", "0.53972733", "0.5396051", "0.536142...
0.64033735
0
calculate score of a full flag side
function directScore(inputFlag){ //sum three cards and divide by 100 (subscore) var score = (inputFlag[0][0] + inputFlag[1][0] + inputFlag[2][0])*.01; //add points for type of formation if(inputFlag[0][0] == inputFlag[1][0] && inputFlag[1][0] == inputFlag[2][0]){ //three of a kind score = score + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "calculateScore () {\n return 3 * super.calculateScore();\n }", "calculateAndUpdateScore() {}", "function calculateScore(state) {\r\n var num = 0;\r\n num += check(state.board[0], state.board[1], state.board[2]);\r\n num += check(state.board[3], state.board[4], state.board[5]);\r\n num += ...
[ "0.6889376", "0.6831942", "0.6718523", "0.6661217", "0.6571732", "0.65433544", "0.6500503", "0.6488241", "0.6455048", "0.64359474", "0.6345902", "0.633664", "0.6300605", "0.62593913", "0.6245584", "0.6229445", "0.6224009", "0.62216616", "0.61697197", "0.61681736", "0.6146084"...
0.7151219
0
match the target parts, ignoring extra subdomains on source source: [io, metamask, xyz] target: [io, metamask] result: PASS
function matchPartsAgainstList(source, list) { return list.some((target) => { // target domain has more parts than source, fail if (target.length > source.length) return false // source matches target or (is deeper subdomain) return target.every((part, index) => source[index] === part) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matchPartsAgainstList(source, list) {\n return list.find((target) => {\n // target domain has more parts than source, fail\n if (target.length > source.length) return false\n // source matches target or (is deeper subdomain)\n return target.every((part, index) => source[index] === part)\n })...
[ "0.6492365", "0.57520753", "0.542519", "0.5320181", "0.5249666", "0.5219571", "0.521074", "0.5161467", "0.51216197", "0.50839853", "0.50835913", "0.5060797", "0.5049978", "0.50473773", "0.50464153", "0.5028034", "0.50259984", "0.4998591", "0.4957354", "0.49547535", "0.4947922...
0.6540353
0
Places the currency symbol either on the left or right of the number depending on the currency
function placeCurrencySymbol(targetedEl, currencyType, amount, symbol){ if(rightSideSymbols.includes(currencyType)){ $(targetedEl).text(amount + symbol); } else{ $(targetedEl).text(symbol + amount); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatCurrency(num) {\n return 'PKR ' + (num).toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,'); \n}", "function formatCurrency(num) {\n return 'PKR ' + (num).toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,');\n}", "function getCurrency(c) {\r\n switch (c) {\r\n case 0: { return \"¥\" ...
[ "0.7133999", "0.7038101", "0.68976736", "0.6796562", "0.67082393", "0.66631806", "0.6655572", "0.6571944", "0.655975", "0.6490676", "0.64821076", "0.6480565", "0.64464635", "0.6404723", "0.639671", "0.6396188", "0.63832283", "0.6371114", "0.6369216", "0.6339445", "0.6331346",...
0.71897304
0
require external function to be available to use in this file Chain Promise to validate user input, make a post request, transform data received from server into json and dynamically update UI
function handleSubmit(event) { //First, prevent the submit button DOM element of doing his normal behavior of send info directly to server event.preventDefault() //So we can catch the URL entered by the user into the form field let urlText = document.getElementById('input-url').value //And check wh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function handleSubmit(event) {\n //Don't allow the form to submit the data - which is the default behaviour\n event.preventDefault()\n\n //Declare variables which will hold results from API Fetch\n let subjectivity = document.getElementById('subjectivity');\n let agreement = document.getElem...
[ "0.64691657", "0.62815666", "0.6236551", "0.6207741", "0.6005179", "0.5967671", "0.59099275", "0.5884215", "0.587347", "0.58425575", "0.5839922", "0.58186316", "0.5813118", "0.5806782", "0.5790147", "0.5788702", "0.57831365", "0.577296", "0.5770781", "0.576357", "0.57576096",...
0.6327551
1
Helper functions to translate data coming from API // Function to translate the Subjectivity property passing data coming from API as argument and ifelse chaining
function subjectScore(text) { //store the data in a variable and re-assign its value according the following situations let textScore = text; //if the data received is equal 'objective' if(textScore === 'OBJECTIVE'){ //assign a new value to the variable and return it return textScore =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function articlePolarity(text) {\n\n //store the data in a variable and re-assign its value according the following situations\n let textPolarity = text;\n\n //if the data received is equal 'p+'\n if(textPolarity == 'P+'){\n //assign a new value to the variable and return it\n return tex...
[ "0.56835246", "0.5509444", "0.5096485", "0.5094092", "0.5026578", "0.50265497", "0.5018618", "0.5004268", "0.49736217", "0.4966355", "0.49377942", "0.4933143", "0.49321538", "0.49178514", "0.4906111", "0.48402312", "0.482558", "0.48175806", "0.48103765", "0.479558", "0.479305...
0.6555504
0
Function to translate the Polarity property passing data coming from API as argument and ifelse chaining
function articlePolarity(text) { //store the data in a variable and re-assign its value according the following situations let textPolarity = text; //if the data received is equal 'p+' if(textPolarity == 'P+'){ //assign a new value to the variable and return it return textPolarity = '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkPolarity(score){\n let polarity;\n switch (score){\n case \"P+\":\n polarity = \"strong positive (indicates the polarity found in the element it refers to).\";\n break;\n case \"P\":\n polarity = \"positive (indicates the polarity found in the elem...
[ "0.5316582", "0.501868", "0.5011231", "0.4941619", "0.491893", "0.48124385", "0.47754762", "0.47692022", "0.47344455", "0.47079128", "0.470338", "0.4688396", "0.46407536", "0.46267536", "0.46095008", "0.45974043", "0.4555736", "0.45369354", "0.45339826", "0.45151278", "0.4510...
0.6093054
0
render an element with player and total
function renderTotal(name, hand, total) { const newDiv = document.createElement("div"); newDiv.classList.add("counter"); newDiv.appendChild( document.createTextNode(name + "'s Hand - Total: " + total) ); newDiv.id = name + "Total"; const currentDiv = document.querySelector(".game"); document.body.inse...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "renderPlayers(players) {\n const max = HIGH_SCORE;\n const low = Math.round(HIGH_SCORE / 3);\n const high = Math.round((HIGH_SCORE * 3) / 4);\n return html`${players.map(\n (player) => html`<div class=\"player\">\n <label>${player.name}:${Math.round(player.score)}</label>\n <meter\n ...
[ "0.71182394", "0.70472085", "0.6593897", "0.6509167", "0.6408976", "0.6384188", "0.637247", "0.63689256", "0.63228667", "0.6284303", "0.6267731", "0.62331223", "0.6228268", "0.6221344", "0.6202891", "0.6188583", "0.615847", "0.6128572", "0.6116568", "0.6114756", "0.60758376",...
0.7090005
1
Update UI, update the title of the current song
function updateTitleUI(counterCurrentSong){ const musicTrackList = musicData.map( musicList => musicList.musicTrack); musicOn.innerText = musicTrackList[counterCurrentSong]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateUI(){\r\n musicData.forEach(item => {\r\n const htmlTemplate = `\r\n <li class=\"item\"><img src=\"./img/svg/music.svg\" alt=\"\" data-id=\"${item.id}\"> \r\n <span class=\"title\"> ${item.musicTrack} </span> - \r\n <span class=\"artist\"> ${item.ba...
[ "0.7331712", "0.72480494", "0.71385056", "0.71139234", "0.7103061", "0.7025481", "0.7017621", "0.7002085", "0.68394446", "0.6829291", "0.68154913", "0.67402744", "0.66668355", "0.6616687", "0.66141325", "0.6591699", "0.6557261", "0.65547746", "0.65123063", "0.6491519", "0.648...
0.7708596
0
Update the UI with the name of the artist, band and list of songs
function updateUI(){ musicData.forEach(item => { const htmlTemplate = ` <li class="item"><img src="./img/svg/music.svg" alt="" data-id="${item.id}"> <span class="title"> ${item.musicTrack} </span> - <span class="artist"> ${item.band} </span> <...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateTitleUI(counterCurrentSong){\r\n const musicTrackList = musicData.map( musicList => musicList.musicTrack);\r\n musicOn.innerText = musicTrackList[counterCurrentSong];\r\n}", "static displayMusic() {\n const musics = Storing.getMusic();\n\n musics.forEach(function(music){\n ...
[ "0.6696709", "0.6660869", "0.65208435", "0.62756073", "0.62482613", "0.62321395", "0.6199865", "0.61851865", "0.6162232", "0.615683", "0.6104698", "0.6066647", "0.60339594", "0.6027482", "0.6021432", "0.6014636", "0.60038185", "0.5998316", "0.5968543", "0.5960302", "0.5955149...
0.7124726
0
An async wrapper for thunky Usage: let ready = asyncThunky(_ready) Where _ready receives a callback as single argument which has to be called after being done. Then, either call ready with a callback ready(cb) or await it await ready()
function asyncThunky (fn) { let thunk = thunky(fn) return function (cb) { if (cb) thunk(cb) else { return new Promise((resolve, reject) => { thunk(err => { if (err) reject(err) else resolve() }) }) } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async ready() {\n }", "async waitReady()\r\n\t{\r\n\t}", "async ready(callback) {\n if (!this._ready) {\n // Wait for ready event\n await new Promise(resolve => this.on('ready', resolve));\n }\n callback === null || callback === void 0 ? void 0 : callback();\n }...
[ "0.5764965", "0.5658961", "0.55388117", "0.541674", "0.5414503", "0.5332743", "0.5326541", "0.53218156", "0.52739006", "0.5272106", "0.52674985", "0.52422684", "0.52315867", "0.5180202", "0.51529324", "0.5130023", "0.5106773", "0.5097911", "0.5091794", "0.5076217", "0.5073825...
0.6553001
0
This writes the Email ID to the relevant column The "email" variable should be a GmailMessage type
function recordThreadId(sheet, row, column, email) { var threadID = email.getThread().getId(); sheet.getRange(row + 2, column).setValue(threadID); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getIdWithEmail(destinationMail) {\n const destination = await pool.query(`SELECT users.users_id\n FROM users\n where users_email = ?`, [destinationMail])\n return destination[0].users_id\n}", "function createNe...
[ "0.5966365", "0.5936104", "0.5918419", "0.5897563", "0.57946056", "0.5793352", "0.5791521", "0.57308924", "0.57303536", "0.57251215", "0.568563", "0.567989", "0.5672196", "0.5646767", "0.5607766", "0.55896854", "0.55831325", "0.5571177", "0.5552338", "0.5544999", "0.5429994",...
0.6194449
0
Find the column number of a particular header This is useful when we need to write to the spreadsheet and the columns may move around but keep the same name.
function findColumnWithHeader(headers, headerName) { for (i = 0; i < headers.length; i++) { if (normalizeHeader(headers[i]) == normalizeHeader(headerName)) { return i + 1; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function columnNum(){\n\t var count;\n\t var $headerColumns = $header.find(opts.headerCellSelector);\n\t if(existingColGroup){\n\t count = $tableColGroup.find('col').length;\n\t } else {\n\t count = 0;\n\t $headerColumns.each(function () {\n\t count...
[ "0.7421596", "0.7390949", "0.7068873", "0.6986723", "0.6971913", "0.6594436", "0.6507181", "0.6347548", "0.63275146", "0.63254136", "0.6245689", "0.6098188", "0.6018603", "0.6004578", "0.5981834", "0.5937116", "0.593115", "0.5923257", "0.5908587", "0.5903741", "0.58635825", ...
0.7505328
0
Check if the thread being followed up on has a reply from the person Sends true if the person did reply, false otherwise Sends false if we're using "force draft bump"
function personReplied(thread, address, status) { if (status == "force draft bump" || thread == false) { return false; } var messages = thread.getMessages(); for (i = 0; i < messages.length; i++) { if (messages[i].getFrom().indexOf(address) >= 0) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check(idx) {\n if (idx >= data.messages.length) {\n return false;\n }\n var message = data.messages[idx];\n if (!((message.sender == data.owner_email) || message.auto_generated))\n return false;\n if (message.type == ResponseToComments) {\n i = idx - 1;\n ...
[ "0.6707748", "0.6153342", "0.61309433", "0.61267245", "0.60404867", "0.60208285", "0.59789217", "0.5796595", "0.57300293", "0.57179636", "0.571089", "0.56840384", "0.5659811", "0.5632651", "0.5616954", "0.5599342", "0.5582726", "0.55686677", "0.5526693", "0.5505773", "0.55038...
0.7748555
0
finds the last message in a thread that was sent to a particular person this does not look at cc or bcc
function findLastMessage(thread, address) { if (thread == false || thread == null) { return false; } var messages = thread.getMessages(); for (i = messages.length - 1; i >= 0; i--) { var message = messages[i]; if (message.getTo().indexOf(address) >= 0) { return message; } } return fa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findLastReceived(indice) {\n let mes = this.contacts[indice].messages;\n let lastMsg = \"\";\n let arrayReceived = mes.filter(item => item.status == \"received\");\n lastMsg = arrayReceived[arrayReceived.length - 1]\n return lastMsg;\n }", "function g...
[ "0.70495", "0.69834715", "0.6635753", "0.6480822", "0.6456052", "0.6303601", "0.62307286", "0.6197674", "0.6104898", "0.60754806", "0.601447", "0.59785837", "0.59718496", "0.5971024", "0.594992", "0.59463894", "0.590644", "0.5891711", "0.58477306", "0.57413775", "0.57387954",...
0.8043481
0
If we don't have the thread ID, go search for the message Returns false if none or several threads are found unless we're using "force draft bump"
function findThreadToBump(subject, address, status) { // search for the right thread, get the array of answers threads = GmailApp.search('subject:"' + subject + '" to:' + address); // check the result is correct (unless we're forcing through if (threads.length == 0 || (subject == null && status != "force draft ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function personReplied(thread, address, status) {\n if (status == \"force draft bump\" || thread == false) {\n return false; \n }\n var messages = thread.getMessages();\n for (i = 0; i < messages.length; i++) {\n if (messages[i].getFrom().indexOf(address) >= 0) {\n return true;\n }\n }\n return ...
[ "0.655108", "0.5925415", "0.58059984", "0.57311577", "0.56998587", "0.5645323", "0.56209075", "0.53152436", "0.52155703", "0.519825", "0.5167847", "0.51642156", "0.5150149", "0.51168853", "0.51056904", "0.50831723", "0.50730723", "0.5072343", "0.5061885", "0.50597376", "0.504...
0.6879985
0
This function accepts a list of files and loads the first one into memory as a Papa parse object.
function loadFile(files) { // If no file is selected, alert the user. // The first check is to see if the user cancelled out of the // selection dialog without selecting a file. However, it is // OK to do that if a file was selected earlier and that is what // the second clause checks. if (file...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseMe(file) {\n Papa.parse(file, {\n \t dynamicTyping: true,\n header: false,\n complete: function(results) {\n console.log(\"Finished:\", results.data);\n start(results.data);\n }\n });\n}", "function loadFiles (files) {\n\n let { pdfNames, annoNames } = getC...
[ "0.6385578", "0.6204676", "0.5872158", "0.56273896", "0.56125635", "0.557424", "0.55567145", "0.5340991", "0.53184235", "0.52643734", "0.5255105", "0.52498275", "0.52320415", "0.51221293", "0.5117673", "0.50755274", "0.50286436", "0.5012032", "0.49730316", "0.49702454", "0.49...
0.6384343
1
make courses not offered at this location unavailable
function displayAvailability(location_id) { $('.course-item').each( function () { if ( $.inArray(location_id,$(this).data('locations')) != -1 ) { $(this).removeClass("unavailable"); } else { $(this).addClass("unavailable"); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkRequirements() {\n\tvar distinctCourses = [];\n\t$('.courseName').each(function(index) {\n\t\tif (distinctCourses.indexOf($(this).html()) >= 0) {\n\t\t\t$(this).parent().css('background-color', colorDuplicateCourse);\n\t\t}\n\t\telse {\n\t\t\tdistinctCourses.push($(this).html());\n\t\t\tvar credits =...
[ "0.5604827", "0.56024843", "0.55895483", "0.5558813", "0.5516571", "0.54935634", "0.5490398", "0.545524", "0.53383356", "0.5335708", "0.5319655", "0.5239083", "0.5236962", "0.5233114", "0.5185414", "0.5163283", "0.51548296", "0.51252073", "0.511352", "0.5113091", "0.5077896",...
0.6636739
0
LEAP MOTION STUFF this function runs every time the leap provides us with hand tracking data it is passed a 'frame' object as an argument we will dig into this object
function handleHandData(frame) { if (frame.hands.length == 1) { var handPosition = frame.hands[0].stabilizedPalmPosition;//palm position // grab the x, y & z components of the hand position // these numbers are measured in millimeters var hx = handPosition[0]; var hy = handPosition[1]; var hz ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_loop () {\n setTimeout(this._loop.bind(this), Math.max(this.runtime.currentStepTime, Scratch3Tracking.INTERVAL));\n\n // Add frame to detector\n const time = Date.now();\n if (this._lastUpdate === null) {\n this._lastUpdate = time;\n }\n const offset = time - t...
[ "0.6248469", "0.6120774", "0.59369683", "0.58821905", "0.5864148", "0.58590853", "0.57857555", "0.57486707", "0.5713022", "0.5620189", "0.56198555", "0.5587874", "0.5581905", "0.55317926", "0.5510068", "0.5501859", "0.54971516", "0.54651165", "0.54610807", "0.54579806", "0.54...
0.6145422
1
5:00 > five o'clock 5:01 > one minute past five 5:10 > ten minutes past five 5:15 > quarter past five 5:30 > half past five 5:40 > twenty minutes to six 5:47 > thirteen minutes to six 5:28 > twenty eight minutes past five Write a program which prints the time in words for the input given in the format mentioned above.
function timeInWords (time) { const timeArr = time.split(':'); const [h, m] = timeArr.map((timeStr) => parseInt(timeStr)); //create hash for conversions const timeConvert = { 1 : 'one', 2 : 'two', 3 : 'three', 4 : 'four', 5 : 'five', 6 : 'six', 7 : 'seven', 8 : 'eight', 9 : '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timeInWords(hour, minute){\n let nums = {\n 0 : \"zero\",\n 1 : \"one\",\n 2 : \"two\",\n 3 : \"three\",\n 4 : \"four\",\n 5 : \"five\",\n 6 : \"six\",\n 7 : \"seven\",\n 8 : \"eight\",\n 9 : \"nine\",\n 10 : \"ten\",\n ...
[ "0.7615376", "0.74039125", "0.7363502", "0.73591727", "0.72507924", "0.70468247", "0.69275737", "0.6707887", "0.6693919", "0.6693919", "0.66688645", "0.66688645", "0.6663038", "0.6663038", "0.6663038", "0.6663038", "0.6663038", "0.6663038", "0.6663038", "0.6663038", "0.666303...
0.7711398
0
[] > [] stylizes the result from postgres,
function stylize_result(rows) { return _.map(rows, function(row){ return change_row(row); }) function change_row(row) { var newRow = row; if (row.jobs_date) { var date = '' + row.jobs_date; newRow['jobs_date'] = date.slice(4,15); } titleize('address'); titleize('jobs_owner'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "convertResultsToTable(results,formatter=this.defaultFormatter){\n let json = JSON.parse(sem.queryResultsSerialize(results,\"json\")); \n let table = `<table>\n ${json.caption!=null?`<caption>${json.caption}</caption>`:''}\n <thead><tr>${json.head.vars.map((varName)=>`<th>${varName}</th>`).join('\\n')}</tr></t...
[ "0.639511", "0.6308513", "0.60996044", "0.6064477", "0.6036817", "0.59246093", "0.5904427", "0.5904427", "0.5848635", "0.581167", "0.57641876", "0.57280236", "0.5672846", "0.5671893", "0.5671862", "0.56655073", "0.56598794", "0.56136984", "0.5564132", "0.554144", "0.5535618",...
0.64565253
0
set array random element and delete it
function random(arr) { let rand = Math.floor(Math.random() * arr.length); let toReturn = arr[rand]; arr.splice(rand, 1); return toReturn; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeAtRandom(arr) {\n arr.splice(Math.floor(Math.random() * arr.length), 1);\n return arr;\n}", "_recycleCurrentSample() {\n this.sample.forEach(item => {\n let index = getRandom(this.array.length + 1, this.skip)\n this.array.splice(index, 0, item)\n })\n }", "function R(a){return...
[ "0.74566853", "0.7162538", "0.70035386", "0.69987214", "0.6859602", "0.6859381", "0.67864275", "0.6744174", "0.6700259", "0.66776407", "0.6657083", "0.66551393", "0.6632434", "0.65779567", "0.65764034", "0.64923847", "0.64894044", "0.642144", "0.64002436", "0.63389117", "0.63...
0.71910083
1
Adds a doc to the end of the index
add(doc) { const idx = this.size(); if (isString(doc)) { this._addString(doc, idx); } else { this._addObject(doc, idx); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "add(obj) {\n // if parameter isn't object exit with throw\n if (\"object\" !== typeof obj) {\n throw new TypeError(\"Object being added needs to be an object\");\n }\n // if object you are adding already has id column it is either already in the collection\n // or the ...
[ "0.63851196", "0.6338393", "0.6136496", "0.6118089", "0.5980107", "0.5951959", "0.5789393", "0.578717", "0.56949633", "0.56583554", "0.5630727", "0.56037694", "0.56007874", "0.55743444", "0.5515843", "0.5450116", "0.5427238", "0.5424045", "0.5404469", "0.53704095", "0.5370206...
0.68867934
0
Function checks to see if all questions have been answered. If not, unanswered questions are highlighted in red. If all are answered, the users score is displayed as well as an appropriate image.Also adds checks and x's to users answers
function checkAnswer(){ let counter = 0; let playerScore = 0; //Determine which test to compare correct answers let chosen = document.getElementById("drop"); let pick = chosen.selectedIndex; //If random test is chosen if(testValue.length > 6){ pick = 6; } let potentialAnswers = document.query...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function keepingScore() {\n\n var userAnswer1 = $(\"input[name='answer0']:checked\").val();\n var userAnswer2 = $(\"input[name='answer1']:checked\").val();\n var userAnswer3 = $(\"input[name='answer2']:checked\").val();\n var userAnswer4 = $(\"input[name='answer3']:checked\").val();\n var userAnswer...
[ "0.73251325", "0.72819877", "0.72582436", "0.7238485", "0.7226829", "0.7193976", "0.70782876", "0.7007581", "0.70012426", "0.69994915", "0.6997698", "0.69931394", "0.6979019", "0.697034", "0.69685584", "0.6950814", "0.694249", "0.6930909", "0.6923793", "0.692107", "0.6900641"...
0.7382551
0
Function sends a XMLHttpRequest to open trivia database to load between 1050 test questions
function loadRandom(){ //Clear old random test if necessary if(testValue.length > 6){ testValue.pop(); } //Determine how many questions to load let testLength = document.getElementById("selectLength"); let url; if(testLength.selectedIndex === 0){ url = "https://opentdb.com/api.php?amount=10" }i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchQuestions() {\n $.ajax({\n url: \"https://opentdb.com/api.php?amount=10&category=19&difficulty=medium\",\n method: \"GET\"\n }).then(function (response) {\n totalQuestions = response.results.length;\n for (let i = 0; i < response.results.length; i++) {\n l...
[ "0.68364215", "0.64679825", "0.64580524", "0.64521873", "0.63971335", "0.6295791", "0.62922835", "0.62834024", "0.62773186", "0.6125464", "0.60858226", "0.60679436", "0.6062686", "0.6022697", "0.6016899", "0.60059917", "0.59929436", "0.59850335", "0.59792167", "0.5944438", "0...
0.6558438
1
Opens the filter window containing a tree with the members in a specific dimension Used by DWReport.aspx
function DWOpenFilterWindow(varDimBuffer, varMemberBuffer, varCubeName, varDimension, varMember){ DWOpenFilterWindow(varDimBuffer, varMemberBuffer, varCubeName, varDimension, varMember, null, null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DWOpenFilterWindow(varDimBuffer, varMemberBuffer, varCubeName, varDimension, varMember, varIdReport, varNodeFilterMember)\n{\n\tvar sUrl = 'Filter_Main.aspx?cube=' + varCubeName + '&dimension=' + varDimension + '&member=' + varMember;\n\t\n\tif(varIdReport != null)\n\t\tsUrl += '&nodeFilterMember=' + varN...
[ "0.71801233", "0.5918742", "0.5901206", "0.58335525", "0.57664996", "0.5758855", "0.57481366", "0.56928235", "0.5644131", "0.5623732", "0.5607614", "0.557945", "0.55682874", "0.55261314", "0.5498471", "0.541209", "0.54031384", "0.539933", "0.534953", "0.53485924", "0.53413105...
0.66603565
1
Opens the filter window containing a tree with the members in a specific dimension Used by DWReport.aspx
function DWOpenFilterWindow(varDimBuffer, varMemberBuffer, varCubeName, varDimension, varMember, varIdReport, varNodeFilterMember) { var sUrl = 'Filter_Main.aspx?cube=' + varCubeName + '&dimension=' + varDimension + '&member=' + varMember; if(varIdReport != null) sUrl += '&nodeFilterMember=' + varNodeFilterMember...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DWOpenFilterWindow(varDimBuffer, varMemberBuffer, varCubeName, varDimension, varMember){\n\tDWOpenFilterWindow(varDimBuffer, varMemberBuffer, varCubeName, varDimension, varMember, null, null);\n}", "function showFilterParameters(){\n //dom.byId(\"defaultfilter\").set\n $(\"#default...
[ "0.6660814", "0.59162307", "0.5897861", "0.5831891", "0.5766889", "0.57621896", "0.5749531", "0.56925505", "0.56429935", "0.56198186", "0.560626", "0.55819446", "0.5568802", "0.55235726", "0.5494872", "0.5413382", "0.5403528", "0.54005116", "0.5350623", "0.5347979", "0.533887...
0.7180378
0
Sets the current selected member in the dynamic tree used by the filter window Used by FilterTree.aspx
function DWSetCurrentMember(treeId, nodeId, nodeValue) { document.all("dtvTreeValue").value = nodeValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set(parentId, selected) {\n $$(parentId + ' input.filter_checkbox').each(function(box){ box.checked = selected; } );\n return false;\n}", "function memberSelectorDBox(p) {\n\t /*parameters:\n\t * data: object data with heirarchy compatible with fancytree\n\t * name: name of the new created ...
[ "0.61132044", "0.5906462", "0.58888566", "0.584985", "0.57466817", "0.5737641", "0.57351756", "0.57184464", "0.570009", "0.5658113", "0.5647726", "0.5607406", "0.5575673", "0.55669814", "0.555557", "0.5553338", "0.5547247", "0.5525655", "0.5525322", "0.5525235", "0.5521405", ...
0.60780495
1
Ensure the collection of fieldset titles is large enough to accommodate the number of fieldsets.
function ensureEnoughTitles(count) { while ($scope.fieldsetTitles.length < count) { $scope.fieldsetTitles.push({ loading: false, loaded: false, value: null }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fixTitlesWidth ()\n {\n var customFields_titles = document.querySelectorAll('.customFields_title');\n /* the div that contains the first row of fields */\n var customFields_input = document.querySelectorAll('.customFields_input');\n\n for (var i = 0; i < customField...
[ "0.5388268", "0.5217478", "0.51878625", "0.5159432", "0.50662947", "0.5063975", "0.50560254", "0.5046822", "0.5009132", "0.49800313", "0.49767214", "0.49478903", "0.49406198", "0.4934003", "0.49039045", "0.49025607", "0.48776942", "0.48595878", "0.48398593", "0.48327124", "0....
0.75627375
0
Checks if the specified model's properties match all of the properties in any of the specified fieldsets, while also checking if the fieldset aliases match. This is an indicator of the compatibility of a fieldset model with a collection of fieldset configurations.
function modelMatchesAnyFieldset(model, fieldsets) { // Loop through fieldsets to find a match. for (var i = 0; i < fieldsets.length; i++) { var fieldset = fieldsets[i]; // Confirm that this configured fielset contains exactly // the same properties as those that we...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrayContainsFieldset(fieldset, fieldsets) {\n for (var i = 0; i < fieldsets.length; i++) {\n if (fieldsets[i] === fieldset) {\n return true;\n }\n }\n return false;\n }", "function areSetsEqual(a, b, isEqual, meta) {\n var isValueEqual =...
[ "0.61669934", "0.5492509", "0.53415394", "0.52651095", "0.52651095", "0.52651095", "0.52651095", "0.52651095", "0.52651095", "0.52651095", "0.52651095", "0.52651095", "0.5146253", "0.5146253", "0.5146253", "0.50851583", "0.50817925", "0.49812132", "0.49547976", "0.49498814", ...
0.83946425
0
Checks if the specified array of fieldsets contains the specified fieldset.
function arrayContainsFieldset(fieldset, fieldsets) { for (var i = 0; i < fieldsets.length; i++) { if (fieldsets[i] === fieldset) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function modelMatchesAnyFieldset(model, fieldsets) {\n\n // Loop through fieldsets to find a match.\n for (var i = 0; i < fieldsets.length; i++) {\n var fieldset = fieldsets[i];\n\n // Confirm that this configured fielset contains exactly\n // the same properties as t...
[ "0.6603311", "0.6538069", "0.62744695", "0.5713224", "0.568804", "0.55808157", "0.5572252", "0.5550189", "0.5420286", "0.52522534", "0.52433884", "0.5230537", "0.5229058", "0.5207486", "0.5164365", "0.5137192", "0.5127428", "0.5096925", "0.50560045", "0.5055868", "0.50552493"...
0.8737581
0
Confirms that an array of properties is a subset of another array of properties.
function arePropertiesSubset(subset, superset) { // Loop through the subset of properties. for (var j = 0; j < subset.length; j++) { var subProperty = subset[j]; var matchedProp = false; // Loop through the superset to find a matching property from the subset. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function subset(a, b) {\n var intersection = _.intersection(a, b);\n return intersection.length === a.length;\n }", "subset(otherSet) {\n var firstSet = this.values();\n return firstSet.every(e => otherSet.has(e));\n }", "function isSubset (a1, a2) {\n la(is.array(a1), 'expected first ...
[ "0.6690108", "0.6666955", "0.6598346", "0.6597114", "0.65800697", "0.6507185", "0.65006894", "0.643909", "0.6257804", "0.6234492", "0.622304", "0.62196827", "0.6099751", "0.6089052", "0.6064431", "0.5908726", "0.574332", "0.5706273", "0.5658698", "0.5608458", "0.5578689", "...
0.6838119
0
helper to add an empty fieldset to the render model
function getEmptyRenderFieldset (fieldsetModel) { return {alias: fieldsetModel.alias, collapse: false, isValid: true, properties: []}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emptyEdaFieldsModel(){\n\t\t\tlet emptyModel = [\n\t\t\t\t{\n\t\t\t\t\t'line'\t\t\t\t\t: 1,\n\t\t\t\t\t'activeColumn'\t: 1,\n\t\t\t\t\t'columns'\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'numColumn'\t: 1,\n\t\t\t\t\t\t\t'exist'\t\t\t: true,\n\t\t\t\t\t\t\t'control'\t\t: {\n\t\t\t\t\t\t\t\t'type'\t: 'none',...
[ "0.65763307", "0.6314638", "0.61457056", "0.59893227", "0.5791074", "0.56831557", "0.56591725", "0.5542289", "0.55159014", "0.55159014", "0.5502354", "0.5459258", "0.5458951", "0.5412479", "0.5412479", "0.538339", "0.5346403", "0.5329879", "0.53246605", "0.53196263", "0.53085...
0.7621726
0
Serializes and deserializes an item to return a snapshot of that item (e.g., so it is not changed before being inspected). Useful when troubleshooting. Modified from:
function jsonSnapshot(item) { var cache = []; var stringItem = JSON.stringify(item, function(key, value) { if (typeof value === "object" && value !== null) { if (cache.indexOf(value) !== -1) { return "[Removed Circular Reference Item]"; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _itemToBuffer(item) {\n\n\tvar\n\t\tstrData;\n\n\t// Detect item type\n\titem.type = (typeof item.data == \"string\") ? 1 : (typeof item.data == \"number\") ? 2 : (item.data == null) ? 3 : 4;\n\n\t// Convert item into a string\n\tstrData = (item.type == 1) ? item.data : (item.type == 2) ? item.data.toStri...
[ "0.62869865", "0.6192878", "0.607771", "0.60172355", "0.58449364", "0.5684139", "0.5655172", "0.5630336", "0.56041336", "0.55821794", "0.5525176", "0.55015343", "0.5471125", "0.5469671", "0.5461093", "0.5442498", "0.5408436", "0.5398238", "0.533634", "0.5313085", "0.53085643"...
0.69045615
0
Recursively processes each Archetype fieldset.
function recurseFieldsets(fn, fieldsets) { if (!fieldsets || !fieldsets.length) { return; } _.each(fieldsets, function(fieldset) { fn(fieldset); _.each(fieldset.properties, function (property) { if (property != null && property.value != null &&...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "__initFieldMetadata() {\n this.sections.forEachValue(section => {\n section.subsections.forEach(subsection => {\n subsection.section = section;\n this.__decorateFields(subsection.fields);\n this.subsections.add(subsection.id, subsection);\n ...
[ "0.5248184", "0.52375853", "0.5113937", "0.5093956", "0.5007921", "0.4967708", "0.48823947", "0.48347294", "0.47707105", "0.47640485", "0.47574264", "0.47449717", "0.47408018", "0.47316554", "0.4724185", "0.4658132", "0.46569955", "0.4646963", "0.46370518", "0.46320263", "0.4...
0.6856575
0
Recursively processes each Archetype fieldset property.
function recurseProperties(fn, fieldsets) { recurseFieldsets(function(fieldset) { _.each(fieldset.properties, function (property) { fn(property, fieldset); }); }, fieldsets); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function recurseFieldsets(fn, fieldsets) {\n if (!fieldsets || !fieldsets.length) {\n return;\n }\n _.each(fieldsets, function(fieldset) {\n fn(fieldset);\n _.each(fieldset.properties, function (property) {\n if (property != null && property.valu...
[ "0.7129221", "0.55086076", "0.5005405", "0.5005405", "0.48859942", "0.47294885", "0.4719127", "0.46461025", "0.4645017", "0.46135002", "0.46105334", "0.4608435", "0.4586557", "0.4579297", "0.45786116", "0.45600793", "0.45564288", "0.45258352", "0.45200035", "0.45167303", "0.4...
0.66052896
1
Indicates whether or not the fieldset can be moved between the source and target scope. The source scope is the scope of the fieldset being dragged. The target scope is the scope of the Archetype to drop into.
function canMove(sourceScope, targetScope) { var targetFieldsetConfigs = targetScope.model.config.fieldsets; var targetFieldsets = targetScope.model.value.fieldsets; var sourceFieldset = sourceScope.fieldset; var sameArchetype = arrayContainsFieldset(sourceFieldset, targetFieldsets); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function canDrop(source, target, dragData, dropData) {\n if (!scope.canModify) {\n return false;\n }\n\n var isArea = isRowContainerArea(target);\n\n if (!dragData || !dropData || d...
[ "0.6349344", "0.5949374", "0.5784038", "0.57217723", "0.571635", "0.5601434", "0.5557254", "0.5515709", "0.54848886", "0.5417442", "0.5310999", "0.5275355", "0.5266905", "0.52480334", "0.5211997", "0.52029806", "0.51883805", "0.51790375", "0.5178527", "0.5141655", "0.5141655"...
0.78242594
0
This is an alternative to: element.sortable("instance") Workaround for this issue: Snagged from this pull request: More technical details here:
function getSortableWidgetInstance(element) { // this is a fix to support jquery-ui prior to v1.11.x // otherwise we should be using `element.sortable('instance')` var data = element.data('ui-sortable'); if (data && typeof data === 'object' && data.widgetFullName === 'ui-sortable') { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortableCall(){\r\n console.log(\"stort called\")\r\n\tsortable('.js-sortable', {\r\n forcePlaceholderSize: true,\r\n placeholderClass: 'mb1 bg-navy border border-yellow',\r\n hoverClass: 'bg-maroon yellow',\r\n itemSerializer: function (item, container) {\r\n item....
[ "0.64116335", "0.64049315", "0.63883126", "0.63883126", "0.63883126", "0.63710064", "0.62932116", "0.6271571", "0.6263691", "0.6223646", "0.62113786", "0.616594", "0.6139676", "0.61330825", "0.61097914", "0.60908186", "0.59560484", "0.5909772", "0.58795625", "0.58566266", "0....
0.7265472
0
Checking files and directories ==== Recursively steps into all directories in the project, checking the names of files and directories. If a directory is reached that is excluded, no files or subdirectories within that path are checked. / Finding the first matching pattern in a blacklist Inputs: blacklist: regexp[] nam...
function findFirstMatch (blacklist, name) { var i; for (i=0; i<blacklist.length; i+=1) { if (minimatch(name, blacklist[i])) { return blacklist[i]; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getBlacklistRE() {\n const additionalBlacklist = [\n /ignore-this-directory\\/.*/,\n ];\n return blacklist(additionalBlacklist);\n }", "function generateBlacklist() {\n const packageModules = path.resolve(__dirname, 'node_modules');\n const rootModules = path.resolve(__dirname, '../../node_modul...
[ "0.5721154", "0.52404034", "0.51233596", "0.49107632", "0.48430148", "0.48430148", "0.48393103", "0.47922614", "0.47800526", "0.4760584", "0.475997", "0.47432277", "0.4696281", "0.46543753", "0.46379933", "0.46338332", "0.46325374", "0.46166098", "0.45190167", "0.44773716", "...
0.53045005
1
saves the value of the last direction in which the player has run
updateLastRunningDirection(){ if(this.vx>0){ this.lastRunningDirectionRight = true; } if(this.vx<0){ this.lastRunningDirectionRight = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function UpdateSavePosition() {\n\tthis.savePlayer.x = this.transform.position.x;\n\tthis.savePlayer.y = this.transform.position.y;\n\tthis.savePlayer.z = this.transform.position.z;\n}", "get lastTurn() {\n return this.turns[this.turns.length - 1];\n }", "function lastTurn() {\n\tturnsLeftActivated =...
[ "0.61169845", "0.6099387", "0.59471965", "0.57789296", "0.5723298", "0.56511253", "0.56304276", "0.56100625", "0.5607725", "0.5588465", "0.5475839", "0.5468542", "0.54596984", "0.5450915", "0.54425347", "0.53835213", "0.53801614", "0.5372467", "0.5368003", "0.5368003", "0.535...
0.6438509
0
find by band name
function getBand(name) { return bands.find(function (band){ return band.name === name; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bandMem(name) {\n let out = ''\n for (const key in theBand) {\n let member = theBand[key]\n if (member.name == name) {\n out = `${member.name} is in the band and plays the ${member.instrument}`\n }\n\n }\n return out\n}", "function lookupChargeBand(band, clinicName)\r\n{\r\n\tvar custo...
[ "0.6339197", "0.6160601", "0.59784657", "0.5787976", "0.5742871", "0.56297493", "0.56297493", "0.56181425", "0.56123585", "0.56003547", "0.55983007", "0.55415154", "0.54994637", "0.5420752", "0.5404957", "0.5389199", "0.5360307", "0.53162324", "0.5308093", "0.53026843", "0.52...
0.8376968
0
init is called during object construction. The resource may not have completed construction when this callback runs, therefore all fields of the resource referenced by "asyncId" may not have been populated.
function init(asyncId, type, triggerAsyncId, resource) { _asyncId = asyncId; _type = type; _triggerAsyncId = triggerAsyncId; _resource = resource; debug( asyncId, type, triggerAsyncId, resource ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(async_param) {\n super(async_param);\n }", "async _init() {}", "init() {\n return __awaiter(this, void 0, void 0, function* () { });\n }", "private__InitializeAsync(){\n // generate job unique ID with 'job' prefix\n this.id = uidGenerator.generate...
[ "0.6866714", "0.6691178", "0.6565089", "0.6470528", "0.63714206", "0.6234353", "0.62206566", "0.61923265", "0.61923265", "0.61923265", "0.61923265", "0.61923265", "0.61923265", "0.61923265", "0.61923265", "0.61923265", "0.61923265", "0.61923265", "0.61923265", "0.6004447", "0...
0.73420006
0
Escapes trailing "\" in given text.
static escapeTrailingBackslash(text) { if ('\\' === substr(text, -1)) { let len = strlen(text); text = rtrim(text, '\\\\'); text = text.replace("\0", ''); text += "\0".repeat(len - strlen(text)); } return text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function esc(v) { return \"\\\"\" + v.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\") + \"\\\"\"; }", "function esc(v) { return \"\\\"\" + v.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\") + \"\\\"\"; }", "function esc(v) { return \"\\\"\" + v.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/...
[ "0.6907089", "0.6907089", "0.6907089", "0.6725732", "0.66446733", "0.6618129", "0.6542517", "0.6505148", "0.6315815", "0.6312004", "0.6276689", "0.62242633", "0.62242633", "0.6177839", "0.61454946", "0.6137753", "0.61237717", "0.6103371", "0.6103371", "0.6062821", "0.6051624"...
0.7778204
0
function to init the model, if we have a todolist in local storage we use that value if not, an empty array
function initModel(){ toDoList = JSON.parse(localStorage.getItem('todoList')) || []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TodoModel() {\n this.todoItems = JSON.parse(localStorage.getItem('todo')) || [];\n }", "constructor(){\n if(localStorage.getItem(\"myToDoList\") === null){\n this.list = [];\n } else {\n this.list = JSON.parse(localStorage.getItem(\"myToDoList\"));\n ...
[ "0.7885889", "0.741359", "0.70229936", "0.69548565", "0.6786679", "0.6718427", "0.6600506", "0.6581923", "0.65799266", "0.65653026", "0.65361637", "0.6497203", "0.64128625", "0.64029187", "0.64025635", "0.63966495", "0.6371679", "0.6330611", "0.6298762", "0.6291095", "0.62607...
0.89607084
0
Turns json into useable data. Output MUST use arrays in accordance with the d3.hierarchy requirements
function reformatData(obj, type) { // Converts json file to object with necessary information for later processing const objTree = {}; const keys = Object.keys(obj['data']); for (var repo of keys) { let licenseInfo = obj['data'][repo]['licenseInfo']; // Skip if no...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processData (data) {\n if (!data) {\n return [];\n }\n\n if (!data.children) {\n return data;\n }\n\n // data.name = \"\"; // No name for root\n var therapeuticAreas = data.children;\n for (var i=0; i<therapeuticAreas.length; i++) {\n ...
[ "0.6118526", "0.6035873", "0.58941704", "0.58830553", "0.5870441", "0.58432573", "0.57995516", "0.5799366", "0.5786719", "0.5785595", "0.57725483", "0.57142514", "0.5702574", "0.56825316", "0.56743366", "0.5632869", "0.5630608", "0.5630388", "0.5630279", "0.55779535", "0.5514...
0.6337423
0
new_view_password_confirmation_print comp_res == comparison results says (directly in the html page itself) whether or not the passwords entered meet the required standards.
function signup_view_password_confirmation_print(comp_res,s1,s2){ //console.log("(signup_view_password_confirmation_print)"); // console.log("s1 is: " + document.getElementById(s1).tagName); // console.dir("and the test results are: " + document.getElementById(s1)); var pass = document.getElementById(s1).valu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function comparePassword() {\r\n\t// Both fields have to be filled out\r\n\tif ($(\"#password\").val() !== \"\" && $(\"#password_confirm\").val() !== \"\") {\r\n\r\n\t\t// Repeated new password and password have to be the same\r\n\t\tif ($(\"#password\").val() === $(\"#password_confirm\").val()) {\r\n\t\t\treturn ...
[ "0.6987893", "0.6621623", "0.66173387", "0.6615905", "0.6579161", "0.65036696", "0.648175", "0.64134663", "0.6395188", "0.6366363", "0.63648164", "0.6347206", "0.6341269", "0.6282444", "0.6279524", "0.6267289", "0.6226539", "0.62242395", "0.62209946", "0.62145", "0.62102133",...
0.7614472
0
Generate a qrcode image
qrImage ({ response, params, request }) { const data = request.get().data || params.id const qrCode = qr.image(data, { size: 10 }) response.type('image/png') return qrCode.pipe(response.response) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateQR(){\r\n\r\n var data = qrdata.value;\r\n qrcode.makeCode(data);\r\n \r\n}", "async function run() {\n const logoPath = path.resolve(__dirname, './logo/wapuu-qr.png'); // Add logo here.\n const url = ''; // Add your URL here.\n\n const res = await brandedQRCode.generate(\n {\n ...
[ "0.7715077", "0.7131834", "0.71236753", "0.70929134", "0.70426863", "0.69429845", "0.6905065", "0.686633", "0.6855692", "0.6775745", "0.6756186", "0.67041016", "0.66620016", "0.6634765", "0.6628702", "0.6395187", "0.61967266", "0.6192647", "0.61252546", "0.60657", "0.6028159"...
0.7163659
1
+++++++++++++++++++++++++++++++++ Remove from DOM all download Jobs except first row used as header
function clearDNLTable() { var table = document.querySelector('#NASDownloadTable'); var nbItem = table.rows.length; appendLog("Nb of items to del:"+nbItem); if (table.rows.length > 1) { for (let i=1; i< nbItem;i++) { appendLog("Loop2del "+i+" => item to del:"+table.rows[1].getAttribute("hash")); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function limpiarTabla() {\n $(\"#my_file_output > tbody \").empty();\n}", "function clearRows() {\n // assign variable using getElementById() method to return the element that has the ID attribute of the html table\n var table = document.getElementById(\"ufo-table\");\n // assign variable to the numb...
[ "0.5984846", "0.5780129", "0.5735882", "0.55301666", "0.551833", "0.551358", "0.54619", "0.5437074", "0.5407291", "0.5406038", "0.5400801", "0.5385287", "0.5373793", "0.5372803", "0.5372283", "0.5361832", "0.5349106", "0.53436565", "0.5339652", "0.53394145", "0.5316723", "0...
0.6145248
0
WIP replace by asunc pattern / +++++++++++++++++++++++++++++++++ Load settings, Log and List DNL
async function LoadAndLogAndListDNL_bis() { var resLogin = false; clearError(); clearPopupError(); await getSettings(); appendLog(" LogAndListDNL_bis : settings: "+NASprotocol+" "+NASlogin+":"+NASpassword+"@"+NASaddr+":"+NASport+" temp="+NAStempdir+" move="+NASdir); /* try { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DataLoad() \n{\n\tthis.tagMask=new RegExp(\".\",\"i\");\t\t\t\t\t\t\t\t\t\t// Default passes everything\n\tthis.tagMaskMode=true;\t\t\t\t\t\t\t\t\t\t\t\t\t// Masking mode\n\tthis.userVars=[];\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Holds user variables\t\t\t\t\t\t\t\t\n}", "function loadLogEntries(entryId = null)...
[ "0.55048525", "0.542653", "0.52852255", "0.525337", "0.524739", "0.5242296", "0.52008796", "0.5160702", "0.5143459", "0.509574", "0.5095631", "0.5074414", "0.50648654", "0.50399345", "0.5029431", "0.5012186", "0.5012054", "0.49530536", "0.49093136", "0.48678705", "0.4867715",...
0.55264014
0
======== setExec ======== Starts the server and supplies the path to the executable image path is a string of the form: ?comm=[:][&] where, is the full path to the executable is "DSLite", "Serial", ... is a communicationspecific value is an arbitrary namevalue pair that is specified by the client
function setExec(path, xdcroot, xdcpath) { logger.info("ROV Module: setExec(" + inst.name + ": " + path + ", " + xdcroot + ", ...)"); var prom; if (inst.server == null) { prom = start.call(this, xdcroot, xdcpath); if (inst.server == null) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function commandStartByOS(port, path, file){\r\n\r\n\tif(isWindowsOS()){\r\n\t\treturn 'set PORT='+port+' & cd /D '+path+' & node '+file;\r\n\t}else if(isLinuxsOS()) {\r\n\t\treturn 'cd '+path+ ' && PORT='+port + ' node ' + file ;\r\n\t}\r\n}", "function execute(tpl, params) {\n // Params type checking\n type....
[ "0.57240796", "0.5386415", "0.5212282", "0.52055734", "0.5097477", "0.50558335", "0.5045796", "0.50024456", "0.4978215", "0.49535468", "0.49354625", "0.48792648", "0.48669118", "0.4852552", "0.48436722", "0.48238254", "0.48030668", "0.478975", "0.4777998", "0.4773862", "0.477...
0.71022785
0
======== _exit ======== Terminate the xdctools server for the specified inst
function _exit(inst) { if (inst.server != null) { logger.info("ROV Module: _exit(" + inst.name + ") pid = " + inst.server.pid); /* in case, the target monitor hangs, we kill rather than * inst.server.stdin.write("exit" + os.EOL); */ inst.server.kil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exitHandler(options, err) {\n disconnectDevices();\n}", "function Terminate()\n{\n recordCompletion();\n\n storeDataValue( \"cmi.exit\", \"\" );\n\n terminateCommunication();\n}", "function exit() {\n\t\trunner.exit();\n\t}", "function exitHandler(options, err) {\n\tif(websocket && ws_opened) ...
[ "0.6624611", "0.64875144", "0.6452062", "0.64476764", "0.63317084", "0.63317084", "0.628431", "0.61236346", "0.6115559", "0.609307", "0.6088912", "0.6088531", "0.6073009", "0.60632044", "0.60626453", "0.60372514", "0.60142756", "0.60075724", "0.59788954", "0.5963519", "0.5940...
0.7419274
0
======== _findJRE ======== Locate JRE
function _findJRE(root) { var tokens = [ root + "/jre", root + "/../ccsv6/eclipse/jre", root + "/../ccsv7/eclipse/jre", __dirname + "/../../../../eclipse/jre" ]; for (var i = 0; i < tokens.length; i++) { var tmp = tokens[i]; /* TODO: update nodejs version so...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getJava() {\n let java = 'java';\n if (process.env.JAVA_HOME) {\n java = path.resolve(process.env.JAVA_HOME, 'bin', 'java');\n if (this.osType === 'Windows_NT') {\n java += '.exe';\n }\n }\n return java;\n }", "function detectJavaPlug...
[ "0.6073148", "0.5014599", "0.5013462", "0.49347705", "0.47992292", "0.47308564", "0.47136685", "0.45981723", "0.45763782", "0.44714966", "0.4469134", "0.44453466", "0.44123986", "0.440295", "0.43811518", "0.4357887", "0.42937842", "0.42933968", "0.42828742", "0.4273098", "0.4...
0.79409826
0
======== _findROV ======== Locate latest version of the ROV plugin Returns a path that's relative to the nodejs module path or, if the ROV plugin can't be found, null Assumes that this file and one entry of the nodejs module path have a fixed relative path to the CCS "root" folder (ccsv7) _and_ the eclipse plugins fold...
function _findROV() { /* get absolute path to the CCS "root" folder (ccsv7) */ var root = __dirname + "/../../../.."; /* get a relative path from node's module path to CCS root */ var prefix = "../../../"; /* find all installed versions of the com.ti.rov plugin */ var pdirs = [ root + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findLocalPlugin (plugin_src, searchpath, pluginInfoProvider) {\n loadLocalPlugins(searchpath, pluginInfoProvider);\n const parsedSpec = pluginSpec.parse(plugin_src);\n const versionspec = parsedSpec.version || '*';\n\n let latest = null;\n const versions = localPlugins.plugins[parsedSpec.id...
[ "0.5495475", "0.53760135", "0.48790455", "0.4834334", "0.4834334", "0.48258936", "0.47045508", "0.46433848", "0.46240252", "0.4597229", "0.45692876", "0.45529288", "0.45391768", "0.45192564", "0.45047823", "0.4499195", "0.44964066", "0.44852477", "0.4464275", "0.44605613", "0...
0.8634772
0
======== _checkBuffer ======== Extracts the next message surrounded by and from buffer If buffer is empty, the function returns null. This function should be called only after the caller verifies there are pending promises. Otherwise, the message will be dropped and, depending on the message, it could corrupt the commu...
function _checkBuffer(inst) { /* We need to have some kind of EOM signal to know when the ROV server * finished responding to a command. For now, we use "<EOM>" as a signal. */ if (inst.buffer.indexOf("<EOM>") != -1) { var first = inst.buffer.indexOf("<BOM>"); var last = inst.buffer.in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_readMessagesFromBuffer(data) {\n const messages = [];\n\n while (true) {\n const [msg, rest] = this._readMessageFromBuffer(data);\n if (msg !== null)\n messages.push(msg);\n if (rest === null || msg === null)\n return [messages, rest];\n...
[ "0.64029044", "0.61777586", "0.60994", "0.6043504", "0.6025014", "0.59672415", "0.5853994", "0.56903964", "0.55573", "0.5518456", "0.54949206", "0.54568326", "0.54358417", "0.5421415", "0.53970987", "0.53961885", "0.5349797", "0.5306666", "0.529247", "0.52841914", "0.5271255"...
0.7053414
0
update ping delay timeout
_setPingDelay() { this._clearPingDelay(); this._pingDelayId = setTimeout(() => this._ping(), this._options.pingDelay); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "schedulePing() {\n clearTimeout(this.pingIntervalTimer);\n this.pingIntervalTimer = setTimeout(() => {\n debug(\n \"writing ping packet - expecting pong within %sms\",\n this.server.opts.pingTimeout\n );\n this.sendPacket(\"ping\");\n this.resetPingTimeout(this.server.opts.p...
[ "0.73420435", "0.69882816", "0.6855327", "0.6774153", "0.67067945", "0.67067945", "0.6485811", "0.6477761", "0.6318176", "0.63139516", "0.6301214", "0.62687796", "0.6268037", "0.61694354", "0.6133431", "0.6088135", "0.60812247", "0.60546565", "0.60265857", "0.60127693", "0.59...
0.7488086
0
remove pending request from map
_removePendingRequest(id) { delete this._cbs[id]; delete this._subs[id]; delete this._unsub[id]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_updateAllRequests() {\n const requestQueue = this.requestQueue;\n for (let i = 0; i < requestQueue.length; ++i) {\n const request = requestQueue[i];\n if (!this._updateRequest(request)) {\n // Remove the element and make sure to adjust the counter to account for shortened array\n req...
[ "0.6675455", "0.6675455", "0.6625976", "0.66092277", "0.654016", "0.6381709", "0.6261612", "0.6179578", "0.6168659", "0.6129566", "0.61136883", "0.60856706", "0.60257834", "0.6007461", "0.6003225", "0.5969556", "0.5966066", "0.59539896", "0.592631", "0.5899771", "0.5891423", ...
0.71630216
0
remove successful request from map
_removeSuccessfulRequest(id) { delete this._cbs[id]; if (this._unsub[id]) { delete this._subs[this._unsub[id]]; delete this._unsub[id]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeRequestInfo() {\n var location = getLocation(this.url);\n var index = _.findIndex(requests,\n function (item) {\n return item.pathname === location.pathname\n });\n\n if (index >= 0) {\n requests.splice(0, 1);\n }\n }", ...
[ "0.6450834", "0.6408688", "0.6128125", "0.57616633", "0.56982785", "0.56866336", "0.56866336", "0.5665203", "0.56602997", "0.5623883", "0.5620451", "0.56013", "0.5562188", "0.5547112", "0.5539308", "0.55323154", "0.55323154", "0.5521028", "0.5515947", "0.54960245", "0.5492846...
0.67671525
0
========== STATIC CELLS ==========
drawStaticCells(cells) { const cellComponents = cells.map((cell, index) => { console.log(cell) return ( <VictoryTreemapCell x={cell.x} y={cell.y} name={cell.name} dx={cell.dx} dy={cell.dy} styles={{ cellText: this.props.styl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RENDER_createCells() {\n $.util.render(\"#tmp-cube\", 27); // How Many\n }", "function initConstants()\n{\n // THESE REPRESENT THE TWO POSSIBLE STATES FOR EACH CELL\n DEAD_CELL = 0; \n LIVE_CELL = 1; \n \n // COLORS FOR RENDERING\n LIVE_COLOR = \"#FF0000\";\n GRID_LINES_COLOR...
[ "0.6774728", "0.64756894", "0.64634275", "0.63612664", "0.6313951", "0.6274036", "0.6274036", "0.62595206", "0.6251741", "0.6198558", "0.6164845", "0.6133631", "0.610406", "0.6036159", "0.60102224", "0.5982236", "0.5969389", "0.59623533", "0.59500456", "0.59453624", "0.593488...
0.661459
1
Application Object Constructor The application aggregates a Controller and a Model (And a unit tester)
constructor(){ console.log("(1) Initializing Application"); // Initialize and pass application referance this.Controller = new Controller(this); this.Model = new Model(this); this.unitTester = new unitTester(this); this.id = "CurrTrackerV5.1 Launch Application"; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function App() {\n this.expressApp = express();\n this.middleware();\n this.routes();\n this.idGenerator = 102;\n this.Properties = new PropertyModel_1.PropertyModel();\n this.Users = new UserModel_1.UserModel();\n this.Bookings = new BookingModel_1.BookingModel();\...
[ "0.7262656", "0.7178455", "0.7151528", "0.7025866", "0.69540447", "0.6926879", "0.6847569", "0.6820187", "0.6816342", "0.68027884", "0.6744802", "0.6718943", "0.66601396", "0.6652027", "0.663601", "0.6635647", "0.66234356", "0.65542173", "0.6428087", "0.63910484", "0.6382854"...
0.72806555
0
execute a callback to prove it was run
function invokeCallback(cbFx, val) { ok(true, 'should get run'); cbFx( val ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "callback() {}", "get Callback() {}", "function done() {\n\t if (!invoked) {\n\t invoked = true;\n\n\t callback.apply(null, arguments);\n\t }\n\t }", "_run(cb) {\n cb();\n }", "_run(cb) {\n cb();\n }", "function doCallback() {\n if (callback) callback();\n }", "function ...
[ "0.7263858", "0.7114605", "0.71139026", "0.70290476", "0.70290476", "0.70257777", "0.69922304", "0.69343716", "0.69343716", "0.69343716", "0.69343716", "0.69343716", "0.69343716", "0.69343716", "0.69343716", "0.68817544", "0.68587625", "0.6822169", "0.6793493", "0.6769249", "...
0.72753954
0
return a promise as an if condition
function promiseCondition() { var def = $.Deferred(); setTimeout(function() { def.resolve(); }, 100); return def.promise(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "check (options) {\n return Promise.resolve(true)\n }", "function waitFor(cond) {return new Promise((ok,ko)=>{var tEnd=Date.now()+waitFor.timeout,ret,w4=function(){try{ret=cond();}catch(e){ret=false;}if(ret){return ok(ret);}else{if(tEnd<Date.now()){return ko();}}setTimeout(w4,waitFor.slee...
[ "0.672127", "0.65713185", "0.6524994", "0.6503872", "0.6440957", "0.643979", "0.6423127", "0.6289605", "0.62489", "0.62220865", "0.61516505", "0.61378837", "0.6078478", "0.6051596", "0.6029407", "0.597731", "0.5967163", "0.59290767", "0.5901615", "0.5899564", "0.58914286", ...
0.75772315
0