Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Get promise for working with collection
function getBulkWritePromise(db, collectionName, data) { return connection .getCollection(db, collectionName) .then(collection => doBulkWriteCollection(collection, data[collectionName])); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getCollection() {\n await this.init();\n return new Promise(async (resolve, reject) => {\n if (this.collectionId){\n resolve();\n }\n else { //create a collection \n let options = {\n environment_id: this.environm...
[ "0.7017364", "0.65975237", "0.65445286", "0.64036685", "0.63396263", "0.6329239", "0.621206", "0.61807543", "0.6174128", "0.61378974", "0.6110369", "0.60560375", "0.60466874", "0.6043234", "0.5958007", "0.5895525", "0.5883023", "0.58742285", "0.5834343", "0.58321035", "0.5826...
0.58069694
24
Bulk write to single given collection
function doBulkWriteCollection(collection, data) { return new Promise(function (resolve, reject) { const batch = collection.initializeOrderedBulkOp(); addInserts(batch, data); addUpdates(batch, data); addDeletes(batch, data); batch.execute(function(e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doBulkWrite(db) {\n const data = request.body.data;\n const bulkPromises = [];\n\n for (var collectionName in data) {\n var promise = getBulkWritePromise(db, collectionName, data);\n bulkPromises.push(promise);\n }\n\n return Promise.all(bulkPromise...
[ "0.7194955", "0.66620404", "0.6634837", "0.6624742", "0.63699645", "0.63483155", "0.629057", "0.6266586", "0.6193648", "0.6120158", "0.60686946", "0.60249364", "0.60207075", "0.6016237", "0.59538144", "0.5946971", "0.5904844", "0.5881866", "0.5872566", "0.5787518", "0.5761279...
0.7738649
0
Add insert operations to batch
function addInserts(batch, data) { if (typeof data.insert === 'undefined') return; for (var i = 0; i < data.insert.length; i++) { var doc = data.insert[i]; if (typeof doc._id !== 'undefined') { doc._id = castId(doc._id); } batch.insert(d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertAndGetBatch() {\n var docs = [];\n ['foo', 'bar', 'la', 'bamba'].forEach(function (val) {\n docs.push({value: val});\n });\n\n return dataDb.saveAsync(docs)\n .then(function () {\n return dataDb.viewAsync('data/byValue', {keys: ['foo', 'bar'], limit: 10});\n ...
[ "0.7095778", "0.6680517", "0.66649437", "0.6468712", "0.6452542", "0.63912606", "0.6367889", "0.625406", "0.6241402", "0.620163", "0.61404085", "0.61293525", "0.6042295", "0.59831613", "0.5961053", "0.5913651", "0.59104425", "0.5886406", "0.5882125", "0.5858036", "0.5851931",...
0.7815232
0
Add update operations to batch
function addUpdates(batch, data) { if (typeof data.update === 'undefined') return; for (var i = 0; i < data.update.length; i++) { var doc = data.update[i]; var id = castId(doc._id); delete doc._id; batch.find({_id: id}).updateOne({$set: doc}); }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async _apply (batch) {\n const b = this.bee.batch({ update: false })\n for (const node of batch) {\n const op = JSON.parse(node.value.toString())\n // TODO: Handle deletions\n if (op.type === 'put') await b.put(op.key, op.value)\n }\n await b.flush()\n }", "prepareUpdateBatch(batch) {...
[ "0.72445667", "0.6849505", "0.64314234", "0.6400162", "0.6400162", "0.6400162", "0.63857925", "0.62910074", "0.62026554", "0.6146948", "0.61253667", "0.60509396", "0.6032636", "0.6006308", "0.59787905", "0.59738797", "0.59567577", "0.5954667", "0.5946685", "0.5936344", "0.593...
0.7310842
0
Add delete operations to batch
function addDeletes(batch, data) { if (typeof data.delete === 'undefined') return; for (var i = 0; i < data.delete.length; i++) { var doc = data.delete[i]; if (typeof doc._id !== 'undefined') { doc._id = castId(doc._id); } batch.find(doc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doBatchDelete(batch) {\r\n\r\n const requestBatch = buffer.nextKeys.map((keyVal) => {\r\n return {\r\n DeleteRequest: {\r\n Key: { [keyString]: keyVal }\r\n }\r\n };\r\n });\r\n\r\n let params = {\r\n RequestItems: {}\r\n };\r\n\r\n params.RequestItems[...
[ "0.7378169", "0.71370906", "0.6798564", "0.6719851", "0.66789275", "0.6454975", "0.6371245", "0.6326976", "0.6278756", "0.6231033", "0.61859804", "0.61531794", "0.61443895", "0.6101253", "0.6100855", "0.60742056", "0.6067993", "0.6039487", "0.60090345", "0.5982522", "0.597988...
0.76767653
0
split \n longest word function
function longest(str) { rectMode(CENTER); words = str.split("\n"); let longestSize = 0 for (let word of words) { if (longestSize < textWidth(word)) { longestSize = textWidth(word); } } let height = 2 * textAscent() * max(words.length - 1, 0.5); return [longestSize + 50, height + 50...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function longestWord(sen) {}", "function longest(words) {\n\n}", "function longestWord(sentence) {\n//Declaring variables used in the function longestWord\n var wordSeparator = sentence.split(' ');\n var longestLength = wordSeparator.length;\n var longerWord = ' ';\n //for loop to run from 0 to length of ...
[ "0.720859", "0.71507394", "0.6811699", "0.68046963", "0.67657244", "0.66023904", "0.6573976", "0.65616304", "0.6533494", "0.64631635", "0.6450581", "0.6427799", "0.6423201", "0.64225346", "0.63999814", "0.63818675", "0.6359692", "0.63466215", "0.6339821", "0.63225836", "0.631...
0.66990095
5
convert MC coords to canvas
function convertX(p) { return 0.2504 * p - 381.399 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "trackToCoords(_c) {\r\n\t\t\t\tthis.x = _c.x - (SCREEN_WIDTH*0.5)|0;\r\n\t\t\t\tthis.y = _c.y - (SCREEN_HEIGHT*0.5)|0;\r\n\t\t\t}", "function toCanvasSpace(location, centerLoc) {\n\tvar relativeLoc = new Location(location.x + -centerLoc.x, location.y + -centerLoc.y); \n\treturn new Location(relativeLoc.x * Rende...
[ "0.64642245", "0.6180519", "0.6132028", "0.6086403", "0.6067565", "0.60337317", "0.5993156", "0.59834456", "0.5950327", "0.5942934", "0.5866501", "0.57699704", "0.57686234", "0.57650524", "0.57493013", "0.5746809", "0.5719211", "0.5699854", "0.56199527", "0.5609944", "0.55866...
0.0
-1
Principle 3 code example for New Binding
function friendlyPeople(person) { this.greeting = "Morning "; this.person = person; this.speak = function() { console.log(this.greeting + this.person); console.log(this); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Component_BindingHandler() {}", "function NewBinding(message, name) {\nthis.name = name;\nthis.message = message;\nthis.say = function(){\n return `${this.name} has a message for you: ${this.message}.`\n}\n}", "function BindFactory(){}", "function moduleBinding(name, bindings){\n this.name =...
[ "0.69899845", "0.6887838", "0.6785255", "0.6202083", "0.6165166", "0.61402607", "0.61162895", "0.6058128", "0.6039367", "0.60357714", "0.59840363", "0.59252936", "0.58935064", "0.58935064", "0.5873889", "0.5873889", "0.58523065", "0.58366257", "0.58196187", "0.5776518", "0.57...
0.0
-1
Principle 4 code example for Explicit Binding
function cell() { console.log(this.ringtone); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Component_BindingHandler() {}", "function Bind_A_A_A() {\r\n}", "function Bind_A_Oother() {\r\n}", "function Bind_A_Obound() {\r\n}", "function bindable(){\n\t\t\n\t}", "Bind(IDispatch, string, string) {\n\n }", "constructor() { \n autoBind(this); \n }", "function Bind_A_A_R() {\r\n}"...
[ "0.6447483", "0.6242783", "0.61487275", "0.61337143", "0.6118641", "0.6040933", "0.6023827", "0.5958874", "0.5940821", "0.5874887", "0.5873397", "0.58557445", "0.5764696", "0.567705", "0.5673003", "0.5655911", "0.5655911", "0.5655911", "0.5617473", "0.5592617", "0.55375355", ...
0.0
-1
Metodos para ocultar formularios
function ocultar_busqueda() { document.getElementById("formBusqueda").style.display = "none"; document.getElementById("fade").style.display = "none"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "validarInfo() {\n if (this.erros.length > 0) {\n this.validador.style.display = \"table-row\";\n this.imprimirErros(this.erros);\n } else if ((this.validarRepetido(this.nome, this.peso, this.altura)) == false) {\n this.calculaIMC();\n this.adicionarElemento...
[ "0.6067786", "0.6025762", "0.58580714", "0.5841659", "0.5801623", "0.5757836", "0.57543653", "0.5747976", "0.5730162", "0.5700111", "0.56896985", "0.5623424", "0.56213504", "0.5603087", "0.5601205", "0.5591318", "0.5576242", "0.5557224", "0.5548801", "0.5546922", "0.55177224"...
0.0
-1
Funcion que previsualiza imagen de perfil cargada en registro
function archivo(evt) { var files = evt.target.files; for (var i = 0, f; f = files[i]; i++) { //Solo admitimos imágenes. if (!f.type.match('image.*')) { continue; } var reader = new FileReader(); reader.onload = (function (theFile) { return func...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pasarFoto() {\r\n // se incrementa el indice (posicionActual)\r\n\r\n // ...y se muestra la imagen que toca.\r\n }", "function pasarFoto() {\n if(posicionActual >= imagenes.length -1) {\n posicionActual = 0;\n } else {\n posicionActual++;\n }\n...
[ "0.7059816", "0.68059736", "0.6786737", "0.67735726", "0.6726744", "0.662869", "0.6423639", "0.6351674", "0.63431156", "0.63197184", "0.6305726", "0.62950325", "0.6278456", "0.6275262", "0.6258231", "0.61782104", "0.6158803", "0.610247", "0.6099928", "0.6083759", "0.6076242",...
0.0
-1
Calcula la posicion de un elemento y la almacena en el nombre de ventana.
function recarga() { var bodyRect = document.body.getBoundingClientRect(); var v = document.getElementById('up').getBoundingClientRect(); var offset = v.top - bodyRect.top - 100; window.name = offset; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MenorAMayor(elem1, elem2){\n //return se encarga de finalizar la operación\n return elem1 - elem2;\n}", "function choquebolajug() {\n let bolas = document.getElementsByClassName('bola');\n let jugador = document.getElementById('jugador');\n\n for (let c = 0; c < bolas.length; ...
[ "0.5935421", "0.58214635", "0.56298333", "0.55840117", "0.55804074", "0.5570758", "0.5566262", "0.5541445", "0.5523766", "0.5488757", "0.54415387", "0.54365313", "0.54259354", "0.53914547", "0.53912485", "0.5368052", "0.5351556", "0.53406185", "0.53302133", "0.5300508", "0.52...
0.0
-1
Almacena en el nombre de ventana la posicion actual en la pagina
function recarga2() { window.name = self.pageYOffset || (document.documentElement.scrollTop + document.body.scrollTop); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function definir_pos() {\r\n\tconsole.log(posicaoAtual);\r\n\tif(posicaoAtual<0) posicaoAtual=posicaoMax;\r\n\telse if(posicaoAtual>posicaoMax) posicaoAtual=0;\r\n\r\n\tsetaEsquerda.href = '#id'+((posicaoAtual-1<0)? posicaoMax : posicaoAtual-1);\r\n\tsetaDireita.href = '#id'+((posicaoAtual+1>posicaoMax)? 0 : posic...
[ "0.6414692", "0.5916078", "0.58456206", "0.5711888", "0.5692797", "0.5651732", "0.5589839", "0.5554051", "0.55279213", "0.5508298", "0.54819095", "0.5481762", "0.5478448", "0.5477342", "0.54711217", "0.54542166", "0.54504687", "0.5432631", "0.5421592", "0.54184985", "0.540493...
0.5284899
29
Funcion que permite definir el action del formulario de buqueda para poder filtrar por noticias, foros o tutoriales
function defineActionBusqueda() { var formulario = document.getElementById('idformBusq'); var noticias = document.getElementById('opciones_1'); var tutoriales = document.getElementById('opciones_2'); var foros = document.getElementById('opciones_3'); if (foros.checked) { formulario.action =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listarTodo(){\n document.getElementById(\"IdFormulario\").action=\"/listarTodos/\";\n}", "function filtrar(idFormulario) {\r\n\tdocument.getElementById(idFormulario).submit();\r\n}", "function filtrar(idFormulario) {\r\n\tdocument.getElementById(idFormulario).submit();\r\n}", "function limparUlti...
[ "0.6132787", "0.59289247", "0.59289247", "0.5837537", "0.5757198", "0.57023877", "0.57023877", "0.5511548", "0.5457262", "0.5414426", "0.5405689", "0.53889483", "0.53781164", "0.5376811", "0.53701985", "0.53701985", "0.53593016", "0.5347647", "0.5340214", "0.53340906", "0.532...
0.6742489
0
Funcion que permite enviar un formulario para almacenar la url referer en una variable de sesion, en caso de ser distinta a la url actual.
function url_referer() { var refer = document.referrer; var actual = document.location; if (refer != actual) { document.getElementById('div_url_ref').innerHTML = '<input type="hidden" name="url_ref" value="' + document.referrer + '">'; document.getElementById('formUrlReferer').submit(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cambiarUrl(thisObj){\n\tvar campo = thisObj.attr('name');\n\tvar valor = thisObj.val();\n\tvar nombrePath = window.location.pathname;\n\tvar parametrosInput = thisObj.parents('form').find('#parametrosUrl').val();\n\n\t\n\twindow.history.replaceState(\"object\", nombrePath, nombrePath +'?'+ parametrosInput...
[ "0.6340209", "0.62220263", "0.600015", "0.58378184", "0.57708764", "0.5749208", "0.5749208", "0.5746007", "0.57034934", "0.5696394", "0.56538934", "0.5607953", "0.5559268", "0.5552433", "0.5549191", "0.553742", "0.55037165", "0.5498114", "0.5498114", "0.5452652", "0.54508984"...
0.65554553
0
2nd attemtpt: store count in hash map, not index, since have the index in the second loop anyway
function firstUniqueCharacter(str) { let indexCounter = {}; for (let i = 0; i < str.length; i++) { char = str[i]; indexCounter[char] ? indexCounter[char] += 1 : indexCounter[char] = 1; } for (let i = 0; i < str.length; i++) { char = str[i]; if (indexCounter[char] === 1) return i; } return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mapNameCount() {\n if (!this._key) return;\n this._nameCount = new Map(\n [\n ...this._items.reduce((map, item) => {\n if (!map.has(this._resetKey)) map.set(this._resetKey, 0);\n if (map.has(item[this._key]))\n map.set(item[this._key], map.get(item[this._key]) + 1);\n...
[ "0.67788535", "0.65875995", "0.6555141", "0.6450133", "0.6351637", "0.6245129", "0.62189686", "0.62164426", "0.6186188", "0.61771756", "0.6174402", "0.6131091", "0.6124252", "0.60761577", "0.60741043", "0.60689497", "0.6042114", "0.601696", "0.60138184", "0.59780097", "0.5949...
0.0
-1
Functon to create new google map
function initAutocomplete() { var map = new google.maps.Map(document.getElementById('map'), { center: ltln, zoom: zm, mapTypeId: 'roadmap' }); // Creates a searchbar var input = document.getElementById('searchbar-input'); var searchBox = new google.maps.places.SearchBox(input); map.co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function make_map() {\n map = new google.maps.Map($('#div_map_add_map').get(0), {\n center: {lat: 41.850033, lng: -87.6500523},\n zoom: 3\n });\n}", "function createNewMap(location){\n\t\t\t\t\t// get div element to place map\n\t\t\t\t\tvar mapDiv = document.getElementById('map');\n\t\t\t \t...
[ "0.78141075", "0.7771257", "0.775372", "0.77092063", "0.7521431", "0.7478995", "0.7476058", "0.7440789", "0.74211395", "0.7407821", "0.7399321", "0.7393009", "0.7392059", "0.737961", "0.7366056", "0.7353847", "0.73495495", "0.731769", "0.73069185", "0.7299247", "0.72906846", ...
0.0
-1
Move settings to foreground
function reopenSettings() { navigator.mozApps.getSelf().onsuccess = function getSelfCB(evt) { var app = evt.target.result; app.launch('settings'); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function switchSettings2Back() {\n /* Reset Focus */\n Draw.resetFocus();\n }", "preferencesFocused() {\n\t\tfinsembleWindow.removeEventListener('focused', this.preferencesFocused);\n\t\tthis.changePreferencesAlwaysOnTop(true);\n\t}", "function change_foreground() {\n\tdocument.execCommand(\"f...
[ "0.70268106", "0.6152944", "0.58611155", "0.58604497", "0.5842855", "0.57642895", "0.5727972", "0.56970507", "0.5689222", "0.56629723", "0.5655265", "0.5648316", "0.56366664", "0.5628959", "0.56179774", "0.5576434", "0.5563794", "0.5558695", "0.5536086", "0.5517343", "0.55122...
0.5612324
15
Open a link with a web activity
function openLink(url) { if (url.startsWith('tel:')) { // dial a phone number new MozActivity({ name: 'dial', data: { type: 'webtelephony/number', number: url.substr(4) } }); } else if (!url.startsWith('#')) { // browse a URL new MozActivity({ name: 'view', data: { type: 'url', u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onClickUrl(urlLink) {\n //Alert.alert(\"clicked\");\n Linking.openURL(\"http://\"+urlLink);\n \n }", "function openLink(url) {\n chrome.tabs.create({\n \"url\": url\n });\n}", "openLink(url) {\n window.open(url, \"_blank\")\n }", "function openLink(url)\n{\n navigator.app.l...
[ "0.7142258", "0.71041346", "0.70364547", "0.69807357", "0.68112147", "0.6770053", "0.67494583", "0.6743215", "0.6742079", "0.67333865", "0.67146504", "0.670911", "0.6682383", "0.6621856", "0.65895987", "0.6585758", "0.6538055", "0.65289444", "0.6503271", "0.6464013", "0.64627...
0.7869344
0
These socalled "dialog boxes" are just standard Settings panels () with reset/submit buttons: these buttons both return to the previous panel when clicked, and each button has its own (optional) callback.
function openDialog(dialogID, onSubmit, onReset) { if ('#' + dialogID == Settings.currentPanel) return; var origin = Settings.currentPanel; var dialog = document.getElementById(dialogID); var submit = dialog.querySelector('[type=submit]'); if (submit) { submit.onclick = function onsubmit() { i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "settings() {\n const bgdiv = $(`<div class=\"full-window-div\" style=\"background-color:#aaaa;\"></div>`)\n const dlg = $(`<div style=\"padding:8px; z-index: 2000; border-radius:8px; border: 1px solid black; background-color:white; min-width:200px; min-height:200px; position: fixed; left:50%; top:50%...
[ "0.6493368", "0.62929994", "0.62515557", "0.60962313", "0.60820675", "0.6070971", "0.59899163", "0.59267384", "0.5924682", "0.5916464", "0.588837", "0.58805597", "0.58730114", "0.58649164", "0.586305", "0.58311296", "0.58081245", "0.58073705", "0.5764875", "0.575471", "0.5754...
0.0
-1
Audio Preview First click = play, second click = pause.
function audioPreview(element, type) { var audio = document.querySelector('#sound-selection audio'); var source = audio.src; var playing = !audio.paused; // Both ringer and notification are using notification channel audio.mozAudioChannelType = 'notification'; var url = '/shared/resources/media/' + type +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function audioPreviewClick() {\n\taudioID = $(this).attr(\"data-dps-audio-id\");\n\taction = $(this).attr(\"data-dps-action\");\n\tparent = audioPreviewParent($(this));\n\tconsole.log(audioID + \", \" + action);\n\n\n\tif(action == \"play\") {\n\t\tif($(this).parent().find(\"audio\").length > 0) {\n\t\t\taudio = $...
[ "0.75271016", "0.702712", "0.6647216", "0.6579656", "0.65576714", "0.6551545", "0.6507354", "0.64976686", "0.6469842", "0.6425818", "0.6413235", "0.63931406", "0.6388791", "0.63753057", "0.63753057", "0.6374397", "0.63620245", "0.63607126", "0.6358092", "0.63531053", "0.63483...
0.68132055
2
This emulates elements on Gecko until they get supported natively. To be removed when bug 344618 lands.
function bug344618_polyfill() { var range = document.createElement('input'); range.type = 'range'; if (range.type == 'range') { console.warn("bug344618 has landed, there's some dead code to remove."); return; // <input type="range"> is already supported, early way out. } /** * The JS polyfill tran...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function W(){var a=HTMLElement.call(this)||this;a.g=null;a.ba=null;a.N=null;a.l=null;a.A=null;a.B=null;a.I=null;a.J=null;a.w=\"\";a.s=\"\";a.c=[];a.h=-1;a.i=new G;a.O=new G;a.W=!1;a.Z=!1;a.F=null;a.G=null;a.$=!1;a.m=new Bb;return a}", "function getElementClass(){if(typeof HTMLElement!=='function'){// case of Saf...
[ "0.67809415", "0.6737506", "0.6344592", "0.6344592", "0.62909305", "0.62909305", "0.62909305", "0.62909305", "0.6036691", "0.59903437", "0.5976659", "0.59689564", "0.5930988", "0.5930988", "0.58963174", "0.5883606", "0.5824263", "0.5794041", "0.57933486", "0.5777259", "0.5777...
0.0
-1
TODO: get rid of this global variable
function loadXMLDoc(url, cfunc) { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "static final private internal function m106() {}", "static private internal ...
[ "0.69736034", "0.67508453", "0.65372086", "0.6330483", "0.63142663", "0.6275515", "0.6270401", "0.6250009", "0.61834383", "0.61416334", "0.6096285", "0.5872622", "0.5848511", "0.58446616", "0.58133364", "0.5801447", "0.5794966", "0.57542217", "0.5742738", "0.5700088", "0.5688...
0.0
-1
Highlight the last item scanned
function highlightTableRow() { var upc = $('#lbl-itemAdded').html(); location.href = '#' + upc; $('#' + upc).addClass('selected'); $("#txtFldupc").focus(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "highlightLast_() {\n this.highlightHelper_(this.menuItems_.length, -1);\n }", "highlightNext() {\n const index = this.menuItems_.indexOf(this.highlightedItem_);\n this.highlightHelper_(index, 1);\n }", "function lastItem() {\n\t\tstopSlideshow();\n\t\tchangeItem(anchors.length-1);\n\t}", "highligh...
[ "0.77025586", "0.7063262", "0.6619889", "0.6500124", "0.64716053", "0.6440582", "0.6440582", "0.6440582", "0.6440582", "0.6384055", "0.6377353", "0.63338023", "0.61513406", "0.61394256", "0.61061543", "0.6097767", "0.60695827", "0.6061775", "0.60482836", "0.59878373", "0.5987...
0.0
-1
Leave options array empty to allow all options.
constructor(name, displayName, options, defaultValue) { this.name = name; this.displayName = displayName; this.options = options; this.defaultValue = defaultValue; this.observableValue = ko.observable(this.defaultValue); this.set(defaultValue); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reset() {\n this.options = Object.create(null);\n }", "function cleanOptions(options) {\n Object.keys(options).filter(function (key) { return options[key] === undefined; }).forEach(function (key) { return delete options[key]; });\n}", "validOptions(options) {\n return options.reduce((memo, option) ...
[ "0.65324664", "0.65195364", "0.637693", "0.62471193", "0.61749804", "0.61532784", "0.6088341", "0.60500026", "0.6049217", "0.6049217", "0.60348123", "0.60192573", "0.6010598", "0.60004586", "0.59577775", "0.59577775", "0.59384745", "0.5929284", "0.59261185", "0.5916804", "0.5...
0.0
-1
Probably not needed right now, but might be if we add more logic to a gameTick.
static tick() { this.counter = 0; this.pokemonAttack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleGameTick(ms, owner, events) {\n return; \n }", "handleGameTick(ms, owner, events) {\n return;\n }", "function tick() {\n\n\n\n}", "tickCaller(game){\n game.tick();\n }", "handleTick() {\n this.update()\n this.draw()\n }", "function userTick(delta, t...
[ "0.76921374", "0.7625226", "0.6812376", "0.6808554", "0.6775166", "0.6724754", "0.671273", "0.669472", "0.66423446", "0.6569154", "0.6490532", "0.6479574", "0.6472144", "0.6461036", "0.6457634", "0.6446044", "0.6437028", "0.64365554", "0.64189774", "0.64121324", "0.6411706", ...
0.59979796
69
Attacks with clicks and checks if the enemy is defeated.
static clickAttack() { var _a; // TODO: figure out a better way of handling this // Limit click attack speed, Only allow 1 attack per 20ms (50 per second) const now = Date.now(); if (this.lastClickAttack > now - 20) { return; } this.lastClickAttack = n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static clickAttack() {\n var _a;\n // click attacks disabled and we already beat the starter\n if (App.game.challenges.list.disableClickAttack.active() && player.regionStarters[GameConstants.Region.kanto]() != GameConstants.Starter.None) {\n return;\n }\n // TODO: figu...
[ "0.74415755", "0.71875685", "0.7060002", "0.7020661", "0.688542", "0.68277836", "0.6817367", "0.67661625", "0.67466474", "0.67071813", "0.670611", "0.6659867", "0.66469413", "0.6622171", "0.6598621", "0.65806824", "0.65622014", "0.6543243", "0.65178275", "0.6514317", "0.65135...
0.73870593
1
Generate a new enemy based on the current route and region. Reset the counter.
static generateNewEnemy() { this.counter = 0; this.enemyPokemon(PokemonFactory.generateWildPokemon(player.route(), player.region)); const enemyPokemon = this.enemyPokemon(); GameHelper.incrementObservable(App.game.statistics.pokemonEncountered[enemyPokemon.id]); GameHelper.increm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static generateNewEnemy() {\n Battle.counter = 0;\n Battle.enemyPokemon(PokemonFactory.generateWildPokemon(player.route(), player.region));\n }", "static generateNewEnemy() {\n this.counter = 0;\n this.enemyPokemon(PokemonFactory.generateTrainerPokemon(this.gym.town, this.index()))...
[ "0.775395", "0.7490257", "0.72070706", "0.69395435", "0.67340297", "0.65451586", "0.65391743", "0.6454685", "0.6350136", "0.63063216", "0.6175242", "0.61498404", "0.6124377", "0.6080198", "0.60383445", "0.5974934", "0.5973895", "0.5918685", "0.590758", "0.59021074", "0.587653...
0.7240114
2
Override with a custom function
calculateBonus(level = this.level) { return this.bonusList[level]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initCustomFunctions() {/*To be overridden in sub class as needed*/}", "function aOverrides()\n{\n\n}", "function super_fn() {\n\t\t\t\t\tif (!oldFn) { return }\n\t\t\t\t\teach(arguments, function(arg, i) {\n\t\t\t\t\t\targs[i] = arg\n\t\t\t\t\t})\n\t\t\t\t\treturn oldFn.apply(self, args)\n\t\t\t\t}", "functi...
[ "0.68738484", "0.6767602", "0.6444412", "0.6444412", "0.6444412", "0.6444412", "0.61789286", "0.61506635", "0.6124426", "0.6031344", "0.60210925", "0.6003308", "0.59295076", "0.59135854", "0.5910096", "0.5908885", "0.59065765", "0.58792347", "0.5877686", "0.58617437", "0.5861...
0.0
-1
Override in subclass when other requirements exist.
canBuy() { return this.level < this.maxLevel && this.canAfford(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_validate() {\n throw new Error('_validate not implemented in child class');\n }", "checkValidity(context, event) {\n throw new Error('Implement in subclass');\n }", "checkValidity(context, event) {\n throw new Error('Implement in subclass');\n }", "function SuperclassBare() {}", "function Supe...
[ "0.6229789", "0.60278124", "0.60278124", "0.6009603", "0.6009603", "0.58505535", "0.5738621", "0.56339186", "0.5623911", "0.5623911", "0.5623911", "0.5623911", "0.5623911", "0.5623911", "0.5623911", "0.5623911", "0.560998", "0.55186903", "0.5492072", "0.54508585", "0.54115915...
0.0
-1
potentially newer version, check againt version
isNewerVersion(version, compareVersion) { return compareVersion.localeCompare(version, undefined, { numeric: true }) === -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CheckVersion() {\n \n}", "function cinnamon_version_gte(version) {\n let current = Config.PACKAGE_VERSION.split('.').map(function(x) { return parseInt(x); });\n let required = version.split('.').map(function(x) { return parseInt(x); });\n\n for (i in required) {\n if (required[i] ...
[ "0.75776523", "0.747036", "0.743574", "0.7349438", "0.73047", "0.7169897", "0.7056835", "0.6975671", "0.6853161", "0.6847246", "0.679998", "0.6768824", "0.675525", "0.6679669", "0.667813", "0.6639216", "0.66356134", "0.6619817", "0.6593108", "0.6592779", "0.6592779", "0.657...
0.6759878
13
potentially older version, check againt version
isOlderVersion(version, compareVersion) { return compareVersion.localeCompare(version, undefined, { numeric: true }) === 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CheckVersion() {\n \n}", "function cinnamon_version_gte(version) {\n let current = Config.PACKAGE_VERSION.split('.').map(function(x) { return parseInt(x); });\n let required = version.split('.').map(function(x) { return parseInt(x); });\n\n for (i in required) {\n if (required[i] ...
[ "0.7548544", "0.7358186", "0.7302678", "0.7202592", "0.6956194", "0.68869126", "0.6826083", "0.67983496", "0.6663909", "0.6652774", "0.6645502", "0.66444373", "0.66257876", "0.66051286", "0.65821344", "0.6574568", "0.6571797", "0.6563965", "0.6558804", "0.64873505", "0.647891...
0.6203584
32
Override pokemon attack method so we can ignore the region multiplier
static pokemonAttack() { var _a; // attack twice as fast if we have defeated this stage this.alternateAttack = !this.alternateAttack; if (this.alternateAttack && BattleFrontierRunner.stage() > App.game.statistics.battleFrontierHighestStageCompleted()) { return; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "attack(player) {\r\n player.applyDamage(this.strength);\r\n }", "attack(target) {\n return (target.res -= this.power);\n }", "function stage2(){\n player.attack.plusser += 62;\n}", "attack(target) {\n target.healthPoints -= this.attackPower;\n this.attackPower += this.startAtta...
[ "0.6467274", "0.6382299", "0.6302947", "0.62415594", "0.62361985", "0.6212308", "0.61715627", "0.61110365", "0.6018341", "0.6004089", "0.5995065", "0.5985353", "0.59644955", "0.58448243", "0.58066714", "0.5761089", "0.5758457", "0.57464576", "0.5721288", "0.571727", "0.570346...
0.65662766
1
Award the player with exp, shards and go to the next pokemon
static defeatPokemon() { // This needs to stay as none so the stage number isn't adjusted App.game.breeding.progressEggsBattle(BattleFrontierRunner.stage(), GameConstants.Region.none); this.enemyPokemon().defeat(true); // Next pokemon GameHelper.incrementObservable(this.pokemonIn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function advance() {\n\n // Handle ship\n ship.advance();\n\n // Move rocks\n for (var i = 0; i < rocks.length; i++) {\n rocks[i].advance();\n }\n\n // Move bullets\n for (var i = 0; i < bullets.length; i++) {\n bullets[i].advance();\n }\n\n detectHits();\n cleanUpTheDead();\n}", "function Attack...
[ "0.6613274", "0.644482", "0.6329308", "0.61870396", "0.61094755", "0.6054738", "0.6053734", "0.60386443", "0.601456", "0.5987761", "0.59716153", "0.594827", "0.59113353", "0.5902865", "0.5875251", "0.584849", "0.58226806", "0.5819777", "0.5813968", "0.5804271", "0.5781429", ...
0.5871444
16
Insecure hash, but should keep some of the nosy people out.
hash(text) { let hash = 0, i, chr; if (text.length === 0) { return hash; } for (i = 0; i < text.length; i++) { chr = text.charCodeAt(i); hash = ((hash << 5) - hash) + chr; hash |= 0; // Convert to 32bit integer } return hash...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fastHash(password) {\n return crypto.createHash('sha256').update(password.toString()).digest(\"hex\");\n }", "hash(rawString) {\n return (\n typeof rawString === 'string'\n && rawString.length\n ? crypto.createHmac('sha256', config.hashingSecret).update(rawString).digest('hex')\n ...
[ "0.681773", "0.6554827", "0.6440714", "0.6347112", "0.63238347", "0.6323188", "0.6316478", "0.62772256", "0.62682825", "0.6267901", "0.6254711", "0.62473357", "0.62324953", "0.62301356", "0.6212862", "0.6212862", "0.6204737", "0.62022746", "0.6198965", "0.6193511", "0.6186266...
0.0
-1
Image, Price and Description fields are not currently used on the website, the data is there so the Discord bot and website can share the same dataset
constructor(name, image, price, description, claimFunction = () => true) { this.name = name; this.image = image; this.price = price; this.description = description; this.claimFunction = claimFunction; this.claimed = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendMessage(data, msg, kw) {\n\n msg.channel.send(new Discord.MessageEmbed()\n .setTitle(`FOUND ${data.length} OF ${kw.toUpperCase()}, LOADING NOW.....`)\n .setTimestamp()\n .setFooter('Developed by Bompton#7777'))\n\n data.forEach((value, index) => {\n var embed = new Discord.MessageEmbed()\n ...
[ "0.6453749", "0.6108814", "0.6058542", "0.60379463", "0.60068", "0.58635014", "0.5851989", "0.5761823", "0.57143635", "0.5704778", "0.5676928", "0.5674554", "0.5606102", "0.5564154", "0.55219847", "0.55185395", "0.55090797", "0.54895306", "0.5457953", "0.54432094", "0.5440584...
0.0
-1
Harvest a plot at the given index, returns the amount of money gained from the harvest.
harvest(index, suppressNotification = false) { const plot = this.plotList[index]; if (plot.berry === BerryType.None || plot.timeLeft > 0) { return 0; } App.game.wallet.gainFarmPoints(this.berryData[plot.berry].farmValue); const money = App.game.wallet.gainMoney(this.b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "harvest(index) {\n const plot = this.plotList[index];\n if (plot.berry === BerryType.None || plot.stage() != PlotStage.Berry || plot.isSafeLocked) {\n return;\n }\n App.game.wallet.gainFarmPoints(this.berryData[plot.berry].farmValue);\n const amount = plot.harvestAmoun...
[ "0.61239606", "0.59174144", "0.5901764", "0.5714643", "0.56712264", "0.5512444", "0.5419091", "0.5332519", "0.5186623", "0.5183983", "0.5169958", "0.51659954", "0.5029627", "0.49732798", "0.49501976", "0.49348712", "0.4856192", "0.48326033", "0.4812903", "0.480784", "0.479762...
0.6504863
0
Try to harvest all plots, suppresses the individual notifications
harvestAll() { let total = 0; this.plotList.forEach((plot, index) => { total += this.harvest(index, true); }); if (total > 0) { Notifier.notify({ message: `You earned ${total} money from the harvest!`, type: GameConstants.NotificationOption.success }); } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "harvestAll() {\n this.plotList.forEach((plot, index) => {\n this.harvest(index);\n });\n }", "function plotAll() {\n d3.select(\"#scatter-macro-1 svg\").remove()\n d3.select(\"#scatter-macro-2 svg\").remove()\n d3.select(\"#scatter-micro-1 svg\").remove()\n d3.select(\"#scatter-mi...
[ "0.6424521", "0.6077232", "0.59071565", "0.58650506", "0.57881653", "0.5762996", "0.5749903", "0.5724595", "0.5629145", "0.56083786", "0.55920964", "0.5572937", "0.5543624", "0.5519557", "0.53977996", "0.53954476", "0.5385487", "0.5371797", "0.53648615", "0.5282829", "0.52804...
0.52110773
31
Award the player with exp, and go to the next pokemon
static defeatPokemon() { this.enemyPokemon().defeat(true); // Make gym "route" regionless App.game.breeding.progressEggsBattle(this.gym.badgeReward * 3 + 1, GameConstants.Region.none); this.index(this.index() + 1); if (this.index() >= this.gym.pokemons.length) { GymRu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AttackNextPlayer() {\n Orion.Ignore(self);\n var target = Orion.FindType(\"-1\", \"-1\", \"ground\", \"human|near|live|ignorefriends\", 18, \"gray|criminal|orange|red\");\n if (target.length != 0) {\n Orion.Attack(target[0]);\n Orion.Ignore(target[0]);\n } else {\n Orion.I...
[ "0.6624169", "0.65343624", "0.642277", "0.6399975", "0.63196224", "0.6300452", "0.6250865", "0.62411934", "0.6235277", "0.6126705", "0.6104519", "0.60921246", "0.60921246", "0.60478544", "0.60478544", "0.6043811", "0.6035699", "0.6020802", "0.6019408", "0.5969166", "0.5966803...
0.5820002
34
Private as external sources should use gainExp and normalizedExp
get exp() { return this._exp(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "gainMult() { // Calculate the multiplier for main currency from bonuses\r\n mult = new ExpantaNum(1)\r\n return mult\r\n }", "gainMult() { // Returns your multiplier to your gain of the prestige resource.\n return new Decimal(1) // Factor in any bo...
[ "0.61848384", "0.6085778", "0.60716647", "0.602838", "0.593907", "0.5935302", "0.5924762", "0.5920326", "0.59002453", "0.589049", "0.58532053", "0.5841844", "0.5784753", "0.5763463", "0.57584196", "0.5723229", "0.57208884", "0.5683346", "0.56631655", "0.55618316", "0.55425054...
0.5543393
20
Need to check if tutorial is completed before showing the other quests stuff
static isTutorialCompleted() { var _a; return ((_a = App.game.quests.getQuestLine('Tutorial Quests')) === null || _a === void 0 ? void 0 : _a.state()) == QuestLineState.ended; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onTutorialDone() {\n this.show();\n this.app.message('The tutorial is always available in the settings menu at the bottom right.',5000)\n }", "function tutorial() {\n\tif (event == 'tutorial1') {\n\t\tcurrentStage = levels.chapter1.tutorial.lv1;\n\t\tstageChanged = true;\n\t\tplayer.weapon = wea...
[ "0.7343725", "0.7083407", "0.6646893", "0.6615877", "0.64400566", "0.6417145", "0.63674724", "0.6270897", "0.6260436", "0.62513566", "0.6209254", "0.61832505", "0.61720765", "0.6132431", "0.61272746", "0.61109394", "0.6090138", "0.6060642", "0.60591716", "0.60150373", "0.6000...
0.78886217
0
Get a quest line by name
getQuestLine(name) { return this.questLines().find(ql => ql.name.toLowerCase() == name.toLowerCase()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getOneLineWithName(name){\n return new Promise(function (resolve, reject){\n models.Line.findOne({\n where: {\n lineName: name\n }\n }).then(function(line){\n resolve(line)\n })\n })\n }", "static cr...
[ "0.7259289", "0.5899762", "0.57557964", "0.5747438", "0.566153", "0.5639307", "0.5602895", "0.55773324", "0.55306417", "0.55186754", "0.5499922", "0.54930073", "0.54895353", "0.5486281", "0.5482848", "0.5461547", "0.5448448", "0.5448444", "0.543816", "0.54225177", "0.5346167"...
0.8844698
1
Returns 0 when all quests are complete, ~1 million when none are
getRefreshCost() { const notComplete = this.incompleteQuests().length; return new Amount(Math.floor(250000 * Math.LOG10E * Math.log(Math.pow(notComplete, 4) + 1)), GameConstants.Currency.money); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "allQuestCompleted() {\n return !this.incompleteQuests().length;\n }", "allQuestClaimed() {\n return !this.incompleteQuests().length && !this.currentQuests().length;\n }", "static allQuestCompleted() {\n for (let questCompleted of player.completedQuestList) {\n if (!questCo...
[ "0.692375", "0.6760919", "0.666768", "0.63028777", "0.6287147", "0.6244329", "0.6233794", "0.61251354", "0.60288644", "0.60166925", "0.5973913", "0.5944716", "0.5845424", "0.5805477", "0.57843125", "0.5774963", "0.577084", "0.57673174", "0.5762692", "0.57545835", "0.5751353",...
0.5440273
59
returns false if we still have incomplete quest
allQuestCompleted() { return !this.incompleteQuests().length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static allQuestCompleted() {\n for (let questCompleted of player.completedQuestList) {\n if (!questCompleted()) {\n return false;\n }\n }\n return true;\n }", "allQuestClaimed() {\n return !this.incompleteQuests().length && !this.currentQuests()...
[ "0.7692599", "0.75402766", "0.7147823", "0.68883586", "0.67835623", "0.66707164", "0.66286206", "0.65833485", "0.65744525", "0.6401374", "0.637815", "0.6337075", "0.63136816", "0.6296449", "0.62547284", "0.6228377", "0.6206018", "0.6179234", "0.6179234", "0.6176686", "0.61628...
0.77569884
0
1000 xp needed to reach level 2, amount needed for next level increases by 20% of previous level
levelToXP(level) { if (level >= 2) { // Sum of geometric series const a = 1000, r = 1.2, n = level - 1; const sum = a * (Math.pow(r, n) - 1) / (r - 1); return Math.ceil(sum); } else { return 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PercentToNewLevel(xp) {\n\t//find closest matching lvl xp\n\tfor (i = 0 ; i < experienceArray.length ; i++) {\n\t\tif (xp > experienceArray[i]) {\n\t\t\tcontinue;\n\t\t}\n\t\telse {\n\t\t\t//Check if exp is equal to the exact lvl experience\n\t\t\tif (xp === experienceArray[i]) {\n\t\t\t\treturn 0;\n\t\t\...
[ "0.78292257", "0.7696911", "0.7478431", "0.6977829", "0.69637865", "0.68005687", "0.6756616", "0.6751366", "0.6734539", "0.6711327", "0.6704772", "0.66283184", "0.6627132", "0.6627132", "0.6621942", "0.655694", "0.65527123", "0.6488425", "0.64816517", "0.6473228", "0.6426428"...
0.67322814
10
TODO: Balance the reward amount better
static calcReward(berryType, amount) { const harvestTime = App.game.farming.berryData[berryType].harvestTime; const avgBerriesPerHarvest = 2.5; const plotsAvailable = App.game.farming.unlockedPlotCount(); return Math.ceil((amount / avgBerriesPerHarvest) * (harvestTime / Math.max(4, plots...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "saveReturns(reward) {\n const lastReward = this.rewardHistory[-1];\n const discountedReward = lastReward*this.gamma + reward\n\n this.rewardHistory.push(discountedReward);\n }", "getTotalRewards() {\n let asps = []\n let stats = game.app.stats\n let rews = {\n force: stats.e...
[ "0.69750065", "0.69149137", "0.6773772", "0.6696135", "0.65374583", "0.6418404", "0.6401774", "0.63987666", "0.6195691", "0.61791474", "0.6131919", "0.6076683", "0.6052382", "0.60330135", "0.60032046", "0.59912", "0.59418935", "0.5940098", "0.59338474", "0.5925412", "0.592018...
0.67789525
2
Write a function iFibonacci that behaves like the following: rFibonacci(0) = 0 => 0 rFibonacci(1) = 1 => 1 rFibonacci(2) = 1 => 1 rFibonacci(3) = 1 + 1 => 2 rFibonacci(4) = 1 + 2 => 3 rFibonacci(5) = 2 + 3 => 5 rFibonacci(6) = 3 + 5 => 8 Or I guess it can be written this way too... rFibonacci(0) = 0 => 0 rFibonacci(1) ...
function rFibonacci(num){ if(num === 0){ return 0; }else if(num === 1 || num === 2){ return 1; }else{ return rFibonacci(num - 2) + rFibonacci(num - 1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rFibonacci(n) {\n if (n <= 1)\n return n;\n else\n return rFibonacci(n - 1) + rFibonacci(n - 2);\n}", "function rFibonacci(n) {\n n = Math.floor(n);\n if (n < 1) return 0;\n if (n <= 2) return 1;\n return rFibonacci(n - 1) + rFibonacci(n - 2);\n}", "function recursiveFi...
[ "0.82430935", "0.80629754", "0.8033013", "0.79325247", "0.7892465", "0.7775622", "0.7727549", "0.77275", "0.7679565", "0.7670759", "0.76686853", "0.760644", "0.75975925", "0.7569031", "0.7568494", "0.7560676", "0.75279635", "0.7522748", "0.750178", "0.7492596", "0.7489", "0...
0.814541
1
Converts canvas to an image
function convertCanvasToImage(canvas) { var image = new Image(); image.src = canvas.toDataURL("image/png"); console.log(image); return image; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertCanvasToImage(canvas) {\n var image = new Image();\n image.src = canvas.toDataURL(\"image/png\");\n return image;\n }", "function convertCanvasToImage(canvas) {\n var image = new Image();\n image.src = canvas.toDataURL();\n return i...
[ "0.8333834", "0.8254464", "0.82139057", "0.82139057", "0.8179615", "0.8083456", "0.78639233", "0.7835417", "0.7725472", "0.76350707", "0.7554581", "0.73620445", "0.72527504", "0.7047801", "0.6973731", "0.66054165", "0.6599006", "0.6591964", "0.65837276", "0.65419596", "0.6522...
0.80960125
5
gray out the Intercom overlay
function addMutationObserver() { setCss(); // var el = document.body; var el = $("#IModalOverlay")[0]; if (el && mo.observe) { mo.observe(el, { attributes: true, characterData: false, childList: false, }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function grayOut() {\r\n that.surface.createRect({\r\n x: 0, y: 0, width: that.width, height: that.height\r\n }).setFill([255, 255, 255, 0.4]);\r\n }", "function overlay() {\n sketch.strokeWeight(1);\n sketch.stroke(0, 0, 255, 75);\n sketch.fill(0, 0, 255, 75);\n ...
[ "0.70603544", "0.6557756", "0.64854896", "0.6202075", "0.61932886", "0.6183649", "0.6167349", "0.61627764", "0.61430854", "0.613689", "0.6011568", "0.5977419", "0.5942662", "0.59400326", "0.5935897", "0.59051245", "0.59051245", "0.58820516", "0.58510727", "0.58049655", "0.577...
0.0
-1
function checks for null elements and also checks for foul language
function func(){ pat=/fuck|shit|crap|bullshit/; strName=document.getElementById("name").value str=document.getElementById("comments").value; if(!(document.getElementById("name").value)){ alert("Please input name"); document.getElementById("name").focus(); return false; } else if(!(document.getElementById("c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isLangEmpty(lang) {\n for (var i = 0; i < langAttributes[lang].length; i++) {\n if (!isEmpty($(langAttributes[lang][i].input).val()))\n return false;\n }\n return true;\n }", "function n(a){return!!a&&\"undefined\"!=typeof a.text}", "function validateT...
[ "0.6242883", "0.6065922", "0.6003027", "0.598404", "0.59500456", "0.59240407", "0.5918929", "0.5901439", "0.5846725", "0.5839729", "0.57986814", "0.5750146", "0.5740804", "0.5694271", "0.56933385", "0.5684404", "0.5660142", "0.5652945", "0.5652945", "0.56298363", "0.56218314"...
0.0
-1
Gets the list of datasources from metadata API endpoint.
@autobind getDatasourceDict(): Promise<{ datasourceList: $ReadOnlyArray<string>, currentDatasource: string, }> { return new Promise((resolve, reject) => { this._httpService .get(API_VERSION.V2, `metadata/data_sources`) .then(datasources => resolve({ datasource...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listDatasources() {\n let theUrl = `/api/v${apiVersion}/datasources`;\n let request = $http({\n url: theUrl,\n method: \"GET\"\n });\n return request;\n }", "function getDataSources(callback) {\n if (dataCache) {\n callback(dataCache);\n ...
[ "0.8150909", "0.6728641", "0.6610046", "0.63797075", "0.6375183", "0.6295883", "0.6279902", "0.62446135", "0.5781376", "0.5771814", "0.5756492", "0.57070404", "0.5661301", "0.55675554", "0.5501013", "0.5446705", "0.54217184", "0.5420004", "0.53875667", "0.5382398", "0.5369628...
0.58974755
8
Get global config variables
function getConfiguration(cb) { // Check if device has an embedded leap or not. // Checks db first to see if there's a stored value uiGlobals.embeddedDevice = embeddedLeap.getEmbeddedDevice(); uiGlobals.canInstallPrebundledApps = canInstallPrebundledApps(); console.log('Device type:', uiGlobals.embeddedDevice...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getGlobalSettings() {\n return global_settings;\n}", "function retrieveBaseConfig() {\n // check that environment variables are set\n ensureEnvVariablesSet([\n 'ALGOD_TOKEN',\n 'ALGOD_SERVER',\n 'ALGOD_PORT'\n ])\n}", "function load_config(){\n S.config = K.config.fetch();\n retur...
[ "0.75348365", "0.6958335", "0.6834019", "0.6823526", "0.6820442", "0.6677442", "0.6654103", "0.66342527", "0.6575578", "0.65618616", "0.6551557", "0.6507793", "0.6482537", "0.6472861", "0.64708054", "0.64297026", "0.642642", "0.6417062", "0.63916713", "0.6389052", "0.6382009"...
0.0
-1
Initializes the Google Analytics node module to track stats against.
function initializeGoogleAnalytics(cb) { ga.initialize(cb); ga.trackOpen(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initAnalytics(){\n\tvar accountId = 'UA-2764682-9';\n\tjQuery.getScript('http://www.google-analytics.com/ga.js', function(){\n\t\ttry {\n\t\t\tvar pageTracker = _gat._getTracker(accountId);\n\t\t\tpageTracker._trackPageview();\n\t\t} catch(err) {}\n\t});\n}", "function init() {\n if (!IS_...
[ "0.7175111", "0.71728075", "0.6791051", "0.6731778", "0.6731298", "0.66993797", "0.66287506", "0.6602159", "0.6597205", "0.6436963", "0.632234", "0.6226571", "0.5994284", "0.59835017", "0.59687966", "0.5962274", "0.5957891", "0.58788186", "0.5871936", "0.5850027", "0.5845078"...
0.707843
2
Figure out the user's locale
function initializeInternationalization(cb) { i18n.initialize(function(err, locale) { console.log(err ? 'Error determining locale: ' + (err.stack || err) : 'Determined locale: ' + locale); cb.apply(this, arguments); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLocale() {\n const localePref = \"general.useragent.locale\";\n var locale = getLocalizedPref(localePref);\n if (locale)\n return locale;\n\n // Not localized\n return gPrefSvc.getCharPref(localePref);\n}", "function getLocale() {\n try {\n // Get the default branch\n var defaultPr...
[ "0.77867913", "0.7663662", "0.7555322", "0.7503672", "0.7401395", "0.7387962", "0.73285186", "0.7270397", "0.7270397", "0.7270397", "0.7270397", "0.7270397", "0.7270397", "0.7268798", "0.714466", "0.7096305", "0.70866656", "0.70865846", "0.69007045", "0.6891838", "0.6888714",...
0.0
-1
Check if the main directories used by Leap Motion App Home do, in fact, exist
function ensureWorkingDirs(cb) { var dirFn = function(dirpath) { return function(next) { workingFile.ensureDir(dirpath, next); }; }; var appDataDir = path.join((config.PlatformDirs[os.platform()] || ''), 'Airspace', 'AppData'); var tempDir = config.PlatformTempDirs[os.platform()]; var leapShare...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_app_dir(filepath) {\n try {\n return fs.statSync(path.join(filepath, '.meteor', 'packages')).isFile();\n } catch (e) {\n return false;\n }\n}", "function checkFolders() {\n const courseDataPath = './courseData';\n const htmlFilesPath = './htmlFiles';\n\n if (!fs.existsSync(courseDat...
[ "0.66715515", "0.65471494", "0.65111756", "0.64268667", "0.63574517", "0.6349376", "0.62215734", "0.6112082", "0.5865792", "0.5848666", "0.5823926", "0.5810633", "0.5781527", "0.5776986", "0.5770878", "0.5749354", "0.57394403", "0.57368267", "0.5734832", "0.5705015", "0.56941...
0.59174585
8
Blocks certain embedded devices from installing prebundled apps.
function canInstallPrebundledApps() { freezeDriedBundlePath = _(config.FrozenAppPaths).find(function(bundlePath) { var err; try { console.log("Looking for prebundled path in: " + bundlePath); return fs.existsSync(bundlePath); } catch (_error) { err = _error; console.log("Prebundle ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function boot()\n {\n\t// scriptweeder ui's iframe, don't run in there !\n\tif (in_iframe() && window.name == 'scriptweeder_iframe')\t// TODO better way of id ?\n\t return;\n\tif (location.hostname == \"\")\t// bad url, opera's error page. \n\t return;\n\tassert(typeof GM_getValue == 'undefined', // user...
[ "0.55671185", "0.55662715", "0.5477828", "0.54543734", "0.543725", "0.537977", "0.53732276", "0.5370048", "0.53699845", "0.5321327", "0.52726007", "0.5269026", "0.52620524", "0.52578545", "0.52435815", "0.5219594", "0.52093595", "0.52066016", "0.51581854", "0.5145331", "0.514...
0.5645172
0
For Active Main menu in Mobile View
setActive(menuItem) { if (this.activeItem === menuItem) { this.activeItem = ''; } else { this.activeItem = menuItem; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function activeMenuUI() {\n\t\t\n\t\t\t$scope.isActive = function (viewLocation) { \n\t return viewLocation === $location.path();\n\t };\n\n\t $(function() {\n\t\t\t $('#side-menu').metisMenu();\n\t\t\t});\n\t\t\t$(function() {\n\t\t\t $(window).bind(\"load resize\", function() {\n\t...
[ "0.71044755", "0.7051194", "0.687328", "0.68622005", "0.6862147", "0.6829097", "0.67984587", "0.6771086", "0.67587245", "0.6758379", "0.670417", "0.6693616", "0.6683084", "0.6658231", "0.6655981", "0.6649237", "0.66283894", "0.66078234", "0.6588537", "0.658333", "0.6568449", ...
0.0
-1
For Active Child Menu in Mobile View
setChildActive(subMenu) { if (this.activeChildItem === subMenu) { this.activeChildItem = ''; } else { this.activeChildItem = subMenu; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setActive() {\n var path = window.location.pathname;\n openerp.jsonRpc(\"/get_parent_menu\", \"call\", {\n 'url': path,\n }).done(function(data){\n $(\"#top_menu a\").each(function(){\n if ($(this).attr(\"href\") == data) {\n $(this).closest(\"li\").addClas...
[ "0.70621717", "0.6768252", "0.67344403", "0.6605586", "0.6603432", "0.65076345", "0.648019", "0.64710534", "0.64087486", "0.64062434", "0.63990873", "0.63964635", "0.637436", "0.6367703", "0.6361882", "0.63595444", "0.63592327", "0.6357745", "0.6356766", "0.6352837", "0.63495...
0.62374467
31
For Active Main menu in Mobile View
setActive(menuItem) { if (this.activeItem === menuItem) { this.activeItem = ''; } else { this.activeItem = menuItem; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function activeMenuUI() {\n\t\t\n\t\t\t$scope.isActive = function (viewLocation) { \n\t return viewLocation === $location.path();\n\t };\n\n\t $(function() {\n\t\t\t $('#side-menu').metisMenu();\n\t\t\t});\n\t\t\t$(function() {\n\t\t\t $(window).bind(\"load resize\", function() {\n\t...
[ "0.7104973", "0.7050833", "0.6872987", "0.68623286", "0.6861709", "0.6829331", "0.67981464", "0.6772462", "0.67584234", "0.67579746", "0.67049676", "0.6694472", "0.6683574", "0.6659053", "0.6656991", "0.6650851", "0.66276234", "0.66089463", "0.6588663", "0.65846366", "0.65685...
0.0
-1
For Active Child Menu in Mobile View
setChildActive(subMenu) { if (this.activeChildItem === subMenu) { this.activeChildItem = ''; } else { this.activeChildItem = subMenu; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setActive() {\n var path = window.location.pathname;\n openerp.jsonRpc(\"/get_parent_menu\", \"call\", {\n 'url': path,\n }).done(function(data){\n $(\"#top_menu a\").each(function(){\n if ($(this).attr(\"href\") == data) {\n $(this).closest(\"li\").addClas...
[ "0.70619816", "0.6768702", "0.6732053", "0.66047627", "0.660354", "0.6503579", "0.6479265", "0.6470502", "0.6409573", "0.6406269", "0.6398094", "0.6395052", "0.637253", "0.6365744", "0.636143", "0.6358436", "0.63579696", "0.6356552", "0.63543993", "0.6349679", "0.6348815", ...
0.6237132
32
2b. Books per category
getBookByCategory(id){ return knex.raw('Select * from book1 where id in (Select books_id from category_book where categories_id = ? );',id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBooksInCategory(category) {\n// var db = ScriptDb.getMyDb();\n// var db_categories = ParseDb.getMyDb(applicationId, restApiKey, \"list_categories\");\n var db_gen = ParseDb.getMyDb(applicationId, restApiKey, \"book_generic\");\n \n var books = [];\n \n var query = db_gen.query({});\n while (que...
[ "0.700208", "0.68950313", "0.66279453", "0.63691515", "0.62504905", "0.6095989", "0.6001616", "0.5864023", "0.5813281", "0.57100105", "0.57045424", "0.55712473", "0.55475885", "0.5545265", "0.5519108", "0.5514731", "0.5483776", "0.54609025", "0.5450722", "0.5364763", "0.53626...
0.5375908
19
Daily Programmer Challenge 281 Easy 01 September 2016
function highestBase(num) { const radixes = '123456789abcdefghijklmnopqrstuvwxyz'; const radixIdxs = num.split('').map(x => radixes.indexOf(x)); const highestRadix = Math.max.apply(null, radixIdxs) + 1; return highestRadix + 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function solution(A) {\n\t/* ************* creating vication OBJ **************** */\n\tclass Vication {\n\t constructor(A) {\n\t\t\tthis.vication = A;\n\t\t\tthis.amount = 0;\n\t this.month = [];\n\t for (let i = 0; i < 30; i++) {\n\t this.month.push(false);\n\t }\n\t for...
[ "0.59089154", "0.59045166", "0.5884113", "0.5883689", "0.58500177", "0.5836537", "0.5810529", "0.580356", "0.5756935", "0.5730808", "0.5728911", "0.5728549", "0.570909", "0.57082945", "0.57022506", "0.56916064", "0.56907254", "0.56852245", "0.56719947", "0.56705195", "0.56657...
0.0
-1
Apr 1 'monthdate' 1 April 2019 'date' Saturday, 1 April 2019 'weekdate' Sat, 1 April 2019 'shortweekdate' 12:00 'hours' 1 April 'day'
function formatDate(timestamp, format) { var d = new Date(timestamp); switch (format) { case 'date': return d.getUTCDate() + ' ' + months[d.getUTCMonth()] + ' ' + d.getUTCFullYear(); case 'hours': return leftPad(d.getUTCHours()) + ':00'; case 'monthdate': return shortMonths[d.getUTC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "processDate ( ) {\n let days = [ 'Monday', 'Tuesday', 'Wednesday',\n 'Thursday', 'Friday', 'Saturday', 'Sunday' ];\n let date = new Date ( this.data.release_date ).toDateString ( );\n let split = date.split ( ' ' );\n let fullday = days.filter ( x => x.indexOf ( split [ 0 ] )...
[ "0.6027318", "0.5861854", "0.5861854", "0.5837591", "0.57596326", "0.5755737", "0.5642583", "0.5624561", "0.5615692", "0.5608528", "0.55823505", "0.55689114", "0.5568749", "0.5560077", "0.5504531", "0.547346", "0.53906846", "0.538708", "0.53467566", "0.5335949", "0.5321157", ...
0.0
-1
Sets the current location coordinates to the fields and adds marker to map.
function locationSuccess(position){ var coordinates = position.coords; $('input[name=lat]').val(coordinates.latitude); $('input[name=lng]').val(coordinates.longitude); var map_instance = GoogleMaps.maps.napMap ? GoogleMaps.maps.napMap.instance : GoogleMaps.maps.pickerMap.instance; if(previewMarker[0]){ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set(coords)\n {\n if (!this._marker)\n {\n this._marker = new L.marker([coords.lat, coords.lng]);\n this._marker.addTo(this._map)\n }\n else\n this._marker.setLatLng([coords.lat, coords.lng])\n }", "function markerLocation() {\n\t\t\t//Get location.\n\t\t\tvar currentLocation = marke...
[ "0.7161856", "0.71180344", "0.68362874", "0.6754222", "0.6734271", "0.6689333", "0.65792936", "0.6538391", "0.6522366", "0.6501567", "0.6497192", "0.64802885", "0.6478157", "0.6476848", "0.6473847", "0.6473804", "0.6472247", "0.6464714", "0.64280814", "0.6422891", "0.6409816"...
0.6075275
60
javascript module for image thumbnails functions image thumbnails
function getImages(photos) { function clickHandler(index, photos) { return function (event) { event.preventDefault(); gallery.showPhoto(index, photos); }; } var container = document.getElementsByClassName('thumbnails__list')[0]; container.textContent = '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function a(e){var t=e.file,n=e.thumbnailMaxWidth,r=e.thumbnailMaxHeight,a=e.enableThumbnails;return t.type&&t.type.startsWith(\"image\")?(t=t instanceof Blob?t:new Blob([t]),new s.default(function(e,n){var r=new Image;r.onload=function(){e(r)},r.onerror=n,r.src=URL.createObjectURL(t)}).then(function(e){var o=(0,c....
[ "0.6940589", "0.6829036", "0.68239397", "0.68234557", "0.678651", "0.6743746", "0.6700482", "0.66996723", "0.664479", "0.66237533", "0.6578182", "0.6570802", "0.6567756", "0.656503", "0.6559421", "0.6550619", "0.6529431", "0.6519586", "0.65054667", "0.64985186", "0.64960253",...
0.61954993
63
goes throught the while loop if its greater than zero it displays clunk everytime it goes through the while loop it subtracts one until it becomes zero the num variable is basicaly how many times the word clunk is going to be displayed
function clunk(times){ var num = times; while(num > 0) { display("clunk") num = num - 1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clunk(times) {\n\tvar num = times;\n\twhile (num > 0) {\n\t\tdisplay(\"clunk\");\n\t\tnum = num - 1;\n\t}\n}", "function countRem() {\n //put current value in holder variable to lower by 1 then put back in html\n var guessRem = document.getElementById(\"guess-rem\").innerHTML;\n guessRem--;\n ...
[ "0.6869422", "0.6223535", "0.6138611", "0.6133518", "0.6104815", "0.60154057", "0.59406525", "0.58451355", "0.58354884", "0.58340234", "0.58269274", "0.5807882", "0.5797639", "0.5767609", "0.57392615", "0.5724125", "0.5723899", "0.5691315", "0.5685928", "0.56799316", "0.56666...
0.7089037
0
The function checks the size which comes from the while loop from 1 7 then it makes a desicion with the if and else statements. if the size is equal to zero it displays "clanck" once, same goes for if the size is equal to one it displays "thunk" once. but when it gets to the else statement its different. if the size is...
function thingamajig(size) { var facky = 1; clunkCounter = 0; if(size == 0) { display("clanck"); } else if(size == 1) { display("thunk"); } else { while(size > 1) { facky = facky * size; size = size - 1; } clunk(facky) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clunk(times){\n\tvar num = times;\n\twhile(num > 0) {\n\t\tdisplay(\"clunk\")\n\t\tnum = num - 1;\n\t}\n}", "function treasureHunting (size) {\n for (var i=0, j=540;i<size;i++, j-=50) {\n if ((distanceTo(goldArray[i].x, goldArray[i].y, indian.x, indian.y) <30) && indian...
[ "0.58584297", "0.57541704", "0.5743534", "0.56873274", "0.56425935", "0.56347096", "0.5575408", "0.5559045", "0.5550565", "0.55450034", "0.5516273", "0.5501671", "0.54918426", "0.5474267", "0.54534805", "0.541986", "0.54040277", "0.5395847", "0.5389944", "0.5387942", "0.53581...
0.8119657
0
this function is use to display the output by putting in its own line
function display(output) { console.log(output); document.write(output); document.write("<br>"); clunkCounter = clunkCounter + 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function out(line) {\n core.output(line);\n}", "function create_output_line() {\n\t\t\treturn {\n\t\t\t\ttext: []\n\t\t\t};\n\t\t}", "function add_to_output(s) {\n const output = document.getElementById(\"output\");\n output.innerHTML += \"\\n\" + s;\n output.scrollTop = output.scrollHeight;\n}", ...
[ "0.68728715", "0.6773155", "0.67121947", "0.65638983", "0.6521378", "0.6507764", "0.6497375", "0.64765596", "0.6462662", "0.6442251", "0.6435924", "0.64196265", "0.6400522", "0.6400167", "0.6365363", "0.6351577", "0.63382083", "0.633195", "0.63054717", "0.62957567", "0.626910...
0.6244178
23
conditionally scroll on scroll wheel
function scroll() { div.scrollTop(div.innerHeight()); console.log("scrolling chat"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onWheel(ev) {\n const amount = this._getPixelsScrolled(ev);\n if (amount === 0) {\n return false;\n }\n this._viewportElement.scrollTop += amount;\n return this._bubbleScroll(ev, amount);\n }", "function OCM_scrolling() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$offCanvasEl.mo...
[ "0.76759475", "0.7459908", "0.7381663", "0.7368664", "0.72780395", "0.72371256", "0.72127753", "0.71933365", "0.7161023", "0.7121266", "0.7045677", "0.70411515", "0.70121866", "0.6984041", "0.6984041", "0.69597423", "0.6956148", "0.694639", "0.69389147", "0.6930421", "0.69169...
0.0
-1
AFFICHAGE DU TABLEAU DE LIVRES
function afficheLivre() { $.post ('controler.php', // URL du dossier où s'effectue le traitement 'action=affiche_livre', // Valeur à 'envoyer', ici pas de valeurs à envoyer uniquement une indication pour le traitement function (livres) { if(livres.length > 0){ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function afficherTableauAlarmes() {\n var tableauAlarmes = document.getElementById(\"tableauAlarmes\");\n effacerTableauAlarmes();\n for (var alarme of alarmes) {\n afficherNouvelleAlarme(tableauAlarmes, alarme);\n }\n}", "function lunaAfford(name) {\n\t\treturn () => getCanAfford(teams[\"player\"].resour...
[ "0.5378256", "0.5315357", "0.53022605", "0.5238076", "0.5170597", "0.49764323", "0.4936128", "0.49090195", "0.4901265", "0.4898012", "0.48962137", "0.4890591", "0.48827258", "0.48779246", "0.48548692", "0.48443705", "0.48397875", "0.48264283", "0.4825912", "0.48252445", "0.48...
0.0
-1
Consider a more functional pattern
static getDefinedFields() { const fields = {}; for (let fieldName in this) { const field = this[fieldName]; if (field instanceof fields_1.Field) { fields[fieldName] = field; } } return fields; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "apply () {}", "function miFuncion (){}", "private public function m246() {}", "function purchaseItem(...fns) => fns.reduce(compose)\n\n{} // so I have to make sure that I have returned in here this property", "obtain(){}", "function a(e){return function(t){return i(t,e)}}", "function a(e){return functi...
[ "0.5536048", "0.55205333", "0.547494", "0.5435351", "0.533622", "0.5297667", "0.5297667", "0.52911043", "0.52911043", "0.52911043", "0.5274676", "0.5225249", "0.5217541", "0.52006954", "0.5157579", "0.512755", "0.51088524", "0.5106648", "0.5083124", "0.50642216", "0.50548923"...
0.0
-1
This method is useful for checking an individual field; for example when one field on a form has changed and there is no need to revalidate the ones which have not changed.
static checkOneField(fieldName, value) { const field = this[fieldName]; if (!(field instanceof fields_1.Field)) { throw new Error(`${this.constructor.name} does not have a field ${fieldName}`); } return field.getValidationErrors(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkField(){\n // skip testing fields whom their type is not HIDDEN but they are HIDDEN via CSS.\n if( this.type !='hidden' && $(this).is(':hidden') )\n return true;\n\n prepareFieldData(this);\n\n field.data( 'val', field[0].value.replace(/^\\s+|\\s+$/g, \"\") ); ...
[ "0.73691744", "0.73691744", "0.6966629", "0.69620275", "0.68317854", "0.6744961", "0.6738419", "0.67211485", "0.6719823", "0.6710081", "0.6660466", "0.6582621", "0.6549083", "0.6426063", "0.6392085", "0.6355183", "0.62918043", "0.6288178", "0.62806445", "0.6244892", "0.624153...
0.64001495
14
This method is useful for checking some fields of an object without getting errors for null/undefined values. Multipart forms could make use of this.
static checkSomeFields(data) { const modelValidationErrors = { modelHasErrors: false }; Object.entries(data).forEach(([fieldName, value]) => { const field = this[fieldName]; const valueInData = data[fieldName]; if (field instanceof fields_1.Field) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isValidField(field) {\n if(typeof field === 'undefined') {\n return false;\n } else if(field === null){\n return false;\n } else {\n return true\n }\n }", "function validateFields(){\n\tif(!getValue('nombreID')\n\t\t|| !getValue('contactoID') \n\t\...
[ "0.6852767", "0.6748879", "0.66806746", "0.66190964", "0.6494899", "0.6479627", "0.6462683", "0.6427444", "0.6421555", "0.63803935", "0.6351233", "0.63151586", "0.62785715", "0.62695646", "0.62332195", "0.6214875", "0.6194092", "0.6190699", "0.6175995", "0.61675096", "0.61323...
0.6743935
2
This method is useful for checking a "complete" object (in the sense that all of its fields should have been filled out).
static checkAllFields(data) { const modelValidationErrors = { modelHasErrors: false }; for (let fieldName in this.getDefinedFields()) { const field = this[fieldName]; const valueInData = data[fieldName]; const fieldValidationErrors = field.getValid...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async checkProperties(data, fields) {\n this.fill(data, fields);\n return this.valid(false, false);\n }", "isComplete() {\n return (this.title === this.titleComplete) &&\n (this.labo === this.laboComplete) &&\n (this.univ === this.univComplete) &&\n (this.coAu...
[ "0.6640997", "0.65962106", "0.6231645", "0.6196928", "0.61802626", "0.60915947", "0.6046191", "0.60375553", "0.59692055", "0.5959224", "0.59478074", "0.5915708", "0.590115", "0.5876366", "0.5876366", "0.5876366", "0.58701235", "0.5852016", "0.5851771", "0.58448845", "0.583802...
0.0
-1
Is a saveCookie call queued? / Return a list of all blog entries in order.
function getEntries() { var entries = []; var divs = document.getElementsByTagName('div'); for (var i = 0; i < divs.length; i++) { var div = divs[i]; if (hasClass(div, "entrygroup")) entries.push(div); } return entries; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function queueSaveCookie() {\n if (g_save_queued) {\n return;\n }\n g_save_queued = true;\n window.setTimeout(performQueuedSaveCookie, 5000);\n}", "function loadTasksFromCookie() {\r\n console.log(\"Load previous todo list from cookie?\",checkCookie('todoList'));\r\n\r\n //Check cookie e...
[ "0.56296307", "0.5532341", "0.5356486", "0.53136146", "0.52675366", "0.5241085", "0.5138342", "0.5111728", "0.5085431", "0.49930805", "0.49625614", "0.4956683", "0.49549362", "0.495063", "0.4932313", "0.49201524", "0.4907948", "0.49022618", "0.48610362", "0.48606223", "0.4835...
0.0
-1
Add a class on an element. Handles multiple classes on one element.
function addClass(element, cls) { if (hasClass(element, cls)) return; var old_cls = element.className; if (old_cls) cls = cls + ' ' + old_cls; element.className = cls; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addClass(element, value) \n{\n if (!element.className) \n {\n element.className = value;\n } \n else \n {\n var newClassName = element.className;\n newClassName += \" \";\n newClassName += value;\n element.className = newClassName;\n }\n}", "function addClass(element, classname) {\n...
[ "0.7929834", "0.792197", "0.7856707", "0.7853598", "0.77739096", "0.77614284", "0.77518237", "0.7738314", "0.77141947", "0.7705858", "0.7686411", "0.7679365", "0.76740116", "0.7632348", "0.7628556", "0.76216394", "0.76170176", "0.76079255", "0.7597657", "0.7597657", "0.759684...
0.7538147
24
Remove a class from an element. Handles multiple classes on one element.
function removeClass(element, cls) { var classes = element.className; if (!classes) return; var l = classes.split(' '); for (var i = 0; i < l.length; i++) { if (l[i] == cls) { l.splice(i, 1); break; } } element.className = l.join(' '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeClass(_element, _class) {\n\t// variables\n\tvar classExists = false, // boolean to check if the class already exists\n\t\t\tclassRef; // will hold the array reference if the element exits\n\tvar classes = _element.className.split(\" \");\n\n\n\tif (classes[0] === \"\") { /* element has no classes. ...
[ "0.8443481", "0.8242928", "0.8138515", "0.8032185", "0.7974819", "0.79476213", "0.7879327", "0.7822337", "0.77709794", "0.7764882", "0.77600795", "0.77569664", "0.7756536", "0.7718557", "0.7705428", "0.76718366", "0.76188403", "0.75965035", "0.75856733", "0.75856733", "0.7585...
0.81157464
3
Check whether an element has a given class. Handles multiple classes on one element.
function hasClass(element, cls) { var classes = element.className; if (!classes) return false; var l = classes.split(' '); for (var i = 0; i < l.length; i++) { if (l[i] == cls) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasClass(element, clas)\n{\n return (' ' + element.className + ' ').indexOf(' ' + clas + ' ') > -1;\n}", "function hasClass(element, cls) {\n return element.classList.contains(cls);\n}", "function hasClass(element, className){\n var classes = element.className;\n return classes && new RegExp(\...
[ "0.8379745", "0.81470877", "0.8139193", "0.81298625", "0.81241983", "0.81241983", "0.81241983", "0.81007653", "0.8092771", "0.80921274", "0.80720335", "0.8068666", "0.8065285", "0.80499226", "0.80499226", "0.80499226", "0.8049484", "0.80124533", "0.7996591", "0.7992306", "0.7...
0.82679546
1
Make sure element is visible, and if not, scroll the browser window.
function makeVisible(element) { /* Find the location of element relative to document top. */ var posY = element.offsetTop; var parent = element.offsetParent; while (parent) { posY += parent.offsetTop; parent = parent.offsetParent; } /* Define the range of values that we want to b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ScrollToView(element) {\r\n if (typeof element !== 'undefined') {\r\n browser.executeScript(\"arguments[0].scrollIntoView();\", element);\r\n }\r\n }", "function ensureVisible()\r\n{\r\n var selectedTop = selected.position().top;\r\n var selectedBottom = selectedTop + selected.o...
[ "0.68884885", "0.6859578", "0.66467035", "0.6600582", "0.66000056", "0.6597222", "0.65906304", "0.650418", "0.6464937", "0.64584064", "0.6416497", "0.64012265", "0.64011073", "0.63936", "0.63665336", "0.63472116", "0.6317517", "0.63166344", "0.62880945", "0.6263733", "0.62589...
0.6402518
11
Convert a UTC date/time string into local time. Takes strings of the form 'YYYYMMDD HH:MM'. Timezone offset is expressed in minutes west of UTC (just use new Date().getTimezoneOffset()). Returns a string of the form 'YYYYMMDD HH:MM +ZZ:ZZ'
function convertDateTime(dt, offset) { var d = new Date(dt.substring(0, 4), dt.substring(5, 7) - 1, dt.substring(8, 10), dt.substring(11, 13), dt.substring(14, 16)); d = new Date(d.valueOf() - offset * 60000); /* minutes to milliseconds */ /* Date part */ var yy...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseDateToLocalTime(dateString) {\n var date = new Date(dateString);\n var hour = date.getHours();\n var minute = date.getMinutes();\n var period = hour < 12 ? \"AM\" : \"PM\";\n hour = hour == 0 ? 12 : hour;\n return hour + \":\" + (minute < 10 ? \"0\" + minute ...
[ "0.64504087", "0.6090177", "0.6040669", "0.6001062", "0.58937347", "0.58722353", "0.58542854", "0.58415145", "0.58006567", "0.57827836", "0.57051224", "0.56364024", "0.560808", "0.5565664", "0.55149114", "0.55139476", "0.5484835", "0.5457682", "0.5457183", "0.5457183", "0.545...
0.53846145
32
Is an element collapsed?
function isCollapsed(element) { return hasClass(element, 'collapse'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isCollapsed() {\n return this.outerElement.classList.contains('collapsed');\n }", "function isCollapsed(collapseBlock) {\r\n\tlet collapseCheckbox = collapseBlock.querySelector(\".disclosure-button\");\r\n\treturn (collapseCheckbox.checked == false);\r\n}", "_isCollapsed(data) {\r\n let parent...
[ "0.82372385", "0.7381753", "0.7176082", "0.69332534", "0.6932885", "0.69233316", "0.68807477", "0.68215495", "0.6814556", "0.6786407", "0.6778783", "0.6778783", "0.6778783", "0.6778783", "0.67416006", "0.67416006", "0.6681457", "0.6671133", "0.65346014", "0.6520949", "0.64671...
0.78481144
1
Return a list of collapsed entry IDs.
function getCollapsed() { var collapsed = []; var entries = getEntries(); for (var i = 0; i < entries.length; i++) { var entry = entries[i]; if (isCollapsed(entry)) collapsed.push(entry.id); } /* If we are saving a cookie during page load, do not clobber those entries ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get ids() {\n return this.getListAttribute('ids');\n }", "getEntityIdsAsString() {\n const d = Object.keys(this.items)\n .filter((item) => this.items[item].datasource == undefined && this.items[item].stateOnly == false)\n .map((item) => this.items[item].id)\n return ...
[ "0.5590605", "0.5576511", "0.53622735", "0.53055936", "0.5250869", "0.5232566", "0.5138974", "0.5129351", "0.5036714", "0.5031838", "0.49980292", "0.4975933", "0.49753514", "0.49607107", "0.49335325", "0.49326053", "0.49240968", "0.48989898", "0.48959365", "0.4873936", "0.487...
0.7559456
0
Collapse/expand an element, and make it visible.
function toggleAndShow(element) { toggle(element); makeVisible(element); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function expand(name){\n\tvar elem = get(name)\n\tif (elem) {\n\t\tif (elem.style.display==\"none\"){\n\t\t\telem.style.display=\"block\"\n\t\t} else {\n\t\t\telem.style.display=\"none\"\n\t\t}\n\t\ttoggle_value(name)\n\t}\n}", "function ShowExpandable() {\n var expandable = document.getElementById('expandable'...
[ "0.7506983", "0.7089761", "0.7054934", "0.7037519", "0.7031584", "0.6967816", "0.6927845", "0.6841982", "0.6837971", "0.68303037", "0.68085", "0.67826164", "0.6779056", "0.6756703", "0.66977745", "0.6681077", "0.6655623", "0.6638001", "0.6600746", "0.659524", "0.6592892", "...
0.7102137
1
Collapse/expand 'this'. You can attach this function as an event handler by doing element.onclick = toggleVisibility;
function toggleVisibility() { toggle(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_toggleCollapsedState() {\n const that = this;\n\n if (!that.collapsible) {\n return;\n }\n\n if (!that.collapsed) {\n that.collapse();\n }\n else {\n that.expand();\n }\n }", "function _toggle() {\n\tconst parent = this.parentE...
[ "0.7395216", "0.7140023", "0.70967054", "0.70614964", "0.7033477", "0.7033477", "0.7021061", "0.69874305", "0.69138545", "0.69123596", "0.69123596", "0.6853501", "0.67411584", "0.67367035", "0.67230815", "0.6674806", "0.6663264", "0.66521096", "0.66342616", "0.6584553", "0.65...
0.81301725
0
Internal function that actually collapses/expands an entry. Adds or removes 'collapse' from element's class attribute. CSS rules then take care of the hiding.
function doToggle(element) { if (isCollapsed(element)) { removeClass(element, 'collapse'); delete g_collapsed[element.id]; g_n_collapsed--; } else { addClass(element, 'collapse'); g_collapsed[element.id] = true; g_n_collapsed++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "collapse() {\n return __awaiter(this, void 0, void 0, function* () {\n this.outerElement.classList.add('collapsed');\n return utils_1.sleep(200);\n });\n }", "function collapse() {\n\t\tdocument.documentElement.style.setProperty(\"--collapseHeight\", removeHeight + \"px\");...
[ "0.6758694", "0.6576513", "0.64972067", "0.64307463", "0.64302176", "0.64256436", "0.6380508", "0.62862045", "0.62479043", "0.6231233", "0.6212901", "0.61778307", "0.6114297", "0.6104349", "0.60643214", "0.6056738", "0.6024893", "0.60043424", "0.59981596", "0.5994528", "0.598...
0.63987267
6
Load the collapsed set from a cookie called 'collapse'. Does not touch any elements or global variables.
function loadCookie() { var collapsed = {}; var cookies = document.cookie.split(";"); for (var i = 0; i < cookies.length; i++) { var parts = cookies[i].trim().split("="); if (parts[0] == "collapse") { var ids = unescape(parts[1]).split(","); for (var j = 0; j < ids.le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveCookie(collapsed) {\n var ids = [];\n var lastgood;\n var limit = 4000;\n for (var i = 0; i < collapsed.length; i++) {\n var id = collapsed[i];\n ids.push(escape(id));\n var current = escape(ids.join(\",\"));\n if (current.length < limit)\n lastgood =...
[ "0.713428", "0.68981117", "0.6520389", "0.6302697", "0.5883202", "0.57618517", "0.5680521", "0.56160086", "0.55837876", "0.5535461", "0.552707", "0.545883", "0.5402565", "0.5382975", "0.53680414", "0.53614986", "0.53388983", "0.53102237", "0.5306894", "0.52931106", "0.5292407...
0.8240965
0
Save the collapsed set to a cookie called 'collapse'. Does not touch any elements or global variables.
function saveCookie(collapsed) { var ids = []; var lastgood; var limit = 4000; for (var i = 0; i < collapsed.length; i++) { var id = collapsed[i]; ids.push(escape(id)); var current = escape(ids.join(",")); if (current.length < limit) lastgood = current ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function save_collapsed(objid, addcollapsed)\n{\n\tvar collapsed = fetch_cookie('vbulletin_collapse');\n\tvar tmp = new Array();\n\n\tif (collapsed != null)\n\t{\n\t\tcollapsed = collapsed.split('\\n');\n\n\t\tfor (var i in collapsed)\n\t\t{\n\t\t\tif (collapsed[i] != objid && collapsed[i] != '')\n\t\t\t{\n\t\t\t\...
[ "0.75357676", "0.7325969", "0.6648733", "0.62237036", "0.6190904", "0.60345066", "0.5923089", "0.5906219", "0.58525115", "0.5808117", "0.57933176", "0.5785739", "0.57551116", "0.57455724", "0.5631184", "0.5630719", "0.5628699", "0.56278604", "0.56253725", "0.5595499", "0.5590...
0.81706697
0
Queue a save in 5 seconds. If you queue several times, only one save will be performed.
function queueSaveCookie() { if (g_save_queued) { return; } g_save_queued = true; window.setTimeout(performQueuedSaveCookie, 5000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "requestSave() {\n if (!this.state.isUnsaved) this.setState({isUnsaved: true});\n if (this.saveBackoff) {\n clearTimeout(this.saveBackoff);\n }\n this.saveBackoff = setTimeout(() => {\n this.saveToFHIR();\n this.setState({isUnsaved: false});\n }, 5 * 1000);\n }", "startPendingSave()...
[ "0.6494289", "0.6440909", "0.63554007", "0.60790604", "0.58477867", "0.5726955", "0.5673202", "0.5662088", "0.5637505", "0.55457395", "0.5484638", "0.54510653", "0.5442485", "0.5435161", "0.5394003", "0.53603935", "0.53413063", "0.5294902", "0.5249502", "0.5246153", "0.520204...
0.71018165
0
Update the counters shown on the bottom right corner.
function updateStats() { if (!g_original_title) { g_original_title = document.title; } var total_entries = getEntries().length; var new_entries = total_entries - g_n_collapsed; document.title = g_original_title + ' - ' + new_entries + ' new entries'; var stats = document.getElementById('...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateCounters() {\n $(\"#lives\").html(\"lives: \" + lives);\n $(\"#levelCounter\").html(\"level: \" + level);\n}", "updateCounter () {\n\t\tthis.model.incrementUserMovements();\n\t\t$writeInnerHTML( this.view.$counter, this.model.userMovements );\n\t}", "function updateCount() {\n\t\t$('#count...
[ "0.7283494", "0.6980218", "0.6807193", "0.6701086", "0.66810703", "0.664427", "0.6629467", "0.6548977", "0.6548271", "0.65286696", "0.65222603", "0.65209866", "0.650629", "0.65060884", "0.64995295", "0.6494209", "0.6477581", "0.64745796", "0.6449102", "0.6436783", "0.6426068"...
0.0
-1
Keyboard focus: return the currently focused element.
function getCurEntry() { var entries = getEntries(); return entries[g_cur_entry]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get focusElement(){return this._input()||this}", "get _focusedElement() {\n let commandDispatcher = this._commandDispatcher;\n if (commandDispatcher) {\n return commandDispatcher.focusedElement;\n }\n return null;\n }", "function getActiveElement() {\r\n try {\r\n return document.acti...
[ "0.7545895", "0.7475181", "0.7460645", "0.7447917", "0.7447917", "0.7447917", "0.7444718", "0.743551", "0.74302346", "0.7299114", "0.7299114", "0.7299114", "0.7299114", "0.7299114", "0.7299114", "0.7299114", "0.7299114", "0.72608554", "0.7244671", "0.72144043", "0.71904516", ...
0.0
-1
Select this entry Can be attached as an event handler
function selectThisEntry() { var entries = getEntries(); for (var n = 0; n < entries.length; n++) { if (entries[n] == this) { selectEntry(n, false); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "selectHandler(e) {\n const { trigger } = this.props;\n trigger(e);\n }", "onSelect(event) {}", "function on_event_select_add_entry_to_logick_menu(e)\n{\n /*removes old Logick*/\n delete_custom_logick_of_element();\n \n /*sets the new custom elements*/\n logick_elements.custom_logick_eleme...
[ "0.6532568", "0.63458633", "0.6269916", "0.6234151", "0.6207591", "0.61330605", "0.6114432", "0.6075501", "0.6075501", "0.6075501", "0.6075501", "0.6037479", "0.6037479", "0.59828454", "0.5949799", "0.5938143", "0.59371716", "0.59371716", "0.59161395", "0.5882789", "0.5863629...
0.57232374
30
Select the next entry
function nextEntry() { selectEntry(g_cur_entry + 1, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "selectNext() {\n const children = Array.from(this.children);\n if (!children || children.length === 0) {\n return;\n }\n const selectedItem = this.selectedItem;\n const prevIndex = children.indexOf(selectedItem);\n const nextIndex = prevIndex + 1 >= children.length ? 0 : prevIndex + 1;\n ...
[ "0.709621", "0.690418", "0.68799025", "0.67642194", "0.66997874", "0.6683497", "0.66738665", "0.65182024", "0.6517543", "0.6435238", "0.64341515", "0.64162606", "0.63802844", "0.63766444", "0.6367688", "0.6350074", "0.63388276", "0.6314977", "0.628958", "0.62529725", "0.62072...
0.8254476
0
Select the previous entry
function prevEntry() { selectEntry(g_cur_entry - 1, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "selectPrevious() {\n const children = Array.from(this.children);\n if (!children || children.length === 0) {\n return;\n }\n const selectedItem = this.selectedItem;\n const prevIndex = children.indexOf(selectedItem);\n const nextIndex = prevIndex - 1 < 0 ? children.length - 1 : prevIndex - 1...
[ "0.7661618", "0.73812217", "0.7356744", "0.730648", "0.7188538", "0.71489453", "0.7140695", "0.70575744", "0.7047096", "0.70064837", "0.6981482", "0.6839984", "0.6833891", "0.68145144", "0.68130904", "0.67687386", "0.6762534", "0.6753865", "0.67349297", "0.67344224", "0.67328...
0.870679
0
Select the next unread entry
function nextUnread() { var entries = getEntries(); var n = g_cur_entry + 1; while (n < entries.length && isCollapsed(entries[n])) n++; if (n == entries.length) { n = 0; while (n < g_cur_entry && isCollapsed(entries[n])) n++; } selectEntry(n, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextEntry() {\n selectEntry(g_cur_entry + 1, true);\n}", "function prevUnread() {\n var entries = getEntries();\n var n = g_cur_entry - 1;\n while (n >= 0 && isCollapsed(entries[n]))\n n--;\n if (n < 0) {\n n = entries.length - 1;\n while (n > g_cur_entry && isCollaps...
[ "0.70789677", "0.6353398", "0.59390885", "0.58995247", "0.5872781", "0.58668697", "0.5766685", "0.5666778", "0.5652249", "0.5633564", "0.5573636", "0.5545409", "0.5516357", "0.5512371", "0.54955554", "0.5472895", "0.54543096", "0.5443803", "0.5435619", "0.54011285", "0.539328...
0.76438403
0
Select the previous unread entry
function prevUnread() { var entries = getEntries(); var n = g_cur_entry - 1; while (n >= 0 && isCollapsed(entries[n])) n--; if (n < 0) { n = entries.length - 1; while (n > g_cur_entry && isCollapsed(entries[n])) n--; } selectEntry(n, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prevEntry() {\n selectEntry(g_cur_entry - 1, true);\n}", "function nextUnread() {\n var entries = getEntries();\n var n = g_cur_entry + 1;\n while (n < entries.length && isCollapsed(entries[n]))\n n++;\n if (n == entries.length) {\n n = 0;\n while (n < g_cur_entry && ...
[ "0.77025545", "0.639882", "0.6374999", "0.6271315", "0.61556906", "0.6137202", "0.6110013", "0.61034614", "0.59610814", "0.5946718", "0.5942346", "0.5937872", "0.59354204", "0.58801836", "0.5858591", "0.5835714", "0.5835261", "0.58227617", "0.5796965", "0.5796944", "0.5754448...
0.77080065
0
Expand/collapse the current entry
function toggleCurrent() { toggleAndShow(getCurEntry()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggleExpand() {\n if (currentExpanded !== undefined) {\n currentExpanded.justToggleExpand();\n currentExpanded = undefined;\n }\n if (!this.state.expand && currentExpanded === undefined)\n currentExpanded = this;\n\n this.justToggleExpand();\n }", ...
[ "0.7120207", "0.7120207", "0.7068777", "0.69574034", "0.6769541", "0.675283", "0.66972965", "0.66887194", "0.6616376", "0.6603367", "0.6581728", "0.6573481", "0.6546629", "0.6531756", "0.65303344", "0.6473202", "0.6470736", "0.6447079", "0.64039683", "0.6397104", "0.6397104",...
0.6221999
33
Collapse the current entry, then go to the previous unread entry
function collapseThenPrevUnread() { var current = getCurEntry(); if (!isCollapsed(current)) { toggle(current); } prevUnread(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function collapseThenNextUnread() {\n var current = getCurEntry();\n if (!isCollapsed(current)) {\n toggle(current);\n }\n nextUnread();\n}", "function nextUnread() {\n var entries = getEntries();\n var n = g_cur_entry + 1;\n while (n < entries.length && isCollapsed(entries[n]))\n ...
[ "0.82400453", "0.70826465", "0.6921194", "0.6371922", "0.6258197", "0.5918308", "0.5845847", "0.5765019", "0.57388294", "0.5737494", "0.5706529", "0.5609347", "0.5603496", "0.5589401", "0.55101913", "0.54812986", "0.5478853", "0.5442584", "0.54085153", "0.5403885", "0.5398927...
0.83861744
0
Collapse the current entry, then go to the next unread entry
function collapseThenNextUnread() { var current = getCurEntry(); if (!isCollapsed(current)) { toggle(current); } nextUnread(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function collapseThenPrevUnread() {\n var current = getCurEntry();\n if (!isCollapsed(current)) {\n toggle(current);\n }\n prevUnread();\n}", "function nextUnread() {\n var entries = getEntries();\n var n = g_cur_entry + 1;\n while (n < entries.length && isCollapsed(entries[n]))\n ...
[ "0.7962046", "0.7623416", "0.6418748", "0.62385064", "0.59567225", "0.5906797", "0.5875298", "0.5851328", "0.57686245", "0.5696924", "0.56821924", "0.56590605", "0.5642513", "0.55863744", "0.5584937", "0.5567726", "0.551322", "0.54760164", "0.54721725", "0.54571474", "0.54532...
0.85354054
0
Open link for the current entry in a new tab.
function viewEntry() { var current = getCurEntry(); var url = $('a.title', current).attr('href'); window.open(url); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newWindowLink(e) {\n e.preventDefault();\n\n window.open($(this).attr('href'));\n }", "openLink(url) {\n window.open(url, \"_blank\")\n }", "function openInNewTab(url) {\n var win = window.open(url, '_blank');\n win.focus();\n }", "function open_new_...
[ "0.7510594", "0.7455538", "0.74397665", "0.7425222", "0.73615247", "0.7335858", "0.73029584", "0.71953034", "0.7187673", "0.71772957", "0.7162402", "0.7158", "0.7158", "0.71449786", "0.7142156", "0.7136733", "0.71304506", "0.7033355", "0.6971779", "0.6818573", "0.6804289", ...
0.7652027
0
Convert all times to user's local time zone. This function is idempotent. It looks for elements with class 'date' that contain a string of the form "YYYYMMDD HH:MM", and replaces it with a converted string of the form "YYYYMMDD HH:MM +ZZ:ZZ".
function convertTimesToLocal() { var elements = document.getElementsByTagName('span'); var date_regex = /^\d\d\d\d-\d\d-\d\d \d\d:\d\d$/; var offset = new Date().getTimezoneOffset(); for (var i = 0; i < elements.length; i++) { var e = elements[i]; if (hasClass(e, "date") && date_regex.te...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transformUTCToTZ() {\n $(\".funnel-table-time\").each(function (i, cell) {\n var dateTimeFormat = \"MM:DD HH:mm\";\n transformUTCToTZTime(cell, dateTimeFormat);\n });\n }", "function to_local_time(el_list) {\n var i;\n var today = (new Date()).toDateString();...
[ "0.66728", "0.6643859", "0.65066934", "0.6183171", "0.5502768", "0.54315543", "0.5425421", "0.53209233", "0.5262213", "0.52461743", "0.5144951", "0.5103354", "0.50894165", "0.50842", "0.5079419", "0.5079419", "0.5065636", "0.5038883", "0.5036624", "0.49802616", "0.49797103", ...
0.66497993
1