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
Add a listener to the markers to link to Wikipedia
function listenerMarker(marker, title) { // Add the location name as a label to the box var locationTitle = "<div id = 'main'><div id = 'location-title'><h1 id='wiki-title'>" + title + "</h1></div><div id = 'wikipedia-links'></div></div>"; // Variable to set the search based on the selected marker title var ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addListeners(marker) {\n\tgoogle.maps.event.addListener(marker, 'click', function(event) {\n\t\tvar item = this.data;\n\t\tvar url = item[\"url\"];\n\t\tplaceNews(url);\n\t\tplaceMetadata(item);\n\t});\n\n\tgoogle.maps.event.addListener(marker, 'mouseover', function(event) {\n\t\tthis.infowindow.open(map,...
[ "0.66778857", "0.6513049", "0.6276305", "0.6223054", "0.62051904", "0.6201237", "0.61502725", "0.60540575", "0.6053321", "0.60219175", "0.59196097", "0.59178233", "0.5895292", "0.5867199", "0.5857264", "0.5837276", "0.58267707", "0.5813374", "0.5810049", "0.57870543", "0.5770...
0.7137419
0
Profile pic + edit pic widget
function openUploadWidget () { cloudinary.openUploadWidget({ cloud_name: 'ddanielnp', upload_preset: 'profile_preset', multiple: false }, function (error, result) { $('.profile_image').attr('src', result[0].eager[0].secure_url) $('#account_profile_image').val(result[0].eager[0].secure_url) }) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleEditAvatarClick() {\n setEditAvatarPopupOpen(true);\n }", "displayPicture(url){this.newPictureContainer.attr('src',url);page('/add');this.imageCaptionInput.focus();this.uploadButton.prop('disabled',true)}", "function profilepic(){\n\t\tvar ruta = \"/image/create\";\n\t\t$.ajax({\n\t\t\...
[ "0.6682591", "0.6642812", "0.66364604", "0.66307807", "0.66217077", "0.65514994", "0.65498054", "0.6469975", "0.6356042", "0.62749577", "0.6268612", "0.6257144", "0.6241634", "0.6217187", "0.62048507", "0.6194402", "0.6186102", "0.61820585", "0.61670613", "0.61648935", "0.613...
0.68560195
0
JavaScript function to get the week end date
function endOfWeek(date) { var lastday = date.getDate() - (date.getDay() - 1) + 6; return new Date(date.setDate(lastday)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function weekEnd() {\r\n var today = new Date().getDate();\r\n var month = new Date().getMonth()+1;\r\n var year = new Date().getFullYear();\r\n var now = parseInt((new Date(month+\"/\"+today+\"/\"+year).getTime()-Date.UTC(1970,0,1))/1000);\r\n var diff = 6 - new Date().getDay();\r\n return now +...
[ "0.8173743", "0.69554305", "0.6949125", "0.69059056", "0.689223", "0.68617815", "0.6749403", "0.662587", "0.657956", "0.65356785", "0.650887", "0.6502386", "0.64899075", "0.64850503", "0.6472711", "0.6451981", "0.6432511", "0.6423359", "0.64145637", "0.6407812", "0.6407812", ...
0.79428315
1
Checkpoint 3 | Moving the queen
function moveForward (){ let t; let t1; switch(queen.direction){ case "N": t=queen.postion.i-1; if(t>8 || t<0){ console.log("Not Possible to move"); } else{ queen.postion.i=t; } break; cas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function promoteQueens() {\n _pieces\n .filter(p => p.piece === PEAO && p.row === 0)\n .forEach(p => p.piece = RAINHA); \n}", "function queenMove(currentSpace, nextSpace, pieceWillBeHere, pieceWillNotBeHere) {\n var x1 = currentSpace[0].charCodeAt(),\n x2 = nextSpace[0].charCodeAt(),\n...
[ "0.66620415", "0.664721", "0.6626382", "0.63935894", "0.6291934", "0.6289263", "0.6218421", "0.60749406", "0.6055872", "0.6048353", "0.59837186", "0.5955017", "0.59037113", "0.58978814", "0.5873395", "0.585754", "0.5847972", "0.58293325", "0.57289565", "0.5673819", "0.5673819...
0.71463186
0
Returns an object containing the computed style and the combined vertical padding size, combined vertical border size and boxsizing value. This style is returned as string to be applied as attribute of an element.
function calculateStyling(node) { const reactId = node.getAttribute('data-reactid'); // calculate the computed style only once it's not in the cache if (!computedStyleCache[reactId]) { // In order to work with legacy browsers the second paramter for pseudoClass // has to be provided http://caniuse.com/#f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStyle(element) {\n var style = window.getComputedStyle(element);\n var dimensions = element.getBoundingClientRect();\n return {\n fontSize: style.fontSize, \n fontFamily: style.fontFamily, \n fontWeight: style.fontWeight, \n ...
[ "0.6799668", "0.6280145", "0.62133175", "0.6071726", "0.6045806", "0.60362667", "0.5973988", "0.5928247", "0.5911143", "0.5883403", "0.58428556", "0.57795817", "0.57553446", "0.5752419", "0.57324106", "0.5723909", "0.5723092", "0.571549", "0.57139444", "0.57120126", "0.570451...
0.63125086
1
Md Modal Enter Animation
function mdEnterAnimation(Animation, baseEl) { const baseAnimation = new Animation(); const backdropAnimation = new Animation(); backdropAnimation.addElement(baseEl.querySelector('ion-backdrop')); const wrapperAnimation = new Animation(); wrapperAnimation.addElement(baseEl.querySelector('.modal-wrap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mdEnterAnimation(Animation, baseElm) {\n const baseAnimation = new Animation();\n const backdropAnimation = new Animation();\n backdropAnimation.addElement(baseElm.querySelector('.modal-backdrop'));\n const wrapperAnimation = new Animation();\n wrapperAnimation.addElement(baseElm.querySelec...
[ "0.73490626", "0.69623274", "0.6875627", "0.6662737", "0.64639467", "0.62895614", "0.6046325", "0.59910625", "0.596152", "0.59303164", "0.5879151", "0.58324826", "0.58275735", "0.58248687", "0.5819712", "0.58001095", "0.5798906", "0.57964396", "0.5794256", "0.5780218", "0.575...
0.72004694
1
Md Modal Leave Animation
function mdLeaveAnimation(Animation, baseEl) { const baseAnimation = new Animation(); const backdropAnimation = new Animation(); backdropAnimation.addElement(baseEl.querySelector('ion-backdrop')); const wrapperAnimation = new Animation(); const wrapperEl = baseEl.querySelector('.modal-wrapper'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mdLeaveAnimation(Animation, baseElm) {\n const baseAnimation = new Animation();\n const backdropAnimation = new Animation();\n backdropAnimation.addElement(baseElm.querySelector('.modal-backdrop'));\n const wrapperAnimation = new Animation();\n const wrapperElm = baseElm.querySelector('.mod...
[ "0.72147554", "0.68184924", "0.6691639", "0.66676027", "0.66676027", "0.66161644", "0.65302855", "0.6509006", "0.6505121", "0.6505121", "0.6505121", "0.6505121", "0.6505121", "0.6505121", "0.64734316", "0.64734316", "0.64533454", "0.64401627", "0.6403774", "0.6377878", "0.637...
0.698505
1
Get the most recently opened modal overlay.
getTop() { return modals.get(getHighestId()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "openLastModal() {\n const lastOpenModal = this.lastOpenModal;\n\n if (this.element.querySelectorAll('.invalid-feedback').length === 0) {\n return;\n }\n\n if (typeof lastOpenModal === 'object' && lastOpenModal.slug === this.data.get('slug')) {\n this.element.classL...
[ "0.65356547", "0.64678705", "0.6274302", "0.62169564", "0.61495906", "0.5992283", "0.59790003", "0.59699017", "0.59699017", "0.5844782", "0.5843398", "0.5797066", "0.57969594", "0.57629925", "0.5759361", "0.5701553", "0.5689499", "0.56460387", "0.5639772", "0.5623569", "0.555...
0.717929
0
Middleware functions middleware to check if a user owns the place post
function checkPlaceOwnership(req, res, next) { if (req.isAuthenticated()) { Place.findById(req.params.id, function(err, foundPlace) { if (err) { req.flash('error', 'Place not found'); res.redirect('back'); } else { // does user own the post if (foundPlace.author.id.equa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function validateOwnership(req, res, next){\n const {username} = req.decodedJwt;\n const userId = await db('users').select('id').where('username', username).first();\n const postId = req.params.id;\n const post = await db('posts').select('creator_id').where('id', postId).first();\n if (userId....
[ "0.6930542", "0.651814", "0.6500142", "0.6396062", "0.63367176", "0.63198596", "0.60841715", "0.5924203", "0.58683836", "0.5857322", "0.5847952", "0.58118653", "0.58086324", "0.575999", "0.5751307", "0.5731931", "0.5685175", "0.5671956", "0.5645832", "0.5610669", "0.56000525"...
0.7994342
0
middleware to check if a user owns the comment
function checkCommentOwnership(req, res, next) { if (req.isAuthenticated()) { Comment.findById(req.params.comment_id, function(err, foundComment) { if (err) { console.log('Error with edit comment route ', err); res.redirect('back'); } else { // does user own the comment ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkCommentOwnership(req,res,next){\n // is user logged in?\n if(req.isAuthenticated()){\n Comment.findById(req.params.comment_id,function(err,foundComment){\n if(err){\n res.redirect(\"back\");\n } else {\n // if logged in is the user owns...
[ "0.77853847", "0.76770085", "0.6908786", "0.6834474", "0.68206286", "0.6761578", "0.65450114", "0.6499035", "0.63550746", "0.6336463", "0.62864417", "0.6278765", "0.6208913", "0.62001663", "0.61014545", "0.59566283", "0.5918327", "0.5914959", "0.5908924", "0.5860305", "0.5857...
0.78384453
0
Parse a value as a PIXI.Point.
function parsePoint(val) { var arr; if (typeof val === 'string') { arr = val.split(',').map(Number) ; } else if (typeof val === 'number') { arr = [val]; } else if (Array.isArray(val)) { // shallow copy the array arr = val.slice(); } else if ("x" in val) { arr = [val.x, val.y]; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parsePoint (string) {\n string = string.trim()\n const pattern = /^(\\d+),(\\d+)$/\n const match = string.match(pattern)\n\n if (match == null) {\n console.log(`invalid target position ${string}`)\n process.exit(1)\n }\n\n const x = parseNumber(match[1])\n const y = parseNumber(match[2])\n\n ...
[ "0.63911074", "0.6185836", "0.6083481", "0.58569676", "0.57320774", "0.5723446", "0.5707461", "0.56915295", "0.5602869", "0.55646825", "0.554021", "0.554011", "0.54638284", "0.5455249", "0.53891057", "0.5380008", "0.53740335", "0.53645426", "0.53564554", "0.531194", "0.530703...
0.7102304
0
Any props listed in propnames are applied to the display object
transferDisplayObjectPropsByName(oldProps, newProps, propsToCheck) { let displayObject = this._displayObject; for (var propname in propsToCheck) { if (typeof newProps[propname] !== 'undefined') { setPixiValue(displayObject, propname, newProps[propname]); } else if (typeof oldProps[propname] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nameProps(obj) {\n\n}", "function displayProperties(properties) {\n var propDiv = $(\"#propList\");\n for (var i = 0; i < properties.length; i++) {\n var prop = properties[i];\n if (!prop) continue;\n\n var card = prop.card;\n propertyDatabase[card.title] = prop;\n spaceTitle[prop.id] =...
[ "0.6067101", "0.6007559", "0.5966317", "0.5890058", "0.57644564", "0.5759586", "0.57235324", "0.5709162", "0.5641647", "0.56013215", "0.5528005", "0.54884756", "0.5488323", "0.5476245", "0.5469048", "0.5460908", "0.54537046", "0.54428864", "0.5439899", "0.54243034", "0.541844...
0.63019323
0
Recursive function to apply the HCS algorithm, given the current graph as input.
function hcs(nodes, edges, zoomed) { // A graph with one or two nodes is ignored. //if(edges.length <= 1) return; // Get the clusters by calculating the minimum spanning tree (Kruskal). var clusters = kruskal(nodes, edges); // Split clusters into subgraphs. _.each(clusters, function(cluster, i) { v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scc () {\r\n\tvar secs=3, nc = 0, i;\t\r\n\r\n\tfor (i = 0; i < nodes.length; i++) visited[i] = 0;\r\n\tpostnum = new Array;\r\n\tcomp = new Array;\r\n\tfor (i = 0; i < nodes.length; i++) comp[i] = 0;\r\n\t\r\n\tbegin = ((new Date()).valueOf() - time0)/1000;\r\n\tdfs_cnt = 0;\r\n\tcurr = 0;\r\n\t\r\n\t// ...
[ "0.57182807", "0.5441882", "0.5057228", "0.49495187", "0.49218997", "0.49218997", "0.4895737", "0.4883879", "0.48330486", "0.48004964", "0.4795325", "0.47841406", "0.47750464", "0.47679767", "0.47636276", "0.4747124", "0.47319275", "0.47101262", "0.4703357", "0.46917057", "0....
0.6038372
0
XOR hex strings function
function XOR_hex(a, b) { var res = "", i = a.length, j = b.length; while (i-- >0 && j-- >0) res = (parseInt(a.charAt(i), 16) ^ parseInt(b.charAt(j), 16)).toString(16) + res; //document.write(res+"<br>"); //comment it return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pseudo_XOR_str(a, b) {\n // convert strings to ASCII char codes\n var aList = a.split('');\n var bList = b.split('');\n var xored = '';\n for (var i = 0; i < aList.length && i < bList.length; i++) {\n xored += String.fromCharCode(aList[i].charCodeAt() ^ bList[i].charCodeAt());\n }\n\n return xor...
[ "0.74764824", "0.7339652", "0.73152536", "0.72240096", "0.71544296", "0.69428533", "0.69428533", "0.69428533", "0.69428533", "0.69428533", "0.69428533", "0.69428533", "0.69428533", "0.69428533", "0.69428533", "0.69428533", "0.69428533", "0.69428533", "0.69428533", "0.69428533",...
0.7977843
0
sec_exponent = hash(passphrase) XOR hash(random_seed)
function genCalcHash() { //document.write("<br>random_seed "+random_seed); //test random_seed value in this function. if(random_seed == false){//if random_seed not active //using original brainwallet function var hash = Crypto.SHA256($('#pass').val()); }else{ //using brainwallet with specifie...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SecureRandom() {}", "function unblindEncrypt(N, e, s, b1){\r\n unblind = (s.multiply(b1)).mod(N);\r\n hash = unblind.modPow(e,N);\r\n return hash; \r\n }", "function Generate_seed() {\n \tvar i, j, k = \"\";\n\n\taddEntropyTime();\n\tvar seed = keyFromEntropy();\n\n \tvar prng =...
[ "0.6191842", "0.61784655", "0.6123357", "0.60613936", "0.5983504", "0.5974765", "0.5948349", "0.59465826", "0.5924342", "0.59152174", "0.5915045", "0.58650243", "0.58620846", "0.58620846", "0.58460575", "0.58451205", "0.58256304", "0.58235013", "0.5806713", "0.5801921", "0.57...
0.6819568
0
to don't start translate twise, on autoclick to two buttons "from", and "to", when converter runned by permalink.
function start_translate_once(){ if(no_translate === false){ //if need translate, after "from"-button clicked translate(); //translate "from" -> "to" } else{ //else no_translate = false; //set this to false, and translate on second call. } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function translateStory() {\n stop = true;\n let story = document.getElementById(\"story\");\n let text = document.getElementById(\"hiddenText\").innerHTML;\n story.innerHTML = text;\n document.getElementById(\"translateButton\").disabled = true;\n}", "function enableReTranslate() {\n try {\n ...
[ "0.61691135", "0.59315723", "0.58488923", "0.58487016", "0.57959247", "0.56545544", "0.54376626", "0.53869313", "0.53869313", "0.53869313", "0.5382088", "0.5372935", "0.5325429", "0.5303797", "0.5286827", "0.52322215", "0.5227328", "0.52118295", "0.5176746", "0.5170546", "0.5...
0.7457545
0
funtion to show and hide download link (button) for empty or filled readonly textarea's
function linkText(input, link, fileName) { //IDs and filename link.style.display = 'none' ? 'block': 'block'; updateLink(input, link) link.download = fileName; function onInput() { updateLink(input, link); } input.addEventListener("input", onInput); return onInput; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleDownload() {\n\t\tif ($(opts.sDateEl).val() == \"\" || $(opts.eDateEl).val() == \"\") {\n\t\t\t$(opts.submitEl).attr(\"disabled\", \"disabled\");\n\t\t\treturn\n\t\t}\n\n\t\tif ($(opts.stationEl).val() == null || $(opts.stationEl).val().length < 1) {\n\t\t\t$(opts.submitEl).attr(\"disabled\", \"disa...
[ "0.6361148", "0.62641287", "0.60833424", "0.60799193", "0.5944634", "0.5897755", "0.5895028", "0.5881942", "0.58200055", "0.57435036", "0.5734244", "0.5701929", "0.56759006", "0.567169", "0.5666598", "0.56370264", "0.5589387", "0.5563891", "0.5553763", "0.553242", "0.55314946...
0.6430001
0
Gets the school of a teacher user
async function getTeacherSchool () { try { //Get School ///The api to call to get the user's school, complete with query string parameters var api = apiRoot + "/user/school?email=" + userSession.auth.email; ///Getting the school via api call var school = await callGet...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getschool() {\n return this.school;\n }", "getSchool() {\n return this.school\n }", "getSchool () {\n return this.school;\n }", "getSchool() {\n return this.school;\n }", "getSchool(){\n \n return this.school; \n }", "getSchool() {\r\n return th...
[ "0.65584195", "0.6548625", "0.6439859", "0.6402818", "0.63748693", "0.63692194", "0.6262553", "0.6262553", "0.6259057", "0.6259057", "0.6259057", "0.6042663", "0.5961466", "0.5930281", "0.58334124", "0.58334124", "0.58224803", "0.57982725", "0.57062256", "0.56872344", "0.5645...
0.6619926
0
Compiles a string containing a select item with corresponding text and value /text: The label and the value of the option
function newSelectItem(text) { //String compilation ///Correctly formats HTML to be appended to the input box, returned at the end of the function var option = "<option value='" + text + "'>" + text + "</option>"; return option }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newSelectItemValue(text, value) {\r\n //String compilation\r\n ///Correctly formats HTML to be appended to the input box, returned at the end of the function\r\n var option = \"<option value='\" + value + \"'>\" + text + \"</option>\";\r\n\r\n return option\r\n}", "function getOptionMarkup(v...
[ "0.7025754", "0.6756074", "0.66983056", "0.6625299", "0.6612424", "0.652449", "0.63422954", "0.6278229", "0.6237378", "0.62366706", "0.622077", "0.62202513", "0.62135094", "0.6147601", "0.6081405", "0.6074477", "0.60526264", "0.60469925", "0.6027036", "0.59970224", "0.5996174...
0.6947374
1
Get the new user's school from the school select box (hidden for teachers since they can only add to their own school)
function getSchool() { return $("#school-select").val(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getTeacherSchool () {\r\n try {\r\n //Get School\r\n ///The api to call to get the user's school, complete with query string parameters\r\n var api = apiRoot + \"/user/school?email=\" + userSession.auth.email;\r\n\r\n ///Getting the school via api call\r\n var s...
[ "0.71248776", "0.64966244", "0.62645996", "0.62578255", "0.62278783", "0.6216319", "0.61585057", "0.61417276", "0.61417276", "0.61417276", "0.614113", "0.6066145", "0.6066145", "0.59862685", "0.5966939", "0.59265", "0.5913436", "0.5908952", "0.5831703", "0.5793388", "0.574365...
0.7195152
0
Compiles a string containing a select item with corresponding text and value, with a different text and value /text: The label of the option /value: The value of the option
function newSelectItemValue(text, value) { //String compilation ///Correctly formats HTML to be appended to the input box, returned at the end of the function var option = "<option value='" + value + "'>" + text + "</option>"; return option }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newSelectItem(text) {\r\n //String compilation\r\n ///Correctly formats HTML to be appended to the input box, returned at the end of the function\r\n var option = \"<option value='\" + text + \"'>\" + text + \"</option>\";\r\n\r\n return option\r\n}", "function newSelectItem(text) {\r\n /...
[ "0.7087655", "0.7087655", "0.6780448", "0.6548023", "0.6520727", "0.65009123", "0.6426927", "0.63352144", "0.630784", "0.62988424", "0.6196908", "0.6194369", "0.6169873", "0.6167019", "0.61255634", "0.61002666", "0.60947514", "0.60578984", "0.5993802", "0.5985228", "0.5979372...
0.7147045
0
Loads the qualifications from S3. Runs on class change
async function loadQualification() { //Error checking ///Basic set up for all API calls. In the case of an error it generates an error bar with an appropriate message ///For APi calls the message is generated by the promise result ///In the case of page changes they are reversed in the catch stateme...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function load (params, useS3) {\n let { source, scraper, date, tz } = params\n const { _sourceKey, timeseries } = source\n\n if (!isLocal) useS3 = true // Force S3 in production\n const loader = useS3 ? s3 : local\n\n let folders = await loader.getFolders(_sourceKey)\n\n /**\n * All cache data is sav...
[ "0.5577574", "0.55755514", "0.5573227", "0.5530574", "0.5363389", "0.53573114", "0.52832806", "0.52820295", "0.5280972", "0.51188827", "0.50905144", "0.50440276", "0.5027728", "0.49705407", "0.49573076", "0.4952295", "0.49445972", "0.48504585", "0.48385322", "0.4835078", "0.4...
0.58095694
0
Compiles an API URI for the filter function. Uses REST for a GET method /filePath: The location of the index file to be pulled form S3 /isTopics: If the file to be pilled is for the topics, changing the file name to be selected in the function
function filterAPI(filePath, isTopics) { //API construction ///Variable to store the URI, to be passed out at the end of the function var uri = ""; ///Adds the API root, the correct resource and the filepath parameter to the URI uri = apiRoot + "/question/filter-recall?filePath=" + filePath; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getSampleFile (filters) {\n console.log(\"Filters: \", filters);\n return client.get(\"/request/file/data\", {\n params: {\n filters: filters\n }\n }).then(response => response.data);\n }", "get url() {\n return `/api/projects/file/${this.projectId}${this.filePath}`\n }", "get __...
[ "0.600984", "0.57313085", "0.5711236", "0.56909883", "0.55580616", "0.5531287", "0.5472509", "0.5446206", "0.5437228", "0.54223466", "0.54160595", "0.5352759", "0.5313205", "0.52863264", "0.526785", "0.5260173", "0.5230511", "0.5223084", "0.51655376", "0.51567084", "0.5151047...
0.73807037
0
Loads new exam boards from S3 based on the selected qualification. Runs on qualification change
async function newQualification() { try { clearStatusBar(); //Variables ///Array containing the data pulled from the file system var examBoards = []; ///The file path of the qualification, therefore the location of the index file containing the exam boards ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function loadQualification() {\r\n //Error checking\r\n ///Basic set up for all API calls. In the case of an error it generates an error bar with an appropriate message\r\n ///For APi calls the message is generated by the promise result\r\n ///In the case of page changes they are reversed in the ...
[ "0.6001793", "0.49852926", "0.48895955", "0.47857308", "0.47377408", "0.47147375", "0.46407804", "0.4619754", "0.46029446", "0.45475775", "0.45285234", "0.4512619", "0.4507141", "0.44997257", "0.44760713", "0.4458274", "0.44535568", "0.44454995", "0.44280413", "0.43990362", "...
0.5292449
1
Loads new subjects from S3 based on the selected exam board. Runs on exam board change
async function newExamBoard() { try { clearStatusBar(); //Variables ///Array containing the data pulled from the file system var subjects = []; ///The file path of the qualification, therefore the location of the index file containing the subjects userSess...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function newSubject() {\r\n try {\r\n clearStatusBar();\r\n\r\n //Variables\r\n ///Array containing the topics pulled from the file system\r\n var topics = [];\r\n\r\n ///The file path of the topics file\r\n userSession.filePath = encodeURIComponent($(\"#qualifica...
[ "0.6422793", "0.5382466", "0.52566165", "0.5058318", "0.5031858", "0.49604407", "0.48724142", "0.48523673", "0.47788593", "0.47581184", "0.47153354", "0.46454036", "0.46211478", "0.4619315", "0.46081793", "0.4599215", "0.45979616", "0.45628718", "0.45542118", "0.45499888", "0...
0.5579542
1
Loads new topics from S3 based on the selected subject
async function newSubject() { try { clearStatusBar(); //Variables ///Array containing the topics pulled from the file system var topics = []; ///The file path of the topics file userSession.filePath = encodeURIComponent($("#qualification").val()) + "/" + en...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectTopic(topic){\n currentSubject = topic;\n var topicObj = getItemTopicsData(currentSubject);\n \n if(topicObj.data.length > 0){\n //show the stickers from the data stored\n showStickers(topicObj.data);\n }\n else\n {\n //search for the topic in the API and lo...
[ "0.5418341", "0.5414992", "0.539961", "0.52794945", "0.5245186", "0.5147812", "0.5146491", "0.5127913", "0.5123781", "0.508934", "0.5070045", "0.50285286", "0.49908", "0.49585855", "0.49537778", "0.4947652", "0.49464804", "0.49368343", "0.49343607", "0.48952124", "0.48795077"...
0.65306044
0
Generates a checkbox for a theme /name: the display text and the value of the box /section: the section that the box belongs to /isChild: a boolean variable to store whether the box should be indented, as it is a topic not a section
function newThemeBox(name, section, isChild) { //Variables ///Stores the string for the check box - returned at the end of the function var checkBox = ""; ///A temporary variable containing the class to be given to the box - made from the section and converted into a CSS friendly form var box...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createCheckBox(rootNode) {\n var x = document.createElement(\"INPUT\");\n x.setAttribute(\"type\", \"checkbox\");\n rootNode.appendChild(x);\n}", "function Themes_PreProcessCheckBox(theObject)\n{\n\tif (!(theObject.TreeGridCell || theObject.UltraGrid))\n\t{\n\t\ttheObject.Properties[__NEMESIS_P...
[ "0.58463305", "0.56610626", "0.5640784", "0.5626973", "0.5623425", "0.55862707", "0.5574312", "0.54765826", "0.5437754", "0.5429713", "0.5413612", "0.5400392", "0.53492063", "0.5347607", "0.5310897", "0.5288871", "0.5285536", "0.5271074", "0.525091", "0.5248687", "0.523125", ...
0.75481063
0
Converts inputted text into a CSS friendly form
function textToCSS(text){ //Variables ///A temporary variable to store the output - returned at the end of the function var output = text; //Replacing ///Uses regex to remove all invalid characters, excluding spaces output = output.replace(/[.,\/#!$%\^&\*;:{}=\-_`~()]/g,""); ///...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatText(text){\n text = text.replace(/\\r/g, \" \").replace(/\\n/g, \" \");\n text = text.replaceAll(/#w(.*?)#w;/g, \"<span class='text-important'>$1</span>\");\n text = text.replaceAll(/##(.*?)##;/g, \"<span class='text-title'>$1</span>\");\n text = text.replaceAll(/#d(.*?)#d;/g, \"<span c...
[ "0.64595634", "0.6078172", "0.59284425", "0.57881045", "0.57595974", "0.5756237", "0.57179534", "0.5676695", "0.5657966", "0.56413543", "0.5641341", "0.564009", "0.56207484", "0.5580118", "0.550416", "0.5490892", "0.54838085", "0.546492", "0.545081", "0.545081", "0.545081", ...
0.7621912
0
Selects or deselect every box in the topics section /boxID: the id of the select all box
function selectAll(boxID){ try { clearStatusBar(); //Variables ///Stores whether the boxes are to be checked or unchecked var isSelected = $("#" + boxID).prop("checked"); //Selection ///Changes the checked property of every check box in the topic-select c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectAllMessages(){\r\n checkBoxSelection(true, 'divInbox');\r\n}", "function massSelect(boxID, boxClass) {\r\n try {\r\n clearStatusBar();\r\n\r\n //Variables\r\n ///The checked property of the box that was selected to run the function - boolean\r\n var isSelected = $...
[ "0.6569273", "0.65340936", "0.65062183", "0.63720834", "0.6340087", "0.6217457", "0.6194065", "0.61134493", "0.6112858", "0.6080852", "0.60283", "0.6019054", "0.59938973", "0.596153", "0.5954622", "0.5944889", "0.5915259", "0.590929", "0.5900969", "0.5885362", "0.5871999", ...
0.75814974
0
The onClick for a topic check box handles counting and mass selectors
function massSelect(boxID, boxClass) { try { clearStatusBar(); //Variables ///The checked property of the box that was selected to run the function - boolean var isSelected = $("#" + boxID).prop("checked"); ///A boolean variable to aid in counting single boxes ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateNumChecked() {\r\n //Display updates\r\n ///If the number of topics is 0\r\n if(userSession.numTopics === 0) {\r\n ///Change the text to ask the user to select a topic\r\n $(\"#num-topics-selected\").text(\"Please select one or more topic\");\r\n ///Disable the do quest...
[ "0.64933646", "0.61174846", "0.6115965", "0.6107738", "0.60175896", "0.5995235", "0.5987772", "0.59834343", "0.5936064", "0.5925216", "0.5902603", "0.59004277", "0.58369833", "0.57825404", "0.5779246", "0.57717127", "0.57633483", "0.5754282", "0.5750662", "0.5738287", "0.5730...
0.6349253
1
Updates the section boxes and the select all box /isSelected: stores whether the box that was changed was selected or deselected /boxClass: the class of the box that was checked
function updateMassSelectors(isSelected, boxClass){ //Variables ///Boolean storing whether all of the boxes have been selected var isAllSelected = true; //Checking and updating ///If the box was selected if(isSelected) { ///For each box with that class $("." + boxClass)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleCheckboxes(){\n\n for(let cb of this.checkboxes){\n\n if(cb.selected){\n cb.element.classList.add(SELECTED_CLASS);\n }\n else{\n cb.element.classList.remove(SELECTED_CLASS);\n }\n\n cb.element.checked = cb.selected;\n...
[ "0.65773946", "0.6511198", "0.6476148", "0.6399479", "0.63304263", "0.60875505", "0.60618377", "0.6051605", "0.60130143", "0.59155905", "0.5915369", "0.58474654", "0.58070034", "0.5723496", "0.5712592", "0.5698819", "0.56966114", "0.56828654", "0.5665903", "0.564991", "0.5628...
0.7762608
0
Get the ID of the class from the class selector box
function getClassID() { return $("#class-name-select").val(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_id_from_class(full_class){\n\t\t\t\tvar id_class = full_class.split(' ')[1];\n\t\t\t\tvar id_split = id_class.split('-');\n\t\t\t\treturn id_split[id_split.length-1];\n\t\t\t}", "function id_from_class_pair(el, action) {\n var r = new RegExp(\".*\"+action+\"_([^ ]+).*\")\n return el.className.repl...
[ "0.6513845", "0.64229715", "0.61937624", "0.61859137", "0.61793727", "0.6105596", "0.601548", "0.59763134", "0.5882414", "0.5868419", "0.5868419", "0.5862654", "0.58590215", "0.5819977", "0.57676274", "0.5730096", "0.56896514", "0.56683546", "0.561879", "0.5615512", "0.561360...
0.7306029
0
Get the name of the class from the class selector box
function getClassName() { return $("#class-name-select option:selected").text(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getClass() {\n return this._executeAfterInitialWait(() => this.currently.getAttribute('class'));\n }", "function className(name) {\n\treturn document.getElementsByClassName(name);\n}", "get className() {\n return this.classList.toString();\n }", "className() {\n return `infobox ${t...
[ "0.69289815", "0.6824403", "0.66318965", "0.66184044", "0.6563717", "0.6523353", "0.6516241", "0.6455917", "0.6440041", "0.63977563", "0.63977563", "0.63872325", "0.6327616", "0.6320664", "0.62841743", "0.6280506", "0.6279868", "0.6275328", "0.62467676", "0.6233365", "0.62194...
0.75589955
0
Gets the current deadline in a format that the backend finds friendly
function getDeadline() { //Deadline ///The deadline as a time var deadline = new Date($("#new-assignment-deadline").val()) ///Converting the deadline ISO string - e.g. '2021-11-03T15:33:31.424Z' deadline = deadline.toISOString(); ///Cutting off the Z return deadline.substring(0, 2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getEditDeadline() {\r\n //Deadline\r\n ///The deadline as a time\r\n var deadline = new Date($(\"#edit-assignment-deadline\").val())\r\n\r\n ///Converting the deadline ISO string - e.g. '2021-11-03T15:33:31.424Z'\r\n deadline = deadline.toISOString();\r\n\r\n ///Cutting off the Z\r\n ...
[ "0.7533293", "0.6848073", "0.6575901", "0.6387771", "0.6313407", "0.6234715", "0.5998393", "0.59108704", "0.5909197", "0.5873181", "0.57672673", "0.57664293", "0.5739387", "0.5699601", "0.5622713", "0.5564251", "0.54899585", "0.5475507", "0.5467756", "0.5467618", "0.5454787",...
0.7760381
0
Generate an edit assignment row for the assignment page /assignment: the data of the assignment to be displayed on the row /index: the number of the assignment on the page
function generateAssignmentRow(assignment, index) { //Generate Assignment Row ///Array to store each line of the row - concatenated and returned at the end of the function var assignmentRow = []; ///Push the assignment row to the array assignmentRow.push( '<div class="row assignment-...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editRow(userId, classId, assignId, num) {\n // initialize variables\n editUrl = \"/users/\" + userId + \"/classes/\" + classId + \"/assignments/\" + assignId + \"/edit\";\n deleteUrl = \"/users/\" + userId + \"/classes/\" + classId + \"/assignments/\" + assignId;\n deleteAction = \"/users/\" + userId ...
[ "0.59851897", "0.5867682", "0.58248085", "0.58206385", "0.5672574", "0.56137353", "0.5606158", "0.56058687", "0.55968577", "0.5496577", "0.54953533", "0.5490985", "0.5482176", "0.5439143", "0.543253", "0.54288965", "0.5422314", "0.54115856", "0.5398156", "0.53882396", "0.5384...
0.685902
0
Changes the assignment page by + or 1 /Change: how many pages to change by
function newAssignmentPage(change) { //Variables ///The number of assignments on a page, determined by a select box var pageSize = $("#frm-assignment-page-num").val(); ///How many assignments to change by var changeBy = pageSize * change; ///How many assignments are now in previous pag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setAssignmentPage(pageNumber) {\r\n //Variables\r\n ///The number of assignments on a page, determined by a select box\r\n var pageSize = $(\"#frm-assignment-page-num\").val();\r\n\r\n ///The number of assignments now on previous pages\r\n var offset = pageSize * pageNumber;\r\n\r\n\r\n ...
[ "0.7264013", "0.70923835", "0.70626295", "0.68740696", "0.6661056", "0.65890545", "0.65738094", "0.65698093", "0.6537732", "0.6513944", "0.65116006", "0.64740545", "0.642348", "0.6401871", "0.63958293", "0.633751", "0.6323601", "0.6275345", "0.6251957", "0.6236614", "0.623181...
0.75955826
0
Sets the assignment page to a new page /pageNumber: the number of the page you are now changing to
function setAssignmentPage(pageNumber) { //Variables ///The number of assignments on a page, determined by a select box var pageSize = $("#frm-assignment-page-num").val(); ///The number of assignments now on previous pages var offset = pageSize * pageNumber; //Change Page ///If ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newAssignmentPage(change) {\r\n //Variables\r\n ///The number of assignments on a page, determined by a select box\r\n var pageSize = $(\"#frm-assignment-page-num\").val();\r\n\r\n ///How many assignments to change by\r\n var changeBy = pageSize * change;\r\n\r\n ///How many assignments ...
[ "0.747657", "0.7271067", "0.71005934", "0.7038214", "0.7029697", "0.70048887", "0.69926316", "0.698533", "0.69735587", "0.68852234", "0.6753685", "0.6744563", "0.6743043", "0.66587156", "0.6657604", "0.6656475", "0.66373086", "0.6620154", "0.6589177", "0.6584368", "0.6579689"...
0.82418174
0
Generates the page markers that go underneath the delete page /currentPage: which page is currently selected
function generateAssignmentPageMarkers (currentPage) { //Generate Page Markers ///Empty out the current page marker row $("#assignment-page-markers").empty(); ///The number of assignments on a page, determined by a select box var pageSize = $("#frm-assignment-page-num").val(); ///How m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deletePage() {\n var $wp = $('.write-pages li'); // the list of book pages\n var $page = $($wp.get(editIndex)); // the current page\n $page.remove(); // remove it\n setupEditContent();\n setModified();\n }", "function deletePage() {\r\n if...
[ "0.6137889", "0.60316116", "0.5962636", "0.5771472", "0.57675165", "0.57591325", "0.5758625", "0.571618", "0.56567836", "0.5653438", "0.5650903", "0.5641945", "0.5624501", "0.5624158", "0.5620821", "0.5603602", "0.559327", "0.55919844", "0.55711937", "0.5563663", "0.5563322",...
0.6517555
0
Gets the ID of the selected assignment
function getSelectedID() { return $("#assignment-id-" + userSession.selectedAssignment).text(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assignmentsGetCurrentIdx() {\n\tvar asgnSelect = document.getElementById('assignment_select');\n\tif (asgnSelect.selectedIndex == -1) return -1;\n\tvar currentId = asgnSelect.options[asgnSelect.selectedIndex].value;\n\tfor (var i=0; i<assignments.length; i++)\n\t\tif (assignments[i].id == currentId)\n\t\t...
[ "0.72679883", "0.6690994", "0.6429179", "0.63820857", "0.6328038", "0.6266923", "0.61711293", "0.60678554", "0.60678554", "0.59974957", "0.59866333", "0.595185", "0.5940864", "0.5940864", "0.59114367", "0.59069103", "0.5906645", "0.5874216", "0.585953", "0.585953", "0.5841901...
0.80683124
0
Gets the name of the selected assignment
function getSelectedName() { return $("#assignment-name-" + userSession.selectedAssignment).text(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSelectedName() {\n\t\t\tif (items.length === 0 || !items[selected]) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treturn items[selected];\n\t\t}", "function assignmentGetName(idx) {\n\tvar name = assignments[idx].name;\n\tvar level = assignments[idx].level;\n\tfor (var j=idx-1; j>=0; j--) {\n\t\tif (assignmen...
[ "0.6815493", "0.6725602", "0.66086346", "0.61701536", "0.61201936", "0.6116475", "0.6057292", "0.6051061", "0.5977736", "0.5975905", "0.5949398", "0.5947526", "0.5937823", "0.5925154", "0.59197456", "0.5908436", "0.5895141", "0.58781606", "0.5863524", "0.5848296", "0.58478725...
0.78166574
0
Gets the deadline in a format that the backend finds friendly
function getEditDeadline() { //Deadline ///The deadline as a time var deadline = new Date($("#edit-assignment-deadline").val()) ///Converting the deadline ISO string - e.g. '2021-11-03T15:33:31.424Z' deadline = deadline.toISOString(); ///Cutting off the Z return deadline.substring...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDeadline() {\r\n //Deadline\r\n ///The deadline as a time\r\n var deadline = new Date($(\"#new-assignment-deadline\").val())\r\n\r\n ///Converting the deadline ISO string - e.g. '2021-11-03T15:33:31.424Z'\r\n deadline = deadline.toISOString();\r\n\r\n ///Cutting off the Z\r\n retur...
[ "0.7831019", "0.68527377", "0.6656939", "0.6277391", "0.62538606", "0.6143054", "0.59900355", "0.58896536", "0.5802054", "0.56331563", "0.5602766", "0.5565105", "0.5562942", "0.55255103", "0.5515717", "0.5513717", "0.54815906", "0.54162925", "0.5402105", "0.53883433", "0.5343...
0.75780153
1
Enables or disables the delete button for assignments
function deleteAssignmentCheck() { //Button Handler ///If the checkbix is checked, enable the button if($("#assignment-delete-check").prop('checked')) { $("#delete-assignment-btn").removeAttr("disabled"); } else { ///If not then disable the button $("#delete-assignment-btn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DoEnabling() {\r\n var deleteButton = document.getElementById(\"deleteButton\");\r\n var renameButton = document.getElementById(\"renameButton\");\r\n\r\n var disabled = document.getElementById(\"quicklaunch-tree\").view.selection.count == 0;\r\n deleteButton.disabled = disabled;\r\n renameButton.dis...
[ "0.7006579", "0.64026886", "0.63636184", "0.6195132", "0.6156941", "0.6127759", "0.6095412", "0.6090771", "0.6063591", "0.60591125", "0.60116225", "0.5996688", "0.59667844", "0.5945792", "0.5935127", "0.5890435", "0.58858556", "0.5846513", "0.58168954", "0.57976544", "0.57880...
0.6566785
1
Update the 'onMobile' state any time the window changes size
listenForWindowResize() { $(window).resize(() => { this.setState({ onMobile: window.innerWidth < this.MOBILE_THRESH }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onResize() {\n let mobile = window.innerWidth < 800\n if (mobile !== this.isMobile) {\n this.isMobile = mobile\n }\n }", "handleResize() {\n if (window.innerWidth >= screenWidths.maxMobile) {\n if (this.state.isMobile) {\n this.setState({ isMobile: false });\n ...
[ "0.76976776", "0.73821914", "0.7049122", "0.70311785", "0.70081043", "0.70081043", "0.692401", "0.6871337", "0.68448347", "0.6831142", "0.68295556", "0.680602", "0.6751457", "0.6688429", "0.6670352", "0.66464645", "0.6642993", "0.66269195", "0.6611349", "0.66104096", "0.66056...
0.77240217
0
this function isolates the way we turn a major into an html class
function getMajorAsClass(major) { return major.replace(/ /g,''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeElementOpacityForDifferentMajors(class_name, major, new_opacity) {\n var elements = document.getElementsByClassName(class_name);\n\n for (var i in elements) {\n var element = elements[i];\n // var classes = element.className;\n\n if (element.className) {\n var c...
[ "0.60044867", "0.58897936", "0.57813066", "0.5767612", "0.5674897", "0.55961084", "0.55856335", "0.5584547", "0.55518055", "0.55411637", "0.5489664", "0.54399276", "0.54399276", "0.5439877", "0.54137343", "0.54133433", "0.53902733", "0.53845775", "0.5383536", "0.53783983", "0...
0.73410076
0
this function takes a class name, a major, and an opacity and changes all elements of the given classname without the given major to the new opacity.
function changeElementOpacityForDifferentMajors(class_name, major, new_opacity) { var elements = document.getElementsByClassName(class_name); for (var i in elements) { var element = elements[i]; // var classes = element.className; if (element.className) { var classes = elem...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setOpacity(querySelector, newOpacity) {\r\n document.querySelectorAll(querySelector).forEach(function (e) {\r\n e.style.opacity = newOpacity;\r\n });\r\n }", "changeOpacity(selector, opacity) {\n const targets = document.querySelectorAll(selector);\n []....
[ "0.677328", "0.6262613", "0.6248344", "0.6168686", "0.61264384", "0.61058354", "0.6061641", "0.60191005", "0.5980022", "0.5918337", "0.58969456", "0.58969456", "0.5890903", "0.5887805", "0.58875364", "0.58768064", "0.5870443", "0.5839235", "0.5829243", "0.5810106", "0.5783360...
0.8639265
0
builds the Form to add a salutation
buildForm() { this.newSalutation = this.fb.group({ language: [''], salutation: [''], gender: ['2'], letterSalutation: [''], }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "buildForm() {\n this.salutationForm = this.fb.group({\n firstname: [''],\n gender: [''],\n language: [''],\n lastname: [''],\n letterSalutation: [''],\n salutation: [''],\n salutationTitle: [''],\n title: ['']\n }...
[ "0.7360912", "0.6823614", "0.64713246", "0.6267221", "0.6083312", "0.6038908", "0.59476215", "0.5937527", "0.589886", "0.57489383", "0.57384235", "0.57018703", "0.5690404", "0.567373", "0.56732064", "0.5673125", "0.56574565", "0.56432855", "0.5605013", "0.55596316", "0.555164...
0.7627162
0
adds a Salutation to the recognize list
addSalutation() { return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () { try { yield this.salutationService.addSalutation(this.newSalutation.value); } catch (err) { console.error(err); } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addSalutation(newSal) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () {\n try {\n yield this.http.post(this.urlAddSal, newSal).toPromise().then(() => {\n this.openDialog('Successfully added \"' + newSal.salu...
[ "0.5966646", "0.5775771", "0.5052125", "0.5026884", "0.4980927", "0.49736694", "0.49420726", "0.49221614", "0.4911609", "0.49017987", "0.48152274", "0.47436363", "0.47429094", "0.47408023", "0.4730951", "0.47000483", "0.47000483", "0.46953198", "0.46890357", "0.46788773", "0....
0.59283596
1
fills in the a new formatted salutation
fillSalutation(sal) { this.formatSalutation = sal; this.salutIsForm = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "generateFullLetterSalutation() {\n var salutation = '';\n if (!this.checkFieldIfEmpty('letterSalutation')) {\n salutation = this.salutationForm.get('letterSalutation').value;\n }\n if (!this.checkFieldIfEmpty('firstname')) {\n salutation =\n salutati...
[ "0.6999129", "0.58301324", "0.56566787", "0.56224376", "0.5449692", "0.53472304", "0.5150513", "0.513221", "0.51200426", "0.50993776", "0.50775164", "0.50702006", "0.503617", "0.5028712", "0.50224686", "0.49945244", "0.49886703", "0.49786943", "0.49762547", "0.49734208", "0.4...
0.7812021
0
call the API to add a new Salutation to the Backend
addSalutation(newSal) { return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () { try { yield this.http.post(this.urlAddSal, newSal).toPromise().then(() => { this.openDialog('Successfully added "' + newSal.salutation + '"'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addEmployeeToDb() {\n const newEmployee = {\n name: {\n firstName: `${firstName.value}`,\n lastName: `${lastName.value}`,\n },\n jobYears: parseInt(jobYears.value),\n salary: parseInt(salary.value),\n position: `${position.value}`,\n team: `${team.value}`,\n phone: `${phone...
[ "0.64111865", "0.6300729", "0.6211298", "0.6153199", "0.61487776", "0.59118956", "0.5781968", "0.5777887", "0.57580674", "0.5713871", "0.57094985", "0.5700822", "0.56893265", "0.56844485", "0.5679476", "0.56441295", "0.563018", "0.5613047", "0.560093", "0.55997956", "0.557530...
0.7008242
0
call the API to add a new title to the Backend
addTitle(newTitle) { return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () { try { var params = new _angular_common_http__WEBPACK_IMPORTED_MODULE_1__["HttpParams"]().set('title', newTitle); yield this.http.post(this.urlAddTi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "commitAddToTitle(payload) { return this.commit('commitAddToTitle', payload); }", "setTitle(title) {\n this.get('headData').set('title', title);\n }", "async function onSaveTitle(val) {\n try {\n let editContentRes = await fetch('/content/edit', {\n method: 'POST',\n ...
[ "0.7535006", "0.71386796", "0.7036956", "0.69128424", "0.6746681", "0.6722081", "0.66185325", "0.6564606", "0.6564606", "0.6564606", "0.6564606", "0.6564606", "0.65488553", "0.6535552", "0.65001374", "0.64148444", "0.64109343", "0.6271713", "0.62568194", "0.62253964", "0.6201...
0.75931
0
builds the Form to edit the formatted salutation
buildForm() { this.salutationForm = this.fb.group({ firstname: [''], gender: [''], language: [''], lastname: [''], letterSalutation: [''], salutation: [''], salutationTitle: [''], title: [''] }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "buildForm() {\n this.newSalutation = this.fb.group({\n language: [''],\n salutation: [''],\n gender: ['2'],\n letterSalutation: [''],\n });\n }", "fillForm(fSalut) {\n this.salutationForm.setValue({\n firstname: fSalut.firstname,\n ...
[ "0.690478", "0.65902007", "0.6350034", "0.6168978", "0.6125232", "0.60183734", "0.59981", "0.59013265", "0.5881177", "0.58765686", "0.5856617", "0.5842093", "0.57812023", "0.5777363", "0.57442284", "0.5716776", "0.5631465", "0.5616179", "0.5598901", "0.55700666", "0.55575126"...
0.6615965
1
converts a language to the according number
convertLanguage(lang) { switch (lang) { case "German": { return 0; break; } case "French": { return 1; break; } case "English": { return 2; break; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertOneToNine (n, lang) {\t\n var oneToNine = {\n\t0:'',\n 1: function (){\t\t\n\t\tvar language = {\n\t\t\t0: 'one',\n\t\t\t1: 'un',\n\t\t\t2: 'uno'\t\t\t\t\t\t\n\t\t};\t\t\n\t\treturn language[lang];\t\t\t\n },\n 2: function (){\t\t\n\t\tvar language = {\n\t\t\t0: 'two',\n\t\t\t1: 'deux',\n...
[ "0.6904724", "0.6730991", "0.6584864", "0.65454936", "0.64111", "0.6404354", "0.6393778", "0.6367773", "0.6308176", "0.6278398", "0.61383677", "0.613337", "0.613337", "0.61302286", "0.6124186", "0.60760593", "0.6053795", "0.60491234", "0.6022116", "0.6021485", "0.6019962", ...
0.73280364
0
checks if the Form Group Field if it is null or empty
checkFieldIfEmpty(field) { var empty = false; if (this.salutationForm.get(field).value == null || this.salutationForm.get(field).value == '') { empty = true; } return empty; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkFieldEmpty(FieldData,cntErrField)\n{\n if(FieldData.length) \n {\n return false;\n } \n else\n {\n cntErrField.value=\"\";\n return true;\n }\n}", "isValidField(field) {\n if(typeof field === 'undefined') {\n return false;\n } else i...
[ "0.63447106", "0.6309224", "0.6279197", "0.6226981", "0.6182112", "0.61127436", "0.6112486", "0.61067396", "0.61045533", "0.60995185", "0.6080216", "0.60633004", "0.60482967", "0.5999772", "0.59965533", "0.5976459", "0.5964731", "0.59243315", "0.5903047", "0.5895653", "0.5891...
0.68941015
0
creates the letter salutation as string first method ist for a static string second is for editing
generateFullLetterSalutation() { var salutation = ''; if (!this.checkFieldIfEmpty('letterSalutation')) { salutation = this.salutationForm.get('letterSalutation').value; } if (!this.checkFieldIfEmpty('firstname')) { salutation = salutation + ' ' + t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createEstablishmentCode() {\n let _lText = '';\n let _lPossible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n for (let _i = 0; _i < 9; _i++) {\n _lText += _lPossible.charAt(Math.floor(Math.random() * _lPossible.length));\n }\n return _lText;\n}", "function salute2(myName){\n\treturn \"Hola \" ...
[ "0.6441592", "0.6322593", "0.62926364", "0.6217729", "0.6191881", "0.6081219", "0.6065057", "0.60251987", "0.60054356", "0.59842676", "0.59829986", "0.5969819", "0.595249", "0.594557", "0.5907081", "0.5896125", "0.5863888", "0.584127", "0.58393466", "0.58165514", "0.5815647",...
0.7240427
0
copy the letter salutation into the clipboard
copyLetterSal() { this.clipboard.copy(this.letterSalutation); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copyPass() {\n var copyText = document.getElementById(\"password\");\n copyText.select();\n copyText.setSelectionRange(0, 128)\n document.execCommand(\"copy\");\n alert(\"Copied the text: \" + copyText.value);\n }", "function copyPass() {\n var str = document.getElementById(\"pwBox\"...
[ "0.7345355", "0.72000253", "0.71795714", "0.7173768", "0.71378195", "0.7090056", "0.7041747", "0.703616", "0.6981425", "0.6981081", "0.6950999", "0.6904812", "0.6843805", "0.6836462", "0.6832401", "0.6825502", "0.6793265", "0.66874146", "0.6651117", "0.6649351", "0.6641355", ...
0.88917243
0
Function to check the value of the "Country" field and set the "State/Province" field accordingly
function checkCountryState(mode, sfuCountry, sfuStateprov) { var currentState = $('#'+sfuStateprov+' option:selected').val(); $('#'+sfuStateprov).empty(); // clear existing options from state/province dropdown var currentCountry = $('#'+sfuCountry).val(); // Get country and states from JSON var selected...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countryChange()\n{ \n if (\n (document.getElementById('selbillcountry') && document.getElementById('selbillstate')) \n || \n (document.getElementById('txtbillcountry') && document.getElementById('txtbillstate'))\n )\n {\n if (\n document...
[ "0.67524135", "0.6702326", "0.66998965", "0.66456807", "0.65856004", "0.65531725", "0.65234745", "0.6509287", "0.64964926", "0.64752126", "0.646772", "0.643129", "0.64114743", "0.640438", "0.6348159", "0.62899345", "0.6279975", "0.6273279", "0.6255098", "0.6251993", "0.625153...
0.7293059
0
Function to check the value of the "Market" field and set the "Submarket" field accordingly
function checkMarketSubmarket(mode, sfuMarket, sfuSubmarket) { var currentSubmarket = $('#'+sfuSubmarket+' option:selected').val(); $('#'+sfuSubmarket).empty(); // clear existing options from submarket dropdown var currentMarket = $('#'+sfuMarket).val(); // Get market and submarkets from JSON var select...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateMarket(selection, marketRecord, price, status) {\n\tswitch (selection) {\n \tcase \"Home\":\n \tmarketRecord[\"home\"] = price;\n \tbreak;\n \tcase \"Draw\":\n \tmarketRecord[\"draw\"] = price;\n break;\n case \"Away\":\n \tmarketRecord[\"away\"...
[ "0.61331815", "0.60721016", "0.55807567", "0.53710884", "0.5304192", "0.5267954", "0.5152043", "0.5137735", "0.5103601", "0.50971043", "0.50648797", "0.5044618", "0.5032486", "0.5026042", "0.49860093", "0.4980491", "0.49705335", "0.49689263", "0.49543655", "0.4937744", "0.493...
0.7699167
0
Function to clear the contact form, including cookie and hidden recipient id field
function clearIdentity(sfuForm, sfuEmail) { // var remove_sp_identity = $.removeCookie('SP_IDENTITY'); // clear the cookie var remove_sp_identity = $.removeCookie('SP_IDENTITY', { path: '/' }); // => true console.log(remove_sp_identity); //////////////////////////////// if( remove_sp_identity == true ) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearContactForm() {\n document.getElementById('user-id').value = \"\";\n document.getElementById('filter-value').value = \"\";\n}", "function clearContactForm(){\r\n localStorage.clear();\r\n document.getElementById(\"contactForm\").reset(); \r\n}", "function clearForm() {\n fullName...
[ "0.7799598", "0.74594223", "0.7379154", "0.7276548", "0.7233243", "0.7091555", "0.7035433", "0.69949603", "0.69604844", "0.6931914", "0.6879724", "0.68497753", "0.67856365", "0.6758066", "0.6661472", "0.6656581", "0.66480225", "0.6625945", "0.6623078", "0.66192895", "0.661668...
0.75071806
1
Returns the class attribute as class="name name..."
get asAttribute() { const keys = Array.from(this.classes.keys()); return (keys.length ? ' class="' + escapeHTML(keys.join(' ')) + '"' : ''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get className() { \n return this.getAttribute('class'); \n }", "getClass() {\n return this.getAttribute('class');\n }", "get className() {\n return this.attributes.className;\n }", "function classString(classInfo){var o=[];for(var name in classInfo){var v=classInfo[name];if(v){o.push(...
[ "0.72124493", "0.71910197", "0.7046814", "0.66571844", "0.66367054", "0.6613496", "0.6504485", "0.6236865", "0.61858064", "0.61777806", "0.61777806", "0.61489433", "0.613975", "0.61343217", "0.613363", "0.6125121", "0.6066984", "0.6065214", "0.60513335", "0.60486263", "0.5997...
0.8297125
0
Get the className propery from the classList
get className() { return this.classList.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getClassNames() {\n let classNames = ['thread-ListItem'];\n\n return classNames.join(' ');\n }", "function getClassName() {\n return classnames(\n \"px-4 py-2 rounded text-sm text-black hover:bg-gray-200 hover:text-black\",\n props.className\n );\n }", "getClass() {\n return this...
[ "0.76949257", "0.70371914", "0.68541425", "0.6840642", "0.68202937", "0.68202937", "0.6810584", "0.6786034", "0.6786034", "0.6786034", "0.6786034", "0.6786034", "0.6777091", "0.67750895", "0.67510885", "0.67510885", "0.67510885", "0.67510885", "0.67510885", "0.67510885", "0.6...
0.73655045
1
Set the classList from a string of class names
set className(names) { for (const name of names.split(/ /)) { this.classList.add(name); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setClassList(element, classlist) {\n\telement.className = classlist.join(' ');\n}", "static addClass(element, classString) {\n let part, i;\n part = classString.split(' ');\n for (i = 0; i < part.length; i++) {\n if (part[i].trim() !== '') {\n element.class...
[ "0.7048283", "0.6214282", "0.60560304", "0.60560304", "0.6042583", "0.60289127", "0.597568", "0.5896702", "0.5896409", "0.5870222", "0.58389646", "0.5831122", "0.5831122", "0.5831122", "0.5831122", "0.5815278", "0.579851", "0.57795787", "0.5765694", "0.5727607", "0.5727607", ...
0.75575995
0
METHODS Set the variables from the info bar
function setInitialValues(w, t, f, a) { //Set the labels from the info bar $('#arrow').text('Arrow: ' + Boolean(a)); $('#wumpus').text('Wumpus: ' + w); $('#traps').text('Traps: ' + t); $('#size').text('Size: ' + f); fieldSize = f; traps = t; wumpus = w; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setExtraInfo(){}", "function setInfobox(props){\r\n \r\n var infoValue, i = infoValue = 0;\r\n do {\r\n var infoValue = parseFloat(props[expressed]).toFixed(i);\r\n i++;\r\n }\r\n while (infoValue <= 0);\r\n \r\n if (isNaN(infoValue)...
[ "0.6974153", "0.6678367", "0.64322054", "0.64040446", "0.63354653", "0.6262129", "0.6252128", "0.61857975", "0.6160096", "0.6138896", "0.61254835", "0.60746324", "0.6056329", "0.60430527", "0.6009319", "0.5982196", "0.5962039", "0.5949", "0.5941386", "0.5939389", "0.58814645"...
0.6833494
1
Draws the playground, just a grid depending on the field size
function drawPlayground() { //Get the table as root var root = $('#board'); //Clear the board root.empty(); //Create html grid content var grid = ''; for(var i = 0; i < fieldSize; i++) { //Append a row grid += '<div style="line-height: 1px;">'; for(var j = 0; j ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawNewPlayfield() {\n\tlet mainInnerHTML = ''\n\tfor (let y = 0; y < playField.length; y++) {\n\t\tfor (let x = 0; x < playField[y].length; x++) {\n\t\t\tmainInnerHTML += '<div class=\"cell\" style=\"opacity:0.25;\"></div>'\n\t\t}\n\t}\n\tmain.innerHTML = mainInnerHTML\n\tmainCells = Array.from(main.quer...
[ "0.6878931", "0.67618006", "0.6637112", "0.65917796", "0.65856737", "0.65395033", "0.6532051", "0.6520118", "0.6491758", "0.6476488", "0.6467916", "0.6459315", "0.6457601", "0.6454836", "0.64473087", "0.6445935", "0.643721", "0.6433447", "0.64285564", "0.64175826", "0.6412884...
0.7526486
0
Funcion que envia un pedido/s extraido de la bd a traves de ws
function send_pedido(pedidos, ws, camarero=false,header) { pedidos.forEach(function (pedido) { let pedido_parseado = {}; pedido_parseado.num_pedido = pedido.num_pedido ? pedido.num_pedido : ''; pedido_parseado.mesa = pedido.mesa; let array_item_nombre = pedido.item_nombre.split(',');...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chamar_senhaNovamente(ws){\n sendToTv(ws);\n}", "function crearPartida() {\n partidaId=\"minas12345\";\n stompClient.send(\"/app/Nuevo-Juego\", {}, JSON.stringify({idPartida:\"minas12345\",nombre:\"Prueba\",tipoPartida:\"Publica\",filas:15,columnas:15,numeroJugadores:3,modalidad:\"Sencillo\...
[ "0.6543109", "0.6255162", "0.6176095", "0.6144776", "0.5918557", "0.5880542", "0.55799866", "0.55184734", "0.5486586", "0.5420774", "0.537155", "0.5355658", "0.5355096", "0.5351565", "0.5322141", "0.531438", "0.53077257", "0.5304487", "0.5295728", "0.5285019", "0.5281731", ...
0.7321443
0
checks if apple coords are at snakeBody, if not draws apple
function drawApple(appleX, appleY){ for(let segment of snakeBody){ (segment.x === appleX && segment.y === appleY) ? generateAppleLocation() : drawRect(appleX, appleY, rectSide, rectSide, "green"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isSnakePosOK(x,y){\n //not on the other snake\n for (var k = 0; k < snakes[1-i].body.length; k++){\n if ((x == snakes[1-i].body[k][0] || x-1 == snakes[1-i].body[k][0] || x-2 == snakes[1-i].body[k][0]) && y == snakes[1-i].body[k][1])\n return false; ...
[ "0.73563075", "0.72107744", "0.7121704", "0.70997", "0.7023382", "0.6968817", "0.6952759", "0.6858245", "0.681194", "0.6745819", "0.6723944", "0.6709725", "0.67050755", "0.6702958", "0.6671034", "0.66151065", "0.65492237", "0.6548197", "0.65373707", "0.64951736", "0.6493264",...
0.76700836
0
takes snakeBody array and draws a piece for each array element
function drawSnake(){ for(let segment of snakeBody){ drawRect(segment.x, segment.y, rectSide, rectSide, "red"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawSnake() {\r\n // Draw each part\r\n snake.forEach(drawSnakePart)\r\n}", "function drawSnake() {\n ctx.fillStyle = \"orange\";\n ctx.fillRect(snake[0].x, snake[0].y, 20, 20);\n ctx.strokeStyle = \"#764100\";\n ctx.strokeRect(snake[0].x, snake[0].y, 20, 20);\n\n for (let i = 1; i < snake.length...
[ "0.77572364", "0.76784855", "0.7666947", "0.76553136", "0.76553136", "0.76539016", "0.76327616", "0.7609942", "0.76032907", "0.7537413", "0.75086075", "0.74808556", "0.74722046", "0.7464315", "0.7398705", "0.73853654", "0.7369235", "0.73106015", "0.7206878", "0.7158576", "0.7...
0.7945218
0
Closes the Details Card and Opens Image viewer card
function closeDetails(position) { $('#detailsCard' + position).hide(); $('#closeCard' + position).hide(); $('#card' + position).show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "openCardDetails() {\n EnigmailWindows.openWin(\n \"enigmail:cardDetails\",\n \"chrome://openpgp/content/ui/enigmailCardDetails.xhtml\",\n \"centerscreen\"\n );\n }", "close() {\n this.card.close();\n }", "function closeDetails() {\n if (selectedDiv_ != null) {\n selectedDiv_...
[ "0.7025193", "0.6615272", "0.65888995", "0.6556873", "0.64312094", "0.62698257", "0.62542915", "0.6249464", "0.62477833", "0.6213877", "0.61030805", "0.6094631", "0.60615814", "0.6057948", "0.6025883", "0.59952927", "0.59893596", "0.5988587", "0.5958612", "0.5912354", "0.5890...
0.6715714
1
Generate a PDF from HTML using wkhtmltopdf's CLI interface. Spawns a child process with `wkhtmltopdf `. wkhtmltopdf must be installed and pathaccessible. TODO: If HTML generation has run, reuse that output TODO: Local web server to ease wkhtmltopdf rendering
wkhtmltopdf(markup, fOut, opts, on_error) { // Save the markup to a temporary file const tempFile = fOut.replace(/\.pdf$/i, '.pdf.html'); FS.writeFileSync(tempFile, markup, 'utf8'); // Prepare wkhtmltopdf arguments. let wkopts = _.extend({'margin-top': '10mm', 'margin-bottom': '10mm'}, opts.wkhtmlt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pdfGenerator(html) {\n let conversion = convertFactory({\n\n converterPath: convertFactory.converters.PDF\n\n });\n\n conversion({\n html: html,\n //waiting for confirmation before converting\n waitForJs: true,\n waitForJsVarName: readyToConvert,\n },\n //Using this function to run thr...
[ "0.6238933", "0.61900353", "0.61843085", "0.6154822", "0.6076699", "0.60106057", "0.59052986", "0.5602338", "0.5476819", "0.5425499", "0.5382816", "0.537857", "0.5359343", "0.5351065", "0.5342046", "0.530546", "0.52706987", "0.52594733", "0.5240631", "0.523476", "0.5219795", ...
0.65900075
0
Generate a PDF from HTML using Phantom's CLI interface. Spawns a child process with `phantomjs `. Phantom must be installed and pathaccessible. TODO: If HTML generation has run, reuse that output TODO: Local web server to ease Phantom rendering
phantomjs( markup, fOut, opts, on_error ) { // Save the markup to a temporary file const tempFile = fOut.replace(/\.pdf$/i, '.pdf.html'); FS.writeFileSync(tempFile, markup, 'utf8'); let scriptPath = PATH.relative(process.cwd(), PATH.resolve( __dirname, '../utils/rasterize.js' )); scriptPath = SLASH(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pdfGenerator(html) {\n let conversion = convertFactory({\n\n converterPath: convertFactory.converters.PDF\n\n });\n\n conversion({\n html: html,\n //waiting for confirmation before converting\n waitForJs: true,\n waitForJsVarName: readyToConvert,\n },\n //Using this function to run thr...
[ "0.67827433", "0.6573974", "0.6527661", "0.6498144", "0.61612964", "0.61386776", "0.6127243", "0.59542835", "0.59096473", "0.5874095", "0.5842788", "0.58330643", "0.57428896", "0.5683991", "0.5672118", "0.5580659", "0.5577305", "0.5536118", "0.5510595", "0.54546094", "0.54319...
0.6755711
1
Generate a PDF from HTML using WeasyPrint's CLI interface. Spawns a child process with `weasyprint `. Weasy Print must be installed and pathaccessible. TODO: If HTML generation has run, reuse that output
weasyprint( markup, fOut, opts, on_error ) { // Save the markup to a temporary file const tempFile = fOut.replace(/\.pdf$/i, '.pdf.html'); FS.writeFileSync(tempFile, markup, 'utf8'); SPAWN('weasyprint', [tempFile, fOut], false, on_error, this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pdfGenerator(html) {\n let conversion = convertFactory({\n\n converterPath: convertFactory.converters.PDF\n\n });\n\n conversion({\n html: html,\n //waiting for confirmation before converting\n waitForJs: true,\n waitForJsVarName: readyToConvert,\n },\n //Using this function to run thr...
[ "0.6596121", "0.6203307", "0.6185785", "0.6179616", "0.6149186", "0.6012606", "0.599943", "0.5964672", "0.5872107", "0.5797898", "0.5766413", "0.5746802", "0.5730298", "0.56797934", "0.56534547", "0.56492007", "0.56345606", "0.5622458", "0.5589321", "0.5515531", "0.55108714",...
0.6830428
0
preload() Load dog image and sound
function preload() { dog.image = loadImage("assets/images/dog.png"); dog.sound = loadSound("assets/sounds/bark.wav"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preload() {\n song = loadSound('hit.mp3');\n reimu = loadImage('reimu.png');\n stage = loadImage(\"stage3.gif\");\n //stagel = createImg(\"stage3.gif\");\n song2 = loadSound(\"bgm.mp3\");\n song3 = loadSound(\"deathbgm.mp3\");\n}", "function preload(){\r\nsadDog=loadImage(\"Dog.png\");\r\nhappyDog...
[ "0.84714043", "0.84141517", "0.84141517", "0.8410634", "0.8405355", "0.83926815", "0.83519614", "0.83241796", "0.82715684", "0.8262027", "0.82513696", "0.8249188", "0.8228731", "0.82128304", "0.81618017", "0.81477195", "0.813913", "0.8131525", "0.81134886", "0.8092503", "0.80...
0.8654506
0
setup() Put the dog in a random location and set up its sound
function setup() { createCanvas(windowWidth,windowHeight); // We'll draw from the center imageMode(CENTER); // Choose a random location for the dog, use offsets to avoid having it // appear half off-screen dog.x = random(0 + dog.image.width/2,width - dog.image.width/2); dog.y = random(0 + dog.image.heigh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setup() {\n createCanvas(windowWidth, windowHeight);\n\n // We'll draw from the center\n imageMode(CENTER);\n // Choose a random location for the dog, use offsets to avoid having it\n // appear half off-screen\n dog.x = random(0 + dog.image.width / 2, width - dog.image.width / 2);\n dog.y = random(...
[ "0.7508007", "0.738637", "0.7316427", "0.68457836", "0.6670316", "0.66661227", "0.6597871", "0.6592278", "0.6590857", "0.6569458", "0.6545864", "0.65162843", "0.6486387", "0.64356107", "0.6310258", "0.62961286", "0.6295936", "0.62924415", "0.62739867", "0.6269637", "0.6263456...
0.7541421
0
draw() Tracks distance of mouse from the dog and alters its barking volume and pan to indicate its location. Displays a circle around the invisible dog if you find it.
function draw() { // A nice green background background(100,200,100); // Calculate the distance to the dog from the mouse var d = dist(mouseX,mouseY,dog.x,dog.y); // If the mouse if over the dog, we found it if (d < dog.image.height/2) { // Display the invisible dog (tinted to transparent because it's...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {\n // A nice green background\n background(100, 200, 100);\n\n // Calculate the distance to the dog from the mouse\n let d = dist(mouseX, mouseY, dog.x, dog.y);\n\n // If the mouse is over the dog, we found it\n if (d < dog.image.height / 2) {\n // Display the invisible dog (tinted to tra...
[ "0.7863864", "0.64474124", "0.6382904", "0.6336523", "0.6304191", "0.62971264", "0.627651", "0.6271964", "0.6265023", "0.6257673", "0.6245649", "0.62079567", "0.61884713", "0.6157652", "0.61296123", "0.61043864", "0.60224813", "0.60198367", "0.5994747", "0.59886724", "0.59609...
0.78546053
1
function: processes user response. Decides on what type of employee to create and adds it to the teamArray input: the users response to multiple questions return: none
function processResponse(response) { switch (currentEmployeeType) { case Manager.getRole(): teamArray.push(new Manager(response.employeeName, response.employeeID, response.employeeEmail, response.officeNumber)); break; case Engineer.getRole(): teamArray.push(new Engineer(response.employeeNa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addEmployee() { \n inquirer.prompt(employeeQuestions)\n \n .then((employeeData) => {\n \n\n const {role, name, id, email, gitHub, school, confirmEmployee} = employeeData;\n let theEmployee;\n \n // SET A CONDITION ON WHICH INPUT DA...
[ "0.7495505", "0.73103213", "0.72578365", "0.71743107", "0.7119816", "0.7089597", "0.708354", "0.7074273", "0.7065573", "0.7011027", "0.7006006", "0.6911406", "0.67873234", "0.6761241", "0.6746187", "0.67376834", "0.6724062", "0.6723469", "0.6686772", "0.6668591", "0.6660849",...
0.73499554
1
purpose: determines the next action on which type of questions to ask based on the user selection input: the user option can to add engineer, intern, or exit return: none
function determineNextAction(option) { switch(option.toString()) { case "Add Engineer": currentEmployeeType = Engineer.getRole(); askQuestions(ENGINEER_QUESTIONS); break; case 'Add Intern': currentEmployeeType = Intern.getRole(); askQuestions(INTERN_QUESTIONS) break; c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextQuestion() {\n if(\"Manager\"){\n managerInfo\n \n ifelse(\"Engineer\")\n engineerInfo\n \n ifelse(\"Intern\")\n internInfo\n \n ifelse(undefined)\n throw(err)\n }\n}", "function questionUser() {\n inquirer.prompt([\n {\n t...
[ "0.70097256", "0.6807664", "0.67841357", "0.6776413", "0.6713218", "0.66975015", "0.66714543", "0.66276217", "0.66244334", "0.6623054", "0.66128683", "0.6607778", "0.6530161", "0.65133196", "0.6496841", "0.6479315", "0.6476401", "0.6473915", "0.64583457", "0.6441697", "0.6436...
0.72544456
0
Instantiate fileReader object, collect file signature and retrieve MIME type
function getMimeType(file, callback) { var fileReader = new FileReader(); // instantiate new FileReader object fileReader.onloadend = function(e) { // after file is loaded... var arr = (new Uint8Array(e.target.result)).subarray(0, 4); // get file signature var header = ""; // tranlsate fil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMimeType(blob, callback) {\n \n var fileReader = new FileReader(); // instantiate new FileReader object\n\n fileReader.onloadend = function(e) { // after file is loaded...\n var arr = (new Uint8Array(e.target.result)).subarray(0, 4); // get file signature\n var header = \"\"; // tranlsate ...
[ "0.6191147", "0.5892392", "0.58599585", "0.550345", "0.5427197", "0.54167825", "0.54122335", "0.53612465", "0.5350738", "0.53481305", "0.52656174", "0.52008724", "0.5198083", "0.5147108", "0.5122078", "0.50972223", "0.5095566", "0.5062645", "0.5058691", "0.5057479", "0.505289...
0.60696703
1
Adjust div size after image file loads line 170: onload="resizeDiv()"
function resizeDiv() { var panel = document.getElementById("imgUploaderPanel"); panel.style.maxHeight = panel.scrollHeight + "px"; // recalculate height }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resizeDiv() {\r\n\t\t$this = $['mapsettings'].element;\r\n\t\tvar divsize = \"width:\" + $this.parent().get(0).clientWidth + \"px; height: \" + $(window).height() + 'px;';\r\n\t $this.attr('style', divsize);\t\t\r\n\t\tvar divsize = \"width:\" + ($this.parent().get(0).clientWidth - $this.get(0).offsetLef...
[ "0.77937067", "0.660256", "0.65949064", "0.65654796", "0.64859486", "0.6470764", "0.64233905", "0.638956", "0.63836014", "0.6312406", "0.62805164", "0.6279776", "0.6268639", "0.62550133", "0.6245841", "0.6215212", "0.6170368", "0.6155826", "0.6154339", "0.61501294", "0.614308...
0.68182236
1
fire off base64encoded image string retrieval (asynchronous) callback function called in resizeImage() to get resized base64encoded image string and output to div
function getBase64StringMulti(resized) { var stringDataTypeFull = resized.split(';')[0]; var stringDataType = stringDataTypeFull.split(':')[1]; // get data type for blob conversion var stringBase64 = resized.split(',')[1]; // get base64 string for blob conversion - iVB...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function evaluateAndResize(file) {\n\n var fileName = file[\"name\"].slice(0, -4) + \".png\"; // image name to use with blob (resized output = PNG)\n\n // determine file signature via magic numbers\n getMimeType(file, evaluateMimeType); // fire off MIME type retrieval (asynchronous)\n\n // callback f...
[ "0.6698695", "0.6570614", "0.6328561", "0.63247377", "0.631355", "0.62755966", "0.6274095", "0.62343997", "0.62336206", "0.6178667", "0.61670786", "0.6099577", "0.6081549", "0.6064475", "0.6041293", "0.59720826", "0.59697545", "0.5950407", "0.5934187", "0.5929922", "0.5919798...
0.68865424
0
Iterate through photos object and pass each photo to evaluateAndResize()
function processFileList() { var input = document.querySelector("#photos"); var files = input.files; for (i = 0; i < files.length; i++) { evaluateAndResize(files[i]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resizeImages () {\n // @@@ future feature: consider combining all the promises and using\n // Promise.all() to better handle things?\n [...this.elements].forEach(this.calculateImages, this);\n }", "function resizeImages() {\n\n if(!_$epubHtml) {\n return;\n }\...
[ "0.6858819", "0.6601825", "0.6601825", "0.6549844", "0.6354078", "0.6167821", "0.6083349", "0.6042817", "0.60341555", "0.60081327", "0.59776735", "0.59670883", "0.59643203", "0.5957087", "0.59551877", "0.59530014", "0.5936807", "0.5921053", "0.5901073", "0.5896692", "0.588282...
0.7369934
0
Trigger /upload_photos route to start processing photo data from photo queue
function uploadPhotos() { $.ajax({ url: "/upload_photos", type: 'POST', data: {photoUploadStatus: "OK"}, success: function(data, status, xhr) {} }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function queuePhotos(file, index, length) {\n $.ajax({\n url: \"/queue_photos\",\n type: 'POST',\n data: {filename: file.filename, data: file.data},\n success: function(data, status, xhr) {},\n complete: function(data, status, xhr) {\n if...
[ "0.6733395", "0.6423481", "0.6287298", "0.618163", "0.60438067", "0.6002294", "0.59709084", "0.59646136", "0.5832492", "0.58030695", "0.57820153", "0.5774025", "0.57105756", "0.56900865", "0.5688466", "0.56727403", "0.5669972", "0.5651493", "0.5641725", "0.5610936", "0.559828...
0.65098053
1
Incrementally draw a progress bar based on photo upload completion
function photoProgressBar(progress, length) { var elem = document.getElementById("photo_progress"); var speed = 20 * length; // integer determines speed of progress bar draw var id = setInterval(frame, speed); function frame() { if (width >= progress) { cl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onUploadProgress(e) {\r\n\tif (e.lengthComputable) {\r\n\t\tvar percentComplete = parseInt((e.loaded + totalUploaded) * 100 / totalFileLength);\r\n\t\tvar bar = document.getElementById('bar');\r\n\t\tbar.style.width = percentComplete + '%';\r\n\t\tbar.innerHTML = percentComplete + ' % complete';\r\n\t\tco...
[ "0.7143079", "0.7139108", "0.7110955", "0.7064022", "0.7014758", "0.69855946", "0.6954892", "0.6869848", "0.68271923", "0.6793308", "0.67210394", "0.6718084", "0.67161083", "0.67150694", "0.67061657", "0.66911113", "0.66896397", "0.66824365", "0.6675983", "0.66740286", "0.667...
0.7669682
0
Sets display style for photo progress bar div so it is visible
function showPhotoProgress() { document.getElementById('hide_ajax_progress').style.display = "inline"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "showProgressBar() {\n\n document.getElementById('loading-progress-container').style.display = 'block';\n document.getElementById('loading-progress').style.width = \"0%\";\n\n }", "function showProgress(){\n\t$('#progress-wrapper').css('display', 'flex');\n}", "function showProgressBar()\n{\n\t...
[ "0.72602385", "0.71382684", "0.7020407", "0.6577255", "0.6528316", "0.65125924", "0.65006375", "0.64713293", "0.6469783", "0.6270283", "0.6265613", "0.6258849", "0.62300515", "0.62201667", "0.6139348", "0.6132718", "0.60940063", "0.6088124", "0.6086772", "0.6070598", "0.60345...
0.7556472
0
Renvoie la description d'un personnage
function decrire(personnage) { var description = personnage.nom + " a " + personnage.sante + " points de vie et " + personnage.force + " en force"; return description; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "afficherDescription() {\n return (\n this.nom\n + ' est '\n + this.couleur\n + ' pèse '\n + this.poids\n + ' grammes et mesure '\n + this.taille\n + ' centimètres.'\n );\n }", "getDescription() {\n return \"Nom : \"+this.nom+\"\\nAge : \"+th...
[ "0.7729161", "0.77070993", "0.7129677", "0.7043399", "0.70301986", "0.6941028", "0.69052213", "0.6824497", "0.67664933", "0.6736479", "0.6708204", "0.6708204", "0.6708204", "0.67065394", "0.67065394", "0.67065394", "0.67065394", "0.67065394", "0.67065394", "0.67065394", "0.67...
0.7916427
0
setup children properties of the given processObj;
_buildProcessTree(processObj) { (typeof processObj === 'number') && (processObj = this.getProcessTree(processObj)); try { let lines = execSync(`pgrep -lfP ${processObj.pid}`).toString().split('\n').filter(e => e); lines.forEach(line => { let [_, pid, name] = line.match(/^(\d+) (.*)$/); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createProcesses() {\n Object.keys(this.workers).forEach(type => {\n const env = {\n 'type': type,\n 'verbose': config.verbose,\n };\n this.workers[type] = this.fork(type, env);\n });\n }", "function wa...
[ "0.5612524", "0.5579815", "0.55565584", "0.54157543", "0.5352142", "0.52501315", "0.5233835", "0.5177688", "0.51343966", "0.510362", "0.5074654", "0.50687337", "0.50595665", "0.50427574", "0.5041931", "0.5035168", "0.5033034", "0.5015301", "0.49723876", "0.49512935", "0.49252...
0.59883416
0
Create a new dish
function create(req, res) { const { data: { name, price, description, image_url } = {} } = req.body; const newDish = { id: nextId(), //function gives a new id to new dish name, price, description, image_url, }; dishes.push(newDish); res.status(201).json({ data: newDish }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create(req, res) {\n const {\n data: { id, name, description, price, image_url },\n } = req.body;\n\n const newId = nextId();\n const newName = req.body.data.name;\n const newDescription = req.body.data.description;\n const newPrice = req.body.data.price;\n const newImageUrl = req.body.data.imag...
[ "0.7373368", "0.73065007", "0.7195827", "0.716365", "0.61891186", "0.6173817", "0.615338", "0.61236304", "0.61151457", "0.6105929", "0.6028132", "0.5952543", "0.59438634", "0.59077895", "0.59073025", "0.5749243", "0.57441044", "0.57223946", "0.5689278", "0.5687983", "0.566321...
0.74603087
0
promptUserPurchase will prompt the user for the item/quantity they would like to purchase
function promptUserPurchase() { // console.log('___ENTER promptUserPurchase___'); // Prompt the user to select an item inquirer.prompt([ { type: 'input', name: 'item_id', message: 'Please enter the Item ID which you would like to purchase.', validate: validateInput, filter: Number }, { type:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function promptUserPurchase() {\n inquirer.prompt([\n {\n name: \"itemID\",\n message: \"What is the id number of the item you wish to purchase?\"\n },\n {\n name: \"quantity\",\n message: \"How many do you wish to buy?\"\n }\n ]).then(f...
[ "0.8879636", "0.85296756", "0.84048676", "0.8350836", "0.8263148", "0.81989616", "0.81934136", "0.8149061", "0.81326663", "0.8131231", "0.81050897", "0.80656475", "0.8035337", "0.79231495", "0.7892448", "0.7882499", "0.78524226", "0.78497875", "0.7821577", "0.78102154", "0.77...
0.8723726
1
displayInventory will retrieve the current inventory from the database and output it to the console
function displayInventory() { // console.log('___ENTER displayInventory___'); // Construct the db query string queryStr = 'SELECT * FROM products'; // Make the db query connection.query(queryStr, function(err, data) { if (err) throw err; console.log('Existing Inventory: '); console.log('.....................
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayInventory() {\n\tqueryStr = 'SELECT * FROM bamazondb.products';\n\tconnection.query(queryStr, function(err, data) {\n\t\tif(err) throw err;\n\n\t\tconsole.log(\"Current Inventory: \");\n\t\tconsole.log(\"..................................................................................................
[ "0.87555295", "0.8435315", "0.817737", "0.81641746", "0.8150763", "0.8049356", "0.79754746", "0.79002297", "0.7897682", "0.781505", "0.7727299", "0.76696044", "0.76662236", "0.7621269", "0.76104844", "0.7588232", "0.75409293", "0.75007313", "0.7452467", "0.73386407", "0.72629...
0.8814655
0
runBamazon will execute the main application logic
function runBamazon() { // console.log('___ENTER runBamazon___'); // Display the available inventory displayInventory(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runBamazonManager() {\n // Creates Prompt\n console.log(\"\\nWelcome to Bamazon\\n------------------\\n\");\n inquirer.prompt([\n {\n type: \"list\",\n message: \"Choose an Option\",\n choices: [\"View Products for Sale\",\n \"View Low Invent...
[ "0.7131357", "0.6909747", "0.6302335", "0.6302129", "0.61789155", "0.6124588", "0.6045504", "0.60108143", "0.6001083", "0.59634507", "0.59258217", "0.59257734", "0.5925576", "0.591088", "0.590244", "0.58626074", "0.5836026", "0.5822929", "0.5803792", "0.57864344", "0.5784636"...
0.7353363
0
Compute an effective percapacity unit price
price() { return this.bid / this.capacity; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "computeRefuel() {\n return ((100 - this._fuelLevel) / 100) * this._capacity;\n }", "function priceCalculation() {\n\n const bestPrice = getValue('primary-price');\n const extraMemory = getValue('extra-memory');\n const extraStorage = getValue('extra-storage');\n const fastDelivery = getValu...
[ "0.6549056", "0.6546285", "0.6499925", "0.6345177", "0.62788945", "0.6271538", "0.62672234", "0.6256673", "0.6254601", "0.6237417", "0.616832", "0.6164329", "0.6106789", "0.608745", "0.6084686", "0.6076735", "0.60523105", "0.6050492", "0.60475826", "0.6047251", "0.6042637", ...
0.7085512
0
Compare this Bid to another bid to see if it's cheaper
isCheaperThan(other) { return this.price() < other.price(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareMemory(a, b) {\r\n\r\n\tvar dateA = getDateFromMemory(a);\r\n\tvar dateB = getDateFromMemory(b);\r\n\t\r\n\tvar voteNumA = $(a).attr(\"votes\");\r\n\tvar voteNumB = $(b).attr(\"votes\");\r\n\t\r\n\tvar updatedDateA = new Date(dateA.getTime()+voteNumA*secondPerMemoryVote*1000);\r\n\tvar updatedDateB...
[ "0.63272524", "0.62321943", "0.59343517", "0.589582", "0.58707035", "0.586089", "0.5846542", "0.5844188", "0.58274513", "0.58139336", "0.57718074", "0.5700992", "0.5661398", "0.5582735", "0.5582137", "0.5579092", "0.5571819", "0.5555898", "0.55546474", "0.5549469", "0.5546008...
0.6792459
0
A mime type handler for json objects.
function mimeTypeHandlerJSON(response) { return new Promise((resolve) => response.json().then(json => resolve(json))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function forceJsonContentType (req, res, next) {\n const contentType = req.headers['content-type'];\n // content-type might contain other strings i.e. charset: UTF-8\n return contentType.indexOf('application/json') < 0?\n next(Boom.unsupportedMediaType(\"Expect application/json\")): next();\n}", "isJsonMim...
[ "0.6438498", "0.63793933", "0.60188913", "0.5972431", "0.5955855", "0.5832297", "0.5729232", "0.56958026", "0.55647737", "0.54856324", "0.54856324", "0.5482453", "0.54726267", "0.54726267", "0.54726267", "0.5402269", "0.5375005", "0.5362895", "0.5347516", "0.5308613", "0.5279...
0.64580566
0
Finds major with id
function findOneMajorWithId(majorId, callback) { Major.findOne() .where({ id: majorId }) .exec(function(err, major) { callback(err, major); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setMajorNameInstadeOfId() {\n $(\"*[data-major]\").each(function () {\n\n var id = $(this).data(\"major\");\n $(this).text(majorsMap[id]);\n })\n}", "function retrieveMajor(semver) {\n semver = semver.split('.')\n\tconsole.log(semver[0]);\n \n}", "function getCurrentMajor()\n...
[ "0.5987383", "0.58541733", "0.5759799", "0.5643595", "0.54010695", "0.5380806", "0.5284651", "0.5261274", "0.5227454", "0.5200342", "0.5199093", "0.5156734", "0.5146135", "0.50950944", "0.50284797", "0.4973899", "0.49716648", "0.49588418", "0.495384", "0.4945681", "0.49359435...
0.70238453
0
Gets distance from given point to the nearest circle, with distance ceiled by 'maximumDistance'. Basic concept: Determine distance to current iteration's circle. If inside it, done, else figure out which partition of space the possibly closest circle is in and check for the next iteration's circle in that given partiti...
getDistance(x, y) { const currentObject = this; const getNewDirection = function(c1x, c1y, dir) { const radsOffset = dir*Math.PI/2.0; const isZero = (y - c1y) == 0 && (x - c1x) == 0; var rads = 0.0; if (!isZero) { rads = (Math.atan2(y - c1y, x - c1x) - radsOffset + 4.0*Math.PI)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "GetDistanceToPoint() {}", "function findClosestInSuggestedPath(x,y){\n var closest = 0;\n\n var mdist = 2000;\n\n var dist_x = 0;\n var dist_y = 0;\n\n for (var i = 0; i < suggestedPathPoints.length; i++) {\n dist_x = Math.abs(suggestedPathPoints[i].x - x);\n dist_y = Math.abs(sugges...
[ "0.590441", "0.58005077", "0.5796145", "0.5525656", "0.54770315", "0.54193634", "0.53779006", "0.537673", "0.5351295", "0.5346478", "0.5336191", "0.53212595", "0.5309444", "0.53085804", "0.5290315", "0.5276427", "0.52725023", "0.5251028", "0.524587", "0.5215851", "0.52089", ...
0.6514982
0
Returns color given distance from some point to the nearest circle for that point.
getColorFromDistanceFromNearestCircle(distance) { if (distance <= 0) { return [0, 0, 0, 255]; } else if (distance <= this.cutOff && this.cutOff > 0.00001) { // Interpolate from black to red. const val = Math.max(Math.min(Math.round(255*distance/this.cutOff), 255), 0); return [val, 0, 0, 25...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getColor(x, y) {\n const distanceToNearestCircle = this.getDistance(x, y);\n\n const rgbaArray = this.getColorFromDistanceFromNearestCircle(distanceToNearestCircle);\n\n return rgbaArray;\n }", "function getColorPoint(range, point) {\n if (point <= range[0][0])\n return range[0][1];\n if (...
[ "0.6395812", "0.62927866", "0.6267055", "0.6252585", "0.6252585", "0.6225176", "0.604437", "0.6036491", "0.6015063", "0.59891903", "0.5988255", "0.5988088", "0.5947304", "0.58914965", "0.5888019", "0.58790636", "0.5810934", "0.5809588", "0.58083135", "0.57995665", "0.57975966...
0.7672475
0
Processes the next collection in the collections array. If we have finished processing all of the collections, it triggers the callback.
function processNextCollection() { if (i < collections.length) { var collection = collections[i] i++ // Use myself as a callback. resetCollection(db, collection, processNextCollection) } else { cb() } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processNextCollection() {\n if (i < collections.length) {\n var collection = collections[i];\n i++;\n // Use myself as a callback.\n resetCollection(db, collection, processNextCollection);\n } else {\n cb();\n }\n }", "function processNextCollection() {\n if (i < co...
[ "0.8285021", "0.80393237", "0.80393237", "0.62535554", "0.61772776", "0.61772776", "0.61772776", "0.61772776", "0.61772776", "0.6015998", "0.5901057", "0.55746996", "0.5546235", "0.5483704", "0.5482013", "0.54320896", "0.54050756", "0.539941", "0.5354281", "0.5354281", "0.534...
0.8538723
0
Create the Invoice PDF
async function createPDF(pdfDoc, invoiceId) { pdfDoc.fontSize(26).text("Your Invoice"); pdfDoc.fontSize(15).text(SEPARATOR); pdfDoc.fontSize(15).text(SEPARATOR); const order = await Order.findById(invoiceId).populate('cart.products.productId'); order.cart.products.forEach(prod => { pdfDoc.fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createPDF() {\n var totalPieces = imagePieces.length - 1;\n var doc = new jsPDF({\n unit: 'px',\n invWrapperat: 'a4'\n });\n imagePieces.forEach(function(img){\n doc.addImage(img, 'JPEG', 18, 0);\n if(totalPieces)\n doc.addPage();\n totalPieces--;\...
[ "0.73222816", "0.6881583", "0.67835253", "0.6757244", "0.6581249", "0.6577746", "0.6540408", "0.65221655", "0.64298594", "0.6401584", "0.628935", "0.62841094", "0.6271786", "0.6263776", "0.62341464", "0.6228115", "0.6203073", "0.6193408", "0.6175723", "0.6165838", "0.6158917"...
0.7710339
0
Fix issue Change docker daemon storage driver from 'aufs' to OverlayFS (either "overlay" or "overlay2")
async function fixCompatibilityIssueWithDockerMachine({ ssh }) { console.group('• Fixing remote docker daemon - changing daemon storage driver') let dockerMachineConfigurationFile = '/etc/systemd/system/docker.service.d/10-machine.conf' // file that holds the docker storage driver configuration. let i ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changeDebianFileType() {\n if (this.deployFile.unitInfo.artifactType == 'debian') {\n this.deployFile.unitInfo.artifactType = 'base';\n this.deployFile.unitInfo.debian = true;\n }\n else {\n this.deployFile.unitInfo.artifactType = 'debian';\n }\n }", ...
[ "0.47658056", "0.47436774", "0.4677077", "0.4645943", "0.45615664", "0.4499151", "0.44936067", "0.44927123", "0.44274572", "0.44200975", "0.44086707", "0.43826073", "0.4374213", "0.43378615", "0.42515427", "0.42485607", "0.4223297", "0.420616", "0.42016858", "0.4187677", "0.4...
0.6498741
0
sets the system message
function setSystemMessage(message) { $("div#systemMsg #sMsg").html(message); $("div#systemMsg").removeClass("hidden"); if (!$("div#errorMsg").hasClass("hidden")) $("div#errorMsg").addClass("hidden"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function systemMessage(msg) {\n}", "function setMessage(msg) {\n\t\tdocument.getElementById(\"message\").innerText = msg;\n\t}", "function setMessage(msg) {\r\n\t\tdocument.getElementById(\"message\").innerHTML = msg;\r\n\t\tdocument.getElementById(\"message\").style.color = 'navy';\r\n\t\tdocument.getElementB...
[ "0.74965173", "0.70854187", "0.6799736", "0.6617809", "0.66142434", "0.6587728", "0.6528106", "0.65009946", "0.64979124", "0.64947665", "0.6420322", "0.63974357", "0.63898724", "0.63496673", "0.62986773", "0.6287704", "0.6250479", "0.61579835", "0.6156831", "0.61457837", "0.6...
0.7570445
0
The old constraint system does not allow for strings, so this function checks if the layout props contain string values In certain centering cases we can convert the strings to the old constraint system, so that logic is captured here
function containsInvalidStringValues(props) { window["__checkBudget__"](); const { left, right, top, bottom, center } = props; // We never allow right or bottom to be strings if ([right, bottom].some(isString)) { return true; } // Only allow a string for left, if it is part of the center...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PdfStringLayouter(){/**\n * Checks whether the x co-ordinate is need to set as client size or not.\n * @hidden\n * @private\n */this.isOverloadWithPosition=false;//\n}", "layoutHorizontalAlign () {\n return false;\n //return this.content.layout &&\n /...
[ "0.5716802", "0.5407362", "0.5107725", "0.5103618", "0.50860643", "0.5077472", "0.50545996", "0.50275433", "0.49779806", "0.49771762", "0.49319065", "0.49182856", "0.49037522", "0.49009204", "0.48985457", "0.4823521", "0.47973514", "0.47926417", "0.479141", "0.47661024", "0.4...
0.65008235
1
when start button pressed, enable stop button and disable start button capture the images in textarea set up the timer and run the animation
function start() { disable(); images = document.getElementById("mytextarea").value.split("=====\n"); timer = setInterval(run, time); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function start() {\n startBtn(); \n setTimer(3);\n changeImage();\n displayTimer();\n active();\n}", "function startClicked() {\r\n // get original text in the text area (if any) and hold it in a global variable\r\n if (!!document.getElementById(\"text-area\").value) {\r\n originalText = docu...
[ "0.7407961", "0.72139686", "0.67146075", "0.66983587", "0.6612326", "0.6596928", "0.65432954", "0.6497429", "0.6462992", "0.6438299", "0.64094067", "0.64016044", "0.6343311", "0.6305879", "0.630029", "0.62944245", "0.62740505", "0.62634647", "0.6214018", "0.62007016", "0.6187...
0.7712915
0