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 (mon...
{ "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(func...
{ "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 = primeirasLetra...
{ "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...
{ "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; } e...
{ "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]...
{ "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"], ...
{ "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...
{ "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 -- wor...
{ "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 = schedul...
{ "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...
{ "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 = userIn...
{ "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...
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.inde...
{ "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]) || ...
{ "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 >...
{ "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._loc...
{ "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] == nu...
{ "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 = ...
{ "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)) { r...
{ "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; } ...
{ "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(con...
{ "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; ...
{ "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 (!m...
{ "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. ...
{ "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 actu...
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 = offsetFro...
{ "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 us...
{ "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'; } ...
{ "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; ...
{ "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') { thre...
{ "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.fil...
{ "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.appe...
{ "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").hid...
{ "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.getE...
{ "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....
{ "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 ar...
{ "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.p...
{ "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 t...
{ "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){ ...
{ "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 }, ...
{ "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 par...
{ "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': jQ...
{ "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; });...
{ "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(); ...
{ "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...
{ "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...
{ "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 t...
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 press...
{ "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("========...
{ "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.pu...
{ "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