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
update action taken by the user for the website.
function updateUserWebsiteInfo(url, action){ var websiteJson = new Object(); websiteJson[url] = action; if(typeof user.website == "undefined") { var currentUserRefUrl = UserRefUrl + '/' + user.id; var json = new Object(); json['website'] = websiteJson; currentUserRef = new F...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateAction() {}", "updateUser(h, p){\n\t\tlet oldInfo = this.props.user;\n\t\tlet updatedInfo = { happiness: oldInfo.happiness + h,\n\t\t pollution: oldInfo.pollution + p};\n\t\tlet userUrl = `/api${this.props.match.url}`;\n\t\tthis.props.actions.updateUser(userUrl, updatedInfo);\n\t}", "updateUser(h, p){\n\...
[ "0.67384434", "0.6272434", "0.6240928", "0.6165409", "0.5926351", "0.58958554", "0.5829935", "0.58295506", "0.5817425", "0.57946885", "0.5760404", "0.57465667", "0.57402235", "0.5698524", "0.5687509", "0.5649926", "0.5636002", "0.5622448", "0.55885625", "0.5578953", "0.557658...
0.64386606
1
2. create a function to populate our table with each obj inside our arr
function populateTable(someArray) { var myTable = document.getElementById("myTable"); someArray.forEach((obj)=> { //1. for each object, create a new row (<tr>) let tr = document.createElement("tr"); myTable.appendChild(tr); //2. for each object, enter some data (<td>) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function table(arr) {\n let lean = arr.map((doc) => doc.toObject());\n return console.table(lean);\n}", "function createTable(arr)\n{\n arr.forEach(function(ele){\n let tr = document.createElement(\"tr\");\n \n for(key in ele)\n {\n let td = document.createElement(\"td\");\n td.tex...
[ "0.72921747", "0.7114492", "0.70117134", "0.68250835", "0.68191296", "0.68015325", "0.6793555", "0.679132", "0.6772907", "0.6768003", "0.67656434", "0.6717217", "0.6690863", "0.6685175", "0.6673283", "0.6666172", "0.6665861", "0.665884", "0.6655876", "0.66462743", "0.6642079"...
0.74781775
0
check if no more undefined values in coefficients
function checkSolved(coefficients) { for (var i = 0; i < coefficients[0].length; i++) { if (coefficients[0][i] == undefined) { return false; } } for (var i = 0; i < coefficients[1].length; i++) { if (coefficients[1][i] == undefined) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hasFractionCoeff() {\n // coeffNode is either a constant or a division operation.\n return this.coeff && NodeType.isOperator(this.coeff);\n }", "function expIsConst(a) {\n return a.length <= 1;\n}", "constant() {\n return this._values.length === 1;\n }", "function inputDataUndef(sta...
[ "0.5627773", "0.56254536", "0.52513623", "0.5208699", "0.5160679", "0.51303726", "0.5089436", "0.5085571", "0.50842255", "0.50520223", "0.502824", "0.49966013", "0.49939528", "0.49789545", "0.49678034", "0.49666008", "0.49614516", "0.49555108", "0.49534404", "0.49534404", "0....
0.67202115
0
class to manage the relationships between the coefficients in the equation
function Relationship() { this.leftTerms = []; this.rightTerms = []; // add a variable to the relationship, given a side, its index in coefficients, and its coefficient (which is the subscript of a term) this.addVariable = function(side, index, coeff) { if (side == "right") { this.rightTerms.push(new Relation...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function coefficientToExpression(coeffs, operators){\r\n\ttoReturn = operators[0];\r\n\tfor(i=0; i<operators.length-1; i++){\r\n\t\ttoReturn += coeffs[i] + operators[i+1];\r\n\t}\r\n\ttoReturn = toReturn.replace(\" 0x +\",\"\");\r\n\tfor(i=0; i<4; i++){\r\n\t\ttoReturn = toReturn.replace(\" 1x\",\" x\");\r\n\t\tto...
[ "0.5931202", "0.58914703", "0.57798404", "0.57491547", "0.5738426", "0.5727851", "0.5698931", "0.5647798", "0.55964774", "0.55612165", "0.5539736", "0.54854345", "0.54739684", "0.5473003", "0.5457186", "0.5448778", "0.53936505", "0.5387874", "0.53655404", "0.5351171", "0.5347...
0.65796596
0
class to keep track of variables within relationships the values for these variables are what we are solving for to balanace the equation. They are the coefficients
function RelationshipVariable(index_, coefficient_) { this.index = index_; this.coefficient = coefficient_; this.value = undefined; // which is actually the coefficient in the larger equation }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Relationship() {\n\tthis.leftTerms = [];\n\tthis.rightTerms = [];\n\n\t// add a variable to the relationship, given a side, its index in coefficients, and its coefficient (which is the subscript of a term)\n\tthis.addVariable = function(side, index, coeff) {\n\t\tif (side == \"right\") {\n\t\t\tthis.right...
[ "0.64209723", "0.5587258", "0.5399283", "0.52615225", "0.5234414", "0.5218479", "0.52162135", "0.51844233", "0.5176656", "0.5153406", "0.51427937", "0.51060265", "0.50893235", "0.5054555", "0.5017057", "0.49816427", "0.49602133", "0.49548423", "0.49504176", "0.49390617", "0.4...
0.61376685
1
This will return the super types of a type and cache them.
function getSuperTypes(type, openWorldType) { const cached = openWorldType.cache.get(type); if (cached) { return cached; } const value = openWorldType.discoverer(type); if (value === 'term') { const res = Object.create(null); res.__depth = 0; res[type] = 0; op...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getAllSubtypes() {\n const _cache = base_node_1.BaseNode._getCache(this);\n if (!_cache._allSubTypesVersion || _cache._allSubTypesVersion < base_node_private_1.ReferenceTypeCounter) {\n _cache._allSubTypes = null;\n }\n if (!_cache._allSubTypes) {\n _cache._allSubT...
[ "0.6324652", "0.59929264", "0.595862", "0.5866389", "0.58315545", "0.5779377", "0.5507416", "0.519868", "0.51245785", "0.5120917", "0.5120917", "0.5099968", "0.4993478", "0.49910632", "0.49830773", "0.48120487", "0.47933984", "0.4792346", "0.47733516", "0.47515324", "0.474725...
0.7452666
0
count every exon occurrence
function countDup(exonsArray) { const start = x => exonsArray[x]["relative start"]; const end = x => exonsArray[x]["relative end"]; let hash = new Map(); for (var i = 0; i < exonsArray.length; i++) { let key = start(i) + ':' + end(i); let item = exonsArray[i]; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getExpectedToReport(rows,prd,ounit) {\n\tvar exp_count = 0;\n\t$.each(rows, function (indx, onerow){\n if(ounit==onerow[2] && prd==onerow[1] && onerow[0]=='RRnz4uPHXdl.ACTUAL_REPORTS'){ \n exp_count = exp_count + 1;\n }\t\t\t\t\t\t\t\t\n\t})\t\t\...
[ "0.6098734", "0.60480857", "0.60480857", "0.60480857", "0.60480857", "0.6016573", "0.6016573", "0.6016573", "0.6016573", "0.6016573", "0.5969488", "0.59586495", "0.5927635", "0.5922004", "0.5917476", "0.5914394", "0.59036934", "0.59029084", "0.589206", "0.5861924", "0.5857603...
0.6781117
0
calculate percentage of occurrence
function calcPerc(count) { return (count / data.number_isoforms) * 100 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numberCountInPercentage() {\n var totalSize = ar.length;\n var count = {\n posCount: 0,\n negCount: 0,\n zeroCount: 0\n };\n ar.forEach(function(num) {\n if (num > 0) {\n count.posCount++;\n } else if (num < 0) {\n count.negCount++;\n } else {\n count.zeroCount++;\n ...
[ "0.6650602", "0.65285504", "0.64983493", "0.6438514", "0.6414981", "0.6350765", "0.6343686", "0.6342986", "0.6311534", "0.6295444", "0.62713486", "0.62579525", "0.6257073", "0.6243919", "0.6216104", "0.6185242", "0.61752105", "0.616723", "0.6152531", "0.6139305", "0.6124882",...
0.6620712
1
output an eight pointed star rules a star of size n is made up of the following: n rows the middle (n / 2 + 1) row has n stars every other row has three stars and spaces decrease until center and then increase again first row spaceBetween = (starWidth 3) / 2 where starWidth = n (rowNum space) + star + (spaceBetween spa...
function star(n) { if (n % 2 === 0) return undefined; if (n < 7) return undefined; let rowWidth = n; let direction = 1; for (let rowNum = 1; rowNum <= n; rowNum += 1) { let spaceBetween = (rowWidth - 3) / 2; let paddingLeft = (n - rowWidth) / 2; if (rowNum === Math.floor(n / 2) + 1) { dra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function star(n) {\n let middle = Math.floor(n / 2);\n let padding = n - 3;\n for (let row = 0; row < n; row++) {\n if (row === middle) {\n console.log('*'.repeat(n));\n } else {\n let toMiddle = (row > middle) ? row - middle - 1 : middle - row - 1;\n let sidePad = (padding / 2) - toMiddle;...
[ "0.8172502", "0.7697083", "0.7430555", "0.73120195", "0.7304324", "0.73021966", "0.7283851", "0.7280125", "0.7253164", "0.7241991", "0.7214399", "0.71242875", "0.7120363", "0.70736635", "0.70588416", "0.70579123", "0.70047814", "0.6991472", "0.6980548", "0.68414", "0.68100774...
0.7939022
1
Used to disable slide nav while it is transitioning (avoids nav appearing during transitions)
function handleSlideNavClick() { $('.slideNav').hide(); slideNavHover = true; slideNavEnabled = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_disableAnimation() {\n this.isAnimatable = false;\n toggleClass(this.navEl, 'no-animation', !this.isAnimatable);\n }", "function toggleSlideOutNavigation() {\n setSlideOutNavigationVisible(!slideOutNavigationVisible);\n }", "function allowTransitions(){$('body').find('#transitions-remove').remove()...
[ "0.6910073", "0.6716486", "0.67129046", "0.6695597", "0.6570363", "0.65472496", "0.6503387", "0.6455533", "0.63794345", "0.63615376", "0.63527155", "0.6241151", "0.61932445", "0.6170727", "0.61222994", "0.61199015", "0.61039346", "0.61022145", "0.6096102", "0.6092803", "0.605...
0.7458371
0
Timer that controls delay before snackbar auto hides
setAutoHideTimer () { const autoHideDuration = this.props.autoHideDuration if (autoHideDuration > 0) { clearTimeout(this.timerAutoHideId) this.timerAutoHideId = setTimeout(() => { if (this.props.open !== null && this.props.onRequestClose) { this.props.onRequestClose(Snackbar.reaso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSnackbar(){\n snackbar.className = \"show\";\n setTimeout(function(){\n snackbar.className = snackbar.className.replace(\"show\", \"\");\n }, 3000);\n}", "function dipslaySnackbar(msg) {\n var x = document.getElementById(\"snackbar\");\n x.innerHTML = msg;\n x.className = \"show\";\n setTi...
[ "0.7558931", "0.72854537", "0.7120542", "0.70418435", "0.69105196", "0.68506694", "0.68307036", "0.67973864", "0.6684891", "0.6644691", "0.6592722", "0.6592722", "0.6554747", "0.65079165", "0.6476806", "0.6450442", "0.6432401", "0.6430957", "0.64075035", "0.64032793", "0.6401...
0.7640555
0
requests the phenomena available for the station selected
function getPhenomenaJSON(){ $.getJSON('http://sensorweb.demo.52north.org/sensorwebclient-webapp-stable/api/v1/phenomena?phenomenon=phe_9eb82ebc5a37b3c8e97f736e85c3032a&station=' + temp.getId(), function(data) { var phenArr = []; for(var i = 0; i < data.length; i++){ phenArr.push(new Phenomenon(data[i].id...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStations() {\n var params = {\n };\n \n $.ajax({\n url: \"https://gateway.apiportal.ns.nl/public-reisinformatie/api/v2/stations?\" + $.param(params),\n beforeSend: function(xhrObj){\n \n // Request headers\n xhrObj.setRequ...
[ "0.6259454", "0.5983277", "0.5695096", "0.5682927", "0.5602912", "0.5588389", "0.5562039", "0.5548755", "0.5547933", "0.54848886", "0.54750115", "0.5460702", "0.54477423", "0.5444993", "0.5409443", "0.5398614", "0.5385493", "0.5381659", "0.5381245", "0.53740597", "0.53646666"...
0.60033566
1
requests all timeseries available for a phenomenon of one station
function getTimeseriesJSON(phenId, stationId) { frame.loadTimeseries(); req = getXMLHttpRequest(); if (req) { req.onreadystatechange = function() { if(req.readyState == 4){ var timeseries = JSON.parse(req.responseText); frame.currentPhenomenon.timeSeries = timeseries; frame.setTimeseries(); } }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static search(query: string): Promise<Array<Series>> {\n return TraktApi.searchShow(query)\n .map(result => result.show)\n .filter(show => show.title && show.year && show.status)\n .map(show => show.ids.tvdb)\n .filter(id => id) // remove null/undefined ids\n .then(ids => _array.uniq(id...
[ "0.5946229", "0.59022856", "0.590091", "0.58908033", "0.58305526", "0.5806644", "0.57662165", "0.57340485", "0.5719705", "0.57113695", "0.5681788", "0.56529313", "0.56259084", "0.56045353", "0.55978113", "0.5596142", "0.5592051", "0.5581975", "0.557653", "0.5573122", "0.55719...
0.59505045
0
Add disableinteraction layer and adjust the size and position of the layer
function _disableInteraction() { var disableInteractionLayer = document.querySelector('.introjs-disableInteraction'); if (disableInteractionLayer === null) { disableInteractionLayer = document.createElement('div'); disableInteractionLayer.className = 'introjs-disableInteraction'; this._targetE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _disableInteraction(){var disableInteractionLayer=document.querySelector(\".introjs-disableInteraction\");if(disableInteractionLayer===null){disableInteractionLayer=_createElement(\"div\",{className:\"introjs-disableInteraction\"});this._targetElement.appendChild(disableInteractionLayer);}setHelperLayerPo...
[ "0.7170388", "0.7006125", "0.7006125", "0.7006125", "0.70054585", "0.6456511", "0.61058515", "0.60783166", "0.60768396", "0.60367924", "0.60020083", "0.5997312", "0.59734136", "0.59296036", "0.5927774", "0.59202254", "0.59111404", "0.5900778", "0.58768904", "0.5841254", "0.58...
0.7014667
1
To remove all show element(s)
function _removeShowElement() { var elms = document.querySelectorAll('.introjs-showElement'); for (var i = 0, l = elms.length; i < l; i++) { var elm = elms[i]; _removeClass(elm, /introjs-[a-zA-Z]+/g); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeShowAllLink() {\n\t$('.show-all').remove();\n}", "function hide_all(){\n\t//hide the element\n\tfor (var i = 0; i < shown.length; i++) {\n\t\tconsole.log(shown.length);\n\t\thide(shown[i]);\n\t};\n\tshown=[];\n}", "function clearResults() {\r\n const clearResults = document.getElementsByClass...
[ "0.7603042", "0.71687", "0.7138757", "0.7011065", "0.69311696", "0.6764829", "0.6734154", "0.66770047", "0.666838", "0.6652054", "0.6640104", "0.6618477", "0.6618477", "0.65929645", "0.6565955", "0.65621656", "0.65396243", "0.6532073", "0.6528597", "0.65162194", "0.6489168", ...
0.7379834
1
Realigns all hint elements
function _reAlignHints() { for (var i = 0, l = this._introItems.length; i < l; i++) { var item = this._introItems[i]; if (typeof (item.targetElement) == 'undefined') continue; _alignHintPosition.call(this, item.hintPosition, item.element, item.targetElement) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reAlignHints(){var _this6=this;forEach(this._introItems,function(_ref2){var targetElement=_ref2.targetElement,hintPosition=_ref2.hintPosition,element=_ref2.element;if(typeof targetElement===\"undefined\"){return;}alignHintPosition.call(_this6,hintPosition,element,targetElement);});}", "function realign(...
[ "0.7906708", "0.6366462", "0.63606393", "0.6126755", "0.58957624", "0.57941955", "0.57941955", "0.5791286", "0.57778233", "0.5690408", "0.5679806", "0.5577674", "0.55141395", "0.54945946", "0.5389023", "0.5347159", "0.529675", "0.5291314", "0.5264364", "0.5243384", "0.5240512...
0.78781646
1
Removes all hint elements on the page Useful when you want to destroy the elements and add them again (e.g. a modal or popup)
function _removeHints() { var hints = this._targetElement.querySelectorAll('.introjs-hint'); if (hints && hints.length > 0) { for (var i = 0; i < hints.length; i++) { _removeHint.call(this, hints[i].getAttribute('data-step')); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeHints(){var _this3=this;var hints=hintQuerySelectorAll(\".introjs-hint\");forEach(hints,function(hint){removeHint.call(_this3,hint.getAttribute(\"data-step\"));});DOMEvent.off(document,\"click\",removeHintTooltip,this,false);DOMEvent.off(window,\"resize\",reAlignHints,this,true);if(this._hintsAutoRe...
[ "0.75579447", "0.75210917", "0.7420845", "0.727884", "0.7161742", "0.6935348", "0.6916988", "0.68832684", "0.67258304", "0.6652683", "0.66498864", "0.6600755", "0.65909326", "0.6563871", "0.65570694", "0.65165085", "0.650127", "0.6498455", "0.64889276", "0.6480707", "0.645220...
0.7591906
0
downloads information about the campus callback is a function called after the response is received give callback a parameter which will be the campus information
function mapyst_campus(callback) { params = { api_key: API_KEY }; $.getJSON("campus api url", params, callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAcademicInfo(callback) {\n let xhttp = new XMLHttpRequest();\n\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n callback.apply(this,[JSON.parse(this.responseText)]);\n }\n };\n\n xhttp.open(\"GET\", \"academics.php\", true);\n xhttp.send();...
[ "0.62619346", "0.5935684", "0.5876698", "0.57949185", "0.5738085", "0.5693536", "0.5543362", "0.5500445", "0.5495289", "0.54948175", "0.5456921", "0.54375345", "0.5431995", "0.5415379", "0.53950065", "0.53564805", "0.53507084", "0.53271663", "0.5316699", "0.53137004", "0.5312...
0.6441634
0
returns a url which can be used to download a blueprint image building is the index of the building according to the info in the campus info floor is the index of the floor in the building according to the info in the campus info
function mapyst_blueprint_url(building, floor) { return "blueprint api url?building=" + building + "&floor=" + floor + "&api_key=" + API_KEY; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBuildingID() {\n\n //get mapName from URL file (buildingID=\"X-X-X\".svg)\n var URL = window.location.href;\n var mapName = URL.substring(\n URL.lastIndexOf(\"buildingID=\") +11, \n URL.lastIndexOf(\".svg\")\n );\n \n \n var notMain = URL.includes(\"buildingID=\"...
[ "0.6006686", "0.59099", "0.58148694", "0.5801135", "0.575088", "0.56645113", "0.5646397", "0.56154054", "0.55957687", "0.5585671", "0.5577324", "0.55663985", "0.5559547", "0.55347246", "0.55344903", "0.55236495", "0.5514593", "0.54956037", "0.5489142", "0.5487907", "0.5467695...
0.71952224
0
downloads a blueprint of a building's floor building is the index of the building according to the info in the campus info floor is the index of the floor in the building according to the info in the campus info callback is a function called after the response is received give callback a parameter which will be the blu...
function mapyst_blueprint(building, floor, callback) { params = { building: building, floor: floor, api_key: API_KEY }; $.getJSON("blueprint api url", params, callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapyst_blueprint_url(building, floor) {\n\treturn \"blueprint api url?building=\" + building + \"&floor=\" + floor + \"&api_key=\" + API_KEY;\n}", "function floorOverviewCallback(data) {\n let template = getTemplate('unit');\n let building = $('.building_select.active').attr('id').replace('buildin...
[ "0.65300757", "0.5588225", "0.5565387", "0.5500919", "0.54836684", "0.54517967", "0.5398965", "0.526496", "0.52528167", "0.52478945", "0.5235049", "0.5228766", "0.52280545", "0.5215106", "0.51967263", "0.5184572", "0.5163415", "0.5161555", "0.51485413", "0.512767", "0.5123933...
0.6824634
0
start is text representing the start/beginning of a route end is text representing the end/destination of a route search is text representing any point note that search has precedence (if search is not empty, it will be assumed to be a one point request) prefs is a comma separated list of booleans (true's, false's) rep...
function mapyst_route(start, end, search, prefs, callback) { params = { start: start, end: end, search: search, prefs: prefs, api_key: API_KEY }; $.getJSON("route api url", params, callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calcRoute() {\n\n var start = pos;\n var end = document.getElementById('end').value;\n var request = {\n origin:start,\n destination:end,\n travelMode: google.maps.TravelMode.DRIVING\n };\n directionsService.route(request, function(response, status) {\n if (status == google.maps.Dir...
[ "0.5929171", "0.5877017", "0.5872538", "0.58555144", "0.57744735", "0.57439524", "0.5692401", "0.56519884", "0.56406564", "0.5632208", "0.55823153", "0.55308396", "0.55129004", "0.5511702", "0.5482084", "0.54784244", "0.54628855", "0.5446489", "0.5437091", "0.5434501", "0.542...
0.7322447
0
converts a point in the campus data to a google maps latlng object
function mapyst_pointToLatLng(point) { return new google.maps.LatLng(point.lat / MILLION, point.lng / MILLION); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pointLatLng( point ) {\n\treturn new GLatLng( point[0], point[1] );\n}", "function getCoords(point) {\n return [Number(point.lat.toFixed(4)), Number(point.lng.toFixed(4))];\n }", "function gtaCoordToLonLat(x, y)\r\n{\r\n\tvar mapx = x * 0.03;\r\n\tvar mapy = y * 0.03;\r\n\treturn new OpenLayers...
[ "0.68894523", "0.6656213", "0.66493285", "0.6521485", "0.65171874", "0.6505107", "0.64429295", "0.6348597", "0.63484985", "0.63202935", "0.63174087", "0.6284228", "0.6275922", "0.62618625", "0.6235339", "0.62282693", "0.62275994", "0.62262386", "0.62207556", "0.62170064", "0....
0.7477631
0
determines whether a direction is outside
function mapyst_outsideDir(direction) { var building = direction.end.buildingIndex; return mapyst_outsideBuilding(campus, building); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isOutside(nextXCord, nextYCord) {\r\n\t\t// Is it outside on x- or y-axis?\r\n\t\tvar isOutsideX = (nextXCord < 0 || nextXCord > worldWidth) ? true : false;\r\n\t\tvar isOutsideY = (nextYCord < 0 || nextYCord > worldHeight) ? true : false;\r\n\t\tvar isOutside = (isOutsideX || isOutsideY) ? true : false;\...
[ "0.7319515", "0.6781238", "0.6618623", "0.6564908", "0.65014213", "0.64764374", "0.62859803", "0.6259529", "0.6080621", "0.60537136", "0.60419905", "0.60120595", "0.5933495", "0.5901227", "0.5901227", "0.5901227", "0.5888642", "0.5888642", "0.5888642", "0.5888642", "0.5888642...
0.75945807
0
determines the building of a direction
function mapyst_dirBuildingIndex(direction) { return direction.end.buildingIndex; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function find_location_to_build_unit(castleLoc, map, list, r) {\n var loc;\n // r.log(\"castle location:\" + castleLoc.x + \", \" + castleLoc.y);\n if (map[castleLoc.y][castleLoc.x + 1] === true && find_if_robot_is_present([castleLoc.x + 1, castleLoc.y], list) === true) {\n loc = { 'x': 1, 'y': 0 }...
[ "0.63616806", "0.6297619", "0.626186", "0.6254427", "0.6113009", "0.6051459", "0.59862185", "0.57884365", "0.578553", "0.5758667", "0.57449937", "0.5719566", "0.5695435", "0.56903213", "0.5650971", "0.5640629", "0.5634754", "0.5564197", "0.5552375", "0.55321395", "0.55226684"...
0.71659446
0
determines the floor of a direction
function mapyst_dirFloorIndex(direction) { return direction.end.floorIndex; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRealFloor(n) {\n if (n === 0 || n < 0) return n\n if (n < 13) return n - 1\n if (n > 13) return n - 2\n if (n === 13) return \"This floor does not exist in America!\"\n}", "function getRealFloor(n) {\n if (n === 0) {return 0;}\n if (n >= 13) {return n-2;}\n if (n > 0 && n < 13) {return n-1;}\n...
[ "0.6773642", "0.63304883", "0.6307168", "0.6203428", "0.6150541", "0.6108511", "0.6097617", "0.60815907", "0.60695255", "0.60668325", "0.60320073", "0.6027053", "0.59924144", "0.59599644", "0.5936163", "0.59170026", "0.589597", "0.5895488", "0.58482254", "0.5814885", "0.58024...
0.7575256
0
Update expiry date by Key
async function expire(key, expiryDate) { return tokens.findOne({ key: key }, function (err, token) { if (err) throw err; token.expiryDate = expiryDate; return token.save(function (err, result) { if (err) throw err; return result; }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function update(key, val, expiry = 1800) {\n await client.set(key, val, 'EX', expiry);\n}", "setExpiryDate(payload, next) {\n\t\tlet expiryDate = new Date(0);\n\t\texpiryDate.setUTCSeconds(payload.expiryDate); // expiry date is a raw epoch as it comes from Stripe\n\t\tlet updatePayload = {\n\t\t\tquery:...
[ "0.70669866", "0.6739294", "0.662831", "0.6530125", "0.6285811", "0.61497736", "0.60854524", "0.60819924", "0.588342", "0.588342", "0.58767956", "0.5863293", "0.58487767", "0.5684496", "0.5681513", "0.5669922", "0.56439835", "0.5635468", "0.5628263", "0.5588944", "0.55639374"...
0.6957648
1
allow to serialize set
function Set_toJSON(key, value) { if (typeof value === 'object' && value instanceof Set) { return [...value]; } return value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set serializedObject(value) {}", "static toSet(){\n return \"toSet\"\n }", "function Set () {\n this.dataStore = [];\n }", "function as_set(self) {\n return new Sk.builtin.set(Sk.misceval.arrayFromIterable(self));\n}", "serialize() {}", "serialize() {}", "serialize() {}",...
[ "0.64704174", "0.6243265", "0.61712295", "0.61341274", "0.60605294", "0.60605294", "0.60605294", "0.60605294", "0.60605294", "0.60605294", "0.60605294", "0.60605294", "0.60605294", "0.60605294", "0.60605294", "0.60605294", "0.60605294", "0.60605294", "0.60605294", "0.60605294",...
0.71298105
0
Initialize a mixed checkbox.
initCustomCheckbox() { const status = this.getCustomState(); const supplementaryLabel = this.container.querySelector( 'span.supplementary-label' ); const customCheckbox = document.createElement( 'div' ); customCheckbox.classList.add( 'checkbox' ); customCheckbox.setAttribute( 'role', 'checkbox' ); customChe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CheckboxWidget(initVal) {\n\tInputWidget.apply(this,[INPUT({type:'checkbox','checked':(initVal ? true : false)})]);\n}", "function booleanInit() {\n var that = this;\n this.$input = $(\n '<input type=\"checkbox\" value=\"true\" class=\"editor-checkbox\" hideFocus>',\n );\n this.$input.a...
[ "0.71604025", "0.65488005", "0.6437604", "0.6403552", "0.6192925", "0.6118989", "0.6108805", "0.5988986", "0.59546965", "0.59347606", "0.5890234", "0.5869486", "0.58627737", "0.5819939", "0.5811416", "0.5793054", "0.5764748", "0.5731471", "0.5651934", "0.56281966", "0.5621697...
0.71331066
1
Get custom status for the toplevel checkbox.
getCustomState() { const checkedSubInputs = this.subGroup.querySelectorAll( '[type="checkbox"]:checked' ); let state = false; if ( checkedSubInputs.length === this.subInputs.length ) { state = true; } else if ( 0 < checkedSubInputs.length ) { state = 'mixed'; } return state; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getChecked(selfUL, status) {\r\n\t\tvar opts = _options(selfUL);\r\n\t\tstatus = status || \"checked\";\r\n\t\tvar selector = \"\";\r\n\t\tif (status == \"checked\") {\r\n\t\t\tselector = \"span.TrC1\";\r\n\t\t} else if (status == \"unchecked\") {\r\n\t\t\tselector = \"span.TrC0\";\r\n\t\t} else if (statu...
[ "0.60593104", "0.5898365", "0.58891505", "0.587962", "0.57929075", "0.5755426", "0.5719914", "0.5686118", "0.56219786", "0.5577336", "0.5567077", "0.55423915", "0.5531631", "0.5531631", "0.5531631", "0.55136293", "0.5510219", "0.55064696", "0.54868335", "0.5463422", "0.542188...
0.5926201
1
Method which checks if click event path contains elements in _overlayToIgnore, and prevents overlay hide if id exists in event path isElementContained is called to check if event target is nested in overlay parent
isElementAllowed(parent, event) { if (this._overlayToIgnore?.size > 0) { for (const element of event.path) { if (element.id && this._overlayToIgnore.has(element.id)) { return true; } } } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_outsideClickListener(event) {\n const eventPath = event.composedPath();\n\n if (eventPath.indexOf(this.positionTarget) < 0 && eventPath.indexOf(this.$.overlay) < 0) {\n this.opened = false;\n }\n }", "handleOutsideClick(e) {\n if (this.node) {\n if (!this.node.contains(e.target)...
[ "0.6247182", "0.61721146", "0.61466", "0.5849728", "0.5777489", "0.57255906", "0.56821567", "0.56741285", "0.56500703", "0.5591838", "0.5591838", "0.5591838", "0.5587958", "0.5587958", "0.5587958", "0.5587958", "0.5587958", "0.5587958", "0.5587958", "0.5587958", "0.55847806",...
0.71276903
0
Method which checks if the click event target is nested in overlay parent
isElementContained(parent, event) { var node = event.target?.parentNode; while (node != null) { if (node === parent) { return true; } node = node.parentNode; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_outsideClickListener(event) {\n const eventPath = event.composedPath();\n\n if (eventPath.indexOf(this.positionTarget) < 0 && eventPath.indexOf(this.$.overlay) < 0) {\n this.opened = false;\n }\n }", "function alreadyClicked(evt) {\n return ($(evt.target).parent().attr('clicked'));\n}", "fun...
[ "0.6755355", "0.6516276", "0.6461736", "0.6432935", "0.6418033", "0.6381261", "0.635985", "0.63518447", "0.622447", "0.6097462", "0.606951", "0.60627294", "0.60037315", "0.5983328", "0.59271467", "0.5919059", "0.5917162", "0.5904013", "0.58796674", "0.5874039", "0.587052", ...
0.6623846
1
Update the enemy's position, required method for game Parameter: dt, a time delta between ticks
update(dt) { //Set enemy speed this.x += this.s*dt; this.checkOutside(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update(dt) {\n // You should multiply any movement by the dt parameter\n // which will ensure the game runs at the same speed for\n // all computers.\n // handles enemy movement- use dt(time delta) to normalize gamse speed\n\n // check enemies position status\n // within the grid -> move forwar...
[ "0.8016584", "0.7930652", "0.79089636", "0.7807448", "0.7785798", "0.7751921", "0.77501315", "0.7711419", "0.7710239", "0.76918", "0.7675924", "0.7665924", "0.7661256", "0.7596541", "0.7563993", "0.75317806", "0.7496217", "0.74835384", "0.744133", "0.7398935", "0.73872644", ...
0.8167182
0
Modal events shows the winmessage modal.
function winMessage() { MODAL.style.display = 'block'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showMessage() {\n modal.style.display = \"block\";\n }", "function showEventWindow() {\r\n\r\n\t// check input\r\n\t// $('#modal-body').html(getEventStatus('buildEvent'));\r\n\t// $('#showModal').modal();\r\n\t// TODO show window\r\n\talert('Diese Funktion steht in der Demo leider nicht zur Ve...
[ "0.7252657", "0.69745207", "0.6953922", "0.68555206", "0.68243796", "0.67815036", "0.67623377", "0.6760569", "0.67519253", "0.66436327", "0.6616555", "0.6616052", "0.660888", "0.65908843", "0.6587195", "0.6582526", "0.65722686", "0.6541431", "0.6541431", "0.65409017", "0.6540...
0.7678441
0
Find all prices on results page
function getPrices() { // Find all <li> search results var x = document.getElementsByClassName("search-page__result"); var i = x.length; var result = []; // Extract price and year for each result while(i--) { var price = x[i].getElementsByClassName("vehicle-price")[0].innerHTML; var year = x[i].getElementsBy...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scrapePrices(){\n resetDatasource();\n completedInsertions = 0;\n\n // iterate over locations and retrieve price data for each\n locations.forEach(function(location){\n requestHeader = {\n 'Authorization': 'Token ' + config.serverToken\n }\n\n // create request query string\n var apiF...
[ "0.66193885", "0.63526255", "0.6333761", "0.62929714", "0.6205024", "0.6136959", "0.6101291", "0.6022695", "0.5985142", "0.59583193", "0.5950736", "0.59387034", "0.5878633", "0.5856835", "0.5848837", "0.5848343", "0.57757723", "0.5772436", "0.57435644", "0.57406104", "0.57373...
0.7356119
0
Go to next page Returns true if successful, false if no next page is found
function nextPage() { var nextLink = document.getElementsByClassName("paginationMini--right__active")[0]; if(nextLink !== undefined) { nextLink.click(); return true; } else { return false } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function goToNextPage() {\n\t\tif ( canNextPage() ) {\n\t\t\tgoToPage( currentPage() + 1 );\n\t\t}\n\t}", "function nextPage(){\n if (page > 0)\n {\n setPage( page +1);\n }\n }", "nextPage () {\n if (this.haveNextPage) {\n this.goToPage(this.paginator.currentPage ...
[ "0.75438106", "0.7439045", "0.7291083", "0.7269252", "0.72691154", "0.7265044", "0.72641677", "0.7236058", "0.72352993", "0.7226398", "0.71786493", "0.71759903", "0.7152534", "0.70387185", "0.7033507", "0.7017838", "0.70155084", "0.7014288", "0.69691145", "0.691274", "0.68634...
0.78897214
0
Wait a random time then call back the process function
function waitCallback() { var waitTime = Math.random() * 2 * AVERAGE_WAIT_TIME; if(waitTime < 1000) { waittime = 1000; } setTimeout(process, waitTime); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function process(num) {\r\n // function to delay\r\n delay();\r\n console.log(num);\r\n}", "function process1(){\n\t setTimeout(function(){ console.log(\"process 1 is complete\"); }, 2000);\n}", "function wait(){}", "sleepForProcess(time) {\nthis._sleepProcessContinueTime = Date.now() + time;\nretur...
[ "0.70591843", "0.668763", "0.6554091", "0.6476791", "0.64031637", "0.6326869", "0.63063616", "0.6280033", "0.6238827", "0.62267", "0.61807734", "0.60998744", "0.60954285", "0.6090621", "0.6071971", "0.6060246", "0.6059777", "0.6046299", "0.6028329", "0.60133517", "0.59974664"...
0.7935224
0
GeneralHomepage component displays Navbar Displays welcome banner Routes users to /login or /signup
function GeneralHomepage(props) { return ( // <Router> <React.Fragment> <Navbar sticky='top'> <Navbar.Brand> <Link to="/"> <img height={60} src="/static/img/small-new-logo.png"/> </Link> </Navbar.Brand> <Navbar.Collapse className="j...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayHome(ctx) {\n if (!auth.isAuth()) {\n ctx.loadPartials({\n header: './templates/common/header.hbs',\n footer: './templates/common/footer.hbs',\n loginForm: './templates/forms/loginForm.hbs',\n regi...
[ "0.699686", "0.65884936", "0.65874964", "0.6503903", "0.64514995", "0.6437931", "0.635223", "0.63236856", "0.6295261", "0.6236942", "0.6226943", "0.6209216", "0.61949", "0.61808383", "0.61733514", "0.61684674", "0.61493987", "0.6130626", "0.6106404", "0.61006397", "0.6080464"...
0.6998989
0
Populates the Project Details in the form
function getProjectDetails(){ var projectId = document.getElementById("projectViewSelect").value; var method = "GET"; var url = baseURL + "Project/" + projectId; var httpRequest = createHttpRequest(method, url); httpRequest.onreadystatechange = function(){ if (httpRequest.readyState == 4 && httpRequest....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _fillProjectDetail() {\n if (items) {\n $scope.addEditButtonFlag = true;\n serverRequestService.serverRequest(ADD_EDIT_PROJECT_CTRL_API_OBJECT.getProjectDetailByProjectId + items, 'GET').then(_getProjectDetail);\n }\n }", "function fillProjectInformation(data) {\n ...
[ "0.74159265", "0.68182844", "0.6791215", "0.6790838", "0.67839056", "0.66863066", "0.6661034", "0.64903486", "0.6478901", "0.64245963", "0.6421508", "0.6388222", "0.63880455", "0.63584363", "0.634502", "0.6327312", "0.631421", "0.62961006", "0.62422997", "0.6225116", "0.62157...
0.7176438
1
Populates the Category Details in the form
function getCategoryDetails(){ var categoryId = document.getElementById("categoryViewSelect").value; var method = "GET"; var url = baseURL + "Category/" + categoryId; var httpRequest = createHttpRequest(method, url); httpRequest.onreadystatechange = function(){ if (httpRequest.readyState == 4 && httpReq...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNewCategoryDetails() {\n var category = {};\n var properties = new Array\n category.Name = $('#newCategoryName').val();\n category.Description = $('#newCategoryDescruption').val();\n category.DateModified = $.now()\n category.Email = email;\n count = 0;\n var rowCount = $('#AddC...
[ "0.684358", "0.6549479", "0.6481749", "0.63763213", "0.6297688", "0.6268353", "0.6047285", "0.603286", "0.6003146", "0.5973504", "0.59461814", "0.59280515", "0.59235084", "0.59091413", "0.58873755", "0.58858", "0.5855289", "0.5842405", "0.5814613", "0.5778976", "0.5776337", ...
0.69995093
0
Update the changes made in Category form to the database
function updateCategoryDetails(e){ e.preventDefault(); var categoryFormData = JSON.parse(queryStringToJsonString($("#admin-view-category").serialize())); var categoryObj = {}; for(var key in categoryFormData){ categoryObj[key] = decodeURIComponent(categoryFormData[key]); } updateDetails("PUT", baseURL...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function actionUpdateCategory()\n{\n\tvar name = $('.input-child-category').find('.txt_name').val();\n\tvar description = $('.input-child-category').find('.txt_description').val();\n\tvar category_id = $('#txt_category_id').val();\n\tvar parent_id = $('#cbo_parent').val();\n\t\n\t// console.log(name);\n\t// consol...
[ "0.7707423", "0.70901823", "0.7001967", "0.6979275", "0.6704569", "0.66894877", "0.66472024", "0.66455525", "0.6585413", "0.65330595", "0.6517816", "0.64799833", "0.64235115", "0.639989", "0.6369068", "0.634406", "0.6284234", "0.6196815", "0.6161407", "0.6144711", "0.61412424...
0.70929855
1
Adds a candy of random color at row, col.
addRandomCandy(row, col, spawnRow, spawnCol) { let random_color = Math.floor(Math.random() * CandyColors.length); let candy = new Candy(CandyColors[random_color], this.candyCounter++); this.add(candy, row, col, spawnRow, spawnCol); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeColor(){\n var i = Math.floor(Math.random() * 8);\n col = c[i];\n}", "function Col() {\n\tvar color1 = Math.floor(Math.random() * 256); \n\tvar color2 = Math.floor(Math.random() * 256);\n\tvar color3 = Math.floor(Math.random() * 256);\n\tvar randomColor = \"rgb(\" + color1 + \" , \" + color3...
[ "0.7124589", "0.65871984", "0.6564313", "0.65388334", "0.6505548", "0.643702", "0.6434244", "0.64104885", "0.6405022", "0.6393349", "0.6317941", "0.6308429", "0.63067186", "0.62866086", "0.6246076", "0.624579", "0.62452835", "0.6238167", "0.6235033", "0.62260544", "0.62124455...
0.81379634
0
Returns the candy immediately in the direction specified by direction ['up', 'down', 'left', 'right'] from the candy passed as fromCandy
getCandyInDirection(fromCandy, direction) { switch (direction) { case "up": { return this.getCandyAt(fromCandy.row - 1, fromCandy.col); } case "down": { return this.getCandyAt(fromCandy.row + 1, fromCandy.col); } case "l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveCandy(e){\n\n\tvar fromCandy = parseCandyFromInput();\n\tvar id = e.target.id;\n\n\tvar dir;\n\tif (id == \"up-arrow\"){\n\t\tdir = \"up\";\n\t}\n\telse if (id == \"down-arrow\") {\n\t\tdir = \"down\";\n\t}\n\telse if (id == \"right-arrow\") {\n\t\tdir = \"right\";\n\t}\n\telse if (id == \"left-arrow\...
[ "0.5910389", "0.5572941", "0.5534618", "0.52837944", "0.5006465", "0.49514604", "0.48778474", "0.4816328", "0.47668535", "0.4755258", "0.4746091", "0.4741458", "0.4715473", "0.4710986", "0.47028401", "0.47023916", "0.4686653", "0.46619254", "0.46331722", "0.46331722", "0.4606...
0.8135911
0
Flip candy1 with candy2 in one step, firing two move events. Does not verify the validity of the flip. Does not crush candies produced by flip.
flipCandies(candy1, candy2) { // Swap the two candies simultaneously. let details1 = { candy: candy1, toRow: candy2.row, toCol: candy2.col, fromRow: candy1.row, fromCol: candy1.col }; let details2 = { candy: candy2, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function flipCard(event) {\n \n//counter for the moves\n moves++;\n counter.innerHTML= 'Moves '+ moves;\n\n if (!firstCard || !secondCard) {\n event.target.classList.toggle('front');\n //lock the bord \n if (lockBord) return; \n if (this === firstCard) return;\n\n if (!hasFlippedCard) {\n ha...
[ "0.65831816", "0.6411302", "0.6224742", "0.61663324", "0.6129596", "0.6125052", "0.6109397", "0.6088252", "0.60776407", "0.60491985", "0.60396284", "0.60289365", "0.6028781", "0.59832746", "0.59744257", "0.5932335", "0.5918795", "0.59085095", "0.58980983", "0.5869408", "0.586...
0.76788986
0
Sorts Top Scores List and Creates a List of the Top 5 Scores
function sortTopScoresList() { topScores.sort((a, b) => b.score - a.score); topFiveScores = topScores.slice(0, 5); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrangeBestScores(actualScore){\r\n \r\n if(bestScores.length < 5){\r\n \r\n bestScores.push(actualScore);\r\n }\r\n\r\n else if (bestScores[bestScores.length - 1] < actualScore){\r\n \r\n bestScores.pop();\r\n bestScores.push(actualScore);\r\n }\r\n\r\n ...
[ "0.74457496", "0.6804465", "0.6778535", "0.6729443", "0.66460836", "0.66289616", "0.662605", "0.6597064", "0.6564662", "0.65179", "0.64956635", "0.64950097", "0.6494455", "0.6480062", "0.64636457", "0.64291555", "0.63760716", "0.6373832", "0.63537395", "0.6289806", "0.6282171...
0.8782053
0
get expense large and small category list
function getExpenseLargeWithSmallCategoryList() { console.log('[Service CategoryService getLargeAndSmallCategoryList] start'); return local_db.query('categoryDoc/expense_category_large_small').then(function (response) { var largeCategoryAndSmallCategoryDocs = response.rows.map(function (response) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getExpenseLargeCategoryList() {\n console.log('[Service CategoryService getExpenseLargeCategoryList] start');\n\n return local_db.query('categoryDoc/expense_category_large').then(function (response) {\n var largeCategory = response.rows.map(function (response) {\n return response.value;\...
[ "0.72973764", "0.7036388", "0.61854875", "0.59898925", "0.59729445", "0.5916759", "0.58785576", "0.5798373", "0.5745349", "0.56812644", "0.55119514", "0.5500993", "0.5496972", "0.5493204", "0.5488747", "0.5445419", "0.5417211", "0.53775054", "0.53621453", "0.52897245", "0.527...
0.73551744
0
get expense large category list
function getExpenseLargeCategoryList() { console.log('[Service CategoryService getExpenseLargeCategoryList] start'); return local_db.query('categoryDoc/expense_category_large').then(function (response) { var largeCategory = response.rows.map(function (response) { return response.value; }); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getIncomeLargeCategoryList() {\n console.log('[Service CategoryService getIncomeLargeCategoryList] start');\n\n return local_db.query('categoryDoc/income_category_large').then(function (response) {\n var largeCategory = response.rows.map(function (response) {\n return response.value;\n ...
[ "0.7310232", "0.69105554", "0.66644824", "0.6645282", "0.6486447", "0.6211078", "0.61693287", "0.615909", "0.6060221", "0.6046396", "0.5936902", "0.5933221", "0.5925433", "0.5917625", "0.5891424", "0.58866733", "0.58400583", "0.5818825", "0.5811806", "0.5811694", "0.579578", ...
0.76370645
0
get income large category list
function getIncomeLargeCategoryList() { console.log('[Service CategoryService getIncomeLargeCategoryList] start'); return local_db.query('categoryDoc/income_category_large').then(function (response) { var largeCategory = response.rows.map(function (response) { return response.value; }); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getExpenseLargeCategoryList() {\n console.log('[Service CategoryService getExpenseLargeCategoryList] start');\n\n return local_db.query('categoryDoc/expense_category_large').then(function (response) {\n var largeCategory = response.rows.map(function (response) {\n return response.value;\...
[ "0.7004086", "0.64176726", "0.641534", "0.6326896", "0.6314776", "0.62857354", "0.62765855", "0.62575465", "0.62566453", "0.62211585", "0.62086266", "0.61640555", "0.61390823", "0.6123519", "0.6116942", "0.60667914", "0.60567224", "0.60308903", "0.60308903", "0.6029202", "0.6...
0.7579718
0
creating a function to send AJAX request to getdefinition() in annotatorApplication.js API
function generateResult(){ var selectedOntologies = []; //creating an empty array to hold selected ontologies var annotateText=document.getElementById("typeArea").value; //get the text value //selectedOntologies = ["Adaptor1", "Adaptor2"]; //testing: hardcoding the selected ontologies //chec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getProcessDefinitionsAndThen(func) {\n\t$.ajax({\n type: 'GET',\n url: JODA_ENGINE_ADRESS + '/api/repository/process-definitions',\n success: function(data) {\n \tfunc(data);\n },\n dataType: \"json\"\n });\n}", "function defineAjax(query){\n \n ...
[ "0.6300379", "0.620572", "0.60155195", "0.59045494", "0.58270824", "0.5749494", "0.57361", "0.5708815", "0.5703712", "0.5697868", "0.5697868", "0.5666113", "0.56647927", "0.5591584", "0.55899024", "0.5550247", "0.55408674", "0.55337256", "0.553021", "0.5527684", "0.5489954", ...
0.62757736
1
listen to undo / redo action on an element triggered by (CTRL|META)+(Y|Z)
function listenUndoRedo(e) { if (e.ctrlKey || e.metaKey) { if (e.which === 89 || e.which === 90) { e.preventDefault(); e.stopPropagation(); } // Y = 89 if (e.which === 89) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hookUndoShortcutKey() {\n document.addEventListener('keydown', (e) => {\n const keyCode = e.keyCode || e.code;\n if (keyCode === 90 && (e.ctrlKey || e.metaKey)) {\n if (e.shiftKey) {\n this._undoRedoBuffer.redo(); // Ctrl + Shift + Z\n }...
[ "0.7441188", "0.6447203", "0.6335831", "0.6320327", "0.62309283", "0.6022239", "0.60032904", "0.5972004", "0.59608185", "0.59279877", "0.5905862", "0.5850329", "0.5850329", "0.5850329", "0.5850329", "0.5850329", "0.5850329", "0.5850329", "0.5850329", "0.5850329", "0.5744159",...
0.762199
0
Takes in a params object with the following parameters: origin, num_waypoints, types, and either destination or radius (in miles) Calculates a route with a number of stops equal to num_waypoints Returns a route object containing: origin, destination, and an array of waypoints. Check Google Maps docs for structure of wa...
async function calculateTrip(params) { var origin = params.origin; var num_waypoints = parseInt(params.num_waypoints); var types = params.types == "" ? [] : params.types.split(','); types.push("tourist_attraction"); // if only a radius is provided, calculate a random destination near edge of radius ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calcRoute() {\n\n var request = {\n origin: start,\n destination: end,\n travelMode: google.maps.TravelMode[travelMode],\n waypoints: waypts\n };\n\n directionsService.route(request, function(result, status) {\n\n if (status == google.maps.DirectionsStatus.OK) {\n directionsDisplay....
[ "0.6481218", "0.64268935", "0.6412768", "0.6299007", "0.6269304", "0.62585497", "0.6210587", "0.6167774", "0.6158563", "0.6117574", "0.6088642", "0.6067851", "0.6063156", "0.60086256", "0.5976581", "0.59675556", "0.595895", "0.59316874", "0.59188414", "0.58962864", "0.5878385...
0.73356414
0
Function to check if the User has beaten the highscore
function hasBeatenScore(userScore){ var maxScore = 0; for(var i=0;i<highScores.length-1;i++){ if(highScores[i].score>=maxScore){ maxScore = highScores[i].score; } } return userScore>maxScore; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasUserBeatenHighScore() {\n var maxScore = 0;\n for (var i = 0; i < highScores.length; i++) {\n var currentHighScore = highScores[i].score;\n if (currentHighScore > maxScore) {\n maxScore = currentHighScore;\n }\n }\n if (score > maxScore) {\n return \"CONGRATULATIONS AGAIN! You have...
[ "0.79255027", "0.78743756", "0.7523475", "0.7435846", "0.73806435", "0.7339485", "0.7131907", "0.7090071", "0.7086963", "0.70551807", "0.7043541", "0.6988358", "0.69700706", "0.6925181", "0.6924381", "0.6913654", "0.6909139", "0.6905575", "0.68015856", "0.6749256", "0.6745746...
0.80320275
0
funUpdateConsole('RB Socket.IO Server running at port 10543', false); Core Programs Show Clients' List every 10 seconds
function funShowClients() { for (let i = 0; i < aryClients.length; i++) { try { funUpdateServerMonitor("Connection Code: " + aryClients[i].connectionCode + "&nbsp;&nbsp;&nbsp;User ID: " + aryClients[i].userId, true); } catch (err) { // } } // let dtTemp = Date...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function funShowClients() {\n for (let i = 0; i < global.aryClients.length; i++) {\n try {\n mRU.funUpdateServerMonitor(\"Connection Code: \" + global.aryClients[i].strSocketID + \"&nbsp;&nbsp;&nbsp;User ID: \" + aryClients[i].userId, true);\n } catch (err) {\n //\n }\n }\n mRU....
[ "0.6971213", "0.6808598", "0.6308435", "0.61830795", "0.6177133", "0.6175315", "0.61669296", "0.6164632", "0.6159556", "0.6148109", "0.6133015", "0.60988307", "0.6042675", "0.6031182", "0.601019", "0.5999722", "0.59803385", "0.5973907", "0.5966781", "0.59617853", "0.5949923",...
0.7055527
0
If replaceFlag is true, it means that sharing structure is completely replaced (if needed). If replaceFlag is false, it means that sharing is added to if needed (what's already there plus what's shared.
function shareOne(type, fromReference, publicAccess, to, replaceFlag) { var from = getObject(type, fromReference); if (!from || !from.id) { log.error("dhis.shareOne can't find " + type + " to share " + util.inspect(fromReference)); return; } //log.trace("dhis.shareOne type " + type + " f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggleOverwrite() {\n this.setOverwrite(!this.$overwrite);\n }", "function setShared (/*boolean*/ _isShared) {\n isShared = _isShared;\n }", "function share() {\n // send the save snapshot to the share service as it has all we need already\n shareService.share(saveSnapShot).then(functio...
[ "0.5179475", "0.51465404", "0.4868794", "0.48181883", "0.46928212", "0.46554306", "0.46554306", "0.46554306", "0.46554306", "0.46542782", "0.45893157", "0.45290568", "0.45275587", "0.44715372", "0.4395928", "0.43938777", "0.43871057", "0.43854055", "0.4380693", "0.43624473", ...
0.6260049
0
filters through the mock data and returns bikes for a given location and radius
getBicyclesByLatLng(location, radius) { return this.store.filter( bike => turf.distance(toLngLat(location), toLngLat(bike.pos)) < radius ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findBikes() {\n var latitude = 38.9072;\n var longitude = -77.0369;\n var queryUrl = \"https://api.coord.co/v1/sv/location?latitude=\" +latitude + \"&longitude=\" + longitude + \"&radius_km=\" + radius + \"&access_key=\" + coord;\n request(queryUrl, function (error, response, body){\n i...
[ "0.6934466", "0.6199266", "0.61675894", "0.6094429", "0.60206825", "0.5961225", "0.59108365", "0.59002304", "0.58888614", "0.57672876", "0.5761343", "0.5746194", "0.5692828", "0.56898695", "0.5681163", "0.5652376", "0.562714", "0.5621613", "0.5620929", "0.5615943", "0.5588710...
0.7330534
0
flashes the current line to highlight an error
errorLine() { const view = this.app.workspace.activeLeaf.view; if (view instanceof obsidian.MarkdownView) { const cm = view.sourceMode.cmEditor; let cursorLine = cm.getCursor().line; cm.addLineClass(cursorLine, "wrap", plugin_name + "-error"); setTimeout((...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw_error() {\n\tdocument.getElementById(\"raw_output\").innerHTML = \"ERROR!\";\n}", "error(message){\n this.terminal.echo(\"[[;red;]\" + message + \"]\");\n }", "function print_error(line) {\n\ttry {\n\t\tif(ansi) { debug.defaults.cursors.error(stderr_cursor); }\n\t\t_print_error(line);\n...
[ "0.67976534", "0.6571959", "0.65389735", "0.65114635", "0.6296488", "0.6248946", "0.6094176", "0.60850686", "0.60716075", "0.606556", "0.6049388", "0.6029571", "0.6006175", "0.59832716", "0.59678984", "0.5967343", "0.5965794", "0.5962465", "0.5958049", "0.5945041", "0.5935151...
0.70451915
0
gotoSibling is configured only for [n_item = +1 or 1] it may be extended later
gotoSibling(n_item) { const view = this.app.workspace.activeLeaf.view; if (view instanceof obsidian.MarkdownView) { const cm = view.sourceMode.cmEditor; let line_limit; if (n_item > 0) { line_limit = cm.lastLine(); } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextSib(){\n endPos = $(selectedNode).parent().siblings('li').length;\n siblings = $(selectedNode).parent().parent().children('li').children('.node');\n\n if(sibPos != endPos){\n sibPos++;\n }else{\n log('Last sibling is selected - no more to right')\n }\n\n //style selecte...
[ "0.652431", "0.641464", "0.641464", "0.6394068", "0.6389535", "0.6380312", "0.6377942", "0.6377942", "0.6377942", "0.6357915", "0.6262708", "0.6262708", "0.6177118", "0.6177118", "0.6177118", "0.61450154", "0.61428463", "0.6121924", "0.61177033", "0.610312", "0.6088345", "0...
0.7986384
0
gotoCousin is configured only for [n_item = +1 or 1] it may be extended later
gotoCousin(n_item) { const view = this.app.workspace.activeLeaf.view; if (view instanceof obsidian.MarkdownView) { const cm = view.sourceMode.cmEditor; let line_limit; if (n_item > 0) { line_limit = cm.lastLine(); } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateCurrentNextToGoCandidate(item) {\n item.nextToGo = true;\n}", "gotoCheckLimit(current_line, n_item, line_limit) {\n if (n_item > 0 && current_line < line_limit) {\n return true;\n }\n else if (n_item < 0 && current_line > line_limit) {\n return true;\n ...
[ "0.54996616", "0.5231484", "0.5217627", "0.52038354", "0.51995224", "0.51961404", "0.5164829", "0.51473683", "0.51473683", "0.51473683", "0.50889915", "0.5068755", "0.5060306", "0.5048544", "0.4964743", "0.4938445", "0.49217272", "0.4887963", "0.48409018", "0.48362386", "0.48...
0.760307
0
gotoSection is configured only for [n_item = +1 or 1] it may be extended later
gotoSection(n_item) { const view = this.app.workspace.activeLeaf.view; if (view instanceof obsidian.MarkdownView) { const cm = view.sourceMode.cmEditor; let cursorHead = cm.getCursor(); let line_base = cursorHead.line; let line_limit; if (n_ite...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function goto_section(event){\n\n let wantedSection = event.target.textContent;\n let found = undefined; \n \n for(section of sections){ \n (section.getAttribute(\"data-nav\") == wantedSection) && (found = section);\n }\n \n window.scrollTo({\n top: found....
[ "0.6568029", "0.65054125", "0.6285653", "0.62813914", "0.6052465", "0.5998655", "0.59681314", "0.59178776", "0.5884075", "0.58561325", "0.5832038", "0.5826634", "0.5807272", "0.57517654", "0.57421196", "0.5705463", "0.5664043", "0.5655138", "0.56396633", "0.5618486", "0.55958...
0.76724994
0
gotoCheckLimit is configured only for [n_item = +1 or 1] it may be extended later
gotoCheckLimit(current_line, n_item, line_limit) { if (n_item > 0 && current_line < line_limit) { return true; } else if (n_item < 0 && current_line > line_limit) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkLimit() {\n return global.maxItems && global.detailsEnqueued >= global.maxItems;\n}", "function checkboxFieldSelectionLimit(options) {\n\n var\n $item = $.extend({\n itemField: '',\n itemLimit: 3,\n itemFieldInstruction: 'Choose up to 3'\n }, opt...
[ "0.63496506", "0.6226431", "0.6018639", "0.59347695", "0.5750889", "0.57188195", "0.55809855", "0.5540797", "0.55206764", "0.54939955", "0.5375436", "0.5357895", "0.5352009", "0.53467", "0.5299188", "0.52924633", "0.5286699", "0.52832043", "0.5277601", "0.5267729", "0.5256079...
0.78246325
0
ServerSideRuleClass factory. Exposes: getMaxIndex: returns a SwitchRequest by which the DASH player will change the requested quality shouldAbandon: return a SwitchRequest to the lowest quality if the backend decides to drop the current segment transfer; to be able to do so, we use the internal state of the interceptor...
function ServerSideRuleClass() { let factory = getFactory(); let context = window._onEventContext; const SwitchRequest = factory.getClassFactoryByName('SwitchRequest'); const MetricsModel = factory.getSingletonFactoryByName('MetricsModel'); const StreamController = factory.getSingletonFactor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PartyRuleClass() {\n\n //Some models and controllers provided by Dash.js to gather metrics and return SwitchRequests\n let factory = dashjs.FactoryMaker;\n let SwitchRequest = factory.getClassFactoryByName('SwitchRequest');\n let DashMetrics = factory.getSingletonFactoryByName('DashMetrics');\...
[ "0.55690044", "0.5154319", "0.47227886", "0.4442792", "0.43268952", "0.4206822", "0.4174104", "0.4136967", "0.41277763", "0.40882328", "0.40593657", "0.4057001", "0.4057001", "0.40137926", "0.39928144", "0.39928144", "0.39668658", "0.3954384", "0.39486676", "0.39193884", "0.3...
0.70162946
0
Creating effects pool as a buffer of audio effects.
constructor() { this.effectsPool = {}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BufferEffect (effect, channelCount, args) {\n\tthis.channelCount\t= isNaN(channelCount) ? this.channelCount : channelCount;\n\tthis.effects\t\t= [];\n\n\tfunction fx () {\n\t\teffect.apply(this, args);\n\t}\n\tfx.prototype = effect.prototype;\n\n\twhile (channelCount--) {\n\t\tthis.effects.push(new fx());...
[ "0.6697992", "0.6349776", "0.6221369", "0.59872204", "0.5888707", "0.5801435", "0.57298857", "0.5680969", "0.5593079", "0.5583256", "0.5539568", "0.5467262", "0.5467262", "0.54313636", "0.54089385", "0.54073465", "0.5361651", "0.5327368", "0.53131616", "0.53081375", "0.526119...
0.70379156
0
Get currently loaded effects.
get effects() { return this.effectsPool; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getActiveEffects() {\n return Object.keys((0, _kolmafia.myEffects)()).map(e => Effect.get(e));\n}", "function getActiveSongs() {\n return getActiveEffects().filter(isSong);\n}", "applyEffect() {\n\t\treturn this._effect();\n\t}", "constructor() {\n this.effectsPool = {};\n }", "getEffectsWit...
[ "0.7908491", "0.59938246", "0.5890713", "0.58614135", "0.58291155", "0.5783723", "0.5770747", "0.57522124", "0.5730707", "0.5727665", "0.56979764", "0.56336653", "0.5464406", "0.54079866", "0.5367436", "0.5367436", "0.53388387", "0.53139746", "0.53139746", "0.53139746", "0.53...
0.7481974
1
when mouse is clicked, tell the game the mouse has been clicked
function mouseClickedOnCanvas() { game.click = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mouseClicked() {\n MouseClickedAtX = mouseX;\n MouseClickedAtY = mouseY;\n}", "function mouseClicked() {\n // If it has been clicked return true\n return true;\n }", "function mouseClicked() {\n if (start.start === false) {\n start.mouseClicked();\n } else {\n handler.mo...
[ "0.77467567", "0.7746425", "0.7586698", "0.7568265", "0.75376177", "0.75083745", "0.750355", "0.74831665", "0.7418375", "0.741706", "0.734337", "0.7343064", "0.73299134", "0.73294336", "0.7326265", "0.7311963", "0.7309781", "0.72980607", "0.72917974", "0.7284019", "0.7275487"...
0.8223076
0
set targetDate as now or the preview date if one exists pass to scrubData
function getTargetDate ( data, qdate, callback ) { // set default date to now var targetDate = moment(); // if not production and date is appended, use the appended date if ( config.previewEnabled && typeof req.query.date !== "undefined" ) { targetDate = moment( qdate, config.dates.format ); } // pass everyt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refreshCurrentDate() {\n\t\t\t\tdateCurrent = getDateInRange(dateCurrent, dateShadow, before, after);\n\t\t\t}", "function applyDate(cal, elem) {\n\t\ttargetElem = cal.targetInput;\n\t\tif (targetElem !=null || targetElem !=undefined) {\n\t\t\tvar date = new Date(cal.date.getFullYear(), cal.date.getMont...
[ "0.58589685", "0.5792512", "0.5588527", "0.5571571", "0.55597234", "0.55159825", "0.5511372", "0.5453391", "0.540782", "0.54009277", "0.5389995", "0.5347204", "0.5339205", "0.533097", "0.53261757", "0.5310127", "0.5307327", "0.52936673", "0.52904195", "0.52759534", "0.5270858...
0.7533653
0
getProgressDuration Returns the time difference between two given time
function getProgressDuration(d1, d2) { const date1 = new Date(d1); const date2 = new Date(d2); let millisec, seconds = 0, minutes = 0, hours = 0 const defaultDuration = '0.00 secs' if(d1 && d2) { millisec = date2.getTime() - date1.getTime() seconds = millisec / 1000 minutes = seconds * ( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getProgressDurationInMinutes(d1, d2) {\n\n const date1 = new Date(d1);\n const date2 = new Date(d2);\n let millisec, seconds, minutes = 0\n\n if(d1 && d2) {\n millisec = date2.getTime() - date1.getTime()\n seconds = millisec / 1000\n minutes = seconds * ( 1/60 )\n minutes = minute...
[ "0.75630283", "0.7303008", "0.7258426", "0.7258426", "0.7258426", "0.7256827", "0.70828515", "0.7015901", "0.69005954", "0.68360853", "0.6689918", "0.665824", "0.65311", "0.6332803", "0.6271429", "0.6230316", "0.62254876", "0.62176085", "0.62141824", "0.6176912", "0.61751264"...
0.77563167
0
posInit.plyr = owarePos.opposite( posInit.plyr );
function makePosInit(){ "use strict"; posInit.plyr = owarePos.opposite( posInit.plyr ); return posInit.clone(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setNegate() {\nE3Vec.setNegateV3(this.xyz);\nreturn this;\n}", "setInvertX() {\nreturn this.xyzw[0] = -this.xyzw[0];\n}", "static setNegateQV(qv) {\n//-----------\nqv[0] = -qv[0];\nqv[1] = -qv[1];\nqv[2] = -qv[2];\nqv[3] = -qv[3];\nreturn qv;\n}", "static setNegateV3(xyz) {\nvar x, y, z;\n[x, y, z] = xyz;\nr...
[ "0.6430888", "0.6381502", "0.6172096", "0.6024162", "0.594835", "0.5931633", "0.5881366", "0.5828069", "0.5824885", "0.579412", "0.5753259", "0.5753259", "0.5753259", "0.575025", "0.56882006", "0.56876516", "0.5683175", "0.56790566", "0.5624505", "0.5605204", "0.5591962", "...
0.751453
0
assign val to move for sorting
function moveSortVal(pos,mv){ "use strict"; //fill in for larger sizes! return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set sortingOrder(value) {}", "sortBy({ value }) {\n\n }", "unshift(val) {\n \n }", "function reposition() {\n\tfor (let i = 0; i < tempArr.length; i++) {\n\t\tidList[left + i] = tempArr[i];\n\t}\n\tposition++;\n\tif (!finishedSorting()) {\n\t\tinitializeValues();\n\t}\n}", "function sortVal(val) {\n ...
[ "0.63389975", "0.59170234", "0.5883622", "0.5865532", "0.5711118", "0.56976366", "0.5694657", "0.56756604", "0.5657289", "0.5657289", "0.56204814", "0.5596253", "0.5595852", "0.555306", "0.55446506", "0.5529995", "0.54936796", "0.5455831", "0.5441239", "0.54260606", "0.540846...
0.7693601
0
return new muskPos by applying given mov to given pos
function positionFromMove(mv,pos){ "use strict"; var pscp = pos.clone(), nm, i, p = pos.plyr, op, cap, mov; pscp.sow( [ pos.plyr, mv[0][1] ] ); pscp.plyr = pos.opposite( p ); pscp.possibleMoves = false; return pscp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function positionFromMove(mov,pos,plyr){\n \"use strict\";\n var pscp = pos.clone(),\n loc = mov[0],\n pce = 3 - 2*plyr;\n pscp[loc[0]][loc[1]] = pce;\n return pscp;\n}", "function movePos(pos) {\n return {\n x: pos.x + pos.xV,\n y: pos.y + pos.yV,\n xV: pos.xV,\...
[ "0.7131838", "0.63815325", "0.59348714", "0.5627945", "0.5548453", "0.5492981", "0.54841775", "0.5472432", "0.5472385", "0.54626465", "0.54591846", "0.5446724", "0.542145", "0.5416002", "0.5399789", "0.5393839", "0.5389497", "0.5377272", "0.53640556", "0.535601", "0.53545934"...
0.6908356
1
===================================================================================================== IE placehoder input fix
function placeholderFix(){ $.logThis("placeholder fix called"); //ie placeholder fix $.support.placeholder = ( 'placeholder' in document.createElement('input') ); if($.support.placeholder){ $.logThis("placeholder supported"); $('.form_label').hide(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function placeholderSupport()\r\n{\r\n\t/* input placeholder for ie9 & ie8 & ie7 */\r\n jQuery.support.placeholder = ('placeholder' in document.createElement('input'));\r\n\t/* input placeholder for ie9 & ie8 & ie7 end*/\r\n\t\r\n\t/*fix for IE7 and IE8 */\r\n\tif (!jQuery.support.placeholder) {\r\n\t\tjQuery(...
[ "0.6560061", "0.63627994", "0.6328703", "0.6133193", "0.6047604", "0.60285485", "0.5922367", "0.5891383", "0.5833633", "0.5739739", "0.56612664", "0.56548506", "0.5645648", "0.55916387", "0.5561827", "0.5503912", "0.54808646", "0.54623526", "0.54443234", "0.5422239", "0.54090...
0.66352046
0
Prompt for confirmation on STDOUT/STDIN
function confirm(msg, callback) { var rl = readline.createInterface({ input: process.stdin, output: process.stdout }) rl.question(msg, function (input) { rl.close() callback(/^y|yes|ok|true$/i.test(input)) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function confirm(desc, callback) {\n process.stdout.write('\\u0033[90m' + desc + '\\u0033[0m');\n process.stdin.setEncoding('utf8');\n process.stdin.once('data', function (data) {\n data = String(data).trim().toLowerCase();\n callback(data === 'y' || data === 'yes');\n }).resume();\n}", "function confi...
[ "0.7402678", "0.7336624", "0.7334638", "0.73317975", "0.73091096", "0.72306", "0.71619505", "0.7078012", "0.69355744", "0.6814801", "0.6759297", "0.6759297", "0.6721008", "0.66419286", "0.6595067", "0.6499405", "0.6421505", "0.63756245", "0.6375438", "0.63615495", "0.6360537"...
0.73465663
1
IsAdmin : detect if the current user is admin return : true if a current user in the list
function isAdmin() { var ret=false,users = Get_ADMIN(), current_user = Session.getActiveUser().getEmail(); ret= users.split(',').lastIndexOf(current_user)!=-1; //Logger.log('Logging page, current user:%s, is admin:%s',current_user,ret) return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isAdmin() {\n\treturn getMe() === getAdmin();\n}", "function isAdmin() {\n var ret=false,users = Get_ADMIN(), current_user = Session.getActiveUser().getEmail();\n\n ret= users.split(',').lastIndexOf(current_user)!=-1;\n Logger.log('Logging page, current user:%s, is admin:%s',current_user,ret)\n \n ...
[ "0.8203417", "0.8019585", "0.78622204", "0.7844143", "0.7688169", "0.7667539", "0.7667539", "0.76059175", "0.7602778", "0.7577662", "0.7501322", "0.74769515", "0.7429246", "0.7405856", "0.73600584", "0.7355067", "0.7348037", "0.7246418", "0.7201251", "0.7164283", "0.71555346"...
0.80424017
1
uncheck selected radio buttons if custom amount was choosen
function onCustomAmountFocus() { for (var i = 0; i < donateForm.length; i++) { if (donateForm[i].type == 'radio' && donateForm[i].checked == true) { checkedInd = i; donateForm[i].checked = false; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearRadioButton(){\n\t\t$(\"input[name=choice]:checked\").prop('checked',false);\n\t}", "function onCustomAmountFocus() {\n\t\t\tfor (var i = 0; i < donateForm.length; i++) {\n\t\t\t\tif (donateForm[i].type == 'radio') {\n\t\t\t\t\tdonateForm[i].onclick = function() {\n\t\t\t\t\t\tcustomAmount.value = ...
[ "0.662672", "0.6543305", "0.6517985", "0.6516802", "0.64894027", "0.6487952", "0.6446978", "0.64435565", "0.64420533", "0.6433624", "0.640918", "0.6404962", "0.6403125", "0.6403125", "0.6306616", "0.62978655", "0.62898237", "0.6275115", "0.6275115", "0.6242369", "0.62306756",...
0.6923707
0
FIX ISSUES FOR STAMPLAY API Angular removes the header 'ContentType' if request is GET. This function is a hack to add the header back in, because RestDB requires the header.
function addContentTypeToHeader() { return { request : requestInterceptor }; function requestInterceptor(config) { if (angular.isDefined(config.headers['Content-Type']) && !angular.isDefined(config.data)) config.data = ''; return confi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addContentTypeToHeader() {\n return {\n request : requestInterceptor\n };\n\n function requestInterceptor(config) {\n if (angular.isDefined(config.headers['Content-Type']) && !angular.isDefined(config.data))\n config.data = '';\n\n retur...
[ "0.68410784", "0.6789466", "0.6679066", "0.6350589", "0.63461894", "0.6308554", "0.60715866", "0.60350287", "0.59880203", "0.5975279", "0.5942631", "0.58841306", "0.58157355", "0.58050346", "0.5803962", "0.57779694", "0.57756776", "0.57756776", "0.5768912", "0.5763884", "0.57...
0.70051265
0
returns an array of all items in collection
async getAll() { let items = []; let collection = await this.collection(); await collection.find({}).forEach((item) => {items.push(item)}); this.dbClient.close(); return items; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "all() {\n return this.items;\n }", "function getAllItems () {\n return Item.find()\n}", "function getAllItems() {\n return Item.find();\n}", "values() {\n\t\tlet result = [];\n\n\t\tfor (let key of Object.keys(this.collection)) {\n\t\t\tresult.push(this.collection[key]);\n\t\t}\n\n\t\treturn resu...
[ "0.74258965", "0.7294794", "0.7246248", "0.7080849", "0.70328903", "0.70043015", "0.70043015", "0.7002696", "0.6946562", "0.68923485", "0.68690234", "0.68690234", "0.686036", "0.68563735", "0.685495", "0.6848473", "0.683153", "0.68144333", "0.673045", "0.673045", "0.673045", ...
0.75024015
0
updates an item in the collection based on id and an update object
async update(id, obj) { let collection = await this.collection(); await collection.updateOne({_id: ObjectId(id)}, {$set:obj}) this.dbClient.close(); return console.log('Item successfully updated') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateById(id, updateObj) {\n return this.findById(id)\n .then((doc) => {\n if (doc) {\n return doc.update(updateObj).exec();\n }\n else {\n return Promise.reject(\"document not found\");\n }\n });\n }", "functi...
[ "0.7438128", "0.7309647", "0.72811854", "0.72081363", "0.70802283", "0.69791466", "0.6967742", "0.69480115", "0.69391453", "0.69339657", "0.69336677", "0.690752", "0.6857361", "0.68133914", "0.6807833", "0.67971784", "0.6776684", "0.67692304", "0.6766609", "0.6712033", "0.668...
0.76634014
0
ORMMAReady called by the SDK Sets global 'ormmaAvail' to true
function ORMMAReady(evt) { var msg; window.ormmaAvail = window.ormmaAvail || ORMMAReadyStatus.FOUND; if (window.ormmaAvail !== ORMMAReadyStatus.NOT_FOUND) { //clear any timers that have been waiting for ORMMA window.clearTimeout(window.ormmaWaitId); logit('ORMMA found'); if (typeof ormma === 'undefined')...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ORMMAReady(evt) {\n\twindow.ormmaAvail = window.ormmaAvail || ORMMAReadyStatus.FOUND;\n\tif (window.ormmaAvail !== ORMMAReadyStatus.NOT_FOUND) {\n\t\t//clear any timers that have been waiting for ORMMA\n\t\twindow.clearTimeout(window.ormmaWaitId);\n\n\t\tshowit('*ORMMAReady() found.');\n\t\tlogit('ORMMA f...
[ "0.7488567", "0.6981693", "0.6914624", "0.5739299", "0.56465966", "0.5488785", "0.5470527", "0.5464676", "0.5414043", "0.5358447", "0.5352356", "0.5349404", "0.5348284", "0.5341977", "0.533005", "0.5322584", "0.5322584", "0.5317414", "0.5317414", "0.5317414", "0.5317414", "...
0.7422511
1
stub function to highlight when ORMMA is not found
function ORMMANotFound() { window.ormmaAvail = window.ormmaAvail || ORMMAReadyStatus.NOT_FOUND; if (window.ormmaAvail !== ORMMAReadyStatus.FOUND) { window.ormmaAvail = false; showit('Test failed.<br/><br/>*ORMMAReady() not found.', 'result'); logit('ORMMA not found'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "highlight(on) { }", "function e(n) {\n return n && \"function\" == typeof n.highlight;\n }", "function ORMMANotFound() {\n\twindow.ormmaAvail = window.ormmaAvail || ORMMAReadyStatus.NOT_FOUND;\n\tif (window.ormmaAvail !== ORMMAReadyStatus.FOUND) {\n\t\twindow.ormmaAvail = false;\n\t\tshowit('Test f...
[ "0.5662265", "0.5246105", "0.5216126", "0.509516", "0.5010479", "0.49870384", "0.49834096", "0.4976612", "0.49046206", "0.48955467", "0.48625347", "0.48390406", "0.4817364", "0.4773224", "0.4764726", "0.4748607", "0.4743926", "0.47277212", "0.47252652", "0.4715947", "0.470844...
0.53000534
1
call categories render method
function categories() { // assign categories object to a variable var categories = memory.categories; // loop through categories for (category in categories) { // call categories render method memory.categories[category].render(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render(){\n\t\tconst { categories } = this.props\n\n\t\treturn (\n\t\t\t<div className=\"col-12-medium\">\n\t\t\t\t<div className=\"row\">\n\t\t\t\t\t<div className=\"col-12-medium\">\n\t\t\t\t\t\t<Link className=\"mobile-menu-link\" to=\"/\" onClick={this.props.toggleMenu}>all</Link>\n\t\t\t\t\t</div>\n\t\t\t\t</...
[ "0.6521652", "0.6484214", "0.64207983", "0.6400039", "0.63238615", "0.63237166", "0.6319964", "0.6316074", "0.6295718", "0.62789", "0.62624574", "0.6251663", "0.6206565", "0.6178517", "0.6170403", "0.61657554", "0.61593455", "0.61366004", "0.61194855", "0.6104749", "0.6098323...
0.76342034
0
save post id and posts image url to LocalStorage
function mediaLocStorage() { // assign media object to a variable var mediaObj = memory.media, // create an empty object mediaLinks = {}; // loop through media object for (var i = 0; i < mediaObj.length; i++) { if (mediaLin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updatePostId(postId){\n localStorage[\"postId\"] = postId;\n}", "function addImage(postId) {\r\n // upload the file\r\n const storage = firebase.storage();\r\n const user = firebase.auth().currentUser;\r\n const ref = storage.ref('posts').child(postId).child('post-image');\r\n \r\n c...
[ "0.70410585", "0.6750638", "0.667188", "0.651251", "0.6378891", "0.6349592", "0.6321007", "0.6282165", "0.6269532", "0.6246237", "0.6243499", "0.6215662", "0.61281437", "0.61250013", "0.6121458", "0.6115962", "0.6080027", "0.6064768", "0.6048789", "0.59679914", "0.59460586", ...
0.6972488
1
This sets up ticket sidebar events that, when fired, will send information to the top_bar instance.
function createTicketSidebarEventHandlers(instanceGuid, location) { // Get sidebar app instance. let ticketSidebar = top_bar.instance(instanceGuid) // Have sidebar app call top_bar app's 'activeTab' event on sidebar's 'app.activated' and 'app.deactivated' events. ticketSidebar.on('app.activated', () => { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setup(data) {\n //Load the sidebar-content into memory\n const sidebarView = $(data);\n\n //Find all anchors and register the click-event\n sidebarView.find(\"a\").on(\"click\", this.handleClickMenuItem);\n\n //TODO: Add logic here to determine which menu items should be visible ...
[ "0.6077698", "0.605759", "0.60535204", "0.58441645", "0.5782778", "0.56570125", "0.5572261", "0.5548545", "0.5523827", "0.551184", "0.55085665", "0.54961383", "0.54944754", "0.5491494", "0.54884183", "0.5456052", "0.54528946", "0.54498607", "0.5435194", "0.5429751", "0.542760...
0.7099458
0
all users that have benefits
async usersBenefits () { let users_id = await this.models.benefit_histories.distinct('user_id'); let users = await this.models.users.find({_id: {$in: users_id}, deletedAt: null}, {password: 0}); if (!users || users.length === 0) { throw new Error(); } return users; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getAllBenefits ({ commit }) {\n benefitsAPI.getBenefits(benefit => {\n commit(mutationType.SHOW_ALL_BENEFITS, benefit)\n })\n }", "function getUsers() {\n\t// Get the list of users from the contract\n\tcontract.getUsers.call((error, result) => {\n\t if(error) {\n\t\t return console.log(error);\n\t ...
[ "0.63094866", "0.6277073", "0.6137387", "0.59757745", "0.5940679", "0.5903052", "0.5868637", "0.5826147", "0.5812168", "0.5774377", "0.5770677", "0.5767177", "0.5755385", "0.5745162", "0.57434386", "0.5693915", "0.5690709", "0.56646866", "0.56436306", "0.5636374", "0.56330866...
0.8162568
0
count average rate and update user
async updateUserRating (user_id) { let ratings = await this.models.ratings.find({user_id}, {rating: 1}); let object = ratings.reduce((acc, item) => { acc[`${item.rating}`] || (acc[`${item.rating}`] = 0); acc[`${item.rating}`]++; return acc; }, {}); let firstArg = Object.keys(object).reduce...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function query_db_mascot(res,year,rate) {\n\tquery = \"SELECT * FROM Mascot WHERE Mascot.Year = '\"+year+\"'\";\n\tconnection.query(query, function(err, rows) {\n\t\tif (err) console.log(err);\n\t\telse {\n\t\t\tvar x = rows[0];\n\t\t\tconsole.log(x.Rating);\n\t\t\tconsole.log(x.numOfUser);\n\t\t\tvar newAvg = (x....
[ "0.6606514", "0.6330335", "0.62908536", "0.62545145", "0.6248193", "0.622328", "0.61995965", "0.61868846", "0.6176154", "0.61761117", "0.6165159", "0.61531824", "0.6144479", "0.61413884", "0.61380196", "0.6097975", "0.6087086", "0.6065557", "0.6052318", "0.6034291", "0.602865...
0.7116885
0
var defaultSplitTerm = 'AND';
function injectOperatorBetweenTerms(searchPhrase) { // Default to using AND useAnd = (module.exports.defaultSplitTerm == 'AND'); // Remove leading and trailing whitespace searchPhrase = searchPhrase.trim(); if(useAnd){ // replace all spaces with ' AND ', then remove any extra ANDs searchPhrase = searchPh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTerms(query) {\n\treturn query.split(\" AND \");\n}", "function BOT_wordIsSep(word) {\r\n\tif(word == \"with\" || word == \"and\") return(true) \r\n}", "splitFilterIntoTerms (searchString) {\n if (!searchString) {\n return null;\n }\n\n ...
[ "0.6036891", "0.60338855", "0.6029059", "0.56473595", "0.55504566", "0.54663825", "0.546068", "0.5445393", "0.541923", "0.5373604", "0.5283378", "0.5275371", "0.5264778", "0.5264778", "0.5171645", "0.5164568", "0.50739264", "0.50498486", "0.5046394", "0.50454974", "0.50373495...
0.6901164
0
This function converts a boolean query to a 2 dimensional array. a AND (b OR c) Becomes: [[a, b],[a,c]] This works recursively and generates an array of all possible combination of a matching query. The output is meant to be easily parsed to see if there are any matches. There are more efficient ways to match content t...
function _parseBooleanQuery(searchPhrase) { // Remove outer brackets if they exist. EX: (a OR b) -> a OR b searchPhrase = removeOuterBrackets(searchPhrase); // remove double whitespaces searchPhrase = removeDoubleWhiteSpace(searchPhrase); // Put ANDs inbetween all the terms that only have a space betwee the...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assembleQuery(){\n var groups = searchGroups.children(\".search-group\");\n var groupQueries = [];\n\n for(var group = 0; group < groups.length; group++){\n var inputFields = groups[group].querySelectorAll(\"input[type=text]\");\n var regexCheckbox = groups[group].querySelectorAll(\...
[ "0.6048997", "0.60395205", "0.5699797", "0.5518121", "0.54913706", "0.5280814", "0.50462604", "0.49154866", "0.48921272", "0.48921272", "0.48921272", "0.48921272", "0.48830596", "0.48745596", "0.48662263", "0.48544532", "0.48540798", "0.4840803", "0.48402017", "0.4798213", "0...
0.69673395
0
Removes double whitespace in a string In: a b c\nd\te Out: a b c d e
function removeDoubleWhiteSpace(phrase) { return phrase.replace(/[\s]+/g, ' '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reduceDoubleSpaces( string ) {\n\tstring = string.replace( \" \", \" \" );\n\tif ( string.search( \" \" ) > 0 ) {\n\t\treturn reduceDoubleSpaces( string );\n\t}\n\treturn string;\n}", "function unspace(string) {\n return string.replace(/\\r\\n|\\n| /g, '')\n}", "function qctrim(s) {\r\n\ts = s.repl...
[ "0.72699565", "0.70850897", "0.7047431", "0.69281864", "0.6924448", "0.69038105", "0.6896566", "0.6855745", "0.6855745", "0.67989844", "0.6786755", "0.6774741", "0.6757607", "0.67404586", "0.6733079", "0.6730537", "0.666988", "0.66574717", "0.66546476", "0.6643519", "0.664315...
0.72596794
1
Merges 2 or paths together in an AND fashion in: orPathA: [ [ a ], [ b ] ] orPathB: [ [ c, d ], [ e ] ] out: [ [ a, c, d ], [ b, c, d], [ a, e ], [ b, e ] ]
function orAndOrMerge(orPathA, orPathB) { var result = []; orPathA.forEach(function(andPathA) { orPathB.forEach(function(andPathB) { result.push(andAndMerge(andPathA, andPathB)); }); }); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function orsAndMerge(ors) {\n var result = [[]];\n for (var i = 0; i < ors.length; i++) {\n result = orAndOrMerge(result, ors[i]);\n }\n\n return result;\n}", "function mergeOrs(ors) {\n var result = ors[0];\n for (var i = 1; i < ors.length; i++) {\n result = result.concat(ors[i]);\n }\n\n return r...
[ "0.7111633", "0.6573616", "0.6251221", "0.60459834", "0.5981962", "0.58194214", "0.57066846", "0.5650202", "0.5627848", "0.5602025", "0.55929863", "0.55929863", "0.55781215", "0.5571492", "0.55119354", "0.548196", "0.5462446", "0.5462446", "0.54427284", "0.5432908", "0.538102...
0.8885186
0
Merges multiple OR paths into one OR path, in an AND fashion in: [ [ [ a ], [ b ] ], [ [ c, d ], [ e ] ] [ [ f ] ] ] out: [ [ a, c, d, f ], [ b, c, d, f ], [ a, e, f ], [ b, e, f ] ]
function orsAndMerge(ors) { var result = [[]]; for (var i = 0; i < ors.length; i++) { result = orAndOrMerge(result, ors[i]); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function orAndOrMerge(orPathA, orPathB) {\n var result = [];\n orPathA.forEach(function(andPathA) {\n orPathB.forEach(function(andPathB) {\n result.push(andAndMerge(andPathA, andPathB));\n });\n });\n\n return result;\n}", "function mergeOrs(ors) {\n var result = ors[0];\n for (var i = 1; i < or...
[ "0.7992217", "0.7069213", "0.6168518", "0.60681695", "0.60173106", "0.59977573", "0.5950499", "0.58846235", "0.5782858", "0.5687098", "0.56258136", "0.56167513", "0.5544778", "0.55265254", "0.546626", "0.5464496", "0.5439109", "0.5420303", "0.5420303", "0.5418167", "0.5416510...
0.7612705
1
Removes the bracket at the beginning and end of a string. Only if they both exist. Otherwise it returns the original phrase. Ex: (a OR b) > a OR b But yet doesn't remove the brackets when the last bracket isn't linked to the first bracket. Ex: (a OR b) AND (x OR y) > (a OR b) AND (x OR y)
function removeOuterBrackets(phrase) { // If the first character is a bracket if (phrase.charAt(0) === '(') { // Now we'll see if the closing bracket to the first character is the last // character. If so. Remove the brackets. Otherwise, leave it as it is. // We'll check that by incrementing the counte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeUnpairedBrackets(string){\n\n var letter;\n var left = [], right = [];\n\n for (let n = string.length - 1; n >= 0; n--){\n\n letter = string.charAt(n);\n\n if (letter == \"[\") left.push(n);\n else if (letter == \"]\") right.push(n);\n\n if (left.length > ri...
[ "0.6257403", "0.6013214", "0.5891341", "0.5874895", "0.58254445", "0.5734766", "0.5676707", "0.56405646", "0.5598164", "0.5566005", "0.55603355", "0.55603355", "0.5489001", "0.5446696", "0.53489", "0.5297321", "0.52648443", "0.5263929", "0.5243172", "0.52410936", "0.52275157"...
0.7210387
0
Returns boolean true when string contains brackets '(' or ')', at any position within the string Ex: (b AND c) > true Ex: b AND c > false
function containsBrackets(str) { return !!~str.search(/\(|\)/); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bracketsAllowed(str) {\n let open_bracket_idx = str.search(\"\\\\(\");\n let closed_bracket_idx = str.search(\"\\\\)\");\n if (open_bracket_idx == -1 || closed_bracket_idx == -1) {\n return true;\n }\n if (closed_bracket_idx - open_bracket_idx == 4) {\n return true;\n }\n return false;\n}", ...
[ "0.73508745", "0.72623694", "0.7138283", "0.7098028", "0.70735145", "0.70556533", "0.70535547", "0.70411056", "0.69575214", "0.69210464", "0.69057846", "0.68956244", "0.6891337", "0.68834746", "0.6880755", "0.6861311", "0.6858165", "0.6857723", "0.68518007", "0.68455255", "0....
0.74773645
0
Splits a phrase into multiple strings by a split term. Like the split function. But then ignores the split terms that occur in between brackets Example when splitting on AND: In: a AND (b AND c) Out: ['a', '(b AND c)'] We do this by using the built in 'split' function. But as soon as we notice our string contains brack...
function splitRoot(splitTerm, phrase) { var termSplit = phrase.split(' ' + splitTerm + ' '); var result = []; var tempNested = []; for (var i = 0; i < termSplit.length; i++) { // If we are dealing with a split in a nested query, // add it to the tempNested array, and rebuild the incorrectly parsed nest...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toSplit(phrase){\n\tvar cut = phrase.split(\" \");\n\treturn cut;\n}", "function getSuggestionsSplitBy(term, splitStr) {\n var splitTerm = term.split(splitStr);\n var initialSuggestions = splitTerm.map(function (st, i) { return splitTerm.slice(i).join(splitStr); });\n var suggestions = [];\n ...
[ "0.6721981", "0.611794", "0.59967095", "0.5994349", "0.5989446", "0.5984278", "0.5953115", "0.5912379", "0.5909378", "0.5860037", "0.5845251", "0.5805901", "0.5768238", "0.57618177", "0.57006085", "0.57003903", "0.5697946", "0.5648145", "0.5634731", "0.5624491", "0.5593283", ...
0.66289395
1
Check if icon is a town
function checkicon(type){ if(type==4||type==5||type==6||type==7){ return true; }else{return false} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isIcon(icon) {\n return findElement(this).classList.contains(icon);\n }", "function isInHosp(li) {\n return (li.querySelector(\"[id^='icon15___']\")) ? true : false;\n }", "function isIcon(target) {\n return angular.isDefined(target.element) && angular.isDefined(target.config);\n }", "funct...
[ "0.6868145", "0.6122002", "0.6044532", "0.6036127", "0.6036127", "0.602752", "0.577938", "0.5688146", "0.5633965", "0.5604646", "0.5550543", "0.549797", "0.5473438", "0.5448432", "0.5443111", "0.5432492", "0.54147863", "0.54112405", "0.54065806", "0.5379402", "0.5372091", "...
0.6609856
1
Click Events for Attractions
function addAttractionClickEvents() { let parent = $(this).children('.card-img-overlay') let child = parent.children()[0] if ($(child).hasClass('notHidden')){ $(child).prop('hidden', 'true') $(child).removeClass('notHidden') } else { $(child).addClass('notHidden') $(child).removeAttr('hidden') } addToBa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _click(d){\n \n }", "onclick(){}", "click_extra() {\r\n }", "_click(e) {\n const type = this.cel.getAttribute('data-type');\n\n this[type](e);\n }", "function click(el){\n \n \n}", "click() { }", "function doClick(e) {\n options.onClick(e);\n }", "_evtClic...
[ "0.6509233", "0.6396063", "0.63033485", "0.6298665", "0.62603", "0.620733", "0.61745185", "0.61164415", "0.61054534", "0.61009955", "0.6062613", "0.60435617", "0.5995239", "0.5970369", "0.59571165", "0.59450984", "0.5941636", "0.5895611", "0.5887146", "0.5885652", "0.58677953...
0.64823395
1
check if attraction has an image
function checkForImage(attraction) { let randomNum = Math.floor(Math.random() * 5) if (attraction.hasOwnProperty('preview')) { return attraction.preview.source } else { return placeholderImages[randomNum] } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasImg(input)\n{\n\treturn (input.indexOf('<img') != -1 || input.indexOf('<Img>') != -1 || input.indexOf('<IMG') != -1);\n}", "checkImg(el){\r\n let pathImg = el.poster_path\r\n let img = \"\"\r\n if(!pathImg){\r\n img = \"no-img.png\"\r\n }else{\r\n img = 'https://imag...
[ "0.67646426", "0.6612114", "0.6571681", "0.64902747", "0.6455928", "0.6444567", "0.6433491", "0.64291984", "0.6386227", "0.63812613", "0.6369641", "0.6365084", "0.6365084", "0.6357395", "0.635061", "0.63180065", "0.6310741", "0.6254706", "0.62354285", "0.6225071", "0.6188359"...
0.765056
0
Removes all children of the specified DOM element.
function removeChildren(element) { while (element.firstChild) { element.removeChild(element.firstChild); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeChildren(element) {\n while (element.firstChild) {\n element.removeChild(element.firstChild);\n }\n }", "function removeChildren(element) {\n while (element.hasChildNodes()) {\n element.removeChild(element.firstChild);\n }\n }", "function r...
[ "0.810329", "0.8099476", "0.8098433", "0.7671878", "0.7532214", "0.7502345", "0.7358505", "0.7290418", "0.7290418", "0.72220784", "0.7214024", "0.7185316", "0.7138092", "0.71361655", "0.71159136", "0.7088229", "0.7030816", "0.70164984", "0.69526464", "0.69100505", "0.6883517"...
0.81048954
0
Returns a human readable string for the provided scalar in the given units.
function formatScalar(value, units) { return units.conversion(value).toFixed(units.precision); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatScalar(value, units) {\n return units.conversion(value).toFixed(units.precision);\n }", "get unitFormatted() {\r\n\t\treturn this.count > 1 ? this.unit + 's' : this.unit;\r\n\t}", "function format(value, units, includeValue) {\n var obj;\n\n if (typeof value === 'string') {\n incl...
[ "0.6815404", "0.60338396", "0.59706837", "0.59647626", "0.590575", "0.590575", "0.5740646", "0.56303763", "0.5613008", "0.5605274", "0.5539287", "0.5539287", "0.5527949", "0.5521372", "0.54868126", "0.54868126", "0.5481961", "0.5430909", "0.53294986", "0.5286063", "0.52430826...
0.6899365
0
Returns a human readable string for the provided rectangular wind vector in the given units. See
function formatVector(wind, units) { var d = Math.atan2(-wind[0], -wind[1]) / τ * 360; // calculate into-the-wind cardinal degrees var wd = Math.round((d + 360) % 360 / 5) * 5; // shift [-180, 180] to [0, 360], and round to nearest 5. return wd.toFixed(0) + "° @ " + formatScalar(wind[2], units); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatVector(wind, units) {\n var d = Math.atan2(-wind[0], -wind[1]) / τ * 360; // calculate into-the-wind cardinal degrees\n var wd = Math.round((d + 360) % 360 / 5) * 5; // shift [-180, 180] to [0, 360], and round to nearest 5.\n return wd.toFixed(0) + \"° @ \" + formatScalar(wind...
[ "0.7906199", "0.59097123", "0.57479745", "0.56890374", "0.5453193", "0.54245967", "0.54049844", "0.53829813", "0.5381281", "0.53498656", "0.53154653", "0.5305986", "0.5257048", "0.5237376", "0.5237376", "0.51727855", "0.5164264", "0.5151379", "0.51387763", "0.5111589", "0.510...
0.7852131
1
Si se agrega un material con y todavia no se agrego la columna unidad, se agrega y se corren todas las filas un espacio (para que queden alineadas con los titulos de las columnas.
function agregarColumnaUnidadYCorrerFilas(){ //Si el material a agregar tiene unidad if(unidadMat){ $('#item' + cantMat).prepend( '<td id="uni' + cantMat + '">' + $('#unidad1').val() + ' ' + unidadMat + '</td>' ); //Si no corri las filas todavia if(!filasCorridas){ filasCorridas = true; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function trataColisoes()\n{\n //lateral esquerda - 1\n if(esfera.posicao[0] - esfera.raio < parametrosMesa.xMin)\n {\n if(ultimaColisao != 1)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 1;\n } \n }\n\n //lateral dir...
[ "0.6782604", "0.6071177", "0.60203254", "0.59980714", "0.5952256", "0.5941119", "0.5849453", "0.5828394", "0.5827679", "0.5825331", "0.5793179", "0.5784007", "0.5782542", "0.57456726", "0.57310146", "0.57195276", "0.570185", "0.5686662", "0.56849086", "0.5682909", "0.5682014"...
0.7060688
0
function fetching a pokemon
function fetchPokemon() { // build a URL using the endpoint and a random integer const index = randomIntUpTo(pokedex); const url = `${endpoint}${index}`; // fetch request fetch(url) .then(response => response.json()) .then((json) => { // resolved: retrieve the necessary information and update t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getSpecificPokemon(pokemon) {\n const response = await axios.get(`https://pokeapi.co/api/v2/pokemon/${pokemon}`)\n // console.log(response.data);\n yourPokemon = response.data\n displayYourPokemon(response.data);\n displayYourPokemonMoves(response.data);\n assignPokemonStats(respon...
[ "0.7970451", "0.7676312", "0.7663576", "0.7648845", "0.7568838", "0.7523978", "0.75080556", "0.74779356", "0.74759114", "0.7457206", "0.737681", "0.73226416", "0.7248509", "0.7244258", "0.72200775", "0.71936977", "0.71724313", "0.7135587", "0.7116381", "0.7114833", "0.7101249...
0.8072377
0
Get the sender info from FB
function getSenderInfo(sender_psid, page) { // console.log(`getSenderInfo - sender_psid = ${sender_psid} ; page.token = ${page.token}`) const access_token = page.token // Send the HTTP request to the Messenger Platform return request({ url: `https://graph.facebook.com/v2.6/${sender_psid}`, qs: { f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSender(context, activeUsername) {\n return $(context).find('a').first().attr('href').replace('https://www.facebook.com/','').replace('profile.php?id=','') === activeUsername ? activeUsername : 'me';\n }", "function getInformation(senderId) {\n return new Promise((resolve, reject) => {\n\n req...
[ "0.7152868", "0.69160336", "0.64194334", "0.6380067", "0.6023539", "0.5938406", "0.5931115", "0.56537557", "0.5646769", "0.56402814", "0.5612529", "0.558241", "0.55777", "0.5570942", "0.55453724", "0.5507175", "0.5505726", "0.54868853", "0.5468155", "0.5467358", "0.5454572", ...
0.78323257
0
()()()()() ACCESSING DATA ()()()()()\\ Return Berry Bites data for store3 on January 7.
function accessesingData1() { return store3[1]['inventory sold']['Berry Bites']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function accessesingData1() {\n return (store1[\"2015-01-08\"][0][1]);\n}", "function accessesingData2() {\n return (store1[\"2015-01-06\"][1][2])\n}", "function get_data() {}", "function accessesingData2() {\n return store3[3]['inventory sold']['Mint Wafers']['quantity'];\n}", "function accessesingData1(...
[ "0.7088138", "0.67669976", "0.66881585", "0.628907", "0.6102037", "0.60885084", "0.60885084", "0.5972084", "0.5972084", "0.59414643", "0.58654547", "0.5862426", "0.5840806", "0.58000255", "0.57538795", "0.57023555", "0.56544477", "0.5604382", "0.55900675", "0.555514", "0.5544...
0.70011747
1