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
5: Body mass index(BMI) is calculated as follows: bmi = weight in Kg / (height x height) in m2. Write a function which calculates bmi. BMI is used to broadly define different weight groups in adults 20 years old or older.Check if a person is underweight, normal, overweight or obese based the information given below.
function bmi(kg, m) { let indexBmi = kg / Math.pow(m, 2); if (indexBmi >= 30) { return console.log("Obese"); } else if (indexBmi >= 25) { return console.log("Overweight"); } else if (indexBmi >= 18.5) { return console.log("Normal weight"); } else { return console.log("Underweight"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bmi(weight, height) { // the parameters are height and weight\n var bodyMass = weight / (height * height); // i declared the variable to bodyMass to calculate the bodymass but instead of exponent 2 since it wasnt working i did height times itself\n if (bodyMass <= 18.5) return \"Underweight\"\n if (bod...
[ "0.8438067", "0.82595015", "0.80829865", "0.7922899", "0.77958953", "0.77698994", "0.77475137", "0.77296144", "0.7628763", "0.7606456", "0.7558116", "0.7523544", "0.7514475", "0.7504679", "0.75025207", "0.74736875", "0.73504794", "0.73190415", "0.72958195", "0.72245187", "0.7...
0.7389948
16
6: Write a function called checkSeason, it takes a month parameter and returns the season:Autumn, Winter, Spring or Summer.
function checkSeason(month) { if (month === 9) { console.log("The season is Autumn."); } else if (month === 8) { console.log("The season is Autumn."); } else if (month === 7) { console.log("The season is Autumn."); } else if (month === 10) { console.log("The season is Winter."); } else if (month === 11) { console.log("The season is Winter."); } else if (month === 12) { console.log("The season is Winter."); } else if (month === 1) { console.log("The season is Spring."); } else if (month === 2) { console.log("The season is Spring."); } else if (month === 3) { console.log("The season is Spring."); } else { console.log("The season is Summer."); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSeason() {\n month = d.getMonth() + 1;\n if (3 <= month && month <= 5) {\n return 'spring';\n }\n else if (6 <= month && month <= 8) {\n return 'summer';\n }\n else if (9 <= month && month <= 11) {\n return 'fall';\n }\n else{\n return 'winter';\n }\...
[ "0.7930279", "0.79269266", "0.7269071", "0.7255933", "0.6924466", "0.68562376", "0.6493932", "0.6463682", "0.6463682", "0.6260932", "0.6144034", "0.61049837", "0.60054785", "0.59470886", "0.5892112", "0.58111554", "0.58016074", "0.5799047", "0.5778231", "0.5759706", "0.575970...
0.878837
0
All roman numerals answers should be provided in uppercase.
function convertToRoman(num) { let romanNums = { 1000: "M", 900: "CM", 500: "D", 400: "CD", 100: "C", 90: "XC", 50: "L", 40: "XL", 10: "X", 9: "IX", 5: "V", 4: "IV", 1: "I", } let keys = Object.keys(romanNums).reverse(); let romanNum = ""; keys.forEach(function(key) { while (key <= num) { romanNum += romanNums[key]; num -= key; } }); return romanNum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RomanNumeralsHelper() {\n}", "function uppercase(input) {}", "function upperLetters(){\n // start at the position of the first uppercase letter in the character set\n for (var i = 65; i <= 90; i++) {\n // push every lowercase letter from positions 65 to 90 into storedCharacters key\n answer.st...
[ "0.67612714", "0.6459759", "0.63812846", "0.636349", "0.6262297", "0.6224946", "0.61437637", "0.6119703", "0.60750407", "0.606791", "0.6036034", "0.60154474", "0.5995357", "0.59585154", "0.59578204", "0.5949594", "0.58397007", "0.58324236", "0.5827182", "0.5826234", "0.582203...
0.0
-1
Criado em: 20/02/2010 Autor: Fabricio P. Reis Funcao usada para validar os dados obrigatorios e colocar letras maiusculas e minusculas nos campos adequados
function validarDados() { var mensagem = "Preencha corretamente os seguintes campos:"; if (trim(document.formPaciente.nome.value) == "") { mensagem = mensagem + "\n- Nome"; } else { // Linha abaixo comentada para manter acentos //document.formPaciente.nome.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.nome.value)).toLowerCase()); document.formPaciente.nome.value = primeirasLetrasMaiusculas(trim(document.formPaciente.nome.value).toLowerCase()); } if (!document.formPaciente.sexo[0].checked && !document.formPaciente.sexo[1].checked) { mensagem = mensagem + "\n- Sexo"; } if (trim(document.formPaciente.dataNascimento.value) == "") { mensagem = mensagem + "\n- Data de Nascimento"; } // Nome do pai sem acentos e/ou cedilhas if (trim(document.formPaciente.nomePai.value) != "") { // Linha abaixo comentada para manter acentos //document.formPaciente.nomePai.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.nomePai.value)).toLowerCase()); document.formPaciente.nomePai.value = primeirasLetrasMaiusculas(trim(document.formPaciente.nomePai.value).toLowerCase()); } // Nome da mae sem acentos e/ou cedilhas if (trim(document.formPaciente.nomeMae.value) != "") { // Linha abaixo comentada para manter acentos //document.formPaciente.nomeMae.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.nomeMae.value)).toLowerCase()); document.formPaciente.nomeMae.value = primeirasLetrasMaiusculas(trim(document.formPaciente.nomeMae.value).toLowerCase()); } if (trim(document.formPaciente.logradouro.value) == "") { mensagem = mensagem + "\n- Logradouro"; } else { // Linha abaixo comentada para manter acentos //document.formPaciente.logradouro.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.logradouro.value)).toLowerCase()); document.formPaciente.logradouro.value = primeirasLetrasMaiusculas(trim(document.formPaciente.logradouro.value).toLowerCase()); } // Numero sem acentos e/ou cedilhas if (trim(document.formPaciente.numero.value) != "") { document.formPaciente.numero.value = retirarAcentos(trim(document.formPaciente.numero.value)).toUpperCase(); } /* Numero deixa de ser obrigatorio if (trim(document.formPaciente.numero.value) == "") { mensagem = mensagem + "\n- Numero"; } */ if (trim(document.formPaciente.bairro.value) == "") { mensagem = mensagem + "\n- Bairro"; } else { // Linha abaixo comentada para manter acentos //document.formPaciente.bairro.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.bairro.value)).toLowerCase()); document.formPaciente.bairro.value = primeirasLetrasMaiusculas(trim(document.formPaciente.bairro.value).toLowerCase()); } // Complemento sem acentos e/ou cedilhas if (trim(document.formPaciente.complemento.value) != "") { // Linha abaixo comentada para manter acentos //document.formPaciente.complemento.value = retirarAcentos(trim(document.formPaciente.complemento.value)).toUpperCase(); document.formPaciente.complemento.value = trim(document.formPaciente.complemento.value).toUpperCase(); } if (trim(document.formPaciente.cidade.value) == "") { mensagem = mensagem + "\n- Cidade"; } else { // Linha abaixo comentada para manter acentos //document.formPaciente.cidade.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.cidade.value)).toLowerCase()); document.formPaciente.cidade.value = primeirasLetrasMaiusculas(trim(document.formPaciente.cidade.value).toLowerCase()); } if (trim(document.formPaciente.estado.value) == "") { mensagem = mensagem + "\n- Estado"; } if (trim(document.formPaciente.indicacao.value) == "") { mensagem = mensagem + "\n- Indicacao"; } if (document.formPaciente.indicacao.value == "selected") { if (trim(document.formPaciente.indicacaoOutra.value) == "") { mensagem = mensagem + "\n- Indicacao - Outra"; } else { // Linha abaixo comentada para manter acentos //document.formPaciente.indicacaoOutra.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.indicacaoOutra.value)).toLowerCase()); document.formPaciente.indicacaoOutra.value = primeirasLetrasMaiusculas(trim(document.formPaciente.indicacaoOutra.value).toLowerCase()); } } if (mensagem == "Preencha corretamente os seguintes campos:") { return true; } else { alert(mensagem); goFocus('nome'); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validarDados() {\n var mensagem = \"Preencha corretamente os seguintes campos:\";\n\n if (trim(document.formProcedimento.nome.value) == \"\") {\n mensagem = mensagem + \"\\n- Nome\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formProcedimento...
[ "0.7299923", "0.71525186", "0.70642394", "0.7037944", "0.7037944", "0.6984522", "0.6983445", "0.6907712", "0.68994087", "0.6879504", "0.6818327", "0.6788984", "0.67866", "0.6776433", "0.6769318", "0.6767671", "0.6756519", "0.6733219", "0.67088115", "0.665767", "0.661388", "...
0.6931287
7
Funcao usada para mostrar / sumir o div contendo Informacoes Adicionais
function mostrarXsumir(valor){ document.formPaciente.indicacaoOutra.value = ""; var abreDiv = document.getElementById('infoIndicacaoOutra'); if (valor == 'selected') { abreDiv.style.display = 'block'; } else { abreDiv.style.display = 'none'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MostrarContadores() {\n\tvar div = document.getElementById(\"mostrarcontador\");\n\tdiv.innerHTML = \"\";\n\n\tvar TitleTotalArticles = document.createElement(\"h4\");\n\tvar TitlePriceWithoutIVA = document.createElement(\"h4\");\n\tvar TitleTotalPrice = document.createElement(\"h4\");\n\n\tvar cont1 = 0;...
[ "0.6914211", "0.6438706", "0.63988787", "0.6324239", "0.6297997", "0.62307537", "0.6178018", "0.61089385", "0.61064047", "0.6092528", "0.60772383", "0.6062174", "0.6044518", "0.60284287", "0.6023026", "0.6019397", "0.59932554", "0.5988071", "0.5985599", "0.5985018", "0.597986...
0.0
-1
TO DO Valida RG Verificar se tem letras e numeros ou soh numeros e retirar acentos e/ou cedilhas
function validarRg(rg) { if (trim(rg.value) != '') { document.formPaciente.rg.value = retirarAcentos(trim(document.formPaciente.rg.value)).toUpperCase(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validar_rut()\n{\n var rut = document.getElementById('rut_b');\n var digito = document.getElementById('dv_b');\n var numerico = rut.value.search( /[^0-9]/i );\n \n if(rut.value == \"\" && digito.value == \"\")\n return true\n if( numerico != -1 ) {\n alert(\"El rut contiene...
[ "0.6833627", "0.66488755", "0.6527119", "0.6515081", "0.64495075", "0.6447154", "0.64043987", "0.63646114", "0.6309656", "0.6294315", "0.62799543", "0.62775326", "0.62419873", "0.6202933", "0.6181346", "0.6152914", "0.614273", "0.6108729", "0.61048865", "0.6091144", "0.607921...
0.60487604
24
Funcao usada para realizar a pesquisa de acordo com a opcao de campo (nome, logradouro, cpf,...) escolhida pelo usuario Esta funcao eh chamada pela funcao confirmarBuscarTodos(campo, op)
function submeter(op) { // Seta a opcao de pesquisa escolhida para o action correspondente funcionar corretamente document.formPaciente.opcao.value = op; switch(op){ // PESQUISAR PELO NOME case 0: { // Linha abaixo comentada para manter acentos //document.formPaciente.nome.value = primeirasLetrasMaiusculas(retirarAcentos(document.formPaciente.nome.value).toLowerCase()); document.formPaciente.nome.value = primeirasLetrasMaiusculas(document.formPaciente.nome.value).toLowerCase(); document.formPaciente.submit(); }break; // PESQUISAR PELO CPF case 1: { document.formPaciente.submit(); }break; // PESQUISAR PELO LOGRADOURO case 2:{ // Linha abaixo comentada para manter acentos //document.formPaciente.logradouro.value = primeirasLetrasMaiusculas(retirarAcentos(document.formPaciente.logradouro.value).toLowerCase()); document.formPaciente.logradouro.value = primeirasLetrasMaiusculas(document.formPaciente.logradouro.value).toLowerCase(); document.formPaciente.submit(); }break; // PESQUISAR PELO CODIGO case 3:{ document.formPaciente.submit(); }break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function confirmarBuscarTodos(campo, op) {\n if ((trim(campo.value) == '') || (campo.value == null)) {\n if(confirm(\"Tem certeza que deseja pesquisar todos os registros?\\nEsta operacao pode ser demorada devido a quantidade de registros.\")) {\n submeter(op);\n return true;\n ...
[ "0.80265516", "0.80265516", "0.67630863", "0.67630863", "0.61554533", "0.6106358", "0.58928365", "0.54975146", "0.5472808", "0.545245", "0.5437709", "0.542456", "0.5419351", "0.5368439", "0.5365553", "0.53437465", "0.531203", "0.5305149", "0.52963907", "0.5285123", "0.5276386...
0.0
-1
Funcao para exibir alert com opcoes de OK ou Cancelar quando o paramentro 'campo' for vazio Esta funcao eh usada na pagina consultarPaciente para garantir que o usuario queira mesmo buscar todos os registros
function confirmarBuscarTodos(campo, op) { if ((trim(campo.value) == '') || (campo.value == null)) { if(confirm("Tem certeza que deseja pesquisar todos os registros?\nEsta operacao pode ser demorada devido a quantidade de registros.")) { submeter(op); return true; } else { return false; } } else { submeter(op); return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function confirmarBuscarTodos(campo) {\n if (trim(campo.value) == '') {\n if(confirm(\"Tem certeza que deseja pesquisar todos os registros?\\nEsta operacao pode ser demorada devido a quantidade de registros.\")) {\n return true;\n }\n else {\n return false;\n }\...
[ "0.6851009", "0.6851009", "0.6372521", "0.6171562", "0.6170321", "0.61476344", "0.6146789", "0.6144102", "0.61305183", "0.61137265", "0.6093173", "0.60903144", "0.6079721", "0.60712004", "0.60670096", "0.6060402", "0.6054829", "0.60454863", "0.6040154", "0.6031249", "0.602667...
0.71117973
1
Funcao usada para manipular tecla > no formulario de consulta
function consultarComEnter(event, campo, op) { var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; if (keyCode == 13) { return confirmarBuscarTodos(campo, op); } else { return event; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fCidadeF10(opc,codCdd,foco,topo,objeto){\r\n let clsStr = new concatStr();\r\n clsStr.concat(\"SELECT A.CDD_CODIGO AS CODIGO,A.CDD_NOME AS DESCRICAO\" );\r\n clsStr.concat(\" ,A.CDD_CODEST AS UF\" ); \r\n clsStr.concat(\" FROM CIDADE A\" ...
[ "0.6364463", "0.61970794", "0.6181174", "0.6151602", "0.604923", "0.6044036", "0.60373837", "0.6027106", "0.6019904", "0.59680444", "0.59525824", "0.5949489", "0.5947865", "0.5940497", "0.59354776", "0.5911324", "0.59108806", "0.58991563", "0.58905876", "0.5886648", "0.588230...
0.0
-1
Funcao para exibir alert com opcoes de OK ou Cancelar confirmando opcao do usuario
function confirmarAcao(acao) { if(confirm("Tem certeza que deseja incluir este paciente na fila de " + acao + "?")) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function modalDialog2_handleOK (e) {\r\n\t\tvar window = e.data.window;\r\n\t\tvar form = e.data.form;\r\n\t\tvar errorDiv = e.data.errorDiv;\r\n\t\tvar waitDiv = e.data.waitDiv;\r\n\t\tvar options = e.data.options;\r\n\t\t\r\n\t\tvar action = form ? form.attr(\"action\") : \"\";\r\n\r\n\t\terrorDiv.hide();\r\n\t\...
[ "0.7049495", "0.70396626", "0.69722766", "0.68546766", "0.68477017", "0.6736305", "0.6681695", "0.6654357", "0.66375214", "0.65882206", "0.6564247", "0.65480965", "0.6510215", "0.64953274", "0.64436585", "0.6432796", "0.64258397", "0.64061934", "0.6393038", "0.63813233", "0.6...
0.622793
37
Analyze log blocks delimited by Time : tag
function processLog() { var log_entry; var log_lines; var date; var time; var query_string; var entry_stats; logdata.shift(); // ignore server infos for (var i = 0; i < logdata.length; i++) { // load string log_entry = "# Time: " + logdata[i]; logdata[i] = {}; log_lines = log_entry.split("\n"); // get host logdata[i].db_name = log_lines[1].split("[")[1].split("]")[0]; // get stats entry_stats = log_lines[2].split(" "); logdata[i].query_time = parseInt(entry_stats[2]); // query time logdata[i].lock_time = parseInt(entry_stats[5]); // lock time logdata[i].rows_sent = parseInt(entry_stats[8]); // rows sent logdata[i].rows_examined = parseInt(entry_stats[11]); // row examined // update stats if (logdata[i].query_time < stats.query_time.min) stats.query_time.min = logdata[i].query_time; if (logdata[i].query_time > stats.query_time.max) stats.query_time.max = logdata[i].query_time; if (logdata[i].lock_time < stats.lock_time.min) stats.lock_time.min = logdata[i].lock_time; if (logdata[i].lock_time > stats.lock_time.max) stats.lock_time.max = logdata[i].lock_time; if (logdata[i].rows_sent < stats.rows_sent.min) stats.rows_sent.min = logdata[i].rows_sent; if (logdata[i].rows_sent > stats.rows_sent.max) stats.rows_sent.max = logdata[i].rows_sent; if (logdata[i].rows_examined < stats.rows_read.min) stats.rows_read.min = logdata[i].rows_examined; if (logdata[i].rows_examined > stats.rows_read.max) stats.rows_read.max = logdata[i].rows_examined; log_lines[0] = log_lines[0].replace(' ', ' '); date = str_split(log_lines[0].split(' ')[2],2); time = log_lines[0].split(' ')[3].split(":"); // parse date date = new Date("20" + date[0], date[1] - 1, date[2], time[0], time[1], time[2]); var year = date.getFullYear(); var month = date.getUTCMonth() + 1; if (month < 10) month = "0" + month; var day = date.getDate().toString(); if (day < 10) day = "0" + day; var hours = date.getHours().toString(); if (hours < 10) hours = "0" + hours; var mins = date.getMinutes().toString(); if (mins < 10) mins = "0" + mins; logdata[i].dateObj = date; // date logdata[i].date = year + "/" + month + "/" + day + " " + hours + ":" + mins; logdata[i].hour = hours; // isolate query log_lines.shift(); log_lines.shift(); log_lines.shift(); // query query_string = checkMulitpleQueries(log_lines.join("<br/>").split("# User@Host: "), date, i); // add formatted query tou the list logdata[i].query_string = query_string; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function process_E1_History_Stats_15min_Out_Log_Record(record)\n{\n\tvar myId;\t\t\n\tvar subelement = LOOKUP.get(record.monitoredObjectPointer); \n\t\n\tif(subelement == null)\n\t{\n\t\tlogP5Msg(\"process_E1_History_Stats_15min_Out_Log_Record\", \"SAMUBA_E1_History_Stats_15min_Out_Log_Record\", \"Skipping 0 rid ...
[ "0.552654", "0.54871875", "0.5452622", "0.53817314", "0.52517253", "0.52517253", "0.5249744", "0.51914006", "0.5134551", "0.5007868", "0.49654788", "0.49614042", "0.49240983", "0.48859766", "0.48845705", "0.4860869", "0.4860869", "0.4860869", "0.48470366", "0.48448303", "0.48...
0.5760078
0
Registers redirect rules assuming that currently no rules are registered by this extension, yet.
function registerRules() { var redirectRule = { priority: 100, conditions: [ // If any of these conditions is fulfilled, the actions are executed. new RequestMatcher({ // Both, the url and the resourceType must match. url: { pathSuffix: ".jpg" }, resourceType: ["image"], }), new RequestMatcher({ url: { pathSuffix: ".jpeg" }, resourceType: ["image"], }), ], actions: [new RedirectRequest({ redirectUrl: catImageUrl })], }; var exceptionRule = { priority: 1000, conditions: [ // We use hostContains to compensate for various top-level domains. new RequestMatcher({ url: { hostContains: ".google." } }), ], actions: [new IgnoreRules({ lowerPriorityThan: 1000 })], }; var callback = function () { if (chrome.runtime.lastError) { console.error("Error adding rules: " + chrome.runtime.lastError); } else { console.info("Rules successfully installed"); chrome.declarativeWebRequest.onRequest.getRules(null, function (rules) { console.info( "Now the following rules are registered: " + JSON.stringify(rules, null, 2) ); }); } }; chrome.declarativeWebRequest.onRequest.addRules( [redirectRule, exceptionRule], callback ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function addRedirect(inputs, {namespace, apihost}) {\n const redirectRules = []\n\n if (deployWeb) {\n redirectRules.push(`/* https://${namespace}-${apihost}/:splat 200!`)\n } else if (inputs.path) {\n const redirectPath = inputs.path.endsWith('/')\n ? inputs.path\n : inputs.path + '/'\n ...
[ "0.574882", "0.546954", "0.5318327", "0.5318327", "0.5318327", "0.5318327", "0.5318327", "0.5318327", "0.5318327", "0.5311433", "0.5311433", "0.5311433", "0.5311433", "0.5311433", "0.5311433", "0.5311433", "0.5311433", "0.5311381", "0.5260532", "0.52460283", "0.52335984", "...
0.7447899
0
Testing how to save the course in the courseCart of the DB
function MapAndJSONTesting(res) { let testMap = new Map(); let testArr = [0, 1, 2, 3, 4, 5, 6]; testMap.set("Schedule1", testArr); console.log(testMap.toString()); console.log(testMap); let testObj = { "ya": "okay" }; let testMap2Json = mapToJson(testMap); console.log(testMap2Json); console.log(jsonToMap(testMap2Json)); console.log(typeof testObj); res.status(200).json({ "testMap": testMap, "testMap2JSON": testMap2Json, "testArr": testArr, "testObj": testObj }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createCourse(course) {\n course.coursename = course.coursefirstname + \"-\" + course.courselastname;\n course.semid = vm.semesterId;\n course.profid = vm.userInfo.professorid;\n courseService\n .createCourse(course)\n .then(function...
[ "0.6486599", "0.64159745", "0.6343108", "0.63065195", "0.61627835", "0.6136635", "0.6093632", "0.6058487", "0.6056491", "0.6036487", "0.60346305", "0.5981917", "0.59663355", "0.59516203", "0.59490734", "0.5935352", "0.5933228", "0.59205437", "0.5914743", "0.58775425", "0.5831...
0.0
-1
================================ Promise Examples ================================================== Usage example of Async / Await in the project In this example data was fetched from DB step 1: create the async function analogous to a driverFunc() as follows:
async function asyncAddCourseSubController(userInput, req, res, next) { const query = await checkCourseExistDuringSemester(userInput, req, res, next); // console.log(query); // console.log(typeof query); // let queryObj = JSON.parse(query); console.log(query); let queryObj = query; // return.length -- works for findall() because return is an array console.log(queryObj.length); // return[object.termCode] -- works for findOne() because return is a JSON object console.log(queryObj.object.termCode); console.log(queryObj["object"]["termCode"]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function asyncFuncExample(){\n let resolvedValue = await myPromise();\n console.log(resolvedValue);\n }", "async function printDataAsyncAwait() {\n let p = promiseFunction();\n const beta = await p;\n console.log(beta);\n}", "async function testAsync(co...
[ "0.6733115", "0.667679", "0.6646334", "0.65305686", "0.64699066", "0.6430638", "0.6423003", "0.6406689", "0.64020073", "0.6366596", "0.6353627", "0.63467866", "0.63157725", "0.62763137", "0.62402797", "0.62385356", "0.6223069", "0.62206525", "0.62122625", "0.62117916", "0.618...
0.0
-1
step2: create the functions that need to be called synchronously/sequentially in the above function
function checkCourseExistDuringSemester(userInput, req, res, next) { return new Promise((resolve,reject) => { // ============= How to do query =================================== // ======== Check if the course Exists ======================= // const query = scheduleModel.find(); const query = scheduleModel.findOne(); query.setOptions({lean: true}); query.collection(scheduleModel.collection); // example to do the query in one line // query.where('object.courseSubject').equals(userInput.courseSubject).exec(function (err, scheduleModel) { // building a query with multiple where statements query.where('object.courseSubject').equals(userInput.courseSubject); query.where('object.courseCatalog').equals(userInput.courseCatalog); // query.where('object.termTitle').equals(userInput.termTitle); query.where('object.termDescription').equals(userInput.termDescription); query.exec((err, result) => { // console.log("From the sub function: " + query); resolve(result); reject(err); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testFunctions()\n{\n let _count = 100;\n const _getFn = () =>\n {\n const _n = _count++;\n return (cb) => setTimeout(\n () => cb(null, _n),\n Math.random() * 50\n );\n };\n jfSync(\n [\n _getFn(),\n _getFn(),\n ...
[ "0.62581563", "0.60704714", "0.6002653", "0.59502167", "0.5950089", "0.59460443", "0.5940863", "0.59010917", "0.5874552", "0.5824157", "0.5800918", "0.5799899", "0.57769054", "0.5767607", "0.57646465", "0.57551473", "0.57367325", "0.57189244", "0.5712297", "0.5700772", "0.566...
0.0
-1
step 3: Now you can call the async function anywhere you like for the example I called it in one of the controller methods that gets by the REST Calls mainFunc(userInput, req, res, next); Async / Await examples Reference1 :::
async function asyncAwait() { var aVal = null; try { const first = await promiseFunc(aVal); console.log(first); const second = await promiseFunc(first); console.log(second); const third = await promiseFunc(second); console.log(third); aVal = third; console.log(aVal); } catch (e) { console("Error"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function main() {\n\n getUser(\"test1\");\n\n}", "async function fetchUser() {\n return \"abc\";\n}", "async function asyncWrapperFunction() {\r\n await htmlRouting();\r\n await videoRouting();\r\n const data = await dataProcessing();\r\n const nodes = await nodesGetting();\r\n dynamic...
[ "0.6948377", "0.65889823", "0.6489263", "0.6400034", "0.63576305", "0.6288742", "0.6282028", "0.6265965", "0.6238099", "0.6221576", "0.62209773", "0.62048906", "0.6180364", "0.61578697", "0.6127205", "0.61076176", "0.6106216", "0.6082266", "0.6082227", "0.6064737", "0.6064737...
0.0
-1
================================= Promise Examples ================================================= =============== Database test query functions =================================================== This is an example function not used anywhere in the project
function testQueryBuilder() { // user input should have the following: // -> userID // -> Semester selected // -> Course Subject // -> Course Code // const userInput = req.body; // Example or Test statement from postman --> in the body ->> x-www-form-urlencoded was selected // let testTitle = userInput.COEN; // setting the mongoose debugging to true const mongoose = require("mongoose"); mongoose.set('debug', true); dbHelpers.defaultConnectionToDB(); // both findOne() and find() works // const query = scheduleModel.find(); const query = scheduleModel.findOne(); query.setOptions({lean: true}); query.collection(scheduleModel.collection); // example to do the query in one line // query.where('object.courseSubject').equals(userInput.courseSubject).exec(function (err, scheduleModel) { // building a query with multiple where statements query.where('object.courseSubject').equals(userInput.courseSubject); query.where('object.courseCatalog').equals(userInput.courseCatalog); query.exec(function (err, scheduleModel) { try { res.status(200).json({ userInput, scheduleModel, message: "addCourseToSequence executed" }) // } } catch (err) { console.log("Error finding the course provided by the user"); res.status(200).json({ message: "Internal Server Error: Course not found" }) } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testQueries() {\n const queries = [\n // findAndSearch(),\n // createNote()\n // findById('000000000000000000000002')\n // findAndUpdate('5ba1566686d6ed45d030e4d9')\n findAndUpdate('5ba155cffeb22e8c6cf7965a'),\n findById('5ba155cffeb22e8c6cf7965a')\n ];\n\n \n return Promise.all(quer...
[ "0.7072084", "0.6965696", "0.6881106", "0.6881106", "0.68532574", "0.681616", "0.68005687", "0.68005687", "0.67238986", "0.6720794", "0.66493005", "0.6567426", "0.65658003", "0.65441704", "0.6538023", "0.65171593", "0.6513134", "0.6497586", "0.6497586", "0.6460553", "0.645569...
0.0
-1
============== Database test query ===================================================
function mapToJson(map) { return JSON.stringify([...map]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CreateDatabaseQuery() {}", "function testQueries() {\n const queries = [\n // findAndSearch(),\n // createNote()\n // findById('000000000000000000000002')\n // findAndUpdate('5ba1566686d6ed45d030e4d9')\n findAndUpdate('5ba155cffeb22e8c6cf7965a'),\n findById('5ba155cffeb22e8c6cf7965a')...
[ "0.67630345", "0.6684823", "0.6263232", "0.6207665", "0.6201697", "0.6107374", "0.6038539", "0.6005674", "0.59990776", "0.59990776", "0.59958535", "0.59946406", "0.5946922", "0.59375215", "0.59108126", "0.5886826", "0.5854224", "0.5816241", "0.581162", "0.5800839", "0.5764274...
0.0
-1
Adding a method to the constructor NB: fucking works !
greet() { return `${this.name} says hello.`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructur() {}", "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "function _ctor() {\n\t}", "__previnit(){}", "function _construct()\n\t\t{;\n\t\t}", "function Ctor() {}", "function HelperConstructor() {}", "constructor (){}", "constructor( ) {}", "fun...
[ "0.7370769", "0.7263137", "0.7263137", "0.7263137", "0.712248", "0.6965426", "0.6959364", "0.69394857", "0.68425643", "0.6770985", "0.67553824", "0.67202747", "0.6710721", "0.6672627", "0.6672627", "0.6672627", "0.6672627", "0.6672627", "0.6672627", "0.6551111", "0.65505445",...
0.0
-1
Get All User By Hospital ID
async GetAllUserByHospitalID (val) { // console.log(val) try { const response = await axios.get(`https://kidney-diary-service.yuzudigital.com/users?hospitalId=` + val.hospitalID) return response.data } catch (error) { return error.response } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getUserData(id) {\n const { users } = this.props;\n let data = users.users;\n let result = data.filter(user => user.login.uuid === id);\n\n return result;\n }", "function getAll(id) {\n return db('people').where({'user_id': id});\n}", "function getEmployees(req, res, next) {\n var id = parse...
[ "0.65712804", "0.6507643", "0.64661324", "0.6444435", "0.6352326", "0.62574583", "0.62258863", "0.6223066", "0.62215537", "0.6211341", "0.6192594", "0.6171471", "0.6170969", "0.61689293", "0.61489487", "0.6142468", "0.61366373", "0.6107716", "0.61033773", "0.60999733", "0.609...
0.7225104
0
right to left function
function setRtl(lang) { switch (lang) { case "ar": return setRightoleft({ status: true }); default: return setRightoleft({ status: false }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toLeft(){\n}", "function LeftNodeRight(node) {\n if (node) {\n LeftNodeRight(node.left);\n result.push(node.value);\n LeftNodeRight(node.right);\n }\n }", "function rotateRightLeft(node) { \n node.right = rotateRightRight(node.right); \n return rotateLeftLeft(no...
[ "0.7550095", "0.71720326", "0.71361285", "0.6994268", "0.6929432", "0.6865777", "0.66811967", "0.6646705", "0.66431296", "0.64886266", "0.6482068", "0.6424207", "0.64165175", "0.6284513", "0.6281804", "0.62790155", "0.62592065", "0.62270707", "0.6221941", "0.6196062", "0.6187...
0.0
-1
Write a function `minMaxProduct(array)` that returns the product between the largest value and the smallest value in the array. Assume `array` is an array of numbers. Assume an array of at least two numbers. Example minMaxProduct([0,1,2,3,4,5]) => 0 minMaxProduct([5,4,3,2,1]) => 5 minMaxProduct([4,2,5,1,5]) => 25
function minMaxProduct(array){ var min = array[0]; var max = array[0]; for (var i = 0; i < array.length; i++) { if (min > array[i]) { min = array[i]; } else if (max < array[i]) { max = array[i]; } } return min * max; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function minMaxProduct(array){\n var biggestNumber = Math.max.apply(null, array); //only used this after reading Mozilla docs\n var smallestNumber = Math.min.apply(null, array); // \"\"\n return (biggestNumber * smallestNumber);\n}", "function minMaxProduct(array){\n // your code here...\n}", "function max...
[ "0.8783292", "0.8142232", "0.72863984", "0.72103554", "0.7036269", "0.69720227", "0.69512016", "0.6931631", "0.68986726", "0.68151355", "0.67547876", "0.6730858", "0.6714051", "0.6672191", "0.6661583", "0.66550887", "0.6652756", "0.66503114", "0.662717", "0.6606599", "0.66065...
0.9041857
0
Write a function `leastCommonMultiple(num1, num2)` that returns the lowest number which is a multiple of both inputs. Example leastCommonMultiple(2, 3) => 6 leastCommonMultiple(6, 10) => 30 leastCommonMultiple(24, 26) => 312
function leastCommonMultiple(num1, num2){ if (num1 === 2 || num2 === 2) { return num1 * num2 } else if (num1 % 2 === 0) { return (num1 / 2) * num2; } else if (num2 % 2 === 0) { return (num2 / 2) * num1; } else { return num1 * num2; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function leastCommonMultiple(num1, num2){\n var smallerNumber = Math.min(num1, num2);\n var largerNumber = Math.max(num1, num2);\n var multiple = smallerNumber;\n\n while(true) {\n if (multiple % largerNumber === 0) {\n return multiple;\n }\n multiple += smallerNumber;\n }\n}", "function least...
[ "0.9017953", "0.8722978", "0.7976531", "0.78440845", "0.7657435", "0.75450426", "0.75349295", "0.7462742", "0.74439675", "0.74222004", "0.7396669", "0.73602855", "0.73050475", "0.7280567", "0.7251591", "0.72227526", "0.72107136", "0.7208665", "0.7195854", "0.7193158", "0.7186...
0.8883312
1
Write a function `hipsterfy(sentence)` that takes takes a string containing several words as input. Remove the last vowel from each word. 'y' is not a vowel. Example hipsterfy("proper") => "propr" hipsterfy("proper tonic panther") => "propr tonc panthr" hipsterfy("towel flicker banana") => "towl flickr banan" hipsterfy("runner anaconda") => "runnr anacond" hipsterfy("turtle cheeseburger fries") => "turtl cheeseburgr fris" Solution from Paris with one function and two for loops
function hipsterfy(sentence){ var splitSentence = sentence.split(" "); var vowels = ["a","e","i","o","u"]; var newSentence = []; for (var i = 0; i < splitSentence.length; i++) { var word = splitSentence[i]; for (var k = word.length - 1; k >=0 ; k--) { // console.log(word[k]); if (vowels.indexOf(word[k]) !== -1) { // console.log("word[k] is: " + word[k]); word = word.slice(0,k) + word.slice(k+1); // console.log("word before the break is: " + word); break; } } newSentence.push(word); } return newSentence.join(" "); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hipsterfy(sentence){\n\n var vowels = ['a', 'e', 'i', 'o', 'u'];\n\n var sentArr = sentence.split(' ');\n//iterate through the array:\n for(var i = 0; i < sentArr.length; i++){\n var word = sentArr[i];\n // console.log(word);\n //iterate through the element itself:\n // for(var j = 0; j < word....
[ "0.7598701", "0.66150284", "0.6609498", "0.6352171", "0.6308119", "0.61867553", "0.61338073", "0.61263466", "0.60992587", "0.60802", "0.60788816", "0.6027845", "0.6003421", "0.59983814", "0.59888405", "0.5980003", "0.5970728", "0.5952415", "0.5944918", "0.5940205", "0.5936369...
0.70518637
1
calculateProduksi get the permintaan and persediaan value from text field and prints the production amount calculated
function calculateProduksi() { var permintaan = document.getElementById('permintaan').value; var persediaan = document.getElementById('persediaan').value; document.write(defuzzyfikasi(permintaan, persediaan)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "calculPricePni(){\n this.panierPrice = 0;\n for (let product of this.list_panier) {\n var price = product.fields.price*product.quantit;\n this.panierPrice = this.panierPrice+price;\n }\n //on arrondi le price au deuxieme chiffre apres la vir...
[ "0.69717216", "0.686301", "0.66871744", "0.6685071", "0.6645067", "0.6515604", "0.6502173", "0.64452", "0.6407038", "0.63952535", "0.6373846", "0.6366004", "0.6364821", "0.6350403", "0.6340947", "0.6327886", "0.63234204", "0.6283239", "0.6264719", "0.6258163", "0.62203205", ...
0.72264314
0
setMinPermintaan set the minPermintaan variable with value from text input
function setMinPermintaan () { minPermintaan = document.getElementById('newMinPermintaan').value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setMinPersediaan(params) {\n minPersediaan = document.getElementById('newMinPersediaan').value;\n }", "set min(value) {\n Helper.UpdateInputAttribute(this, 'min', value);\n }", "function setM(value) {\n document.getElementById(\"valueM\").innerHTML = value;\n mines = parseInt(valu...
[ "0.7858439", "0.6905027", "0.68398803", "0.67898595", "0.67226154", "0.6696683", "0.6590643", "0.65395427", "0.649166", "0.6344122", "0.6255673", "0.62309146", "0.6205384", "0.61770135", "0.61602587", "0.61048377", "0.6040299", "0.6015067", "0.6009302", "0.5949658", "0.591732...
0.8304282
0
setMaxPermintaan set the maxPermintaan variable with value from text input
function setMaxPermintaan() { maxPermintaan = document.getElementById('newMaxPermintaan').value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setMaxPersediaan() {\n maxPermintaan = document.getElementById('newMaxPersediaan').value;\n }", "function maxDecimales (){\n inputDecimales.value;\n}", "set max(max) {\n this._max = !isNumber(max) || max <= 0 ? 100 : max;\n }", "function setMaxVeganAndVegetarian() {\n if (Nu...
[ "0.82385206", "0.7557402", "0.72324264", "0.70395625", "0.7004344", "0.69728523", "0.680585", "0.6773965", "0.6625173", "0.6621312", "0.6562023", "0.6506439", "0.6458832", "0.6446216", "0.64046824", "0.63815355", "0.63498", "0.63414544", "0.63092923", "0.6305604", "0.63033473...
0.8336871
0
setMinPersediaan set the minPersediaan variable with value from text input
function setMinPersediaan(params) { minPersediaan = document.getElementById('newMinPersediaan').value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setMinPermintaan () {\n minPermintaan = document.getElementById('newMinPermintaan').value;\n }", "set min(value) {\n Helper.UpdateInputAttribute(this, 'min', value);\n }", "set _min(value) {\n Helper.UpdateInputAttribute(this, \"min\", value);\n }", "function updateMinN(min) {\n ...
[ "0.7976153", "0.71554196", "0.7120069", "0.6942235", "0.6768394", "0.6699136", "0.66111183", "0.65619206", "0.6553356", "0.6510541", "0.6487791", "0.6330027", "0.63266677", "0.6298205", "0.6243311", "0.6142725", "0.610474", "0.60677993", "0.6027375", "0.60231453", "0.60153884...
0.810261
0
setMaxPersediaan set the maxPersediaan variable with value from text input
function setMaxPersediaan() { maxPermintaan = document.getElementById('newMaxPersediaan').value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setMaxPermintaan() {\n maxPermintaan = document.getElementById('newMaxPermintaan').value;\n }", "function maxDecimales (){\n inputDecimales.value;\n}", "set max(max) {\n this._max = !isNumber(max) || max <= 0 ? 100 : max;\n }", "set _max(value) {\n Helper.UpdateInputAttrib...
[ "0.8009443", "0.7632048", "0.754425", "0.72252905", "0.7180746", "0.7062205", "0.6993835", "0.6927285", "0.6903482", "0.6804582", "0.6711847", "0.66559166", "0.65869105", "0.6552504", "0.65364695", "0.6512207", "0.65094644", "0.65094644", "0.65094644", "0.65094644", "0.650946...
0.81307983
0
set the min and max variables to it's initial value
function resetMinMax() { minPermintaan = 1000; maxPermintaan = 5000; minPersediaan = 100; maxPersediaan = 600; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateMinMax() {\n min = parseInt(minValueField.value);\n max = parseInt(maxValueField.value);\n}", "function setMinMaxValues(min, max) {\n numberGuessInput.min = min;\n numberGuessInput.max = max;\n}", "function setRangeValue(min, max) {\n minNumRange.value = min;\n maxNumRange.value = max;\n}"...
[ "0.7926771", "0.789713", "0.7590515", "0.73252755", "0.730143", "0.7226012", "0.7106195", "0.7015695", "0.70142543", "0.69892055", "0.69873947", "0.69194937", "0.6833583", "0.68163675", "0.6810438", "0.67994595", "0.6763152", "0.6716786", "0.67108697", "0.670427", "0.66776705...
0.7715629
2
Bound Checker: check if the particle/ball is collide with other
function BoundChecker(particle) { this.objectCounter = objectCounter++; this.particle = particle; this.func = this.funcMap[particle.name]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "collideBroadPhase(other) {\n // By default assume all collisions will be checked.\n return true;\n }", "checkBound(i, current) {\n // get the current velocity with respect to deltaT\n let curVel = multiplyVector(current.vel, deltaT);\n\n // if given object does not react to bounding r...
[ "0.73048663", "0.700014", "0.697474", "0.6893094", "0.6882723", "0.68703336", "0.6849041", "0.68466705", "0.6825712", "0.6798142", "0.6758802", "0.6757075", "0.67559093", "0.67529964", "0.6683891", "0.6671648", "0.66652703", "0.66529447", "0.66430485", "0.6620247", "0.6613209...
0.7364233
0
A Ball particle and related functions
function Ball(pos, r) { this.pos = pos; this.velocity = new Vector(0, 0); this.radius = r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Ball(x, y, velX, velY, color, size, nextphase,retention) {\n this.x = x;\n this.y = y;\n this.velX = velX;\n this.velY = velY;\n this.color = color;\n this.size = size;\n this.nextphase=nextphase;\n this.retention=retention;\n\n\n}", "function end_Particle(x , y) // you will need to modify the p...
[ "0.71184534", "0.69016254", "0.688879", "0.68635935", "0.6822931", "0.6577163", "0.6545521", "0.65444607", "0.6502456", "0.6496114", "0.64847225", "0.64781713", "0.647718", "0.6471997", "0.646383", "0.6460675", "0.6446303", "0.6439485", "0.6422377", "0.6419649", "0.6411926", ...
0.63703877
24
Instantiates a new component.
constructor(props: Props) { super(props); this.state = { lobbyEnabled: props._lobbyEnabled }; this._onToggleLobby = this._onToggleLobby.bind(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create(options) {\n return new component_Component(options);\n}", "function Component() { }", "function ComponentInstance() {\r\n _super.call(this);\r\n }", "createComponent(obj){\n\t\t\tvar comp = new Component(obj.selector, obj.template, obj.ctrlFunc);\n\t\t\tthis[componentSymbo...
[ "0.74001366", "0.71638787", "0.6990484", "0.69105464", "0.68156224", "0.6727543", "0.6727543", "0.6727109", "0.6665906", "0.66610533", "0.66211635", "0.65455705", "0.65051603", "0.64789724", "0.64429253", "0.64429253", "0.64429253", "0.64429253", "0.64429253", "0.64429253", "...
0.0
-1
mount products from db
componentDidMount() { fetch('/products') .then(response => response.json()) .then(data => { this.setState({ products: data }) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function productItems() {\n\tconnection.connect(function(err) {\n\n\t\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif (err) throw err\n\t\telse console.table(res , \"\\n\");\n\t\tproductId();\n\t\t});\n\t});\n}", "function getProducts(res, mysql, context, complete){\n \tmysql.pool.q...
[ "0.6670745", "0.6422243", "0.64205784", "0.6407651", "0.6333878", "0.6325375", "0.63012415", "0.6281852", "0.62682015", "0.6244326", "0.62443244", "0.6220509", "0.6216465", "0.6177422", "0.61530566", "0.6148213", "0.6145554", "0.61373985", "0.6136584", "0.61347616", "0.613434...
0.0
-1
This is done to register the method called with moment() without creating circular dependencies.
function setHookCallback (callback) { hookCallback = callback; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(moment) {\n this.moment = moment;\n }", "moment(date) {\n return moment(date);\n }", "viewDateMoment () {\n const m = moment(this.props.viewDate)\n return function () {\n return m.clone()\n }\n }", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments,...
[ "0.6808176", "0.61082673", "0.59246933", "0.5748391", "0.5748391", "0.5748391", "0.5748391", "0.5748391", "0.5748391", "0.5748391", "0.5748391", "0.5748391", "0.5748391", "0.5748391", "0.5748391", "0.5748391", "0.5740086", "0.5740086", "0.5740086", "0.5735562", "0.5735562", ...
0.0
-1
compare two arrays, return the number of differences
function compareArrays(array1, array2, dontConvert) { var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i; for (i = 0; i < len; i++) { if ((dontConvert && array1[i] !== array2[i]) || (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) { diffs++; } } return diffs + lengthDiff; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs+...
[ "0.82791424", "0.82791424", "0.82791424", "0.82791424", "0.82791424", "0.82791424", "0.82791424", "0.82791424", "0.82791424", "0.82791424", "0.82791424", "0.79984933", "0.79866725", "0.79537725", "0.7922521", "0.77097225", "0.75572866", "0.75463253", "0.75318825", "0.7503132", ...
0.0
-1
format date using native date object
function formatMoment(m, format) { if (!m.isValid()) { return m.localeData().invalidDate(); } format = expandFormat(format, m.localeData()); formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); return formatFunctions[format](m); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "formatDate(date) {\n\t\treturn date.toString()\n\t\t.replace(/(\\d{4})(\\d{2})(\\d{2})/, (string, year, month, day) => `${year}-${month}-${day}`);\n\t}", "static formatDate(date) {\n return new Date(date).toLocaleDateString();\n }", "formatTheDate(date, format) {\n const [ year, month, day ] = (date.toI...
[ "0.75320816", "0.7421278", "0.7386446", "0.7386206", "0.73497903", "0.7336332", "0.73048234", "0.7300858", "0.7292591", "0.7292591", "0.7292591", "0.7221218", "0.7213261", "0.7210653", "0.7188191", "0.71826464", "0.71783525", "0.71683335", "0.71673006", "0.71582985", "0.71363...
0.0
-1
pick the locale from the array try ['enau', 'engb'] as 'enau', 'engb', 'en', as in move through the list trying each substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
function chooseLocale(names) { var i = 0, j, next, locale, split; while (i < names.length) { split = normalizeLocale(names[i]).split('-'); j = split.length; next = normalizeLocale(names[i + 1]); next = next ? next.split('-') : null; while (j > 0) { locale = loadLocale(split.slice(0, j).join('-')); if (locale) { return locale; } if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) { //the next array item is better than a shallower substring of this one break; } j--; } i++; } return globalLocale; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n \n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : nu...
[ "0.7080735", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034",...
0.0
-1
This function will load locale and then set the global locale. If no arguments are passed in, it will simply return the current global locale key.
function getSetGlobalLocale (key, values) { var data; if (key) { if (isUndefined(values)) { data = getLocale(key); } else { data = defineLocale(key, values); } if (data) { // moment.duration._locale = moment._locale = data; globalLocale = data; } else { if ((typeof console !== 'undefined') && console.warn) { //warn user if arguments are passed but the locale could not be set console.warn('Locale ' + key + ' not found. Did you forget to load it?'); } } } return globalLocale._abbr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are p...
[ "0.7327511", "0.72994685", "0.72960633", "0.7250679", "0.7250679", "0.7250679", "0.7250679", "0.7250679", "0.7250679", "0.7242776", "0.7242776", "0.7231589", "0.72192186", "0.7215549", "0.72115666", "0.72115666", "0.72115666", "0.72115666", "0.72076297", "0.7207319", "0.72072...
0.0
-1
Pick the first defined of two or three arguments.
function defaults(a, b, c) { if (a != null) { return a; } if (b != null) { return b; } return c; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pick() {\n\tvar args = arguments,\n\t\ti,\n\t\targ,\n\t\tlength = args.length;\n\tfor (i = 0; i < length; i++) {\n\t\targ = args[i];\n\t\tif (typeof arg !== 'undefined' && arg !== null) {\n\t\t\treturn arg;\n\t\t}\n\t}\n}", "function pick() {\n\t\tvar args = arguments,\n\t\t\ti,\n\t\t\targ,\n\t\t\tlengt...
[ "0.7629042", "0.75575334", "0.74523604", "0.7447829", "0.6875494", "0.6672635", "0.6649544", "0.66400206", "0.65779024", "0.6487554", "0.64760274", "0.64054173", "0.62996894", "0.62969613", "0.62835485", "0.61632556", "0.61517835", "0.5961853", "0.59598327", "0.5933788", "0.5...
0.0
-1
convert an array to a date. the array should mirror the parameters below note: all values past the year are optional and will default to the lowest possible value. [year, month, day , hour, minute, second, millisecond]
function configFromArray (config) { var i, date, input = [], currentDate, expectedWeekday, yearToUse; if (config._d) { return; } currentDate = currentDateArray(config); //compute day of the year from weeks and weekdays if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { dayOfYearFromWeekInfo(config); } //if the day of the year is set, figure out what it is if (config._dayOfYear != null) { yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) { getParsingFlags(config)._overflowDayOfYear = true; } date = createUTCDate(yearToUse, 0, config._dayOfYear); config._a[MONTH] = date.getUTCMonth(); config._a[DATE] = date.getUTCDate(); } // Default to current date. // * if no year, month, day of month are given, default to today // * if day of month is given, default month and year // * if month is given, default only year // * if year is given, don't default anything for (i = 0; i < 3 && config._a[i] == null; ++i) { config._a[i] = input[i] = currentDate[i]; } // Zero out whatever was not defaulted, including time for (; i < 7; i++) { config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; } // Check for 24:00:00.000 if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) { config._nextDay = true; config._a[HOUR] = 0; } config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input); expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay(); // Apply timezone offset from input. The actual utcOffset can be changed // with parseZone. if (config._tzm != null) { config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); } if (config._nextDay) { config._a[HOUR] = 24; } // check for mismatching day of week if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) { getParsingFlags(config).weekdayMismatch = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dateFromArray(input) {\n return new Date(input[0], input[1] || 0, input[2] || 1, input[3] || 0, input[4] || 0, input[5] || 0, input[6] || 0);\n }", "function dateFromArray(input) {\n return new Date(input[0], input[1] || 0, input[2] || 1, input[3] || 0, input[4] || 0, input[5] || 0, inp...
[ "0.7055596", "0.7055596", "0.69680774", "0.6847937", "0.66370344", "0.6459812", "0.6129757", "0.61271906", "0.60674685", "0.60150933", "0.60150933", "0.60150933", "0.60150933", "0.60150933", "0.59615904", "0.59615904", "0.59615904", "0.58991313", "0.5884828", "0.58760655", "0...
0.0
-1
date from iso format
function configFromISO(config) { var i, l, string = config._i, match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), allowTime, dateFormat, timeFormat, tzFormat; if (match) { getParsingFlags(config).iso = true; for (i = 0, l = isoDates.length; i < l; i++) { if (isoDates[i][1].exec(match[1])) { dateFormat = isoDates[i][0]; allowTime = isoDates[i][2] !== false; break; } } if (dateFormat == null) { config._isValid = false; return; } if (match[3]) { for (i = 0, l = isoTimes.length; i < l; i++) { if (isoTimes[i][1].exec(match[3])) { // match[2] should be 'T' or space timeFormat = (match[2] || ' ') + isoTimes[i][0]; break; } } if (timeFormat == null) { config._isValid = false; return; } } if (!allowTime && timeFormat != null) { config._isValid = false; return; } if (match[4]) { if (tzRegex.exec(match[4])) { tzFormat = 'Z'; } else { config._isValid = false; return; } } config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); configFromStringAndFormat(config); } else { config._isValid = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isoDate(date)\n{\n\treturn date.getFullYear() + \"-\" + (date.getMonth() + 1) + \"-\" + date.getDate()\n}", "function dateFromISO8601(isostr) {\n var parts = isostr.match(/\\d+/g);\n var date = new Date(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]);\n var mm = date...
[ "0.7161587", "0.7084152", "0.69561076", "0.68181574", "0.66757625", "0.66372114", "0.6559707", "0.6525335", "0.6466161", "0.6465599", "0.644205", "0.64171946", "0.6406543", "0.6406543", "0.6406543", "0.6406543", "0.63656497", "0.63241196", "0.6322188", "0.62742394", "0.626350...
0.0
-1
date and time from ref 2822 format
function configFromRFC2822(config) { var match = rfc2822.exec(preprocessRFC2822(config._i)); if (match) { var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]); if (!checkWeekday(match[1], parsedArray, config)) { return; } config._a = parsedArray; config._tzm = calculateOffset(match[8], match[9], match[10]); config._d = createUTCDate.apply(null, config._a); config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); getParsingFlags(config).rfc2822 = true; } else { config._isValid = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createDrupalDateFromPieces(date, hour, minute, marker) {\n //Build time\n var time = hour + ':' + minute + ' ' + marker;\n //Build full date\n var dateTime = moment(date + ' ' + time, 'YYYY-MM-DD hh:mm A');\n //Return date in 24-hour format\n return moment(dateTime);\n }",...
[ "0.653082", "0.63895303", "0.6154629", "0.6096161", "0.60804975", "0.605977", "0.60540193", "0.605324", "0.605324", "0.605324", "0.605324", "0.6040541", "0.6028883", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6...
0.0
-1
date from iso format or fallback
function configFromString(config) { var matched = aspNetJsonRegex.exec(config._i); if (matched !== null) { config._d = new Date(+matched[1]); return; } configFromISO(config); if (config._isValid === false) { delete config._isValid; } else { return; } configFromRFC2822(config); if (config._isValid === false) { delete config._isValid; } else { return; } // Final attempt, use Input Fallback hooks.createFromInputFallback(config); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isoToDate(s) {\n if (s instanceof Date) { return s; }\n if (typeof s === 'string') { return new Date(s); }\n}", "function isoStringToDate(match){var date=new Date(0);var tzHour=0;var tzMin=0;// match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\nvar dateSett...
[ "0.69151974", "0.66991687", "0.6643978", "0.65537083", "0.65537083", "0.6520427", "0.6492825", "0.64871174", "0.6448661", "0.64316744", "0.64316744", "0.64103484", "0.64103484", "0.6407205", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "...
0.0
-1
date from string and format string
function configFromStringAndFormat(config) { // TODO: Move this to another part of the creation flow to prevent circular deps if (config._f === hooks.ISO_8601) { configFromISO(config); return; } if (config._f === hooks.RFC_2822) { configFromRFC2822(config); return; } config._a = []; getParsingFlags(config).empty = true; // This array is used to make a Date, either with `new Date` or `Date.UTC` var string = '' + config._i, i, parsedInput, tokens, token, skipped, stringLength = string.length, totalParsedInputLength = 0; tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; for (i = 0; i < tokens.length; i++) { token = tokens[i]; parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; // console.log('token', token, 'parsedInput', parsedInput, // 'regex', getParseRegexForToken(token, config)); if (parsedInput) { skipped = string.substr(0, string.indexOf(parsedInput)); if (skipped.length > 0) { getParsingFlags(config).unusedInput.push(skipped); } string = string.slice(string.indexOf(parsedInput) + parsedInput.length); totalParsedInputLength += parsedInput.length; } // don't parse if it's not a known token if (formatTokenFunctions[token]) { if (parsedInput) { getParsingFlags(config).empty = false; } else { getParsingFlags(config).unusedTokens.push(token); } addTimeToArrayFromToken(token, parsedInput, config); } else if (config._strict && !parsedInput) { getParsingFlags(config).unusedTokens.push(token); } } // add remaining unparsed input length to the string getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength; if (string.length > 0) { getParsingFlags(config).unusedInput.push(string); } // clear _12h flag if hour is <= 12 if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) { getParsingFlags(config).bigHour = undefined; } getParsingFlags(config).parsedDateParts = config._a.slice(0); getParsingFlags(config).meridiem = config._meridiem; // handle meridiem config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem); configFromArray(config); checkOverflow(config); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeDateFromStringAndFormat(string, format) {\n var datePartArray = [0, 0, 1, 0, 0, 0, 0],\n config = {\n tzh : 0, // timezone hour offset\n tzm : 0 // timezone minute offset\n },\n tokens = format.match(formattingTokens),\n ...
[ "0.7544057", "0.7378126", "0.71777546", "0.71777546", "0.71777546", "0.71777546", "0.71671367", "0.7163808", "0.7163808", "0.7163808", "0.7163808", "0.7163808", "0.71498096", "0.71486294", "0.71486294", "0.71486294", "0.70893186", "0.7086403", "0.70293576", "0.70293576", "0.7...
0.0
-1
date from string and array of format strings
function configFromStringAndArray(config) { var tempConfig, bestMoment, scoreToBeat, i, currentScore; if (config._f.length === 0) { getParsingFlags(config).invalidFormat = true; config._d = new Date(NaN); return; } for (i = 0; i < config._f.length; i++) { currentScore = 0; tempConfig = copyConfig({}, config); if (config._useUTC != null) { tempConfig._useUTC = config._useUTC; } tempConfig._f = config._f[i]; configFromStringAndFormat(tempConfig); if (!isValid(tempConfig)) { continue; } // if there is any input that was not parsed add a penalty for that format currentScore += getParsingFlags(tempConfig).charsLeftOver; //or tokens currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; getParsingFlags(tempConfig).score = currentScore; if (scoreToBeat == null || currentScore < scoreToBeat) { scoreToBeat = currentScore; bestMoment = tempConfig; } } extend(config, bestMoment || tempConfig); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeDateFromStringAndArray(string, formats) {\n var output,\n inputParts = string.match(parseMultipleFormatChunker) || [],\n formattedInputParts,\n scoreToBeat = 99,\n i,\n currentDate,\n currentScore;\n for (i = 0; i < format...
[ "0.6992324", "0.6912437", "0.6811143", "0.67375225", "0.67375225", "0.67375225", "0.67375225", "0.67375225", "0.67109895", "0.67109895", "0.67109895", "0.66975677", "0.65970886", "0.65863997", "0.65863997", "0.65736145", "0.65736145", "0.65736145", "0.65736145", "0.65736145", ...
0.0
-1
Pick a moment m from moments so that m[fn](other) is true for all other. This relies on the function fn to be transitive. moments should either be an array of moment objects or an array, whose first element is an array of moment objects.
function pickBy(fn, moments) { var res, i; if (moments.length === 1 && isArray(moments[0])) { moments = moments[0]; } if (!moments.length) { return createLocal(); } res = moments[0]; for (i = 1; i < moments.length; ++i) { if (!moments[i].isValid() || moments[i][fn](res)) { res = moments[i]; } } return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n ...
[ "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085"...
0.0
-1
TODO: Use [].sort instead?
function min () { var args = [].slice.call(arguments, 0); return pickBy('isBefore', args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sort() {\n\t}", "sort() {\n\t}", "function Sort() {}", "sort(){\n\n }", "function sortItems(arr) {\r\n return arr.sort();\r\n}", "function sort(theArray){\n\n}", "function arrangeElements( array ) {\r\n\tarray = array.sort();\r\n\treturn array;\r\n}", "function alfa (arr){\n\tfor (var i = 0; i<...
[ "0.76898605", "0.76898605", "0.7431569", "0.73816824", "0.722597", "0.70467216", "0.70034754", "0.698132", "0.69408303", "0.6881676", "0.6873754", "0.6873754", "0.683487", "0.6828153", "0.6822689", "0.68005455", "0.678884", "0.6772283", "0.6722359", "0.6710714", "0.6707308", ...
0.0
-1
Return a moment from input, that is local/utc/zone equivalent to model.
function cloneWithOffset(input, model) { var res, diff; if (model._isUTC) { res = model.clone(); diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf(); // Use low-level api, because this fn is low-level api. res._d.setTime(res._d.valueOf() + diff); hooks.updateOffset(res, false); return res; } else { return createLocal(input).local(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeAs(input, model) {\n\t return model._isUTC ? moment(input).zone(model._offset || 0) :\n\t moment(input).local();\n\t }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "funct...
[ "0.8500792", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.7952661", "0.79354805", ...
0.0
-1
MOMENTS keepLocalTime = true means only change the timezone, without affecting the local hour. So 5:31:26 +0300 [utcOffset(2, true)]> 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset +0200, so we adjust the time as needed, to be valid. Keeping the time actually adds/subtracts (one hour) from the actual represented time. That is why we call updateOffset a second time. In case it wants us to change the offset again _changeInProgress == true case, then we have to adjust, because there is no such time in the given timezone.
function getSetOffset (input, keepLocalTime, keepMinutes) { var offset = this._offset || 0, localAdjust; if (!this.isValid()) { return input != null ? this : NaN; } if (input != null) { if (typeof input === 'string') { input = offsetFromString(matchShortOffset, input); if (input === null) { return this; } } else if (Math.abs(input) < 16 && !keepMinutes) { input = input * 60; } if (!this._isUTC && keepLocalTime) { localAdjust = getDateOffset(this); } this._offset = input; this._isUTC = true; if (localAdjust != null) { this.add(localAdjust, 'm'); } if (offset !== input) { if (!keepLocalTime || this._changeInProgress) { addSubtract(this, createDuration(input - offset, 'm'), 1, false); } else if (!this._changeInProgress) { this._changeInProgress = true; hooks.updateOffset(this, true); this._changeInProgress = null; } } return this; } else { return this._isUTC ? offset : getDateOffset(this); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSetOffset(input,keepLocalTime){var offset=this._offset||0,localAdjust;if(!this.isValid()){return input!=null?this:NaN;}if(input!=null){if(typeof input==='string'){input=offsetFromString(matchShortOffset,input);}else if(Math.abs(input)<16){input=input*60;}if(!this._isUTC&&keepLocalTime){localAdjust=getD...
[ "0.66583717", "0.66583717", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", ...
0.0
-1
TODO: remove 'name' arg after deprecation is removed
function createAdder(direction, name) { return function (val, period) { var dur, tmp; //invert the arguments, but complain about it if (period !== null && !isNaN(+period)) { deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'); tmp = val; val = period; period = tmp; } val = typeof val === 'string' ? +val : val; dur = createDuration(val, period); addSubtract(this, dur, direction); return this; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setName(name) { }", "constructor(name) {\n super(name);\n this.name = name;\n }", "constructor(name) {\n this.name = name;\n }", "constructor(name) {\n this.name = name;\n }", "constructor(name) {\n this.name = name;\n }", "constructor(name) {\n this.name = name;\n }", "construct...
[ "0.67782986", "0.6759405", "0.67381084", "0.67381084", "0.67381084", "0.67381084", "0.6733258", "0.6733258", "0.67120683", "0.66484624", "0.6612438", "0.6540716", "0.65202653", "0.65195", "0.6489472", "0.6465985", "0.6462259", "0.6415414", "0.6381141", "0.6297654", "0.6276111...
0.0
-1
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same
function inspect () { if (!this.isValid()) { return 'moment.invalid(/* ' + this._i + ' */)'; } var func = 'moment'; var zone = ''; if (!this.isLocal()) { func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; zone = 'Z'; } var prefix = '[' + func + '("]'; var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY'; var datetime = '-MM-DD[T]HH:mm:ss.SSS'; var suffix = zone + '[")]'; return this.format(prefix + year + datetime + suffix); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inspect(){if(!this.isValid()){return'moment.invalid(/* '+this._i+' */)';}var func='moment';var zone='';if(!this.isLocal()){func=this.utcOffset()===0?'moment.utc':'moment.parseZone';zone='Z';}var prefix='['+func+'(\"]';var year=0<=this.year()&&this.year()<=9999?'YYYY':'YYYYYY';var datetime='-MM-DD[T]HH:mm:...
[ "0.7134383", "0.7134383", "0.71187127", "0.7092415", "0.70798695", "0.70798695", "0.70798695", "0.70798695", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595...
0.0
-1
If passed a locale key, it will set the locale for this instance. Otherwise, it will return the locale configuration variables for this instance.
function locale (key) { var newLocaleData; if (key === undefined) { return this._locale._abbr; } else { newLocaleData = getLocale(key); if (newLocaleData != null) { this._locale = newLocaleData; } return this; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function locale(key){var newLocaleData;if(key===undefined){return this._locale._abbr;}else{newLocaleData=getLocale(key);if(newLocaleData!=null){this._locale=newLocaleData;}return this;}}", "function locale(key){var newLocaleData;if(key===undefined){return this._locale._abbr;}else{newLocaleData=getLocale(key);if(...
[ "0.728698", "0.728698", "0.7233657", "0.7206724", "0.7206724", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0....
0.0
-1
() (5) (fmt, 5) (fmt) (true) (true, 5) (true, fmt, 5) (true, fmt)
function listWeekdaysImpl (localeSorted, format, index, field) { if (typeof localeSorted === 'boolean') { if (isNumber(format)) { index = format; format = undefined; } format = format || ''; } else { format = localeSorted; index = format; localeSorted = false; if (isNumber(format)) { index = format; format = undefined; } format = format || ''; } var locale = getLocale(), shift = localeSorted ? locale._week.dow : 0; if (index != null) { return get$1(format, (index + shift) % 7, field, 'day'); } var i; var out = []; for (i = 0; i < 7; i++) { out[i] = get$1(format, (i + shift) % 7, field, 'day'); } return out; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function foo5(a /* : number */, a2 /* : number */) /* : string => boolean => Foo */ {\n return s => b => ({\n moom: b,\n soup: s,\n nmb: a + a2 + 1\n })\n}", "function P$4(t){return t?[l$b(t[0]),l$b(t[1]),l$b(t[2]),l$b(t[3]),l$b(t[4]),l$b(t[5])]:[l$b(),l$b(),l$b(),l$b(),l$b(),l$b()]}", "funct...
[ "0.54531336", "0.54146004", "0.5401874", "0.5301911", "0.5250483", "0.5142086", "0.51317817", "0.50911343", "0.49964577", "0.49964246", "0.4973575", "0.49658364", "0.49169186", "0.4916026", "0.4910392", "0.49102533", "0.49102533", "0.49102533", "0.49102533", "0.49102533", "0....
0.0
-1
supports only 2.0style add(1, 's') or add(duration)
function add$1 (input, value) { return addSubtract$1(this, input, value, 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Duration(time) {\n var d = document.createElement('span');\n d.classList.add('duration');\n d.innerText = time;\n return d;\n}", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subt...
[ "0.6432664", "0.61080503", "0.61080503", "0.61080503", "0.61080503", "0.61080503", "0.61080503", "0.61080503", "0.61080503", "0.61080503", "0.61080503", "0.61080503", "0.61080503", "0.60846037", "0.6060423", "0.6014779", "0.6014779", "0.60114676", "0.5894277", "0.5894277", "0...
0.0
-1
supports only 2.0style subtract(1, 's') or subtract(duration)
function subtract$1 (input, value) { return addSubtract$1(this, input, value, -1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function durati...
[ "0.74000996", "0.74000996", "0.74000996", "0.74000996", "0.74000996", "0.74000996", "0.74000996", "0.74000996", "0.74000996", "0.74000996", "0.74000996", "0.74000996", "0.7380024", "0.7363161", "0.7363161", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", ...
0.0
-1
helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(vf=c)),vf._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(vf=c)),vf._abbr}", "function $a(a,b){var c;\n// moment.duration...
[ "0.6559981", "0.6559981", "0.6559981", "0.6559981", "0.6475563", "0.63821334", "0.63278216", "0.63278216", "0.63278216", "0.63278216", "0.63278216", "0.63278216", "0.63278216", "0.63278216", "0.63278216", "0.62139046", "0.612348", "0.612348", "0.6098201", "0.6098201", "0.6098...
0.0
-1
This function allows you to set the rounding function for relative time strings
function getSetRelativeTimeRounding (roundingFunction) { if (roundingFunction === undefined) { return round; } if (typeof(roundingFunction) === 'function') { round = roundingFunction; return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n ...
[ "0.7260021", "0.7238755", "0.7238755", "0.7238755", "0.7238755", "0.7238755", "0.7238755", "0.7238755", "0.70974416", "0.70974416", "0.70974416", "0.70974416", "0.70974416", "0.70974416", "0.70974416", "0.70974416", "0.70974416", "0.70974416", "0.70974416", "0.70974416", "0.7...
0.0
-1
This function allows you to set a threshold for relative time strings
function getSetRelativeTimeThreshold (threshold, limit) { if (thresholds[threshold] === undefined) { return false; } if (limit === undefined) { return thresholds[threshold]; } thresholds[threshold] = limit; if (threshold === 's') { thresholds.ss = limit - 1; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSetRelativeTimeThreshold (threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshol...
[ "0.6977598", "0.69336283", "0.6906506", "0.6906506", "0.6906506", "0.6906506", "0.6906506", "0.6906506", "0.6900698", "0.6900698", "0.6900698", "0.6900698", "0.6900698", "0.6900698", "0.6894468", "0.6885829", "0.6872021", "0.68407196", "0.68244886", "0.68244886", "0.68244886"...
0.0
-1
Pseudo code for demonstration purposes only.
async list({ page = 1, pageSize = 10, userId }) { const posts = await fetch(`https://jsonplaceholder.typicode.com/posts${userId ? `?userId=${userId}` : ''}`) .then(response => response.json()); const inRange = i => i < pageSize * page && i >= pageSize * page - pageSize; return { data: posts.filter((_, i) => inRange(i)), meta: { page, pageSize, pages: Math.ceil(posts.length / pageSize), total: posts.length, }, }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "static private internal function m121() {}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "step() { }", "async 'after sunbath' () {\n console.log( 'see? I appear here because of the first custom abov...
[ "0.6285859", "0.6075171", "0.60083896", "0.5838226", "0.5838226", "0.5838226", "0.5755638", "0.56398547", "0.56264746", "0.56264746", "0.56264746", "0.5563839", "0.55582327", "0.55336064", "0.55327356", "0.54672194", "0.54441786", "0.54238284", "0.54238284", "0.54238284", "0....
0.0
-1
Scoped outside of the function main code Create a function that calculates the perimeter of a rectangle
function calcPeri() { var width = 10; //Scoped to the function calcPeri console.log("Inside of the function the value of width is " + width); var height = 20; var perimeter = width*2 + height*2; console.log("Inside of function the perimeter is " + perimeter); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function perimeterrectangle(width, height) {\n console.log(2 * (5 + 8));\n}", "function recPerimeter(width, height) {\nreturn(width*height + \" is the perimeter of this rectangle.\");\n}", "function perimeterRec(w,h){\n //perimiter = 2*width+height\n var p =2*w + 2*h;\n return p;\n\n}", "function c...
[ "0.7927504", "0.77272373", "0.7715633", "0.76928955", "0.76766694", "0.7626446", "0.76262635", "0.7444603", "0.73960435", "0.7387288", "0.73542076", "0.7335779", "0.73195326", "0.7289485", "0.7232488", "0.7181726", "0.7180677", "0.71612847", "0.705846", "0.7031909", "0.703061...
0.7263793
14
three below functions are connected to buttons: small, medium, large
function resizeSmall (rows, columns) { container.style.gridTemplateRows = `repeat(${rows}, 25px`; container.style.gridTemplateColumns = `repeat(${columns}, 25px`; console.log(cSize); for(var i = 0; i < totalCells; i++) { var cell = document.createElement('div'); container.appendChild(cell).className = 'item'; console.log('Test1'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getButtonSize(isDesktop){\n if(isDesktop){\n return \"large\"\n }\n else{\n return \"small\"\n }\n }", "function WidthChangeSmall(mqsmall) {\n if (mqsmall.matches) {\n buttonsFieldRemoveBindings();\n buttonsFieldAssignSmall();\n midLayout();\n adaptSmallScree...
[ "0.67416584", "0.6682934", "0.656902", "0.6505533", "0.63801485", "0.6345863", "0.63231", "0.63231", "0.63057667", "0.6264855", "0.6252861", "0.6222661", "0.61947155", "0.61727214", "0.6169727", "0.61290115", "0.6122657", "0.6086204", "0.60833025", "0.60581416", "0.60555", ...
0.0
-1
This function resets the number of hearts and bread slices there are at the beginning of the game. It automatically sets each to 5 (full health/hunger).
function onloadhandler() { document.getElementById("heart1").hidden = false; document.getElementById("heart2").hidden = false; document.getElementById("heart3").hidden = false; document.getElementById("heart4").hidden = false; document.getElementById("heart5").hidden = false; document.getElementById("bread1").hidden = false; document.getElementById("bread2").hidden = false; document.getElementById("bread3").hidden =false; document.getElementById("bread4").hidden = true; document.getElementById("bread5").hidden = true; document.getElementById("pocketknife").hidden = true; document.getElementById("sword1").hidden = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetFruitTally() {\n grapes = 0;\n watermalon = 0;\n oranges = 0;\n cherries = 0;\n crown = 0;\n seven = 0;\n dollor = 0;\n blank = 0;\n}", "function resetFruitTally() {\n grapes = 0;\n bananas = 0;\n oranges = 0;\n cherries = 0;\n bars = 0;\n bells = 0;\n s...
[ "0.70941234", "0.70399004", "0.70399004", "0.7018411", "0.69952816", "0.6873096", "0.68539196", "0.68431634", "0.67876583", "0.674339", "0.6636134", "0.6634603", "0.66241455", "0.6594799", "0.6588156", "0.658633", "0.6575699", "0.6572473", "0.6531252", "0.6519453", "0.6487055...
0.0
-1
This function controls the global variable for health. Throughout the game, we can set the health and the hearts will disappear.
function displayHearts() { document.getElementById("heart5").hidden = false; document.getElementById("heart4").hidden = false; document.getElementById("heart3").hidden = false; document.getElementById("heart2").hidden = false; document.getElementById("heart1").hidden = false; if( health === 4) { document.getElementById("heart5").hidden = true; } if( health === 3) { document.getElementById("heart5").hidden = true; document.getElementById("heart4").hidden = true; } if( health === 2) { document.getElementById("heart5").hidden = true; document.getElementById("heart4").hidden = true; document.getElementById("heart3").hidden = true; } if( health === 1) { document.getElementById("heart5").hidden = true; document.getElementById("heart4").hidden = true; document.getElementById("heart3").hidden = true; document.getElementById("heart2").hidden = true; } if( health === 0) { document.getElementById("heart5").hidden = true; document.getElementById("heart4").hidden = true; document.getElementById("heart3").hidden = true; document.getElementById("heart2").hidden = true; document.getElementById("heart1").hidden = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "humanHealth() {\n if ( this.humanHealth < 0 ) {\n this.humanHealth = 0;\n alert( 'You Lost!' );\n this.gameStarted = false;\n } else if ( this.humanHealth > 100 ) {\n this.humanHealth = 100;\n }\n }", "loseHealth() {\n this.health--;\n this.tint = 0xff0...
[ "0.7733549", "0.7381738", "0.73797417", "0.7197034", "0.71393603", "0.7122758", "0.71154654", "0.7089154", "0.7088735", "0.70698965", "0.7054828", "0.7046016", "0.7043073", "0.70301557", "0.6978089", "0.69637847", "0.69288003", "0.6914784", "0.6894672", "0.6867419", "0.686393...
0.6222529
94
This function controls the global variable for hunger. Throughout the game, we can set the hunger and the slices of bread will disappear.
function displayBreads() { document.getElementById("bread5").hidden = false; document.getElementById("bread4").hidden = false; document.getElementById("bread3").hidden = false; document.getElementById("bread2").hidden = false; document.getElementById("bread1").hidden = false; if( hunger === 4) { document.getElementById("bread5").hidden = true; } if( hunger === 3) { document.getElementById("bread5").hidden = true; document.getElementById("bread4").hidden = true; } if( hunger === 2) { document.getElementById("bread5").hidden = true; document.getElementById("bread4").hidden = true; document.getElementById("bread3").hidden = true; } if( hunger === 1) { document.getElementById("bread5").hidden = true; document.getElementById("bread4").hidden = true; document.getElementById("bread3").hidden = true; document.getElementById("bread2").hidden = true; } if( hunger === 0) { document.getElementById("bread5").hidden = true; document.getElementById("bread4").hidden = true; document.getElementById("bread3").hidden = true; document.getElementById("bread2").hidden = true; document.getElementById("bread1").hidden = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hungerDrain () {\r\n if (hungerBar.w > 0) {\r\n hungerBar.w -= hungerBar.speed;\r\n } else if (hungerBar.w <= 0) {\r\n stopGame();\r\n }\r\n}", "function HLdown(){\n console.log(\"In hair l arrow clicked\");\n hair.destroy();\n hairindex--;\n if(hairindex<=0)\n {\n ...
[ "0.6264154", "0.6066547", "0.5992308", "0.5913272", "0.5897634", "0.5886988", "0.5807684", "0.5765865", "0.5705917", "0.56791675", "0.5676864", "0.5664624", "0.56344634", "0.5626992", "0.56182355", "0.5616587", "0.5611646", "0.558643", "0.5585921", "0.5577688", "0.5549681", ...
0.57011956
9
The story variable determines where the text will appear. In this case, that is the "story" div. The "btn" variables define the buttons in the game. For the majority of the storyline, only "btn1" and "btn2" are used. "btn3" and "btn4" are used for the enddefining choice.
function displayStory(choice) { var story = ""; var btn1 = ""; var btn2 = ""; var btn3 = ""; var btn4 = ""; switch(choice) { //The case "beginning" is used at the end of the game, when the player fails and must return to the start. (or when the GAME OVER alert comes up.) //Bread or Sword - This choice is arguably one of the most important in the game. It starts you off and affects your fate early in the game. case "beginning": case "bread/sword": story = "You wake up in a dark, dreary cave. You have no memory of your previous life, and the only thing in your mind is the echo of water dripping from the ceiling. You grab a backpack that sits in front of you on the cave floor. You have a pocket knife, some rope, dried fruit that won't last long, a water bottle half-full, and a jagged rock. You see two things in the cave: A sword and a package of bread. Which do you take? Only one will fit in your backpack."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('bread')"); btn1.innerHTML = ("Continue your journey..."); break; //This is the very first goal of the game. It informs the player what their current task is. alert("GOAL 001: Escape_cave"); //This is the very first checkpoint of the game. Its purpose is to return the player back to a certain point in the game when they die. This keeps them entertained, and they will not return to the beginning every time they die. case "Checkpoint1": //Whether the player chooses bread or sword, they will progress to the same choices. However, whether they chose to keep the bread or the sword will affect their fate later on. case "bread": case "sword": health = 5; displayHearts(); story = "You notice a long hallway leading out of the cave. When you reach the end of the hallway, you are met with two doors. One is bright green and earthy, surrounded by vines. A cool breeze wafts from the crack beneath it. The other is black as coal, and is strangled with dried, withering tree branches. Intense heat flames from it. Which door will you choose?"; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('door1')"); btn1.innerHTML = "Door 1"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('door2')"); btn2.innerHTML = "Door 2"; if(bread === true) { document.getElementById("bread3").hidden = false; document.getElementById("bread4").hidden = false; document.getElementById("bread5").hidden = false; } else { document.getElementById("sword1").hidden = false; } //image = ""; break; //door 1 - the first door, and whether the user chose bread or sword will affect which choices come up and how the NPCs (non-player characters) react to them. //The if statement determines which choices the player is given. Certain choices WILL lead to death. case "door1": if (bread) { story = "You turn the mahogany handle of the door. You emerge on a hill surrounded by rolling fields. Down the hill, peasants drenched in sweat and dressed in faded rags labor away, picking some kind of pale blue cotton. Cruel-faced supervisors pace behind them, watching their work and carrying sharp-looking batons. You walk down the hill, hoping that your own tattered clothes will blend in with theirs. You come to an area where no supervisors seem to be watching. You chose the BREAD. The people have hunger-hollowed cheeks, so you give them some of your bread. They immediately trust you, and allow you to work beside them and hide yourself. The few people near you now trust you, and they decide to help conceal you. The supervisor arrives to monitor your laboring progress and begins taunting those beside you. Will you stand up to the supervisor or make friends with him?"; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('makeFriends')"); btn1.innerHTML = "Make friends"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('standUpToSupervisor')"); btn2.innerHTML = "Stand up to the supervisor"; //image = ""; } if(sword) { story = "You turn the mahogany handle of the door. You emerge on a hill surrounded by rolling fields. Down the hill, peasants drenched in sweat and dressed in faded rags labor away, picking some kind of pale blue cotton. Cruel-faced supervisors pace behind them, watching their work and carrying sharp-looking batons. You walk down the hill, hoping that your own tattered clothes will blend in with theirs. You come to an area where no supervisors seem to be watching. You chose the SWORD. The people are alarmed by the glinting blade hidden under your shirt. You assure them that you will do nothing but protect them. The few people near you now trust you, and they decide to help conceal you. The supervisor arrives to monitor your laboring progress and begins taunting those beside you. Will you stand up to the supervisor or keep your head down and continue working?"; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('keepHeadDown')"); btn1.innerHTML = "Keep Head Down"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('standUp')"); btn2.innerHTML = "Stand up to the supervisor"; //image = ""; } break; //(bread) stand up/make friends - This is a minor choice, meaning it will either lead to death or the continue button. case "makeFriends": story = "You crack a funny joke at the supervisor. He looks at you blankly for a moment, but then his dark bearded face stretches into a smile. He pats your back and tells you that he will help you, sending you to a building in the distance. You find a knife on the ground and carefully pick it up."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('continue')"); btn1.innerHTML = "Continue..."; alert("ACHIEVEMENT 001: Clever move. Keep making friends like this and you'll escape soon enough."); document.getElementById("pocketknife").hidden = false; break; //ACHIEVEMENT: BUILDING //This is the first "death oppurtunity" in the game. It is also the reason why we placed checkpoints throughout the code. If the player chooses to stand up to the supervisor, they will die and be given the option to return to the last checkpoint. case "standUpToSupervisor": story = "The taunts that the supervisor shoots at the laborers anger you. You stand up and he narrows his eyes at you. For a brief moment, you glare at each other. Suddenly, all you can see is the glint of his sword in the sunlight and then....darkness. sorry, you're DEAD!"; health = 0; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint1')"); btn1.innerHTML = "Try again from the last CHECKPOINT"; break; //RETURN TO CHECKPOINT// //(sword) standUp/keep head down - another minor choice. case "keepHeadDown": story = "Though you stay well hidden among the group of laborers, you notice the supervisor is eyeing you strangely. You realize that he sees the sword hidden in your belt. You look back at him, hoping he will do nothing. Suddenly, he nocks an arrow in the bow on his back. Before you can react, he has released the bowstring. Sorry, you're DEAD!"; health = 0; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint1')"); btn1.innerHTML = "Try again from the last CHECKPOINT"; break; //RETURN TO CHECKPOINT case "standUp": story = "The taunts that the supervisor shoots at the laborers anger you. You stand up and he narrows his eyes at you. The supervisor flings his knife at you in anger. Quickly thinking, you dart to the side and catch it. You run to a building in the distance, and foolishly promise to come back for the other workers."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('continue')"); btn1.innerHTML = "Continue..."; alert("ACHIEVEMENT 001: Your reflexes will save you. But don't make promises you can't keep!"); document.getElementById("pocketknife").hidden = false; break; //Door 2 - the second door, and whether the user chose bread or sword will affect which choices come up and how the NPCs (non-player characters) react to them. case "door2": //door 2 (bread) if( bread ) { story ="You use the end of your shirt to turn the knob, as it is too hot. You enter a dark forest of fire-blackened trees. The sky is so full of smog that it has a grayish tinge and it is impossible to tell whether it is day or night. The only light in the vicinity comes from the dim glow of flames licking at the trees. The faint howling of wolves can be heard in the distance, miles away. After a moment you realize the howls are getting louder and louder. Suddenly, a gray blur leaps out of the shadowy trees. Several more gray blurs follow it. You try to feed the bread to the wolves but your are in vain. The wolves lunge and pin you to the ground. The last thing you hear before the darkness consumes you is their howls. Sorry, you're DEAD!"; health = 0; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint1')"); btn1.innerHTML = "Try again from the last CHECKPOINT"; } //door 2 (sword) else if (sword) { story ="You use the end of your shirt to turn the knob, as it is too hot. You enter a dark forest of fire-blackened trees. The sky is so full of smog that it has a grayish tinge and it is impossible to tell whether it is day or night. The only light in the vicinity comes from the dim glow of flames licking at the trees. The faint howling of wolves can be heard in the distance, miles away. After a moment you realize the howls are getting louder and louder. Suddenly, a gray blur leaps out of the shadowy trees. Several more gray blurs follow it."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('runForDoor/climbTree')"); btn1.innerHTML = "Face the wolves"; } break; case "runForDoor/climbTree": story = "Since you chose the SWORD, you are able to fend off the wolves. However, there are too many of them. You desperately sprint off into the trees and see two options. You can either run for a rusty door covered in ivy, or climb a tree. You grab a rusty knife off the forest floor for additional protection."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('climbTree')"); btn1.innerHTML = "Climb the tree"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('runForDoor')"); btn2.innerHTML = "Run for the door"; document.getElementById("pocketknife").hidden = true; break; case "climbTree": story = "You attempt to scramble up the tree, and feel the wolves' hot breath on your heels. You grab at a branch, but it breaks in your hand. You fall to the ground and are winded as your back crashes into the leaves. The wolves growl and pounce at you. Sorry, you're DEAD!"; health = 0; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint1')"); btn1.innerHTML = "Try again from the last CHECKPOINT"; break; case "runForDoor": story = "You sprint towards the door as fast as your feet can go and manage to lever the door open with your sword. You quickly close the door behind you and barely escape the razor sharp teeth of the wild-eyed wolves. You are now in a dark, empty-halled building."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('continue')"); btn1.innerHTML = "Continue..."; alert("ACHIEVEMENT 001: You're fast... but are you smart enough to make it out alive?"); break; alert("ACHIEVEMENT 002: So close, yet so far! You made it to the building!"); //All of the choices branch back to the building to make coding easier. Now, the player's destination is whatever lies beyond the building. //The next defining choice determines who the player's companion will be. This choice will greatly affect the next storyline and the user's fate. alert("GOAL 002: Escape_building"); case "Checkpoint2": case "continue": hunger = 5; displayBreads(); story = "As you sneak through the building, wondering if it is inhabited, you hear a chorus of thousands of footsteps. You begin to run, and come to a supply room with an opened door. You go inside and there is an exit on either side of you. A figure runs in from each side. One is a violet-eyed girl with a long sheet of dark hair. The other is a confident-looking, brown-haired youth. Both yell for you to come with them if you want to live. Who will be your companion? Choose wisely."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Alec')"); btn1.innerHTML = "The brown haired warrior"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('Violet')"); btn2.innerHTML = "The violet eyed girl"; break; alert("GOAL 003: Cooperate_to_Escape"); //The next checkpoint. Its purpose is to return the player back to the beginning of the Alec branch, so that they do not have to make the companion choice again. case "Checkpoint3": case "Alec": health = 5; displayHearts(); story="You run towards the brown haired boy, happy to be heading away from the increasingly loud footsteps. He introduces himself as Alec, and drags you to a door that you never would have noticed if you were on your own. it was a wise decision to choose him. As you slide through the door, you realize that the footsteps have become quieter. Alec stumbles over a pipe. As you help him up, you hear a large crash nearby. Do you choose to run after Alec, or do you you knock him out and leave him behind for whatever caused the sound?"; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('runTogether')"); btn1.innerHTML = "Run after Alec"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('knockHimOut')"); btn2.innerHTML = "Knock Alec out"; break; case "knockHimOut": story="You slyly grab a broken piece of pipe from the ground and forcefully strike Alec in a swift blow to the head. He crumples to the ground and you make a dash for the closest out of the three doors in the room. As you turn to see if you are being followed, you trip backwards and realize you are falling through the air. Suddenly you hit something hot and the burning liquid you land in sears your skin before engulfing you. Sorry, you're DEAD!"; health = 0; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint3')"); btn1.innerHTML = "Try again from the last checkpoint"; break; case "runTogether": story="You follow Alec through a maze of doorways and thank him when he grabs your arm to stop you from falling into a vat of boiling oil. You run for what seems like hours, and finally slow to a walk. It seems as though there is no way to escape the building. You hear a low, raspy voice say 'The Silver Arrow is near. Once it is found, we will at last have a purpose.' It is a man wearing a black hood speaking to another short man with scars covering his bald head. He appears to have a weapon. Do you stay to fight him, or do you hide?"; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('fightHood')"); btn1.innerHTML = "Fight"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('hideFromHood')"); btn2.innerHTML = "Hide"; break; case "fightHood": story="You and Alec circle around the figure. Suddenly, you feel an invisible force pressing on your neck. In a few minutes, your vision fades to black. Sorry, you're DEAD!"; health = 0; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint3')"); btn1.innerHTML = "Try again from the last checkpoint"; break; //A new checkpoint makes sure that you won't be pulled all the way back to the beginning of the Alec storyline. case "Checkpoint4": health = 5; displayHearts(); hunger = 3; displayBreads(); case "hideFromHood": story = "You dive behind a thick pipe, and Alec follows quickly. The figure begins to whisper excitedly about someting and you feel compelled to stay hidden and listen in on the conversation. You learn about a mysterious phenomenon called the Silver Arrow and when the figures retreaat into the darkness, you question Alec about this discovery."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('threatenAlec')"); btn1.innerHTML = "Threaten Alec"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('convinceAlec')"); btn2.innerHTML = "Convince Alec"; break; case "threatenAlec": story = "You grab a knife from your belt and raise it threateningly. You demand that he explain about the silver arrow, but he sighs and relents."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint5')"); btn1.innerHTML = "Acquire Information"; // ACHIEVEMENT KNOWLEDGE ACQUIRED break; case "convinceAlec": story = "You compel Alec to tell you about the Silver Arrow by bringing out your persuasive skills. You say, 'I deserve to know what's going on.' He stares at you for a while and then gives in."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint5')"); btn1.innerHTML = "Acquire Information"; break; case "Violet": story = "The brown-haired boy flees from the room as the sound of footsteps gets louder. The girl cocks her head at you and says, 'Nice choice. I'm Violet.' She motions for you to follow her and goes into a room off to the side. As you hear low, raspy voices, Violet pushes you to the ground, knocking the wind out of you. She flattens you against the cool floor. Do you stay still and trust her or fight back in fear that you chose the wrong companion? "; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('stayStill')"); btn1.innerHTML = "Stay still"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('fightBack')"); btn2.innerHTML = "Fight Back"; break; case "fightBack": story = "You struggle, kicking and screaming. You pull yourself away and run out into the hallway. There, a squadron of soldiers awaits you. Sorry, you're DEAD."; health = 0; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint2')"); btn1.innerHTML = "Try again from the last checkpoint"; break; case "stayStill": story = "You keep yourself still and try not to breathe. Violet is deadly silent, her eyes squeezed tightly shut. Once the thunderous footsteps and voices fade, Violet sighs. 'Thanks for trusting me. You would've died otherwise.'"; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('setUpCamp')"); btn1.innerHTML = "Set up camp"; break; case "setUpCamp": hunger = 3; displayBreads(); story = "You and Violet follow a maze of hallways before stopping at a small corner isolated from the rest of the building. She opens her backpack and shares some of her supplies with you. Suddenly, you hear the sound of footsteps drawing near. Violet wraps her hand against your mouth to muffle your surprise. The footsteps stop closeby and the voices seem to be whispering about a mysterious object called the silver arrow. 'It is almost time. The silver arrow is near and once we have aqquired it, we will have a purpose at last.' The footsteps recede and you look at Violet questioningly. She sighs, looks at the ground. "; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint5')"); btn1.innerHTML = "Acquire Information"; break; case "Checkpoint5": health = 5; displayHearts(); story = "'It's time I told you what I know'. What do you want to know first?"; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('howDidIGetHere')"); btn1.innerHTML = "How did I get here?"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('whatIsTheSilverArrow')"); btn2.innerHTML = "What is the Silver Arrow?"; break; case "howDidIGetHere": story = "'Your companion starts to explain. 'So this is basically a realm created by the leaders of a prominent buisness empire. It's pretty much a compilation of virtual reality and the perception of people in the real world. You probably came here after a queer business seminar like all of the other people in this world. Moral of the story: Don't drink the Kool-Aid. As for the Silver Arrow, It's more of a phenomenon than a tangible object. It's rumored to be some kind of EMP that fries the technology imprisoning your brain. We need it to get out of here. We should rest so we have a better chance of finding it.' "; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('rest')"); btn1.innerHTML = "Rest and prepare for the journey to come"; break; case "whatIsTheSilverArrow": story = "'It's more of a phenomenon than a tangible object. Its rumored to be some kind of EMP that fries the technology imprisoning your brain. We need it to get out of here. We should rest so we have a better chance of finding it. And as for how you got here, this is basically a realm created by the leaders of a promindent buisness empire. It's pretty mcuh a compilation of virtual reality and the perception of people in the real world. You probably came here after a queer business seminar like all of the other people in this world. Moral of the story: Don't drink the Kool-Aid.' "; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('rest')"); btn1.innerHTML = "Rest and prepare for the journey to come"; break; alert("GOAL: Find_Silver_Arrow") case "rest": displayHearts(); story = "You and you're companion rest in your secluded corner, discussing your game plan for the next day. You feel confident about the plan, but forget about that as the darkness of sleep envelops you."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('continueAgain')"); btn1.innerHTML = "Continue"; break; case "Checkpoint6": case "continueAgain": health = 5; displayHearts(); story = "You wake up to the sound of your companion rifling through your supplies for the day. You start to pack as well, and decide that you will be heading out in a few moments. As you leave the building you are faced with a broken wooden fence and a white picket fence. Which will you choose?"; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('brokenFence')"); btn1.innerHTML = "Broken Fence"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('whitePicketFence')"); btn2.innerHTML = "White Picket Fence"; break; case "brokenFence": story = "You hop the fence lithely and with ease. Your companion is loaded with heavy bags and impales their leg on a splintered plank of wood. You stare at the wound in horror. Suddenly you see a strange glow at the edge of a cliff nearby. You grab your companion around the shoulders and make your way to the cliff."; health = 4; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('keepSearching')"); btn1.innerHTML = "Go to edge of the cliff"; break; case "whitePicketFence": story = "You unlatch the gate of the fence and continue on your way. You head towards the dark forest ahead and arrive at a clearing. On your right, a startlingly blue baby bird hops down a dirt path. On your left, a trail of lush plant life leads off into the trees. Which way do you go?"; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('babyBird')"); btn1.innerHTML = "Right, after the baby bird"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('plantLife')"); btn2.innerHTML = "Left, towards the plants"; break; case "babyBird": story = "You follow the baby bird into a more humid part of the forest, where brightly colored birds flock in the trees. A very large red bird locks its beady eyes on you. Suddenly, a whirlwind of birds attacks you. There is nothing you and your companion can do as you are overrun. You're DEAD. Try again from the last checkpoint. "; health = 0; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint6')"); btn1.innerHTML = "Return to last CHECKPOINT"; break; case"plantLife": story = "You follow the trail of abundant plant life. It leads you to a cheerfully bubbling spring of water. You and your companion sit down to replenish your supplies. Do you continue to sit and rest or keep looking for the cliff on which the Silver Arrow is rumored to be located? "; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('sitRest')"); btn1.innerHTML = "Sit and rest"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('keepSearching')"); btn2.innerHTML = "Keep searching"; break; case "sitRest": hunger = 5; displayBreads(); story = "You and your companion blissfully relax at the edge of the pond into which the spring empties. Suddenly, you hear growls from the leafy foliage. A pack of furry creatures leaps out of the trees. There is no time to see what they are. Do you run away from them, or stay and fight?"; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('runFromFuzzies')"); btn1.innerHTML = "Run from the creatures"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('fightFuzzies')"); btn2.innerHTML = "Fight the creatures"; break; case "runFromFuzzies": story = "You and your companion attempt to run from the furry creatures, but one of them drops out of a tree, right on to you. Sorry, you're DEAD. Try again from the last CHECKPOINT."; health = 0; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint6')"); btn1.innerHTML = "Return to last CHECKPOINT"; break; case "fightFuzzies": story = "You and your companion draw your weapons, attempting to fight off the beasts. However, your companion is severely injured, while you have a large gash on your forehead. You grab onto a vine and snatch your partner with your other hand."; hunger = 3; displayBreads(); health = 2; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('keepSearching')"); btn1.innerHTML = "Continue to the cliff"; break; case "Checkpoint7": case "keepSearching": story = "You arrive at the cliff, where the Silver Arrow hovers over the ravine below. Your companion's health has deteriorated immensely. You are on your own."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('continue3')"); btn1.innerHTML = "Continue"; break; //This is where the other two buttons come in. Only one choice will leave the player alive. The other three will either send up a GAME OVER alert or start the player back at the beginning. case "continue3": story = "You tell your companion to wait on the ground. You scan your surroundings, searching for something to swing yourself high enough to reach the Silver Arrow. You find a tree branch extending over the edge, steady enough to lasso a rope around and hold your weight. It takes a few tries to loop your rope around it, but you manage to make it into a sturdy fork in the tree trunk. You realize that your companion is groaning in pain and has rolled over to the edge of the cliff. Do you attempt to lean over and grab the Silver Arrow, lasso it, help your friend and come back for the Silver Arrow, or run away and search for another way out? You consider that running away may be the smartest decision, but are not entirely sure. What will you decide? "; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('grabArrow')"); btn1.innerHTML = "Grab the Arrow"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('lassoArrow')"); btn2.innerHTML = "Lasso the Arrow"; btn3 = document.createElement("BUTTON"); btn3.setAttribute("onClick", "displayStory('helpFriend')"); btn3.innerHTML = "Help your friend"; btn4 = document.createElement("BUTTON"); btn4.setAttribute("onClick", "displayStory('runAway')"); btn4.innerHTML = "Look for other escape options"; break; //This choice sends up the GAME OVER alert. case "grabArrow": story = "You lean over to grab the Silver Arrow, but a burning sensation rips through your body. You now realize that it is a plasma shield. You are DEAD. GAME OVER! Try again from the beginning when you are ready. "; health = 0; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('gameOver')"); btn1.innerHTML = "GAME OVER"; break; //This choice sends up the GAME OVER alert. case "lassoArrow": story = "You attempt to lasso the arrow with your rope. You are genuinely surprised when the arrow is neatly surrounded by your rope. You pull it up and reach out to touch the Silver Arrow. Suddenly, your head is filled with a blinding pain. Sorry, the EMP fried your brain. GAME OVER! Try again from the beginning when you are ready. "; health = 0; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('gameOver')"); btn1.innerHTML = "GAME OVER"; break; //This choice leads to the player winning the game. case "helpFriend": story = "You shake your head at the Silver Arrow and drop back down to the ground next to your companion. As soon as you reach out to touch their arm, a swirl surrounds you and you return to an appartment in New York City. All your memories are returned and you are glad to be back where you belong. Congratulations! YOU WIN!"; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('youWin')"); btn1.innerHTML = "YOU WIN"; break; //This choice starts the character back at the beginning of the game. case "runAway": health = 5; displayHearts(); hunger = 5; displayBreads(); story = "You drop down to the ground and run past your injured companion. You head straight for the trees, but a swirl of darkness surrounds you. When you open your eyes, your worst nightmare has come true. You are back in the cave where you started."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('beginning')"); btn1.innerHTML = "Return to the cave"; break; //This case sends out a GAME OVER alert. case "gameOver": alert("Sorry, you chose wrong. You will have to be wiser next time."); break; //This case sends out a YOU WIN alert. case"youWin": alert("Fantastic job! You won! You were honest, brave, and compassionate. You will make a great warrior someday."); break; } // end switch // change content on page document.getElementById("story").innerHTML = story; var buttons = document.getElementById("buttons"); while (buttons.firstChild) { buttons.removeChild(buttons.firstChild); } document.getElementById("buttons").appendChild(btn1); document.getElementById("buttons").appendChild(btn2); document.getElementById("buttons").appendChild(btn3); document.getElementById("buttons").appendChild(btn4); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createStory() {\n // In this example you need to initialise these in reverse order, so that\n // when you assign a target it already exists. I.e., start at the end!\n lunarEnd4B = new StorySection(\n \"The Escavator explodes, falling backwards into one of the many craters of the moon. It was a brief...
[ "0.67953455", "0.67123556", "0.66923004", "0.65786326", "0.65327525", "0.63282275", "0.6197285", "0.6194669", "0.61112314", "0.5984539", "0.5967992", "0.5955947", "0.5896802", "0.5857841", "0.5819762", "0.5806267", "0.5752977", "0.57322645", "0.56742704", "0.5658183", "0.5645...
0.7388394
0
Event CALLBACK ; called on menu Click
onshowHideMenu(menuContainer, element, ev) { this.logger.warn('onshowHideMenu using @', element); const rectV = this.video.getBoundingClientRect(); const rect = element.getBoundingClientRect(); if (menuContainer.classList.contains('fj-hide')) { this.logger.warn('setting left @', (rect.right - ev.pageX)); this.logger.warn('setting left @', (rect.left - ev.pageX)); menuContainer.style.left = ev.pageX - rectV.left - rect.width; menuContainer.classList.remove('fj-hide'); } else { menuContainer.classList.add('fj-hide'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "menuButtonClicked() {}", "function ips_menu_events()\n{\n}", "function onOpen() {\n createMenu();\n}", "function OnClicked(param: String)\r\t{\r\t\tif (!ShowMenu(param, true))\r\t\t{\r\t\t\tgameObject.SendMessage(param, SendMessageOptions.DontRequireReceiver);\r\t\t\tShowMenu(\"\", false);\r\t\t\tActivateMe...
[ "0.7742164", "0.76287085", "0.7162202", "0.6919832", "0.689633", "0.6857095", "0.683963", "0.68111545", "0.6804773", "0.6801286", "0.67989427", "0.677226", "0.67076373", "0.6678382", "0.6666025", "0.6638033", "0.6581996", "0.6581729", "0.6569902", "0.6528707", "0.6526812", ...
0.0
-1
Used to Hide menu
HideMenus() { this.HideMenuSubs(); this.HideMenusAuds(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hideMenu()\n{\n\t\t\n\t\t//set a timeout and then kill all the menu's\n\t\t//we will check in menuHandler() to see if some stay lit.\n\t\tmenuTimeout= setTimeout(\"killMenu('all');\",800);\n\t\t\n\t\tflagMenuSwitch=\"off\";\n\t\t\n}//end hideMenu() function", "function hideMenu($this){\n $this.css(...
[ "0.81721485", "0.79180944", "0.7890523", "0.78867286", "0.77528787", "0.76835996", "0.763952", "0.76345354", "0.7621206", "0.7535662", "0.75270855", "0.74567723", "0.74488103", "0.74456435", "0.7412652", "0.73228407", "0.731964", "0.7313505", "0.7298508", "0.72896236", "0.728...
0.8137771
1
Setting Auds menu and cbx
SetupAuds(playerMedia) { this.logger.info('Calling for setup Auds !!!'); let audsBtn = null; let i = 0; let item = null; this.mediaPlayer = playerMedia; const audioTracks = this.mediaPlayer.getAudioLanguages(); this.audsExist = false; this.logger.info(' Trying to setup menu Auds , text tracks length : ', audioTracks); // check if exist if ((!audioTracks) || (audioTracks.length <= 1)) { this.audsExist = false; this.logger.log(' Audio Menu not created !'); return false; } // Setting inner of btn div audsBtn = document.getElementById(this.audsBtnId); this.logger.info('Setting the btn ', audsBtn, ' from id ', this.audsBtnId); // this.video array this.audsList = document.getElementById(this.audsMenuListId); // clear old if (this.audsList !== null) { while (this.audsList.firstChild) { this.audsList.removeChild(this.audsList.firstChild); } } else { this.audsMenuDiv = document.createElement('div'); this.audsMenuDiv.classList.add('settingMenuDiv'); this.audsMenuDiv.classList.add('fj-hide'); this.audsMenuDiv.innerHTML = `${'<div class="fj-list-title"> Audios </div> ' + '<ul class="fj-list" id="'}${this.audsMenuListId}" >` + '</ul>'; this.menusDiv.appendChild(this.audsMenuDiv); // Add events for audios button audsBtn.addEventListener('click', (ev) => { this.onshowHideMenu(this.audsMenuDiv, this, ev); }); // audios list this.audsList = document.getElementById(this.audsMenuListId); } for (i = 0; i < audioTracks.length; i += 1) { item = document.createElement('li'); if (this.mediaPlayer.isAudioLangEnabled(i) === true) { item.classList.add('subtitles-menu-item-actif'); } else { item.classList.add('subtitles-menu-item'); } item.setAttribute('index', i); item.innerHTML = this.mediaPlayer.getAudioLangLabel(i); this.audsList.appendChild(item); item.addEventListener('click', () => { this.activate(this, false); }); } this.logger.debug(' Audio Menu created !', audioTracks.length, '! ', this.audsList); return this.audsExist; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "domListener(){\n this.menuDisplay([\"file\",\"rotate\",\"brush\",\"outline\",\"fills\",\"size\"]);\n }", "function SetSkin(skn : GUISkin)\r\t{\r\t\tmenuSkin = skn;\r\t}", "function showMenu() {\r\n togMenu=true;\r\n togSet=false;\r\n ctx.fillStyle = \"black\";\r\n ctx.globalAlpha = 0.9; \...
[ "0.6267899", "0.6078762", "0.5981175", "0.59540915", "0.59386784", "0.5938602", "0.5918045", "0.5909882", "0.58985406", "0.58672947", "0.5791357", "0.5786228", "0.5741798", "0.5723836", "0.5716758", "0.5712814", "0.5691221", "0.5688368", "0.56815803", "0.56610215", "0.5654246...
0.5636266
22
copies over the results into one of our own objects
function copyResults(result, config) { var r = {}; // copy over Object.keys(result).forEach(function (key) { r[key] = result[key]; }); // because Array's start at 0. r.line -= 1; // pass the user config along with it r.config = config; return r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resultObj(){\n\n\t\tthis.nsid = false\n\t\tthis.source = false\n\t\tthis.value = false\n\t\tthis.differentiated = true\t//default is to be differentiated \n\t\tthis.sparse = false\n\t}", "function copyResults(result, config) {\n var r = {};\n Object.keys(result).forEach(function (key) {\n ...
[ "0.6646897", "0.66429925", "0.63339907", "0.62893623", "0.61651933", "0.6069167", "0.60538733", "0.598137", "0.5975113", "0.5875084", "0.5773404", "0.5731083", "0.57191104", "0.5700195", "0.563671", "0.56353885", "0.5633537", "0.5618694", "0.56153715", "0.56085706", "0.558945...
0.6772009
0
checks if this error is fixable, and fixes it
function fixError(r, code) { // call fix function if (errors.hasOwnProperty(r.raw)) { errors[r.raw].fix(r, code); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fixError() {\n /* exploit = \"installFix\";\n switch (checkFw()) {\n case \"7.02\":\n localStorage.setItem(\"exploit702\", SCMIRA702(\"miraForFix\"));\n document.location.href = \"mira.html\";\n break;\n case \"6.72\":\n let func2 = SCMIRA(\"c-code\");\n let func1 = SCMIRA...
[ "0.6161692", "0.60046", "0.57907164", "0.5754214", "0.5615763", "0.5599336", "0.55635893", "0.55439484", "0.55075085", "0.543655", "0.5286961", "0.52278155", "0.51493484", "0.4930272", "0.4890797", "0.48722386", "0.48690188", "0.48433304", "0.48282576", "0.47948614", "0.47943...
0.6545727
0
Funciones de los menus
function menu(urls,id){ $('#'+id+'').click( function(){ $.ajax({ url: urls, success: function(data){ $('#area_trabajo').html(data); } }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function menuOptions() {}", "function menuhrres() {\r\n\r\n}", "function selectMenu() {\n\tif (menuActive()) { //Si on est dans le menu, on lance la fonction appropriée\n\t\tvar fn = window[$(\".menu_item_selected\").attr(\"action\")];\n\t\tif(typeof fn === 'function') {\n\t\t\tfn();\n\t\t}\n\t} else if (delAl...
[ "0.7892099", "0.76655406", "0.7402291", "0.73971885", "0.7183003", "0.7127317", "0.7086527", "0.6965697", "0.6904595", "0.6903715", "0.6886215", "0.6848438", "0.6812586", "0.679516", "0.6788568", "0.6738062", "0.6712725", "0.67064685", "0.6700338", "0.6700084", "0.6685255", ...
0.0
-1
dependent on selected conversion mode via radiobutton
execConvert(mode) { switch (mode) { case "bin": return new BinaryConverter(); case "rom": return new RomanConverter(); default: return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function determineConverter (clickEvent) {\n if (radioCel.checked === true) {\n toCelsius();\n } else {\n toFahrenheit();\n }\n}", "function determineConverter (clickEvent) {\n\tuserTemp = document.getElementById(\"userTemp\").value;\n\n\tif(fRadio.checked){\n\t\ttoFahrenheit(userTemp);\n\t\tconsole.log...
[ "0.69719696", "0.69033223", "0.6802354", "0.6719851", "0.65819967", "0.6391341", "0.6376588", "0.6275576", "0.6252695", "0.61912256", "0.6119355", "0.60224265", "0.59989476", "0.5994305", "0.5981777", "0.5974612", "0.5933151", "0.59169775", "0.5854362", "0.57823277", "0.57654...
0.0
-1
color the events on the calendar
function showEvents () { let days = document.getElementsByClassName('day'); let events = []; [...eventData['events']].forEach((event)=>{ [...days].forEach((day)=>{ if(event['day']===day.innerHTML && event['month']===headerMonths.innerHTML && event['year']===headerYears.innerHTML){ day.classList.add('active-event'); events.push(event) } }); }); return events; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function colorOnDutyDays(events) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = events[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion...
[ "0.7248624", "0.7222284", "0.6989382", "0.6987157", "0.68738794", "0.67348254", "0.67117745", "0.64718235", "0.6469848", "0.63437915", "0.6327179", "0.62514055", "0.6214961", "0.62094647", "0.6176478", "0.61717534", "0.6167375", "0.61454374", "0.6106831", "0.6101825", "0.6099...
0.0
-1
clears previous event Text
function clearEventText() { if(document.getElementsByClassName('event-desc')){ [...document.getElementsByClassName('event-desc')].forEach((event)=>{ event.outerHTML=''; }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clearText() {\n this.text = \"\";\n this.removeTextFromBlob(this)\n }", "function allClear() {\n previousText.innerHTML = '';\n currentText.innerHTML = '';\n}", "function clearText(e){\n\t$.originalText.value= \"\";\n\t$.originalText.focus();\n\t$.encryptedText.text = \"\";\n...
[ "0.7547148", "0.73806345", "0.7340957", "0.732975", "0.719757", "0.7190587", "0.71485156", "0.6981213", "0.6930317", "0.6922503", "0.68709725", "0.6764964", "0.67129636", "0.6699456", "0.668519", "0.66842955", "0.6678535", "0.6674945", "0.6670356", "0.6625484", "0.66188854", ...
0.69302785
9
import ProfileTitle from "../components/ProfileTitle";
function Profile() { return ( <div> {/* <ProfileTitle/> */} <CardWrapper> <UsersProfile /> </CardWrapper> </div > ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function InboxHeader(props) {\n return (\n <div className=\"ProjectHeader\">\n <h1> {props.title} </h1>\n </div>\n )\n}", "function Header(props) {\n return (\n <div className=\"header\">\n <h1>{props.title}</h1>\n </div>\n\n )\n}", "function UserPage() {\n...
[ "0.6351072", "0.61878794", "0.61363184", "0.6131286", "0.6123139", "0.6091882", "0.6087841", "0.6086385", "0.6061564", "0.60608673", "0.6024049", "0.60169667", "0.60099024", "0.6003747", "0.59255886", "0.58919424", "0.5880093", "0.58571887", "0.585398", "0.5841795", "0.583960...
0.67856216
0
Base class for GradientPicker, HuePicker and AlphaPicker. Creates a gradient on a canvas surface and a picker surface.
function CanvasPicker(size, initialColor, opts) { View.apply(this); this.eventInput.pipe( this.eventOutput ); this.options = { pickerSize: [4, size[1] + 5], transition: { curve: Easing.inSineNorm, duration: 50 }, pickerPosX: 0, pickerPosY: 0, pickerZ: 2, railsY: false, pickerProperties: {}, colorPicker: false } this.setOptions(opts); this.size = size; this.color = initialColor.clone(); this.name = name; this.pos = []; this._dirty = true; this.canvasSize = [this.size[0]*2, this.size[1]*2]; this._selectedCoords = [ Utils.map(this.options.pickerPosX, 0, 1, 0, this.size[0]-1, true), Utils.map(this.options.pickerPosY, 0, 1, 0, this.size[1]-1, true), ] this.gradient = new CanvasSurface({ size: [this.size[0], this.size[0]], canvasSize: [this.size[0]*2, this.size[0]*2] }); var pickerPos = getPickerPos.call(this, this.size[0] * this.options.pickerPosX, this.size[1] * this.options.pickerPosY); this.pickerTransform = new Modifier({ transform: FM.translate(pickerPos[0], pickerPos[1], 0) }); if(this.options.colorPicker) { this.picker = new ColorButton(this.options.pickerSize, this.color) } else { this.picker = new Surface({ size: this.options.pickerSize }); } this.picker.setProperties(this.options.pickerProperties); this._mousemove = mousemove.bind(this); this._mouseup = mouseup.bind(this); this.gradient.on('mousedown', mousedown.bind(this)); this.picker.on('mousedown', mousedown.bind(this)); this.gradient.on('touchstart', touchstart.bind(this)); this.picker.on('touchstart', touchstart.bind(this)); this.gradient.on('touchmove', touchmove.bind(this)); this.picker.on('touchmove', touchmove.bind(this)); this.gradient.on('click', blockEvent); this.picker.on('click', blockEvent); this.on('updatePosition', this.updateColor.bind(this)); this.on('updatePosition', updatePicker.bind(this)); // Render Tree this._add(this.pickerTransform)._link(this.picker); this._add(this.gradient); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ColorPicker(\n painter,\n parameterName,\n wgl,\n canvas,\n shaderSources,\n left,\n bottom\n ) {\n this.wgl = wgl;\n this.canvas = canvas;\n this.input = document.querySelector(\"input\");\n\n this.input.addEventListener(\"change\", this.onInputChange.bind(this));\n\n ...
[ "0.6408844", "0.59213406", "0.58637923", "0.58365434", "0.58052385", "0.5804588", "0.5787539", "0.576824", "0.5745963", "0.56734824", "0.56734824", "0.56734824", "0.56734824", "0.56734824", "0.56693137", "0.5643128", "0.5642134", "0.5618394", "0.56100994", "0.55595106", "0.55...
0.7124908
0
remove todo by id
function removeTodoById(id, li) { connection.remove({ from: 'tasks', where: { id: id } }).then(() => { li.remove() // alert('Todo removed') }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeTodo(id){\n console.log(id);\n document.getElementById(id).remove();\n }", "deleteTodo(id) {\r\n this.todos = this.todos.filter(todo => todo.id !== id);\r\n this._changeList(this._currentTab);\r\n }", "function removeTodo(id) {\n setTodos(todos.filter((todo) => todo.id...
[ "0.8605196", "0.8281466", "0.8218897", "0.8181986", "0.80951536", "0.80237436", "0.7956088", "0.79301983", "0.7841629", "0.7789171", "0.77714443", "0.7763824", "0.7742939", "0.7712732", "0.77099705", "0.7707687", "0.765229", "0.76473784", "0.76441395", "0.763017", "0.76299906...
0.83325195
1
Create the object called cashRegister and initialize its total property
function cashRegister(){ this.total = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(cash, balance) {\n this.cash = cash;\n this.balance = balance;\n this.stocks = [];\n }", "function SalaryCalculator(){\n this.basic = 0;\n this.hra = 0;\n this.da = 0;\n this.tax = 0;\n}", "constructor () {\n\t\tthis.coins = 0;\n\t}", "function SalaryCalculator(){\n this.basic...
[ "0.6317211", "0.5981754", "0.59598035", "0.5766497", "0.57234746", "0.5703512", "0.5618086", "0.5594363", "0.55786014", "0.5568819", "0.555426", "0.55496466", "0.5545485", "0.5476828", "0.547584", "0.546053", "0.54487026", "0.5436227", "0.5430639", "0.5393035", "0.5389929", ...
0.84139043
0
load partners for selection
function partnersLoad(){ function makePartner(num, title){ $('#partner_wrapper #scroll_wrapper').append('<div id="'+num+'" class="partner" data-title="'+title+'"><img src="/images/logos/'+num+'.jpg" /><div class="selectPartner"><span></span>SELECT<div></div></span></div></div>'); }; //loop through each partner and place it on page $.each(App.Partners.all, function(i, v){ makePartner(v[0], v[1]); }); //bind click event to each partner logo $('.partner').bind('click', function(){ var partnerId = $(this).attr("id"); if($(this).hasClass('checked')){ $(this).removeClass('checked'); $(this).children("div").children("span").css({ 'backgroundPosition' : 0+'px' }); $('li#p_'+partnerId).fadeOut(300, function(){ $(this).remove(); }); }else { $(this).addClass('checked'); $(this).children("div").children("span").css({ 'backgroundPosition' : -22+'px' }); $('#pickedWrapper').append('<li id="p_'+partnerId+'" style="display:none;"><img src="/images/logos/'+partnerId+'.jpg" /></li>'); $('li#p_'+partnerId).fadeIn(300); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadPartner() {\n \tGisMap.Util.MAX_APP_FILES = application.partner_sources.length;\n \tGisMap.Util.LOADED_APP_FILES = 0;\n if (application.partner_sources.length == 0) {\n GisMap.Core.injectHtml(STARTAPPLICATION);\n return;\n ...
[ "0.64359224", "0.6208802", "0.6164785", "0.61607283", "0.6020295", "0.5882443", "0.5869283", "0.58347934", "0.57876337", "0.57861394", "0.577068", "0.57621163", "0.5759205", "0.5743609", "0.57420623", "0.573382", "0.5720121", "0.5719845", "0.5706663", "0.56966305", "0.5693122...
0.75619054
0
Fade in Cells randomly
function gridTransition() { $('#game_board').each(function(){ var $cell = $(this).find('.open'); var cell_amount = $cell.length; var random_cell = $cell.eq(Math.floor(cell_amount*Math.random())); random_cell.animate({'color': jQuery.Color('#fff')}, 100, function(){ $(this).animate({'color': jQuery.Color('#bd727b')}, 100); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function colorFade() {\n var color = [];\n\n for (var i = 0; i < 3; i++) {\n var pickNum = Math.floor(Math.random() * 255);\n color.push(pickNum);\n }\n\n $(\"body\").css({\n backgroundColor: \"rgb(\" + color[0] + \", \" + color[1] + \", \" + color[2] + ...
[ "0.6749497", "0.6607842", "0.6536754", "0.6503139", "0.63221365", "0.6300223", "0.62297064", "0.62213385", "0.6210899", "0.6200453", "0.6169167", "0.6161667", "0.6135734", "0.6128716", "0.6114257", "0.61134255", "0.61133355", "0.6091899", "0.608283", "0.60579175", "0.6050929"...
0.7135088
0
Bind Events for ajax calls
function bindEvents(){ //Move to next page button click $('.btn_continue').bind('click', function(){ var nameVal = $(this).attr("name"); loadnextpage(nameVal); return false; }); $('.entertowin, #sorryRegister').bind('click', function(){ loadnextpage('register'); return false; }); //Select Partners on Partners page $('#selectSix').bind('click', function(){ partnersSelect(); return false; }); $('#double_down').bind('click', function(){ loadnextpage('doubledown'); return false; }); $('#keep_offer').bind('click', function(){ loadnextpage('register'); return false; }); $('.reset').bind('click', function(){ resetGame(); return false; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bindEvents(){\n //Shows spinner loader on AJAX calls\n $(document).on({\n ajaxStart: function(){\n $('#loader').removeClass('hidden');\n $('body').addClass('loading');\n },\n ajaxStop: function(){ \n $('#loader')...
[ "0.7103751", "0.7096981", "0.70443255", "0.668868", "0.65920866", "0.6562029", "0.65329397", "0.6457068", "0.63906914", "0.6384853", "0.63636196", "0.63054353", "0.6236459", "0.6146691", "0.6144744", "0.6115682", "0.61021787", "0.61001533", "0.6050454", "0.604859", "0.6034155...
0.5991899
23
Left mouse button controls the orbit itself. The right mouse button allows to move the camera and the point it's looking at in the XY plane. The scroll moves the camera forward and backward.
function setupCamera(scene) { let canvas = scene.viewer.canvas; let camera = scene.camera; let MOVE_SPEED = 2; let ZOOM_SPEED = 30; let ROTATION_SPEED = 1 / 200; let mouse = {buttons: [false, false, false], x: 0, y: 0, x2: 0, y2: 0}; let right = vec3.create(); let up = vec3.create(); let horizontalAngle = -Math.PI / 2; let verticalAngle = -Math.PI / 4; let cameraTarget = vec3.create(); // What the camera orbits. // Initial setup, go back a bit and look forward. camera.move([0, -400, 0]); camera.setRotationAroundAngles(horizontalAngle, verticalAngle, cameraTarget); // Move the camera and the target on the XY plane. function move(x, y) { let dirX = camera.directionX; let dirY = camera.directionY; // Allow only movement on the XY plane, and scale to MOVE_SPEED. vec3.scale(right, vec3.normalize(right, [dirX[0], dirX[1], 0]), x * MOVE_SPEED); vec3.scale(up, vec3.normalize(up, [dirY[0], dirY[1], 0]), y * MOVE_SPEED); camera.move(right); camera.move(up); // And also move the camera target to update the orbit. vec3.add(cameraTarget, cameraTarget, right); vec3.add(cameraTarget, cameraTarget, up); } // Rotate the camera around the target. function rotate(dx, dy) { // Update rotations, and limit the vertical angle so it doesn't flip. // Since the camera uses a quaternion, flips don't matter to it, but this feels better. horizontalAngle += dx * ROTATION_SPEED; verticalAngle = Math.max(-Math.PI + 0.01, Math.min(verticalAngle + dy * ROTATION_SPEED, -0.01)); camera.setRotationAroundAngles(horizontalAngle, verticalAngle, cameraTarget); } // Zoom the camera by moving forward or backwards. function zoom(factor) { // Get the forward vector. let dirZ = camera.directionZ; camera.move(vec3.scale([], dirZ, factor * ZOOM_SPEED)); } /* // Resize the canvas automatically and update the camera. function onResize() { let width = canvas.clientWidth; let height = canvas.clientHeight; canvas.width = width; canvas.height = height; camera.viewport([0, 0, width, height]); camera.perspective(Math.PI / 4, width / height, 8, 100000); } window.addEventListener("resize", function(e) { onResize(); }); onResize(); */ // Track mouse clicks. canvas.addEventListener("mousedown", function(e) { e.preventDefault(); mouse.buttons[e.button] = true; }); // And mouse unclicks. // On the whole document rather than the canvas to stop annoying behavior when moving the mouse out of the canvas. window.addEventListener("mouseup", (e) => { e.preventDefault(); mouse.buttons[e.button] = false; }); // Handle rotating and moving the camera when the mouse moves. canvas.addEventListener("mousemove", (e) => { mouse.x2 = mouse.x; mouse.y2 = mouse.y; mouse.x = e.clientX; mouse.y = e.clientY; let dx = mouse.x - mouse.x2; let dy = mouse.y - mouse.y2; if (mouse.buttons[0]) { rotate(dx, dy); } if (mouse.buttons[2]) { move(-dx * 2, dy * 2); } }); // Handle zooming when the mouse scrolls. canvas.addEventListener("wheel", (e) => { e.preventDefault(); let deltaY = e.deltaY; if (e.deltaMode === 1) { deltaY = deltaY / 3 * 100; } zoom(deltaY / 100); }); // Get the vector length between two touches. function getTouchesLength(touch1, touch2) { let dx = touch2.clientX - touch1.clientX; let dy = touch2.clientY - touch1.clientY; return Math.sqrt(dx * dx + dy * dy); } // Touch modes. let TOUCH_MODE_INVALID = -1; let TOUCH_MODE_ROTATE = 0; let TOUCH_MODE_ZOOM = 1; let touchMode = TOUCH_MODE_ROTATE; let touches = []; // Listen to touches. // Supports 1 or 2 touch points. canvas.addEventListener('touchstart', (e) => { e.preventDefault(); let targetTouches = e.targetTouches; if (targetTouches.length === 1) { touchMode = TOUCH_MODE_ROTATE; } else if (targetTouches.length == 2) { touchMode = TOUCH_MODE_ZOOM; } else { touchMode = TOUCH_MODE_INVALID; } touches.length = 0; touches.push(...targetTouches); }); canvas.addEventListener('touchend', (e) => { e.preventDefault(); touchMode = TOUCH_MODE_INVALID; }); canvas.addEventListener('touchcancel', (e) => { e.preventDefault(); touchMode = TOUCH_MODE_INVALID; }); // Rotate or zoom based on the touch mode. canvas.addEventListener('touchmove', (e) => { e.preventDefault(); let targetTouches = e.targetTouches; if (touchMode === TOUCH_MODE_ROTATE) { let oldTouch = touches[0]; let newTouch = targetTouches[0]; let dx = newTouch.clientX - oldTouch.clientX; let dy = newTouch.clientY - oldTouch.clientY; rotate(dx, dy); } else if (touchMode === TOUCH_MODE_ZOOM) { let len1 = getTouchesLength(touches[0], touches[1]); let len2 = getTouchesLength(targetTouches[0], targetTouches[1]); zoom((len1 - len2) / 50); } touches.length = 0; touches.push(...targetTouches); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function controlLeftAction() {\n xCoord -= (357 + 30);\n let limiteIzquierdo = 0;\n if (xCoord < limiteIzquierdo){\n xCoord = limiteIzquierdo;\n }\n containterTrending.scroll(xCoord, yCoord);\n}", "function onMouseMove(event) {\n // store the mouseX and mouseY position \n event.preventDefaul...
[ "0.6669174", "0.617785", "0.61591494", "0.61524904", "0.6122603", "0.6096839", "0.6057147", "0.6028616", "0.60280967", "0.59993976", "0.5987891", "0.5983427", "0.5970282", "0.595384", "0.59290147", "0.5928145", "0.5846607", "0.5831137", "0.5822703", "0.580224", "0.5734582", ...
0.612916
4
Move the camera and the target on the XY plane.
function move(x, y) { let dirX = camera.directionX; let dirY = camera.directionY; // Allow only movement on the XY plane, and scale to MOVE_SPEED. vec3.scale(right, vec3.normalize(right, [dirX[0], dirX[1], 0]), x * MOVE_SPEED); vec3.scale(up, vec3.normalize(up, [dirY[0], dirY[1], 0]), y * MOVE_SPEED); camera.move(right); camera.move(up); // And also move the camera target to update the orbit. vec3.add(cameraTarget, cameraTarget, right); vec3.add(cameraTarget, cameraTarget, up); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function move() {\n x += (targetX - x) * 0.1;\n y += (targetY - y) * 0.1;\n\n if (Math.abs(targetX - x) < 1 && Math.abs(targetY - y) < 1) {\n x = targetX;\n y = targetY;\n } else {\n requestAnimationFrame(move);\n }...
[ "0.7103392", "0.70698553", "0.7021567", "0.690013", "0.6737478", "0.6677076", "0.6602707", "0.65754235", "0.653087", "0.65242475", "0.6485809", "0.6482012", "0.64480805", "0.6418192", "0.6376169", "0.6369993", "0.63421035", "0.63374376", "0.6336548", "0.63209236", "0.63131386...
0.74697953
0
Rotate the camera around the target.
function rotate(dx, dy) { // Update rotations, and limit the vertical angle so it doesn't flip. // Since the camera uses a quaternion, flips don't matter to it, but this feels better. horizontalAngle += dx * ROTATION_SPEED; verticalAngle = Math.max(-Math.PI + 0.01, Math.min(verticalAngle + dy * ROTATION_SPEED, -0.01)); camera.setRotationAroundAngles(horizontalAngle, verticalAngle, cameraTarget); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "rotate() {\n if (!this.rotation) {\n return;\n }\n this.ctx.translate(this.x - state.cameraX + this.width / 2, this.y);\n this.ctx.rotate(this._degToRad(this.rotation + 90));\n this.ctx.translate(-this.x + state.cameraX - this.width / 2, -this.y);\n }", "rotate() {\n\t\tthis.scene.rotate(-Ma...
[ "0.72759056", "0.68382436", "0.6835041", "0.672158", "0.6593706", "0.6376184", "0.6355608", "0.63428843", "0.6310431", "0.62964314", "0.62236065", "0.6218251", "0.6201183", "0.61812794", "0.6181065", "0.6172513", "0.6157836", "0.6143725", "0.6143454", "0.61164904", "0.6116165...
0.55552334
66
Zoom the camera by moving forward or backwards.
function zoom(factor) { // Get the forward vector. let dirZ = camera.directionZ; camera.move(vec3.scale([], dirZ, factor * ZOOM_SPEED)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zoom() {\n const speed = 2;\n if (Date.now() - lastUpdate > mspf) {\n let e = window.event || e; // old IE support\n let delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));\n\n cameraDistance += delta * speed;\n cameraDistance = Math.min(Math.max(cameraDistanc...
[ "0.75529623", "0.75270426", "0.7071705", "0.6874714", "0.68658197", "0.68371975", "0.6793753", "0.678613", "0.6686939", "0.6658725", "0.6653342", "0.66445583", "0.6642654", "0.6589087", "0.6584138", "0.6579761", "0.65435493", "0.6541787", "0.6522788", "0.6514777", "0.64044493...
0.7447297
2
Get the vector length between two touches.
function getTouchesLength(touch1, touch2) { let dx = touch2.clientX - touch1.clientX; let dy = touch2.clientY - touch1.clientY; return Math.sqrt(dx * dx + dy * dy); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getLength() {\n var x1 = this.point1.getX();\n var y1 = this.point1.getY();\n var x2 = this.point2.getX();\n var y2 = this.point2.getY();\n return Math.hypot(x1 - x2, y1 - y2);\n }", "function len (p1, p2) {\n return Math.sqrt((p2.x - p1.x) * (p2.x - p1.x) + (p2.y - p1.y)...
[ "0.6841312", "0.6699425", "0.6670049", "0.6597115", "0.6594384", "0.6546013", "0.65313715", "0.64357984", "0.6395281", "0.63648415", "0.6281862", "0.62077695", "0.6207016", "0.618117", "0.6129951", "0.61223197", "0.61141026", "0.60874313", "0.60874313", "0.59573007", "0.59410...
0.7707527
0
Create "factory factory" function that returns a constructor function. The factory factory takes in one parameter, "type". Each created factory needs to create objects with this given type. Each created factory needs to take in three parameters and save them to the created objects: make model Use your factory factory to create at least five factories, such as bicycle factory car factory boat factory blimp factory train factory Lastly, use those factories to create some vehicles. Store all your created vehicles inside one array, loop over that array and print out each vehicle. Question: Check the type of your factories and of the objects that your factories create what is the type of a factory and what is the type of a created object? Add your answer as comments into into your solution file.
function factoryFactory(type){ return function Factory(make, model){ this.type = type; this.make = make; this.model = model; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function VehicleFactory() {}", "function VehicleFactory() {}", "function VehicleFactory() {}", "function VehicleFactory(){}", "function Factory(){}", "function Factory() {\r\n this.createProduct = function(type) {\r\n let product;\r\n if (type === \"Phone\") {\r\n product = new Phone();\r\n ...
[ "0.6904147", "0.6904147", "0.6904147", "0.68390626", "0.67700315", "0.6756162", "0.67426604", "0.67426604", "0.65748215", "0.6492375", "0.6492375", "0.613752", "0.6054911", "0.5903043", "0.5883048", "0.5813172", "0.5813172", "0.57693833", "0.57693833", "0.57452667", "0.573208...
0.7566754
0
on click, show example
function showExample(img, btn) { 'use strict'; console.log("clicked " + btn + " to show " + img); var a, gif_class, btns_class; a = 0; gif_class = document.getElementsByClassName(img); btns_class = document.getElementsByTagName('button'); //identify which button was pressed for (a; a < btns_class.length; a++) { //---SHARE BUTTON--- if (btn === "share-btn") { console.log("share btn clicked"); //make active activeClass(btn, btns_class); //check for visible imgs if (visibleCheck('storyboard')) { //hide if visible if (document.getElementsByTagName("img").length > 0) { document.getElementsByClassName(img)[1].style.visibility = "hidden"; } } //set attribute with prototype file gif_class[1].setAttribute("src", "share-gif02.gif"); //make visible document.getElementsByClassName(img)[1].style.visibility = "visible"; return; //---HOME BUTTON--- } else if (btn === "home-btn") { console.log("home btn clicked"); //make active activeClass(btn, btns_class); //check for visible imgs if (visibleCheck('storyboard')) { //hide if visible if (document.getElementsByTagName("img").length > 0) { document.getElementsByClassName(img)[1].style.visibility = "hidden"; } } alert("prototype has not been created yet"); return; //---FEED BUTTON--- } else if (btn === "feed-btn") { console.log("feed btn clicked"); //make active activeClass(btn, btns_class); //check for visible imgs if (visibleCheck('storyboard')) { //hide if visible if (document.getElementsByTagName("img").length > 0) { document.getElementsByClassName(img)[1].style.visibility = "hidden"; } } alert("prototype has not been created yet"); return; //---UPLOAD BUTTON--- } else if (btn === "upload-btn") { console.log("upload btn clicked"); //make active activeClass(btn, btns_class); //check for visible imgs if (visibleCheck('storyboard')) { //hide if visible if (document.getElementsByTagName("img").length > 0) { document.getElementsByClassName(img)[1].style.visibility = "hidden"; } } alert("prototype has not been created yet"); return; //---EVENTS BUTTON--- } else if (btn === "events-btn") { console.log("events btn clicked"); //make active activeClass(btn, btns_class); //check for visible imgs if (visibleCheck('storyboard')) { //hide if visible if (document.getElementsByTagName("img").length > 0) { document.getElementsByClassName(img)[1].style.visibility = "hidden"; } } alert("prototype has not been created yet"); return; //---SETTINGS BUTTON--- } else if (btn === "settings-btn") { console.log("settings btn clicked"); //make active activeClass(btn, btns_class); //check for visible imgs if (visibleCheck('storyboard')) { //hide if visible if (document.getElementsByTagName("img").length > 0) { document.getElementsByClassName(img)[1].style.visibility = "hidden"; } } alert("prototype has not been created yet"); return; //---CONTACTS BUTTON--- } else if (btn === "contacts-btn") { console.log("contacts btn clicked"); //make active activeClass(btn, btns_class); //check for visible imgs if (visibleCheck('storyboard')) { //hide if visible if (document.getElementsByTagName("img").length > 0) { document.getElementsByClassName(img)[1].style.visibility = "hidden"; } } alert("prototype has not been created yet"); return; //---MESSAGING BUTTON--- } else if (btn === "messaging-btn") { console.log("messaging btn clicked"); //make active activeClass(btn, btns_class); //check for visible imgs if (visibleCheck('storyboard')) { //hide if visible if (document.getElementsByTagName("img").length > 0) { document.getElementsByClassName(img)[1].style.visibility = "hidden"; } } alert("prototype has not been created yet"); return; //---FEED:UPLOAD TRANSITION--- } else if (btn === "feed-upload") { console.log("feed:upload btn clicked"); //make active activeClass(btn, btns_class); //check for visible imgs if (visibleCheck('storyboard')) { //hide if visible if (document.getElementsByTagName("img").length > 0) { document.getElementsByClassName(img)[1].style.visibility = "hidden"; } } alert("prototype has not been created yet"); return; //---FEED:SETTINGS TRANSITION--- } else if (btn === "feed-settings") { console.log("feed:settings btn clicked"); //make active activeClass(btn, btns_class); //check for visible imgs if (visibleCheck('storyboard')) { //hide if visible if (document.getElementsByTagName("img").length > 0) { document.getElementsByClassName(img)[1].style.visibility = "hidden"; } } alert("prototype has not been created yet"); return; //---CONTACTS:MESSAGING--- } else if (btn === "contacts-msg") { console.log("contacts:messaging btn clicked"); //make active activeClass(btn, btns_class); //check for visible imgs if (visibleCheck('storyboard')) { //hide if visible if (document.getElementsByTagName("img").length > 0) { document.getElementsByClassName(img)[1].style.visibility = "hidden"; } } alert("prototype has not been created yet"); return; } console.log("showExample() complete"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "show() {\n\n }", "show() {}", "async show() {\n \n }", "function showX() {\n\t\t$(\".ex\").show();\n\t}", "function onShowDemo() {\n resetPageState();\n var demoCon = document.querySelector('.demo_con');\n demoCon.innerHTML = generateClickimageSource();\n\n var img = d...
[ "0.7264848", "0.69415605", "0.6569241", "0.63958585", "0.634904", "0.63241345", "0.630526", "0.6298256", "0.6298256", "0.6298256", "0.6298256", "0.62970984", "0.6265472", "0.62434703", "0.6214603", "0.62052023", "0.618148", "0.61746895", "0.61584914", "0.6116763", "0.61167103...
0.0
-1
Initialise the Ffau instance in the document
constructor(){ console.log("========================="); console.log('%c Ffau Editor ', 'background: #00d1b2; color: white;'); console.log("A Blockly-based HTML editor made by the CodeDdraig organisation."); console.log("https://github.com/codeddraig/ffau"); console.log("=========================\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function HATSTFInit(HTInfo, useTF, focusFieldName, hatsportletid){}", "function init(fe) {\n\n // Receive from parameters received as arguments.\n formElements = fe;\n\n // Add mask for CPF field.\n formElements.cpfField.mask('000.000.000-00', {reserve: true});\n\n // Add mask ...
[ "0.58653635", "0.58578366", "0.5785591", "0.5705894", "0.5705894", "0.5705894", "0.5705894", "0.5705894", "0.56884736", "0.5678361", "0.565527", "0.56455743", "0.55984324", "0.55343485", "0.54911584", "0.5489732", "0.54860723", "0.54712754", "0.5467892", "0.53741926", "0.5371...
0.0
-1
Clears all blocks from the workspace without further confirmation
clearWorkspace(){ this.ffauWorkspace.clear(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function discard() {\n var count = Blockly.mainWorkspace.getAllBlocks().length;\n if (count < 2 || window.confirm(\"Remove all blocks?\")) {\n Blockly.mainWorkspace.clear();\n window.location.hash = '';\n }\n}", "function removeAllBlocks() {\n\tblocks.innerHTML = '';\n\tsetScriptNumber('');\n}", "func...
[ "0.7357635", "0.70252275", "0.692244", "0.692244", "0.6804593", "0.66938204", "0.6484614", "0.6483334", "0.6264242", "0.6258153", "0.6250678", "0.62446827", "0.6239094", "0.62057793", "0.6192085", "0.6157075", "0.61457103", "0.61273205", "0.61059386", "0.60769105", "0.6063118...
0.58823514
30
compare function for args of type int
function compareTo(x, y) { x = parseInt(x, 10); y = parseInt(y, 10); if (x < y) return -1; else if (x > y) return 1; else return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exComparator( int1, int2){\r\n if (int1 > int2){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "function exComparator( int1, int2){\r\n if (int1 > int2){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "function exComparator( in...
[ "0.69550085", "0.69550085", "0.69342357", "0.69342357", "0.69342357", "0.69342357", "0.6898179", "0.64595217", "0.6458621", "0.6303674", "0.6269464", "0.6155361", "0.6142284", "0.6130069", "0.61173993", "0.6084174", "0.60786366", "0.607372", "0.60731894", "0.6064328", "0.6064...
0.0
-1
put keyvalue pair into BST
put(key, val) { this.root = this.putHelper( this.root, key, val, this.rootX, this.rootY, this.rootDeltaX, this.rootDeltaY ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "insert (key, value) {\n value = value || key;\n\n //leafs need to insert the value at themself and make new leaf children\n if(this.height == 0) {\n this.key = key;\n this.value = value || key;\n this.left = new BinarySearchTree(this);\n this.right = new BinarySearchTree(this);\n ...
[ "0.76697665", "0.75830215", "0.756652", "0.74670446", "0.7416154", "0.7303209", "0.72141135", "0.7160151", "0.70765877", "0.7041104", "0.702723", "0.69686866", "0.6964511", "0.6914944", "0.69114923", "0.6900008", "0.68844813", "0.6643288", "0.6639078", "0.66138464", "0.655669...
0.6780852
17
whether bst contains given key
contains(key) { return this.getAnimated(key) !== null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "contains(key) {\n let current = this.head;\n while(current.object != key) {\n current = current.next;\n if(current == null)\n return false;\n }\n return true;\n }", "contains(key)\n\t{\n\t\tkey = this.toString(key);\n\t\treturn super.has(key);\n...
[ "0.74852335", "0.7288049", "0.7159886", "0.7114057", "0.7095252", "0.7091315", "0.7019882", "0.6891799", "0.6878289", "0.680276", "0.67626894", "0.673904", "0.6724886", "0.66724604", "0.6665484", "0.6661064", "0.6661064", "0.6661064", "0.6661064", "0.6661064", "0.6654296", ...
0.6368829
39
delete minimum node (not animation)
deleteMin() { this.root = this.animateDeleteMinHelper(this.root); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteMin(node) {\n if (node.left == null) return node.right;\n node.left = deleteMin(node.left);\n node.size = size(node.left) + size(node.right) + 1;\n return node;\n}", "animateDeleteMin() {\r\n const animations = [];\r\n animations.push(new Animation(\"display\", \"Deleting Min\", \"\"));\...
[ "0.7383449", "0.6988974", "0.69006515", "0.69006515", "0.68844527", "0.65875614", "0.6582033", "0.65137094", "0.6493366", "0.6442281", "0.6390009", "0.6350146", "0.63184255", "0.63092464", "0.63092464", "0.6276753", "0.6263889", "0.62426925", "0.6183698", "0.61782646", "0.616...
0.8056322
0
min key of bst (used as helper function)
min() { return this.minHelper(this.root); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function minKey(key,mstSet) \n{ \n // Initialize min value \n let min = Number.MAX_VALUE, min_index; \n for (let v = 0; v < V; v++) \n if (mstSet[v] == false && key[v] < min) \n min = key[v], min_index = v; \n \n return min_index; \n}", "min() {\n const minNode = this.findMinNo...
[ "0.7765121", "0.7436394", "0.74103135", "0.7381988", "0.7113029", "0.6510588", "0.6460559", "0.63056743", "0.6169822", "0.6135426", "0.61296546", "0.61219144", "0.6117367", "0.6096558", "0.6096558", "0.60959053", "0.60959053", "0.60959053", "0.60955966", "0.60948294", "0.6094...
0.57721007
98
max key of bst
max() { return this.maxHelper(this.root); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getMaxKey () {\n return this.getMaxKeyDescendant().key\n }", "maxNode(node) {\n if (node) {\n while (node && node.right !== null) {\n node = node.right;\n }\n return node.key;\n }\n }", "function max(node) { \n var keyToReturn = node.key;\n if (node != nul...
[ "0.7417824", "0.7282816", "0.7147359", "0.70557886", "0.66765076", "0.6442911", "0.6403701", "0.63958293", "0.6278479", "0.62258345", "0.6217179", "0.62098986", "0.6203329", "0.6197103", "0.61727077", "0.6158078", "0.6141446", "0.6104041", "0.60833156", "0.6047678", "0.597882...
0.5695654
34
return all nodes in bst
nodes() { if (this.isEmpty()) return []; return this.nodesHelper1(this.min().key, this.max().key); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "list_nodes() {\n let result = this._list_nodes_in_subtree(this.root);\n return result;\n }", "bfs() {\n const visitedNodes = [];\n const nodeQueue = [this.root];\n\n while(nodeQueue.length){\n const currentNode = nodeQueue.shift();\n visitedNodes.push(currentNode.val);\n ...
[ "0.6983639", "0.66061306", "0.6589199", "0.6575846", "0.6420659", "0.641339", "0.6354541", "0.635103", "0.6348391", "0.6341294", "0.6335956", "0.632871", "0.62996626", "0.6277351", "0.622497", "0.62093824", "0.62093824", "0.6197734", "0.6193166", "0.61921084", "0.6166727", ...
0.6424415
4
inorder traversal of nodes
inorderNodes() { let queue = []; this.inorderNodesHelper(this.root, queue); return queue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inOrderTraversal(node) {}", "inorderTraversal() {\n\n }", "inorderTraversal(node = this.root) {\n if (node === null)\n return;\n\n this.inorderTraversal(node.left);\n console.log(node.data);\n this.inorderTraversal(node.right);\n }", "inorder(node) {\n ...
[ "0.8586327", "0.80949754", "0.78377247", "0.78191906", "0.78191906", "0.7784994", "0.7784994", "0.7784994", "0.7769381", "0.7545223", "0.74973994", "0.7490266", "0.7421076", "0.73980016", "0.7306658", "0.72934455", "0.72826487", "0.7265739", "0.72056234", "0.7176716", "0.7061...
0.6893698
29
return balanced version of current BST
getBalancedBST() { const balancedBST = new BST( this.rootX, this.rootY, this.rootDeltaX, this.rootDeltaY ); const inorderNodes = this.inorderNodes(); let n = inorderNodes.length; if (!n > 0) return; const q = []; let lo = 0; let hi = n - 1; q.push([lo, hi]); while (q.length !== 0) { [lo, hi] = q.shift(); if (lo <= hi) { const mid = lo + Math.floor((hi - lo) / 2); const midNode = inorderNodes[mid]; balancedBST.put(midNode.key, midNode.value); q.push([lo, mid - 1]); q.push([mid + 1, hi]); } } return balancedBST; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "balance() {\n // inorder traversal on bst returns a sorted sequence\n const values = this.inorder();\n // make the middle element the new root\n const root = new TreeNode(values[Math.floor(values.length / 2)]);\n // contruct the tree from root and return\n return this.bala...
[ "0.7789535", "0.6980783", "0.6961443", "0.69460994", "0.69186974", "0.6902281", "0.67135483", "0.6669187", "0.6631955", "0.6584506", "0.65605843", "0.653778", "0.6526986", "0.6490976", "0.6478659", "0.64777195", "0.63858235", "0.6381439", "0.6335802", "0.632249", "0.626935", ...
0.78425217
0