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
Example binToHex(["0111110", "1000000", "1000000", "1111110", "1000001", "1000001", "0111110"])
function binToHex(bins) { return bins.map(bin => ("00" + (parseInt(bin, 2).toString(16))).substr(-2).toUpperCase()).join(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function binToHex(a) {\r\n\tvar newVal = \"\";\r\n\tfor (i = 0; i < a.length/8; i++) \r\n\t\tnewVal += (\"00\" + parseInt(a.slice(8*i, 8*i+8),2).toString(16)).slice(-2);\r\n\treturn newVal;\r\n}", "function binToHex(bin) {\n for (var fourBitChunks = [], c = 0; c < bin.length; c += 4)\n fourBitChunks.pu...
[ "0.7413676", "0.70409733", "0.7034735", "0.6969076", "0.69535136", "0.69194937", "0.68874204", "0.6870118", "0.6826296", "0.6817666", "0.680198", "0.680198", "0.680198", "0.67952865", "0.67902726", "0.67830145", "0.6762924", "0.6740234", "0.67265904", "0.6723809", "0.67170584...
0.74536294
0
when its the players turn and they click on cell , then the color changes
function changeColors(currentPlayer, col) { console.log(currentPlayer); if (currentPlayer == 1) { col.removeClass('grey'); col.addClass('green'); col.addClass('p1'); } else { col.removeClass('green'); col.addClass('red'); col.addClass('p2'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeColor(e) {\n let column = e.target.cellIndex;\n let row = [];\n\n for (let i = 5; i > -1; i--){\n if(tableRow[i].children[column].style.backgroundColor =='white'){\n row.push(tableRow[i].children[column]);\n if(currentPlayer===1) {\n row[0].style....
[ "0.78940594", "0.75791633", "0.7496699", "0.7407657", "0.7294252", "0.723321", "0.71987605", "0.71439785", "0.71367407", "0.70968103", "0.7058698", "0.702306", "0.69892895", "0.688082", "0.68590707", "0.6855624", "0.6830104", "0.68278027", "0.6810469", "0.6797483", "0.6774784...
0.72036785
6
Get picture by ID
get(req, res, next) { req.checkParams( 'id', 'Invalid picture ID provided').isMongoId(); req.getValidationResult() .then( (result) =>{ if( !result.isEmpty() ){ let errorMessages = result.array().map(function (elem){ return elem.msg; }); PictureController.respondWithError(res, 500, 'There are validation errors: ' + errorMessages.join(' && ')); } let picId = req.params.id; return new Promise(function (resolve, reject) { PictureModel.findById(picId, function (err, pic) { if (pic === null) { PictureController.respondWithError(res, 500, "User not found against Provided id "+ picId); } else { resolve(pic); } }); }); }) .then((pic) => { PictureController.respondWithSuccess(res, 200, pic,"Successfully created"); }) .catch( (error) => { PictureController.respondWithError(res,error.status || 500, error); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get(id, callback) {\n database.schema.Img.find({\n id: id\n }, function (err, imgs) {\n if (err)\n callback(err, null)\n else if (imgs.length === 0)\n callback(new Error('No such image exists.'), null);\n else\n callback(null, imgs[0]);\n ...
[ "0.7613639", "0.7359118", "0.7139366", "0.70564103", "0.702378", "0.695637", "0.6928418", "0.6888502", "0.68387246", "0.6810745", "0.6776196", "0.67119944", "0.6700618", "0.66877294", "0.66669065", "0.66419965", "0.6623405", "0.6592644", "0.6559659", "0.6551724", "0.65137815"...
0.5866057
77
Build a list of configuration (custom launcher names).
function buildConfiguration(type, target) { const targetBrowsers = Object.keys(browserConfig) .map(browserName => [browserName, browserConfig[browserName][type]]) .filter(([, config]) => config.target === target) .map(([browserName]) => browserName); // For browsers that run locally, the browser name shouldn't be prefixed with the target // platform. We only prefix the external platforms in order to distinguish between // local and remote browsers in our "customLaunchers" for Karma. if (target === 'local') { return targetBrowsers; } return targetBrowsers.map(browserName => { return `${target.toUpperCase()}_${browserName.toUpperCase()}`; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static Configurators() {\n const customizeNothing = []; // no customization steps\n return [ customizeNothing ];\n }", "function updateArgProcessorList() {\n var argProcessorList = new commandLineUtils.ArgProcessorList();\n\n // App type\n addProcessorFor(argProcessorList, 'apptype', 'E...
[ "0.5952684", "0.54929423", "0.5462945", "0.54263645", "0.53882575", "0.5377423", "0.534919", "0.5339271", "0.53169733", "0.53052163", "0.5300868", "0.5283008", "0.5272032", "0.52457243", "0.5242057", "0.5235154", "0.52095884", "0.5202356", "0.5185812", "0.5145657", "0.5125965...
0.5686087
1
Duplicate layer warnning message
function showDuplicateMsg() { $("#worning-duplicate").dialog("open"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function warnConflictLayerName(module, layerName, layersMap) {\n\t\tif (module.mid !== layerName && layersMap[module.mid]) {\n\t\t\twarn(\"The layer \" + layerName + \" contains the module \" + module.mid +\n\t\t\t\t\" which is also a layer name.\\nThis is likely to cause problems as the layer \" +\n\t\t\t\tmodule...
[ "0.6802336", "0.6285311", "0.62693626", "0.626083", "0.5824914", "0.58229935", "0.5817325", "0.579206", "0.5733343", "0.57217723", "0.56994754", "0.5674651", "0.5636674", "0.5588524", "0.5580182", "0.55401933", "0.55259746", "0.54604703", "0.5458214", "0.54571515", "0.5450979...
0.49626294
49
No Layer to remove warnning message
function showRemoveMsg() { $("#worning-no-layer").dialog("open"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeWarning() {\n document.getElementById(this.id + \"_error\").innerHTML = \"\";\n }", "warn() {}", "function hideWorkingMessage() {\n psc().hideLayer();\n}", "static notifyWarning()\n\t\t{\n\t\t\tthis.notify(NotificationFeedbackType.Warning);\n\t\t}", "function noWarning(){\n noL...
[ "0.6376763", "0.62939286", "0.6247481", "0.6026614", "0.5996649", "0.5991714", "0.5986352", "0.5960493", "0.5948277", "0.5915595", "0.5890063", "0.5885589", "0.5862935", "0.5840045", "0.5839866", "0.58298117", "0.5802476", "0.5760516", "0.5749318", "0.5715565", "0.57076156", ...
0.0
-1
gets called when the user clicks on an observable link
function observable_link_clicked(observable_id) { $("#frm-filter").append('<input type="checkbox" name="observable_' + observable_id + '" CHECKED>').submit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "click(e){\r\n if ( this.url ){\r\n bbn.fn.link(this.url);\r\n }\r\n else{\r\n this.$emit('click', e);\r\n }\r\n }", "function onClick(link){\n \n}", "function handleClickedLink( url, view ) {\n\t// return true if the link was handled or to prevent other plugi...
[ "0.6859117", "0.68423307", "0.6615774", "0.656904", "0.65555376", "0.65233034", "0.6451522", "0.6348706", "0.6241252", "0.6215904", "0.6196734", "0.6171554", "0.6155926", "0.6136672", "0.61081654", "0.6096219", "0.6093206", "0.6088368", "0.60765094", "0.6024824", "0.6024824",...
0.5703929
77
gets called when the user clicks on a tag link
function tag_link_clicked(tag_id) { $("#frm-filter").append('<input type="checkbox" name="tag_' + tag_id + '" CHECKED>').submit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onTagClick(e) {\r\n console.log(e.detail);\r\n console.log(\"onTagClick: \", e.detail);\r\n }", "function onTagClick(e){\n console.log(e.detail);\n console.log(\"onTagClick: \", e.detail);\n }", "function onClickTag(e)\n{\n\tif (!e) var e = window.event;\n...
[ "0.75356567", "0.74746776", "0.7072557", "0.7063431", "0.6959302", "0.67220116", "0.6701569", "0.6610266", "0.6605996", "0.65622306", "0.6502058", "0.6462321", "0.6444712", "0.64422756", "0.6355239", "0.63428026", "0.62632555", "0.6211025", "0.62032723", "0.61599153", "0.6150...
0.58167
37
gets called when the user clicks on the right triangle button next to each alert this loads the observable information for the alerts and allows the user to select one for filtering
function load_alert_observables(alert_uuid) { // have we already loaded this? var existing_dom_element = $("#alert_observables_" + alert_uuid); if (existing_dom_element.length != 0) { existing_dom_element.remove(); return; } $.ajax({ dataType: "html", url: 'observables', data: { alert_uuid: alert_uuid }, success: function(data, textStatus, jqXHR) { $('#alert_row_' + alert_uuid).after('<tr id="alert_observables_' + alert_uuid + '"><td colspan="6">' + data); }, error: function(jqXHR, textStatus, errorThrown) { alert("DOH: " + textStatus); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function afterAlertsLoad() {\n if (sessionStorage.getItem(\"search_all_selected_obj\") !== null) {\n var obj,\n index;\n obj = JSON.parse(sessionStorage.getItem(\"search_all_selected_obj\"));\n index = TableUtil.getTableIndexById('#tblAlerts', obj.Id);\n ...
[ "0.6027999", "0.5704662", "0.56729025", "0.5671811", "0.55752796", "0.55389655", "0.55389655", "0.55220586", "0.55215806", "0.5472647", "0.54531014", "0.544349", "0.5392448", "0.5316566", "0.5316141", "0.5280121", "0.5274039", "0.5268145", "0.5252321", "0.52098984", "0.520235...
0.48475093
86
1) Generate random number 2) Give user ability to guess 3) If they are wrong guess again, maybe get a hint 4) IF they win say they won
function guessGame() { let randomNr = Math.floor(Math.random() * 11); console.log(randomNr); let guess; do { guess = prompt("Guess a number between 1 and 10"); console.log(guess, randomNr); if (randomNr > guess) { console.log("You guessed to low"); } else if (randomNr < guess) { console.log("You guessed too high"); } } while (guess != randomNr); console.log("You won!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomNumber() {\n\tif (getyx(y,x) =='Y3X23' || getyx(y,x) =='Y3X2') {\n\t\tvar randomNumber = (Math.floor(Math.random() * 5) + 1);\n\t\tvar bet = prompt('Please make a wager');\n\t\tvar guess = prompt('Please pick a number from 1 to 5');\n\t\t\tif(parseInt(guess) == randomNumber) {\n\t\t\talert('You just...
[ "0.79177094", "0.7891137", "0.7750411", "0.7650739", "0.7627652", "0.7563111", "0.754357", "0.75278264", "0.7454332", "0.74457943", "0.7437742", "0.7436417", "0.74299675", "0.742554", "0.74173", "0.7388835", "0.738245", "0.7381374", "0.73766744", "0.7343955", "0.73307776", ...
0.6890487
75
There are two things needed to place a beacon: the position and a name TO DO: name will have to be unique. At this point, if there are two entries with the same name, it will return the first it finds (a) position: currently, the position is the PLAYER'S position when player places the marker block, so use 'self.position' (b) name: enter a name in quotation marks, like "beacon1" or "pool"
function beacon(me, beaconName){ //we place a marker at the position we want: box(blocks.beacon,1,2,1); //In the next lines, we build the beacon object: var loc = me.getLocation(); //the next line appends the beacon's name to the array that contains only the tag key (the name the player gives to the beacon) beaconNameArray.push(beaconName); //the position is returned as an object which has coordinates as properties (keys). We are extracting the properties x, y and z //and puting them in an array whic we call locx. Since I want the numbers to be easy to read, and extreme precision is not //important for this plugin, I also round the numbers var locx = [Math.round(loc.getX()),Math.round(loc.getY()),Math.round(loc.getZ())]; //The beacon object is then assembled and appended to the beaconArray array var beaconObj = {tag: beaconName, position: locx}; beaconArray.push(beaconObj); //finally, we display the result to the player, showing the name of the beacon and its coordinates. //TO DO: TAB list of beacons' names echo('You are at ' + beaconName + ' at position ' + locx[0] + ", " + locx[1] + ", " + locx[2]); /* these were used to debug: echo(beaconObj.tag + beaconObj.position); echo(beaconArray.length); echo(beaconArray[0]); echo(beaconNameArray[0]); */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNewdidFromPos(position) {\n\t//flag ( \"getNewdidFromPos():: Started! Called for position: \" + position );\n\t//a=GM_getValue(myacc())\n\tvar allVillagePos = GM_getValue(myacc() + \"_allVillagePos2\").split(\",\");\n\t//flag ( \"getNewdidFromPos: allVillagePos=\"+allVillagePos+\";\");\n\tfor (var i = ...
[ "0.55945784", "0.55155414", "0.5372061", "0.53548574", "0.52936345", "0.5292482", "0.52400655", "0.52102", "0.5159438", "0.51353896", "0.51154304", "0.5113312", "0.51111436", "0.5110201", "0.5109417", "0.5098488", "0.50911343", "0.50832295", "0.5079928", "0.5076207", "0.50456...
0.7198466
0
this will guard against any duplicates the user inputs
function noDuplicatesinUserGuesses(userGuessesArr) { var checkDuplicatesArr = []; for (var i = 0; i < userGuessesArr.length; i++) { if (checkDuplicatesArr.indexOf(userGuessesArr[i]) === -1) { checkDuplicatesArr.push(userGuessesArr[i]); } } return checkDuplicatesArr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkIsDuplicatingInputs(numOfInputs) {\n const InputsArr = [];\n for (let i = 1; i <= numOfInputs; i++) {\n InputsArr.push(document.getElementById(`serial-${i}`).value + '-' + document.getElementById(`typeName-${i}`).value);\n }\n return InputsAr...
[ "0.6776648", "0.67727125", "0.66299736", "0.64909345", "0.62932765", "0.62074447", "0.61125845", "0.61001307", "0.6071562", "0.6062199", "0.6048642", "0.5961513", "0.59330827", "0.59151876", "0.5910981", "0.5858354", "0.58479273", "0.58370197", "0.5829865", "0.58098704", "0.5...
0.0
-1
displays the word at end of game
function displayWord(hangmanWord) { var showWord = ""; for (var i = 0; i < hangmanWord.correctLettersGuessed.length; i++) { showWord += hangmanWord.correctLettersGuessed[i].letterGuessed; } return showWord; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DisplayWord() {\n\tvar wordToPrint : String;\n\tvar hWord : GameObject;\n\t//var offset : float;\n\tswitch(this.kana) {\n\t\tcase \"a\":\n\t\t\twordToPrint = \"あ り\";\n\t\tbreak;\n\t\t\n\t\tcase \"i\":\n\t\t\twordToPrint = \"い な ず ま\";\n\t\tbreak;\n\t\t\n\t\tcase \"u\":\n\t\t\twordToPrint = \"う さ ぎ\";\n\t...
[ "0.735485", "0.7281575", "0.72742707", "0.7265616", "0.7172165", "0.7069368", "0.70655465", "0.70403314", "0.7035831", "0.70275617", "0.7018534", "0.69981015", "0.69899875", "0.697977", "0.69433796", "0.6937526", "0.6928103", "0.6922864", "0.69144416", "0.6908628", "0.6903575...
0.6786421
34
Desenha LOOP Infinito while (1)
function draw() { background(0,0,0); vitorioso(); if(!(placarPlayerUm >= 10 || placarPlayerDois >=10)){ jogo(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loopInfinito() {\n while (true) { }\n}", "function loop() {\r\n}", "function loop() {\r\n // if (is_loop) {\r\n setTimeout(manage_loop, manager.interval);\r\n // is_loop = false;\r\n // }\r\n }", "function cambiarEstiloAuto() ...
[ "0.8160807", "0.72183514", "0.7165397", "0.7162067", "0.7156095", "0.7156095", "0.7044727", "0.70299995", "0.6846243", "0.6711894", "0.67076546", "0.6599778", "0.6598126", "0.6598126", "0.6571005", "0.65352774", "0.65262204", "0.65159464", "0.64951324", "0.6481465", "0.647833...
0.0
-1
funcion para que mueva la ventana de sitio y evitar que el usuario click en si
function esquivarUsuario() { //obtenemos la hora actual var ahora = new Date(); //calculamos las nuevas coordenadas var x = ahora.getMilliseconds(); var y = x / 2; //desplazamos la ventana // window.moveTo(x, y); //movemos el div var ventana = document.getElementById('myModal'); ventana.style.position = "absolute"; ventana.style.left = x + "px"; ventana.style.top = y + "px"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ClickGerarElite() {\n GeraElite();\n AtualizaGeral();\n}", "function ClickGerarAleatorioElite() {\n GeraAleatorioElite();\n AtualizaGeral();\n}", "function ClickHabilidadeEspecial() {\n // TODO da pra melhorar.\n AtualizaGeral();\n}", "function ClickGastarFeitico() {\n AtualizaGeral();\n}", ...
[ "0.6638013", "0.661474", "0.65913135", "0.6577645", "0.6461949", "0.6403069", "0.6400792", "0.6325191", "0.6247681", "0.6090469", "0.60621065", "0.60539836", "0.605245", "0.6049288", "0.5998921", "0.598902", "0.5986557", "0.59647393", "0.59558606", "0.5948739", "0.5946089", ...
0.0
-1
funcion que muestra un mensaje cuando se pulsa no
function mostrarMensaje() { //mostramos un mensaje alert("¡Nos sorprende tu respuesta!"); //cerramos la ventana window.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onMessageArrived(message) {\n console.log(message.payloadString);\n mentrada=message.payloadString;\n document.getElementById(\"tanto\").innerHTML=mentrada;\n\tc=1+1;\n if (mentrada == \"0\"){\n\t\talert(\"No hay alimento en el dispensador\");\n\t}\n\n }", "function msgPerdeu() {\n ...
[ "0.66921383", "0.6573976", "0.65367085", "0.65140164", "0.65140164", "0.6327588", "0.6315882", "0.6301805", "0.62942123", "0.62942123", "0.6260059", "0.6259319", "0.6250487", "0.62083673", "0.61987877", "0.6191728", "0.6167637", "0.6163977", "0.61625004", "0.6136166", "0.6130...
0.0
-1
Call WebUSB API to send response.bin to device
function sendToken2Device (unlockToken) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function RequestUSBDevice() { \n await navigator.usb.requestDevice({ filters: [{}] });\n}", "async function SendBlyncUSB30ControlCommand(deviceInfo, byRedValue, byGreenValue, byBlueValue, byLightControl, byMusicControl_1, byMusicControl_2) {\n\n try {\n var device = deviceInfo.device;\n\n ...
[ "0.6560741", "0.6358267", "0.63325894", "0.61360186", "0.6115113", "0.60801035", "0.6074475", "0.60720617", "0.6020907", "0.58643204", "0.5797482", "0.57846606", "0.57151884", "0.57029116", "0.56599176", "0.5598955", "0.55791366", "0.55470836", "0.55214137", "0.54890126", "0....
0.0
-1
Call WebUSB API to get challenge.bin from device
function getChallenge () { //Fake data var randomData = []; var bytes = new Uint8Array(4); for (var i=4; i--; ) { let longRandomNumber = Math.floor(Math.random() * 1000000000); bytes[i] = longRandomNumber & (255); longRandomNumber = longRandomNumber >> 8 } randomData.push(bytes); console.log(randomData); var blob = new Blob(randomData); blob["lastModifiedDate"] = ""; blob["name"] = "challenge.bin"; var fakeF = blob; console.log(fakeF); return fakeF; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function RequestUSBDevice() { \n await navigator.usb.requestDevice({ filters: [{}] });\n}", "async getRequestDeviceInfo() {\n const outputReportID = 0x01;\n const subcommand = [0x02];\n const data = [\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n ...
[ "0.62603414", "0.61711174", "0.5881223", "0.564345", "0.56137395", "0.55299354", "0.55139816", "0.54276687", "0.5425389", "0.54120064", "0.5388707", "0.5372538", "0.5353609", "0.52452624", "0.5164182", "0.5159718", "0.51450515", "0.5111828", "0.50875866", "0.50299066", "0.501...
0.46860376
57
document.getElementById(password) . innerHTML = text;
function getRandome (max) { return max[Math.floor(Math.random() * max.length )]; console.log(Math.random()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function WritePassword(passwordText) {\n document.getElementById(\"password\").textContent = passwordText;\n\n}", "function writePassword() {\n document.querySelector(\"#password\").innerHTML = password;\n\n }", "function userInput(password) {\n document.getElementById(\"password\").textContent = pas...
[ "0.88116086", "0.8573077", "0.83758783", "0.8321781", "0.8316973", "0.8254185", "0.8232729", "0.82186484", "0.8214353", "0.8212168", "0.819865", "0.8196123", "0.8187172", "0.8187172", "0.8183191", "0.8169886", "0.8150967", "0.8148606", "0.81402886", "0.8140272", "0.8134589", ...
0.0
-1
Setup canvas based on the video input
function setup_canvases() { canvas.width = video_element.scrollWidth; canvas.height = video_element.scrollHeight; output_element.width = video_element.scrollWidth; output_element.height = video_element.scrollHeight; console.log("Canvas size is " + video_element.scrollWidth + " x " + video_element.scrollHeight); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_setupCanvas() {\n\t\tconst {video, elements} = this;\n\n\t\tconst virtualCanvas = elements.virtualCanvas = document.createElement('canvas');\n\n\t\tthis.context = elements.canvas.getContext('2d');\n\t\tthis.virtualContext = virtualCanvas.getContext('2d');\n\n\t\telements.canvas.width = virtualCanvas.width = video...
[ "0.78905183", "0.73323876", "0.7324095", "0.6902919", "0.6802968", "0.6754874", "0.674903", "0.67110926", "0.6707982", "0.66969913", "0.66809857", "0.6675698", "0.6649001", "0.65843296", "0.65676445", "0.65668964", "0.65466964", "0.65347123", "0.6457012", "0.6453839", "0.6424...
0.7507471
1
Connect the proper camera to the video element, trying to get a camera with facing mode of "user".
async function connect_camera() { try { let stream = await navigator.mediaDevices.getUserMedia({ video: { facingMode: "user" }, audio: false }); video_element.srcObject = stream; video_element.setAttribute('playsinline', true); video_element.setAttribute('controls', true); // remove controls separately setTimeout(function() { video_element.removeAttribute('controls'); }); } catch(error) { console.error("Got an error while looking for video camera: " + error); return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function setupCamera() {\n const video = document.getElementById('video')\n video.width = videoWidth\n video.height = videoHeight\n\n const stream = await navigator.mediaDevices.getUserMedia({\n audio: false,\n video: {\n facingMode: 'user',\n width: videoWidth,\n height: videoHeight...
[ "0.76734245", "0.74210167", "0.7339442", "0.7298811", "0.72884417", "0.72826576", "0.72387886", "0.7193497", "0.7098979", "0.709148", "0.70444125", "0.7037726", "0.70060045", "0.6965139", "0.6923468", "0.6908866", "0.6832422", "0.68167394", "0.6798288", "0.67865056", "0.67649...
0.8200102
0
Functions to make the calculator work
function btnPress() { if (result > 0) { clear(); } currentVal += this.value; updateDisplay(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function performCalculation() {\r\n if (calculator.firstNumber == null || calculator.operator == null) {\r\n alert(\"Anda belum menetapkan operator\");\r\n return;\r\n }\r\n\r\n let result = 0;\r\n if (calculator.operator === \"+\") {\r\n result = parseInt(calculator.firstNumber) +...
[ "0.79579", "0.79144764", "0.7734643", "0.7706488", "0.76287186", "0.75894624", "0.7580908", "0.75727016", "0.7569012", "0.7554074", "0.7547628", "0.7543969", "0.753799", "0.7525766", "0.7469643", "0.74664235", "0.74541664", "0.7437918", "0.7416802", "0.7410551", "0.7402005", ...
0.0
-1
http headers are case insentive so make sure key comparison is lowercase http header values still checked for case sensitivity
function headerPropMatcher(value, other) { return function () { if (typeof value === "undefined") return true; return Object.keys(value).every(function (key) { return value[key] === other[key.toLowerCase()]; }); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalizeHeaders(headers) {\n var h = {};\n for(var key in headers) {\n h[key.toLowerCase()] = headers[key];\n }\n return h;\n }", "function normalizeHeaders(headers) {\n var h = {};\n for(var key in headers) {\n h[key.toLowerCase()] = headers[key];\n }\n return h;\n ...
[ "0.71113825", "0.71113825", "0.6760743", "0.6760743", "0.6760743", "0.673706", "0.6694855", "0.64865065", "0.6258938", "0.6158184", "0.6158184", "0.6158184", "0.6157643", "0.6157643", "0.6157643", "0.6157643", "0.6157643", "0.6157643", "0.6157643", "0.61353904", "0.6130744", ...
0.6012075
24
app.use("/api/events", usersRoutes(knex)); app.use("/api/timeslots", usersRoutes(knex)); app.use("/api/attendees", usersRoutes(knex)); String randomizing function
function generateRandomString() { let randomize = Math.random() .toString(36) .substring(7); return randomize; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set_routes() {\n\n // Check your current user and roles\n app.get( '/status/:id', function( request, response ) {\n acl.userRoles( request.params.id || false, function( error, roles ){\n response.json( {'User': request.user ,\"Roles\": roles });\n });\n });\n\n // On...
[ "0.7205066", "0.68016106", "0.65026265", "0.64773345", "0.6475147", "0.6441569", "0.6441569", "0.63967544", "0.635786", "0.6301378", "0.62763906", "0.6275354", "0.62747335", "0.6191203", "0.61695", "0.61682653", "0.61668205", "0.61516255", "0.61287296", "0.611662", "0.6045925...
0.0
-1
TimeEngine method (scheduled interface)
advanceTime(time) { this.trigger(time); this.__lastTime = time; return time + this.__period; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ScheduleAt(time){\n \tconsole.log(\"scheduleprofecionales at\");\n }", "scheduler() {\n this.maybeTickSongChart();\n\n // When nextNoteTime (in the future) is near (gap is determined by \n // scheduleAheadTime), schedule audio & visuals and advance to the next\n // note.\n while (this.nextNoteTime...
[ "0.6416027", "0.6408302", "0.63115746", "0.62752646", "0.62608033", "0.62101203", "0.61650443", "0.61095214", "0.6015887", "0.5985229", "0.59624815", "0.59351104", "0.5895897", "0.5881284", "0.5830455", "0.5811016", "0.5795725", "0.5775376", "0.57715", "0.57437265", "0.573325...
0.0
-1
TimeEngine method (transported interface)
syncPosition(time, position, speed) { if (this.__period > 0) { var nextPosition = (Math.floor(position / this.__period) + this.__phase) * this.__period; if (speed > 0 && nextPosition < position) nextPosition += this.__period; else if (speed < 0 && nextPosition > position) nextPosition -= this.__period; return nextPosition; } return Infinity * speed; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tickCurrentTimeEngine() {\n\n var d = new Date();\n\n currentHours = d.getHours();\n currentMinutes = d.getMinutes();\n currentSeconds = d.getSeconds();\n\n if (currentHours.toString().length == 1) {\n choursDigit_1 = 0...
[ "0.60922885", "0.5949018", "0.5756867", "0.57554275", "0.57554275", "0.57131803", "0.56148666", "0.55186754", "0.5505017", "0.5497742", "0.5468396", "0.5467718", "0.54543716", "0.54002976", "0.5386592", "0.53503424", "0.5311419", "0.5294002", "0.52667093", "0.52347416", "0.52...
0.0
-1
TimeEngine method (transported interface)
advancePosition(time, position, speed) { this.trigger(time); if (speed < 0) return position - this.__period; return position + this.__period; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tickCurrentTimeEngine() {\n\n var d = new Date();\n\n currentHours = d.getHours();\n currentMinutes = d.getMinutes();\n currentSeconds = d.getSeconds();\n\n if (currentHours.toString().length == 1) {\n choursDigit_1 = 0...
[ "0.60914993", "0.5946908", "0.575641", "0.57523924", "0.57523924", "0.57110393", "0.5612518", "0.5518446", "0.5502605", "0.5496253", "0.54666376", "0.54654276", "0.5452242", "0.53977484", "0.5385463", "0.5348433", "0.53089094", "0.5291369", "0.52643234", "0.5233921", "0.52327...
0.0
-1
You can extend webpack config here
extend (config, ctx) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "extend (config, { isDev, isClient }) {\n // if (isDev && isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n // }\n if (process.server && p...
[ "0.75780183", "0.7486256", "0.74535376", "0.7388344", "0.73616195", "0.72877634", "0.7282417", "0.7211369", "0.71547335", "0.7107632", "0.70970905", "0.7090317", "0.7045734", "0.7035934", "0.70036227", "0.699704", "0.69930667", "0.6985959", "0.69833404", "0.6973784", "0.69592...
0.0
-1
converts it to a base b number. Return the new number as a string E.g. base_converter(5, 2) == "101" base_converter(31, 16) == "1f"
function baseConverter(num, b) { if (num === 0) { return "" }; const digit = ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"]; return baseConverter((num/b), b) + digit[num % b]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function baseConverter(num, base) {\n const bases = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, \"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\n const possibleBases = bases.slice(0, base)\n\n let result = [];\n\n while (num >= base) {\n result.unshift(possibleBases[num % base])\n num = Math.floor(num / base)\n }\n resul...
[ "0.78933334", "0.7787537", "0.76196146", "0.746665", "0.74133676", "0.7408443", "0.7408443", "0.7408443", "0.7408443", "0.7367569", "0.7335649", "0.72488385", "0.7197895", "0.7121101", "0.7059255", "0.7058206", "0.69450194", "0.6917524", "0.6917524", "0.68824667", "0.68824667...
0.81513506
0
Redraw the HTML table when needed ( eg when we change the generation)
function redrawHTMLGrid(grid, gridID) { var gridHTML = document.getElementById(gridID); for (var i = 0; i < height; i++) { for (var j = 0; j < width; j++) { var cell = gridHTML.rows[i].cells[j]; if (grid[i][j]) cell.className = "selected"; else cell.className = ""; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderTable() {\n clearTable();\n showTable();\n}", "function drawtable()\n{\n // going to use a template for this!\n\n // example table data row { id: \"CDL\", rank: 1949, \"change\": 23, \"winp\" : 84.4, \"run\" : \"wwwwwwwwww\" },\n\n // need in the item s_players,\n // {{:rank}}\n // {{:ch...
[ "0.7407916", "0.73421526", "0.731697", "0.7130859", "0.70566887", "0.68977284", "0.6853059", "0.67965204", "0.6790126", "0.67550945", "0.67364925", "0.66919464", "0.6648768", "0.6648", "0.66468537", "0.6614461", "0.6550473", "0.65374005", "0.6521049", "0.6520708", "0.6518475"...
0.0
-1
Draw a grid (html table) according to the input values for height and width of user
function drawHTMLGrid(height, width, gridID) { var gridHTML = document.getElementById(gridID); // Clear previous table and stop game of life algorithm gridHTML.innerHTML = ""; clearInterval(globalInterval); // Create html table for (var i = 0; i < height; i++) { var row = gridHTML.insertRow(0); for (var j = 0; j < width; j++) { var cell = row.insertCell(0); cell.innerHTML = ""; } } // Onclick a table element, change its class $(".grid td").click(function () { if (this.className == "") this.className = "selected"; else this.className = ""; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeGrid() {\n const height = inputHeight.val();\n const width = inputWidth.val();\n\n for (let i = 0; i < height; i++) {\n const row = $('<tr></tr>');\n for (let j = 0; j < width; j++) {\n row.append('<td></td>');\n }\n canvas.append(row);\n }\n}", "function makeGrid (){\nvar in1= ...
[ "0.8265037", "0.81319696", "0.8104697", "0.802983", "0.79749984", "0.7900075", "0.78400546", "0.7790189", "0.77530295", "0.7727299", "0.7696823", "0.7652794", "0.76238596", "0.76086986", "0.760159", "0.7578795", "0.7557386", "0.75469404", "0.7451794", "0.74278045", "0.7396933...
0.0
-1
Get the grid state from HTML
function getHTMLGrid(gameofLife) { var gridHTML = document.getElementById("grid"); var array = []; for (var i = 0, row = void 0; row = gridHTML.rows[i]; i++) { array[row.rowIndex] = []; for (var j = 0, col = void 0; col = row.cells[j]; j++) { if (col.className == "selected") array[row.rowIndex][col.cellIndex] = 1; else array[row.rowIndex][col.cellIndex] = 0; } } return array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseGrid(grid) {\n var str = '';\n for (var row = 0; row < grid.length; row++) {\n for (var col = 0; col < grid[row].length; col++) {\n str = str + (grid[row][col].state ? grid[row][col].state.toLowerCase() : '-')\n }\n }\n return str;\n}", "getGrid(gridNr) {\n ...
[ "0.6115273", "0.5874661", "0.5821485", "0.5768903", "0.5744697", "0.57446486", "0.5667717", "0.5627815", "0.5625856", "0.55612373", "0.5547919", "0.54730815", "0.5395059", "0.53842986", "0.5363936", "0.5337135", "0.53354484", "0.5299901", "0.52846044", "0.52349216", "0.521641...
0.57623345
4
(only applicable to raw and normal forms)
showError(message){ this.setState({ message: message }); this.setState({ loggedIn: false }); this.setState({ messageclass: 'alert alert-danger' }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set Raw(value) {}", "get Raw() {}", "function Raw(){}", "get raw() { return this._raw; }", "get raw() { return this._raw; }", "callSite(values, raw) {\n\n values.raw = raw || values;\n return values;\n }", "protected internal function m252() {}", "get normalized() {}", "async norma...
[ "0.6127074", "0.60859853", "0.6042301", "0.59349465", "0.59349465", "0.5480133", "0.5360717", "0.52917254", "0.52516854", "0.52384514", "0.5226667", "0.51880723", "0.51880723", "0.509369", "0.5085544", "0.5026419", "0.50058883", "0.5000224", "0.5000224", "0.5000224", "0.49569...
0.0
-1
Function to create circles with different positions and velocities
function create_circle() { //Random Position this.x = Math.random()*W; this.y = Math.random()*H; //Random Velocities this.vx = 0.1+Math.random()*1; this.vy = -this.vx; //Random Radius this.r = 10 + Math.random()*50; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createCircles() {\n \n \tconst dTheta = 0.5*2.43;\n \n \tlet c1 = new OrthoganalCircle(0,dTheta);\n \tlet c2 = new OrthoganalCircle(TWO_PI/3,dTheta);\n \tlet c3 = new OrthoganalCircle(2*TWO_PI/3,dTheta);\n\n \tcircles = [c1,c2,c3]; \n \n}", "createCircle() {\n const particle = [];\n\n for...
[ "0.8012867", "0.7532649", "0.72093153", "0.71758884", "0.71456313", "0.7104973", "0.7095474", "0.70853734", "0.7039927", "0.7023612", "0.7003312", "0.6963377", "0.69378877", "0.68887025", "0.6850711", "0.6844003", "0.6842291", "0.67999196", "0.67995", "0.6793498", "0.6775934"...
0.7532618
2
Function to draw the background
function draw() { //Create the gradient var grad = ctx.createLinearGradient(0, 0, W, H); grad.addColorStop(0, 'rgb(19, 105, 168)'); grad.addColorStop(1, 'rgb(0, 0, 0)'); //Fill the canvas with the gradient ctx.globalCompositeOperation = "source-over"; ctx.fillStyle = grad; ctx.fillRect(0,0,W,H); //Fill the canvas with the circles for(var j = 0; j < circles.length; j++) { var c = circles[j]; //Draw the circle and it with the blur grad ctx.beginPath(); ctx.globalCompositeOperation = "lighter"; ctx.fillStyle = grad; ctx.arc(c.x, c.y, c.r, Math.PI*2, false); ctx.fill(); //Lets use the velocity now c.x += c.vx; c.y += c.vy; //To prevent the circles from moving out of the canvas if(c.x < -50) c.x = W+50; if(c.y < -50) c.y = H+50; if(c.x > W+50) c.x = -50; if(c.y > H+50) c.y = -50; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawBackground() {\n\t// Draw the background\n\tcolorRect(0, 0, canvas.width, canvas.height, '#333');\n}", "function drawBackground() {\n ctx.fillStyle = COLOR_BACKGROUND;\n ctx.fillRect(0, 0, width, height);\n}", "function Background() {\n\tctx.beginPath();\n\tctx.rect(0, 0, 1140, 600);\n\tctx....
[ "0.840327", "0.83144766", "0.8288564", "0.8146599", "0.81359756", "0.81241894", "0.80891436", "0.8056861", "0.802413", "0.8013045", "0.79130584", "0.78841805", "0.78572387", "0.78559095", "0.78409606", "0.78127265", "0.77953005", "0.7791962", "0.7768092", "0.77617973", "0.773...
0.0
-1
Filtrar por nombre y especie
function handleFilter(data) { if (data.key === "name") { return setFilterName(data.value); } else if (data.key === "species") { return setFilterSpecies(data.value); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filtrarProd(){\nlet filtrado = productos.filter(prod => {\n \n return prod.nombre.toLowerCase().includes($(\"#txtFiltrar\").val().toLowerCase())\n})\nlistarProductos(filtrado)\n$(\"#txtFiltrar\").val(\"\")\n}", "function filtro() {\n let selectorSexo = document.getElementById(\"selectorSexo\");\n...
[ "0.7111127", "0.70671946", "0.6926898", "0.65646803", "0.65564334", "0.65414715", "0.6495549", "0.64823645", "0.6480472", "0.64273787", "0.6356719", "0.6287484", "0.628119", "0.62747353", "0.6254951", "0.62457097", "0.6240369", "0.6231702", "0.62291324", "0.6214421", "0.61833...
0.0
-1
Checks if `value` is a property name and not a property path.
function isKey(value, object) { if (Array.isArray(value)) { return false; } const type = typeof value; if ( type === "number" || type === "boolean" || value == null || isSymbol(value) ) { return true; } return ( reIsPlainProp.test(value) || !reIsDeepProp.test(value) || (object != null && value in Object(object)) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isControlled(props, valueProp) {\n // React's built-in <input> considers a prop to be provided if its value is non-null/undefined.\n // Mirror that behavior here (rather than checking for just undefined).\n return props[valueProp] !== undefined && props[valueProp] !== null;\n}", "function isCon...
[ "0.60520184", "0.60520184", "0.60428756", "0.58993435", "0.5889884", "0.585996", "0.5847797", "0.5843738", "0.57885444", "0.5783723", "0.5783723", "0.5783723", "0.5783723", "0.5783723", "0.5783723", "0.5781897", "0.57815415", "0.57815415", "0.57815415", "0.5776515", "0.577588...
0.0
-1
click a los numeros;
function Nu(num){ document.getElementById("result").value=document.getElementById("result").value+num; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buttonClicked(key) {\r\n numberButtons.forEach(number => {\r\n if(number.innerText === key) {\r\n number.click();\r\n }\r\n })\r\n}", "handleNumClick(i, e) {\n let numEvent = new CustomEvent('numPress', { 'detail': { 'number': i } });\n let keypad = document....
[ "0.7131207", "0.7007308", "0.6951292", "0.6844245", "0.68236154", "0.6785539", "0.6764145", "0.67068475", "0.66902304", "0.66212386", "0.65701467", "0.6565539", "0.6507141", "0.6483116", "0.6441663", "0.63847923", "0.6383678", "0.63509285", "0.6316498", "0.6312572", "0.630939...
0.0
-1
click al signo (+,/,,)
function Sign(s){ G_Numero1=document.getElementById("result").value; G_Signo=s; document.getElementById("result").value=""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clickSignInLnk() {\n return this.SignInLnk.click();\n }", "function signupLinkClick() {\n closeSigninClick();\n signupClick();\n}", "clickOnSignInLink(){\n let signInLink = utils.byLocator(jobsPageLocator.jobsPage.SignInLink);\n utils.clickOn(signInLink);\n }", "async clickSi...
[ "0.63308024", "0.6325274", "0.59800106", "0.5818107", "0.5774368", "0.5710783", "0.57096374", "0.5677159", "0.567587", "0.5666399", "0.5660508", "0.56503785", "0.56413054", "0.5638463", "0.55988306", "0.5586199", "0.55725545", "0.5566793", "0.553986", "0.55269295", "0.5509403...
0.534272
44
=============================================>>>>> = MEDIA QUERIES = ===============================================>>>>>
function handleWidthChange(mqlVal) { if (mqlVal.matches) { $navLinks.off('click'); $('.btn-section').off('click'); $navLinks.on('click', function(e) { e.preventDefault(); var target = $(this).attr('href'), targetOffset = $(target).offset(); $(this).parent().addClass('active').siblings().removeClass('active'); $('html,body').animate({scrollTop: (targetOffset.top)}, 500); $('.nav-main').removeClass('active'); $('.hamburger').removeClass('is-active'); }); /*=============================================>>>>> = REMOVE CUSTOM SCROLLBAR = ===============================================>>>>>*/ $('.section-block-content').mCustomScrollbar('destroy'); } else { $navLinks.off('click'); checkUrlHash(); $('.section-main-block, .section-secondary-block').addClass('animated'); $('.section-secondary-block-right').on(animationEnd, function(e) { if ($(e.target).parent().hasClass('section-out') && $(e.target).hasClass('section-secondary-block-right')) { console.log('Section "' + $(e.target).parent().attr('id') + '" out.' ); $(e.target).parents('.section').removeClass('section-out'); $(e.target).removeClass(sectionOutAnimation).siblings('.section-secondary-b').removeClass(sectionOutAnimation); } else if ($(e.target).parent().hasClass('section-in') && $(e.target).hasClass('section-secondary-block-right')) { console.log('Section "' + $(e.target).parent().attr('id') + '" in.' ); isAnimating = false; } }); $navLinks.on('click', function(e) { e.preventDefault(); changeSections(e); }); $('.btn-section').on('click', function(e) { e.preventDefault(); changeSections(e); }); /*=============================================>>>>> = INIT CUSTOM SCROLLBAR = ===============================================>>>>>*/ $('.section-block-content').mCustomScrollbar({ theme: 'flipcard', scrollInertia: 100 }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getMediaItems(albumID){\n //Reponse contains an array of (id, description, productUr, mediaMetaData, filename)\n const token = await GoogleSignin.getTokens();\n await this.getDbUserData();\n data = {\n URI: 'https://photoslibrary.googleapis.com/v1/mediaItems:search',\n ...
[ "0.644103", "0.60938877", "0.60685694", "0.5915229", "0.5886536", "0.58821404", "0.5860882", "0.58383995", "0.58078915", "0.5766396", "0.57354265", "0.5735394", "0.5730848", "0.5702633", "0.5676882", "0.5661672", "0.565121", "0.5624092", "0.5617748", "0.55673903", "0.55485564...
0.0
-1
redirect from createRoom page to joinRoom page or viceVersa
function redirect(param) { const value = param; if(value === 'createroom'){ location.href = "createRoom.html"; } else if (value === 'joinroom') { location.href = "index.html"; } else if (value === 'permissionGranted') { // location.href = "homepage"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function goToRoom(e) {\n\te.preventDefault();\n\n\tvar roomName = $.trim($('#roomName').val());\n\n\tif(!roomName){ return; } \n\n window.location.href = '/covert/room/' + roomName;\n}", "async function createChatroomAndRedirect(e) {\n setLoading(true);\n try {\n let roomId = profileD...
[ "0.7536238", "0.7142537", "0.69698006", "0.6648515", "0.66118354", "0.6590052", "0.6523262", "0.6497811", "0.6487846", "0.64606035", "0.64541465", "0.6422784", "0.64120525", "0.6398517", "0.6353128", "0.63165313", "0.6307308", "0.6282584", "0.62794757", "0.6279065", "0.627861...
0.6787807
3
used by collapsible() to hide elements
function hideElements() { let elementsToHide = document.querySelectorAll(".elementToHide"); elementsToHide.forEach((item) => { item.classList.toggle("hide-element"); }) // console.log(elementsToHide); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hide() {}", "function hideElements() {\n $(\"#collapse_icon\").html(\"show\");\n $(\".sidebar_elements\").addClass(\"hidden\").fadeTo(600, 0).css('dispaly', 'flex');\n $(\"#cross\").removeClass(\"hidden\").fadeTo(600, 1).css('dispaly', 'flex');\n}", "function hide() {\n $.forEach(this.elements,...
[ "0.7696056", "0.7422398", "0.7333384", "0.7272602", "0.7221115", "0.72023773", "0.7200048", "0.7130635", "0.7071157", "0.7068182", "0.70546514", "0.7046007", "0.69858533", "0.69858533", "0.69854015", "0.69841826", "0.6978578", "0.6970021", "0.6970021", "0.6947223", "0.6942153...
0.0
-1
output message to DOM
function outputMessage(msg) { const div = document.createElement('div'); div.classList.add('message'); div.innerHTML = `<p class="meta"> ${msg.username}•<span>${msg.time}</span></p> <p class="text"> ${msg.text} </p>`; const chatSection = document.getElementById('chat-message'); chatSection.appendChild(div); // console.log(div); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function outputMesssage(message) {\n const div = document.createElement('div');\n div.innerHTML = `${message}`;\n document.querySelector('.messages').appendChild(div);\n}", "function output(message) {\n const para = document.createElement('p');\n para.innerHTML = message;\n outputDiv.appendChil...
[ "0.7349049", "0.7335071", "0.71537566", "0.70986444", "0.7090382", "0.7079102", "0.7029552", "0.70211124", "0.6986701", "0.6970532", "0.6938852", "0.6931121", "0.68999714", "0.68598974", "0.68533146", "0.68473786", "0.68436587", "0.68171614", "0.68057007", "0.6804204", "0.679...
0.68937236
13
Prompt the user before leave chat room
function leaveRoom() { const leaveRoom = confirm('Are you sure you want to leave the chatroom?'); if (leaveRoom) { window.location = '../index.html'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function leaveRoom() {\n let chatLink = server + '/chat/' + roomId;\n Swal.fire({ background: background, position: \"top\", title: \"Leave this room?\",\n html: `<p>If you want to continue to chat,</br> go to the main page and</br> click on chat of this room</p>`,\n showDenyButton: true, confirmButtonText...
[ "0.7367518", "0.7307474", "0.72227997", "0.7046869", "0.6863847", "0.68358433", "0.68050003", "0.6736533", "0.66827023", "0.66460466", "0.6634746", "0.6505397", "0.6496834", "0.6462929", "0.6460044", "0.64054745", "0.6391411", "0.6321094", "0.6310152", "0.62895876", "0.628174...
0.72276896
2
Add room name to DOM
function outputRoomName(room) { const roomName = document.getElementById('room-name'); roomName.innerHTML = room; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function outputRoomName(room) {\n roomName.innerHTML = `<li class=\"contact\">\n <div class=\"wrap\">\n <div class=\"meta\">\n <p class=\"name\">${room}</p>\n </div>\n ...
[ "0.7907107", "0.7804841", "0.7804841", "0.7804841", "0.7804841", "0.7804841", "0.7804841", "0.77756387", "0.7764691", "0.7764691", "0.77535206", "0.7694868", "0.7694868", "0.7694868", "0.7694868", "0.76699555", "0.7601553", "0.7549329", "0.7530662", "0.74739176", "0.7458124",...
0.7851127
1
Add users to DOM
function outputUsers(users) { const userList = document.getElementById('users'); userList.innerHTML = ` ${users.map(user => `<li>${user.username}</li>`).join('')} `; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addUserToDom( user ) {\n var user = new User( user );\n var html = user.getUserHtmlString();\n $('#users-window').append(html);\n }", "function users(arr) {\n arr.forEach(element => {\n fragment.appendChild(renderUsers(element));\n });\n elUserListWrapper.ap...
[ "0.7952884", "0.7369776", "0.70811844", "0.69950676", "0.69260037", "0.6859463", "0.68376815", "0.6807424", "0.6793708", "0.6773879", "0.6771808", "0.6758447", "0.67424613", "0.6739701", "0.67254215", "0.66942924", "0.6682839", "0.6682308", "0.66621274", "0.66621274", "0.6662...
0.62353987
54
same as first func
function initDragula() { dragger.destroy(); dragger = dragula([ document.getElementById("required"), document.getElementById("1A"), document.getElementById("1B"), document.getElementById("2A"), document.getElementById("2B"), document.getElementById("3A"), document.getElementById("3B"), document.getElementById("4A"), document.getElementById("4B"), document.getElementById("5A"), document.getElementById("5B"), document.getElementById("6A"), document.getElementById("6B"), document.getElementById("7A"), document.getElementById("7B"), document.getElementById("8A"), document.getElementById("8B"), document.getElementById("9A"), document.getElementById("9B"), document.getElementById("10A"), document.getElementById("10B"), document.getElementById("trash") ]); dragger.on('drop', function (el, target, source) { const term = $(target).attr("id"); const src = $(source).attr("id"); let draggedId = el.id; let termIndex = 0; if (term === "trash") { emptyTrash(); checkSchedule(termIndex); } else if (term === "required") { // no operations if courses are dragged back to required courses // need to change in future because all course needs to be validated again document.getElementById(draggedId).style.color = "darkslateblue"; // back to original color checkSchedule(termIndex); } else { if (src === "required") { //only check schedule for course after term has been dropped termIndex = terms.indexOf(term); } else { //src is Term Number termIndex = Math.min(terms.indexOf(src), terms.indexOf(term)); } // else needs to check all schedule again` checkSchedule(termIndex); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firstFunc(funcParam){\n funcParam();\n}", "function first(func, array){\n for (var i=0; i<array.length; i++){\n\t if (func(array[i])) return array[i];\n }\n return undefined;\n }", "function firstFunction(array) {\n return array[0];\n }", "function first(arr, cb) {...
[ "0.71622723", "0.6917423", "0.6829868", "0.666389", "0.6551532", "0.6531658", "0.6525417", "0.6499219", "0.6499219", "0.6491045", "0.6417933", "0.6415121", "0.6395186", "0.6393414", "0.63775855", "0.63620055", "0.632454", "0.6301253", "0.6288463", "0.6282723", "0.6275193", ...
0.0
-1
Vanilla JS to add a new task
function addTask() { /* Get task text from input */ const inputTask = document.getElementById("taskText").value.toUpperCase(); let id = inputTask + "(" + Math.round(Math.random() * 100) + ")"; //generate random number to prevent unique id id = id.replace(" ", ""); // check if inputTask has whitespace if (/\S/.test(inputTask)) { /* Add task to the 'Required' column */ $.ajax({ url: 'http://127.0.0.1:8000/api/course-info/get/' + inputTask, type: 'get', // This is the default though, you don't actually need to always mention it success: function (data) { document.getElementById("required").innerHTML += "<li class='task' id='" + id + "' onclick='popupWindow(\"" + id + "\",-1)'>" + "<p>" + inputTask + "</p></li>"; }, error: function (data) { document.getElementById("required").innerHTML += "<li class='task' id='" + id + "' onclick='popupWindow(\"" + id + "\",-1)'>" + "<p>" + inputTask + " *</p></li>"; } }); /* Clear task text from input after adding task */ document.getElementById("taskText").value = ""; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addTask() {\n Task.addTask(info.newTask);\n info.newTask = \"\";\n }", "addTask() {\n const input = qs('#addTask');\n saveTask(input.value, this.key);\n this.showList();\n }", "addNewTask() {\n let task = new Task(this.newTaskName);\n task.id = new Date().g...
[ "0.8582499", "0.83260816", "0.82045835", "0.8187", "0.80332613", "0.7992455", "0.7992383", "0.7912743", "0.7834776", "0.7806132", "0.7794268", "0.7776513", "0.7737798", "0.77044237", "0.77003527", "0.764926", "0.764752", "0.7641587", "0.7582123", "0.7576442", "0.75711054", ...
0.0
-1
Vanilla JS to delete tasks in 'Trash' column
function emptyTrash() { /* Clear tasks from 'Trash' column */ document.getElementById("trash").innerHTML = ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteTasks() {\n const mutateCursor = getCursorToMutate();\n if (mutateCursor) {\n clickTaskMenu(mutateCursor, 'task-overflow-menu-delete', false);\n } else {\n withUnique(\n openMoreMenu(),\n 'li[data-action-hint=\"multi-select-toolbar-overflow-menu-delete\"]',\n ...
[ "0.7403256", "0.72473013", "0.7158116", "0.7153182", "0.71489525", "0.7123197", "0.70864403", "0.70445865", "0.70080054", "0.6972743", "0.6972021", "0.69592506", "0.6953322", "0.69066185", "0.6871405", "0.68564725", "0.6838206", "0.6827074", "0.68257725", "0.6818862", "0.6803...
0.7694405
0
handleMessage: do the entire sequence for this message. subscribe: send the machine if available, else send error. any other command: send error. This method returns a promise that usually resolves. It rejects only if there is a bug or internal error.
handleMessage(clientId, data) { return new Promise( (resolve, reject) => { log(`client ${clientId}: |${data}|`); if (data.match(/^\s*subscribe\s+/)) { const m = data.match(/subscribe\s+(\w+)/); if (m) { let machine = m[1]; this.subscribe(clientId, machine) .then( () => { log(`subscribed ${clientId} to machine ${machine}`); resolve(); }) .catch( errMsg => { const fullMsg = `error: ${errMsg}`; log(fullMsg); this.sendMessage(clientId, fullMsg) .then(resolve) .catch(reject); }); } else { const msg = `error: bad subscribe command`; log(`sending ${msg} to client ${clientId}`); this.sendMessage(clientId, `${msg}`) .then(resolve) .catch(reject); } } else if (data.match(/^command\s+/)) { const m = data.match(/^\s*command\s+(\w+)/); const arr = data.split('\n').filter( e => e.length > 0); if (!m) { log(`did not match command pattern`); return reject(`bad command line: ${arr[0]}`); } log(`emitting command ${m[1]} ${clientId}: |${arr.slice(1)}|`); this.emit('command', m[1], clientId, arr.slice(1)); return resolve(); } else { const msg = `bad command: |${trunc(data)}|`; console.log(`sending ${msg} to client ${clientId}`); this.sendMessage(clientId, msg) .then(resolve) .catch(reject); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function handleMessage(msg, reply) {\n let response = 'success';\n try {\n if (msg.command == 'capture') {\n if (!msg.streamId) {\n throw new Error('No stream ID received');\n }\n await startCapture(msg.streamId);\n } else if (msg.command == 'stop') {\n stopCapture();\n ...
[ "0.62991405", "0.6008539", "0.58747715", "0.581249", "0.57012355", "0.5655519", "0.5601487", "0.55965835", "0.55960613", "0.5570987", "0.554621", "0.55416393", "0.55300313", "0.54769", "0.54657245", "0.5454042", "0.54484653", "0.53516346", "0.5329301", "0.5327847", "0.5322457...
0.6933967
0
subscribe() returns a promise. write a "provide" command followed by the serialization of the indicated machine. If no such machine, then reject.
subscribe(clientId, machine) { return new Promise( (resolve, reject) => { if (typeof machine !== 'string' || !machine.match(/^[a-z0-9]+$/)) { return reject(`subscribe: bad machine name: ${machine}`); } const rec = this._clientMap.get(clientId); if (! rec) { return reject(`subscribe(${machine}): no such client: ${clientId}`); } else if (rec.machines.includes(machine)) { log(`subscribe(${machine}): already subscribed`); return resolve(); } else if (! this._machineMap.has(machine)) { return reject(`subscribe: no such machine: ${machine}`); } rec.machines.push(machine); log(`sending machine ${machine} to client ${clientId}`); this.sendMachine(machine, rec.wse) .then( resolve ) .catch( errMsg => reject(`failed sending ${machine}: ${errMsg}`) ); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ProductionEngineSubscription(machine) {\n //console.log('created pe subs: ', machine.id);\n\n let pesMachine = machine;\n let peState = null;\n\n this.getPeState = () => peState;\n this.getMachine = () => pesMachine;\n\n this.makeUpdater = function () {\n return function(newState)...
[ "0.5257558", "0.51723474", "0.4928612", "0.48542452", "0.48314035", "0.48277408", "0.48249453", "0.47648463", "0.47130254", "0.47021812", "0.4699739", "0.46977046", "0.46927583", "0.46921438", "0.46291152", "0.46257806", "0.46217126", "0.45902544", "0.4585775", "0.45815372", ...
0.68615836
0
variable para manejar la reproduccion de sonido de notificacion
function actualizarNotificaciones(){ $.ajax({ url : "ajax/campana-notificaciones.php", method: "POST", success: function(datos){ var cantNoti=datos; if(cont!=cantNoti && cont<cantNoti){ document.getElementById('player').play(); cont = cantNoti; } $('#cantidad_notificaciones').html(datos); if(datos == 0){ $('#cantidad_notificaciones').css('background-color','gray'); }else{ $('#cantidad_notificaciones').css('background-color','red'); } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function galerijRechts(){\r\n\tlengthExtensie = getImgPad(\"plaatjeFrame\");\r\n\tif (Number(lengthExtensie[3]) < totaalPlaatjes){\r\n\t\tplaatjeNummer = Number(lengthExtensie[3]) + 1;\r\n\t}\r\n\telse{\r\n\t\tplaatjeNummer = 1;\r\n\t}\r\n\tsetPlaatjeNaam(lengthExtensie, plaatjeNummer, \"plaatjeFrame\");\r\n\tretu...
[ "0.5440219", "0.5339634", "0.53384095", "0.5233856", "0.5200052", "0.5199249", "0.51917046", "0.51895845", "0.5126079", "0.51148546", "0.5114559", "0.5105019", "0.5071394", "0.50506276", "0.5014611", "0.50108767", "0.49970484", "0.4989662", "0.4980363", "0.49793032", "0.49767...
0.0
-1
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++ Agregar comentario ++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function agregarComentario(codigoNoticia, codigoUsuario){ data = "codigo_noticia="+codigoNoticia+"&"+ "codigoUsuario="+codigoUsuario+"&"+ "contenido="+$("#txt_comentario").val(); ; $.ajax({ url : "ajax/agregar_comentario.php?accion=4", data: data, method: "POST", dataType: "json", success:function(resultado){ if (resultado.codigo_resultado==1){ $("#txt_comentario").val(""); cargarComentarios(codigoNoticia); }else alert(resultado.mensaje); $(function () { $('[data-toggle="popover"]').popover(); }) }, error:function(){ alert("Ups, no se pudo cargar el contenido."); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_comentarios(){ // funcion de agregar comentarios\n\n var nombre = document.getElementById('nombre').value; //tomo valores que ingresa el usuario en el form\n var coment = document.getElementById('texto_coment').value;\n var puntos = document.getElementById('puntos').value;\n\n comentario.p...
[ "0.67340124", "0.6665499", "0.64305824", "0.63836443", "0.6347343", "0.62406707", "0.62374985", "0.62332064", "0.62103367", "0.6160985", "0.6156094", "0.615274", "0.6133597", "0.6125442", "0.6122164", "0.610954", "0.60880464", "0.6067993", "0.60568416", "0.60443884", "0.60349...
0.5861529
62
$urlRouterProvider.otherwise('/blog'); $locationProvider.html5Mode(true); troubles with f5, MB I have to add 'ngadmin' to all routes on clientside
function tmpl(mdl, filename) { // return APP_ROOT_FOLDER + mdl + '/templates/' + filename + '.html'; return ROOT + mdl + '/templates/' + filename + '.html'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function config($locationProvider, $stateProvider) {\n $locationProvider\n .html5Mode({\n enabled: true,\n requireBase: false\n });\n\n $stateProvider\n .state('home', {\n url: '/',\n controller: 'H...
[ "0.70081425", "0.67581046", "0.6521661", "0.6463842", "0.62978435", "0.6270588", "0.6248024", "0.6082253", "0.6050122", "0.603999", "0.6039961", "0.6029623", "0.6015504", "0.60119295", "0.5923023", "0.5915811", "0.59057236", "0.5884399", "0.58723426", "0.58223176", "0.5808531...
0.0
-1
Validation for correct component functioning
componentWillMount() { const { headers } = this.props; const keys = Object.keys(this.props.data[0]); headers.forEach(h => { if (keys.indexOf(h) === -1) { throw new Error('One of the headers provided do not match a property from the row entity, please revise' + '"headers" and "data" props supplied'); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validate(){\n\n\t\t//TODO: make this work\n\n\n\t}", "isValid(){\n let component = this.props.component\n let key = this.props.attribute\n return !component.state.data[key].error\n }", "isValid(): boolean {\n return this.innerComponent.isValid();\n }", "@action\n ...
[ "0.7114409", "0.7060334", "0.68913716", "0.67783165", "0.6748929", "0.66354346", "0.6621943", "0.6493374", "0.64520377", "0.6451088", "0.64212316", "0.64124346", "0.6371954", "0.6364813", "0.635534", "0.6311542", "0.63046616", "0.63046616", "0.6302848", "0.6274953", "0.626759...
0.0
-1
end functions for typeclass "Appendable"
function unsafeInsert(selector, selection) { return selection.insert(selector); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Append() {\r\n}", "append() {\n errors.throwNotImplemented(\"appending element to collection\");\n }", "function AppendAll() {\r\n}", "function Appendable(n, v) {\n 'use strict'\n var val = n + \"=\" + v;\n this.append = function (name, value) {\n val += (\"&\" + name + \"=\" + v...
[ "0.68925905", "0.667579", "0.61507356", "0.61467755", "0.6069787", "0.60099924", "0.59639144", "0.5720726", "0.56616426", "0.5654691", "0.5614543", "0.55670524", "0.5537994", "0.5528203", "0.5514664", "0.5481797", "0.5481797", "0.5412114", "0.53961855", "0.53751755", "0.53720...
0.0
-1
functions that attach event handlers
function attachCallbackToEvent(selection, eventType, callback) { selection.on(eventType, callback); return selection; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function attachEventHandlers() {\n // TODO arrow: attach events for functionality like in assignment-document described\n var clicked;\n $(\"#\"+_this.id).click(function(event){\n clicked = true;\n diagram.selectArrow(_this);\n });\n $(\"#\"+_this.id).contents()...
[ "0.78477645", "0.76434076", "0.75672", "0.751856", "0.751856", "0.751856", "0.751856", "0.751856", "0.751856", "0.751856", "0.751856", "0.751856", "0.751856", "0.751856", "0.751856", "0.751856", "0.751856", "0.751856", "0.751856", "0.751856", "0.751856", "0.751856", "0.72...
0.0
-1
another variation useful if you need to pass something arbitrary thru to the callback fn achieved by caching the thing you want sent in a Property in the D3 selection
function attachCallbackToEventWithProperty(selection, eventType, callback, propname, prop) { selection.on(eventType, callback); selection.property(propname, prop); return selection; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function optionChanged() { \n\n var testSubject = d3.select('#selDataset').node().value;\n buildPlot(testSubject)\n \n}", "function optionChanged(){\r\n var dropdownMenu = d3.select('#selDataset');\r\n var subjectID = dropdownMenu.property('value');\r\n// run the plot data function (which includes...
[ "0.58874065", "0.57989436", "0.5757216", "0.56241125", "0.55572116", "0.54892504", "0.5479817", "0.54547167", "0.541034", "0.5369719", "0.53387153", "0.533705", "0.52792317", "0.526219", "0.52497226", "0.52429646", "0.52146345", "0.51889366", "0.5138782", "0.5133924", "0.5130...
0.56258893
3
Renders the layout of the `ProductImage` component.
render() { return ( <div className="row justify-content-lg-start"> <div className="col-lg-2 thumbs"> {this.props.product.map( (product) => { let arr = []; // The comingled images between product and these standalone images // threw me off a bit arr.push(product.product_images.map( (image, index) => { return ( <a onClick={() => this.props.updateSelectedImage(image)}> <img key={`thumb-image-${index}`} className="img-fluid" src={image} alt={`Product thumbnail ${index}`}/> </a> ) })); arr.push(product.options.map( (option, index) => { return ( <a onClick={() => this.props.updateSelectedProduct(option)}> <img key={`thumb-option-${index}`} className="img-fluid" src={option.option_image} alt={`Product thumbnail ${index}`}/> </a> ) })); arr = arr.reduce( (a, b) => { return a.concat(b); }); return arr; })} </div> <div className="col-lg-10" data-test="selected-image"> <img className="img-fluid" src={this.props.selectedImage} alt="Selected"/> </div> </div> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderProduct() {\n logger.info('renderProduct start');\n var imageGroups = currentProduct.getHeroImageGroups();\n var altImagesInfo = [],\n imageViews = [];\n\n currentProduct.ensureImagesLoaded('altImages').done(function() {\n var imageGroup,\n imageGroupImages,\n ...
[ "0.68119514", "0.6711578", "0.6438905", "0.6103812", "0.60803235", "0.6068057", "0.6055299", "0.6051518", "0.60464317", "0.6000089", "0.5971422", "0.5937545", "0.5921839", "0.5915895", "0.5908995", "0.5892216", "0.5871162", "0.5831915", "0.5831691", "0.5806436", "0.5787973", ...
0.5530093
36
Displays users name and a button, starts game when clicked.
function introWelcome() { title.innerText = "Welcome, " + username; subTitle.innerText = ""; firstButton.classList.remove("hidden"); firstButton.innerText = "Click to start!" firstButton.onclick = function() { startFunction(); } userInput.classList.add("hidden"); submitButton.classList.add("hidden"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showGamificationButton(names, urls) {\n\n //////////////////////////\n // REMOVE OLD BUTTONS\n /////////////////////////\n const old_gameStartButton = document.getElementById('start_game_button'),\n old_gameButton = document.getElementById('guess_game_button');\n if (old_gameStartB...
[ "0.7060195", "0.69904566", "0.6753309", "0.67526233", "0.6736144", "0.6704425", "0.6685465", "0.6605404", "0.6598817", "0.65951693", "0.6560461", "0.6552254", "0.6488314", "0.643916", "0.6436459", "0.64232516", "0.6409647", "0.64065343", "0.63825643", "0.6379045", "0.63708436...
0.59898114
94
Choose to eat at a fancy restaurant or a fastfood restaurant.
function startFunction() { title.innerText = ""; subTitle.innerText = subTitleIntro; firstButton.innerText = "fancy restaurant"; secondButton.classList.remove("hidden"); secondButton.innerHTML = "fastfood restaurant"; firstButton.onclick = function() { regretFancyRestaurantOption(); } secondButton.onclick = function() { regretFastFoodRestaurantOption(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleFastRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const fastDishInput = document.getElementById(\"fast-input\").value;\n const fastfoodMenu = [\"cheeseburger\", \"doubleburger\", \"veganburger\"]\n\n if(fastDishInput == fastfoodMenu[0]) {\n restaurantClosin...
[ "0.7036451", "0.68487436", "0.6445757", "0.6161395", "0.6132312", "0.608472", "0.59508175", "0.5935433", "0.59339875", "0.5858789", "0.5857141", "0.5808869", "0.5801549", "0.5787674", "0.57862955", "0.5737572", "0.571127", "0.5710847", "0.5680382", "0.56678766", "0.5634949", ...
0.0
-1
Continue or regret option for fancy restaurant.
function regretFancyRestaurantOption() { subTitle.innerText = "Are you sure?"; firstButton.innerText = "Yes, continue"; firstButton.onclick = function() { fancyRestauratMenu(); } secondButton.innerText = "No, go back"; secondButton.onclick = function() { startFunction(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleFancyRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const dishInput = document.getElementById(\"dish-input\").value;\n const fancyMenu = [\"pizza\", \"paella\", \"pasta\"]\n\n if(dishInput == fancyMenu[0]) {\n restaurantClosing();\n } else if (dishInput =...
[ "0.68103266", "0.64964914", "0.6342976", "0.62424755", "0.61173964", "0.6034379", "0.5987297", "0.58292925", "0.5781033", "0.5737571", "0.57127887", "0.5708035", "0.5688682", "0.56830406", "0.56636477", "0.56604296", "0.56401587", "0.5638404", "0.56222045", "0.5614877", "0.56...
0.559048
23
Continue or regret option for fastfood restaurant.
function regretFastFoodRestaurantOption() { subTitle.innerText = "Are you sure?"; firstButton.innerText = "Yes, continue"; firstButton.onclick = function() { fastFoodRestaurantScene(); } secondButton.innerText = "No, go back"; secondButton.onclick = function() { startFunction(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleFastRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const fastDishInput = document.getElementById(\"fast-input\").value;\n const fastfoodMenu = [\"cheeseburger\", \"doubleburger\", \"veganburger\"]\n\n if(fastDishInput == fastfoodMenu[0]) {\n restaurantClosin...
[ "0.7001863", "0.657572", "0.6354631", "0.61981887", "0.61617345", "0.6039793", "0.59346044", "0.58597845", "0.5759057", "0.57568675", "0.5734756", "0.5711459", "0.56503254", "0.56424713", "0.5628671", "0.5624591", "0.56080526", "0.5606945", "0.55971736", "0.5590472", "0.55805...
0.56144774
16
Fancy restaurant scene start.
function fancyRestauratMenu() { subTitle.innerText = fancyRestaurantWelcome; firstButton.classList.add("hidden"); secondButton.classList.add("hidden"); fancyDiv.classList.remove("hidden"); handleFancyRestaurantChoice(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function start() {\n // To present a scene, use the following line, replacing 'sample' with\n // the id of any scene you want to present.\n\n SceneManager.getSharedInstance().presentScene('newScene1');\n}", "function startup() {\n\tsceneTransition(\"start\");\n}", "function start() {\n for(var ...
[ "0.74389476", "0.7310588", "0.70975536", "0.6952484", "0.6715637", "0.66859394", "0.663983", "0.6638555", "0.6571287", "0.65618575", "0.65270853", "0.6473177", "0.646615", "0.64646536", "0.6458617", "0.64431214", "0.6443038", "0.6418837", "0.6404111", "0.64015144", "0.6380875...
0.0
-1
Dish menu for fancy restaurant scene.
function handleFancyRestaurantChoice() { /** @type {HTMLInputElement} Input field. */ const dishInput = document.getElementById("dish-input").value; const fancyMenu = ["pizza", "paella", "pasta"] if(dishInput == fancyMenu[0]) { restaurantClosing(); } else if (dishInput == fancyMenu[1]) { restaurantClosing(); } else if (dishInput == fancyMenu[2]) { restaurantClosing(); } else { fancyRestauratMenu(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayMenu() {\n const menu = document.querySelector(\"#menu\");\n let dishes = hard_coded_dishes;\n\n dishes.forEach(dish => {\n // generate template for main ingredient and the name of the dish\n const main = displayDish(\n dish.course,\n dish.name,\n dish.price,\n dish.ing...
[ "0.66595", "0.64337385", "0.6374985", "0.63151807", "0.62984025", "0.6261499", "0.6255055", "0.6168333", "0.61503583", "0.6132916", "0.61064476", "0.6048671", "0.6040572", "0.6017006", "0.5998923", "0.59902024", "0.5983666", "0.59650725", "0.5962446", "0.5915375", "0.5912792"...
0.6014771
14
Fastfood restaurant scene start.
function fastFoodRestaurantScene() { subTitle.innerText = fastfoodWelcome; firstButton.classList.add("hidden"); secondButton.classList.add("hidden"); fastDiv.classList.remove("hidden"); handleFastRestaurantChoice(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startup() {\n\tsceneTransition(\"start\");\n}", "function start() {\n // To present a scene, use the following line, replacing 'sample' with\n // the id of any scene you want to present.\n\n SceneManager.getSharedInstance().presentScene('newScene1');\n}", "function start() {\n for(var ...
[ "0.7005796", "0.6905421", "0.6712243", "0.6531578", "0.6511532", "0.65048075", "0.6440274", "0.6435362", "0.6370753", "0.63203603", "0.6283713", "0.62831676", "0.62555844", "0.6246311", "0.6242093", "0.6232279", "0.6213741", "0.6201732", "0.61525476", "0.6120415", "0.61030513...
0.6223574
16
Dish menu for fastfood restaurant scene start.
function handleFastRestaurantChoice() { /** @type {HTMLInputElement} Input field. */ const fastDishInput = document.getElementById("fast-input").value; const fastfoodMenu = ["cheeseburger", "doubleburger", "veganburger"] if(fastDishInput == fastfoodMenu[0]) { restaurantClosing(); } else if (fastDishInput == fastfoodMenu[1]) { restaurantClosing(); } else if (fastDishInput == fastfoodMenu[2]) { restaurantClosing(); } else { fastFoodRestaurantScene(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initMenu() {\n // Connect Animation\n window.onStepped.Connect(stepMenu);\n\n // Make buttons do things\n let startbutton = document.getElementById('start_button');\n \n //VarSet('S:Continue', 'yielding')\n buttonFadeOnMouse(startbutton);\n startbutton.onclick = startDemo\n\n\n ...
[ "0.65776086", "0.65583575", "0.65202", "0.6496863", "0.6446255", "0.6437807", "0.6436781", "0.64309365", "0.6362453", "0.6336776", "0.6317718", "0.6301867", "0.6280807", "0.6278971", "0.6271259", "0.62144846", "0.6179938", "0.6157224", "0.6079268", "0.6076413", "0.6034619", ...
0.58811235
32
Endning scene, when button is clicked the page refreshes to starting point.
function restaurantClosing() { subTitle.innerText = gameExit; firstButton.innerText = "Play again?"; firstButton.classList.remove("hidden"); fancyDiv.classList.add("hidden"); fastDiv.classList.add("hidden"); firstButton.onclick = function() { location.reload(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function end(){\n Manager.clearGame();\n changeState(gameConfig.GAME_STATE_START_SCENE);\n}", "function endGame() {\n $('.home').css({ 'margin-top': '0px' });\n disappear('.instructions');\n hide('.view-button');\n disappear('.follow-circle');\n disappear('.instructions');\n ...
[ "0.7501099", "0.7182471", "0.71448046", "0.71136594", "0.71136594", "0.67926484", "0.6751904", "0.660751", "0.6588003", "0.65868604", "0.6547606", "0.6524403", "0.6503534", "0.64659953", "0.64595336", "0.6429853", "0.6414972", "0.6357407", "0.6339703", "0.6338195", "0.6336011...
0.0
-1
Change the BG of body
function bodyBG(image) { let bg = "linear-gradient(45deg,rgba(0, 0, 0, 0.6) 65%, rgba(250, 250, 250, 0.34))"; if (window.innerWidth < 800) { document.body.style.backgroundImage = bg + ",url('img/sm/" + image + "')"; } else { document.body.style.backgroundImage = bg + ",url('img/" + image + "')"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeBodyBg(color){\r\n document.body.style.background = color;\r\n }", "function setBackground (bg) {\n\tif (bg.img.length > 0) {\n\t\tbgImgObj.onload = function(){\n\t\t\tdocument.body.style.backgroundImage =\"url('\" + bg.img + \"')\";\n\t };\n\n\t\tbgImgObj.src = bg.img;\n\n\t docum...
[ "0.76715577", "0.73678327", "0.73218066", "0.7317351", "0.7225835", "0.71228945", "0.70734984", "0.6943245", "0.691535", "0.6907454", "0.6903787", "0.69023407", "0.68907183", "0.68554646", "0.6825707", "0.6818228", "0.6811231", "0.67675275", "0.6664751", "0.6652312", "0.66469...
0.0
-1
Drag element when mouse down on it
function drag (el) { el.addEventListener('mousedown', () => { el.style.cursor = grab window.addEventListener('mousemove', dragBox(el)) el.style.zIndex = index + 1 console.log(window.getComputedStyle(el).zIndex) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mouseDownEvent(eb){\r\n dragging = eb\r\n}", "onMouseDrag(e) {}", "mouseDrag(prev, pt) {}", "mouseDrag(prev, pt) {}", "function onMouseDown(event)\n{\n dragging = true;\n var pos = getRelative(event);\n mouseDragStartX = pos.x;\n mouseDragStartY = pos.y;\n}", "startDrag(x, y) {}", "func...
[ "0.7448934", "0.7445981", "0.7434803", "0.7434803", "0.73383325", "0.72711074", "0.71712095", "0.71278065", "0.70817447", "0.7007203", "0.7007203", "0.70053345", "0.7001513", "0.6993286", "0.6958098", "0.6944916", "0.69328177", "0.69316167", "0.6918795", "0.6918795", "0.69060...
0.65766144
51
Stop drag when mouse up on an element
function dragEl (el) { window.addEventListener('mouseup', (e) => { el.style.cursor = grab window.removeEventListener('mousemove', dragBox(el)) el.style.zIndex -= 1 console.log(window.getComputedStyle(el).zIndex) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pointerUp(event) {\n dragging = false;\n }", "onElementMouseUp(event) {\n if (this.dragContext) {\n this.endMove();\n event.preventDefault();\n }\n }", "onElementMouseUp(event) {\n if (this.dragContext) {\n this.endMove();\n event.preventDefault();\n }\n }",...
[ "0.7828176", "0.7713579", "0.7713579", "0.76460505", "0.7573367", "0.75427765", "0.7493127", "0.74205", "0.74172616", "0.7387032", "0.73673016", "0.73669547", "0.7278426", "0.7272666", "0.72687185", "0.7268313", "0.71928036", "0.7182019", "0.7163921", "0.7142748", "0.7140526"...
0.0
-1
Fly sequence Portals activation procedure Switch division
function SwitchDivision(target,Manual){ const rebu = $("#Reach"); Section = false; Active.SwitchDivision = true; Forward.obj = false; Dur = 2; for(X = 0; X < Portal.length; X++) { if (target.hasClass(Portal[X])) { const prtl = $("#" + Portal[X]); // Setting .Flow's background color TweenMax.to(target.find(".Flow"),.5,{background: Active.Color,autoAlpha: 0}); // Activating the new section Section = prtl.children().first(); if( Active.Division.attr("id") === "Temporary" ){target = $("#Temporary");} // Switching Active.Division = Section; Dimension = prtl; ChildrenLen = Dimension.children("footer,header,article").length; if ((!Reverse.pedal && (ChildrenLen > 1 && Active.Division.index() + 1 < ChildrenLen))) { Forward.obj = Dimension.children().eq(Active.Division.index() + 1); } Forward.isAvailable = true; Forward.isAllowed(true); Glitch.on("#Gandalf", null); } } // Boosting active fly's speed to wrap up faster if( Shrinker && Shrinker.isActive() ) { Shrinker.duration(2); Shrinker.eventCallback("onComplete",LoadSection,[FlyAssociates]); }else{ // Hiding the current section TweenMax.to(Active.Division, .5, {autoAlpha: 0,onComplete: LoadSection,onCompleteParams: [FlyAssociates]}); } Locked = true; Active.Portal = false; // Prepping the spaceship for the next section if( Section === false || Manual ){ Dimension = Active.Division.parent(); ChildrenLen = Dimension.children("footer,header,article").length; Forward.isAvailable = true; Forward.isAllowed(true); Glitch.on("#Gandalf", null); if( !Manual ) { // Keeping the current division in target variable target = Active.Division; // Set upcoming sibling of the last division as current division when: if ( // Last division isn't reversed to this division !Reverse.pedal && // Current division has upcoming siblings ( Active.Division.index() + 1 < ChildrenLen && // Next division when set, isn't the Temporary division (Current main division) Dimension.children().eq(Active.Division.index() + 1).attr("id") !== "Temporary" ) ) { Active.Division = Dimension.children().eq(Active.Division.index() + 1); } else if ((Active.Portal === false && !Reverse.pedal)) { Active.Division = Subject = $("#Temporary"); Forward.isAvailable = false; // Resetting portals affected assets if (Rotten.Direct !== false) { Rotten.Direct.play(); GetPortal = $(Rotten.Direct.target[0]).closest(".Portal"); CheckForToggle(GetPortal); // Fly Config Active.Portal = Subject = GetPortal; Parent = Subject.parent(); Forward.isAvailable = true; }else{ rebu.data({GandalfOpt: 1}); Forward.isAllowed(false); } } else if (Reverse.pedal) { Active.Division = Reverse.obj; Subject = Active.Division.find(".Entry"); Parent = Active.Division; // Resetting portals affected assets if (Rotten.Direct !== false && Active.Division.attr("id") === "Temporary") { Rotten.Direct.play(); GetPortal = $(Rotten.Direct.target[0]).closest(".Portal"); CheckForToggle(GetPortal); // Fly Config Active.Portal = GetPortal; if (Active.Division.attr("id") === "Temporary") { Subject = GetPortal; } } } // Set the upcoming sibling as next division when current division has followed siblings if ( Active.Division.index() + 1 < ChildrenLen ) { Forward.obj = Dimension.children().eq(Active.Division.index() + 1); } // Or reset to the main division else if( Active.Division.attr("id") !== "Temporary" ){ Forward.obj = $("#Temporary"); } } if( !Forward.obj.length && Active.Dimension === Portal[0] ){ rebu.data({GandalfOpt: 2}); Forward.isAvailable = false; Forward.isAllowed(false); } Section = Active.Division; } Section.css({visibility: "", opacity: "", transform : "", transformOrigin: ""}); function LoadSection(Flyascs){ // Actions that should be done only when shrinker is available $(".Flow ,.Shrinker").css({transform: "", visibility: "", opacity: "", background: ""}); // Resetting fly associates $(target).css({opacity: 0, visibility: "hidden",zIndex: -1,transform : "", transformOrigin: ""}); TweenMax.set(Flyascs.toString(), {y: 0, x: 0, scale: 1, rotation: 0}); Section.css({zIndex: 1}); Active.SwitchDivision = false; } Draggable.get(".Pedal").endDrag(); ReverseSequence(); DivisionSequence(true); Pathfinder(); DivisionExpress.set.Beam(); URI(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "activate() {\n this.active = true\n this.activatedComponents.forEach(contact => {\n contact.activate(this.value < 9 ? ActivationSources.ALGEDONODE : ActivationSources.DIAL_OUTPUT)\n })\n }", "async activate(){\n\t\tfor(const node of this.flowTree[0])\n\t\t\tawait node.activate();\n\t}", "onSwitc...
[ "0.60313374", "0.5884927", "0.5854123", "0.5854123", "0.5854123", "0.5756651", "0.5733953", "0.5701265", "0.57011676", "0.5696058", "0.56745774", "0.56244195", "0.5612491", "0.5596226", "0.5581617", "0.55560327", "0.5531749", "0.5509789", "0.54743826", "0.541155", "0.5393223"...
0.53914255
21
recursion (flat tree structure)
function flatRecord(record, indent, childrenColumnName, expandedKeys, getRowKey) { var arr = []; arr.push({ record: record, indent: indent }); var key = getRowKey(record); var expanded = expandedKeys === null || expandedKeys === void 0 ? void 0 : expandedKeys.has(key); if (record && Array.isArray(record[childrenColumnName]) && expanded) { // expanded state, flat record for (var i = 0; i < record[childrenColumnName].length; i += 1) { var tempArr = flatRecord(record[childrenColumnName][i], indent + 1, childrenColumnName, expandedKeys, getRowKey); arr.push.apply(arr, (0, _toConsumableArray2.default)(tempArr)); } } return arr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function iterativeFlatten(root) {\n var nodes = [], i = 0;\n var toRecurse = [root];\n\n function recurse() {\n var nextGen = []\n toRecurse.forEach(function(node){\n if (!node.id) node.id = ++i;\n nodes.push(node);\n\n if (node.children) nextGen = nextGen.co...
[ "0.6545768", "0.6522955", "0.6522955", "0.6522955", "0.63996917", "0.6390482", "0.63771105", "0.63418573", "0.63144714", "0.6300509", "0.62738794", "0.62598526", "0.6240276", "0.62336373", "0.62021476", "0.61904514", "0.61747825", "0.6170924", "0.6166377", "0.61520875", "0.61...
0.0
-1
Return a promise to load features for the genomic interval
async readFeatures(chr, start, end) { const index = await this.getIndex() if (index) { this.indexed = true return this.loadFeaturesWithIndex(chr, start, end) } else if (this.dataURI) { this.indexed = false return this.loadFeaturesFromDataURI() } else { this.indexed = false return this.loadFeaturesNoIndex() } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async readFeatures(chr, start, end) {\n\n const index = await this.getIndex()\n if (index) {\n return this.loadFeaturesWithIndex(chr, start, end);\n } else if (this.dataURI) {\n return this.loadFeaturesFromDataURI();\n } else {\n return this.loadFeatures...
[ "0.6543959", "0.61009336", "0.590788", "0.5869675", "0.5767293", "0.5726963", "0.571669", "0.5531802", "0.54262996", "0.5398379", "0.53473455", "0.52430815", "0.5231676", "0.5218503", "0.5158587", "0.5131139", "0.5100868", "0.5091692", "0.50904274", "0.50904274", "0.5066121",...
0.6294286
1
Return a Promise for the async loaded index
async loadIndex() { const indexURL = this.config.indexURL return loadIndex(indexURL, this.config, this.genome) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getCurentIndex() {\n\n this.check()\n return await this.storage.loadIndex()\n }", "async loadIndex() {\n const indexURL = this.config.indexURL;\n let indexFilename;\n if (isFilePath(indexURL)) {\n indexFilename = indexURL.name;\n } else {\n const uri...
[ "0.70689124", "0.6799907", "0.6459076", "0.64186", "0.6398918", "0.6349781", "0.62687784", "0.62290114", "0.6192579", "0.6090689", "0.60649323", "0.60526985", "0.6047419", "0.60411704", "0.6028308", "0.6021699", "0.60055244", "0.5975181", "0.59711975", "0.5960433", "0.5925177...
0.7352213
0
A class to define how a fighter behaves. Gun constructor Sets the properties with the provided arguments
function Gun(x, y, size) { this.x = x; this.y = y; this.size = size; this.angle; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Gun(descr) {\n\n // Common inherited setup logic from Entity\n this.setup(descr);\n\n this.rememberResets();\n\t\n\tthis.tower = g_sprites.tower;\n this.diamond = g_sprites.diamond;\n\t\n\tthis.towerHeight = this.tower.height;\n\tthis.towerWidth = this.tower.width;\n\t\n // Set normal drawi...
[ "0.67743284", "0.6739134", "0.66912013", "0.66515183", "0.6590362", "0.6360284", "0.6355191", "0.6214117", "0.61946684", "0.6174791", "0.6174791", "0.6172805", "0.6158926", "0.6143233", "0.6126082", "0.6047762", "0.6047762", "0.6028191", "0.6028043", "0.6022599", "0.6015924",...
0.5953281
25
return the two oldest/oldest ages within the array of ages passed in.
function twoOldestAges(ages){ ages.sort((a,b) => b-a) ages = ages.slice(0,2) ages.sort((a,b) => a-b); return ages; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function twoOldestAges(ages){\n let sorted = ages.sort((a, b) => { return b - a; });\n return [sorted[1], sorted[0]];\n }", "function twoOldestAges(ages){\nlet oldestAges = ages.sort((a, b) => b-a).splice(0,2).reverse();\n return oldestAges;\n}", "function twoOldestAges(ages){\n var sortArr = ages...
[ "0.78486305", "0.7427882", "0.7326222", "0.7013265", "0.6738038", "0.6712644", "0.6627846", "0.65975624", "0.6574193", "0.65132743", "0.64635026", "0.6458466", "0.6167384", "0.61547387", "0.61451113", "0.6124622", "0.61235875", "0.6054878", "0.60398024", "0.5996854", "0.59744...
0.74437
1
Simple route middleware to ensure user is authenticated.
function ensureAuthenticated(req, res, next) { if (req.isAuthenticated()) { return next(); } req.session.error = 'Please sign in!'; res.redirect('/signin'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ensureAuthenticated(req, res, next){\n if (req.isAuthenticated()){\n return next();\n }\n else {\n res.redirect('/');\n }\n}", "function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/');\n}", "function ensureAuthe...
[ "0.77062464", "0.76014584", "0.7570125", "0.7560704", "0.7558127", "0.7558127", "0.7558127", "0.7551246", "0.7539155", "0.75295085", "0.75295085", "0.7519517", "0.75158256", "0.75106835", "0.7509376", "0.7509376", "0.7509193", "0.7509193", "0.7509193", "0.75080097", "0.750545...
0.0
-1
append the created div to the divmodal
componentDidMount() { modalRoot.appendChild(this.element); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addModal() {\n let div = $('<div/>');\n\tdiv.attr({\n\t\tid: 'modal-point',\n\t\tclass: 'modal fade'\n\t});\n div.attr(\"data-backdrop\", \"static\").attr(\"data-keyboard\", \"false\").attr(\"tabindex\", \"-1\").attr(\"role\", \"dialog\").attr(\"aria-hidden\", \"true\");\n $('body').append(div);\...
[ "0.74427956", "0.72275966", "0.710669", "0.7074965", "0.7026188", "0.69933385", "0.69156855", "0.6837551", "0.6785633", "0.6733064", "0.67140305", "0.66620874", "0.66341144", "0.659592", "0.65889287", "0.6588722", "0.6525796", "0.65159184", "0.64908737", "0.6489671", "0.64631...
0.0
-1
remove the created div when this Modal Component is unmounted Used to clean up the memory to avoid memory leak
componentWillUnmount() { modalRoot.removeChild(this.element); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "destroy() {\n $.removeData(this.element[0], COMPONENT_NAME);\n }", "destroy() {\n this.teardown();\n $.removeData(this.element[0], COMPONENT_NAME);\n }", "destroy() {\n this._componentRef.destroy();\n }", "destroy() {\n if (!this.isDestroyed) {\n this.uiWrapper.parentNo...
[ "0.72245914", "0.71879286", "0.70123136", "0.6941995", "0.6914517", "0.691231", "0.6912048", "0.6909787", "0.6885292", "0.6876775", "0.6874604", "0.6846686", "0.6827205", "0.6821308", "0.6811845", "0.67996776", "0.67801577", "0.6775338", "0.67741215", "0.67691034", "0.6741515...
0.7750632
0
Navigate to Submit an Ad Page
function gotoSubmitAd() { if (localStorage.getItem('user_id')) { window.location.href = "../dashboard/dashboard.html"; } else { window.location.href = "../login/login.html"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function submitPost(post) {\n $.post(\"/api/posts\", post, function() {\n window.location.href = \"/addexercise\";\n });\n }", "function goToSubmit() {\n var element = document.getElementById('car_submit');\n element.scrollIntoView({ behavior: \"smooth\", block: \"end\" });\...
[ "0.6617835", "0.6567393", "0.6372224", "0.6305512", "0.62939143", "0.6288367", "0.62680435", "0.6235656", "0.6207745", "0.6203159", "0.6171488", "0.611962", "0.61175114", "0.6093927", "0.6084791", "0.6063685", "0.60440403", "0.5987568", "0.59585685", "0.59585685", "0.59500283...
0.6731556
0
region boilerplate / intialization Define a function for initiating a conversation on installation With custom integrations, we don't have a way to find out who installed us, so we can't message them :(
function onInstallation(bot, installer) { if (installer) { bot.startPrivateConversation({user: installer}, function (err, convo) { if (err) { console.log(err); } else { convo.say('I am a bot that has just joined your team'); convo.say('You must now /invite me to a channel so that I can be of use!'); } }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onInstallation(bot, installer) {\n if (installer) {\n bot.startPrivateConversation({user: installer}, function (err, convo) {\n if (err) {\n console.log(err);\n } else {\n convo.say(\"Hi there, I'm Taylor. I'm a bot that has just joined your te...
[ "0.7064618", "0.70323336", "0.6839463", "0.60243225", "0.59829617", "0.58580023", "0.5844213", "0.5825384", "0.58016616", "0.56972075", "0.56972075", "0.56972075", "0.5686682", "0.5686682", "0.5686682", "0.5686682", "0.5683251", "0.56718254", "0.5652333", "0.5609291", "0.5585...
0.6913098
6
endregion Core bot logic goes here! region getters / setters of times and reports sets the time that the standup report will be generated for a channel
function setStandupTime(channel, standupTimeToSet) { controller.storage.teams.get('standupTimes', function(err, standupTimes) { if (!standupTimes) { standupTimes = {}; standupTimes.id = 'standupTimes'; } standupTimes[channel] = standupTimeToSet; controller.storage.teams.save(standupTimes); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_setTime() {\n switch(this.difficultyLevel) {\n case 1:\n // this.gameTime uses ms\n this.gameTime = 45000;\n break;\n case 2:\n this.gameTime = 100000;\n break;\n case 3:\n this.gameTime = 160000;\n break;\n case 4:\n ...
[ "0.6415461", "0.6378349", "0.62627757", "0.6210528", "0.61560214", "0.6148118", "0.61439914", "0.6081126", "0.6080375", "0.6006004", "0.60012776", "0.5998794", "0.59911495", "0.5936987", "0.5936987", "0.589188", "0.5864137", "0.5824479", "0.5819341", "0.57981336", "0.5797444"...
0.62667125
2
gets the time that the standup report will be generated for a channel
function getStandupTime(channel, cb) { controller.storage.teams.get('standupTimes', function(err, standupTimes) { if (!standupTimes || !standupTimes[channel]) { cb(null, null); } else { cb(null, standupTimes[channel]); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBotMsgTime(session){\n\tconsole.log(\"getBotMsgTime() executing\");\n\tvar botTime = new Date(session.userData.lastMessageSent);\n\tconsole.log(\"Bot time unformatted is:\");\n\tconsole.log(botTime);\n\n\tvar botTimeFormatted = dateFormat(botTime, \"yyyy-mm-dd HH:MM:ss\");\n\n\tconsole.log(\"Bot messag...
[ "0.6040518", "0.60359293", "0.6010521", "0.6001613", "0.5957078", "0.5952818", "0.590619", "0.58774245", "0.5787974", "0.5776971", "0.56780404", "0.56668615", "0.5617398", "0.56120676", "0.5591071", "0.55838776", "0.55686265", "0.5552662", "0.55173296", "0.55053", "0.55017895...
0.7024009
0
gets all the times that standup reports will be generated for all channels
function getStandupTimes(cb) { controller.storage.teams.get('standupTimes', function(err, standupTimes) { if (!standupTimes) { cb(null, null); } else { cb(null, standupTimes); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkTimesAndReport(bot) {\n getStandupTimes(function(err, standupTimes) { \n if (!standupTimes) {\n return;\n }\n var currentHoursAndMinutes = getCurrentHoursAndMinutes();\n for (var channelId in standupTimes) {\n var standupTime = standupTimes[channel...
[ "0.7166729", "0.6094642", "0.5958097", "0.59040844", "0.58943397", "0.58160514", "0.56860137", "0.5672652", "0.5641199", "0.5632324", "0.55998343", "0.5589384", "0.5563304", "0.5517262", "0.5500199", "0.5493791", "0.5482123", "0.54770815", "0.54730433", "0.5445748", "0.542590...
0.55671674
12
gets all the times users would like to be asked to report for all channels
function getAskingTimes(cb) { controller.storage.teams.get('askingtimes', function(err, askingTimes) { if (!askingTimes) { cb(null, null); } else { cb(null, askingTimes); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkTimesAndReport(bot) {\n getStandupTimes(function(err, standupTimes) { \n if (!standupTimes) {\n return;\n }\n var currentHoursAndMinutes = getCurrentHoursAndMinutes();\n for (var channelId in standupTimes) {\n var standupTime = standupTimes[channel...
[ "0.63503927", "0.6317712", "0.62979084", "0.62357336", "0.6132495", "0.61065966", "0.60647625", "0.6019824", "0.60135365", "0.5945615", "0.58777934", "0.5843234", "0.5824663", "0.57908154", "0.57801193", "0.5777819", "0.5754453", "0.5743466", "0.5729201", "0.57270294", "0.572...
0.0
-1
gets the time a user has asked to report for a given channel
function getAskingTime(user, channel, cb) { controller.storage.teams.get('askingtimes', function(err, askingTimes) { if (!askingTimes || !askingTimes[channel] || !askingTimes[channel][user]) { cb(null,null); } else { cb(null, askingTimes[channel][user]); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStandupTime(channel, cb) {\n controller.storage.teams.get('standupTimes', function(err, standupTimes) {\n if (!standupTimes || !standupTimes[channel]) {\n cb(null, null);\n } else {\n cb(null, standupTimes[channel]);\n }\n });\n}", "function getBotMsgT...
[ "0.6046183", "0.5564972", "0.5558473", "0.55167425", "0.54932386", "0.5406893", "0.5406754", "0.5369679", "0.5338762", "0.5330139", "0.52722967", "0.5264473", "0.51975965", "0.5191128", "0.5190129", "0.51743525", "0.5171066", "0.5164562", "0.5160631", "0.5139034", "0.5132241"...
0.6806506
0
records when a user would like to be asked to report for a channel
function addAskingTime(user, channel, timeToSet) { controller.storage.teams.get('askingtimes', function(err, askingTimes) { if (!askingTimes) { askingTimes = {}; askingTimes.id = 'askingtimes'; } if (!askingTimes[channel]) { askingTimes[channel] = {}; } askingTimes[channel][user] = timeToSet; controller.storage.teams.save(askingTimes); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reportClicked() {\n chrome.runtime.sendMessage({ \"button\": \"report\", \"id\": data[currentIndex]._id });\n}", "@track((undefined, state) => {\n return {action: `enter-attempt-to-channel: ${state.channel.name}`};\n })\n enterChannel(channel){\n\n let addNewMessage = this.props.addNewMessage...
[ "0.6045982", "0.60354316", "0.5868806", "0.58020276", "0.57129234", "0.5711092", "0.5693896", "0.5583567", "0.55673665", "0.5566418", "0.5545174", "0.5532798", "0.5529501", "0.5511182", "0.5510019", "0.54998803", "0.545792", "0.54545987", "0.5444427", "0.5440843", "0.54334974...
0.49428362
91
cancels a user's asking time in a channel
function cancelAskingTime(user, channel) { controller.storage.teams.get('askingtimes', function(err, askingTimes) { if (!askingTimes || !askingTimes[channel] || !askingTimes[channel][user]) { return; } else { delete askingTimes[channel][user]; controller.storage.teams.save(askingTimes); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cancel() {\n return this.channel.basicCancel(this.tag)\n }", "cancelA2HSprompt(_this) {\n document.getElementById('cancel-btn').addEventListener('click', () => {\n _this.delayA2HSprompt();\n _this.hideMsg();\n });\n }", "function OnCancelAndUnlockPressed()\n{\n\t// Un...
[ "0.62495184", "0.61248153", "0.60613745", "0.6051775", "0.5957667", "0.579878", "0.5796032", "0.5793594", "0.57708716", "0.5764484", "0.5754102", "0.5734898", "0.5730226", "0.57185125", "0.57181215", "0.5714681", "0.57004356", "0.56908435", "0.56721675", "0.56693536", "0.5641...
0.8139517
0
adds a user's standup report to the standup data for a channel
function addStandupData(standupReport) { controller.storage.teams.get('standupData', function(err, standupData) { if (!standupData) { standupData = {}; standupData.id = 'standupData'; } if (!standupData[standupReport.channel]) { standupData[standupReport.channel] = {}; } standupData[standupReport.channel][standupReport.user] = standupReport; controller.storage.teams.save(standupData); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doStandup(bot, user, channel) {\n\n var userName = null;\n\n getUserName(bot, user, function(err, name) {\n if (!err && name) {\n userName = name;\n\n bot.startPrivateConversation({\n user: user\n }, function(err, convo) {\n if (!...
[ "0.6443461", "0.592248", "0.59018815", "0.58021027", "0.57642514", "0.5632085", "0.5553548", "0.5301624", "0.516726", "0.51363057", "0.5127875", "0.5127709", "0.5107881", "0.51040447", "0.50867414", "0.50698984", "0.5049063", "0.504188", "0.50250804", "0.5000019", "0.49985132...
0.74245036
0
gets all standup data for a channel
function getStandupData(channel, cb) { controller.storage.teams.get('standupData', function(err, standupData) { if (!standupData || !standupData[channel]) { cb(null, null); } else { cb(null, standupData[channel]); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLobbyData(){}", "function clearStandupData(channel) {\n controller.storage.teams.get('standupData', function(err, standupData) {\n if (!standupData || !standupData[channel]) {\n return;\n } else {\n delete standupData[channel];\n controller.storage.te...
[ "0.6174487", "0.6143607", "0.6024814", "0.6006331", "0.597928", "0.5950036", "0.5829109", "0.56514424", "0.56441987", "0.564225", "0.5628344", "0.55985993", "0.5591854", "0.5590676", "0.55876064", "0.5571876", "0.5569628", "0.55689764", "0.55517554", "0.55306715", "0.5503061"...
0.7028158
0
clears all standup reports for a channel
function clearStandupData(channel) { controller.storage.teams.get('standupData', function(err, standupData) { if (!standupData || !standupData[channel]) { return; } else { delete standupData[channel]; controller.storage.teams.save(standupData); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n\t\treturn this._sendMessage(JSON.stringify({type: \"clearHistory\"}), (resolve, reject) => {\n\t\t\tresolve([channel]);\n\t\t});\n\t}", "clearAllChannels() {\n this.state.channels.forEach((channel) => {\n if (channel.active) {\n this.context.api.newsItem.removeChannel...
[ "0.6528912", "0.6494929", "0.64406866", "0.6426045", "0.62254184", "0.6205152", "0.62045234", "0.6150138", "0.61259806", "0.5997079", "0.5973085", "0.5954252", "0.5943247", "0.591203", "0.59086585", "0.5901544", "0.58659446", "0.58659446", "0.58659446", "0.5856577", "0.585166...
0.68249196
0
returns true (in a callback) if the specified user has a standup report saved
function hasStandup(who, cb) { var user = who.user; var channel = who.channel; controller.storage.teams.get('standupData', function(err, standupData) { if (!standupData || !standupData[channel] || !standupData[channel][user]) { cb(null, false); } else { cb(null, true); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isUserSaving () {\n\treturn !!( editorData.isSavingPost() && !editorData.isAutosavingPost() );\n}", "userCreated (project) {\n if (!userStore.data.scitran) {return false;}\n return project.group === userStore.data.scitran._id;\n }", "function _check_if_exist_change(){\n ...
[ "0.649892", "0.6148491", "0.61291283", "0.59572446", "0.58156663", "0.576441", "0.5732094", "0.5696675", "0.56009287", "0.552245", "0.5477061", "0.5475031", "0.5408099", "0.53833044", "0.53567165", "0.53470856", "0.5345371", "0.53063864", "0.526573", "0.5260738", "0.5246342",...
0.5873136
4
intended to be called every minute. checks if there exists a user that has requested to be asked to give a standup report at this time, then asks them
function checkTimesAndAskStandup(bot) { getAskingTimes(function (err, askMeTimes) { if (!askMeTimes) { return; } for (var channelId in askMeTimes) { for (var userId in askMeTimes[channelId]) { var askMeTime = askMeTimes[channelId][userId]; var currentHoursAndMinutes = getCurrentHoursAndMinutes(); if (compareHoursAndMinutes(currentHoursAndMinutes, askMeTime)) { hasStandup({user: userId, channel: channelId}, function(err, hasStandup) { // if the user has not set an 'ask me time' or has already reported a standup, don't ask again if (hasStandup == null || hasStandup == true) { var x = ""; } else { doStandup(bot, userId, channelId); } }); } } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function promptStandup(promptMessage) {\n usersService.getLateSubmitters().then(lateSubmitters => {\n if (lateSubmitters.length > 0) {\n console.log(\"Behold late submitters members = > \" + lateSubmitters);\n lateSubmitters.forEach(user => {\n sendMessageToUser(user,...
[ "0.6484531", "0.6158379", "0.5830184", "0.579746", "0.57936287", "0.5697816", "0.5687309", "0.5672732", "0.5660969", "0.56362784", "0.5614853", "0.55957496", "0.5588634", "0.553915", "0.5532074", "0.55250454", "0.5511523", "0.5510523", "0.5507814", "0.54976106", "0.54964715",...
0.6836265
0
will initiate a private conversation with user and save the resulting standup report for the channel
function doStandup(bot, user, channel) { var userName = null; getUserName(bot, user, function(err, name) { if (!err && name) { userName = name; bot.startPrivateConversation({ user: user }, function(err, convo) { if (!err && convo) { var standupReport = { channel: channel, user: user, userName: userName, datetime: getCurrentOttawaDateTimeString(), yesterdayQuestion: null, todayQuestion: null, obstacleQuestion: null }; convo.ask('What did you work on yesterday?', function(response, convo) { standupReport.yesterdayQuestion = response.text; convo.ask('What are you working on today?', function(response, convo) { standupReport.todayQuestion = response.text; convo.ask('Any obstacles?', function(response, convo) { standupReport.obstacleQuestion = response.text; convo.next(); }); convo.say('Thanks for doing your daily standup, ' + userName + "!"); convo.next(); }); convo.next(); }); convo.on('end', function() { // eventually this is where the standupReport should be stored bot.say({ channel: standupReport.channel, text: "*" + standupReport.userName + "* did their standup at " + standupReport.datetime, //text: displaySingleReport(bot, standupReport), mrkdwn: true }); addStandupData(standupReport); }); } }); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initiateConversation(adminID){\n rainbowSDK.contacts.searchById(adminID).then((contact)=>{\n console.log(\"[DEMO] :: \" + contact);\n if(mocClicked == \"Chat\"){\n rainbowSDK.conversations.openConversationForContact(contact).then(function(conversation) {\n consol...
[ "0.5840379", "0.56874186", "0.5675624", "0.5628233", "0.55131686", "0.54803413", "0.5475566", "0.5454759", "0.5421371", "0.5414625", "0.5405184", "0.5356118", "0.5349045", "0.5308127", "0.5287822", "0.5276483", "0.52346283", "0.520408", "0.520408", "0.520408", "0.520408", "...
0.69738185
0
when the time to report is hit, report the standup, clear the standup data for that channel
function checkTimesAndReport(bot) { getStandupTimes(function(err, standupTimes) { if (!standupTimes) { return; } var currentHoursAndMinutes = getCurrentHoursAndMinutes(); for (var channelId in standupTimes) { var standupTime = standupTimes[channelId]; if (compareHoursAndMinutes(currentHoursAndMinutes, standupTime)) { getStandupData(channelId, function(err, standupReports) { bot.say({ channel: channelId, text: getReportDisplay(standupReports), mrkdwn: true }); clearStandupData(channelId); }); } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearStandupData(channel) {\n controller.storage.teams.get('standupData', function(err, standupData) {\n if (!standupData || !standupData[channel]) {\n return;\n } else {\n delete standupData[channel];\n controller.storage.teams.save(standupData);\n ...
[ "0.6351986", "0.57172143", "0.57172", "0.5665382", "0.5609832", "0.56097007", "0.5597038", "0.5584903", "0.5575114", "0.5570066", "0.55546856", "0.55154425", "0.55140424", "0.5512958", "0.54904246", "0.54677385", "0.5444892", "0.5407005", "0.54037684", "0.53916013", "0.539094...
0.63896483
0
returns an object (not date) with the current hours and minutes, Ottawa time
function getCurrentHoursAndMinutes() { var now = convertUTCtoOttawa(new Date()); return { hours: now.getHours(), minutes: now.getMinutes() }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNow() {\n var now = new Date();\n return {\n hours: now.getHours() + now.getMinutes() / 60,\n minutes: now.getMinutes() * 12 / 60 + now.getSeconds() * 12 / 3600,\n seconds: now.getSeconds() * 12 / 60\n };\n }", "function time() {\r\n var data = new Date();\r\n v...
[ "0.7421034", "0.7070131", "0.7042703", "0.7019506", "0.7016044", "0.6983289", "0.69333446", "0.68698555", "0.68485516", "0.6821014", "0.68004423", "0.6745183", "0.67373943", "0.6730873", "0.6727982", "0.67008406", "0.66862845", "0.65916675", "0.6536028", "0.65289223", "0.6526...
0.7886335
0
compares two objects (not date) with hours and minutes
function compareHoursAndMinutes(t1, t2) { return (t1.hours === t2.hours) && (t1.minutes === t2.minutes); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compare(a,b) {\r\n var startTimeA = (a.StartTimeHour*60) + a.StartTimeMinute;\r\n var startTimeB = (b.StartTimeHour*60) + b.StartTimeMinute;\r\n return startTimeA - startTimeB;\r\n}", "equalsTo(operand){\r\n return (this.hours === operand.hours && this.minutes === operand.minutes);\r\n }", "fun...
[ "0.7367753", "0.694777", "0.6863364", "0.6707897", "0.6653542", "0.6519639", "0.64801466", "0.64379394", "0.64292246", "0.63552475", "0.6304667", "0.624035", "0.6188942", "0.6164275", "0.6143916", "0.6035805", "0.6030706", "0.59936357", "0.59759927", "0.5975752", "0.5959879",...
0.81036144
0
if the given date is in UTC, converts it to Ottawa time. this is a 'reasonable' hack since the only two places that the js will be run will be on azure (UTC), and locally (Ottawa time)
function convertUTCtoOttawa(date) { var d = new Date(); if (d.getHours() === d.getUTCHours()) { d.setUTCHours(d.getUTCHours() - 5); } return d; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toMarketTime(date,tz){\n\t\t\t\tvar utcTime=new Date(date.getTime() + date.getTimezoneOffset() * 60000);\n\t\t\t\tif(tz && tz.indexOf(\"UTC\")!=-1) return utcTime;\n\t\t\t\telse return STX.convertTimeZone(utcTime,\"UTC\",tz);\n\t\t\t}", "toFinnishTime(date) {\n //var date = new Date();\n date.setH...
[ "0.69358057", "0.66025054", "0.6601455", "0.65316075", "0.65142703", "0.6426732", "0.6398034", "0.63451177", "0.6302007", "0.63002443", "0.6222299", "0.61798775", "0.6176149", "0.6171457", "0.6171189", "0.61192024", "0.60711014", "0.6012052", "0.60070336", "0.5975017", "0.596...
0.79901075
0
returns a formatted string of the current datetime in Ottawa time
function getCurrentOttawaDateTimeString() { var date = convertUTCtoOttawa(new Date()); var hour = date.getHours(); hour = (hour < 10 ? "0" : "") + hour; var min = date.getMinutes(); min = (min < 10 ? "0" : "") + min; var year = date.getFullYear(); var month = date.getMonth() + 1; month = (month < 10 ? "0" : "") + month; var day = date.getDate(); day = (day < 10 ? "0" : "") + day; return year + "-" + month + "-" + day + ": " + hour + ":" + min; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFormattedCurrentDateTime() {\n return new Date().toJSON().slice(0, 19).replace('T', ' ');\n}", "function nowAsString() {\n return new Date().toISOString().replace(\"T\", \" \").replace(\"Z\",\" \");\n}", "function formatCurrentDateTime() {\n // Timestamp from API seems to be GMT, which the...
[ "0.7872003", "0.7791804", "0.7354191", "0.73127687", "0.72452915", "0.7146017", "0.7138602", "0.7121298", "0.7103326", "0.7062861", "0.7016527", "0.70033497", "0.695631", "0.6956222", "0.69544303", "0.69452065", "0.69369656", "0.6936768", "0.6931186", "0.6926132", "0.6895374"...
0.8083763
0