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
CONCATENATED MODULE: ./src/init/timePickerInput.ts Create a new time picker and render in a modal each time an input is focused
function timePickerInput_create(input) { if (!input || !(input.inputElement instanceof HTMLInputElement)) { throw new Error("The inputElement must be a html input element"); } var modal = null; var el = input.inputElement; var displayModal = function () { modal = timePickerModal_crea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timePickerModal_create(input) {\n var _input = parseInputs(input);\n var context = new di_DiContext(_input.config);\n var timePicker = publicTimePicker(context);\n var modal = createModal(timePicker.element);\n modal.onClickOrEsc(function () { return timePicker.cancel(); });\n timePicker...
[ "0.8213872", "0.77182627", "0.74911606", "0.74586403", "0.7295399", "0.7262352", "0.7180971", "0.7093143", "0.70480096", "0.70352304", "0.7021585", "0.7014886", "0.68765074", "0.6858289", "0.6737631", "0.66851866", "0.650647", "0.6446688", "0.6446688", "0.6446688", "0.6446688...
0.82588613
0
Delete from firebase DB
function favoriteDelete(key) { // Delete object from firebase let favoriteDBRef = favoritesDBRef.child(key); favoriteDBRef.remove(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "delete () {\n db.ref('messages').remove()\n }", "travelDelete(key){\n\t\t\tfirebase.database().ref('travels/' + key).remove();\n\t}", "function deleteData() {\n\n var kodePengiriman = document.getElementById(\"kodePengiriman\").textContent;\n\n var database = firebase.database();\n var dbRef = dat...
[ "0.7679588", "0.7518946", "0.7517587", "0.73793507", "0.73530924", "0.73331034", "0.71978205", "0.71415967", "0.7116838", "0.71129173", "0.7092916", "0.702881", "0.70211184", "0.70191544", "0.69943804", "0.6989291", "0.69564825", "0.6938979", "0.69349104", "0.6890291", "0.687...
0.76757133
1
remove a favorite from the array based on key
function arrayItemRemove(favorites, index) { let removed = favorites.splice(index, 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeFavorite(state, value) {\n\t\t\tconst favoriteHero = JSON.parse(JSON.stringify(state.favorites))\n\t\t\tfavoriteHero.forEach( (element, index) => {\n\t\t\t\tif (element.id == value) favoriteHero.splice(index, 1)\n\t\t\t});\n\t\t\tstate.favorites = favoriteHero\n\t\t}", "removeFromFavorite(state, item) {\n ...
[ "0.7654723", "0.7005246", "0.7004438", "0.6931206", "0.6789689", "0.6749847", "0.6668772", "0.6651199", "0.6613024", "0.6607505", "0.64869964", "0.64709294", "0.64592916", "0.6301522", "0.6299423", "0.6273969", "0.6257098", "0.62455773", "0.62355334", "0.6228833", "0.62267244...
0.71852905
1
Check all Fields for ADD are completed (in progress______________________________)
function checkAllFieldsInserted(){ createOrder(); // console.log($("#AddModal:input").val()); // var empty = ""; // if ($("#AddModal :input") !== "" && $("#AddModal :input").val() === 0){ // createClient(); // } else { // $.notify("You must complete all fields to Add the Client!","wa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkAllFields(){\n\t\t// run check on all fields till find error\n\t\tvar len=this.olist.length;\n\t\tfor(var i=0;i<len;i++){\n\t\t\tvar o=this.olist[i];\n\n\t\t\t// present only error for first field we run into\n\t\t\tif(!this.test_field(o)){return false;break;}\n\n\t\t}\n\n\t\treturn true;\t\n\t\t\n\t}", "fu...
[ "0.6534625", "0.6239046", "0.62198746", "0.6061466", "0.5867728", "0.58530414", "0.5793548", "0.57546365", "0.5670132", "0.5669806", "0.5646419", "0.5618283", "0.5606226", "0.5605926", "0.56033504", "0.55839807", "0.55658805", "0.5546789", "0.5500962", "0.5491966", "0.5486771...
0.6648246
0
Load info of the Client DNI taken from autocomplete
function getClientDetails(){ var dni = $("#dni").val(); $.ajax({ url: 'https://tfg-sergi-daw-neosmith.c9users.io/clientDetByDni/'+dni, type: 'GET', success: function(result){ $( '<div class="form-group" id="clientInfo"></div>' ).insertAfter( "#buttonLoadDniData...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showInfoClient() {\n let index = $('select[id=selectRFC2]').val();\n //console.log($('select[id=selectRFC2] option:selected').text());\n //console.log('showInfoClient', response[index]);\n $('#txtName').val(response[index].client_name);\n $('#txtAddress').val(response[index].client_address)...
[ "0.5863267", "0.5559697", "0.55315167", "0.5463505", "0.5347177", "0.5339027", "0.5306123", "0.5295514", "0.5276179", "0.5260577", "0.52535707", "0.5237876", "0.5187142", "0.5176943", "0.5170859", "0.51609945", "0.515865", "0.5154771", "0.5115373", "0.5109532", "0.5102925", ...
0.5870282
0
1 Liste os clientes ordenados pelo maior valor total em compras
function totalValue() { const p1 = document.querySelector('.p1'); // Pegar conteúdo da requisição const client = requestClients.response; const historic = requestHistoric.response; var obj = [{ name: '', value: '' }]; obj.pop(); for (let i = 0; i < client.length; i++) { var total = 0; var c = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cantidadComentariosTotal() {\r\n return ListaComentarios.length;\r\n}", "function buscadatosCliente(codigoCliente) {\n\tvar datoscliente = new Array();\n\tfor(var j = 0; j < listaclientes.length; j++) {\n\t\tvar tmpcliente = listaclientes[j].split(\"|\");\n\t\tif(tmpcliente[0] == codigoCliente) {\n\t...
[ "0.66457397", "0.6126919", "0.6077299", "0.5987803", "0.59670335", "0.59123975", "0.578821", "0.576887", "0.57571447", "0.57434636", "0.57290584", "0.57193005", "0.57160914", "0.57057214", "0.5698962", "0.56798875", "0.5669748", "0.56297725", "0.55968165", "0.55916816", "0.55...
0.6767656
0
Retorna todos os vinhos do cliente
function getWines(client) { // Pegar conteúdo da requisição const historic = requestHistoric.response; var wine = []; for (let i = 0; i < historic.length; i++) { // Compara os últimos caracteres do CPF do cliente e do histórico const last = historic[i].cliente.length - 1; if (client.cpf[13] == his...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getLista() {\n // retorno la lista de clientes conectados excepto los que no tienen nombre \n return this.lista.filter(cliente => cliente.nombre !== 'sin-nombre'); // la lista es privada , la accedo desde un metodo publico \n }", "async index(req, res) {\n const clientes = await Cliente.findA...
[ "0.64890915", "0.6082921", "0.6042738", "0.6030942", "0.6003883", "0.5954799", "0.59436446", "0.593407", "0.5927286", "0.5924739", "0.5887305", "0.58663714", "0.5859612", "0.584778", "0.582379", "0.58200604", "0.5818811", "0.5805972", "0.5772739", "0.5762124", "0.5757171", ...
0.6321353
1
end of map overlay get the arcgeometries...2nd version using feature_objects
function getArcs_V2(topology, featureObjects_, simplify_){ var col_arcs_ = {}; featureObjects_.forEach(function(featureObj_){ var arcs = featureObj_.getArcsPure(); readArcs(arcs); function readArcs(arcs_){ arcs_.forEach(function(arc){ var arc_id = arc; var sign = 1; if(arc_id<0){arc_id= (arc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getArcsOfNeighbores(features, col_arcs_){\n\tvar members = [];\n\tvar feat_members = features.map(function(feature){\n\t\t//clear the members array\n\t\tmembers = members.slice(members.length);\n\t\tif(feature.arcs!=undefined)var cache = feature.arcs;\n\t\telse if (feature.geometry!=undefined)var cache = ...
[ "0.6616345", "0.6586396", "0.6353618", "0.6168911", "0.60051", "0.5844325", "0.58020985", "0.5790909", "0.5779124", "0.5747069", "0.57361907", "0.5722604", "0.5715095", "0.568617", "0.5670921", "0.56699526", "0.5656236", "0.5642171", "0.56173444", "0.55969626", "0.5596912", ...
0.6862534
0
end of get the arcgeometries build geometries from arcgeometries...2nd versionusing feature_objects
function getGeometries_V2(featObjs, col_arcs_){ var polygons = [], members = []; featObjs.forEach(function(d){ if(d.type==='Polygon'){ members = []; var a = readPolygon2({arcs:d.geometry}, d.id); polygons.push({type:'Polygon', coordinates: a, id:d.id, clipped:d.clipped, properties: d.properties, neighbors...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getArcs_V2(topology, featureObjects_, simplify_){\n\tvar col_arcs_ = {};\t\n\tfeatureObjects_.forEach(function(featureObj_){\n\t\tvar arcs = featureObj_.getArcsPure();\n\t\treadArcs(arcs);\n\t\t\n\t\tfunction readArcs(arcs_){\n\t\t\tarcs_.forEach(function(arc){\n\t\t\t\tvar arc_id = arc;\n\t\t\t\tvar sign...
[ "0.7289933", "0.6989799", "0.69792676", "0.6570706", "0.64404106", "0.63298005", "0.61590964", "0.61171126", "0.6094016", "0.60713804", "0.6065704", "0.60547453", "0.60237855", "0.6023264", "0.59849304", "0.5892417", "0.58667564", "0.58430105", "0.5809926", "0.57949895", "0.5...
0.713372
1
object for removed features
function remFeatures(removeCandidate, id_origin_){ this.id=removeCandidate.id; this.id_origin=id_origin_; //this is the id of the feature, where this was aggregated to //this.index=index_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteFeature() {}", "function removeFeatures() {\n // query for the features you want to remove\n featureLayer.queryFeatures().then(function (results) {\n // edits object tells apply edits that you want to delete the features\n const deleteEdits = {\n...
[ "0.7747367", "0.70671695", "0.69292074", "0.68801", "0.6817052", "0.6668999", "0.6619889", "0.6592559", "0.6398552", "0.6387233", "0.6387233", "0.6360707", "0.6243075", "0.6214145", "0.618776", "0.6181729", "0.6142859", "0.6061078", "0.6029832", "0.60282636", "0.6022807", "...
0.7197307
1
Objectdefinition FeatureObject ... contains all necessary functions and variables of one feature: Type, ID, PROPERTIES, GEOMETRY, getArcsPure(), getGeometry(), getNeighbors()
function featureObj(feature_){ //this.feature = feature_; this.type = feature_.type; this.id = feature_.id; this.properties = feature_.properties; this.geometry = feature_.arcs; this.clipped = false; //check if geometry has holes this.has_hole = false; if(this.type=='Polygon'){ if (this.geometry.length==2)th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createPreviewFeature() {\n this.previewFeature = new Feature();\n this.previewFeature.enableEvents();\n this.previewFeature.setId(this.tempFeatureId);\n this.previewFeature.set(RecordField.DRAWING_LAYER_NODE, false);\n\n var name = /** @type {string|undefined} */ (this.options['name']);\n if (nam...
[ "0.6314639", "0.6280055", "0.6266208", "0.6266101", "0.6264889", "0.6264889", "0.613184", "0.6127586", "0.6127586", "0.6127586", "0.60548496", "0.604292", "0.601306", "0.59980553", "0.59560174", "0.5955625", "0.5950942", "0.59152734", "0.5898091", "0.5896974", "0.58696103", ...
0.74918294
0
get the length of a polygon only from the lengths of each arcs, which it is consists of
function getPolyLengthFromArcs(arcs_, arcCollection_){ //console.log(arcs_) var length_ = 0; for (var i=0; i<arcs_.length; i++){ var arc_id = arcs_[i]; if(arc_id<0)arc_id=(arc_id*(-1))-1; length_ = length_ + arcCollection_[arc_id].length; } return length_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPolylineLength(vertices){\r\n var distance = 0.0; \r\n for(i = 0; i < vertices.length - 2; i += 2){\r\n distance += getDistance(vertices[i], vertices[i + 1], vertices[i + 2], vertices[i + 3]);\r\n }\r\n return distance;\r\n }", "function length(ax, ay, az) {\n return Math.sqrt...
[ "0.6927301", "0.6870008", "0.6718082", "0.6591416", "0.65628207", "0.65493155", "0.6426261", "0.6426027", "0.6262081", "0.62490195", "0.61411977", "0.6126967", "0.60761034", "0.6060798", "0.6021367", "0.60114324", "0.5964657", "0.5963587", "0.5957722", "0.59475935", "0.593947...
0.77252173
0
get Length of a linestring [[coordsX1,coordsY1],...,[coordsXn,coordsYn]]
function getLineLength(coords){ var length = 0; //coords.forEach(function(d){ for (var i=1;i<coords.length;i++){ var a = coords[i-1], b = coords[i], dX = a[0]+b[0], dY = a[1]+b[1]; length = length + Math.sqrt(Math.pow(dX,2)+Math.pow(dY,2)); } return length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLength () {\n var length = 0;\n for (var i = 0, l = lines.length; i < l; i++) {\n length += lines[i].length;\n }\n return length + lines.length - 1; // include '\\n's\n }", "function getLength () {\n var length = 0;\n for (var i = 0, l = lines.length; i < l; i+...
[ "0.6899469", "0.6899469", "0.6638875", "0.64619684", "0.610109", "0.609965", "0.60206777", "0.5875361", "0.5843917", "0.5840308", "0.5839788", "0.58117485", "0.58035624", "0.57891697", "0.57471025", "0.57458377", "0.5744766", "0.57312566", "0.572328", "0.5718904", "0.5718904"...
0.7679488
0
replace all german umlaute within a given string
function replaceUmlaute(value){ var id = value; var umlaute = {'\u00c4':'Ae', '\u00e4':"ae", '\u00d6':'Oe', '\u00f6': 'oe', '\u00dc':'Ue', '\u00fc':'ue', '\u00df':'ss'} for(i in umlaute){if(id.indexOf(i)!=-1)id=id.replace(i,umlaute[i])} return id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nonAccentVietnamese(str)\n{\n str = str.toLowerCase();\n str = str.replace(/\\u00E0|\\u00E1|\\u1EA1|\\u1EA3|\\u00E3|\\u00E2|\\u1EA7|\\u1EA5|\\u1EAD|\\u1EA9|\\u1EAB|\\u0103|\\u1EB1|\\u1EAF|\\u1EB7|\\u1EB3|\\u1EB5/g, \"a\");\n str = str.replace(/\\u00E8|\\u00E9|\\u1EB9|\\u1EBB|\\u1EBD|\\u00EA|\\u1E...
[ "0.7220997", "0.6834404", "0.68270826", "0.6516192", "0.6405933", "0.6367545", "0.62669754", "0.62578976", "0.60853195", "0.6073879", "0.6067023", "0.60495204", "0.6031869", "0.5993438", "0.5974253", "0.5964932", "0.5954526", "0.5915562", "0.5915562", "0.5915562", "0.59027004...
0.74197364
0
Get rollup building configurations
function getBuildingConfigs (target) { return target.map(({ dirname, name, version, entry, outDir, styleFilename }) => { return formats.map(format => { return { inputOptions: getInputOptions({ entry, outDir, styleFilename }), outputOptions: getOutputOptions({ outDir, name, version, format })...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "build() {\n this.buildEntry()\n .buildOutput()\n .buildRules()\n .buildPlugins()\n .buildResolving()\n .mergeCustomConfig();\n\n return this.webpackConfig;\n }", "function genConfigs(format) {\n let configs\n switch (format){\n case 'um...
[ "0.5761074", "0.5690484", "0.5554685", "0.54719055", "0.53444195", "0.53089505", "0.51121664", "0.5087874", "0.50856", "0.50780314", "0.506169", "0.5060301", "0.50558156", "0.5010938", "0.49883422", "0.49863708", "0.49673596", "0.49441442", "0.49320576", "0.49177617", "0.4911...
0.62260896
0
Takes the id of the parent section of the cover clicked. Since all Ids are numerical, this method extracts the number and picks the midlayer section whose Id corresponds with the toplayer section. Then it finds the child element of the midlayer section, which is an image, and returns its source.
function getMidlayerImg(target) { //Takes the numerical value of the id of toplayer section i.e section id="t1", idOfMidLayerImg id = "p1" var idOfMidLayerImg = "p" + target.parentNode.id.substring(1);; //Takes parent element which is a section. var parentElemMidlayerImg = document.getElementById(""+idOfMidLayerImg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toDetailsFromImage(clickedImage) {\n var ciParent = clickedImage.parentElement;\n\n toDetails(ciParent);\n}", "function findParent() {\n return $('.aloha-image-block[data-articleimageid=\"' +\n scope.articleImageId + '\"]');\n }", "static ...
[ "0.5633763", "0.5618785", "0.5398169", "0.5391353", "0.5372906", "0.52113134", "0.5164563", "0.5131643", "0.51303434", "0.508303", "0.5059078", "0.5057931", "0.5040781", "0.50235015", "0.50211287", "0.49868262", "0.49731264", "0.49638477", "0.49195418", "0.4907924", "0.490416...
0.7596919
0
If two tiles have been flipped, check if the midlayer images are identical. If they are not, readd the flipTile function back to the two tiles and put back the covers. If they are the same, remove the
function checkImg() { if (item.firstImage.src == item.secondImage.src){ item.pairsFlipped++; //alert("Same images! Num of pairs flipped: " + item.pairsFlipped); //remove midlayer images setTimeout (function () { item.firstImage.src = ""; item.secondImage.src = ""; }, 800); } else{ //testing ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tileMatchCheck() {\n if (firstTile.dataset.image === secondTile.dataset.image) {\n removeTile();\n endState++;\n endStateCheck(endState);\n return;\n }\n\n unflipTiles();\n }", "function flipTileToBack(){\n \n var ...
[ "0.7432481", "0.6870132", "0.6763947", "0.66351134", "0.6634785", "0.64643866", "0.6395515", "0.6356944", "0.6338199", "0.625645", "0.6191743", "0.60445285", "0.5938614", "0.5928287", "0.589447", "0.5843182", "0.58222187", "0.58005494", "0.5756792", "0.5715121", "0.57075226",...
0.7423085
1
Update the old value on the command, if currently unset. Call this during initialization if the command sets class properties in the constructor that are required by getOldValue.
updateOldValue() { if (this.oldValue == null) { this.oldValue = this.getOldValue(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "restoreValue() {\n if (this.updated) {\n this.setValue(this.originalValue);\n this.updated = false;\n }\n }", "update(){if(this.originalInputValue===''){this._reset();}}", "function setOrRevertInputValue() {\n // if the input value is invalid - revert it to the...
[ "0.62186956", "0.5974978", "0.584328", "0.5838499", "0.5801146", "0.5782198", "0.5650145", "0.5565924", "0.5541382", "0.5518506", "0.5484138", "0.5479426", "0.54745495", "0.54745495", "0.5462436", "0.54287946", "0.53576654", "0.5351503", "0.5343414", "0.533796", "0.5247806", ...
0.72615826
0
Start Plato inspector and visualizer
function startPlatoVisualizer(done) { console.log('Running Plato'); var excludeFiles = /.*markerclusterer.js/; var plato = require('plato'); var options = { title: 'Plato Inspections Report', exclude: excludeFiles }; plato.inspect(filePath.src, 'reports/plato', options, platoC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static start() {\n console.log(\"-- Starting Novel.js... --\");\n this.getNovelName();\n this.loadMainJson();\n }", "function start() {\n const defaultOptions = {\n toolbox: toolboxCategories,\n renderer: 'zelos',\n };\n addGUIControls((options) => {\n return Blockly.inject('blocklyDiv', op...
[ "0.64404356", "0.6232394", "0.6227408", "0.5980156", "0.5962137", "0.59476984", "0.5924596", "0.5892744", "0.5892744", "0.5880891", "0.5878477", "0.5878477", "0.58727705", "0.58713263", "0.58664036", "0.5864372", "0.5856462", "0.58170414", "0.57423174", "0.57386565", "0.57321...
0.6345111
1
Esta rutina inicia el juego, definiendo la cantidad de fichas tanto en el eje X como Y para crear el tablero.
function IniciarJuego() { //Se calculan la cantidad de fichas en el arreglo. El "-1" es el espacio en blanco en el tablero cantidad_fichas = Math.pow(nivel, 2) - 1; //Se oculan la pantalla principal y el mensaje de resultad completado en caso de estar visibles. seccion_de_inicio.style.display = "none"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function genera_tabla(personatges) {\n\n // Obtener la referencia del elemento body\n var div = document.getElementsByTagName(\"div\")[0];\n\n // Crea un elemento <table> y un elemento <tbody>\n var tabla = document.createElement(\"table\");\n var tblBody = document.createElement(\"tbody\");\n\n ...
[ "0.6040083", "0.5932814", "0.57609475", "0.5726531", "0.5718108", "0.56251675", "0.561697", "0.5574461", "0.55068535", "0.54590356", "0.5404096", "0.54035175", "0.53905725", "0.53775984", "0.53722847", "0.5370518", "0.5365317", "0.5354634", "0.5350822", "0.53047764", "0.53041...
0.6515826
0
Create a 'Two Weeks' chart object that is a wrapper around Tideline components
function chartWeeklyFactory(el, options) { var log = bows('Weekly Factory'); options = options || {}; var emitter = new EventEmitter(); var chart = tideline.twoWeek(emitter); chart.emitter = emitter; var pools = []; var create = function(el, options) { if (!el) { throw new Error('Sorry, you ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createChartWeek(dataset){\r\n\r\n //x axis values\r\n var x_data = buildxData(dataset);\r\n var y_data = buildyData(dataset);\r\n\r\n //Get additional data\r\n var prevClose_data = additionalData(dataset,2);\r\n var openingRate_data = additionalData(dataset,3);\r\...
[ "0.65414715", "0.592994", "0.58317965", "0.58317965", "0.5716195", "0.5688592", "0.5587182", "0.55859077", "0.5582275", "0.555654", "0.5541691", "0.5458628", "0.54314893", "0.5382258", "0.5354514", "0.53392774", "0.5321773", "0.5287579", "0.5281161", "0.5275311", "0.52680886"...
0.72505647
0
base case is length of the array. how do I capitalize only the first letter of a String? create a substring of length 1, call toUpperCase on it. recursively call capitalizeFirst after stringArray.pop() as argument.
function capitalizeFirst(stringArray){ var capitalizedArray = []; (function cap(strArray){ if(!strArray.length){ return; }else{ var newString = strArray[strArray.length - 1][0].toUpperCase() + strArray[strArray.length-1].slice(1); strArray[strArray.length-1] =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function capitalizeFirst(arr) {\n // create result array\n let capitalized = [];\n\n // helper\n function helper(array) {\n // base case:\n // array is empty, return\n if (array.length === 0) return;\n\n // recursive case:\n // split first string into array of characters\n // capitalize first...
[ "0.78465474", "0.7845584", "0.7845584", "0.7839229", "0.78196746", "0.76780814", "0.76751375", "0.7663096", "0.76386297", "0.76326424", "0.76283824", "0.7612907", "0.7611375", "0.7599126", "0.7564932", "0.75614244", "0.7538041", "0.75315017", "0.7524053", "0.75194734", "0.751...
0.8183892
0
Update proxies from fate0 File
function updateFate0Proxies() { console.log('Rogue That, Fate0'); var content = fs.readFileSync('fate0Proxies.txt', 'utf8'); var fate0proxy = content.split('\n'); //console.log('proxies length is ' + fate0proxy.length); for(var n = 0; n < fate0proxy.length - 1; n++) { proxyArray.p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateChillProxies() {\n console.log('Rogue That, Chill');\n var content = fs.readFileSync('proxies.txt', 'utf8');\n\n var fate0proxy = content.split('\\n');\n //console.log('proxies length is ' + fate0proxy.length);\n for(var n = 0; n < fate0proxy.length - 1; n++) {\n prox...
[ "0.7822603", "0.78148323", "0.58274573", "0.54345703", "0.54001886", "0.53219855", "0.5190396", "0.5100854", "0.50485593", "0.50310904", "0.49557972", "0.4907344", "0.48880652", "0.4869747", "0.48396233", "0.4839394", "0.483256", "0.48305854", "0.48154023", "0.47964466", "0.4...
0.8384573
0
Update proxies from chill File
function updateChillProxies() { console.log('Rogue That, Chill'); var content = fs.readFileSync('proxies.txt', 'utf8'); var fate0proxy = content.split('\n'); //console.log('proxies length is ' + fate0proxy.length); for(var n = 0; n < fate0proxy.length - 1; n++) { proxyArray.push(f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update24Proxies() {\n console.log('Rogue That, 24');\n var content = fs.readFileSync('Proxies24.txt', 'utf8');\n\n var fate0proxy = content.split('\\n');\n //console.log('proxies length is ' + fate0proxy.length);\n for(var n = 0; n < fate0proxy.length - 1; n++) {\n proxyArr...
[ "0.7612123", "0.7588085", "0.5981715", "0.5587988", "0.5292145", "0.5224364", "0.5196773", "0.5194887", "0.512946", "0.5051224", "0.49745667", "0.49452385", "0.48942438", "0.48761025", "0.48590872", "0.48538855", "0.4815616", "0.4809758", "0.47554797", "0.4751888", "0.4739154...
0.84784395
0
Update proxies from proxies24
function update24Proxies() { console.log('Rogue That, 24'); var content = fs.readFileSync('Proxies24.txt', 'utf8'); var fate0proxy = content.split('\n'); //console.log('proxies length is ' + fate0proxy.length); for(var n = 0; n < fate0proxy.length - 1; n++) { proxyArray.push(fate0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateChillProxies() {\n console.log('Rogue That, Chill');\n var content = fs.readFileSync('proxies.txt', 'utf8');\n\n var fate0proxy = content.split('\\n');\n //console.log('proxies length is ' + fate0proxy.length);\n for(var n = 0; n < fate0proxy.length - 1; n++) {\n prox...
[ "0.7221606", "0.71034354", "0.62497836", "0.6157717", "0.5685947", "0.5595171", "0.5595171", "0.5595171", "0.5549116", "0.5539979", "0.5539979", "0.5539979", "0.55370855", "0.5476744", "0.5476744", "0.5476744", "0.5476744", "0.5476744", "0.5476744", "0.5476744", "0.543728", ...
0.77075356
0
Update total avaiable proxy list
function updateTotalProxies () { console.log('Enemy down'); updateProxySource(); updateFate0Proxies(); updateChillProxies(); update24Proxies(); setTimeout(function(){ var uniqProxy = [ ...new Set(proxyArray) ]; proxyArray.length = 0; console.log(uniqProxy.length + ' Proxies Found!'); checked...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update24Proxies() {\n console.log('Rogue That, 24');\n var content = fs.readFileSync('Proxies24.txt', 'utf8');\n\n var fate0proxy = content.split('\\n');\n //console.log('proxies length is ' + fate0proxy.length);\n for(var n = 0; n < fate0proxy.length - 1; n++) {\n proxyArr...
[ "0.63426375", "0.61137384", "0.6079729", "0.59820783", "0.5932217", "0.589921", "0.5641354", "0.54843247", "0.54616296", "0.54406345", "0.5416551", "0.5406035", "0.53766686", "0.53713083", "0.5354369", "0.53353137", "0.53157914", "0.5310658", "0.52954507", "0.5293938", "0.528...
0.7333521
0
Make popup edit vertex info
makePopupEditVertex(vertexId) { const {name, description, repeat, mandatory, data, id, groupType} = _.find(this.dataContainer.vertex, {'id': vertexId}); // Get vertex group with group type const group = _.find(this.vertexDefinition.vertexGroup, {'groupType': groupType}); this.currentId = id; // Append conten...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "makePopupEditVertex(vertexId) {\n\t\t// Use in function updateVertexInfo()\n\t\tlet {name, description, repeat, mandatory, data, id, groupType} = _.find(this.dataContainer.vertex, {'id': vertexId})\n\t\t// Get vertex group with group type\n\t\tlet group = _.find(this.vertexDefinition.vertexGroup, {'groupType': gro...
[ "0.72657967", "0.70009154", "0.69558424", "0.629179", "0.62916476", "0.6275052", "0.6225042", "0.622374", "0.616278", "0.60951006", "0.60141236", "0.5957018", "0.5941285", "0.58784", "0.58564895", "0.5846711", "0.5816311", "0.5759847", "0.57569605", "0.5750884", "0.5683347", ...
0.72363627
1
Close popup edit vertex info
closePopVertexInfo() { this.currentId = null; let options = {popupId: `${HTML_VERTEX_INFO_ID}_${this.svgId}`}; PopUtils.metClosePopup(options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "closePopVertexInfo() {\n\t\tthis.currentId = null\n\t\tlet options = {popupId: `${HTML_VERTEX_INFO_ID}_${this.svgId}`}\n\t\tPopUtils.metClosePopup(options)\n\t}", "function closeEditWindow() {\n //Remove the full sick blackout effect\n removeBlackoutEffect();\n\n //make the popup div invisible\n let ...
[ "0.81901413", "0.71824807", "0.6995964", "0.6460153", "0.6420939", "0.6388868", "0.6290642", "0.6270706", "0.62601644", "0.6231671", "0.62090886", "0.6185696", "0.6174642", "0.61694574", "0.6164937", "0.61464757", "0.61389065", "0.6136293", "0.6134372", "0.6129733", "0.611777...
0.82615507
0
Update vertex info Update value properties Update name, type, ... Update present (DOM)
updateVertexInfo(forms, isEffectToParent = true) { const {id, name, description, repeat, mandatory, data, groupType} = forms; const vertex = _.find(this.dataContainer.vertex, {'id': id}); vertex.name = name; vertex.description = description; vertex.repeat = repeat; vertex.mandatory = mandatory; vertex.dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateVertexInfo(forms) {\n\t\tconst {id, name, description, repeat, mandatory, data, groupType} = forms\n\t\tlet vertex = _.find(this.dataContainer.vertex, {'id': id})\n\t\tvertex.name = name\n\t\tvertex.description = description\n\t\tvertex.repeat = repeat\n\t\tvertex.mandatory = mandatory\n\t\tvertex.data = dat...
[ "0.7108445", "0.66660506", "0.6458163", "0.6083922", "0.5994054", "0.597697", "0.5967345", "0.5957738", "0.593391", "0.5771783", "0.56773925", "0.56376183", "0.5622731", "0.5599607", "0.5599233", "0.5583773", "0.5535452", "0.55110466", "0.5499334", "0.54960316", "0.5487987", ...
0.6769616
1
Validate Vertex Define Structure
validateVertexDefineStructure(data) { //Validate data exists if(data===undefined) { return false; } if (!data.VERTEX_GROUP || !data.VERTEX) { return false; } if (Object.keys(data).length > 2) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "validateVertexDefineStructure(data) {\n\n\t\t//Validate data exists\n\t\tif(data===undefined)\n\t\t{\n\t\t\treturn false\n\t\t}\n\n\t\tif (!data.VERTEX_GROUP || !data.VERTEX) {\n\t\t\treturn false\n\t\t}\n\n\t\tif (Object.keys(data).length > 2) {\n\t\t\treturn false\n\t\t}\n\n\t\treturn true\n\t}", "validateGrap...
[ "0.7815209", "0.66519386", "0.60230196", "0.5830134", "0.57203877", "0.5687565", "0.560658", "0.5575606", "0.55062", "0.5506074", "0.5477422", "0.5439323", "0.5424759", "0.5395896", "0.53951985", "0.53951985", "0.5384376", "0.5372481", "0.5370477", "0.5352501", "0.5330653", ...
0.77670795
1
Check for collisions (Found the algorithm on the forums). If a collision occurs the game is reset and the score is decreased by 50 points.
function checkCollisions () { allEnemies.forEach(function(enemy) { if (! (enemy.leftEnemy > player.rightPlayer || enemy.rightEnemy < player.leftPlayer || enemy.topEnemy > player.bottomPlayer || enemy.bottomEnemy < player.topPlayer )) { player.reset(); score.total = score.to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkCollision() {\n if (\n this.x < player.x + COLISION_LIMIT &&\n this.x + COLISION_LIMIT > player.x &&\n this.y < player.y + COLISION_LIMIT &&\n this.y + COLISION_LIMIT > player.y\n ) {\n score = 0;\n scoreDiv.innerHTML = score;\n ...
[ "0.81042236", "0.74664044", "0.7442888", "0.72828794", "0.717216", "0.7170034", "0.71697164", "0.7146206", "0.712132", "0.7087105", "0.70765996", "0.707485", "0.70673966", "0.7056447", "0.7031806", "0.7020093", "0.7015568", "0.6994739", "0.6985864", "0.69858605", "0.6970879",...
0.7638973
1
Group: Helpers _____________________________________ Function: decorateLog Log a Gulp task result with emoji and colour. Parameters: (function) color gulpcolor (function) log gulplog (object) filePath, messageCount, warningCount, errorCount Returns: (string) decorated string
function decorateLog( color, log, { textstring = '', messageCount = 0, warningCount = 0, errorCount = 0 } = {} ) { const colors = { pass: 'GREEN', message: 'WHITE', warning: 'YELLOW', error: 'RED' }; const emojis = { pass: '✔', message: '💬', warning: '⚠️', error: '✖' }; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addLog(message, color) {\n $('.log').prepend('<small class=\"log-' + color + '\">&ofcir; ' + message + '</small>');\n}", "function colorized(msg, color = \"\\x1b[32m\") {\n console.log(color, msg); //cyan color + msg;\n}", "function myLog (inputString, color) {\n // send to console in color\n...
[ "0.61338836", "0.5905104", "0.5706821", "0.5686708", "0.5629586", "0.5353111", "0.5347145", "0.5321972", "0.53119785", "0.52422714", "0.5222257", "0.5211814", "0.5201896", "0.5197239", "0.51643515", "0.51454395", "0.51372474", "0.51114696", "0.5087634", "0.50789595", "0.50776...
0.7537898
0
Get workbooks which the logged in user has rights to
async function getWorkbooks(userCred, siteID, userID) { config1 = { headers: { 'Content-Type': 'application/xml', 'Accept': '*/*', 'X-Tableau-Auth': userCred } }; try{ var res_Workbooks = await axios.get("https://ebi-au-1.niometrics.com/api/3.11/sites/"+sit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBookList(){\n books = readfile.getData(bookDataPath);\n return books;\n}", "static getBooks() {\n\t\t let books;\n\t\t if(localStorage.getItem('books') === null) {\n\t\t\t books = [];\n\t\t } else {\n\t\t\t books = JSON.parse(localStorage.getItem('books'));\n\t\t }\n\n\t\t return books;\n\t }",...
[ "0.56428665", "0.53010356", "0.5296268", "0.52792764", "0.5211209", "0.5210705", "0.5160845", "0.5117085", "0.5100527", "0.50924826", "0.5056005", "0.50476336", "0.50279486", "0.50243497", "0.5012468", "0.50039977", "0.4913079", "0.48729357", "0.48553845", "0.48485082", "0.48...
0.54668605
1
Get list of views on a workbook
async function getViews(workbook_Names) { for(var i = 0; i<workbook_Names.length; i++){ var res_Views = await axios.get("https://ebi-au-1.niometrics.com/api/3.11/sites/"+siteID+"/workbooks/"+workbook_Names[i].id+"/views", config1); var res_Views = res_Views.data; parser.parseString(res_Views, (err, result...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getViewList(){\n\t//first get current stored view names, stored in views array\n\tvar views = [],\n\t\tbaseSrc = '../../implementation/js/ide/view/';\n\t//\n\tvar paths = fs.walkSync(path.join(baseSrc, 'user')); //walkSync relies on fs-extra 1.x.x. 2.x.x has moved this function to a separate package.\n\t/...
[ "0.69170743", "0.6343636", "0.6191374", "0.6105751", "0.6068542", "0.60623956", "0.6046258", "0.57107055", "0.5593581", "0.5553724", "0.5548736", "0.5509296", "0.5477336", "0.53732723", "0.5288763", "0.5244708", "0.52149236", "0.51767004", "0.5167665", "0.51457816", "0.511509...
0.67234915
1
activa la seleccion de la imagen y obtiene su codigo base64
function evento_obtener_base64_imagen() { $("#inp").on("change", function () { if (this.files && this.files[0]) { var archivo = new FileReader(); archivo.onload = function (e) { $("#img").attr("src", e.target.result); }; archivo.readAsDataURL(t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function encodeImageFileAsURL() {\n\n var filesSelected = document.getElementById(\"file\").files;\n if (filesSelected.length > 0) {\n var fileToLoad = filesSelected[0];\n\n var fileReader = new FileReader();\n\n fileReader.onload = function (fileLoadedEvent) {\n ...
[ "0.7106909", "0.6630982", "0.66071296", "0.6599767", "0.6286069", "0.6236303", "0.62185466", "0.61647105", "0.6121707", "0.61138886", "0.6101593", "0.60991454", "0.6055836", "0.60391426", "0.6017339", "0.60156786", "0.59895915", "0.59795916", "0.5890205", "0.58660936", "0.585...
0.69908243
1
funcion agregar datos a tabla
function agregar_a_tabla() { //agregamos los datos al objeto TEMAS_TABLA.push({ folio_orden: ($(".datos_temas").length + 1) , nombre: $("#nombre_tema").val() , contenido: $("textarea").val() , imagen: $("#img").attr("src") , usuario: $("#Label1").text() , fecha: f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function criarItensTabela(dados){\n\n const linha = tabela.insertRow()\n const colunaId = linha.insertCell(0)\n const colunaNome = linha.insertCell(1)\n const colunaData = linha.insertCell(2)\n const colunaAcoes = linha.insertCell(3)\n\n const itemId = document.createTextNode(dados.id)\n const...
[ "0.701116", "0.6959933", "0.68975204", "0.6895874", "0.68672645", "0.6784788", "0.6782481", "0.6768483", "0.67505157", "0.6740968", "0.6729291", "0.6720199", "0.67016715", "0.6698811", "0.66863936", "0.6684486", "0.66781855", "0.667042", "0.66311747", "0.6625449", "0.6616556"...
0.70657724
0
find seconds to tomorrow
function getSecondsToTomorrow(){ let today = new Date(); let tomorrow = new Date(+today + 24*3600*1000); return Math.round((tomorrow.setHours(0, 0, 0, 0) - today)/1000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tomorrowsDate(){\n let timestamp = Date.now();\n return timestamp;\n}", "function getSecondsToTomorrow() {\n let now = new Date();\n let diff = new Date(now.getFullYear(), now.getMonth(), now.getDate() +1) - now;\n\n return Math.round(diff/1000)\n}", "function seconds() { return +this * SECONDS }...
[ "0.67021143", "0.6675381", "0.6340863", "0.61299026", "0.6124676", "0.60582983", "0.60337794", "0.6003192", "0.59498554", "0.5944319", "0.58970183", "0.5833714", "0.5797801", "0.57387507", "0.5726233", "0.572543", "0.5713739", "0.56727844", "0.56686616", "0.56354934", "0.5629...
0.70685804
0
Swap state.characterArray current character with newChar at index
switchCharacter(index, newChar) { let newCharacterArray = this.state.characterArray; if (newCharacterArray[index] !== newChar) { newCharacterArray[index] = newChar; let newRawText = newCharacterArray.join(""); this.setState({ rawText: newRawText, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "replaceCharacter(newCharacter) {\n this.setState({character: newCharacter})\n }", "function swap(chars, i, j) {\n var tmp = chars[i];\n chars[i] = chars[j];\n chars[j] = tmp;\n }", "function moveCharToNewPos(letters, i, numberMoves){\r\n var currLetter = letters[i];\r\n ...
[ "0.67752725", "0.65397143", "0.6300734", "0.6005094", "0.59612364", "0.582637", "0.582637", "0.582637", "0.582637", "0.582637", "0.582637", "0.582637", "0.5812274", "0.5767588", "0.5740938", "0.57393116", "0.57236725", "0.57236725", "0.57236725", "0.5716239", "0.5698757", "...
0.8287742
0
The inputhandler component is an interface between the inputsystem of the basicengine and the game's eventsystem. In regular this component is used only by game scene to allow its game objects to receive inputevents. Those inputevents are necessary to solve the problem which gameobject responds to a useraction first by...
function Component_InputHandler() { /** * Indicates if all input events, such as mouse and keyboard event, should be blocked. * * @property blockInput * @type boolean * @default false */ this.blockInput = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "keyInput(e) { /* 轉移至 this._keyInputHander 作為替代方案 */ }", "function inputHandler(){\n\n\tthis.keys = {\n\t\tUP_ARROW: 38,\n\t\tLEFT_ARROW: 37,\n\t\tRIGHT_ARROW: 39,\n\t\tDOWN_ARROW: 40\n\t}\n\n\t//Store mouse coordinates\n\tthis.mx = null;\n\tthis.my = null;\n\n\t//Create an external object reference for the playe...
[ "0.6691403", "0.6677965", "0.6504165", "0.63463676", "0.62932336", "0.62735283", "0.62124497", "0.61747414", "0.61213857", "0.6114423", "0.6109587", "0.61010087", "0.60384935", "0.60342824", "0.60275", "0.60225856", "0.60220647", "0.595765", "0.59286207", "0.5905755", "0.5890...
0.79253936
0
Imagine you are getting the above users collection from a MongoDB database. a. Create a function called signUp which allows user to add to the collection. If user exists, inform the user that he has already an account.
function signUp(username, email, password) { let userExists = false; // This is a 'flag', it's the first time i use it for (let i = 0; i < appUsers.length; i++) { if (appUsers[i].username === username || appUsers[i].email === email) { console.log("User exists"); userExists = true; } } if (!userEx...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function userExists(user){\n\n}", "function create_account(db, username, password, callback) {\n var collection = get_collection(db);\n \n // Search for duplicate usernames first.\n var query = {\n username: username.toLowerCase(),\n };\n collection.findOne(\n query,\n func...
[ "0.67951274", "0.67842567", "0.6768847", "0.6750856", "0.6673614", "0.6642866", "0.66241497", "0.6619124", "0.6599501", "0.6595897", "0.656483", "0.65516174", "0.6549799", "0.653823", "0.64773315", "0.64662164", "0.64510274", "0.64342505", "0.6422153", "0.6409064", "0.6348219...
0.7120439
0
3. The products array has three elements and each of them has six properties. a. Create a function called rateProduct which rates the product
function rateProduct(name, rate) { for (const product of products) { if (product.name.toLowerCase().includes(name)) { let chars = '0123456789abcdefghijklmnñopqrstuvwxyz'; let id = []; for (let i = 0; i < 6; i++) { id.push(chars[Math.floor(Math.random() * c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateRate(){\n numRate = 0; //We zero the numRate out because we will re-compute it from scratch based on all objects\n arrayPurchaseTypes.forEach(function(purchase){\n numRate += purchase.computeRateOfProd();\n })\n document.getElementById(\"num_rate\").innerHTML = numRate;\n}", "pr...
[ "0.68263245", "0.667991", "0.66646934", "0.6576647", "0.656838", "0.63811773", "0.6373278", "0.631878", "0.62338233", "0.61624557", "0.61487263", "0.612937", "0.61194396", "0.61162627", "0.60986644", "0.6095183", "0.6090433", "0.6089658", "0.6064327", "0.6041343", "0.60326624...
0.6974989
0
/statistic scripts / datepicker statistic
function datepickersStatistic(){ $.datepicker.regional['ru'] = { closeText: 'Закрыть', prevText: '&#x3c;Пред', nextText: 'След&#x3e;', currentText: 'Сегодня', monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь', 'Июль','Август','С...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function main() {\n\n var now3 = new Date();\n var now4 = new Date();\n $('#widgetCalendar').DatePicker({\n\tflat: true,\n\tformat: 'd B, Y',\n\tdate: [new Date(now3), new Date(now4)],\n\tcalendars: 3,\n\tmode: 'range',\n\tstarts: 1,\n\tonChange: function(formated, dates) {\n\t start = dateToTimestamp(...
[ "0.6560871", "0.6315254", "0.6232911", "0.6172077", "0.61042035", "0.6055489", "0.603579", "0.599419", "0.59346807", "0.59314066", "0.5930445", "0.58929455", "0.5888994", "0.58869654", "0.58707696", "0.58518285", "0.5811318", "0.58016104", "0.5794012", "0.57910734", "0.578787...
0.63538957
1
build the query object, aka return the query object
build() { return this.queryObject; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "buildQuery () {\n\t\tconst query = { teamId: this.teamId, deactivated: false };\n\t\tconst indexAttribute = 'lastActivityAt';\n\t\tlet { before, after, inclusive } = this.request.query;\n\t\tinclusive = inclusive !== undefined;\n\t\tif (before !== undefined) {\n\t\t\tbefore = parseInt(before, 10);\n\t\t\tif (!befo...
[ "0.69986296", "0.69441044", "0.6819117", "0.679768", "0.67477703", "0.6737867", "0.6737054", "0.6667299", "0.66579026", "0.65839165", "0.65674824", "0.65442985", "0.6493559", "0.64491975", "0.64466774", "0.6420325", "0.6412805", "0.64047384", "0.6396984", "0.6391511", "0.6378...
0.79741365
0
Add should have prefix query
shouldPrefix(key, value) { this.queryObject.query.bool.should.push({ prefix: { [key]: value } }); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mustPrefix(key, value) {\n this.queryObject.query.bool.must.push({\n prefix: { [key]: value }\n });\n return this;\n }", "function appendPrefixIfNeeded(cm) {\n\tvar cur = cm.getCursor();\n\tvar token = cm.getTokenAt(cur);\n\tif (token.className == \"sp-prefixed\") {\n//\t\tif (...
[ "0.7126599", "0.68159366", "0.6704595", "0.6513956", "0.6513956", "0.6243763", "0.62091094", "0.6112313", "0.6112313", "0.60784924", "0.60512173", "0.60419595", "0.6008619", "0.5966196", "0.59491014", "0.59144735", "0.5905518", "0.5903123", "0.5903123", "0.5858392", "0.580403...
0.74744844
0
Add should have term query
shouldTerm(key, value) { this.queryObject.query.bool.should.push({ term: { [key]: value } }); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mustTerm(key, value) {\n this.queryObject.query.bool.must.push({\n term: { [key]: value }\n });\n return this;\n }", "function addTerm(aTerm) {\n if (aTerm) {\n terms.push(aTerm);\n }\n }", "function doANDTerms(query)\n{\n var value = query.value;\n quer...
[ "0.68072826", "0.66601276", "0.6405065", "0.63891155", "0.6276994", "0.61739177", "0.6136443", "0.61301416", "0.60885286", "0.5994779", "0.5976151", "0.59136766", "0.59033936", "0.5841408", "0.5765107", "0.576137", "0.57309496", "0.5650113", "0.5630872", "0.560886", "0.560886...
0.73359305
0
Add should have wildcard query
shouldWildcard(key, value) { this.queryObject.query.bool.should.push({ wildcard: { [key]: '*' + value + '*' } }); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mustWildcard(key, value) {\n this.queryObject.query.bool.must.push({\n wildcard: { [key]: '*' + value + '*' }\n });\n return this;\n }", "withMatchAll(value) {\n if(!value) return;\n this.q.query.match_all = value;\n }", "function checkQuery(item) {\n var newQue...
[ "0.7037256", "0.6040917", "0.58434963", "0.57600045", "0.5727739", "0.5638952", "0.56143373", "0.5569939", "0.55337685", "0.54976285", "0.5448585", "0.5446721", "0.5438082", "0.5438082", "0.5436993", "0.5432468", "0.5425092", "0.5422476", "0.54097354", "0.5389925", "0.5387097...
0.7432498
0
Add should match query
shouldMatch(key, value) { this.queryObject.query.bool.should.push({ match: { [key]: value } }); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mustShouldMatch(terms) {\n const shouldQuery = { bool: { should: [] } };\n terms.forEach((term) => shouldQuery.bool.should.push({ match: { [term.key]: term.value } }));\n this.queryObject.query.bool.must.push(shouldQuery);\n return this;\n }", "mustMatch(key, value) {\n this...
[ "0.6640811", "0.61108774", "0.602466", "0.59724087", "0.59500086", "0.59126145", "0.5866852", "0.5864521", "0.57358533", "0.5649231", "0.5628456", "0.56019527", "0.5588672", "0.55433756", "0.55241317", "0.5507393", "0.5457414", "0.54537994", "0.5444787", "0.542471", "0.539544...
0.7030952
0
Add must have wildcard query
mustWildcard(key, value) { this.queryObject.query.bool.must.push({ wildcard: { [key]: '*' + value + '*' } }); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shouldWildcard(key, value) {\n this.queryObject.query.bool.should.push({\n wildcard: { [key]: '*' + value + '*' }\n });\n return this;\n }", "function checkQuery(item) {\n var newQuery = item.attr('value').toLowerCase();\n if (newQuery.match(/\\*|\\?/g)) {\n ...
[ "0.73004985", "0.60509455", "0.5894036", "0.5771251", "0.56541675", "0.55927217", "0.55831295", "0.552703", "0.55072314", "0.5495918", "0.5478611", "0.54601365", "0.54538417", "0.5432547", "0.54090995", "0.5393531", "0.53577733", "0.53557706", "0.5329945", "0.5329945", "0.532...
0.7252599
1
Add must match query
mustMatch(key, value) { this.queryObject.query.bool.must.push({ match: { [key]: value } }); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shouldMatch(key, value) {\n this.queryObject.query.bool.should.push({\n match: { [key]: value }\n });\n return this;\n }", "mustShouldMatch(terms) {\n const shouldQuery = { bool: { should: [] } };\n terms.forEach((term) => shouldQuery.bool.should.push({ match: { [...
[ "0.6623708", "0.6478642", "0.58732134", "0.5791158", "0.57592565", "0.57148564", "0.5583556", "0.5578242", "0.5575612", "0.55536276", "0.55457026", "0.5538696", "0.5538147", "0.5529284", "0.5483617", "0.5473678", "0.5467613", "0.5394593", "0.5391268", "0.5374823", "0.5360209"...
0.64906424
1
Add must query with should match options
mustShouldMatch(terms) { const shouldQuery = { bool: { should: [] } }; terms.forEach((term) => shouldQuery.bool.should.push({ match: { [term.key]: term.value } })); this.queryObject.query.bool.must.push(shouldQuery); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shouldMatch(key, value) {\n this.queryObject.query.bool.should.push({\n match: { [key]: value }\n });\n return this;\n }", "mustMatch(key, value) {\n this.queryObject.query.bool.must.push({\n match: { [key]: value }\n });\n return this;\n }", ...
[ "0.6579979", "0.60060495", "0.5873126", "0.5790658", "0.5601162", "0.54634535", "0.5355571", "0.52486044", "0.5214421", "0.5169077", "0.5155006", "0.5109937", "0.50840414", "0.5070826", "0.5060612", "0.5039882", "0.501721", "0.49881086", "0.4962288", "0.49588606", "0.4955528"...
0.6739093
0
Add must have term query
mustTerm(key, value) { this.queryObject.query.bool.must.push({ term: { [key]: value } }); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shouldTerm(key, value) {\n this.queryObject.query.bool.should.push({\n term: { [key]: value }\n });\n return this;\n }", "function addTerm(aTerm) {\n if (aTerm) {\n terms.push(aTerm);\n }\n }", "function doANDTerms(query)\n{\n var value = query.value;\n ...
[ "0.7044997", "0.66930825", "0.6668148", "0.6188839", "0.6140687", "0.6115537", "0.60482", "0.6041522", "0.60356855", "0.6031682", "0.5973034", "0.5920603", "0.59188634", "0.5886537", "0.5863348", "0.5822639", "0.5729527", "0.56670815", "0.5649066", "0.55913466", "0.55578196",...
0.6850586
1
Add must have prefix query
mustPrefix(key, value) { this.queryObject.query.bool.must.push({ prefix: { [key]: value } }); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shouldPrefix(key, value) {\n this.queryObject.query.bool.should.push({\n prefix: { [key]: value }\n });\n return this;\n }", "function appendPrefixIfNeeded(cm) {\n\tvar cur = cm.getCursor();\n\tvar token = cm.getTokenAt(cur);\n\tif (token.className == \"sp-prefixed\") {\n//\t\t...
[ "0.7050544", "0.6778849", "0.6689081", "0.6332566", "0.6159911", "0.6159911", "0.6141179", "0.60786974", "0.60464585", "0.60238147", "0.59991294", "0.59991294", "0.5965099", "0.5885831", "0.58832806", "0.5874001", "0.58559966", "0.5851067", "0.5849052", "0.5849052", "0.573864...
0.7146307
0
Add minimum should match count
minimumShouldMatch(count) { this.queryObject.query.bool.minimum_should_match = count; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function incrementMatchScore() {\n\n score++\n \n}", "get matchCount() {\n return this._results.length;\n }", "get matchCount()\r\n\t{\r\n\t\treturn this._results.length;\r\n\t}", "function countUnMatched() {\n var count = 0;\n\n open.forEach(function (element) {\n if (element.match ==...
[ "0.57342154", "0.57093203", "0.5678863", "0.56671387", "0.5631445", "0.5585943", "0.5472999", "0.54527307", "0.54317683", "0.53288513", "0.532584", "0.53233415", "0.53173506", "0.5292675", "0.52631265", "0.52594423", "0.5256505", "0.5256505", "0.5241701", "0.5226493", "0.5218...
0.6869295
0
Create function that determines bubble size (would like to use case/switch)
function bubbleSize(magnitude) { // switch(magnitude) { // case (magnitude < 1): return 10; // case (magnitude < 2): return 20; // case (magnitude < 3): return 30; // case (magnitude < 4): return 40; // case (magnitude < 5): return 50; // case (magnitude < 10): return 60 // } if (magnitude...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bubbleSize() \n{\n for (var i = 0; i < 100; i++) \n {\n fillBubbleSize[i] = random(5, 20);\n }\n}", "setCellSize() {\n\t\t\tconst size = this.d100();\n\t\t\tif (size === 100 && window.innerWidth > 1600) return 5;\n\t\t\tif (size > 97 && window.innerWidth > 900) return 4;\n\t\t\tif (size > 92) retu...
[ "0.6648359", "0.59834504", "0.59696877", "0.5875381", "0.58642775", "0.58015543", "0.57800806", "0.5770272", "0.5688969", "0.5687512", "0.56754327", "0.56698793", "0.5645916", "0.5644346", "0.5641227", "0.5633587", "0.5633316", "0.56301737", "0.5603505", "0.5589921", "0.55713...
0.7890851
0
Create function that determines bubble color (would like to use case/switch)
function bubbleColor(magnitude) { if (magnitude < 1) { return "#7FFF00";} else if (magnitude <2) { return "#ADFF2F";} else if (magnitude <3) { return "#FFD700";} else if (magnitude <4) { return "#FFA500";} else if (magnitude <5) { return "#FF8C00";} else {return "#FF4500";} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Bubblecolor(depth) {\n if (depth > 150) {\n return \"#FF0000\";\n }\n else if (depth > 90) {\n return \"#FF631F\";\n }\n else if (depth > 50) {\n return \"#FFA71F\";\n }\n else if (depth > 20) {\n return \"#F5FB39\";\n }\n else {\n return \"#9B...
[ "0.71063834", "0.6880442", "0.6524129", "0.6500008", "0.6445971", "0.63135415", "0.63054556", "0.628403", "0.6274357", "0.62676805", "0.6266105", "0.6252907", "0.6250169", "0.6238518", "0.62359357", "0.62193614", "0.62079763", "0.62075406", "0.6199839", "0.61995155", "0.61932...
0.7776875
0
If the property is of the condo or apartment type, hides the rent div and shows the floor div
function floor() { $('#floorDiv').show(); $('#rentDiv').hide(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showhideProperties() {\t\n\t\t//Hide or Show the whole 'propertydiv' when the botton is clicked\n\t\tdocument.getElementById('propertydiv').style.display = (document.getElementById('propertydiv').style.display == \"none\") ? \"block\" : \"none\" ; //()?'';'' is an equivalent expression for if(){}else{}\n\...
[ "0.6985242", "0.61541766", "0.6131356", "0.60517", "0.5931485", "0.59063417", "0.5902366", "0.5877549", "0.5877098", "0.5863331", "0.5823068", "0.582273", "0.58222604", "0.58218545", "0.5806688", "0.5801094", "0.5789542", "0.57682526", "0.5758921", "0.5731547", "0.5728051", ...
0.63863695
1
not() should be used with Array.prototype.filter(). Return true only if b is different than any a. For example: [ 1, 2, 3 ].filter( not( 2 ) ) => [ 1, 3 ] [ 1, 2, 3 ].filter( not( [ 2, 3 ] ) ) => [ 1 ]
function not( a ) { return function( b ) { if ( Array.isArray( a ) ) { return !a.some(function( a ) { return a === b; }); } return a !== b; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function not(a, b) {\n return a.filter((value) => b.indexOf(value) === -1);\n }", "function except(a,b){\n return a.filter(function (e){\n return b.indexOf(e) == -1\n });\n}", "function array_diff(a, b) {\n //filter takes in an array and returns values based on a check. if true, returns that ...
[ "0.80173266", "0.74332625", "0.72636604", "0.70367396", "0.6970905", "0.68351233", "0.6774783", "0.67557037", "0.66548437", "0.6573836", "0.6542299", "0.65126365", "0.6468071", "0.6424471", "0.63662624", "0.63038045", "0.6277509", "0.6258128", "0.6257182", "0.6255259", "0.624...
0.7929577
1
add todo items to page, inside accordion structure
function addTodosToPage(data) { //select the accordion div so we can add all the child divs var $myAccordionDiv = $("div#accordion"); //define Done variable. if todo done field is "true" set this variable to "done" and it will display //if the done field is 'false', then we just leave this variable with the text...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addToDo(){ \n const taskContent = document.getElementById('new_task');\n saveToDo(this.LSkey, taskContent);\n this.showToDoList();\n }", "function addToDo(toDo , id , done , trash)\n {\n if(trash){return;}\n\n const DONE = done ? CHECK : UNCHECK;\n const LINE =...
[ "0.6973367", "0.6899862", "0.6865596", "0.68190217", "0.6812514", "0.6809003", "0.6790118", "0.6789992", "0.6778064", "0.6766202", "0.67534465", "0.67413837", "0.6719598", "0.6710457", "0.67083746", "0.67053366", "0.6704134", "0.6703345", "0.6700453", "0.6694826", "0.66826123...
0.7516421
0
last ID assigned to a user add a new user to users and return the id of the new user:
function addUser() { users[++lastID] = new User(); return lastID; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createNewUser(id) {\n users[id] = oracles[o % oracles.length];\n return users[id];\n}", "function getLastId(res) \n {\n console.log('get last id');\n connection.acquire(function(err, con) \n {\n con.query('SELECT LAST_INSERT_ID() as id', function(err, result) {\n ...
[ "0.7002162", "0.68833524", "0.68735874", "0.6839012", "0.68040913", "0.6775983", "0.6712724", "0.6710074", "0.67058766", "0.6674534", "0.66553044", "0.6648988", "0.66466147", "0.6601219", "0.6590846", "0.65898216", "0.65347916", "0.6525735", "0.6511629", "0.64859015", "0.6443...
0.7822896
0
The only way to dynamically set the props of the calendar is by adding the HTML on our own. The JS functions don't seem to work... :(
AddControl() { console.warn('Calendar is broke for now!'); const el = document.getElementById('LoggerCalendarPanel'); const todayDate = new Date(); const todayDateFMT = (todayDate.getMonth() + 1) + "-" + todayDate.getDate() + "-" + today...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createCalendar() {\r\n let date = new Date();\r\n let calendarHTML = \"\";\r\n calendarHTML += calCaption(date);\r\n calendarHTML += calHead();\r\n calendarHTML += calDays(date);\r\n document.getElementById(\"calendar_table\").innerHTML = calendarHTML;\r\n}", "function dynCalendar_setH...
[ "0.6865223", "0.6750955", "0.672257", "0.66994625", "0.6647939", "0.6537663", "0.65240896", "0.6494994", "0.6379298", "0.63650364", "0.6357885", "0.63443595", "0.6324632", "0.6314885", "0.63137895", "0.62945145", "0.6286179", "0.6255584", "0.62320906", "0.6226773", "0.6214173...
0.74660945
0
Creates a new chart with the given data for a category
function makeChart(data, categoryName) { // Capitalise category name categoryName = capitalizeFirstLetter(categoryName) var chart = new CanvasJS.Chart("chartContainer", { animationEnabled: true, theme: "dark1", title:{ text: categoryName==='Cash'?'Commodity':categoryName...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SelectCategory(cat){\n\n\tcategory = cat;\n \n\tCleanChart();\n\n\td3.csv(\"./data/titanic_data.csv\", Draw)\n}", "function Draw(data){\n\tChart.data = Filter(data);\n\n\tChart.addCategoryAxis(\"x\", category);\n // If you want to change axis label, use: var X = Chart.addCategoryAxis(\"x\", categ...
[ "0.65046185", "0.64855707", "0.6310166", "0.6293098", "0.6230037", "0.61717", "0.6169294", "0.610739", "0.606158", "0.59996325", "0.59788835", "0.5957874", "0.5938248", "0.58840585", "0.5881346", "0.58793914", "0.58793277", "0.58735895", "0.585211", "0.5805379", "0.57949454",...
0.6716397
0
Generate chart for particular categories Calculates percentages and sends the processed data to Make chart
async function categoryChart(categoryName){ userData = '' // Get userdata by GET request await getUserData('http://127.0.0.1:5000/' + USERNAME) .then(data => (userData = data)) category = userData.portfolio[categoryName] // Category total categoryTotal = 0 for (item in category){...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fillPieChartData(){\r\n for (var category in expanseDetails) {\r\n var totalCategoryAmount = 0;\r\n\r\n var subCategories = expanseDetails[category];\r\n\r\n for (var i = 0 ; i < subCategories.length ; i++){\r\n totalCategoryAmount += subCategories[i]...
[ "0.6903426", "0.6709689", "0.65484303", "0.65344447", "0.6407955", "0.63511294", "0.6265384", "0.62541896", "0.6235374", "0.6124209", "0.6118469", "0.61049014", "0.6061327", "0.60315454", "0.6006575", "0.5988697", "0.59666264", "0.5934179", "0.59215623", "0.59008765", "0.5899...
0.7003342
0
delete post from backend
function deletePost() { dispatch(removePostFromAPI(postId)); history.push("/"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deletePost(req, res) {\n\n}", "async deletepost(){\n try{\n await axios.get(`/admin/api/delete-post/${this.props.match.params.id}`);\n this.props.history.push(\"/\");\n }catch(err){\n console.log(\"there was an error deleting this post\");\n }\n }", "functi...
[ "0.7766215", "0.7629516", "0.76067704", "0.75867426", "0.7559359", "0.75439227", "0.7463259", "0.7433911", "0.739138", "0.73693734", "0.7363369", "0.7358523", "0.734887", "0.73406416", "0.7254288", "0.72307634", "0.72122264", "0.7200772", "0.7188953", "0.7148321", "0.7142701"...
0.799856
0
zadatak 4 Write a function that takes a number and returns array of its digits.
function digits(n) { var array = []; var elementNumber; var i = 0; while (n) { elementNumber = n % 10; array[i] = elementNumber; i++; n = (n - elementNumber) / 10; } return array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function digitize(n) {\n //code here\n var a=[];\n var array=n.toString().split(''); \n for(let i=array.length-1;i>=0;i--){\n a.push(parseInt(array[i]))\n }\n return a;\n\n }", "function digitize(n) {\n let arr = [];\n let len = n.toString()\n for (let i = len.length - 1; i >= 0;...
[ "0.7493887", "0.73633385", "0.7340449", "0.73155177", "0.7128883", "0.70630616", "0.70149887", "0.6911125", "0.6866372", "0.6790591", "0.67551875", "0.6710133", "0.6702606", "0.6677489", "0.6665176", "0.6660163", "0.65676236", "0.6543478", "0.650491", "0.648583", "0.6460036",...
0.74132586
1
zadatak 7 Write a function to find the maximum and minimum elements. Function returns an array.
function maxandmin(a) { var i; var min = a[0]; var max = a[0]; for (i = 0; i < a.length; i++) { if (a[i] < min) { min = a[i]; } else if (a[i] > max) { max = a[i]; } maxandmin = [min, max]; } return maxandmin; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMinMax(arr){\r\n let min,max,res;\r\n min = Math.min.apply(null , arr);\r\n max = Math.max.apply(null , arr);\r\n res=[min , max];\r\n return res;\r\n}", "function minMax(array){\n let min = array[0]; //Assigning min to first element so function can compare it to something, additional...
[ "0.7915423", "0.76628935", "0.7496432", "0.74880236", "0.747451", "0.7444927", "0.7438605", "0.7392047", "0.7380208", "0.73724735", "0.7358094", "0.7336049", "0.7269741", "0.7269397", "0.7269238", "0.7241935", "0.72194964", "0.71798396", "0.7150291", "0.71303105", "0.71299005...
0.78747123
1
zadatak 9 Write a function to find the element that occurs most frequently.
function getMostFrequentElement(elements) { var elementsFrequency = getElementsFrequency(elements); var maxElementAndIndex = getMaxElementAndPosition(elementsFrequency); var indexOfMostFrequentElement = maxElementAndIndex[1]; return elements[indexOfMostFrequentElement]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findMostFrequentItem(array) {\n const FREQUENCY_COUNT_STORE = {};\n\n array.forEach(item => {\n if (FREQUENCY_COUNT_STORE[item]) {\n FREQUENCY_COUNT_STORE[item]++;\n } else {\n FREQUENCY_COUNT_STORE[item] = 1;\n }\n })\n\n let maxFrequencyCount = 0;\n let mostFrequentItem = null;\n...
[ "0.742481", "0.7415706", "0.73985237", "0.73757577", "0.73713577", "0.7367616", "0.73670065", "0.7359933", "0.73433346", "0.724354", "0.72327447", "0.72173494", "0.7145503", "0.70738304", "0.7041885", "0.7013741", "0.6993854", "0.69780284", "0.6907829", "0.68729806", "0.68579...
0.78000784
0
zadatak 43 Write a function that says whether a number is perfect. 28 > 28 is a perfect number. Note: According to Wikipedia: In number theory, a perfect number is a positive integer that is equal to the sum of its proper positive divisors, that is, the sum of its positive divisors excluding the number itself (also kno...
function isPerfect(number) { var temp = 0; for (var i = 1; i <= number / 2; i++) { if (number % i === 0) { temp += i; } } if (temp === number && temp !== 0) { console.log(number + " is a perfect number."); } else { console.log(num + " is not a perfect num...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_perfect(number) //FUNCTION TO CHECK WHETHER A NUMBER IS PERFECT OR NOT\n{\nvar temp = 0; //PERFECT NUMBER MEANS A NUMBER WHOSE SUM OF ALL THE DIVISORS WHICH PERFECTLY DIVIDE NUMBER WITH REMAINDER ZERO IS EQUALS TO THE NUMBER\n\n for(var i=1;i<=number/2;i++) ...
[ "0.8443084", "0.8229099", "0.8187364", "0.81666976", "0.8107661", "0.8106503", "0.80020547", "0.795647", "0.7855456", "0.780751", "0.7430563", "0.7421966", "0.70869535", "0.70265126", "0.6891514", "0.68874353", "0.6696256", "0.6614805", "0.63074934", "0.6299132", "0.62427336"...
0.8471175
0
Process Div element for Card
function processCardDivs(selectedCards){ cards = [{shape: 0, shade: 0, color: 0, number: 0}, {shape: 0, shade: 0, color: 0, number: 0}, {shape: 0, shade: 0, color: 0, number: 0}] for(let i = 0; i < selectedCards.length; i++){ let src = selectedCards[i].firstChild.src.split('/images/')[1] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CardErstellen(){\n //Holt sich den Container\n var Container = document.querySelector('#card-deck');\n\n for (let index = 1; index < 17; index++) {\n //Div erstellen\n var nCard = document.createElement(\"div\");\n nCard.classList.add(\"card\");\n ...
[ "0.6769721", "0.6721439", "0.6682093", "0.66258836", "0.66127455", "0.6602519", "0.6568177", "0.6497333", "0.6477705", "0.64535177", "0.64500797", "0.64045525", "0.63277507", "0.63271004", "0.6287751", "0.623478", "0.62286437", "0.6224067", "0.6215969", "0.6211227", "0.619622...
0.6780901
0
Selects (add to selected class) 3 cards that comprise a set. returns true on success, false on failure. Takes an array of divs with the card class as a parameter
function findSet(cardDivs){ for(let i = 0; i < cardDivs.length - 2; i++){ for(let j = i + 1; j < cardDivs.length - 1; j++){ for(let k = j + 1; k < cardDivs.length; k++){ if(checkCards(processCardDivs([cardDivs[i], cardDivs[j], cardDivs[k]]))){ //grab set let...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrongCard(array) {\n $(array[0]).addClass('red');\n $(array[1]).addClass('red');\n}", "function processCardDivs(selectedCards){\n cards = [{shape: 0, shade: 0, color: 0, number: 0}, {shape: 0, shade: 0, color: 0, number: 0}, {shape: 0, shade: 0, color: 0, number: 0}]\n for(let i = 0; i <...
[ "0.6572772", "0.64701545", "0.6370189", "0.6364824", "0.6316134", "0.6293829", "0.626069", "0.62192804", "0.6164553", "0.613879", "0.60941815", "0.6064968", "0.60195965", "0.5995111", "0.59648126", "0.5962906", "0.5948747", "0.5921262", "0.5874279", "0.586381", "0.5861423", ...
0.77183145
0
Methods Generates a copy of the target project configured for soliditycoverage and saves to the coverage environment folder. Process exits(1) if try fails
generateCoverageEnvironment() { this.log('Generating coverage environment'); try { this.sanityCheckContext(); let files = shell.ls('-A', this.workingDir); const nmIndex = files.indexOf('node_modules'); // Removes node_modules from array (unless requested). if (!this.copyNodeModu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupCrnaProject() {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n if (projectTools.projectRoot !== null) {\n yield projectTools.installPackages(true);\n yield projectTools.modifyPackageJson(true);\n yield projectTools.c...
[ "0.5876717", "0.57303715", "0.5610097", "0.55342263", "0.5504613", "0.53591686", "0.5264198", "0.517004", "0.5136364", "0.51227766", "0.50755024", "0.5051145", "0.5049488", "0.50245523", "0.49979618", "0.4996699", "0.49912316", "0.49896342", "0.49819818", "0.49536112", "0.493...
0.7541435
0
For each contract except migrations.sol (or those in skipFiles): + Generate file path reference for coverage report + Load contract as string + Instrument contract + Save instrumented contract in the coverage environment folder where covered tests will run + Add instrumentation info to the coverage map
instrumentTarget() { this.skipFiles = this.skipFiles.map(contract => `${this.coverageDir}/contracts/${contract}`); this.skipFiles.push(`${this.coverageDir}/contracts/Migrations.sol`); const instrumentedFiles = []; let currentFile; try { shell.ls(`${this.coverageDir}/contracts/**/*.sol`).forEa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "generateReport() {\n const collector = new istanbul.Collector();\n const reporter = new istanbul.Reporter();\n\n return new Promise((resolve, reject) => {\n // Get events fired during instrumented contracts execution.\n const stream = fs.createReadStream(`./allFiredEvents`);\n stream.on('er...
[ "0.60876596", "0.5877222", "0.5724247", "0.5556031", "0.5498354", "0.53438586", "0.520491", "0.5158419", "0.5108049", "0.50917846", "0.5071985", "0.49803966", "0.49119848", "0.4905169", "0.48646724", "0.48301134", "0.48114297", "0.48001474", "0.47914746", "0.47829795", "0.477...
0.81691056
0
Run truffle (or config.testCommand) over instrumented contracts in the coverage environment folder. Shell cd command needs to be invoked as its own statement for command line options to work, apparently. Also reads the 'allFiredEvents' log.
runTestCommand() { try { const defaultCommand = `truffle test ${this.network} ${this.silence}`; const command = this.testCommand || defaultCommand; this.log(`Running: ${command}\n(this can take a few seconds)...`); shell.cd(this.coverageDir); shell.exec(command); this.testsErrore...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "runCompileCommand() {\n try {\n const defaultCommand = `truffle compile ${this.network} ${this.silence}`;\n const command = this.compileCommand || defaultCommand;\n this.log(`Running: ${command}\\n(this can take a few seconds)...`);\n shell.cd(this.coverageDir);\n shell.exec(command);\n...
[ "0.68173635", "0.66878486", "0.62211627", "0.6047947", "0.5808175", "0.53944904", "0.5313651", "0.52155155", "0.5105977", "0.50848675", "0.50100785", "0.4890754", "0.48867872", "0.48312783", "0.47768617", "0.4766624", "0.47221506", "0.47075626", "0.46081695", "0.45902112", "0...
0.6931832
0
Run truffle compile (or config.compileCommand) over instrumented contracts in the coverage environment folder. Shell cd command needs to be invoked as its own statement for command line options to work, apparently.
runCompileCommand() { try { const defaultCommand = `truffle compile ${this.network} ${this.silence}`; const command = this.compileCommand || defaultCommand; this.log(`Running: ${command}\n(this can take a few seconds)...`); shell.cd(this.coverageDir); shell.exec(command); this.te...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "generateCoverageEnvironment() {\n this.log('Generating coverage environment');\n\n try {\n this.sanityCheckContext();\n\n let files = shell.ls('-A', this.workingDir);\n const nmIndex = files.indexOf('node_modules');\n\n // Removes node_modules from array (unless requested).\n if (!th...
[ "0.70765644", "0.6817894", "0.61155796", "0.59920865", "0.57649386", "0.5419858", "0.541129", "0.5354107", "0.53406775", "0.52130353", "0.5074433", "0.5055304", "0.5050444", "0.50305134", "0.502069", "0.49940857", "0.4968048", "0.4956733", "0.4917575", "0.4903576", "0.4820996...
0.85908705
0
Generates a random quote from the quotes array that is piped into the function Checks if the quotes array length is not equal to the previousQuoteNumbers array and generates a random number
function getRandomQuote(quotearray) { "use strict"; if (quotearray.length !== previousQuoteNumbers.length) { quoteNumber = Math.floor(Math.random() * quotearray.length); //Checks to make sure the randomly generated number hasn't been generated previously while (previousQuoteNumbers.index...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRandomQuote() {\n //random number generator using the index of the quotes array\n let randomNum = quotes[Math.floor(Math.random() * quotes.length)];\n return randomNum;\n}", "function getRandomQuote (array) {\n let randomNumberMaker = Math.floor(Math.random() * array.length);\n myQuote = array[r...
[ "0.7931177", "0.77702695", "0.7765591", "0.773188", "0.7682061", "0.7600526", "0.7592519", "0.7584322", "0.7573601", "0.7554766", "0.7551298", "0.75364447", "0.75324225", "0.7530788", "0.7527879", "0.75229037", "0.7487283", "0.7473101", "0.746839", "0.7465969", "0.74626833", ...
0.8199643
0
2. Using the && operator, consider the following below: Consider a && b a is checked if it is true or false If a is false, false is returned b is checked if it is true or false. If b is false, false is returned. Otherwise, true is returned (as both a and b are therefore true )
function and(a, b) { if(a && b){ const isNow = true; return isNow; } else{ const nowIs = false; return nowIs; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function and(a, b) {\n return a && b\n}", "function andOp(a, b){\r\n return (a === true) ? b :\r\n (a === false) ? false : error(and);\r\n}", "function worksLikeAnd(a, b){\n\tif(!a || !b){\n\t\treturn false;\n\t}\n\treturn true;\n}", "function worksLikeAnd(a, b){\n\tif(!a || !b){\n\t\treturn...
[ "0.8130436", "0.7681204", "0.7249961", "0.7249961", "0.7158026", "0.7120429", "0.70014644", "0.6986847", "0.6632783", "0.6632783", "0.6632783", "0.6632783", "0.6632783", "0.6632783", "0.6632783", "0.6632783", "0.6547914", "0.6547914", "0.6501913", "0.6501913", "0.6473046", ...
0.8163157
0
iframe resize Usage : postSize(event) when the parent window resize.
function postSize(e) { var target = parent.postMessage ? parent : (parent.document.postMessage ? parent.document : undefined); if (typeof target != "undefined") { target.postMessage($("body").outerHeight(), "*"); //target.postMessage('{"action": "scroll"}', "*"); } if (window.addEvent...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parentIframeResize() {\r\n\tvar height = getParam('height');\r\n\t// This works as our parent's parent is on our domain\r\n\tparent.parent.resizeIframe(height);\r\n}", "function onPymParentResize(width) {}", "function __resizeIframe(){\n //if(force_wi...
[ "0.75889033", "0.7458043", "0.7315478", "0.72869533", "0.7236044", "0.7226396", "0.7226396", "0.7211935", "0.7091494", "0.7066281", "0.7033257", "0.6962927", "0.6956225", "0.6946696", "0.69130874", "0.68310714", "0.68254185", "0.68215704", "0.6821547", "0.6813518", "0.6759922...
0.7516335
1
Turn the audio recording on/off. if turning off, then transmit the data to the server, and invoke the callback function on success/failure, if one is provided. Pass in "null" if cb is not needed. If "options['verboseFlag']" is set to True, then a message is displayed to the user to notify them that data is being transm...
function toggleRecordingSilent(e, cbSuccess, cbFailure, options) { // Toggle the audio recording, without making any changes to the UI (such as button labels, AJAX indicators, etc) if (e.classList.contains("recording")) { // stop recording audioRecorder.stop(); e.classList.remove("record...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stopRecording(callback, AudioFormat) {\n // Stop the recorder instance\n recorder && recorder.stop();\n console.log('Stopped recording.');\n\n // Stop the getUserMedia Audio Stream\n audio_stream.getAudioTracks()[0].stop();\n\n // Disable Stop button and enable Record button\n documen...
[ "0.5815148", "0.58103", "0.5755182", "0.5562034", "0.5396667", "0.53407127", "0.532741", "0.53002244", "0.5299336", "0.5280724", "0.5273095", "0.52173626", "0.5214006", "0.5198779", "0.51967883", "0.5185792", "0.5185238", "0.5184791", "0.51811486", "0.51798296", "0.5166704", ...
0.72673655
0
Collision Trigger Handler for activating inactive respawn points when the player steps on them.
function OnTriggerEnter(collider : Collider) { /** Only detect collisions on the static 'current' respawn prefab, and only from GameObjects with the 'Player' tag. Built-in and self-defined object level tags for quick object lookup is more efficient than other methods available such as GameObject.Find(string),...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "playerCollision(rid, lid, uid, bid) {\n // if enemy comes in contact with \"moving blue\" tiles or the player itself\n if(lid == -1 || rid == -1 || uid == -1 || bid == -1 || dist(this.x, this.y, player.x, player.y) < 20){\n // play sound\n collisionsound.play();\n // reset player position, gra...
[ "0.62183017", "0.6017716", "0.59970206", "0.5971239", "0.5968441", "0.5951045", "0.5924209", "0.5913848", "0.58985484", "0.58961487", "0.5892955", "0.58852774", "0.58616793", "0.5853866", "0.58268344", "0.58237445", "0.58232117", "0.5809604", "0.5766332", "0.57493716", "0.574...
0.6594944
0
Sets active state for this particular respawn prefab
function SetActive () { isActive = true; emitterActive.emit = true; emitterInactive.emit = false; respawnLight.intensity = 3.5; audio.Play(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setActive() {\n if (!isActive) {\n setIsActive(true);\n } else {\n setIsActive(false);\n }\n }", "function set_active(obj){\n\t\tobj.css(\"background\", \"#13293D\");\n\t}", "activate(){\n if(!this.active) this.sound.play();\n this.active = true;\n this.game.ca...
[ "0.670839", "0.61260545", "0.60750926", "0.6053153", "0.5976167", "0.5958082", "0.5907872", "0.590272", "0.5895303", "0.5886978", "0.58865845", "0.5830396", "0.57733685", "0.57123685", "0.57039684", "0.56857276", "0.56377894", "0.56318784", "0.5612493", "0.5603586", "0.552763...
0.6201901
1
Sets inactive state for this particular respawn prefab
function SetInactive () { emitterActive.emit = false; emitterInactive.emit = true; respawnLight.intensity = 1.5; audio.Stop(); isActive = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inactive() {\r\n let index = charakterInactiveIndex % inactiveCharakter.length;\r\n\r\n currentinactiveCharakterImage = inactiveCharakter[index];\r\n\r\n charakterInactiveIndex = charakterInactiveIndex + 1;\r\n}", "respawn() {\n this.state = new CreatureState(this, this.gameEngine, this.getDefault...
[ "0.5812246", "0.56460434", "0.521879", "0.51916534", "0.5183923", "0.5174395", "0.5166252", "0.51556605", "0.5123704", "0.5103944", "0.5087479", "0.50788164", "0.5064709", "0.5064709", "0.5064709", "0.5064709", "0.5062556", "0.50567204", "0.5055187", "0.5041741", "0.5001583",...
0.57989746
1
Emit a burst of particles upward in a concentrated ring
function EmitParticleBurst() { emitterRespawn1.Emit(); emitterRespawn2.Emit(); emitterRespawn3.Emit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function particleBurst()\n{\n\temitter = spriteGroup.add(game.add.emitter(124, 275, 10));\n\temitter.makeParticles('star');\n\temitter.gravity = 0;\n\temitter.alpha = 0.8;\n\temitter.start(true, 1000, null, 50);\n\n\tgame.add.tween(emitter).to(\n\t\t{\n\t\t\talpha: 0\n\t\t},\n\t\t1000,\n\t\tPhaser.Easing.Linear.Ou...
[ "0.705991", "0.6252384", "0.61840284", "0.61656594", "0.6081738", "0.60683745", "0.6053276", "0.60255253", "0.5983986", "0.59712464", "0.5888598", "0.5832073", "0.5829926", "0.58009464", "0.57958156", "0.5794615", "0.57833487", "0.57810974", "0.5777751", "0.5753275", "0.57522...
0.739027
0
Brightens the light intensity, emit's a particle burst and plays the given AudioClip before lowering the intensity of the light again.
function FireEffect (sfxClip : AudioClip) { respawnLight.intensity = 3.5; EmitParticleBurst(); if (sfxClip) { // if we have a 'player is respawning' sound effect, play it now. AudioSource.PlayClipAtPoint(sfxClip, transform.position, SFXVolume); } yield WaitForSeconds (2); respawnLight.intensity = 2.0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function trigger_sound_hit_water() {\n sound_hit_water.pause();\n sound_hit_water.currentTime = 0;\n sound_hit_water.play();\n}", "goSound() {\n //High D\n soundEffect(1174.66, 0, 0.8, \"square\", 0.1, 0, 0);\n }", "doRainbow(color) {\n if(this.rainbowOn){\n this.airStream...
[ "0.61215293", "0.6095188", "0.5884935", "0.58519185", "0.5816168", "0.58053625", "0.56325495", "0.56232166", "0.5616067", "0.5601002", "0.56001425", "0.5594891", "0.5584663", "0.5579522", "0.5571001", "0.55527353", "0.55232435", "0.5492401", "0.5488611", "0.5479554", "0.54594...
0.7144261
0
All ASSETS AND CODE ARE COPYRIGHT M&G PRUDENTIAL All ASSETS AND CODE ARE COPYRIGHT M&G PRUDENTIAL Following three functions push array of package data to relevant collection in database TODO: Properly generalise these functions Takes a JSON object parameter from packageHistory and pushes array of this data into databas...
function package1Data(package1Json) { const newArr = []; for (let i = 0; i < package1Json.versions.length; i += 1) { const package1Stats = new Package1Schema({ version: package1Json.versions[i].version, releasedate: package1Json.versions[i].releasedate, type: package1Json.versions[i].type, }); newArr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function package2Data(package2Json) {\n\tconst newArr = [];\n\n\tfor (let i = 0; i < package2Json.versions.length; i += 1) {\n\t\tconst package2Stats = new Package2Schema({\n\t\t\tversion: package2Json.versions[i].version,\n\t\t\treleasedate: package2Json.versions[i].releasedate,\n\t\t\ttype: package2Json.versions...
[ "0.6227201", "0.6174395", "0.60845697", "0.6020368", "0.5920802", "0.59182626", "0.56441015", "0.5628699", "0.551887", "0.54113823", "0.54004246", "0.5378133", "0.5360709", "0.5264521", "0.5229371", "0.5222433", "0.52185076", "0.51783484", "0.5149202", "0.51429856", "0.513399...
0.6375122
0
All ASSETS AND CODE ARE COPYRIGHT M&G PRUDENTIAL All ASSETS AND CODE ARE COPYRIGHT M&G PRUDENTIAL Deletes current collection for each package then reinserts all uptodate data during manually run script. This function is called during a manual script that can be run as a yarn command.
function manualRefresh() { const package3Promise = new Promise((resolve, reject) => Package3Schema.deleteMany((err) => { if (err) { console.error('Error deleting package_3 collection: ', err); reject(err); } else { console.log('package_3 collection cleared'); package3Data(packageHistory('package_3')) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refreshDatabases() {\n\tPackage3Schema.deleteMany((err) => {\n\t\tif (err) {\n\t\t\tconsole.error('Error deleting package_3 collection: ', err);\n\t\t} else {\n\t\t\tconsole.log('package_3 collection cleared');\n\t\t\tpackage3Data(packageHistory('package_3'));\n\t\t}\n\t});\n\n\tPackage2Schema.deleteMany(...
[ "0.6276294", "0.5750595", "0.5723963", "0.5626264", "0.5596343", "0.55874634", "0.55633557", "0.55158925", "0.54980135", "0.5497614", "0.5452102", "0.5445755", "0.54147923", "0.53793764", "0.5351248", "0.53122216", "0.5308331", "0.5303366", "0.5301853", "0.5279849", "0.527926...
0.68901056
0
load menu from async storage
async function getAsyncMenu() { try { await AsyncStorage.getItem('todaysMenu').then(object => JSON.parse(object)).then(object => { updateSearchObject(object) }); } catch (error) { console.error(error); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadMenu(strRoleName) {\n\n\t\t\n\t\tiseConstants.languagename = localStorage.getItem(\"LanguageName\");\n\t\t\n\t\t\n var organization = localStorage.getItem(\"organizations\");\t\n var roleName = strRoleName;\n\t\tvar user\t = localStorage.getItem('username');\n\t\tvar project \t =...
[ "0.67171115", "0.6711414", "0.6707556", "0.6639582", "0.6553743", "0.6515388", "0.6456454", "0.6379555", "0.6353538", "0.63167006", "0.62879", "0.6242023", "0.62321013", "0.6218158", "0.6192705", "0.6186573", "0.61855435", "0.61771107", "0.615714", "0.61485744", "0.6106388", ...
0.72986925
0
load favorite foods from async storage
async function getFavs() { try { let newFavs = await AsyncStorage.getItem('favoritesArray').then(object => object ? changeFavs(JSON.parse(object)) : changeFavs([])); } catch (error) { console.error(error); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadFavorites() {\n var parsedFavorites = JSON.parse( localStorage.getItem('favoritesArray') );\n if (parsedFavorites) {\n for (let i = 0; i < parsedFavorites.length; i++){\n favoriteAdd(parsedFavorites[i]);\n }\n }\n\n}", "function loadFavoriteItems() {\n activeBtn(...
[ "0.7273134", "0.6981236", "0.6837006", "0.6825661", "0.67903334", "0.678913", "0.6704318", "0.6632001", "0.6574672", "0.65706825", "0.6562342", "0.6504434", "0.6481224", "0.64485323", "0.6433628", "0.6416064", "0.64070165", "0.63994604", "0.6370797", "0.6299627", "0.628797", ...
0.7456866
0
Function to remove the current active menu and call to add the next active page.
function removeActive(caller){ if (currentActivePage == 1 && caller != 1){ $('.menu_one').removeClass('active'); addActive(caller); } else if (currentActivePage == 2 && caller != 2) { $('.menu_two').removeClass('active'); addActive(caller); } else if (currentActivePage == 3 && caller != 3) { $('.menu_three...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeCurrent() {\n $navItems.removeClass(\"currentPage\");\n }", "function addActive(newActive){\n\tif(newActive == 1){\n\t\t$('.menu_one').addClass('active');\n\t\tcurrentActivePage = 1;\n\t} else if (newActive == 2) {\n\t\t$('.menu_two').addClass('active');\n\t\tcurrentActivePage = 2;\n\t} else i...
[ "0.718136", "0.6615657", "0.6408484", "0.6374481", "0.62404835", "0.61534286", "0.61240697", "0.6091645", "0.6078647", "0.6047245", "0.6027028", "0.6017896", "0.5998901", "0.5962232", "0.596112", "0.5927514", "0.5925791", "0.5898068", "0.58952695", "0.58780336", "0.58759403",...
0.7130143
1
function that updates the frame rate
function updateFrameRate(currentRate) { frameRate(currentRate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set frameRate(value) {}", "_update()\n {\n const now = performance.now();\n const deltaTime = now - this._lastUpdate;\n\n if(deltaTime >= this._updateInterval) {\n this._fps = Math.round(this._frames / (deltaTime * 0.001));\n this._frames = 0;\n this._last...
[ "0.82045496", "0.79732966", "0.7915321", "0.7811641", "0.77478814", "0.7455272", "0.7407225", "0.7400857", "0.72417104", "0.7170367", "0.71441686", "0.70779896", "0.6943683", "0.6920228", "0.6920228", "0.6886686", "0.6870979", "0.6826578", "0.6818977", "0.6809503", "0.6802568...
0.8507617
0
Set up the score = current snake length offset the starting length
function getScore() { return snakePoints.length - lengthOffset; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lengthenSnakeByOne() {\n snake.currentLength = snake.currentLength + 1;\n return snake.currentLength;\n}", "function updateSnakeContent() {\n // if(score<=firstPoem.length){\n\n // }\n snakePoem.push(firstPoem[score - 1]);\n}", "function init() {\n snake = [];\n snake.push(new Vector(0,10))...
[ "0.68569475", "0.6664321", "0.65970564", "0.631682", "0.629404", "0.61384755", "0.61270905", "0.61216694", "0.6112927", "0.60700107", "0.60516006", "0.60347813", "0.60347587", "0.60268104", "0.6001742", "0.600034", "0.59806186", "0.59394664", "0.59123856", "0.59047437", "0.58...
0.77618957
0
Create Marker for Companies
function createMarkerForCompany(latlng, name, color) { var marker = new google.maps.Marker({ position: latlng, map: map, icon: { // path: google.maps.SymbolPath.BACKWARD_CLOSED_ARROW, path: google.maps.SymbolPath.CIRCLE, strokeC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Company(cpObject) {\n this.companyId = cpObject.CompanyId;\n this.companyName = cpObject.CompanyName;\n this.companyAddress = cpObject.CompanyAddress;\n this.telephone = cpObject.Telephone;\n this.fax = cpObject.Fax;\n this.classification = cpObject.Classification;\n this.numberOfActi...
[ "0.5960356", "0.58785343", "0.56984603", "0.5630791", "0.5627134", "0.5615734", "0.55717593", "0.55340105", "0.552179", "0.5498575", "0.5497128", "0.54946154", "0.5466751", "0.5453148", "0.5445854", "0.54249257", "0.5414184", "0.5411296", "0.5393261", "0.5375078", "0.53347707...
0.627879
0
Create Marker for Employees
function createMarkerForEmployee(latlng, name, color) { var marker = new google.maps.Marker({ position: latlng, map: map, icon: { path: google.maps.SymbolPath.BACKWARD_CLOSED_ARROW, strokeColor: color, strokeWeight: 4, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "generateMarkers(entities, markers, encounterRangeMarkers, iconGroup) {\n\n if(markers) { //check for existing markers\n this.clearMarkers(markers, encounterRangeMarkers);\n }\n\n // Add Interactable Markers\n (entities).forEach((entity) => {\n ...
[ "0.6476584", "0.6409189", "0.61677957", "0.60326314", "0.60281783", "0.5960253", "0.5932835", "0.5894757", "0.58789647", "0.58436227", "0.5839216", "0.58141017", "0.580296", "0.57913023", "0.577891", "0.57768697", "0.57472765", "0.57454246", "0.57452494", "0.57203364", "0.571...
0.6890878
0
for component views, this is the host element. for embedded views, this is the index of the parent node that contains the view container.
function viewParentEl(view) { return view.parent ? view.parentNodeDef.parent : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function viewParentEl(view) {\n var parentView = view.parent;\n if (parentView) {\n return view.parentNodeDef.parent;\n }\n else {\n return null;\n }\n}", "function viewParentEl(view) {\n var parentView = view.parent;\n if (parentView) {\n return view.parentNodeDef.paren...
[ "0.6612719", "0.6612719", "0.6612719", "0.6612719", "0.6612719", "0.661203", "0.661203", "0.661203", "0.661203", "0.661203", "0.661203", "0.661203", "0.661203", "0.661203", "0.661203", "0.6542321", "0.6375185", "0.62454623", "0.62454623", "0.62454623", "0.62454623", "0.6244...
0.69570595
0
Finds the index of the parent injector, with a view offset if applicable. Used to set the parent injector initially. Returns a combination of number of `ViewData` we have to go up and index in that `Viewdata`
function getParentInjectorLocation(tNode, view) { if (tNode.parent && -1 !== tNode.parent.injectorIndex) return tNode.parent.injectorIndex; // ViewOffset is 0 // For most cases, the parent injector index can be found on the host node (e.g. for component // or container), so this loop...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getParentInjectorLocation(tNode, view) {\n if (tNode.parent && tNode.parent.injectorIndex !== -1) {\n return tNode.parent.injectorIndex; // ViewOffset is 0\n }\n // For most cases, the parent injector index can be found on the host node (e.g. for component\n // or container), so this lo...
[ "0.6893629", "0.6893629", "0.6890869", "0.6890869", "0.68770957", "0.6119756", "0.6119756", "0.6119756", "0.6119756", "0.6119756", "0.6119756", "0.6119756", "0.6119756", "0.6119756", "0.59368616", "0.5913785", "0.56524885", "0.56524885", "0.56524885", "0.56524885", "0.5652488...
0.690005
0
Searches for the given token among the node's directives and providers.
function locateDirectiveOrProvider(tNode, lView, token, canAccessViewProviders, isHostSpecialCase) { for (var nodeProviderIndexes = tNode.providerIndexes, tInjectables = lView[_interfaces_view__WEBPACK_IMPORTED_MODULE_7__.s].data, injectablesStart = 65535 /* ProvidersStartIndexMask */ & nodeProviderIndexes,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function locateDirectiveOrProvider(tNode, tView, token, canAccessViewProviders, isHostSpecialCase) {\n var nodeProviderIndexes = tNode.providerIndexes;\n var tInjectables = tView.data;\n var injectablesStart = nodeProviderIndexes & 65535 /* ProvidersStartIndexMask */;\n var directivesStart = tNode.dire...
[ "0.60100275", "0.60100275", "0.59765685", "0.59765685", "0.59765685", "0.59765685", "0.59765685", "0.59765685", "0.59765685", "0.59765685", "0.59765685", "0.59765685", "0.59148765", "0.59148765", "0.5309382", "0.5293358", "0.5211247", "0.51287276", "0.512554", "0.50494695", "...
0.61237454
0
Returns whether the `renderer` is a `ProceduralRenderer3`
function isProceduralRenderer(renderer) { return !!renderer.listen; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isProceduralRenderer(renderer) {\n return !!(renderer.listen);\n}", "function isProceduralRenderer(renderer) {\n return !!(renderer.listen);\n}", "function isProceduralRenderer(renderer) {\n return !!(renderer.listen);\n}", "function isProceduralRenderer(renderer) {\n return !!(renderer....
[ "0.7052931", "0.7052931", "0.7052931", "0.7052931", "0.7052931", "0.7052931", "0.7052931", "0.7052931", "0.7052931", "0.7052931", "0.7052931", "0.7052931", "0.7052931", "0.7052931", "0.7052931", "0.5795696", "0.5795696", "0.57464105", "0.57464105", "0.57464105", "0.57464105",...
0.7066682
0
Determines whether or not the given string is a property metadata string. See storeBindingMetadata().
function isPropMetadataString(str) { return str.indexOf(INTERPOLATION_DELIMITER) >= 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPropMetadataString(str) {\n return str.indexOf(INTERPOLATION_DELIMITER) >= 0;\n}", "function isPropertyTypeUri(uri) {\n return ($.inArray(unurify(uri), PROPERTY_TYPES) != -1); \n }", "function IsPropertyKey(argument) {\n if (Type(argument) === 'string') return true;\n if (Type(argument)...
[ "0.7464869", "0.63997114", "0.5956818", "0.57739604", "0.57739604", "0.5728332", "0.5666278", "0.563742", "0.5609828", "0.5600103", "0.5600103", "0.5588952", "0.5556252", "0.5521742", "0.5512749", "0.5512749", "0.5512749", "0.5512749", "0.5512749", "0.5512749", "0.5512749", ...
0.7375161
1
The expectation is that the activate route is created with the right set of parameters. So we push new values into the observables only when they are not the initial values. And we detect that by checking if the snapshot field is set.
function advanceActivatedRoute(route) { if (route.snapshot) { var currentSnapshot = route.snapshot, nextSnapshot = route._futureSnapshot; route.snapshot = nextSnapshot, Object(_utils_collection__WEBPACK_IMPORTED_MODULE_5__.d)(currentSnapshot.queryParams, nextSnapshot.queryPar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function advanceActivatedRoute(route) {\n\t if (route.snapshot) {\n\t if (!shallowEqual(route.snapshot.queryParams, route._futureSnapshot.queryParams)) {\n\t route.queryParams.next(route._futureSnapshot.queryParams);\n\t }\n\t if (route.snapshot.fragment !== r...
[ "0.5569947", "0.55638987", "0.5537084", "0.54965955", "0.54965955", "0.54965955", "0.546637", "0.546637", "0.546637", "0.546637", "0.546637", "0.546637", "0.546637", "0.546637", "0.54091036", "0.5368897", "0.534607", "0.52171564", "0.5157254", "0.5157254", "0.5138519", "0.5...
0.5673672
0
If `isParent` is: `true`: then `previousOrParentTNode` points to a parent node. `false`: then `previousOrParentTNode` points to previous node (sibling).
function getIsParent() { // top level variables should not be exported for performance reasons (PERF_NOTES.md) return isParent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPreviousOrParentTNode() {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return previousOrParentTNode;\n }", "function prev_node(node){\n while (node) {\n if (node.previousSibling)\n r...
[ "0.6619158", "0.6130957", "0.5759473", "0.5670812", "0.55811095", "0.5519243", "0.54795545", "0.5467654", "0.5465527", "0.54502165", "0.5414379", "0.54121983", "0.538632", "0.5369179", "0.53168845", "0.5299747", "0.52706385", "0.5263348", "0.52543926", "0.52463865", "0.523140...
0.6168011
1
Query instructions can ask for "current queries" in 2 different cases: when creating view queries (at the root of a component view, before any node is created in this case currentQueries points to view queries) when creating content queries (i.e. this previousOrParentTNode points to a node on which we create content qu...
function getOrCreateCurrentQueries(QueryType) { var lView = getLView(), currentQueries = lView[_interfaces_view__WEBPACK_IMPORTED_MODULE_2__.n]; // If this is the first content query on a node, any existing LQueries needs to be cloned. // In subsequent template passes, the cloning oc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCurrentQueries(QueryType) {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return currentQueries ||\n (currentQueries =\n (previousOrParentNode.queries && previousOrParentNode.queries.clone() ||\n new QueryType()));\n}", ...
[ "0.71464777", "0.6934222", "0.6934222", "0.57256866", "0.57256866", "0.57256866", "0.57256866", "0.56181735", "0.56181735", "0.55827725", "0.55827725", "0.55827725", "0.55827725", "0.5576941", "0.5576941", "0.5559752", "0.5483467", "0.5430016", "0.5430016", "0.5426801", "0.53...
0.7452974
0
harmony import Sanitizes the given untrusted CSS style property value (i.e. not an entire object, just a single value) and returns a value that is safe to use in a browser environment.
function _sanitizeStyle(value) { // Make sure it's actually a string. if (!(value = String(value).trim())) return ""; // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for // reasoning behind this. var urlM...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var urlMatch = value.match(URL_RE);\n...
[ "0.74458665", "0.7340815", "0.7340815", "0.7340815", "0.7340815", "0.7340815", "0.7325241", "0.73027647", "0.73027647", "0.6799058", "0.6748695", "0.648009", "0.648009", "0.648009", "0.6430112", "0.6430112", "0.6430112", "0.6430112", "0.6430112", "0.6430112", "0.63920915", ...
0.7441684
1