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
finding the average height of the rectangles and drawing a line and the average
function average() { averageHeight = averageHeight / rectNum; strokeWeight(3); line(0,averageHeight,width,averageHeight); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render(g) {\n let xStart = g.axesPadding+g.axesLineWidth;\n let xEnd = g.width - g.axesPadding;//*2 - g.dataMargin;\n let yStart = g.height-g.axesPadding-g.axesLineWidth/2+1;\n let yDist = g.yMax-g.yMin;\n\n let minYPerc = (this.minimum-g.yMin) / yDist;\n let avgYPerc = (t...
[ "0.655085", "0.6216413", "0.60983735", "0.6041999", "0.59986323", "0.5982436", "0.5981233", "0.5968323", "0.5957864", "0.59384257", "0.59163845", "0.58516264", "0.58514774", "0.582338", "0.56978726", "0.5676951", "0.5672912", "0.56583226", "0.56544757", "0.5616888", "0.561475...
0.85882384
0
Define function to prepare OLI images.
function prepOli(img) { var orig = img; img = renameOli(img); img = fmask(img); img = calcNbr(img); return ee.Image(img.copyProperties(orig, orig.propertyNames())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ImageHelper() { }", "function New_Image_Display(n) {\n image_index += n;\n if (image_index > image_files_in_dir.length) {\n image_index = 1\n }\n if (image_index < 1) {\n image_index = image_files_in_dir.length\n };\n \n val_obj = {descriptionInput:'', taglist:'', imgM...
[ "0.625355", "0.6147142", "0.58259875", "0.5794615", "0.57919383", "0.5734082", "0.5660424", "0.5654898", "0.5643849", "0.56183296", "0.56104654", "0.5603348", "0.5591035", "0.55662715", "0.55596703", "0.554755", "0.5541147", "0.5537942", "0.5530651", "0.55202144", "0.5497128"...
0.63216555
0
Define function to prepare ETM+ images.
function prepEtm(img) { var orig = img; img = renameEtm(img); img = fmask(img); img = etmToOli(img); img = calcNbr(img); return ee.Image(img.copyProperties(orig, orig.propertyNames())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setup() {\n setupImageData();\n\n d3.select(modelView.node).selectAll('.image-container')\n .data(imageData)\n .each(function(data) {\n var images = d3.select(this)\n .selectAll('image')\n .data(data, function(d) {\n return d.src + '-' + d.srcIndex;\n ...
[ "0.55591077", "0.55244327", "0.5513989", "0.54825246", "0.54647213", "0.5464259", "0.5409882", "0.5369812", "0.5347996", "0.531078", "0.5290585", "0.52649677", "0.5255393", "0.5248877", "0.5247482", "0.52465326", "0.52408034", "0.52217424", "0.52210176", "0.5197289", "0.51930...
0.6183624
0
Define function to apply OLS OLI to ETM+ transformation.
function oliToEtmOls(img) { return ee.Image(img.select(['Blue', 'Green', 'Red', 'NIR', 'SWIR1', 'SWIR2']) .multiply(coefficients.oliToEtmOls.slopes) .add(coefficients.oliToEtmOls.itcps) .round() .toShort() .a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function etmToOliOls(img) {\n return img.select(['Blue', 'Green', 'Red', 'NIR', 'SWIR1', 'SWIR2'])\n .multiply(coefficients.etmToOliOls.slopes)\n .add(coefficients.etmToOliOls.itcps)\n .round()\n .toShort()\n .addBands(img.select('pixel_qa'));\n}", "function etmToOli(img) {\n return im...
[ "0.5510246", "0.5454773", "0.53927565", "0.5380821", "0.5143261", "0.5043938", "0.50118804", "0.49470177", "0.49443054", "0.49266246", "0.49208516", "0.48901293", "0.48397076", "0.48270836", "0.4822434", "0.48192045", "0.47914296", "0.47746608", "0.4751045", "0.4732785", "0.4...
0.5799149
0
Define function to apply RMA ETM+ to OLI transformation.
function etmToOliRma(img) { return ee.Image(img.select(['Blue', 'Green', 'Red', 'NIR', 'SWIR1', 'SWIR2']) .multiply(coefficients.rma.slopes) .add(coefficients.rma.itcps) .round() .toShort() .addBands(img.sele...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AMAauto(empresa,time,rendimiento){\n Exitosas = 0;\n indicador = 'Adaptative Moving Average'+'| periodo:'+time;\n\n\n\n listadoPrecios = empresa['precios'];\n listadoPrecios.reverse();\n\n contadorDias = 0;\n enOperacion = false;\n primerPrecio = 0;\n precioObjetivo=0;\n listadoPrecios....
[ "0.58394355", "0.5791281", "0.5082648", "0.5076565", "0.4965766", "0.49542382", "0.48313978", "0.4820332", "0.4818912", "0.48159304", "0.48107246", "0.47709608", "0.47298214", "0.4715165", "0.47048932", "0.46842122", "0.4669161", "0.46500057", "0.4638658", "0.46156496", "0.46...
0.58449715
0
function to find the coordinate of the location from html navigator glocation property. pass the event to the function
function getLocation(e){ if (navigator.geolocation){ navigator.geolocation.getCurrentPosition(getPosition,showError); }else{ x.innerHTML="Geolocation is not supported by this browser."; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getEventLocation(event){\r\n // Relies on the getElementPosition function.\r\n var pos = this.getElementPosition();\r\n \r\n return {\r\n x: (event.pageX - pos.x),\r\n y: (event.pageY - pos.y)\r\n };\r\n}", "function getCurrentLocation(event) {\n event.preventDefault();\n...
[ "0.723824", "0.71161", "0.7045895", "0.68408275", "0.6666172", "0.66564214", "0.66500306", "0.6514669", "0.65107423", "0.65028614", "0.64720803", "0.6436889", "0.6425021", "0.6401897", "0.6388316", "0.63848996", "0.6373397", "0.6346822", "0.6339553", "0.6336096", "0.632631", ...
0.737864
0
join url from protocol
function joinUrl(protocol, domain, endpoint) { return protocol + '//' + domain + endpoint; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function joinUrl(protocol, domain, endpoint) {\n return protocol + '//' + domain + endpoint;\n}", "function urlJoin(...args) {\n return args.join('/')\n .replace(/\\/\\/+/g, '/')\n .replace(/\\/+$/, '')\n .replace(':/', '://')\n}", "function join() {\n var parts = [];\n for (var _i = 0...
[ "0.79148", "0.7331611", "0.72104025", "0.7066972", "0.6945806", "0.6843868", "0.65651786", "0.6359487", "0.63579893", "0.6353074", "0.63350964", "0.62347263", "0.62275356", "0.62275356", "0.61688364", "0.61610776", "0.6107446", "0.6082868", "0.60757536", "0.6024306", "0.60220...
0.8019632
1
Create an `Auth0` instance with `options`
function Auth0 (options) { // XXX Deprecated: We prefer new Auth0(...) if (!(this instanceof Auth0)) { return new Auth0(options); } assert_required(options, 'clientID'); assert_required(options, 'domain'); this._useJSONP = null != options.forceJSONP ? !!options.forceJSONP...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Auth0 (options) {\n // XXX Deprecated: We prefer new Auth0(...)\n if (!(this instanceof Auth0)) {\n return new Auth0(options);\n }\n\n assert_required(options, 'clientID');\n assert_required(options, 'domain');\n\n this._useJSONP = null != options.forceJSONP ?\n !!options.force...
[ "0.7586031", "0.7500923", "0.6567756", "0.6133285", "0.60408837", "0.6034018", "0.57461286", "0.5727904", "0.5694659", "0.56818014", "0.5588691", "0.55353177", "0.5530413", "0.55013514", "0.54922646", "0.5458486", "0.54137146", "0.53782946", "0.53682464", "0.53682464", "0.535...
0.75034153
1
Function Takes a zip file and converts output to geoJSON
function zipToGeoJson(binZip,options) { var manifestZip = xdmp.zipManifest(binZip); var items = []; for (prop in manifestZip) { items.push(manifestZip[prop]) } var projection = items.filter(function(item) { return item.path.match(/\.prj/gi); }).map(function(item,index) { return xdmp.zipGet(binZip,item.pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toGeo(locationZip) {\n return locationData[locationZip];\n }", "zipParser(blob){\n var zip = O.esri.zip;\n var _this = this;\n /*O.esri.*/zip.createReader(new /*O.esri.*/zip.BlobReader(blob), function (zipReader) {\n zipReader.getEntries(function (entries) {\n _this.initMap(entries);...
[ "0.64305365", "0.63793755", "0.6150894", "0.6112751", "0.59269863", "0.5806827", "0.5799536", "0.5781469", "0.5762678", "0.57162565", "0.570116", "0.5666464", "0.5618555", "0.55753213", "0.55692244", "0.5561351", "0.5526353", "0.5525463", "0.5523344", "0.5520175", "0.5494161"...
0.8016717
0
Updates the page information if found and returns true. returns false on failure.
function updatePage(pageId, page){ for(var p in pages) { if(pages[p]._id == pageId) { pages[p].name= page.name; pages[p].description = page.description; pages[p].websiteId = page.websiteId; return true; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updatePage() {\n \tcountLinks();\n \tgetDropDowns();\n \tquery();\n }", "__requestUpdatePageMetaData() {\n let pageMetaData = this._getPageMetadata();\n\n if(!isEmpty(pageMetaData) && !isEqual(this.__pageMetaData, pageMetaData)) {\n this.__pageMetaData = pageMetaData;\n updateMetadat...
[ "0.64135784", "0.61665785", "0.6029088", "0.59559315", "0.58914465", "0.5821671", "0.57722956", "0.576107", "0.57503295", "0.57478666", "0.57371074", "0.57371074", "0.5677414", "0.5638954", "0.56185573", "0.55747616", "0.55733865", "0.556375", "0.55502546", "0.554903", "0.551...
0.7122748
0
Function for filter data according to page number selected
function filterPageNum(page){ // calculate minimum and maximum page index to load minPage = page * 8; maxPage = (page + 1) * 8; // Remove all existing itmes first to add new one filtered $('.items').html(""); for (let index = minPage; index < maxPage; index++) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showTen (page, filtered, filterResult) {\n // Hide all the items in Student list from HTML index\n for (let i = 0; i < liStudents.length; i +=1) {\n liStudents[i].style.display = 'none';\n }\n \n // set page to equal the upper limit of what needs to be displayed based on what page li...
[ "0.70460457", "0.69278735", "0.69069856", "0.67874366", "0.672541", "0.6678826", "0.6556843", "0.6492065", "0.6466455", "0.64568007", "0.64422196", "0.6407297", "0.63926184", "0.6279769", "0.62353796", "0.6230993", "0.6200424", "0.61837274", "0.6149117", "0.6135402", "0.61333...
0.70784974
0
This constructs the reverse mapping for each indexConfig's mapReturnValues mapping
_setReverseMappingValues(mapReturnValues) { if (mapReturnValues) { this.reverseMappedReturnValues = {}; for(let key in mapReturnValues){ this.reverseMappedReturnValues[key] = {}; for (let mappingKey in mapReturnValues[key]) { this.rever...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "appendMappingInverted(mapping) {\n for (let i = mapping.maps.length - 1, totalSize = this.maps.length + mapping.maps.length; i >= 0; i--) {\n let mirr = mapping.getMirror(i);\n this.appendMap(mapping.maps[i].invert(), mirr != null && mirr > i ? totalSize - mirr - 1 : void 0);\n }\n }", "function...
[ "0.54647434", "0.52219033", "0.51774913", "0.51585364", "0.51329756", "0.50129575", "0.50129575", "0.50129575", "0.50129575", "0.49435553", "0.4942582", "0.4927511", "0.48257193", "0.4814357", "0.47856632", "0.47605124", "0.47316006", "0.46869197", "0.46830288", "0.46274832", ...
0.72014374
0
given an array from 1 to n; not sorted, need to find n and what number is missing in the sequence
function findMissing(arr) { //sort the array //get the length - 1 for "n"; //check which number is missing let n = arr.length -1; for (let i = 1; i < arr.length; i++) { let j = i - 1; let temp = arr[i]; while(j >=0 && temp < arr[j]) { arr[j + 1] = arr[j]; j = j - 1; } arr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function determineMissingVal(array){\n for(var i=0; i<array; i++)\n if(i + 1 !== i + 1){\n return (i + 1)\n }\n }", "findMissingNumber(arr) {\n function sumArray() {\n let add = (a, b) => a + b;\n return arr.reduce(add);\n }\n\n function sum() {\n let t...
[ "0.76277524", "0.7602317", "0.75437397", "0.7487735", "0.7476275", "0.7436059", "0.7386547", "0.7349089", "0.73065054", "0.7228358", "0.7219062", "0.7213814", "0.72084427", "0.716135", "0.7156288", "0.71471876", "0.70583415", "0.705422", "0.70515007", "0.69962674", "0.6960720...
0.77354205
0
Canonicalizes the given wellformed BCP 47 language tag, including regularized case of subtags. Spec: ECMAScript Internationalization API Specification, draft, 6.2.3. Spec: RFC 5646, section 4.5.
function canonicalizeLanguageTag(locale) { // start with lower case for easier processing, and because most subtags will need to be lower case anyway locale = locale.toLowerCase(); // handle mappings for complete tags if(__tagMappings.hasOwnProperty(locale)){ return __tagMappings[locale]; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function canonicalizeLanguageTag(locale) {\n // start with lower case for easier processing, and because most subtags will need to be lower case anyway\n locale = locale.toLowerCase(); // handle mappings for complete tags\n\n if (__tagMappings.hasOwnProperty(locale)) {\n return __tagMappings[locale];...
[ "0.66668564", "0.5738269", "0.5643363", "0.5585054", "0.5487849", "0.518823", "0.51692724", "0.5157145", "0.51066667", "0.51053077", "0.50298584", "0.50298584", "0.4969575", "0.49680042", "0.49189708", "0.4917397", "0.4917397", "0.4910442", "0.4896166", "0.48904967", "0.48643...
0.7216134
0
adds turn left action
function addTurnLeft(){ addAction(turn(90), "Left"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addTurnRight(){\n\taddAction(turn(-90), \"Right\");\n}", "function leftTurn(rover) {\n switch (rover.direction) {\n case 'N':\n rover.direction = 'W'\n break;\n case 'E':\n rover.direction = 'N'\n break;\n case 'S':\n rover.direction = 'E'\n break;\n case 'W':\...
[ "0.69804794", "0.69684416", "0.69551075", "0.69357914", "0.68867254", "0.68489933", "0.6803958", "0.6772819", "0.66844976", "0.6656442", "0.6638785", "0.6596144", "0.6591819", "0.65857893", "0.6582185", "0.65195113", "0.6508939", "0.6499027", "0.6489612", "0.6479871", "0.6405...
0.8397731
0
adds turn right action
function addTurnRight(){ addAction(turn(-90), "Right"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addTurnLeft(){\n\taddAction(turn(90), \"Left\");\n}", "function turnRight(rover){\n switch(rover.direction){\n case \"N\":\n rover.direction = \"E\"\n break;\n\n case \"E\":\n rover.direction = \"S\"\n break;\n\n case \"S\":\n rover.direction = \"W\"\n break;\n\n case \"W\...
[ "0.70556176", "0.64540213", "0.6439216", "0.64128053", "0.64125127", "0.627708", "0.6248786", "0.6165703", "0.6071888", "0.60472643", "0.6043057", "0.6032141", "0.6015417", "0.60029364", "0.60013855", "0.59504706", "0.5944496", "0.59436864", "0.59354866", "0.5913608", "0.5905...
0.8110466
0
removes all cards from action card panel
function clearActionCardPanel(){ for (var actionCard : GameObject in actionCardList){ Destroy(actionCard); } actionCardList = []; actionList = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeCards() {\n\t\tgame.workingSet.forEach(element => {\n\t\t\t$(`.card[data-cardIndex=${ element }]`).remove();\n\t\t});\n\t}", "function removeOpenCards() {\n cardOpen = [];\n\n}", "_clearRenderedCards() {\n this._cardsContainer.querySelectorAll('.card').forEach(el => el.remove());\n }",...
[ "0.78536314", "0.7708164", "0.75875235", "0.7560545", "0.7557116", "0.75114715", "0.74622256", "0.74366605", "0.7368413", "0.7362454", "0.73170537", "0.7314947", "0.7302391", "0.7260084", "0.72170347", "0.7211118", "0.71771765", "0.71651244", "0.710064", "0.70782197", "0.7077...
0.83182096
0
subroutine to execute list (so that we can use WaitForSeconds)
function executeList(): IEnumerator{ isExecuting = true; executionStep = 0; scrollToTop(); executeButton.GetComponent(Button).interactable = false; for each(action in actionList){ if (debugMode){ yield WaitForSeconds(debugSpeed); } (action as function())(); executionStep++; } isExecuting = false; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printTasks(list) {\n let idx = -1;\n let len = list.length;\n function execute(content) {\n if (idx >= 0) {\n console.log(content);\n }\n if (++idx < len)\n setTimeout(() => execute(list[idx].Value), list[idx].Time);\n }\n execute();\n}", "function execute() {\r\n\t//iterates ove...
[ "0.6549615", "0.6363476", "0.6182446", "0.61655134", "0.6140146", "0.5877413", "0.5835535", "0.5821644", "0.56748325", "0.56701547", "0.5651659", "0.56510633", "0.5637092", "0.5607232", "0.5605427", "0.5590069", "0.55373883", "0.5532438", "0.5460057", "0.54567105", "0.5442419...
0.67751074
0
Returns driver by id
_API_helper_get_driver_by_id(e, driver_id) { // Note: it wil search for either assigned and unassigned drivers for(let driver of e.data.drivers) { if (driver.driver_id == driver_id) return driver; } return {}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getNextDriver (id) {\n this._drivers = _.sortBy(this._drivers, ['id'])\n const lastDriverId = this._drivers[this._drivers.length - 1].id\n // console.log('last driver id: ' + lastDriverId)\n\n while (id++) {\n // console.log('find for driver id: ' + id)\n let driver = _.find(this._drivers, {i...
[ "0.67120844", "0.6270928", "0.60740536", "0.59384704", "0.5891251", "0.5856834", "0.5847901", "0.5826281", "0.5823941", "0.58210546", "0.5792302", "0.5790438", "0.57880443", "0.57389957", "0.5728517", "0.57193017", "0.56872606", "0.5671584", "0.56693107", "0.5652659", "0.5651...
0.68893564
0
Add random npc function and other funtions
randNpc(){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomNode() {\n \n}", "function SeededRandom(){}", "function NistRandom() {\n this.method = this.ModMethod;\n\n}", "generateRandom() {\n const { x, y } = this.getRandomPixelCoordinate();\n this.create('hero', x, y);\n }", "function npcCreator(id, x, y, img) {\n var self = en...
[ "0.6487357", "0.6317653", "0.62126887", "0.6094708", "0.5937297", "0.58907026", "0.5868768", "0.58544016", "0.58442676", "0.5744663", "0.57365227", "0.5726798", "0.5724431", "0.57065064", "0.5694628", "0.5691593", "0.56912214", "0.568562", "0.5682601", "0.56707543", "0.564683...
0.73783016
0
This is a generic method which takes overlayId and dialogBoxId, and uses them to show different pop ups created for flex form builder page.
function callAngularErrorPopup(overlayId, dialogBoxId) { // popup section. var maskHeight = $(document).height(); var maskWidth = $(window).width(); // calculate the values for center alignment var dialogTop = (maskHeight/3) - ($('#dialog-box').height()); var dialogLeft = (maskWidth/2) - ($('#dialog...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static helpDialog (boxId) {\n\t\tlet me = Box.getBox(boxId);\n\n\t\tif (typeof me.helpInfo === 'function') {\n\n\t\t\tlet dialogId = me.createId('help_dialog');\n\n\t\t\t$(\"#master-table\").append(\n\t\t\t\t$(\"<div>\", {\n\t\t\t\t\tid: dialogId,\n\t\t\t\t\ttitle: '? ' + me.title + ' ?'\n\t\t\t\t}).html(me.helpIn...
[ "0.63211375", "0.6276234", "0.6239331", "0.61607444", "0.6159915", "0.61195886", "0.610053", "0.6093743", "0.59936607", "0.5959127", "0.59584737", "0.59518856", "0.5929089", "0.5906011", "0.5902755", "0.5884897", "0.58696", "0.5862507", "0.5860193", "0.5844187", "0.58222026",...
0.66742176
0
Decorator that marks a class as a Nest exception filter. An exception filter handles exceptions thrown by or not handled by your application code. The decorated class must implement the `ExceptionFilter` interface.
function Catch(...exceptions) { return (target) => { Reflect.defineMetadata(constants_1.FILTER_CATCH_EXCEPTIONS, exceptions, target); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ExceptionHandlerDecorator($delegate, $raven) {\n function ExceptionHandler(exception, cause) {\n var raven = $raven.get();\n if (raven) {\n var additionData = {\n culprit: $raven.getUrl(),\n extra: {\n exception: exception,\n cause: cause\n }\n };\n ...
[ "0.5207645", "0.4758213", "0.45772055", "0.4437553", "0.44311807", "0.44201678", "0.44055367", "0.4306124", "0.4289056", "0.42174506", "0.42147154", "0.4196328", "0.41912615", "0.4141694", "0.41187942", "0.41027826", "0.4086938", "0.40605006", "0.40223545", "0.39994383", "0.3...
0.54691964
0
This method allows to add an input Name (from the old login windows) in the Sound Chat
_setInputName(name){ // It cThe login variable can be set to true this.inputName = name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function registerName(){\n\t//my_name declared in globals.js\n\tmy_name = prompt(\"Please enter a name:\"); //TODO: make this a GUI thing not a prompt\n\tif(my_name===\"\"){\n\t\tregisterName();\n\t\treturn;\n\t}\n\tif(!my_name){\n\t\tthrow new Error(\"Name entry canceled, leaving webpage blank\");\n\t}\n\n\tsocke...
[ "0.7025446", "0.689642", "0.6870511", "0.6866424", "0.6818396", "0.67795515", "0.6760591", "0.67491126", "0.66452146", "0.6603127", "0.6589821", "0.6572551", "0.65716076", "0.6557902", "0.6550803", "0.654911", "0.6525875", "0.65178716", "0.6503954", "0.6499076", "0.6497599", ...
0.7078117
0
Set the focus to Sound Chat input area
setFocus(){ this.$.inputMessage.focus(); this.domHost.playSound("moveCursor", "", ""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setFocus()\n\t{\n\t\tvar wid = fw.getWidget('answerInput', true);\n\t\twid && wid.focus();\n\t}", "function focusOnChat() {\n document.getElementsByName(\"queryBox\")[0].focus()\n}", "function openChat() {\n\n document.getElementById(\"chatBox\").style.display = \"block\";\n document.getEleme...
[ "0.73121345", "0.7162442", "0.71132374", "0.7107633", "0.7104628", "0.7033098", "0.7003492", "0.69667906", "0.6943196", "0.69416535", "0.69397944", "0.68899846", "0.6838907", "0.6831895", "0.68032676", "0.6781683", "0.673547", "0.6717415", "0.6697249", "0.66822004", "0.668220...
0.7671617
0
Read the last five messages to the users
readLatestMessages(messageNumber){ var entireMessages = this.get('messages'); if (messageNumber > entireMessages.length) messageNumber = entireMessages.length; var begin = Math.abs(messageNumber - entireMessages.length); var end = Math.abs(messageNumber - entireMessages.lengt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readLatestMessage() {\n messenger.fetchChatMessages(selectedChatId)\n .then(function (messages) {\n if (messages.length > 0) {\n messenger.chatMessageRead(selectedChatId, messages[messages.length - 1].messageId);\n }\n });\n}", "function readMessages...
[ "0.7280761", "0.7178745", "0.7143443", "0.6895234", "0.65490603", "0.6519527", "0.6519527", "0.63524973", "0.63472885", "0.6336509", "0.63242495", "0.62955606", "0.62954617", "0.6272784", "0.62683976", "0.6259623", "0.6253665", "0.619307", "0.61597735", "0.6158259", "0.610139...
0.7567499
0
Math 2 Write a function called is_even(). This function should take a number. Return true if the input number is even, return false if the number is odd.
function is_even(num) { if (num % 2 !== 0) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_even(num) {\n if (num % 2 != 0) {\n return false\n } else {\n return true\n }\n}", "function is_even(num){\n if(num % 2 == 0){\n return true;\n }\n return false;\n}", "function evenIs(num){\n\treturn num % 2 == 0;\n}", "function is_even(num) {\n return nu...
[ "0.8832179", "0.8743035", "0.8707548", "0.86695224", "0.8527856", "0.8517709", "0.84851116", "0.8478554", "0.8478048", "0.8456021", "0.8455777", "0.84545875", "0.84545875", "0.84497064", "0.84381753", "0.84381753", "0.8431661", "0.83974147", "0.83933705", "0.8389734", "0.8388...
0.882123
1
Math 4 Write a function called create_dummy_array(). This function should take a number n. Return an array of random numbers between 0 and 9 with the length of n.
function create_dummy_array(n) { let random_num = []; for (let i = 0; i < n; i++) { random_num.push(Math.floor(Math.random() * 10)); } return random_num; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create_dummy_array(n){\n let arr=[];\n for(let i = 0; i < n; i++){\n arr.push(Math.random()*9);\n }\n return arr;\n}", "function create_dummy_array(n) {\n var p = [];\n for (i = 0; i < n; i++) {\n p.push(Math.floor(Math.random() * 10));\n }\n return p;\n}", "funct...
[ "0.91164374", "0.8987196", "0.8565374", "0.8561195", "0.8527967", "0.76101387", "0.7273344", "0.7175619", "0.7158408", "0.7158408", "0.7158408", "0.7158408", "0.71550417", "0.7109028", "0.70989734", "0.70775133", "0.7077136", "0.69777536", "0.69777536", "0.6943739", "0.693036...
0.905787
1
Math 5 Write a function called random_choice(). This function should take an array. Return a random element of the array, based on its length. This function should never return undefined.
function random_choice(arr) { rand_num = Math.floor(Math.random() * arr.length); return arr[rand_num]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function random_choice(array){\n var l = array.length;\n var r = Math.floor(Math.random()*l);\n return array[r];\n}", "choice(arr){\n const randomIdx = Math.floor(Math.random() * arr.length)\n return arr[randomIdx]\n}", "function random_choice(arr){\n let idx = Math.floor(Math.random() * arr.length);\n...
[ "0.86888546", "0.8394738", "0.835783", "0.831747", "0.83125865", "0.8156573", "0.8106514", "0.8094813", "0.8055828", "0.803936", "0.79892325", "0.79887795", "0.7957531", "0.79432577", "0.79432577", "0.791889", "0.78805786", "0.78749555", "0.77691", "0.7745606", "0.77438986", ...
0.8402031
1
The crossover() will take care of merging the parents's DNA
crossover(partner) { let newDNA = new DNA(this.lifeSpan); let midPoint = floor(random(this.genes.length)); // We pick a point in the genes // We will create the first half of the child DNA from the genes BEFORE the midpoint // And the second half from the rest of parentB DNA ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "crossover(partner) {\n var newgenes = [];\n // Picks random midpoint\n var mid = floor(random(this.genes.length));\n for (var i = 0; i < this.genes.length; i++) {\n // If i is greater than mid the new gene should come from this partner\n if (i > mid) {\n ...
[ "0.7097149", "0.68364054", "0.68104243", "0.67198336", "0.6693904", "0.6444325", "0.63527256", "0.6210511", "0.6051465", "0.6041297", "0.59787023", "0.5933713", "0.5907531", "0.585528", "0.5850005", "0.5751661", "0.55518913", "0.55302083", "0.5450037", "0.5414866", "0.5398602...
0.7401775
0
The mutation() will take care of causing minor and random changes on the genes
mutation() { for (let i = 0; i < this.genes.length; i++) { if (random(1) < 0.01) { this.genes[i] = p5.Vector.random2D(); this.genes[i].setMag(0.3); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mutation(value)\n {\n let orig = this.genomeSequence.splice();\n for (let i = 0 ; i < this.geneLength; i++)\n {\n if(random(1) < value)\n {\n let indexA = floor(random(this.geneLength));\n let indexB = floor(random(this.geneLength));\n\n ...
[ "0.7934034", "0.75995964", "0.7425964", "0.7423103", "0.7332591", "0.7254557", "0.72543836", "0.7112245", "0.6896279", "0.6741437", "0.6705694", "0.6703969", "0.6699822", "0.6611059", "0.6579955", "0.6574003", "0.65643996", "0.6525194", "0.6486512", "0.64352024", "0.6424225",...
0.8195278
0
This function swaps two array members at random, provided they are not in the exceptions list.
function swap( arr, exceptions ) { var i; var except = exceptions ? exceptions : []; var shufflelocations = new Array(); for (i=0; i<arr.length; i++) { if (except.indexOf(i)==-1) shufflelocations.push(i); } for (i=shufflelocations.length-1; i>=0; --i) { var loci = shufflelocations[i]; var locj = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shuffle( arr, exceptions ) {\r\n\tvar i;\r\n\texceptions = exceptions || [];\r\n\tvar shufflelocations = new Array();\r\n\tfor (i=0; i<arr.length; i++) {\r\n\t\tif (exceptions.indexOf(i)==-1) { shufflelocations.push(i); }\r\n\t}\r\n\tfor (i=shufflelocations.length-1; i>=0; --i) {\r\n\t\tvar loci = shuffle...
[ "0.681246", "0.65702015", "0.6380419", "0.63715214", "0.63009596", "0.6251877", "0.6210775", "0.6177344", "0.6155904", "0.61525583", "0.61463726", "0.6139271", "0.6124423", "0.6116746", "0.61029464", "0.60870826", "0.6069909", "0.6052259", "0.6051046", "0.6024972", "0.601204"...
0.7973073
0
Mean of booleans (true==1; false==0)
function boolpercent(arr) { var count = 0; for (var i=0; i<arr.length; i++) { if (arr[i]) { count++; } } return 100* count / arr.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function boolpercent(arr) {\n\tvar count = 0;\n\tfor (var i=0; i<arr.length; i++) {\n\t\tif (arr[i]) { count++; } \n\t}\n\treturn 100* count / arr.length;\n}", "function boolpercent(arr) {\n\tvar count = 0;\n\tfor (var i=0; i<arr.length; i++) {\n\t\tif (arr[i]) { count++; } \n\t}\n\treturn 100* count / arr.lengt...
[ "0.6279181", "0.6279181", "0.6273198", "0.6010163", "0.59968126", "0.5929756", "0.58997667", "0.58990747", "0.5823812", "0.5816053", "0.5758804", "0.5696077", "0.56039846", "0.5557395", "0.55364144", "0.5520833", "0.5517476", "0.54074425", "0.5372101", "0.53597975", "0.533019...
0.63378733
0
check cocal storage for watch_list item and if it doesn't exist, set it
checkLocal(){ if (localStorage.getItem("watch_list") === null){ localStorage.setItem("watch_list", JSON.stringify(WatchListStore.movies)); } else{ WatchListStore.movies = (JSON.parse(localStorage.getItem("watch_list"))); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setWatchlist() {\n\twatchlist = new Watchlist();\n}", "function watchlist_change_callback(watch_dso, added) {\n let tr = watch_dso.dso.get_catalog_tr();\n if (tr != null) {\n tr.find(\".objects-add\").prop(\"disabled\", added);\n }\n}", "function setWatching(name, value) {\r\n var w...
[ "0.6467389", "0.5917412", "0.56958276", "0.5626755", "0.5521355", "0.5479418", "0.5479418", "0.5479418", "0.5479418", "0.5479418", "0.5479418", "0.5479418", "0.5479418", "0.5479418", "0.5479418", "0.5479418", "0.5479418", "0.5479418", "0.5479418", "0.5479418", "0.5479418", ...
0.6298241
1
add movie to watch list if it does not already exist, then if conditions are met, set local storage watch list to the store's movies array
addMovie(movie){ if(WatchListStore.movies.some(item => item.id === movie.id)){ alert("This Movie is already on your watch list"); } else{ WatchListStore.movies.push(movie); localStorage.setItem("watch_list", JSON.stringify(WatchListStor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveToWatchlist(imdbID){\n var movie = movies.find(function(currentMovie){\n return currentMovie.imdbID == imdbID;\n\n });\n var watchListJSON = localStorage.getItem('watchlist');\n var watchList = JSON.parse(watchlistJSON);\n if (watchlist == null...
[ "0.72877955", "0.70616925", "0.6989802", "0.6704591", "0.6560845", "0.65541226", "0.65177125", "0.6452346", "0.6401642", "0.64009196", "0.6214978", "0.6172032", "0.61488026", "0.6140452", "0.61014897", "0.6021519", "0.5994648", "0.59480727", "0.5905924", "0.587799", "0.585113...
0.81354237
0
remove movie from watchlist by id and then update local storage's watch list item to this store's movie array
deleteMovie(id){ WatchListStore.movies = WatchListStore.movies.filter(movie => movie.id !== id); localStorage.setItem("watch_list", JSON.stringify(WatchListStore.movies)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeMovie(e){\n let id = e.target.id\n let movie = JSON.parse(localStorage.getItem('movie'));\n for (let c = 0 ; c < movie.result.length ;c++){\n if(movie.result[c].name === id){\n movie.result.splice(c,1)\n }\n }\n localStorage.setItem('movi...
[ "0.7191679", "0.6992379", "0.6951923", "0.6805257", "0.6782272", "0.67120516", "0.67018884", "0.66507024", "0.6639743", "0.66256475", "0.6614545", "0.65854424", "0.64362633", "0.6430034", "0.64287037", "0.63968116", "0.6395717", "0.6352495", "0.63248074", "0.632262", "0.63053...
0.8470931
0
Returns a random number between fromValue..toValue
function randRange( fromValue, toValue ) { return Math.random() * (toValue-fromValue) + fromValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randFromTo(from,to){\n return Math.floor(Math.random()*(to-from +1) +from);\n}", "function getRandomIntFromTo(from, to) {\n var size = to - from + 1;\n return from + getRandomNumber(size);\n}", "function randomInt(from, to){\n\t\treturn Math.round((Math.random()*(to-from))+from);\n\t}", "functi...
[ "0.8252509", "0.81856686", "0.817208", "0.8084213", "0.8079786", "0.8068097", "0.8018827", "0.799241", "0.79645693", "0.7929915", "0.7906694", "0.7656917", "0.76347643", "0.7623455", "0.76157635", "0.75931007", "0.755934", "0.75550336", "0.75547624", "0.7515827", "0.7408785",...
0.88405395
0
Returns a random number between value..value ("bi" == bipolar)
function randBi( value ) { return Math.random() * (2*(value||1.0)) - (value||1.0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRandomValue() {\n return (Math.random() * (0.9 - 0.2) + 0.2)\n}", "function randomValue(value){\n return Math.floor(Math.random()*value +1)\n}", "function getRandomValue() {\n var x = Math.random();\n if(x > 0.7)\n x = 4;\n else\n x = 2;\n return x;\n }", ...
[ "0.7247626", "0.69474506", "0.69196266", "0.6915471", "0.68896335", "0.6799551", "0.6773091", "0.6762435", "0.67623615", "0.6737783", "0.6690569", "0.668529", "0.66724837", "0.66670424", "0.66404307", "0.6625506", "0.66223997", "0.6609551", "0.660647", "0.6592114", "0.6586566...
0.78940016
0
Wraps value as close to target as possible.
function wrapCloseToTarget( value, height, target ) { var diff = target - value; return value + (Math.round(diff/height) * height); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static wrap (input, target) {\n if (input >= target) {\n input -= target;\n return Memory.wrap(input, target);\n }\n else if (input < 0) {\n input += target;\n return Memory.wrap(input, target);\n }\n else {\n return input;\n }\n }", "static wrap(value) {\n retu...
[ "0.70029294", "0.6774896", "0.6774896", "0.6774896", "0.6774896", "0.6774896", "0.64466137", "0.6352943", "0.58568615", "0.57997274", "0.57198113", "0.57198113", "0.57198113", "0.57198113", "0.57198113", "0.5677484", "0.5623441", "0.5623441", "0.55342025", "0.5439267", "0.538...
0.73764414
0
Function to show modal for comment page
function showModal() { document.getElementById('modal-backdrop').classList.toggle('hidden'); if(document.getElementById('leave-comment-modal')) { document.getElementById('leave-comment-modal').classList.toggle('hidden'); } if(document.getElementById('create-location-modal')) { document.getElementById('create-lo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showModalComments() {\n let template = $('#commentsTemplates');\n let pjtId = $('.version_current').attr('data-project');\n\n $('.invoice__modalBackgound').fadeIn('slow');\n $('.invoice__modal-general').slideDown('slow').css({ 'z-index': 401 });\n $('.invoice__modal-general .modal__body').a...
[ "0.81703675", "0.7045357", "0.6974666", "0.67152375", "0.66786385", "0.6567222", "0.65404004", "0.6533532", "0.65326005", "0.65301543", "0.6516579", "0.65021545", "0.647018", "0.6469404", "0.6457406", "0.64547366", "0.64348876", "0.6434136", "0.64260894", "0.64258", "0.642142...
0.71260256
1
Funciton to send data for a new location and to interact with DB using XMLHttpRequest
function sendData() { console.log("FJKBNIJDFKBN"); var xhr = new XMLHttpRequest(); if(document.getElementById('leave-comment-modal')) { xhr.open("POST", "/new_comment", true); xhr.setRequestHeader('Content-Type', 'application/json'); xhr.send(JSON.stringify({ author: document.getElementById('comment-auth...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateLocation(loc_id)\n{\n\t\tvar httpRequest = new XMLHttpRequest();\n\t\t//var turl = \"http://localhost/final/data.php\";\n\t\tvar loc_name = document.getElementById(\"name-\"+loc_id).value;\n\t\tvar loc_addr = document.getElementById(\"addr-\"+loc_id).value;\n\t\thttpRequest.open('POST', turl, true);...
[ "0.7073317", "0.69707084", "0.67827445", "0.6727906", "0.67135394", "0.6517749", "0.64174956", "0.63680923", "0.6274439", "0.62665135", "0.62535876", "0.6249595", "0.62334263", "0.61864805", "0.61851406", "0.61774755", "0.61759585", "0.6130437", "0.6127654", "0.6125516", "0.6...
0.7065772
1
performs POST request to submit a new post created by the currently logged in user
async handleNewPostSubmit(event, text) { event.preventDefault(); const path = '/home/posts/create'; const userID = this.state.user._id; const requestBody = {userID, text}; try { let res = await this.makeRequest(path, 'POST', requestBody); // add new post to state's user.posts arra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function submitPost() {\n // add to database\n return new Promise( function(resolve) {\n // Create object and set up request\n let xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState === 4 && this.status === 200) {\n resolve(this.respon...
[ "0.71996915", "0.70294094", "0.70036256", "0.6983954", "0.68745077", "0.6853092", "0.68280727", "0.6813602", "0.6794678", "0.67644805", "0.6752276", "0.6736729", "0.6736308", "0.6723005", "0.6722545", "0.6719037", "0.67004853", "0.6696844", "0.6694467", "0.66925675", "0.66708...
0.72561747
0
~~~HELPERS~~~ uses builtin fetch API call to make a request to URL with body "requestBody" and method "method"
async makeRequest(relativeURL, method, requestBody) { const DOMAIN = process.env.REACT_APP_ROOT_API_DOMAIN; const PORT = process.env.REACT_APP_ROOT_API_PORT; const response = await fetch(`${DOMAIN}:${PORT}${relativeURL}/`, { method: method.toUpperCase(), headers: { 'Content-Type': 'appl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function request(URL, method, body) {\n function makeOptions(method, body) {\n var opts = {\n method: method,\n headers: {\n \"Content-type\": \"application/json\"\n }\n }\n if (body) {\n opts.body = JSON.stringify(body);\n }...
[ "0.74999976", "0.7237881", "0.7180093", "0.7100915", "0.7043866", "0.7030122", "0.6998418", "0.6984939", "0.69658846", "0.6859679", "0.6814125", "0.680047", "0.6781335", "0.677595", "0.6719441", "0.6711799", "0.668768", "0.66770333", "0.6639406", "0.66358626", "0.6630063", ...
0.7269785
1
=========================================Vehicle Marker Movement Function========================================
function changeMarkerPosition(carImageMarker) { bookingTravelcounter++; for (let j = bookingCoordinates.length - bookingTravelcounter; j >= 0; j--) { var latlng = new google.maps.LatLng(bookingCoordinates[j].lat, bookingCoordinates[j].lng); carImageMarker.setPosition(latlng); bookingTrav...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dragMarker() {\n map.addEventListener('dragstart', function (ev) {\n var target = ev.target;\n if (target instanceof H.map.Marker) {\n var pointer = ev.currentPointer;\n var targetPosition = map.geoToScreen(target.getGeometry());\n ...
[ "0.63885564", "0.6358896", "0.6327221", "0.63004625", "0.62766653", "0.6275091", "0.6249337", "0.6241287", "0.62327754", "0.6185112", "0.6183493", "0.612704", "0.61176026", "0.6115086", "0.6060077", "0.60355306", "0.60340106", "0.59911734", "0.5988259", "0.5984063", "0.598367...
0.6567196
0
Generate chart data object for bar chart Aggregation of user answers values by answers options
function getChartDataForBarChart(question, users) { let data = []; for (let i = 0; i < question.question_options.length; i++) { data.unshift({ label: question.question_options[i].title, option_id: question.question_options[i].id, participants: {} }); } for (let i = 0; i < data.length;...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeResultsBarChart(countries) {\n var chart = ui.Chart.feature.byFeature(countries, 'Name');\n chart.setChartType('BarChart');\n chart.setOptions({\n title: 'Population Comparison',\n vAxis: {title: null},\n hAxis: {title: 'Approximate 2015 Population', minValue: 0}\n });\n chart.style().se...
[ "0.64793783", "0.6414144", "0.6307846", "0.6293011", "0.6260365", "0.62465036", "0.6211035", "0.6194585", "0.6161841", "0.6150577", "0.614934", "0.61304706", "0.6112436", "0.609011", "0.6066027", "0.60570127", "0.60512775", "0.60500556", "0.60467637", "0.6045163", "0.6035838"...
0.7526777
0
Generate chart data object for radar chart array of answers data by each user
function getChartDataForRadarChart(question, users) { let data = []; users.forEach(user => { let userAnswer = user.attempts[0].answers.find(a => a.question_id === question.id); if (!userAnswer) { return; } let chartData = { participantId: user.id, answers: [] }; questio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getChartDataForBarChart(question, users) {\n let data = [];\n for (let i = 0; i < question.question_options.length; i++) {\n data.unshift({\n label: question.question_options[i].title,\n option_id: question.question_options[i].id,\n participants: {}\n });\n }\n\n for (let i = 0; i...
[ "0.66551334", "0.65028435", "0.6358124", "0.6237393", "0.6206669", "0.6132175", "0.606876", "0.5919107", "0.5889342", "0.58791935", "0.58542764", "0.58485556", "0.58452153", "0.583034", "0.58122283", "0.58122283", "0.5808648", "0.57804495", "0.57672673", "0.575926", "0.575803...
0.7783045
0
Collect all users answers by options to calculate average on front end later
function getGroupAnswersByOptions(question, users) { let result = []; const userAnswersByQuestion = []; for (let i = 0; i < users.length; i++) { const user = users[i]; const answer = user.attempts[0].answers.find(a => a.question_id === question.id); if (answer) { userAnswersByQuestion.push(an...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calcDistictAnswers(answers, question) {\n\n //Check if answers contains more than one submission and question is defined\n if (answers.length < 1 || question == undefined) {\n console.log(\"Error in calculating disctinct answers: No answers provided or question missing\")\n return;\n }\n\n //Pre...
[ "0.6535389", "0.65216076", "0.62368596", "0.62118745", "0.6185692", "0.6108767", "0.5988151", "0.59628356", "0.59432745", "0.5908018", "0.5905235", "0.58817536", "0.5819511", "0.578893", "0.5759762", "0.5745374", "0.5727711", "0.56677157", "0.56584305", "0.56412", "0.5617057"...
0.65682715
0
Cycles through the images of emails by revealing and hiding the relevant ones upon clicking the next button
function cycleEmails() { $("#next").on("click", function () { $(".reminder").addClass("hidden"); if ($("#canyon").hasClass("shown")) { $("#canyon").addClass("hidden"); $("#canyon").removeClass("shown"); $("#planeTicket").addClass("shown"); $("#planeTicket").removeClass("hidden"); }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextImage() {\n // Store the current item as the previous item\n previousNode = currentNode;\n // Reset the counter\n if (currentNode >= numBanners) {\n currentNode = 0;\n }\n else {\n ...
[ "0.6426432", "0.6289269", "0.6246151", "0.62222534", "0.61906993", "0.61179763", "0.6111518", "0.61065465", "0.60644466", "0.6034692", "0.60341454", "0.60244477", "0.6018295", "0.60121304", "0.6006097", "0.60057217", "0.5997229", "0.5989775", "0.5980421", "0.59598994", "0.594...
0.67151767
0
Open a new tab with the strawpoll voting link
function viewPoll() { $("#poll").on("click", function () { window.open("https://www.strawpoll.me/44308387"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "comparePlans() {\n window.open('http://www.com', '_blank');\n }", "function open_new_tab(url){\n window.open(url, '_blank');\n}", "function openInNewTab(url) {\n var win = window.open(url, '_blank');\n win.focus();\n }", "openTheUrlInsideNewTab(url) {\r\n //browser.wait...
[ "0.7095533", "0.6757906", "0.6693227", "0.6637092", "0.6611517", "0.6575445", "0.65565807", "0.6483507", "0.6477505", "0.6462808", "0.6426655", "0.63952345", "0.6352022", "0.6332375", "0.6319664", "0.62821704", "0.6264452", "0.62231845", "0.62199056", "0.61991584", "0.6199158...
0.7867341
0
Hides and reveals the relevant elements when the people button is clicked
function selectPeople() { $("#people").on("click", function () { $(".contacts").removeClass("hidden"); $(".emails").addClass("hidden"); $(".nav").addClass("hidden"); $("#scheduleImg").addClass("hidden"); $("#canyon").addClass("shown"); // Allows you to cycle through the emails after switching to a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function personal() {\n document.getElementById(\"aboutMeSkills\").style.display = \"none\"\n document.getElementById(\"aboutMeText\").style.display = \"block\"\n}", "function showProfile() {\r\n // making list invisible----\r\n if (getComputedStyle(document.querySelector('.list')).visibility == 'vis...
[ "0.67629194", "0.6592959", "0.6588102", "0.6502788", "0.6484353", "0.645659", "0.64442986", "0.6438589", "0.6409336", "0.63974166", "0.6391221", "0.6385653", "0.6385653", "0.63852316", "0.6380439", "0.63113415", "0.630384", "0.62981504", "0.6293722", "0.6264798", "0.6244561",...
0.70981646
0
Hides and reveals the relevant elements when the files button is clicked
function selectFiles() { $("#files").on("click", function () { $(".files").removeClass("hidden"); $("#scheduleImg").addClass("hidden"); $(".emails").addClass("hidden"); $(".nav").addClass("hidden"); $(".contacts").addClass("hidden"); $("#search").addClass("hidden"); $(".reminder").addClass...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hideFiles() { showFiles(true,this); }", "function showDetailsFile() {\n $(\".div-display-details.file\").toggleClass(\"show\");\n // $(\".div-display-details.folders\").hide()\n}", "function toggleHiddenFilesBtnClick(btn) {\n\tvar show = document.getElementById('show');\n\tvar hide = document.getEle...
[ "0.79782516", "0.7528284", "0.73411417", "0.72400457", "0.7089632", "0.70774263", "0.697108", "0.6800073", "0.6778804", "0.674065", "0.67363435", "0.6696002", "0.66468394", "0.6605832", "0.6596408", "0.64985967", "0.6442079", "0.6413323", "0.6391047", "0.63417065", "0.6289043...
0.7667103
1
Hides and reveals the relevant elements when the search button is clicked
function selectSearch() { $("#searchButton").on("click", function () { $("#search").removeClass("hidden"); $(".files").addClass("hidden"); $("#scheduleImg").addClass("hidden"); $(".emails").addClass("hidden"); $(".nav").addClass("hidden"); $(".contacts").addClass("hidden"); $(".reminder")....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onSearchComplete() {\n $('events').hide(); $('search-results').show(); $('back-to-events-button').show();\n}", "function show_and_hide(){\n search_button.fadeOut(500, 'linear', function () {\n random.fadeIn(500, 'linear');\n search_bar.slideDown(500, 'linear');\...
[ "0.7616357", "0.7193995", "0.7191377", "0.7177288", "0.7080657", "0.7074831", "0.69829756", "0.6974323", "0.69525677", "0.6943501", "0.69201666", "0.6893565", "0.6893265", "0.68699205", "0.6865102", "0.6844658", "0.6829197", "0.68018264", "0.6783803", "0.67681223", "0.6767527...
0.74697036
1
Displays the background images
function backgroundImages() { tint(255, 140); // Reduces the image's opacity image(cherryblossom1, 990, 110); image(cherryblossom2, -20, 20); image(dragon, -50, 340); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayBg() \n{\n\tvar bg = new Image();\n\tbg.src = \"Images/background.jpg\";\n\tctx.drawImage(bg,minCanvasWidth,minCanvasHeight,maxCanvasWidth,maxCanvasHeight);\n}", "draw() {\n // Displaying the background\n image(hubImage, 0, 0, width, height);\n }", "function drawImages(image) {\n// had t...
[ "0.72366023", "0.7189655", "0.7184001", "0.7012197", "0.6744574", "0.6721133", "0.6711324", "0.67066056", "0.6682673", "0.6670723", "0.66679066", "0.6654848", "0.6652884", "0.6562538", "0.65387726", "0.6537147", "0.6505571", "0.6471649", "0.6425017", "0.6421088", "0.6387606",...
0.7249943
0
If you have a new step, just add a condition and create the class
function ScenarioStepFactory(step,ctx) { this.isAction = () => step.action !== undefined this.isConsumedMessage = () => (step.message !== undefined) && (step.consumed_by !== undefined) this.isProducedMessage = () => (step.message !== undefined) && (step.produced_by !== undefined) this.isCalledAPI = () => (step....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "nextStep(stepNumber){\n this.stepCounter++;\n this.stepValue ='step'+this.stepCounter;\n console.log('nextStep ->',this.stepValue);\n switch (this.stepCounter) {\n case 1:\n this.template.querySelector('.step1').classList.remove('slds-hide');\n t...
[ "0.6044721", "0.60231596", "0.58400124", "0.5788955", "0.5693843", "0.56859076", "0.5685879", "0.5662627", "0.55810934", "0.55766916", "0.5412146", "0.54113466", "0.5407014", "0.5355492", "0.5351881", "0.53372943", "0.53268176", "0.53178585", "0.5300945", "0.529925", "0.52729...
0.6124757
0
Train the NLP manager.
async train() { await this.nlpManager.train(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async train(trainingData) {\n\n let intents = trainingData['intents']\n for( let intent in intents ) {\n console.log('\\ttraining', intent)\n for( let utterance of intents[intent]['utterances'] ) {\n //console.log(this.language, utterance, intent)\n ...
[ "0.76216924", "0.7354308", "0.6965677", "0.68033713", "0.6769752", "0.6676265", "0.65867376", "0.64592", "0.6401287", "0.6354004", "0.6250892", "0.62381077", "0.61879855", "0.6030598", "0.59770805", "0.59321207", "0.5927103", "0.59159344", "0.58967435", "0.5885584", "0.587169...
0.85861343
0
Initilizes the selected tab to the first one for the login. Initializing it like this ensures that if the user does not have javascript enabled on their machine, it will not appear stuck on one particular tab. This is to be called on focus change events on members of tabButton class
function changeActiveTab() { for (var j = 0; j < tabs.length; ++j) { tabs[j].className = "tabButton"; if(tabs[j] == this) { this.className += " activeTab"; $(tabs[j]).attr("aria-selected", true); $('#loginIdPanel').attr("aria-labelledby", $(tabs[j]).attr('id')); } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firstTab() {\n\n // Deselect current tab and correspondent tabpanel.\n deselectTab(currentEnabledTabs[currentTabIndex]);\n deselectTabpanel(document.getElementById(currentEnabledTabs[currentTabIndex].getAttribute('aria-controls')));\n\n // Select first t...
[ "0.74629265", "0.6949366", "0.6939522", "0.6909505", "0.68950945", "0.68950945", "0.6772708", "0.6717897", "0.665982", "0.6616202", "0.6609206", "0.6605435", "0.6572011", "0.6566807", "0.6557166", "0.65534097", "0.6491953", "0.64604014", "0.6458214", "0.64579225", "0.6432558"...
0.7227535
1
Disable click handler that closes menu on click of menu item.
function disableClickToClose() { // Close the menu when a menu item is clicked. $(CSS_SELECTOR_MENU_ITEM).unbind("click"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ContextMenuClickHandler() {\n $(settings.menuSelector)\n .off('click')\n .on('click', function(e) {\n $(this).hide();\n\n var $invokedOn = $(this).data(\"invokedOn\");\n ...
[ "0.7459768", "0.7188875", "0.7009534", "0.7009076", "0.6802165", "0.6790638", "0.67703295", "0.6753437", "0.6688629", "0.6662347", "0.66557866", "0.6652776", "0.66497105", "0.6509585", "0.64644635", "0.6461581", "0.64590526", "0.64590526", "0.6437391", "0.64373225", "0.643102...
0.893365
0
Sets the colors of all the divs.
function setPaletteDivs() { _appState.palette.data.forEach((color,i) => _palElems[i].style.backgroundColor = cmn.toCSSColorStr(color)); setForeBackDivs(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setColors () {\n // SET ALL COLOR VARIABLES\n setColorValues();\n\n // UPDATE CSS COLOR STYLES\n setColorStyles();\n\n // SET CONTRAST COLOR STYLES\n setContrastStyles();\n}", "function setAllColors(){\n\tfor (i=0; i<squares.length; i++){\n\t\tsquares[i].style.background = pickColor;\n\t}\n\th1.st...
[ "0.7269615", "0.7052503", "0.7022754", "0.69192755", "0.6730089", "0.6589284", "0.65655804", "0.6514106", "0.6499193", "0.64844906", "0.64815885", "0.6480507", "0.64706904", "0.64637935", "0.6461346", "0.64411104", "0.6413167", "0.64089453", "0.63996595", "0.6377136", "0.6365...
0.73043174
0
detect mouse positioned image to process in iframe send image when mouse pointing recieve ocr processed text and return recent recieved text
function checkImage(clientX, clientY) { //if mouse target on image, process ocr if (currentSetting["useOCR"] == "true" && //when use ocr setting on mouseTarget != null && mouseTarget.tagName === 'IMG' && //when mouse over on img mouseTarget.complete && mouseTarget.naturalHeight !== 0) { //if image is loade...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fetchText() {\n // if the user has selected some text, proceed with that, no matter what\n if (this.editor.getSelectedText() !== \"\") {\n return {\n text: this.editor.getSelectedText(),\n range: this.editor.getSelectedBufferRange()\n }\n }\n\n // no selection, trying to detect ...
[ "0.5717427", "0.55840003", "0.5563424", "0.5525155", "0.55036414", "0.5491295", "0.5472034", "0.5397259", "0.5384006", "0.5373414", "0.5370116", "0.5335723", "0.53292215", "0.53230876", "0.52282983", "0.52206135", "0.5198185", "0.5195642", "0.51836205", "0.5159366", "0.515763...
0.77195567
0
Gets the actual resolved brush in use for the item that is in context.
get actualItemBrush() { return brushToString(this.i.actualItemBrush); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get itemBrush() {\r\n return brushToString(this.i.itemBrush);\r\n }", "get brush() {\r\n return brushToString(this.i.brush);\r\n }", "get markerBrush() {\r\n return brushToString(this.i.markerBrush);\r\n }", "function get_current_selection() {\n /* Get the DOM element */\n ...
[ "0.73152566", "0.6864565", "0.66959155", "0.6092255", "0.6074961", "0.57342565", "0.56737787", "0.56462055", "0.56338406", "0.56326544", "0.5596611", "0.5546238", "0.552548", "0.5515464", "0.5515464", "0.5473994", "0.54603827", "0.54532653", "0.5442022", "0.54409933", "0.5430...
0.7608092
0
Gets the outline in use for the item in context.
get outline() { return brushToString(this.i.outline); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get markerOutline() {\r\n return brushToString(this.i.markerOutline);\r\n }", "drawOutline() {\n\t\tlet width = 30;\n\n\t\tinfo.context.beginPath();\n\t\tinfo.context.rect(this.position.x - width/2, this.position.y - width/2, width, width);\n\t\tinfo.context.strokeStyle = \"black\";\n\t\tinfo.context.s...
[ "0.64843285", "0.6366117", "0.6310144", "0.6252399", "0.6112343", "0.59706736", "0.59338164", "0.5820621", "0.579847", "0.57785624", "0.5735598", "0.5707461", "0.55934995", "0.5552696", "0.53870887", "0.5292792", "0.5292792", "0.5173962", "0.51299274", "0.511958", "0.51179636...
0.7450082
1
Gets the label in use for the item in context, if available.
get itemLabel() { return this.i.itemLabel; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCurrentLabel () {\n return status.currentLabel;\n }", "function getLabel(t) {\n //console.log(t)\n\n var _label = t.data.label || null;\n\n return _label\n }", "get currentLabel() {\n return this._regOrToggled(this.label, this.toggledLabel, this.isToggled);\...
[ "0.6712819", "0.65529144", "0.63721013", "0.63265795", "0.62593144", "0.6250889", "0.6189629", "0.6150812", "0.6146492", "0.6141227", "0.6141227", "0.6141227", "0.61189747", "0.6064316", "0.60438466", "0.59980553", "0.59723264", "0.5916407", "0.5864782", "0.5812327", "0.58079...
0.70769686
0
Gets the potential brush in usage for the item in context.
get itemBrush() { return brushToString(this.i.itemBrush); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get actualItemBrush() {\r\n return brushToString(this.i.actualItemBrush);\r\n }", "get brush() {\r\n return brushToString(this.i.brush);\r\n }", "get markerBrush() {\r\n return brushToString(this.i.markerBrush);\r\n }", "function renderBrush() {\n // So that we don't draw a...
[ "0.6816255", "0.6126103", "0.58433324", "0.5081822", "0.5074424", "0.50718737", "0.5071755", "0.5062121", "0.50335884", "0.4971458", "0.4903879", "0.48119062", "0.480789", "0.47983894", "0.47667903", "0.47638744", "0.47089422", "0.47004136", "0.4698494", "0.46933764", "0.4693...
0.6668172
1
Gets the thickness of the item in context.
get thickness() { return this.i.thickness; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get strokeWidth() {\n return this._strokeWidth || this.diameter / 10;\n }", "get shapeStrokeThickness() {\r\n return this.i.shapeStyle ? this.i.shapeStyle.strokeThickness : NaN;\r\n }", "function measureWidth(item) {\n context$1.font = font(item);\n return measure$1(textValue(item));\...
[ "0.67698103", "0.66194975", "0.63407904", "0.6309577", "0.6309577", "0.6309577", "0.61679405", "0.6023448", "0.60044634", "0.5960528", "0.593928", "0.5891232", "0.5888103", "0.5826632", "0.5753203", "0.57338107", "0.5719876", "0.5712689", "0.5689023", "0.56714153", "0.5670293...
0.7247929
1
Gets the legend label to use for the item in context, if available.
get legendLabel() { return this.i.legendLabel; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get legend() {\n if (this.i.legend != null)\n return this.i.legend.externalObject;\n }", "get legendItemTemplate() {\r\n return this.i.legendItemTemplate;\r\n }", "get title() { return this.Nls(\"Legend_Title\") }", "function legend() {\n obj.extend(config_, defaults_);\n ...
[ "0.6543411", "0.63674617", "0.60894877", "0.605447", "0.5810921", "0.5695612", "0.5686231", "0.5608525", "0.5579876", "0.55757374", "0.55756104", "0.55490613", "0.5536218", "0.5520971", "0.5434338", "0.5407449", "0.5407449", "0.53957623", "0.5357836", "0.5351224", "0.53130406...
0.744258
0
RENDER A LIST OF DRIVES drives: list of drives
function renderDrives(drives) { var driveList = ""; for(var i = 0; i < drives.length; i++) { if (drives[i].mountpoints.length > 0) { var item = `<li id='${drives[i].device}' className='listItem'>` + drives[i].mountpoints[0].path + "</li>"; driveList += item; item = ""; } } $('.drive-li...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findDevices(){\n $('.drive-list').html('<p>Searching for drives...</p>')\n drivelist.list((error, drives) => { \n if (error) {\n throw error;\n }\n renderDrives(drives);\n });\n}", "get drives() {\r\n return new Drives(this);\r\n }", "function _drawLists() {\n let templat...
[ "0.6518405", "0.64984816", "0.57100385", "0.56499946", "0.5647157", "0.55339044", "0.5513089", "0.5468095", "0.5437098", "0.5417288", "0.54006916", "0.53894967", "0.53829", "0.53444153", "0.53111273", "0.5250449", "0.52135724", "0.5187365", "0.5171803", "0.51628876", "0.51627...
0.8334216
0
Aggregate Unicode (space removed)
function uniScore(str) { str = str.split(' ').join(''); let sum = str.split('').reduce((acc, cur) => { acc += cur.charCodeAt(0); return acc; }, 0); return sum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deuni(input){\n\toutput= unescape(input.replace(/\\]/g,\"\").replace(/\\[U\\+/g,\"%u\"));\n return output;\n}", "static normalize(input){\n // https://en.wikipedia.org/wiki/Unicode_equivalence#Normalization\n // http://www.unicode.org/reports/tr15/\n\n // normalize codepoints (split diacritics)...
[ "0.55865914", "0.53788483", "0.53003365", "0.5188591", "0.5186741", "0.5166367", "0.516143", "0.5128834", "0.51193494", "0.5037217", "0.5009783", "0.49849045", "0.49644548", "0.49590865", "0.49556622", "0.49412525", "0.49267438", "0.48939648", "0.48934034", "0.4890671", "0.48...
0.54548395
1
Constructs a new GetTxResponseVout.
constructor() { GetTxResponseVout.initialize(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() { \n \n GetTransactionInfoResponse.initialize(this);\n }", "static from(getTransactionResponse, xrplNetwork) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;\n const transaction = getTransactionResponse.getTransaction();\n if (!transactio...
[ "0.58019704", "0.51394975", "0.49940872", "0.49669504", "0.49438635", "0.48985788", "0.48438427", "0.4770161", "0.46780524", "0.46778712", "0.46663016", "0.46110266", "0.4575828", "0.4573303", "0.455873", "0.4545912", "0.45014343", "0.44745347", "0.44642833", "0.44642833", "0...
0.75525314
0
Only used when host element we are attached to is NOT a fileElement
createFileElm({ change }) { // use specific technique to hide file element within const label = createInvisibleFileInputWrap(); const fileElm = label.getElementsByTagName('input')[0]; fileElm.addEventListener('change', change); this.element.nativeElement.appendChild(label); // pu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function somethingAttached(e) {\n e.preventDefault();\n const isThereFile = document.querySelector(\"[name=attachment]\").files.length > 0;\n this.parentNode.querySelector(\"label\").classList.toggle(\"file-loaded\", isThereFile);\n}", "get attached(){ return this.filter(_elementIsAttached); }", "detached()...
[ "0.6024491", "0.5558094", "0.5545222", "0.54744035", "0.54586655", "0.54418445", "0.5409163", "0.5399846", "0.5399846", "0.5399846", "0.5366542", "0.5333081", "0.5326703", "0.5318482", "0.5315608", "0.52894944", "0.52894944", "0.52894944", "0.52894944", "0.52894944", "0.52894...
0.58928734
1
All tests placed within the $() function since some require DOM elements need to ensure they don't run until the DOM is ready. NOTE: I added this function before realized could use querySelector instead var checkClass = document.querySelector(".menuhidden")
function checkForClass() { // query for the menu-hidden class; capture in HTMLCollection var checkForClassHTMLCollection = document.getElementsByClassName("menu-hidden"); // convert HTML Collection to an Array var checkForClass = [].slice.call(checkForClassHTMLCollection); // calculate length va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkClass() {\n hiddenClass = $('body').hasClass('menu-hidden'); \n }", "function checkVisible()\n{\n\tcheckElementRunThough(\"slide-card\");\n\tcheckElementRunThough(\"cardSec\");\n}", "function checkDomElements() {\n if (menu_open\n && menu_close\n && homepage\n ...
[ "0.7562872", "0.60153025", "0.587038", "0.58417493", "0.58417493", "0.574941", "0.56512296", "0.56467223", "0.56144047", "0.5605424", "0.5549909", "0.55440634", "0.55357105", "0.55155295", "0.5507183", "0.5499455", "0.54728055", "0.54724824", "0.543975", "0.5435715", "0.54190...
0.63687664
1
_Idea from_ _[lodash _.intersection]( Given two arrays, find the item(s) that are present in both. ``` `let a = ['A', 'B', 'Z'] let b = ['Z', 'X', 'Y'] intersection(a, b) _// => ['Z']_` ``` To get it working, don't worry about efficiency. Later we'll learn about specialized data structures that make this simpler/effici...
function intersection(a, b){ // This isn't efficent because it requires looping b multiple times // for a total runtime of O(n^2) // but it fits challenge of being a one-liner return(a.filter(x => b.includes(x))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function intersection(arr1, arr2) {\n return arr1.filter(x => arr2.includes(x));\n}", "function intersect(A, B){\n var result = [];\n for (i = 0; i < A.length; i++) {\n for (j = 0; j < B.length; j++) {\n if (A[i] === B[j] && $.inArray(A[i], result) === -1) {\n result.push(A[i]);\n break;...
[ "0.81247437", "0.81112266", "0.8062798", "0.80586624", "0.80568933", "0.8022188", "0.80089563", "0.79711336", "0.797036", "0.7959336", "0.7959336", "0.7950448", "0.7934996", "0.7934669", "0.7928712", "0.79169476", "0.79056644", "0.7883599", "0.7849042", "0.77789897", "0.77774...
0.82762694
0
this will increment all the neighbors mine count will also increment this mine's count but we don't care
function incrementNeigbours(cells, x, y) { x = parseInt(x); y = parseInt(y); for (var j = (x - 1); j <= (x + 1); j++) { if (typeof cells[j] !== 'undefined') { for (var k = (y - 1); k <= (y + 1); k++) { if (typeof cells[j][k] !== 'undefined' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "countMines() {\n if (this.mine) {\n this.neighborCount = 1;\n return;\n }\n \n var total = 0;\n for (var xoff = -1; xoff <= 1;xoff++ ) {\n var i = this.i + xoff;\n if (i < 0 || i >= this.cols) continue;\n \n for (var yoff = -1; yoff <= 1; yoff++) {\n var j = this.j + y...
[ "0.78891003", "0.7260803", "0.72099346", "0.7191002", "0.7046535", "0.69161916", "0.6862863", "0.68446165", "0.6778715", "0.67404383", "0.6739792", "0.6722817", "0.66609323", "0.6646398", "0.6624983", "0.6617806", "0.6602436", "0.6601429", "0.66011995", "0.65807253", "0.65631...
0.73914903
1
Constructor, create a weak map for saving current state
constructor() { this._state = new WeakMap(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n this.cachedDictionary = {};\n }", "constructor() {\n\n _data.set( this, new Map() );\n _validity.set( this, new Map() );\n\n // Immutable object.\n Object.freeze( this );\n }", "function LazyMap() {\n this.store = {};\n}", "function LazyMap() {\n this.store = {};\n}...
[ "0.68540996", "0.6658665", "0.66384155", "0.66384155", "0.66384155", "0.66384155", "0.66384155", "0.66384155", "0.66183996", "0.6598656", "0.6592859", "0.6569908", "0.6549252", "0.6520288", "0.6464921", "0.6464921", "0.64472896", "0.64472896", "0.6438056", "0.6361212", "0.636...
0.8430818
0
Constructor, takes in keys to listen
constructor(...keys) { this._state = new Map(); for (let key of keys) { this._state.set(key, { pressed: false, cooldown: 0, }); } // Event handlers this._onkeydown = (e) => { const key = e.code; if (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "init(){\n this.addEvents(this.keys);\n }", "constructor(key) {\n\t\tthis.key = key;\n\t\tthis.subscribers = [];\n\t}", "init() {\n var _this = this;\n\n window.addEventListener(\"keydown\", function(e) {\n _this.keys[e.key] = true;\n }, false);\n\n window.addEve...
[ "0.7350662", "0.6973095", "0.6652693", "0.65187323", "0.63681465", "0.6356451", "0.63540995", "0.6324626", "0.6267895", "0.62481105", "0.6230917", "0.622163", "0.6193628", "0.6131542", "0.61270255", "0.6111329", "0.6094414", "0.60886735", "0.6058485", "0.60215604", "0.6009179...
0.71572876
1
of [x,y] coordinates corresponding to locations of his customers. They walk to his truck, but he is fairminded so he wants to minimize total distance from truck to customers. City blocks are perfect squares, and every street is twoway, at perfect right angles. He only parks by street corners (coordinates like [37,16])....
function tacotruck(coords){ var minX = coords[0][0]; var maxX = coords[0][0]; var minY = coords[0][1]; var maxY = coords[0][1]; for(var i = 0; i < coords.length; i++){ if(minX > coords[i][0]){ minX = coords[i][0]; } if(minY > coords[i][1]){ minY = coor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closestStraightCity(c, x, y, q) {\n // Write your code here\n let result = [];\n\n for (let i = 0; i < c.length; i++) {\n let city = c[i];\n let x_coord = x[i];\n let y_coord = y[i];\n let x_dist = Math.max.apply(null, x);\n let nearest_x_idx = null;\n\n for (let j = 0; j < y.length; ...
[ "0.635846", "0.59751475", "0.59116894", "0.55999166", "0.550543", "0.55011773", "0.54673034", "0.54229426", "0.5421564", "0.5410019", "0.54098827", "0.5394434", "0.53812194", "0.53580797", "0.53546304", "0.5351831", "0.5350986", "0.5334121", "0.53318757", "0.5303612", "0.5281...
0.68135375
0
create data footer template
function renderDataFooterTemplate(){ getTemplateAjax('static-files/templates/data-footer.handlebars', function(template) { jqueryNoConflict('#data-footer').html(template()); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createFooter(footer) {\n footer.appendChild(footerTemplate.content);\n }", "function createFooter() {\r\n var foot = document.querySelector('tfoot');\r\n foot.innerHTML = '';\r\n newRow = addElement('tr', '', foot);\r\n addElement('th', 'Totals', newRow);\r\n for (var i = 0; i < times.length; i++) {\...
[ "0.7503313", "0.7107936", "0.70222026", "0.65315354", "0.65194345", "0.6489721", "0.6478833", "0.6453898", "0.64374834", "0.64362854", "0.6423752", "0.63829964", "0.6361119", "0.6353929", "0.6345489", "0.63013", "0.6290261", "0.62783307", "0.62670374", "0.6255379", "0.6253893...
0.72461176
1
Stand up a preview environment, including building and pushing the Docker image
async function provisionPreviewStack(owner: string, repo: string, prNumber: number, requester: string) { await octokit.issues.createComment({ owner, repo, number: prNumber, body: "Ok @" + requester + ", I am provisioning a preview stack" }); // start a build to build and push the Docker image, pl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _beginLivePreview() {\n LiveDevelopment.open();\n }", "function _configureLiveDev() {\n // Set up our transport and plug it into live-dev\n PostMessageTransport.setIframe(Browser.getBrowserIframe());\n LiveDevelopment.setTransport(PostMessageTransport);\n\n ...
[ "0.59707785", "0.58678913", "0.56260276", "0.54532266", "0.54061604", "0.5265558", "0.51830304", "0.518129", "0.5101971", "0.5092277", "0.5082065", "0.5062941", "0.5022536", "0.49975353", "0.4987117", "0.49749756", "0.49687696", "0.49442255", "0.49430907", "0.49246153", "0.49...
0.63079685
0
Retrieve notifications from GitHub and filter to those handled by this bot
async function retrieveNotifications() { console.log("Retrieving notifications: " + (new Date()).toISOString()); try { // Retrieve latest unread notifications const since = new Date(); since.setHours(since.getHours() - 1); // last hour let client = octokit; if (lastModifiedHeader) { clie...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function handleNotification(notification: octokitlib.ActivityListNotificationsResponseItem) {\n // Mark the notification as read\n await octokit.activity.markThreadAsRead({\n thread_id: parseInt(notification.id, 10)\n });\n\n // Validate the notification\n if (notification.reason != 'mention') {\n ...
[ "0.6587729", "0.64947116", "0.63463867", "0.62651503", "0.619315", "0.61868334", "0.6096792", "0.60928845", "0.5913148", "0.58749974", "0.5858113", "0.57063353", "0.57023674", "0.5669808", "0.5669808", "0.55960166", "0.55914855", "0.5582081", "0.5577932", "0.54845285", "0.546...
0.71678215
0
return 0 if actions equals
function compareAction(action1, action2) { if(action1 !== undefined && action2 !== undefined) { switch(action1.browserAction) { case window.gotourl_browseraction: if( action1.browserAction === window.gotourl_browseraction && action1.url ===...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function currentCount(state=0, action){\n if(action.type === \"INCREASE_COUNTER\"){\n return state + 1;\n \n }\n //or minus one depending on the action//\n if(action.type === \"DECREASE_COUNTER\"){\n \n }\n return state -1;\n}", "_isActiveAction( action ) {\n\n\t\tconst index = action._cacheIndex;...
[ "0.60821944", "0.58590245", "0.58590245", "0.5838392", "0.5808505", "0.5774091", "0.5772125", "0.5762623", "0.5757364", "0.5753859", "0.57531667", "0.5621337", "0.5610011", "0.55632126", "0.5554992", "0.5471446", "0.54669356", "0.5448969", "0.54453987", "0.54235715", "0.54007...
0.59676665
1
Return all input tags of types password and text.
function getTags() { var filtered = new Array(), tagList = document.getElementsByTagName('input'); for (var i = 0, l = tagList.length, tag = null; i<l; i++) { tag = tagList[i]; // we're only interested in these two types if (tag.type == "password" || tag.type == "text") { filtered.push(tag);...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function identifyPasswordFields() {\n\t\t//identify user/password pairs\n\t\tuserPasswordPairs = [];\n\t\tlonelyPasswords = [];\n\t\tpriorityPair = null;\n\t\tvar inputPattern = \"input[type='text'], input[type='email'], input[type='password'], input:not([type])\";\n\t\tvar inputList = Array.from(document.getEleme...
[ "0.6006952", "0.5817055", "0.5688751", "0.5670882", "0.5669783", "0.56215584", "0.55802166", "0.5550428", "0.55065197", "0.5486234", "0.5392639", "0.5233261", "0.51953816", "0.518942", "0.51663804", "0.5158271", "0.5153266", "0.51449716", "0.51204085", "0.51139057", "0.510959...
0.7702375
0
Display hostname in title bar with or without subdomains. Look for the domain name in the title first and try to append the toplevel domain. If that's not possible, simply add the hostname at the end of the title.
function setTitle() { var sHostName = window.location.href; var escChar = "\\"; var sCache = /(\/search?\?q=cache:|\/cache\.aspx\?q=|gigablast\.com\/get\?q=|web\.archive\.org\/web\/)/i; if (sHostName.search(sCache) != -1) { // stop script execution return; } sHostName = window.location.hos...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fixTitle() {\r\n window.document.title = window.document.title.replace(/[^-]* - [^-]* - /, \"\") + \" - Safari Online\";\r\n}", "function get_site_name(page_title){\r\n\tif (page_title.indexOf('http://www.')!=-1){\r\n\t\tvar site_start = page_title.indexOf('http://www.')+11;\r\n\t} else {\r\n\t\tvar si...
[ "0.6165333", "0.6016864", "0.5920231", "0.58868784", "0.5759752", "0.5756895", "0.57440704", "0.57018864", "0.5674899", "0.5630437", "0.5626247", "0.5622977", "0.5564617", "0.55616397", "0.55588543", "0.5525782", "0.5495686", "0.54949313", "0.5485058", "0.5473109", "0.5472958...
0.7232964
0
Return sub, second, and toplevel domain of an address. url ...... hostname or complete, valid URL ignSub ... [default: false] if true, subdomains will be ignored
function getDomainName(url, ignSub) { var tld = "", labels = null, result = ""; if (ignSub === undefined) { ignSub = false; } url = prepURL(url); tld = getTLD(url); url = url.slice(0, url.length - tld.length); if (ignSub) { labels = getSubDomains(url); if (labels != null) { if (la...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extractDomain(url){\n var psl = torpedo.publicSuffixList.getDomain(url);\n // psl empty -> url is already a valid domain\n return psl != \"\"? psl : url;\n}", "function getDomain(url) {\r\n anchor.href = url;\r\n var host = anchor.hostname;\r\n var labels = host.split('.');\r\n return {\r\n na...
[ "0.6784474", "0.66911745", "0.65574086", "0.64501953", "0.6318832", "0.62652373", "0.6203698", "0.61916065", "0.6150868", "0.6117631", "0.61081505", "0.60494584", "0.6017192", "0.5971342", "0.5926641", "0.588248", "0.58579576", "0.58507264", "0.58383906", "0.583015", "0.58291...
0.68390924
0
Return all subdomains in an array. Make sure, toplevel and secondlevel domains are stripped before using this function. DOESN'T check for valid subdomains.
function getSubDomains(url) { if (url == null || url.length == 0) { return null; } var labels = prepURL(url).split("."); return labels; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function subdomains(hostame) {\n (hostname || location.hostname).split(/\\./).map(function (e, i, arr) {\n return arr.slice(i).join('.');\n }).reverse();\n}", "function getRelaxedDomain(domain, level){\n\tvar relaxeddomain = domain;\n\tfor (i=0; i<level; i++){\n\t\tvar liBehindFirstDot = relaxeddoma...
[ "0.6888775", "0.553698", "0.5524424", "0.5217492", "0.5133559", "0.51178914", "0.51163286", "0.4976744", "0.49428374", "0.49063835", "0.49056047", "0.49052382", "0.49052382", "0.49052382", "0.49052382", "0.49052382", "0.49052382", "0.49052382", "0.49052382", "0.49052382", "0....
0.62455606
1
reset the grid and ask for a new size
function resetGrid() { // remove the old grid const cells = Array.from(grid.childNodes); for(let i = 0; i < cells.length; i++) grid.removeChild(cells[i]); // get the new size let size = 0; while(size < 2 || size > 100 || isNaN(size)) { size = prompt("Enter a new grid size betwee...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateGrid(){\n //num = prompt(\"enter new grid dimensions\");\n clearGrid();\n newSizeGrid(num);\n}", "function resizeGrid() {\n do {\n size = prompt(\"Enter a number from 1-125\");\n if (size === null || isNaN(size)) {\n return;\n }\n } while (size > 125);\n container.innerHT...
[ "0.78789353", "0.75436765", "0.7510481", "0.7481729", "0.7419408", "0.728575", "0.72656476", "0.72238123", "0.7093422", "0.7069836", "0.70399344", "0.70333546", "0.69920164", "0.69085664", "0.68624693", "0.6849736", "0.68436056", "0.6841834", "0.67809117", "0.6768736", "0.675...
0.7745487
1
Gets Clients from API using Get Request
function getClients(){ http.get(serverAddy + '/api/oec/') .then(data => ui.showClients(data)) .catch(err => console.log(err)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getUserList() {\n\n // Connection properties\n var options = {\n method: 'GET',\n uri: conf.API_PATH + `5808862710000087232b75ac`,\n json: true\n };\n\n return (await request(options)).clients;\n}", "function getAllClients() {\n return clients;\n }", "async f...
[ "0.71877116", "0.7167759", "0.7076705", "0.7047714", "0.69401836", "0.69337994", "0.6900862", "0.6848483", "0.6625663", "0.64881605", "0.6479654", "0.6429183", "0.639241", "0.63681114", "0.62595916", "0.6253762", "0.622549", "0.6211959", "0.6208244", "0.62041146", "0.6166459"...
0.7728044
0
Returns the combined value of several elements that have the same name e.g. radio buttons or groups of checkboxes
function getMultiElementValue(elements) { var types = (0, _uniq.default)(elements.map(function (element) { return element.type; })); if (types.length !== 1) { throw new Error('Multiple form elements with the same name must be of the same type'); } switch (types[0]) { case 'radio': { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getValueFromRadioButton(name) {\n\treturn [...document.getElementsByName('type')]\n\t\t.reduce((rez, btn) => (btn.checked ? btn.value : rez), null)\n}", "getCheckedValues() {\n var checkedValues = $('input[name=' + this.props.inputProps.name + ']:checked').map(function (index, domElement) {\n ...
[ "0.6665301", "0.6507937", "0.62659", "0.62200326", "0.61738", "0.61620307", "0.6099858", "0.6071297", "0.60669804", "0.60623246", "0.60082215", "0.6006991", "0.5986838", "0.5947815", "0.59203225", "0.5915287", "0.58905536", "0.58759356", "0.58595693", "0.5817971", "0.58160025...
0.68844575
1
Marker Test, HardCoded Location untiil BackEnd gets back with help to convert To json
function markerTest() { $.getJSON("http://localhost:9000" + "/getTowers", function (marker){ $.each(marker,function(i, mark) { var iconBase = 'https://maps.google.com/mapfiles/kml/shapes/'; var addmark = new google.maps.Marker({ position: loadpos = { lat: mark.l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MakeMap() {\n // map = new google.maps.Map(document.getElementById('map'), {\n // center: {lat: parseInt(globalLat), lng: parseInt(globalLng)}, //lat: 41.4931, lng: -81.6790\n // zoom: 11,\n // scrollwheel: false\n // });\n console.log(mapURL);\n ma...
[ "0.6169034", "0.60439837", "0.6038644", "0.60286194", "0.6017226", "0.59911907", "0.5983225", "0.59334373", "0.592581", "0.5903197", "0.5902415", "0.58789885", "0.5862133", "0.58527344", "0.58432955", "0.5816788", "0.5806542", "0.5790256", "0.57779086", "0.57676756", "0.57493...
0.63372886
0
Api returns three of the columns with numbers as html so need to parse them. ex: 1277
getYerlesenNumber(html) { return html.match(/\>[0-9]{1,3}|(---)?<\/font></)[1] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function grabData(xx,yy,ii,jj){\r\n\treturn parseInt(getCell(xx,yy,ii,jj).innerHTML.slice(0,getCell(xx,yy,ii,jj).innerHTML.indexOf(\" \")).replace(/,/g, \"\"));\r\n}", "function getDataFromField (str, column) {\n switch (column) {\n case \"ects\":\n case \"course\":\n return Number(str.replac...
[ "0.5880323", "0.56888384", "0.5621151", "0.5603774", "0.559024", "0.5510266", "0.5441766", "0.54046816", "0.5389269", "0.53468245", "0.53283477", "0.53210884", "0.5313076", "0.5282707", "0.52799344", "0.5246811", "0.5219788", "0.5213237", "0.5211211", "0.5185292", "0.51850754...
0.5921522
0
Interface object for driver instances. Should be used with assert.implements to check if an objects implements all required methods.
function DriverInterface() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(){\n\t\tif (new.target === Observer) {\n\t\t\tthrow new TypeError(\"Cannot construct Interface Classes\");\n\t\t}\n\t}", "function IPrinter() {\r\n\t\tthrow 'Interfaces shouldn`t be instanciated';\r\n\t}", "getDriver(): Driver {\n return this.constructor.driver;\n }", "function IClass()...
[ "0.5710796", "0.57097787", "0.56066084", "0.5527883", "0.54653007", "0.5438852", "0.52851194", "0.52437633", "0.521272", "0.5200859", "0.51885694", "0.50977606", "0.5085782", "0.5078373", "0.50554025", "0.50420755", "0.50291413", "0.49989343", "0.49526396", "0.4951567", "0.49...
0.77801424
0
select pagination number by the index
function selectPaginationNumber(index) { if(nav != undefined) { nav.children('a').removeClass(options.navStyle+'-selected'); if(options.navigation == 'pagination') { nav.children('.fg-pagination-number').eq(index).addClass(options.navStyle+'-selected'); } else if(options.navigation == '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "pageIndex(itemIndex) {\n return this.pages.findIndex(page =>\n page.element.find(element => element.originalIndex === itemIndex)\n )\n }", "pageIndex(itemIndex) {\n if (itemIndex < 0 || this.itemCount() - 1 < itemIndex) return -1;\n return Math.floor(itemIndex / this.ipp);\n }", "function ge...
[ "0.71042633", "0.7102907", "0.6883977", "0.6537098", "0.642624", "0.64255327", "0.6410006", "0.64068973", "0.6390142", "0.6365117", "0.63327664", "0.63248587", "0.6309681", "0.6279848", "0.6271946", "0.6260302", "0.62558806", "0.6247101", "0.6229716", "0.6207034", "0.6195975"...
0.7258054
0
NSGetModule: Return the nsIModule object.
function NSGetModule(compMgr, fileSpec) { return module; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function NSGetModule(compMgr, fileSpec) {\n return Module;\n}", "function NSGetModule(comMgr, fileSpec)\n{\n return myAppHandlerModule;\n}", "function NSGetModule(aCompMgr, aFileSpec) \r\n{\r\n\treturn FoxMeterServiceModule;\r\n}", "function NSGetModule(compMgr, fileSpec) {\n return XPCOMUtils.generateMod...
[ "0.7548328", "0.7201062", "0.70388234", "0.69933856", "0.68307495", "0.64422905", "0.64048", "0.5976554", "0.5974347", "0.59607726", "0.5625714", "0.5566324", "0.55663115", "0.5560565", "0.5479672", "0.545579", "0.54507154", "0.5396401", "0.5396401", "0.5396401", "0.5396401",...
0.7553505
0
Observer for the vm.signedIn (boolean) status
function watchForInactivity() { $scope.$watch(function() {return vm.signedIn; }, function(curVal, preVal) { if (curVal === true) { Idle.watch(); closeModals(); watchIdleEvents(); } else { Idle.un...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function authStateObserver(user) {\n if (user) { // User is signed in\n console.log(\"User signed in\");\n } else { // User is signed out\n window.open('../index.html', \"_self\");\n }\n }", "function updateSigninStatus(isSignedIn) {\n console.log('Updating signin status, is user signed in: ...
[ "0.7011246", "0.6759676", "0.6742815", "0.6718584", "0.6701462", "0.6678564", "0.6646033", "0.6644985", "0.66258174", "0.6624862", "0.6622795", "0.65409553", "0.64929277", "0.6471098", "0.6469093", "0.646327", "0.64598536", "0.64392513", "0.6421527", "0.64099807", "0.6403418"...
0.6859355
1
closeModals Watch idle events for start, end, and timeout
function watchIdleEvents() { $scope.$on('IdleStart', function() { closeModals(); vm.warning = $uibModal.open({ templateUrl: 'warning-dialog.html', windowClass: 'modal-danger' }); }); //IdleStart ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeModals() {\n if ($scope.warning) {\n $scope.warning.close();\n $scope.warning = null;\n }\n if ($scope.timedout) {\n $scope.timedout.close();\n $scope.timedout = null;\n }\n }", "function closeModals($scope) {\n if ($scope.warning) {\n $s...
[ "0.6183386", "0.5934321", "0.567483", "0.567483", "0.5668156", "0.5580985", "0.5523037", "0.5481733", "0.5480779", "0.5434629", "0.54112965", "0.5386332", "0.5386332", "0.53855383", "0.5368568", "0.53411067", "0.53008884", "0.5292846", "0.5288494", "0.5288494", "0.5288494", ...
0.66235197
0
watch current state name
function watchStateName() { $scope.$watch(function() {return vm.currrentState.current.name;}, function(newVal, oldVal) { if (newVal !== oldVal) { // console.log('current state name: ' + vm.currrentState.current.name); } }, true)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateName(state, name) {\r\n state.name = name;\r\n }", "getStateName() {\n return this.currentStateName;\n }", "setName(state, name) {\n state.name = name\n }", "function nameChanged() {\n\t\t\tconsole.log(self.name);\n\t\t}", "stateChange(state){\n\t\tLogger.info(`Ably realtime...
[ "0.7140506", "0.6685617", "0.6685378", "0.6621329", "0.6575067", "0.6460301", "0.641829", "0.6318947", "0.6280598", "0.6242439", "0.62250316", "0.61986125", "0.61949337", "0.616084", "0.6137987", "0.6136907", "0.612583", "0.61177343", "0.6108077", "0.60736746", "0.60521424", ...
0.83775496
0
Adds helper classes on the form inputs
function formStyleHelperClasses() { $('.form-style').attr('placeholder', ''); $('.form-style').focus(function() { $(this).closest('.form-group').addClass('is-focused'); }).blur(function() { $(this).closest('.form-group').removeClass('is-focused'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "inputClass () {\n let klass = ''\n\n if (this.state.focus) {\n klass += ' usa-input-focus'\n }\n\n if (this.state.valid) {\n klass += ' usa-input-success'\n }\n\n if (this.state.checked) {\n klass += ' selected'\n }\n\n return klass.trim()\n }", "function updateClasses() {...
[ "0.6986835", "0.64653885", "0.6448802", "0.6448802", "0.6438505", "0.6363489", "0.6316506", "0.62318003", "0.6074974", "0.60481983", "0.6038387", "0.6004796", "0.5979012", "0.5967655", "0.5886024", "0.58693284", "0.5835048", "0.5745844", "0.56580293", "0.5648259", "0.5592261"...
0.693254
1
Widget Slider Recent Posts
function widgetSliderRecentPosts() { var WSRP = $('.slider-recent-posts'); if (WSRP[0]) { var widgetSliderRP = new Swiper('.slider-recent-posts', { loop: true, navigation: { nextEl: '.swiper-button-next', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function relatedPostsWidget(a){(function(e){var f={blogURL:\"\",maxPosts:5,maxTags:5,maxPostsPerTag:5,containerSelector:\"#related_posts\",tags:null,loadingText:\"\",loadingClass:\"loadingxx\",relevantTip:\"\",rlt_summary:100,relatedTitle:\"Related Posts\",readMoretext:\"[...]\",rlpBlank:\"http://1.bp.blogspot.com...
[ "0.67488164", "0.6702406", "0.6482511", "0.64705104", "0.61798114", "0.6075474", "0.5965694", "0.5961188", "0.5906462", "0.589643", "0.5886976", "0.5864642", "0.5850248", "0.58304775", "0.5829689", "0.58014786", "0.5799252", "0.5795673", "0.5766958", "0.5766013", "0.5707839",...
0.8103137
0
Function that returns specific Dialogues and set specific flows for administrators
function getAdminDialogues(input, senderId) { const FbAPIClass = require('./botTools').FacebookAPI; const FacebookAPI = new FbAPIClass(senderId); const delayActivationRegex = /activate message delay/i; const delayDeactivationRegex = /deactivate message delay/i; const flowResetRegex = /roo masters 101/i; AP...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function managerActions() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"rawlist\",\n message: \"What would you like to do?\",\n choices: [\n \"View Products For Sale\",\n \"View Low Inventory\",\n \"Add To Inventory\",\n \"Add New Product\",\n \"Q...
[ "0.58098716", "0.57480836", "0.56691337", "0.56063354", "0.5563731", "0.55089897", "0.5495138", "0.547432", "0.544555", "0.54176825", "0.5389877", "0.5321978", "0.5302124", "0.5280975", "0.5267439", "0.52642655", "0.52434605", "0.5240855", "0.5236909", "0.5223445", "0.5213460...
0.6708118
0
scales a specific icon to a given value by scaling it and adjusting its center
function scaleIcon(icon, value) { var icon_bbox = icon.node().getBBox(); var icon_x = icon_bbox.x; var icon_y = icon_bbox.y; var icon_scaling_factor = value; icon.attr('transform', 'translate('+(1 - icon_scaling_factor) * (icon_x+50)+', '+(1 - icon_scaling_factor) * (icon_y+50)+') scale('+icon_scaling_factor+...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scaleTheIcon() {\n $(this)\n .addClass(\"scale-it\")\n .one(endAnimation, function() {\n $(this).removeClass(\"scale-it\");\n });\n }", "function upScaleLabel(i){\n\tvar currentScale = $(\"#size_group_\" + i).attr(\"size_scale\");\n\tvar currentX = $(\"#size_group_\" + i).attr(...
[ "0.67011356", "0.629016", "0.62807935", "0.6176975", "0.6079884", "0.6043181", "0.6041697", "0.6036407", "0.59807205", "0.5968248", "0.5931744", "0.59263307", "0.583644", "0.58279324", "0.58109796", "0.58048594", "0.57975537", "0.5785928", "0.57427573", "0.5736231", "0.572902...
0.80968094
0
updates all virusicons according to a given week
function update_virusicons(week_text) { setVirusIconScaleByCases(week_text, "Bayern", bayern_virus); setVirusIconScaleByCases(week_text, "Baden-Wurttemberg", baden_virus); setVirusIconScaleByCases(week_text, "Nordrhein-Westfalen", nrw_virus); setVirusIconScaleByCases(week_text, "Hessen", hessen_virus); s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateElectricInputWeek($scope,http,device) {\n // Dates:\n var nowDate = new Date();\n var weekBeginDate = new Date(nowDate.getFullYear(),nowDate.getMonth(),\n nowDate.getDate()-nowDate.getDay());\n // seconds:\n var nowSeconds = Math.round(nowDa...
[ "0.6255728", "0.60645163", "0.59318167", "0.581732", "0.5771119", "0.564468", "0.5622411", "0.5585945", "0.5534333", "0.54974633", "0.54779696", "0.5443735", "0.54421365", "0.54344493", "0.54344493", "0.5433828", "0.5432576", "0.5418445", "0.5415243", "0.54016334", "0.5399148...
0.7069466
0
This function is called per region to resize the virus icon according to the currentdate selected by the slider. The currentdate is reformatted to fit the format in the data. Then it is searched for an element that matches the given region and date and if existing, the 14daycase rate is retrieved and used to scale the ...
function setVirusIconScaleByCases(currentDate, region, icon){ germanyData.forEach(element => { if(currentDate != null){ //reformat date of slider to match format in data var newDateFormat = currentDate.toString().substring(6,10)+"-"+currentDate.toString().charAt(1)+currentDate.toString().substring(3,5); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_virusicons(week_text) {\n setVirusIconScaleByCases(week_text, \"Bayern\", bayern_virus);\n setVirusIconScaleByCases(week_text, \"Baden-Wurttemberg\", baden_virus);\n setVirusIconScaleByCases(week_text, \"Nordrhein-Westfalen\", nrw_virus);\n setVirusIconScaleByCases(week_text, \"Hessen\", he...
[ "0.5839745", "0.53542817", "0.52853143", "0.52547425", "0.5237781", "0.5178119", "0.508066", "0.5048784", "0.50486106", "0.5016585", "0.5006373", "0.49967813", "0.49641666", "0.4927581", "0.49099344", "0.48893246", "0.48741862", "0.48594594", "0.48342025", "0.48267102", "0.48...
0.7788142
0
updates the virus values per region that are displayed in the popup according to a given value that is rounded to two decimals
function updateVirusValue(region, value){ switch(region){ case "Bayern": bayern_virus_value = Math.round((value + Number.EPSILON) * 100) / 100; break; case "Baden-Wurttemberg": baden_virus_value = Math.round((value + Number.EPSILON) * 100) / 100; break; case "Nordrhein-Westfalen": nrw_virus_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateradius1() {\n\n newradius = Number(document.getElementById(\"twok\").value);\n zoomlevel = Number(13); \n}", "function updateVolumeSliderDisplay(value) {\n\t// roundown to nearest 10 becasue we have 10 assets in the sprite.\n\trValue = Math.round(value / 10) * 10;\n\t$(\"#volume .level\").cs...
[ "0.60228705", "0.60006005", "0.5999367", "0.5845891", "0.577653", "0.5771775", "0.5719514", "0.5693207", "0.5681001", "0.5673283", "0.5668735", "0.56485635", "0.5647539", "0.5640096", "0.56343085", "0.561877", "0.5590924", "0.55908287", "0.5559023", "0.55383945", "0.5536022",...
0.77283514
0