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
Encontrar la desviacion estandar para una poblacion
function desviacionEstandar(array) { let desviacionEstandar = varianza(array) ** (1/2); return desviacionEstandar; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function export_vers_demande_repiquage(){\n // TODO: gestion erreurs\n // NE PAS CHANGER L'ORDRE DES PARAMETRES, NE PAS EN SUPPRIMER !!!\n ExportManager.init(\n 'Demandes', // source sheet name\n '113g_b6dqVSrTRSjRNYGKSyXMWk8oXmM4GNDTgRqhmqo', // target sp...
[ "0.6350577", "0.55077815", "0.5285166", "0.525457", "0.5232809", "0.5161403", "0.5152715", "0.5152182", "0.5147635", "0.5121268", "0.51029646", "0.49649003", "0.49509755", "0.49400693", "0.49253273", "0.49197862", "0.49028176", "0.48988926", "0.48668626", "0.48570916", "0.484...
0.0
-1
Encontrar la desviacion estanda para una muestra
function desviacionEstandarMuestra(array) { let desviacionEstandar = varianzaMuestra(array) ** (1/2); return desviacionEstandar; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function export_vers_demande_repiquage(){\n // TODO: gestion erreurs\n // NE PAS CHANGER L'ORDRE DES PARAMETRES, NE PAS EN SUPPRIMER !!!\n ExportManager.init(\n 'Demandes', // source sheet name\n '113g_b6dqVSrTRSjRNYGKSyXMWk8oXmM4GNDTgRqhmqo', // target sp...
[ "0.64624757", "0.5872627", "0.55912757", "0.55587685", "0.54558516", "0.5446862", "0.53775024", "0.53192693", "0.52682614", "0.5266452", "0.5246664", "0.52252465", "0.52015823", "0.5199244", "0.5183707", "0.50715864", "0.5022787", "0.50187", "0.49887902", "0.4982962", "0.4959...
0.0
-1
Unificar en una array las x1 y f1 Ej: xi = [1,2,3] fi = [1,3,2] > expandir(xi, fi) = [1, 2, 2, 2, 3, 3]
function expandir(xi, fi) { let expandir = []; for (i=0; i<xi.length; i++){ for(a=0; a<fi[i]; a++) { expandir.push(xi[i]); } }; return expandir; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "expandir(t) {\n let vecinosNodo = this.nodo.getVecinos();\n if(vecinosNodo.length > 0) {\n vecinosNodo.sort(function (a, b) {\n if(a.nodo.id < b.nodo.id) return -1;\n if(a.nodo.id == b.nodo.id) return 0;\n return 1;\n });\n }\n...
[ "0.5696927", "0.5348963", "0.51213825", "0.51213825", "0.50360304", "0.5023341", "0.50199574", "0.4999499", "0.49450558", "0.49130604", "0.49130604", "0.49130604", "0.4897096", "0.48722678", "0.48584187", "0.4839886", "0.48078343", "0.47889403", "0.47669485", "0.47570235", "0...
0.7983023
0
Read all content of the specified file path.
static async readFile(path) { return (await Util.promisify(Fs.readFile)(path)).toString('utf-8'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readAllText(path) {\n return fs.readFileSync(path, 'utf8');\n}", "readin () {\n this.content = readFile(this.path);\n }", "function getFileContent(path) {\n return fs.readFileSync(`${path}`, {\n encoding: 'utf8'\n })\n}", "async readInternally() {\n const allFiles = ...
[ "0.73189914", "0.70657253", "0.6968789", "0.6932932", "0.682229", "0.6757997", "0.6744645", "0.6722323", "0.66608983", "0.66548276", "0.66044503", "0.6585885", "0.65259516", "0.6417267", "0.6413528", "0.6412319", "0.64041203", "0.6396254", "0.63390654", "0.6309994", "0.628913...
0.616097
25
Read all files from the specified directory path.
static async readDirectory(path) { return await Util.promisify(Fs.readdir)(path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readDir (path) {\n const step = (acc, x) => {\n const fullName = path + \"/\" + x.name\n return x.isDirectory() ? [...acc, ...(readDir (fullName))]\n : fullName.endsWith(\".md\") ? [...acc, fullName]\n : acc\n }\n return FS.readdirSync(path, {withFileTypes: true}).reduce(step, [...
[ "0.68634725", "0.6812523", "0.67728627", "0.6743466", "0.6743039", "0.67259055", "0.6708051", "0.6677751", "0.66723025", "0.66623634", "0.6614888", "0.6611962", "0.65785164", "0.6553542", "0.6542626", "0.65206856", "0.63995296", "0.63847417", "0.63799727", "0.63428545", "0.63...
0.6874777
0
Creates a dependency entry for the specified code.
static createEntry(name, pack, code) { return `"${name}":{pack:${pack ? 'true' : 'false'}, invoke:function(exports, require){${code}}}`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moduleDependency(code: string): string {\n return `@@MODULE_START@@${code}@@MODULE_END@@`;\n}", "createDependency(data) {\n const source = data.source,\n target = data.target,\n fromSide = data.sourceTerminal.dataset.side,\n toSide = data.targetTerminal.dataset.side,\n ...
[ "0.5749483", "0.56092477", "0.5607882", "0.53019017", "0.49790257", "0.48789853", "0.4775793", "0.47467107", "0.47417375", "0.46952614", "0.46872878", "0.46161902", "0.46161902", "0.4577808", "0.45773858", "0.45487282", "0.4501069", "0.44792873", "0.44787928", "0.44749156", "...
0.6328985
0
Creates a dependency link to another dependency.
static createLink(name, link) { return Helper_1.createEntry(name, true, `Object.assign(exports, require('${link}'));`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createDependency() {\n const me = this,\n data = me.creationData,\n source = data.source,\n target = data.target,\n fromSide = data.sourceTerminal.dataset.side,\n toSide = data.targetTerminal.dataset.side,\n type = (fromSide === 'left' ? 0 : 2) + (toSide === 'right' ?...
[ "0.5998672", "0.5987592", "0.5978487", "0.58688045", "0.5718619", "0.57123065", "0.557141", "0.5509102", "0.5506604", "0.5494587", "0.5493516", "0.54318666", "0.54097474", "0.5407429", "0.5334847", "0.5334218", "0.532605", "0.53007036", "0.52874804", "0.5278726", "0.5259665",...
0.57468706
4
Create a model and write it into the target file.
static async createModel(target, entries) { const path = Path.join(Path.dirname(Path.dirname(__dirname)), '/assets/loader.js'); const model = await Helper_1.readFile(path); await Util.promisify(Fs.writeFile)(target, model.replace(`'!MODULES!'`, `{${entries.join(',')}}`)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveModel() {\n\tlet matBlob = saveMtl();\n\tlet objBlob = saveObj();\n\tdownloadObjZip(matBlob, objBlob);\n}", "createModelFile() {\n // check if the `users.js` file exists already\n if (!fs.existsSync(`${this.model}/users.js`)) {\n const file = path.join(__dirname, '../files/users.js')\n\n ...
[ "0.6516215", "0.6280346", "0.62383235", "0.6185216", "0.6080878", "0.58053654", "0.56654143", "0.55199564", "0.54198545", "0.5353124", "0.53277475", "0.5273253", "0.5272443", "0.5240032", "0.52264774", "0.5221405", "0.5181819", "0.51799", "0.5159433", "0.5138186", "0.51373947...
0.659381
0
Load the specified file and insert a new entry if the provided file is valid.
static async loadFile(source, entries) { if (Path.extname(source.path) === '.js') { const code = await Helper_1.readFile(source.path); const file = Path.basename(source.name); if (file === 'index') { entries.push(Helper_1.createEntry(source.name, false, code))...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "load(file) {\n this._loading = file;\n\n // Read file and split into lines\n const map = {};\n\n const content = fs.readFileSync(file, 'ascii');\n const lines = content.split(/[\\r\\n]+/);\n\n lines.forEach(line => {\n // Clean up whitespace/comments, and split into fields\n const field...
[ "0.5395486", "0.53787434", "0.5343946", "0.5146539", "0.5129043", "0.4992401", "0.49372956", "0.49103707", "0.49049407", "0.48727098", "0.48383218", "0.47733665", "0.46670806", "0.46290305", "0.46070564", "0.46019697", "0.45949778", "0.45876628", "0.45761508", "0.4568711", "0...
0.4764631
12
Load the all files from the specified directory and insert all valid output entries.
static async loadDirectory(source, entries) { const files = await Helper_1.readDirectory(source.path); for (const file of files) { const path = Path.join(source.path, file); const stat = Fs.statSync(path); if (stat.isDirectory()) { await Helper_1.loadD...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadFiles() {\n loadConfig();\n loadDictionary();\n loadBlacklist();\n loadBonusPhrases();\n\n console.log('All files loaded');\n}", "function loadDir(dir) {\n\tvar elements = dir.getFiles();\n\n\tfor(var i in elements) {\n\t\tallElements.push(elements[i]);\n\t}\n}", "async loadAll () {...
[ "0.67507744", "0.6129062", "0.60493284", "0.5750803", "0.5679318", "0.5656876", "0.55270255", "0.5499269", "0.54722315", "0.5460549", "0.5418319", "0.53769046", "0.53022766", "0.52997226", "0.5275069", "0.52672", "0.5245049", "0.5242938", "0.52218586", "0.5202343", "0.5197440...
0.5640865
6
Load all valid files and directories and insert all valid output entries.
static async loadPath(source, entries) { const stat = Fs.statSync(source.path); if (stat.isDirectory()) { await Helper_1.loadDirectory(source, entries); } else if (stat.isFile()) { await Helper_1.loadFile(source, entries); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadFiles() {\n loadConfig();\n loadDictionary();\n loadBlacklist();\n loadBonusPhrases();\n\n console.log('All files loaded');\n}", "[loadAllSource]() {\n let ret = [];\n let test = {};\n // dump static html files\n let sopt = this[config].format({\n ...
[ "0.65656954", "0.6011214", "0.5688924", "0.560649", "0.5588388", "0.54939044", "0.5488964", "0.54608905", "0.5376956", "0.53236735", "0.52870035", "0.5270994", "0.52674675", "0.522288", "0.5200525", "0.5165264", "0.5146563", "0.5145445", "0.511089", "0.5109779", "0.5076436", ...
0.0
-1
Load the specified package.json and insert all valid output entries.
static async loadPackage(source, entries, cache) { const json = JSON.parse(await Helper_1.readFile(Path.join(source.path, 'package.json'))); const dependencies = json.dependencies || {}; for (const name in dependencies) { if (!cache.has(name)) { cache.add(name); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function mergePackageJsons () {\n const rawJson = await template.generate({\n directory: `${PLUGIN_PATH}/boilerplate/src`,\n template: 'package.json.ejs',\n props: {}\n })\n\n\n const newPackageJson = JSON.parse(rawJson)\n const currentPackage = filesystem.read('package.json', 'jso...
[ "0.6768876", "0.6704048", "0.6496228", "0.626446", "0.6226382", "0.6174034", "0.61040765", "0.5878229", "0.5863827", "0.5813298", "0.58004534", "0.57394046", "0.5709582", "0.5706456", "0.5686622", "0.56394255", "0.56085056", "0.55966", "0.54233646", "0.53956544", "0.53660756"...
0.5875243
8
Compile all specified sources according to the provided settings.
static async compile(settings) { const entries = []; const cache = new Set(); for (const source of settings.sources) { if (source.package) { await Helper_1.loadPackage(source, entries, cache); } else { await Helper_1.loadPath(so...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compile() {\n fs.readFile(src, 'utf8', function(err, str){\n if (err) {\n next(err);\n } else {\n compiler.compile(str, function(err, str){\n if (err) {\n next(err);\n } else {\n fs.wri...
[ "0.64634377", "0.6232924", "0.62080824", "0.6045781", "0.60140675", "0.6009735", "0.6006568", "0.5841376", "0.5833294", "0.5738702", "0.56912714", "0.5622615", "0.55668235", "0.54926914", "0.5492508", "0.5468235", "0.5452485", "0.5447331", "0.5386469", "0.53827274", "0.538149...
0.7789481
0
load all event listeners
function loadEventListeners(){ // add task event form.addEventListener("submit",addTask); // remove task event taskList.addEventListener("click",removeTask); // clear all task clearBtn.addEventListener("click",clearTask); // filter tasks event filter.addEventListener("keyup",filterTasks); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onload(){\n this.loadEventListeners();\n }", "function loadAllEventListeners() {\n // Buttons click event (Event Delegation)\n buttons.addEventListener(\"click\", calculate);\n}", "function loadEventListeners(){\n\n // get dom class names\n const DOM = UICtrl.getDOMStrings();\n ...
[ "0.74555403", "0.7350685", "0.7307958", "0.7222448", "0.7158674", "0.7158674", "0.71433884", "0.71425045", "0.71401626", "0.71262735", "0.7117435", "0.7100264", "0.7089653", "0.7001704", "0.69977254", "0.69968164", "0.6981859", "0.69699496", "0.6946675", "0.69359314", "0.6910...
0.0
-1
get tasks from local storage to DOM
function getTasks(){ let tasks; if(localStorage.getItem("tasks")===null){ tasks=[]; }else{ tasks=JSON.parse(localStorage.getItem("tasks")) } tasks.forEach(function(task){ const li=document.createElement("li"); // add class ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTasks() {\r\n let tasks;//All Task Will Be Include//\r\n if (localStorage.getItem('tasks') === null) {\r\n tasks = [];//Checking local Storage If Tasks Exist Or Not//\r\n } else {\r\n tasks = JSON.parse(localStorage.getItem('tasks'));\r\n\r\n }\r\n tasks.forEach(task => {\r\n //Tasks In l...
[ "0.8005181", "0.7980048", "0.79615325", "0.79495573", "0.7904263", "0.7893976", "0.78768045", "0.78492206", "0.7841766", "0.78391135", "0.7814316", "0.781373", "0.7809443", "0.78078556", "0.7803444", "0.7791063", "0.77859867", "0.7774334", "0.77693886", "0.7760236", "0.775985...
0.7679176
30
store task to local storage
function storeTaskLocalStorage(task){ let tasks; if(localStorage.getItem("tasks")===null){ tasks=[]; }else{ tasks=JSON.parse(localStorage.getItem("tasks")) } tasks.push(task); localStorage.setItem("tasks",JSON.stringify(tasks)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function storeTaslToLocalStorage(task){\n let tasks ;\n if (localStorage.getItem('tasks') === null)\n {\n tasks = [] ;\n }\n else{\n tasks = JSON.parse(localStorage.getItem('tasks')) ;\n }\n tasks.push(task)\n localStorage.setItem('tasks' , JSON.stringify(tasks));\n}", "function storeTasktoLocalS...
[ "0.8147298", "0.81265515", "0.80832875", "0.80539817", "0.8047617", "0.80158377", "0.8013637", "0.80132973", "0.8008056", "0.80060196", "0.79969317", "0.7987765", "0.7983759", "0.797512", "0.7922191", "0.7897835", "0.7889547", "0.7888086", "0.788204", "0.7878212", "0.786633",...
0.81074184
2
remove from local storage function
function removeTaskFromLocalStorage(taskItem){ let tasks; if(localStorage.getItem("tasks")===null){ tasks=[]; }else{ tasks=JSON.parse(localStorage.getItem("tasks")) } tasks.forEach(function(task,index){ if(taskItem.textContent===task){ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remover(id) {\n localStorage.removeItem(id)\n }", "lremove(key) {\n localStorage.removeItem(key)\n }", "function eliminarLocalStorage(){\n\tlocalStorage.clear();\n}", "function removeItemFromLocalStorage (key){\n window.localStorage.removeItem(key);\n}", "function vaciar_local_storag...
[ "0.78606534", "0.7837143", "0.7807057", "0.7803933", "0.77830267", "0.77517", "0.76510155", "0.76322025", "0.76306987", "0.7625237", "0.7620818", "0.7617105", "0.761006", "0.75845444", "0.7583299", "0.7566576", "0.75432134", "0.7534487", "0.7534487", "0.75308627", "0.75308627...
0.0
-1
clear all task function
function clearTask(){ // this one way of doing it //taskList.innerHTML=" "; // this is the best way to do it cause its faster while(taskList.firstChild){ taskList.removeChild(taskList.firstChild); } // clear from all from local storage clearTasksFromLocalStorage(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearTasks() {\n\t\t\tlongTasks = [];\n\n\t\t\tlongTasksTime = 0;\n\t\t}", "function clear_loops() {\n tasks.clear();\n}", "function clear_loops() {\n tasks.clear();\n}", "function clear_loops() {\n tasks.clear();\n}", "function resetTasks() {\n\t\t\tfor (var i = 0; i < vm.tasks.length; i++) {\...
[ "0.7667062", "0.7587428", "0.7587428", "0.7587428", "0.7571518", "0.75491923", "0.751866", "0.7459951", "0.73090863", "0.7217075", "0.71883446", "0.71863693", "0.71619546", "0.711397", "0.70746094", "0.7007247", "0.7000983", "0.6993951", "0.69871694", "0.69795454", "0.6969644...
0.70133495
15
clear tasks from all local storage
function clearTasksFromLocalStorage(){ localStorage.clear(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearTasksFromLocalStorage() {\n\t// Brisanje svega\n\tlocalStorage.clear();\n}", "function clearTasksFromLocalStorage() {\r\n localStorage.clear();\r\n}", "function clearTasksFromLocalStorage() {\n localStorage.clear();\n}", "function clearTasksFromLocalStorage() {\n localStorage.clear();\n}", ...
[ "0.88051975", "0.872607", "0.87199616", "0.87199616", "0.87199616", "0.87199616", "0.87199616", "0.87098825", "0.870452", "0.87040275", "0.8691159", "0.86620873", "0.86620057", "0.8645951", "0.8612395", "0.8600827", "0.8561537", "0.84325397", "0.8420338", "0.8270419", "0.8207...
0.8778799
1
renderTable renders dataset to the tbody
function renderTable() { $tbody.innerHTML = ""; for (var i = 0; i < filteredDataSet.length; i++) { // Get the current object and its fields var data = filteredDataSet[i]; var fields = Object.keys(data); // Create a new row in the tbody, set the index to be i + startingIndex var $row = $tbody.i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderTable() {\n clearTable();\n showTable();\n}", "function renderTable(data){\r\n\tlet table = createEmptyTable(\"tableContainer\");\r\n\tcreateHeaderRow(table, data[0]); // Pass any of the data objects to this function\r\n\tcreateResultRows(table, data); // Pass all of the data objects to this fun...
[ "0.7849514", "0.7527733", "0.74847263", "0.7473608", "0.7464576", "0.7461065", "0.7455594", "0.7448528", "0.74323535", "0.7332733", "0.7240026", "0.72366977", "0.7227165", "0.7191492", "0.7186293", "0.7112627", "0.70782065", "0.7044953", "0.6990778", "0.69854", "0.694593", ...
0.78268963
1
Like path.join(), but will always use '/' as separator, even on Windows. See
function joinPaths (path1, path2) { return path1 + (path1.match(/\/$/) ? '' : '/') + path2 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function join() {\n var result = path.join.apply(this, arguments);\n return path.normalize(result);\n}", "function join(...parts) {\n return normalizePath(parts.map(normalizePath).join('/'))\n}", "function join() {\n var paths = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n ...
[ "0.8051584", "0.7902039", "0.78002965", "0.77651393", "0.7556715", "0.7446738", "0.74315757", "0.74260587", "0.7370051", "0.7348006", "0.7348006", "0.7262056", "0.7210406", "0.71838546", "0.7161205", "0.7071759", "0.6889856", "0.6885648", "0.6839229", "0.6782529", "0.6776885"...
0.6784018
19
The callback used in options
function logCallback(event) { console.log('Callback triggered:', this, event); log.value = event.detail.action + ' ' + (event.type === 'toggle' ? this.node.classList[0] : this.node.classList[1]) + '\n' + log.value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callback(){}", "optionsUpdateHook() { }", "_callHandler() {\n let args = [].slice.call( arguments );\n let name = args.length ? args.shift() : '';\n\n if ( name && typeof this._options[ name ] === 'function' ) {\n this._options[ name ].apply( this, args );\n }\n }", "function callb...
[ "0.6850941", "0.67157465", "0.6673966", "0.6667901", "0.6667901", "0.6667901", "0.6667901", "0.6667901", "0.6496416", "0.62083185", "0.6148609", "0.60780215", "0.60105073", "0.6007887", "0.6000525", "0.59801453", "0.59532195", "0.5919587", "0.59138525", "0.59123373", "0.58976...
0.0
-1
problem1:kilometer to meter conversion
function kilometerToMeter(kilometer) { if (kilometer < 0) { return "Distance can not be Negative"; } // 1 kilometer = 1000 meter var meter = 1000 * kilometer; return meter; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function kilometerToMeter(km) \n{\n var meter =km*1000; \n return meter;\n}", "function kilometerToMeter(kiloMeter){\n return kiloMeter * 1000;\n}", "function kilometerToMeter(kilo){\n\n if(kilo<0 ){\n return \"invalid input\";\n }\n \n else{\n var meter = kilo*1000; // 1 kilome...
[ "0.784566", "0.781935", "0.7810848", "0.7722678", "0.7670951", "0.7646261", "0.7632359", "0.75819325", "0.7541807", "0.74808955", "0.74655145", "0.74260885", "0.7422014", "0.741587", "0.7383515", "0.7373134", "0.73644686", "0.73234063", "0.7284883", "0.7270195", "0.72634256",...
0.7548746
8
promblem2: Budget Calculation of Watch,Mobile,Laptop
function budgetCalculator(numberOfWatch, numberOfMobile, numberOfLaptop) { //when the quantity is negative if (numberOfWatch < 0) { return "Number of watch is invalid"; } if (numberOfMobile < 0) { return "Number of mobile is invalid"; } if (numberOfLaptop < 0) { return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function budgetCalculator(watch,phone,laptop){\n var watchPrize=watch*50;\n var phonePrize=phone*100;\n var laptopPrize=laptop*500;\n var total= watchPrize+phonePrize+laptopPrize;\n return total;\n }", "function budgetCalculator(watch, mobile, laptop) {\n var preiceOfWatch = watch * 50;\n var...
[ "0.78480506", "0.78096396", "0.7758187", "0.7675797", "0.76497996", "0.76409954", "0.76201737", "0.75993824", "0.7590999", "0.75623006", "0.7471898", "0.74172205", "0.73904896", "0.73834497", "0.73609585", "0.73483366", "0.7303206", "0.72970635", "0.72878426", "0.72540605", "...
0.7164448
25
problem4:Finding out the largest name
function megaFriend(names) { var maxLength = names[0]; for (var i = 0; i < names.length; i++) { var element = names[i]; //if length of the element is greater than the length of maxLength if (element.length > maxLength.length) { maxLength = element; } } retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function megaFriend(bigName){\n var naam = bigName[0];\n //loop for single name\n for(var i = 0; i < bigName.length; i++){\n //to find largest name\n if(naam.length < bigName[i].length){\n naam = bigName[i];\n }\n }\n return naam;\n}", "function megaFriend(largestN...
[ "0.7692057", "0.76465505", "0.75810754", "0.7500393", "0.7488559", "0.74071234", "0.74065614", "0.73964566", "0.7242247", "0.71748453", "0.712523", "0.70566994", "0.69999397", "0.6960576", "0.69263685", "0.686209", "0.68206024", "0.68176275", "0.68000954", "0.67503923", "0.67...
0.66037637
30
selects specific slice from sample state
function getNames(state$) { return state$.select(function (state) { return state.names; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "randomStartingSlice () {\n let slice = Math.floor(Math.random() * Math.floor(this.moduloBase))\n this.log(`Starting at data slice ${slice}/${this.moduloBase}`)\n return slice\n }", "selectPoints(points, indices) {\n return points.slice(indices[0], indices[1]);\n }", "function select...
[ "0.6032635", "0.5910421", "0.579978", "0.5672064", "0.5659684", "0.5545758", "0.55396336", "0.5511213", "0.5455093", "0.5417509", "0.5416514", "0.5416514", "0.5416514", "0.5416514", "0.5416514", "0.5416514", "0.5416514", "0.5416514", "0.5416514", "0.5416514", "0.5416514", "...
0.0
-1
What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? Only works with 20 right now due to that ugly while loop. Need to figure out a way to procedurally generate that.
function smallestMultiple(lim) { "use strict"; var i = lim; while (i % 2 !== 0 || i % 3 !== 0 || i % 4 !== 0 || i % 5 !== 0 || i % 6 !== 0 || i % 7 !== 0 || i % 8 !== 0 || i % 9 !== 0 || i % 10 !== 0 || i % 11 !== 0 || i % 12 !== 0 || i % 13 !== 0 || i % 14 !== 0 || i % 15 !== 0 || i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findSmallestMultiple(){\n var i;\n var limit=20;\n var num=1;\n\n for(i=1;i<=limit;){\n if(num%i){\n num++;\n i=1;\n continue;\n }\n i++;\n }\n return num;\n}", "function lowestMult(){\n let i = 20+2; \n while (!isMult(i)){\n i+=2; // Go up...
[ "0.7927631", "0.727102", "0.7183339", "0.6831153", "0.6752124", "0.67351156", "0.6731966", "0.65752846", "0.6454855", "0.6448464", "0.643521", "0.64110464", "0.6375475", "0.63354534", "0.6316699", "0.6310663", "0.6307797", "0.62969804", "0.6271851", "0.6266316", "0.62476945",...
0.69305664
3
function that checks for Animation
function checkAnimation (params){ if(params.reversed()){ params.play() }else{ params.reverse() } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isAnimating() {\n return animationFrame > 1;\n }", "function checkAnimation() {\n\t var $elem = $('.slide-intro');\n\n\t // If the animation has already been started\n\n\t if (isElementInViewport($elem)) {\n\t // Start the animation\n\t\t\t$('.easing').css('opacity', '1');\n\t\t\t$('.easing')...
[ "0.75167483", "0.73230445", "0.7319692", "0.72553587", "0.71821916", "0.71016157", "0.7059753", "0.6929053", "0.6908899", "0.68990165", "0.686904", "0.67997754", "0.6781306", "0.6775478", "0.6771158", "0.67670083", "0.67670083", "0.676688", "0.67227596", "0.66883034", "0.6685...
0.6941301
7
stes position for centrl box
function setBoxPosition (x, y){ gsap.to('.center-box', 0.1, {x, y, ease: "slow(0.7, 0.7, false)"}) gsap.to('.float', 0.1, {x: -(x/2), y: -(y/2), ease: 'slow(0.7, 0.7, false)'}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set center(value) {}", "set Center(value) {}", "_updatePosFromCenter() {\n let half = this._size.$multiply(0.5);\n this._topLeft = this._center.$subtract(half);\n this._bottomRight = this._center.$add(half);\n }", "set TopCenter(value) {}", "set LeftCenter(value) {}", "function al...
[ "0.7159643", "0.7095158", "0.6659382", "0.6570694", "0.65214574", "0.6518427", "0.6384169", "0.6342635", "0.6321248", "0.6316335", "0.6277457", "0.6259679", "0.62231034", "0.6216236", "0.6190536", "0.6183378", "0.61687577", "0.6128724", "0.6113058", "0.6109398", "0.60474384",...
0.6700388
2
with componentDidMount, the async goes before it instead of after like usual functions
async componentDidMount() { this.initViz(); const fetchedData = await fetchData(); // fetchData is an asyncronous function so it needs an await console.log("Fetched data " + fetchedData); this.setState({ data: fetchedData, graphType: "barGraph"}); // let fetchedCountryHotSpots = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async componentDidMount() {\n //The API calls should be made in componentDidMount method always.\n }", "async componentDidMount() {\n \n }", "componentDidMount() {\n this.loadAsyncData();\n }", "async componentDidMount() {\n catchErrors();\n cacheRequests();\n this.prop...
[ "0.7677299", "0.7527892", "0.7517258", "0.7446366", "0.7438629", "0.7368322", "0.7330473", "0.724021", "0.724021", "0.7232888", "0.72320026", "0.7230114", "0.7212526", "0.7195965", "0.719557", "0.71909094", "0.71598417", "0.71159977", "0.7114146", "0.7091011", "0.7079119", ...
0.0
-1
display search results from elasticsearch on page
function display(hits_out) { var htmlStr = ""; htmlStr += "<article class='result'>"; htmlStr += "<p>The variable you selected is present in the dataset:</p>"; htmlStr += "<h2>" + hits_out[0].datasetName + "</h2>"; htmlStr += "<span class='result-label'>External dataset URL: </span> <a href='" + hit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function search(){\r\n if (!searchField.value)\r\n return;\r\n\r\n let results = searchEngine.search(searchField.value,{\r\n fields: {\r\n tags: { boost: 3 },\r\n title: { boost: 2 },\r\n body: { boost: 1 }\r\n }\r\n }); \r\n\r\n searchResults.clas...
[ "0.7611812", "0.7113927", "0.692058", "0.6685652", "0.6675515", "0.6658772", "0.66585255", "0.6618842", "0.6495402", "0.64904493", "0.6489702", "0.6482521", "0.646545", "0.64451885", "0.64444834", "0.6441153", "0.64365304", "0.6404101", "0.6402688", "0.6383827", "0.638243", ...
0.0
-1
Hugo Logic Changed 2/3/14
function checkHugo(){ if ($("#cover-0").is(":checked") && $("#sim-0").is(":checked") && $("#pass-0").is(":checked") && $("#cancel-0").is(":checked")){ hideHugoFunc(".hugo-1111"); // all - 1111 //Three Active } else if ($("#cover-0").is(":checked") && $("#sim-0").is(":checked") && $("#pass-0").is(":checked...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected internal function m252() {}", "private internal function m248() {}", "private public function m246() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "transient final protected internal function m174() {}", "transient private i...
[ "0.58342624", "0.5692217", "0.5348937", "0.52482444", "0.5231545", "0.5206317", "0.5153214", "0.51030415", "0.5069998", "0.5043751", "0.5043751", "0.5032125", "0.5021178", "0.50162053", "0.49965623", "0.49851498", "0.49662176", "0.49629167", "0.4958088", "0.4884894", "0.48780...
0.0
-1
This is similar to React.lazy, but implemented manually. We use this to Suspend rendering of this component until we fetch the component and the legacy React to render it.
function readModule(record, createPromise) { if (record.status === 'fulfilled') { return record.result; } if (record.status === 'rejected') { throw record.result; } if (!record.promise) { record.promise = createPromise().then( value => { if (record.status === 'pending') { r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function withLazyLoading(WrappedComponent, selectData) {\n // ...and returns another component...\n return class extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n contentLoading: true\n };\n }\n \n componentDidMount() {\n ...
[ "0.6955229", "0.6443283", "0.628506", "0.6209939", "0.617213", "0.6154242", "0.60728747", "0.59945476", "0.5965039", "0.5965039", "0.5965039", "0.5965039", "0.5965039", "0.5965039", "0.5965039", "0.5965039", "0.5965039", "0.5965039", "0.5965039", "0.5965039", "0.5965039", "...
0.0
-1
Checks if the environment is not production
function check(req, res, next){ // *Checking if the environment is set to production: if(process.env.NODE_ENV === 'production'){ // *If it is: // *Blocking this route: res.status(404).end(); } else{ // *If it's not: // *Allowing this route: next();...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isProduction() {\n return argv.production\n}", "function isProductionBuild() {\n return process.env.NODE_ENV === 'production';\n}", "function isDev() {\n return (process.env.NODE_ENV !== 'production')\n}", "function isDeployment() {\n return !isDev()\n}", "function isProdMode() {\n return p...
[ "0.7970355", "0.7920762", "0.77976745", "0.7613523", "0.75806284", "0.7199788", "0.702273", "0.70153713", "0.69918215", "0.68239987", "0.68125105", "0.6795169", "0.6771464", "0.66936857", "0.6601974", "0.6568573", "0.6521055", "0.6493232", "0.6423214", "0.6404538", "0.6351181...
0.5769295
37
Cleans all the api information Does require environment check (not available in production) Does not require admin authentication
function reset(req, res, next){ // *Starting a new promise chain: new Promise((resolve, reject) => { // *Getting all the collections from the database: mongoose.connection.db.collections((err, collections) => { // *Rejecting if there is some error: if(err) return re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearAuthHeaderForAPI() {\n $localStorage.Authorization = undefined;\n delete $http.defaults.headers.common.Authorization;\n }", "function cleanUrlForLogging(baseUrl, apiUrl) {\n var url = apiUrl;\n // Trim the host name\n url = url.substring(baseUrl.length);\n // Filter the que...
[ "0.6446746", "0.6240102", "0.6229265", "0.6098612", "0.5960985", "0.5913003", "0.5836609", "0.5785887", "0.5764772", "0.57537156", "0.57230806", "0.57137966", "0.56178015", "0.5590479", "0.556895", "0.55683875", "0.55683875", "0.5517607", "0.55156815", "0.55156815", "0.551148...
0.49306569
100
Check to see if the last digit of the serial number is even
function isLastDigitEven(serial) { return ['0', '2', '4', '6', '8'].indexOf(serial[serial.length - 1]) > -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isLastDigitEven()\n{\n var lastDigitEven = false;\n var numAsArray = numInString.split('');\n var lastDigit = parseInt(numAsArray[numAsArray.length-1]);\n if ( lastDigit%2 === 0)\n {\n lastDigitEven = true;\n }\n return lastDigitEven;\n}", "function checkEven(number) {\n return +number ...
[ "0.7908323", "0.6793018", "0.6766805", "0.6733871", "0.67241544", "0.66742706", "0.66430086", "0.6532519", "0.65318376", "0.6527472", "0.6525298", "0.6458934", "0.6426635", "0.6425248", "0.6412996", "0.6407369", "0.6407369", "0.6407369", "0.6407369", "0.6407369", "0.6407369",...
0.8904864
0
prints false; This happens because of autoboxing All global items/functions are present in global object; Only works in nodejs and not in browser; In browser, everything is present inside 'window';
function foo2() { this.p = "something" return 10; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function functionTest(){\n 'use strict';\n console.log(this===window);\n}", "function isGlobalObj(obj) {\n return obj && obj.Math == Math ? obj : undefined;\n }", "function isGlobalObj(obj) {\n\t return obj && obj.Math == Math ? obj : undefined;\n\t}", "function isGlobalObj(obj) {\n return obj && obj...
[ "0.6287854", "0.60456985", "0.601794", "0.5965119", "0.5859316", "0.5859316", "0.5859316", "0.5859316", "0.5859316", "0.5859316", "0.58202535", "0.58202535", "0.57850784", "0.5768192", "0.5684884", "0.5684884", "0.5649578", "0.5645866", "0.5626299", "0.5624546", "0.5624546", ...
0.0
-1
arrange pieces and display them
function arrange() { for(var i = 0; i < 15; ++i) { pieces[i].element.style.left = pieces[i].col*100 + "px"; pieces[i].element.style.top = pieces[i].row*100 + "px"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "display() {\n for (let i = 0; i < this.pieces.length; i++) {\n let x_cord = this.pieces[i][0];\n let y_cord = this.pieces[i][1];\n let curr_piece = this.gameboard[x_cord][y_cord];\n imageMode(CORNER);\n if (!(curr_piece === null)) {\n ima...
[ "0.6297676", "0.6286874", "0.61758965", "0.59853435", "0.5978342", "0.59487545", "0.57742965", "0.5745598", "0.57429105", "0.573767", "0.57343435", "0.57118815", "0.56973803", "0.5696995", "0.5677015", "0.5674886", "0.5650588", "0.5642622", "0.56358206", "0.56186724", "0.5614...
0.6726494
0
change the background of pieces
function changeBackground() { var image = document.getElementById("select-background").value; for(var i = 0; i < 15; ++i) { pieces[i].element.style.backgroundImage = 'url(' + image + ')'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeBackground() {\n\t\tvar url = this[this.selectedIndex].value;\n\t\tvar pieces = document.getElementById(\"puzzlearea\").childNodes;\n\t\tfor (var i = 0; i < pieces.length; i++) {\n\t\t\tpieces[i].style.backgroundImage = \"url(backgrounds/\" + url + \")\";\n\t\t}\n\t}", "function setBackground()\n{...
[ "0.67623925", "0.6748835", "0.67444247", "0.67290896", "0.66585714", "0.66413784", "0.6636094", "0.66154504", "0.6606246", "0.65742105", "0.6525301", "0.6525265", "0.65244126", "0.6509492", "0.6507725", "0.64866513", "0.6476248", "0.6463289", "0.6416412", "0.6416327", "0.6413...
0.6754072
1
Sleep function to make requests with specific request Too many request can get the Ip blocked
async function sleep(millisecond) { return new Promise(resolve => setTimeout(resolve, millisecond)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendRequests1() {\n sendRequests(tokenList[0], userIdList[0], pathList_1h, nextUser);\n setTimeout(sendRequests1, 3600000);\n}", "function sendRequests24() {\n sendRequests(tokenList[0], userIdList[0], pathList_24h, nextUser);\n setTimeout(sendRequests24, 86400000);\n}", "static async rate...
[ "0.6498944", "0.64211476", "0.63160515", "0.6250126", "0.6203081", "0.6166173", "0.60303015", "0.60172266", "0.60161006", "0.593036", "0.5918554", "0.5916553", "0.588655", "0.5868422", "0.5864593", "0.584806", "0.584806", "0.584806", "0.58417505", "0.5780946", "0.5731615", ...
0.0
-1
enable/disable edit of weight on formfield:edit template
function toggleWeightAnswer() { if( $( '.cisco-audit-flag-ckbox' ).is( ':checked' )) { $( '#field_weight' ).attr('disabled', 'disabled'); } else { $( '#field_weight' ).removeAttr( 'disabled' ); $( '.controls' ).children().remove( '.shadow-element' ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_disableFormFields(editBoolean) {\n const vitalsForm = this.el.querySelector('#vitalsForm');\n View.disableFormFields(vitalsForm, editBoolean);\n }", "enabledEditMode() {\n\n this.state.inEdit = true;\n var vinput = document.getElementById(\"valueInput\" + this.state.id)\n v...
[ "0.62027705", "0.6075599", "0.6001127", "0.5959927", "0.58699507", "0.58297235", "0.5803341", "0.5754702", "0.5718298", "0.5716523", "0.5705164", "0.56094337", "0.5598153", "0.5592595", "0.55852956", "0.557985", "0.55613846", "0.555559", "0.5551834", "0.5551834", "0.5551834",...
0.62815374
0
Only log errors by default
function Logger () { this.loggingLevel = DEFAULT_LOG_LEVEL; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get LOG_ERRORS() {\n return false;\n }", "function error() {\n var args = [];\n for (var _i = 0; _i < (arguments.length - 0); _i++) {\n args[_i] = arguments[_i + 0];\n }\n // Short circuit if logging is disabled. This is as close to noop as we can get, incase th...
[ "0.7058797", "0.68583095", "0.68341404", "0.6745643", "0.6734991", "0.6706126", "0.6696052", "0.6690024", "0.6689707", "0.66385514", "0.6574505", "0.65733343", "0.6533716", "0.64891285", "0.6475518", "0.6452629", "0.64421296", "0.6433055", "0.64075047", "0.63972855", "0.63942...
0.0
-1
verifies if routeName is the one active (in browser input)
function activeRoute(routeName) { return window.location.href.indexOf(routeName) > -1 ? true : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "activeRoute(routeName) {\n\t\treturn this.props.location.pathname.indexOf(routeName) > -1 ? true : false;\n\t}", "function activeRoute(routeName) {\n return location.pathname === routeName;\n }", "function activeRoute(routeName) {\n return props.location.pathname.indexOf(routeName) > -1 ? true : fal...
[ "0.8147622", "0.80822146", "0.8066798", "0.8066798", "0.787598", "0.77684444", "0.7708424", "0.7453331", "0.744529", "0.744529", "0.744529", "0.744529", "0.744529", "0.744529", "0.732731", "0.7254783", "0.72181565", "0.7135263", "0.7058537", "0.6689704", "0.66354954", "0.64...
0.8122798
3
Llenar tabla de productos
function product_table () { $.ajax({ url: 'get_products', method: 'GET', success: (response) => { let template = ''; response.forEach(record => { template += ` <tr> ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showProducts() {\n connection.query(\"SELECT * FROM `products`\", function(err, res) {\n var table = new Table({\n head: [\"ID\", \"Product\", \"Department\", \"Price\", \"Stock\"],\n colWidths: [4, 18, 17, 10, 7]\n });\n\n for (var i = 0; i < res.length; i++) {\n table.push([\n ...
[ "0.73544055", "0.71088", "0.7015518", "0.6998699", "0.6952912", "0.69514626", "0.68935716", "0.688662", "0.6885424", "0.6876584", "0.6872862", "0.68606484", "0.6856435", "0.6848451", "0.6842942", "0.682511", "0.68203294", "0.6801492", "0.67952186", "0.674008", "0.67108536", ...
0.617778
83
codigo para el csrf token de django
function getCookie(name) { var cookieValue = null; if (document.cookie && document.cookie != '') { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = jQuery.trim(cookies[i]); // Does this cookie string...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "csrfToken() {\n if (!this.isSafe() && !this.isCrossOrigin()) {\n return up.protocol.csrfToken()\n }\n }", "function getCSRFToken() {\r\n var csrfToken = $('#forgeryToken').val();\r\n return csrfToken;\r\n }", "static token() {\n return document.querySelector('meta[name=\"csrf-to...
[ "0.73719716", "0.71319234", "0.70749635", "0.7012012", "0.70112145", "0.6942964", "0.6787509", "0.6758194", "0.67191696", "0.6683848", "0.6656025", "0.6631993", "0.6609194", "0.6606711", "0.65920895", "0.65756845", "0.6155269", "0.6143795", "0.6136809", "0.6120877", "0.611979...
0.0
-1
Get customer info from local storage immediately
componentDidMount() { var getCustomer = this.props.getCustomerInfo; getCustomer(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getCustomer(){\n return(\n this.formState ?\n this.storage.getItem('customers', this.customerId) : {}\n )\n }", "function GetCustomerInfo(){\n if(ValidateEmail(document.querySelector('#userEmail').value)){\n localStorage.clear();\n let email = document.querySelecto...
[ "0.72351456", "0.70462763", "0.65132636", "0.63347554", "0.6244073", "0.6231463", "0.61885804", "0.6170357", "0.6170357", "0.615464", "0.61373365", "0.6128663", "0.60956156", "0.6078016", "0.60490847", "0.60369164", "0.6030082", "0.6014681", "0.6009421", "0.600723", "0.597015...
0.0
-1
Once customer has loaded, input values are set appropriately to customer info
componentDidUpdate(prevProps) { if(prevProps.customer !== this.props.customer) { this.setInputValues(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadCustomerToInput(paramCustomer) {\n $('#inp-first-name').val(paramCustomer.firstName);\n $('#inp-last-name').val(paramCustomer.lastName);\n $('#inp-phone').val(paramCustomer.phoneNumber);\n $('#inp-address').val(paramCustomer.address);\n $('#inp-state').val(paramCustomer.state);\n $('...
[ "0.758572", "0.70769787", "0.68150866", "0.6610169", "0.6531638", "0.62841964", "0.6244077", "0.61934286", "0.61288154", "0.61014134", "0.6094115", "0.60616285", "0.60201275", "0.597532", "0.597435", "0.59601295", "0.59519106", "0.5951413", "0.59221077", "0.58884764", "0.5884...
0.0
-1
INPUT HELPER FUNCTIONS Handle change functions
handleChangeForName (event) { this.setState({ name: event.target.value }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changedInput() {\n\n\t\tlet {isValid, error} = this.state.wasInvalid ? this.validate() : this.state;\n\t\tlet onChange = this.props.onChange;\n\t\tif (onChange) {\n\t\t\tonChange(this.getValue(), isValid, error);\n\t\t}\n\t\tif (this.context.validationSchema) {\n\t\t\tlet value = this.getValue();\n\t\t\tif (this.s...
[ "0.7164257", "0.71482015", "0.6639272", "0.65432924", "0.6503848", "0.6492469", "0.6488233", "0.6474793", "0.6463559", "0.6450831", "0.64380634", "0.64334005", "0.64315075", "0.63986474", "0.6378946", "0.63736796", "0.633396", "0.6315439", "0.63048655", "0.6302307", "0.630121...
0.0
-1
Validate name and city input Can only be letter not numbers or other characters
validateOnlyLetterInput(name) { if(name==='') { return 'This field is required'; } else if(!(/^[A-Za-z\u00C0-\u017F\s]+$/.test(name))) { return 'Invalid input (only letters allowed)'; } return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cityValidation(city) {\r\n var pattern = /^[a-zA-Z]+$/;\r\n if (!pattern.test(city))\r\n displayError(`The city must only contain letters`);\r\n else return pattern.test(city);\r\n}", "validateCity(city){\n if(city){\n if(city.length <= 45){\n let re=/^...
[ "0.78111964", "0.7758719", "0.7756243", "0.73332536", "0.7282593", "0.7225494", "0.7118358", "0.7090071", "0.7072161", "0.69948894", "0.69844395", "0.6884765", "0.6873293", "0.6847333", "0.68403256", "0.68317604", "0.68271446", "0.6789791", "0.67808783", "0.6744976", "0.67155...
0.6924643
11
Validate telephone input Can only be numeric not letters or other characters
validateTelephone(tel) { if(tel==='') { return 'Telephone required'; } else if (!/^\d+$/.test(tel)) { return 'Telephone number invalid' } return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function f_phone(){\n var phone = document.getElementById(\"phone\").value;\n var expresionRegular1=/^\\d{3}-\\d{3}-\\d{3}$/;//<--- con esto vamos a validar el numero\n var expresionRegular2=/\\s/;//<--- con esto vamos a validar que no tenga espacios en blanco\n if(phone === \"\"){\n alert(\"El campo del t...
[ "0.7738034", "0.7699594", "0.7664173", "0.76324314", "0.76234215", "0.75932264", "0.7564696", "0.7540599", "0.7527189", "0.75269216", "0.7458498", "0.74144626", "0.7364549", "0.73470294", "0.73457634", "0.7341128", "0.73391294", "0.73343897", "0.73312587", "0.7330978", "0.732...
0.73810923
12
Validate address input Can only be a combination of letters and numbers but not other characters
validateAddress(address) { if(address==='') { return 'Address required'; } else if (!(/^[A-Za-z\u00C0-\u017F\s\d]+$/.test(address))) { return 'Address invalid (only letters and numbers allowed)' } return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkaddress(){\n var address=document.getElementById(\"address\"); \n // var exp=/^([a-zA-Z])+$/;\n var exp=/^[a-zA-Z0-9\\s\\,\\.\\'\\-]+$/\n if(!exp.test(address.value))\n {\n address.style.border=\"solid red\";\n alert(\"Address can contain alphabets,numbers,whitespace, comm...
[ "0.75633734", "0.75191694", "0.7334822", "0.7168685", "0.7145135", "0.7132841", "0.71000534", "0.7087725", "0.7065335", "0.70550233", "0.7033307", "0.7024048", "0.7012857", "0.6967809", "0.6853584", "0.6841363", "0.6832504", "0.68044376", "0.6801599", "0.68011135", "0.6798414...
0.79178613
0
Validate postal codes Can only be numbers not other characters Watch out for postal code length; Shortest postal code in the world is 2 digits Longest postal code in the world is 10 digits
validatePostalCode(postalCode) { if(postalCode==='') { return 'Postal code required'; } else if (!/^\d+$/.test(postalCode)) { return 'Postal code invalid' } else if (postalCode.length > 10 || postalCode.length < 2) { return 'Postal code invalid (must be betwee...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isValidPostalcode(postalcode) {\n if (postalcode.search) {\n postalcode = removeSpaces(postalcode);\n if (postalcode.length == 6 && postalcode.search(/^[a-zA-Z]\\d[a-zA-Z]\\d[a-zA-Z]\\d$/) != -1) return true;\n else if (postalcode.length == 7 && postalcode.search(/^[a-zA-Z]\\d[a-zA-Z]-\\d...
[ "0.7818092", "0.7714868", "0.76456887", "0.7630285", "0.750667", "0.75054955", "0.7432687", "0.7343139", "0.7339933", "0.7333907", "0.7321405", "0.7270124", "0.7157657", "0.7098975", "0.7029816", "0.7018752", "0.6992725", "0.6958379", "0.6910278", "0.68773144", "0.6846916", ...
0.8016031
0
RENDER HELPER FUNCTIONS Render submit button render distinguishes between disabled buttons and clickable buttons visually
getSubmitButton() { if(this.canSubmit()) { return ( <div className="row"> <div className="submitBtn text-center col-md-12"> <input className="btn btn-lg btn-primary" type="submit" value="Order" /> </div> ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "generateSubmitButton(){\n var validity = this.state.keyValid[this.state.currKey];\n if (this.state.roundTwo) {\n if (this.state.upload !== null || this.state.processingFetch || this.state.md5Progress !== null) {\n return <Button bsStyle=\"success\" disabled><i className=\"ic...
[ "0.6979947", "0.66363114", "0.6524494", "0.652043", "0.6510214", "0.6508888", "0.6507419", "0.6502735", "0.64523375", "0.6416179", "0.63853514", "0.6370421", "0.63602674", "0.63593614", "0.6324794", "0.62765807", "0.62674123", "0.62634283", "0.6259439", "0.6250896", "0.625080...
0.73513955
0
Returns true if user has provided all info and no info is illformed
canSubmit() { return ( this.validateOnlyLetterInput(this.state.name)==='' && this.validateTelephone(this.state.telephone)==='' && this.validateAddress(this.state.address)==='' && this.validatePostalCode(this.state.postalCode)==='' && this.validateOnlyL...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "thereIsSomeUserInfo() {\n return this.state.location.length > 0 || this.state.occupation.length > 0 || this.state.education.length > 0\n }", "function hasUserOptedInOrOut () {\n const insightOptOut = insight.realOptOut === undefined;\n return !(insightOptOut);\n}", "validateAboutMe() {\n if (t...
[ "0.7127391", "0.6441266", "0.62774855", "0.6269094", "0.62019295", "0.6133937", "0.60675037", "0.604651", "0.59767824", "0.59737974", "0.5936712", "0.59323007", "0.59308624", "0.591625", "0.5900562", "0.5891852", "0.5888303", "0.5873272", "0.5869959", "0.5868756", "0.5852172"...
0.0
-1
INTERNAL typeguard: does not extensively check, if obj is an alternative RecognitionResult, but only if it "could" be a alternitve RecognitionResult
function _isAlternativeRecognitionResult(obj) { return obj && typeof obj === 'object'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function camCheckExtraObjective()\n{\n\tvar extraObjMet = true;\n\tif (camDef(__camVictoryData) && camDef(__camVictoryData.callback))\n\t{\n\t\tvar result = __camGlobalContext()[__camVictoryData.callback]();\n\t\tif (camDef(result))\n\t\t{\n\t\t\tif (!result)\n\t\t\t{\n\t\t\t\t__camGameLost();\n\t\t\t\treturn;\n\t...
[ "0.50504714", "0.5029648", "0.49931213", "0.49901748", "0.49594894", "0.49497172", "0.48728597", "0.48171902", "0.48068607", "0.48068607", "0.4797814", "0.476915", "0.47187054", "0.46962565", "0.46944886", "0.46911362", "0.4674138", "0.46560475", "0.46375087", "0.4627557", "0...
0.79507756
0
HELPER functions for click/touch events
function getType(evt, _data) { return evt.originalEvent ? evt.originalEvent.type : evt.type; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onTap(e) {}", "function touchHandler(e)\n {\n // preventDefault also disables pinching and scrolling while touching\n // on qml application\n e.preventDefault();\n var at = {\n layerX: e.touches[0].pageX - element.offsetLeft,\n layerY: e.touches[0].pageY - el...
[ "0.72731954", "0.72400796", "0.72400796", "0.690285", "0.68740255", "0.68728876", "0.6745474", "0.66966546", "0.6692747", "0.6689452", "0.66672915", "0.665629", "0.665629", "0.66432244", "0.6638888", "0.6626091", "0.65988433", "0.65357155", "0.6512687", "0.6490216", "0.646691...
0.0
-1
HELPER functions for speech events
function isRecognition(evt, data) { //FIXME should check the data argument!!! return !isUnderstanding(evt, data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onSpeechStart(e) {\n \n }", "function speak(){}", "function speak() {\n\n var defaultTxt = \"When you have arrived at your destination, double tap the middle of your screen.\"; \n var inputTxt = defaultTxt + getCurrDirection();\n audio(inputTxt);\n\n}", "speak(text){this.__text=text;if(this.syn...
[ "0.77283585", "0.696167", "0.6692465", "0.66335064", "0.657044", "0.64894956", "0.64854604", "0.6292686", "0.6270821", "0.62501675", "0.61879885", "0.61780536", "0.617287", "0.6160807", "0.6133498", "0.6123214", "0.61139756", "0.61019635", "0.60999614", "0.6084898", "0.607288...
0.0
-1
Toggles visibility of main and side contents on S screen size (mobile device).
toggleContents() { if (this.breakpoint === this.sizeS && this.sideContentVisibility !== _SideContentVisibility.default.AlwaysShow) { this._toggled = !this._toggled; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggleContents() {\n\t\tif (this.breakpoint === this.sizeS && this.sideContentVisibility !== SideContentVisibility.AlwaysShow) {\n\t\t\tthis._toggled = !this._toggled;\n\t\t}\n\t}", "function desktopSetUp () {\n $('.hiddenMobile').show()\n $('.viewMobile').hide()\n }", "function mediaQuery(){\r\n ...
[ "0.74804443", "0.6904376", "0.6903499", "0.6828726", "0.6815943", "0.67582655", "0.66987824", "0.6670464", "0.66629714", "0.66629714", "0.66470176", "0.6639611", "0.6621228", "0.6613253", "0.65632606", "0.6550563", "0.65147203", "0.6513244", "0.6489852", "0.64868677", "0.6467...
0.7642961
0
Redraws the graph's nodes and edges
function repaint () { panel.innerHTML = '' graph.draw(graphSVG) if (selected !== undefined) { const bounds = selected.getBounds() drawGrabber(bounds.x, bounds.y) drawGrabber(bounds.x + bounds.width, bounds.y) drawGrabber(bounds.x, bounds.y + bounds.height) drawGrabber(b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function redraw_graph(data) {\n\tlink = link.data(data.links);\n\tlink.exit().remove();\n\tlink.enter().insert(\"line\", \".node\").attr(\"class\", \"link\");\n\tnode = node.data(data.nodes);\n\tnode.enter().insert(\"circle\", \".cursor\").attr(\"class\", \"node\").attr(\"r\", 5).call(force.drag);\n\tforce.start()...
[ "0.73754734", "0.7319367", "0.7319367", "0.7304894", "0.7271081", "0.7270043", "0.69844776", "0.68488497", "0.6782174", "0.674643", "0.6697963", "0.6697255", "0.6696004", "0.66793054", "0.66166633", "0.66077083", "0.66038084", "0.6595464", "0.64981323", "0.6451944", "0.642442...
0.7171738
6
When we scroll below the hero image, hide the floating arrow
function scrollDown(){ if (document.body.scrollTop > (mainImg.offsetHeight - mainImg.offsetHeight/2) || document.documentElement.scrollTop > (mainImg.offsetHeight- mainImg.offsetHeight/2)) { scrollDownBtn.style.display = "none"; } else { scrollDownBtn.style.display = "block"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scrollingHeroFixed (){\n if (apolloConfig.heroStyle==\"fixed\"){\n if (window.innerHeight < window.pageYOffset){\n if (!document.getElementById(\"hero\").classList.contains(\"scroll-opacity\")){\n document.getElementById(\"hero\").classList.add(\"scroll-opacity\");\n ...
[ "0.65109396", "0.63688195", "0.63421816", "0.63052225", "0.6262476", "0.61886203", "0.6165312", "0.60993236", "0.6090303", "0.6088156", "0.60684764", "0.5982233", "0.5920154", "0.59089506", "0.59012187", "0.5894081", "0.5879341", "0.5875562", "0.5875472", "0.5864227", "0.5850...
0.61290705
7
Change the innerHTML of the 'see more' button when clicked
function changeHTML() { counter++; if(counter % 2 != 0){ collapseBtn.innerHTML = "See Less" }else{ collapseBtn.innerHTML = "See More" } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showMore() {\n var see = document.getElementById(\"itemDetail\");\n see.innerHTML = \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Adipisci earum ut, quasi laborum ex sunt est in provident atque corporis, animi debitis dicta. Quae perferendis delectus eveniet aspernatur pariatur adipisci...
[ "0.7420279", "0.74074334", "0.7113127", "0.7042495", "0.6954478", "0.6954361", "0.6858997", "0.6809839", "0.68004775", "0.6761061", "0.6752841", "0.6744938", "0.6728595", "0.6726968", "0.6647979", "0.6647634", "0.6609412", "0.65796274", "0.6575568", "0.65346354", "0.65169024"...
0.67183995
14
Add ES5 property to datacontext for each named repo
function defineLazyLoadedRepos() { repoNames.forEach(function(name) { Object.defineProperty(service, name, { configurable: true, get: function() { // The 1st time the repo is request via this property, //...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function defineLazyLoadedRepos() {\n repoNames.forEach(function (name) {\n Object.defineProperty(service, name, {\n configurable: true, //will redefine this property once\n get: function () {\n // The 1st time repo is request vi...
[ "0.5638861", "0.5087899", "0.5007258", "0.48988646", "0.48863798", "0.48735526", "0.481738", "0.48104063", "0.47891864", "0.47773698", "0.47747132", "0.47544423", "0.47112888", "0.46189955", "0.45803526", "0.45803526", "0.4566051", "0.4551979", "0.45307487", "0.4520152", "0.4...
0.55992246
1
Speaker Verification methods 1. Start the browser listening, listen for 6 seconds, pass the audio stream to "createVerificationProfile"
function enrollNewTextIndependentVerificationProfile(){ navigator.getUserMedia({audio: true}, function(stream){ console.log('I\'m listening... just start talking for a few seconds...'); console.log('Maybe read this: \n' + thingsToRead[Math.floor(Math.random() * thingsToRead.length)]); onMediaSuccess(stream, crea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startListeningForTextIndependentVerification(){\n\tif (verificationProfile.profileId){\n\t\tconsole.log('I\\'m listening... just start talking for a few seconds...');\n\t\tconsole.log('Maybe read this: \\n' + thingsToRead[Math.floor(Math.random() * thingsToRead.length)]);\n\t\tnavigator.getUserMedia({audi...
[ "0.8015632", "0.63128966", "0.6229999", "0.6185917", "0.6078154", "0.6074523", "0.5950027", "0.5940897", "0.58804595", "0.587012", "0.58620054", "0.58549803", "0.58525664", "0.58220804", "0.5795598", "0.5771831", "0.5751744", "0.56846946", "0.5646417", "0.5597958", "0.5589301...
0.73355085
1
createTextIndependentVerificationProfile calls the profile endpoint to get a profile Id, then calls enrollProfileAudioForVerification
function createTextIndependentVerificationProfile(blob){ // just check if we've already fully enrolled this profile if (verificationProfile && verificationProfile.profileId) { if (verificationProfile.remainingEnrollmentsSpeechLength == 0) { console.log("Verification enrollment already completed"); retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function enrolTextIndependentProfileAudioForVerification(blob, profileId){\n\taddAudioPlayer(blob);\n\n\tif (profileId == undefined)\n\t{\n\t\tconsole.log(\"Failed to create a profile for verification; try again\");\n\t\treturn;\n\t}\n\t \n\tvar request = new XMLHttpRequest();\n\trequest.open(\"POST\", enrolTextI...
[ "0.7532332", "0.698207", "0.6706034", "0.663767", "0.594216", "0.5694968", "0.5627548", "0.5319184", "0.5193571", "0.5189566", "0.50941557", "0.5082831", "0.4935368", "0.49163657", "0.4911987", "0.48204276", "0.4806544", "0.4802883", "0.47832692", "0.473995", "0.47286955", ...
0.856146
0
enrolTextIndependentProfileAudioForVerification enrols the recorded audio with the new profile Id
function enrolTextIndependentProfileAudioForVerification(blob, profileId){ addAudioPlayer(blob); if (profileId == undefined) { console.log("Failed to create a profile for verification; try again"); return; } var request = new XMLHttpRequest(); request.open("POST", enrolTextIndependentVerificationProfileE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createTextIndependentVerificationProfile(blob){\n\t\n\t// just check if we've already fully enrolled this profile\n\tif (verificationProfile && verificationProfile.profileId) \n\t{\n\t\tif (verificationProfile.remainingEnrollmentsSpeechLength == 0)\n\t\t{\n\t\t\tconsole.log(\"Verification enrollment alrea...
[ "0.7231387", "0.68953663", "0.6206323", "0.6118572", "0.6036771", "0.52483076", "0.5101326", "0.496467", "0.4946163", "0.48616207", "0.48402122", "0.48156798", "0.47765115", "0.47541326", "0.47533146", "0.47368702", "0.4703065", "0.4688635", "0.46801543", "0.46562448", "0.465...
0.83739537
0
2. Start the browser listening, listen for 4 seconds, pass the audio stream to "verifyTextIndependentProfile"
function startListeningForTextIndependentVerification(){ if (verificationProfile.profileId){ console.log('I\'m listening... just start talking for a few seconds...'); console.log('Maybe read this: \n' + thingsToRead[Math.floor(Math.random() * thingsToRead.length)]); navigator.getUserMedia({audio: true}, function...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function enrollNewTextIndependentVerificationProfile(){\n\tnavigator.getUserMedia({audio: true}, function(stream){\n\t\tconsole.log('I\\'m listening... just start talking for a few seconds...');\n\t\tconsole.log('Maybe read this: \\n' + thingsToRead[Math.floor(Math.random() * thingsToRead.length)]);\n\t\tonMediaSu...
[ "0.70400035", "0.6240109", "0.6168963", "0.6145623", "0.61122644", "0.6072044", "0.5891715", "0.58835185", "0.586399", "0.58261716", "0.57972664", "0.57942337", "0.57370776", "0.57315403", "0.57209605", "0.5698653", "0.56821215", "0.5659075", "0.5655846", "0.56523883", "0.565...
0.79682857
0
3. Take the audio and send it to the verification endpoint for the current profile Id
function verifyTextIndependentProfile(blob){ addAudioPlayer(blob); var request = new XMLHttpRequest(); request.open("POST", verifyTextIndependentProfileEndpoint(verificationProfile.profileId), true); request.setRequestHeader('Content-Type','application/json'); request.setRequestHeader('Ocp-Apim-Subscription-K...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addAudioPlayer(blob) {\n\n // convertAudioToText(blob);\n var customerID = document.getElementById('customer_id').value;\n\n console.log(\"customerId\", customerID);\n var url = \"/identify/\" + customerID;\n console.log(\"getProfileIdFromCustomerId\");\n var request = new XMLHttpReques...
[ "0.70777804", "0.6981788", "0.6622211", "0.6366225", "0.6331133", "0.62928313", "0.6250822", "0.6243221", "0.6242101", "0.6231552", "0.62051564", "0.6184612", "0.61741585", "0.61697006", "0.6168504", "0.61279136", "0.6122921", "0.610985", "0.61069995", "0.60722077", "0.606309...
0.66634715
2
creates a unique pass code that would be used to authenticate users
function createCode(){ let code = ''; let numOfChars = 5; for(let i = 0; i < numOfChars; i++){ let charIndex = Math.floor(Math.random() * chars.length); code += chars[charIndex]; } return code; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generatePw() {\n var possible = 'abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()';\n var newPassword = '';\n \n for(var i=0; i < 16; i++) {\n newPassword += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n \n ...
[ "0.7366057", "0.7159741", "0.70475155", "0.70400846", "0.699145", "0.68753666", "0.68716466", "0.68618065", "0.683257", "0.6828561", "0.6826255", "0.68208236", "0.67546916", "0.6723244", "0.67050517", "0.66992074", "0.6696635", "0.66940695", "0.66539955", "0.6624554", "0.6616...
0.0
-1
responsible for sending out emails
function sendEmail(email){ if(emails.indexOf(email) > -1){ let code = createCode(); // send user email const request = mailjet .post("send", {'version': 'v3.1'}) .request({ "Messages":[ { "From": { "Email": "ajah@renterland.com", "Name": "Ajah Chukwuemeka" }, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sendEmail() {\n email([EMAIL], null, null, null, null);\n }", "sendMail(options) {}", "async function main () {\n // send mail with defined transport object\n transporter.sendMail({\n from: email, // sender address\n to: 'melphelps@live.co.uk', // list of receivers\n subject:...
[ "0.79389185", "0.7699349", "0.7629744", "0.7236803", "0.71167403", "0.70979303", "0.70905954", "0.7075953", "0.7075555", "0.7040384", "0.7010296", "0.7001953", "0.69805765", "0.6978327", "0.6952047", "0.6948077", "0.6945617", "0.69433945", "0.69369465", "0.6919019", "0.691605...
0.0
-1
updates text in state (used for new todo when added)
handleChange(e) { const text = e.target.value this.setState(prevState => { return {...prevState, currentText: text} }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "text (state, text) {\n state.text = text\n }", "updateText(event) {\n\t\tthis.setState({text: event.target.value});\n\t}", "updateText(text) {\n\t\tthis.text = text;\n\t}", "updateText(contentState) {\n this.props.updateEditorContent({...this.props.content, content: contentState})\n }", "...
[ "0.76557976", "0.72115463", "0.72029126", "0.72002167", "0.7123716", "0.6956378", "0.69185144", "0.68031913", "0.67710316", "0.6769277", "0.6745865", "0.6745865", "0.6732654", "0.6694951", "0.6651518", "0.66417944", "0.65344536", "0.6509812", "0.65085334", "0.65063334", "0.64...
0.6069786
44
update state with new array including new todo object
handleSubmit(e) { e.preventDefault() let text = this.state.currentText this.setState(prevState => { const newToDo = { id: this.state.index, task: text, completed: false } const updatedToDos = prevState.toDos.concat(newToDo) return {...prevState, toDos: updated...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addTodo( todo ) {\n this.setState( prevState => {\n return { todoList: [...prevState.todoList, todo] }\n });\n }", "handleChange(id){\n /* the trickiest part of this that we are dealing with an entire array \n because we are saving an array in our state we never wanna modify state...
[ "0.7496331", "0.742551", "0.73884624", "0.73329264", "0.72995883", "0.7289952", "0.7241332", "0.7219193", "0.7186473", "0.7159773", "0.7151697", "0.71053755", "0.7093718", "0.70490277", "0.7034724", "0.70260984", "0.702352", "0.7023369", "0.6994222", "0.6976241", "0.6949521",...
0.68937516
24
Manages a collection of rules used to convert HTML to Markdown
function Rules(options) { this.options = options; this._keep = []; this._remove = []; this.blankRule = { replacement: options.blankReplacement }; this.keepReplacement = options.keepReplacement; this.defaultRule = { replacement: options.defaultReplacement }; this.array...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Rules(md) {\n // require(\"./header.js\")(md); // TODO Remove if markdown-it-anchor do the job\n require(\"./markdownLink.js\")(md);\n}", "function convertHTMLtoMarkdown() {\n\n}", "function TML2HTML() {\n \n /* Constants */\n var startww = \"(^|\\\\s|\\\\()\";\n var endww = \"($|(?=[\\\\s\\...
[ "0.7240034", "0.6547525", "0.5888856", "0.58674055", "0.5788203", "0.56509256", "0.55675155", "0.55455303", "0.5527107", "0.5502006", "0.54577714", "0.54521674", "0.5429894", "0.5417948", "0.5384536", "0.5370535", "0.5366508", "0.5355434", "0.5354347", "0.5343464", "0.5343464...
0.5112615
40
node.contains is not implemented in IE10/IE11
function containsNode(parent, child) { if (parent === child) return true; child = child.parentNode; while (child) { if (child === parent) return true; child = child.parentNode; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function contains(context, node) {\n if (context.contains) return context.contains(node);\n if (context.compareDocumentPosition) return context === node || !!(context.compareDocumentPosition(node) & 16);\n }", "function contains(context, node) {\n if (context.contains) return context.contains(node);\n i...
[ "0.7405145", "0.72839284", "0.72839284", "0.72839284", "0.72839284", "0.72839284", "0.72839284", "0.72839284", "0.72839284", "0.72839284", "0.72839284", "0.7113728", "0.71054214", "0.71054214", "0.67513883", "0.67513883", "0.6683169", "0.6628995", "0.66206574", "0.6604347", "...
0.0
-1
used for writing dynamic sql queries
function strFromObj(obj, separator, callback) { return Object.keys(obj).map(callback).join(separator) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static sql (sql, values = []) {\n\t\treturn adapter(this).sql({sql, values});\n\t}", "function sqlEngine(results) {\n\n var foundResult = \"\";\n var entityString = whereQueryBuilder(results)\n\n if (results[2] == '') {\n var majors = ['analytics', 'computer_science', 'computer_intelligence', 'so...
[ "0.69644296", "0.65708035", "0.647724", "0.64744985", "0.6430702", "0.64187694", "0.6364367", "0.63542366", "0.6353564", "0.62715536", "0.6179073", "0.6056407", "0.6036559", "0.60167927", "0.6008631", "0.59930587", "0.5984969", "0.59184283", "0.5910398", "0.588128", "0.587740...
0.0
-1
Close Connections Most browsers keep a persistent connection open to the server, which prevents the close callback of httpServer from returning. We need to destroy all connections manually.
closeConnections() { Object.keys(this.connections).forEach((socketId) => { let socket = this.connections[socketId]; if (socket) { socket.destroy(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async stop() {\n // 1. Stop listening for connections at http-server \n this.server.close();\n logger.info('Server closed', {\n eventType: 'INFO',\n eventSubType: 'SERVER_NOT_LISTENING',\n });\n // 2. Serve ongoing requests \n // Wait for a give...
[ "0.72448635", "0.7167022", "0.7143708", "0.712225", "0.7115331", "0.70987296", "0.70270956", "0.7010362", "0.70070773", "0.70070773", "0.70070773", "0.6989043", "0.6982236", "0.69630706", "0.692726", "0.68959904", "0.6880664", "0.68458104", "0.6844883", "0.6844883", "0.683431...
0.71089685
5
intercept original console.log call and use custom logic
interceptLog(originalFn: Function, callback: Function) { return function() { let args = Array.prototype.slice.apply(arguments) callback && callback(args) return originalFn.apply(console, args) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "interceptLogs() {\n const context = {};\n context.console = console;\n\n context.console.log = this._log.bind(this, 'log');\n context.console.warn = this._log.bind(this, 'warn');\n context.console.error = this._log.bind(this, 'error');\n context.console.info = this._log.bind(this, 'info');\n c...
[ "0.76192623", "0.7488285", "0.7379716", "0.7281782", "0.72748274", "0.72748274", "0.7247009", "0.7213931", "0.71696854", "0.71350825", "0.7071236", "0.70660603", "0.70634377", "0.7035593", "0.69503343", "0.6923918", "0.6888902", "0.6888902", "0.6876048", "0.6832993", "0.68118...
0.7264863
6
Showing Tweet to the UI
function showingTweetToUI(){ let tweetUi; tweetList.forEach((tweet) => { // console.log(tweet) tweetUi = document.createElement('div'); tweetUi.className = 'post'; tweetUi.innerHTML = ` <div class="post__avatar"> <img src="images/profile.png" al...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showTweet(){\n\t\t$( \".tweet\" ).each(function( index ) {\n\t\t\tvar tweet = $(this)[0];\n\t\t\tvar id = $(this).data(\"tweet\");\n\n\t\t\ttwttr.widgets.createTweet(\n\t\t\t id, tweet, \n\t\t\t\t{\n\t\t\t\t\tconversation : 'none', // or all\n\t\t\t\t\tcards : 'visible', // or visible \n\t\t\t...
[ "0.7735817", "0.6802577", "0.6690655", "0.66050076", "0.65910435", "0.6489966", "0.6446347", "0.6444245", "0.6443281", "0.6298558", "0.6281251", "0.6273937", "0.6261547", "0.62472117", "0.6243844", "0.6241735", "0.6233948", "0.62226164", "0.61778045", "0.6144027", "0.6139161"...
0.6175714
19
import google from "../../../assets/img/google2.png"; import fb from "../../../assets/img/fb.png";
function Signin(props) { const dispatch = useDispatch() const history = useHistory() // const { loading } = useSelector(state => state.user) const [email, setEmail] = useState('') const [password, setPassword] = useState('') const [isPasswordShow, setisPasswordShow] = useState(false) const tooglePassword...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "makeImagePath2(product) {\n return require(`../assets/images/${product.images[2]}`);\n }", "makeImagePath1(product) {\n return require(`../assets/images/${product.images[1]}`);\n }", "function OjoBot() {\n // Import result is the URL of your image\n return <img src={logo} alt=\"Logo\" />;\n}"...
[ "0.65373373", "0.6514486", "0.64278394", "0.63354903", "0.618742", "0.6071636", "0.59767634", "0.5972957", "0.5960917", "0.59347564", "0.5918777", "0.5917529", "0.5785298", "0.57642096", "0.5679", "0.5653912", "0.56477034", "0.563531", "0.5608079", "0.5596929", "0.55814934", ...
0.0
-1
get data from API
handleCandidateData(expertise) { if (!!expertise) { this.setState({ expertises: expertise }) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getData() {\n const apiName = 'sbrestapi';\n const path = '/alerts';\n const myInit = {\n // OPTIONAL\n headers: {}, // OPTIONAL\n };\n\n return API.get(apiName, path, myInit).catch(err => {\n console.log('There has been a problem with your fetch operation: ' + err);\n throw err;\n });\n...
[ "0.74547446", "0.7175203", "0.7116017", "0.7106319", "0.7032878", "0.69697726", "0.6953986", "0.6945369", "0.6928989", "0.6912363", "0.6909982", "0.689807", "0.68972427", "0.6896975", "0.6878978", "0.68632275", "0.68602943", "0.68599385", "0.6843499", "0.6838825", "0.68328923...
0.0
-1
handling Google Calendar API
handleCalendarAPI(response) { if (response.status === 200) { reactLocalStorage.setObject("candidate", { 'id': this.state.id }) this.setState({ refreshUrl: response.data.data }, () => window.location = this.state.refreshUrl) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadCalendarApi() {\n gapi.client.load('calendar', 'v3', listUpcomingGoogleEvents);\n }", "function makeApiCall() {\n gapi.client.load('calendar', 'v3', function() {\n var request = gapi.client.calendar.events.list({\n 'calendarId': 'primary'\n });\n request.execute(function(res...
[ "0.7106255", "0.6992605", "0.6992107", "0.6986598", "0.69148105", "0.69145846", "0.68985456", "0.6881672", "0.68722415", "0.67887795", "0.67826694", "0.6777894", "0.6772704", "0.6763813", "0.6753639", "0.67487144", "0.67487144", "0.67487144", "0.67408746", "0.67391056", "0.66...
0.0
-1
Enter modal mode (only available in inline mode)
full() { const { options, viewer, image, list, } = this; if (!this.isShown || this.played || this.fulled || !options.inline) { return this; } this.fulled = true; this.open(); addClass(this.button, CLASS_FULLSCREEN_EXIT); if (options.transition) { re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function attShowModal() {\n setShowModal(!showModal);\n }", "function openModal(e) {\n\tmodal.style.display = 'block'\n}", "toggleModal () {\n\t\tthis.model.toggleModalState();\n\t\tthis.view.toggleModal( this.model.isModalOpen )\n\t}", "function openModal(){\r\n modal.style.display = 'block';\r...
[ "0.7333772", "0.71552366", "0.70489734", "0.70430166", "0.7033194", "0.7033194", "0.7025927", "0.7025697", "0.7013962", "0.70117885", "0.6997714", "0.6960952", "0.6956647", "0.6952881", "0.69524413", "0.6947459", "0.6939437", "0.69375086", "0.6935553", "0.692603", "0.692603",...
0.0
-1
Exit modal mode (only available in inline mode)
exit() { const { options, viewer, image, list, } = this; if (!this.isShown || this.played || !this.fulled || !options.inline) { return this; } this.fulled = false; this.close(); removeClass(this.button, CLASS_FULLSCREEN_EXIT); if (options.transition) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "modalExit() {\n this.setState({showModal: false});\n }", "handleModalClose() {}", "closeModal() {\n this.close();\n }", "closeModal() {\n this.closeModal();\n }", "function closeMe() {\n\t\t $('#' + settings.id).modal('hide');\n\t\t if (settings.isSubMo...
[ "0.7023697", "0.70105433", "0.7003755", "0.7001799", "0.6973041", "0.6952068", "0.68531334", "0.6852968", "0.6844382", "0.6819854", "0.6819854", "0.6819854", "0.680962", "0.6797631", "0.67842644", "0.6781869", "0.6780791", "0.6780362", "0.67747384", "0.67615265", "0.67615265"...
0.0
-1
Show the current ratio of the image with percentage
tooltip() { const { options, tooltipBox, imageData } = this; if (!this.viewed || this.played || !options.tooltip) { return this; } tooltipBox.textContent = `${Math.round(imageData.ratio * 100)}%`; if (!this.tooltipping) { if (options.transition) { if (this.fading) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _usfGetImageRatio(img){\r\n return img.width/img.height\r\n}", "_toPercent(ratio) {\n return `${ratio * 100}%`;\n }", "info(img) {\n this.dimWidth = img.offsetWidth;\n this.dimHeight = img.offsetHeight\n this.dimRatio = this.dimWidth/this.dimHeight;\n\n console.log(\"Ratio \...
[ "0.7520043", "0.7285729", "0.7067427", "0.7040571", "0.6988264", "0.6729996", "0.65621054", "0.64790356", "0.64381474", "0.6423382", "0.6416959", "0.64072937", "0.63908905", "0.6376559", "0.6374434", "0.6363022", "0.63216555", "0.63071257", "0.63043845", "0.630333", "0.629309...
0.0
-1
Reset the image to its initial state
reset() { if (this.viewed && !this.played) { this.imageData = assign({}, this.initialImageData); this.renderImage(); } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetImage() {\n originalImage.drawTo(canvas);\n}", "function resetImage() {\n //load the image in canvas if the image is loaded successfully\n ctx = canvas.getContext(\"2d\");\n angleInDegrees = 0;\n currentScale = 1;\n ...
[ "0.80812144", "0.7981414", "0.77821755", "0.77564734", "0.7474954", "0.74530864", "0.73836124", "0.7352847", "0.7300189", "0.72896945", "0.7280115", "0.72387135", "0.7162674", "0.7134731", "0.71132195", "0.71113795", "0.7106549", "0.70850646", "0.70420134", "0.6956846", "0.69...
0.70843536
18
Update viewer when images changed
update() { const { element, options, isImg } = this; // Destroy viewer if the target image was deleted if (isImg && !element.parentNode) { return this.destroy(); } const images = []; forEach(isImg ? [element] : element.querySelectorAll('img'), (image) => { if (isFunction(options.f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refresh() {\n ranArrInd(imgArr.length);\n imgOneEl.src = imgArr[imgInd[0]].path;\n imgTwoEl.src = imgArr[imgInd[1]].path;\n imgThreeEl.src = imgArr[imgInd[2]].path;\n imgOneEl.name = imgArr[imgInd[0]].name;\n imgTwoEl.name = imgArr[imgInd[1]].name;\n imgThreeEl.name = imgArr[imgInd[2]].name;\n img...
[ "0.69419533", "0.6921167", "0.6657174", "0.6602763", "0.65868163", "0.6498638", "0.64568025", "0.63490546", "0.63490546", "0.63298607", "0.6265809", "0.62356186", "0.62270737", "0.62089133", "0.6207338", "0.6182145", "0.6179976", "0.6135054", "0.613121", "0.6129629", "0.61207...
0.66591734
2
Close when someone clicks on the "x" symbol inside the overlay
function closeNav() { fadeOut(document.getElementById("myNav")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "close(){Overlay.overlayStack.closeOverlay(this.overlayElement);}", "close() {\n this.overlayManager.close(this.overlayName);\n }", "function onBackdropClick() {\n close();\n }", "function overlayClick() {\n\toverlay.onclick = function() {\n\t\tcloseOverlay();\n\t}\n}", "function closeOv...
[ "0.7338572", "0.7003684", "0.68057996", "0.6781809", "0.67522454", "0.67243785", "0.6631035", "0.65816396", "0.65758115", "0.6575631", "0.65381044", "0.6497306", "0.64691496", "0.6423803", "0.6420383", "0.6408984", "0.64086246", "0.6367908", "0.63564926", "0.63538605", "0.634...
0.0
-1
this function draws the outlines of the polygon that will be rendered
function drawLoop(){ // while there are less than 3 vertices just draw a line strip if (index < 3) { console.log("index < 3"); gl.drawArrays(gl.LINE_STRIP, 0, index); } // now we have enough vertices to draw triangles // so we construct LINE_LOOPS over three vertices else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Render_polygon(ctx, x1, y1, x2, y2, x3, y3, x4, y4, color) {\n ctx.fillStyle = color;\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.lineTo(x3, y3);\n ctx.lineTo(x4, y4);\n ctx.closePath();\n ctx.fill();\n }", "function drawIOutline (){\n\t// Setup the colo...
[ "0.6843165", "0.67795765", "0.6713452", "0.6690311", "0.66358703", "0.6611088", "0.6466653", "0.63371766", "0.6337125", "0.6333119", "0.6324186", "0.6314906", "0.63100064", "0.63099855", "0.6295678", "0.62796605", "0.6224944", "0.6200305", "0.61892945", "0.6188307", "0.618434...
0.0
-1
renders the object showing offending line segment.
function error() { // cleans the screen paints canvas gl.clear( gl.COLOR_BUFFER_BIT ); console.log("error = " + index); gl.uniform4fv(colLoc, flatten(BLACK)); drawLoop(); console.log("error draw the good stuff first"); // set fragment shader variable fColour to RED draw the lines ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "display() {\n line(this.start.x, this.start.y, this.end.x, this.end.y);\n }", "show() {\n strokeWeight(3);\n stroke(this.clr);\n line(this.posx, this.posy, this.endx, this.endy);\n this.posx = this.endx;\n this.posy = this.endy;\n }", "display() {\n fill(this.color);\n\n ...
[ "0.67629296", "0.641042", "0.63695234", "0.6323292", "0.63075846", "0.61812115", "0.6177252", "0.61295176", "0.6125403", "0.60687536", "0.5999921", "0.59868985", "0.59785646", "0.59623826", "0.5961461", "0.59570044", "0.5954389", "0.5938333", "0.59338737", "0.59254014", "0.59...
0.0
-1
below functions are for vertices testing // / Checks the winding direction of a set of vetices and compares the result with last winding result which is stored in the rotation variable. returns true if winding direction is acceptable for triangle_strip windings
function checkWindings(){ // console.log("checkWindings"); // check if there is less than three vertices to inspect if (index < 2 ){ return true; } // set initial rotation based on current winding else if (index == 2) { rotation = RHTwinding(vertices); // set initial rotation based ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isCCW(face, vertices) {\r\n // Compute relative position of consecutive vertices of the face\r\n // as a sequence of vectors.\r\n var vectors = [];\r\n var p0 = vertices[face[face.length - 1]];\r\n var p1 = vertices[face[0]];\r\n var vector = [p1[0] - p0[0], p1[1] - p0[1]];\r\n vectors.push(vector...
[ "0.638001", "0.60146195", "0.600172", "0.5972172", "0.5945731", "0.58333725", "0.58333725", "0.58045274", "0.56877196", "0.5638125", "0.55829793", "0.55822384", "0.55422854", "0.5480415", "0.5461629", "0.5425114", "0.54213643", "0.54213643", "0.54213643", "0.54213643", "0.542...
0.7925349
0
checks that line segmentsdo not intersect returns true if intersection is found with any other line segment It is assumed that checkIntersection is run after a windings check has been confirmed as acceptable.
function checkIntersection(){ // check that there are enough vertices if (index <= 2) return false; // create an array of edges to test against var test_intersection = []; // for each identified edge pair set loop through for ( var i = 0; i < edges.length; i++) { // push the firs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "doLineSegmentsIntersect (Ax, Ay, Bx, By, Cx, Cy, Dx, Dy) {\n const Sx = Bx - Ax\n const Sy = By - Ay\n const Tx = Dx - Cx\n const Ty = Dy - Cy\n const u = (-Sy * (Ax - Cx) + Sx * (Ay - Cy)) / (-Tx * Sy + Sx * Ty)\n const v = (Tx * (Ay - Cy) - Ty * (Ax - Cx)) / (-Tx * Sy + Sx * Ty)\n return u >...
[ "0.7118126", "0.7096089", "0.69276065", "0.6875121", "0.67793757", "0.6659825", "0.6648933", "0.66282725", "0.6552229", "0.6523466", "0.6510755", "0.6474765", "0.6434639", "0.6371882", "0.63644576", "0.635955", "0.63554716", "0.63554716", "0.6347827", "0.631496", "0.6301711",...
0.59496826
37
Tests if the line segments are intersecting vlist is an array containing 4 2D points in order P0, P1, Q0, Q1
function intersecting(vlist) { // showArray(vlist); var pq = subtract(vlist[2], vlist[0]); // The vector from P0 to Q0 (i.e. Q0-P0) var v = subtract(vlist[1], vlist[0]); // The vector from P0 to P1 var w = subtract(vlist[3], vlist[2]); // The vector from Q0 to Q1 var v2 = dot(v, v); var w2 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lineSegmentsIntersect (x1, y1, x2, y2, x3, y3, x4, y4) {\n var x=((x1*y2-y1*x2)*(x3-x4)-(x1-x2)*(x3*y4-y3*x4))/((x1-x2)*(y3-y4)-(y1-y2)*(x3-x4));\n var y=((x1*y2-y1*x2)*(y3-y4)-(y1-y2)*(x3*y4-y3*x4))/((x1-x2)*(y3-y4)-(y1-y2)*(x3-x4));\n if (isNaN(x)||isNaN(y)) {\n return false;\n } else...
[ "0.68795776", "0.6660005", "0.6465546", "0.64478314", "0.63789046", "0.634157", "0.6311335", "0.63055587", "0.626326", "0.62626857", "0.6224975", "0.61432934", "0.6116409", "0.6055315", "0.6043215", "0.60156184", "0.60004973", "0.5996012", "0.5986759", "0.59704924", "0.596345...
0.786428
0
Tests if the winding is anticlockwise (Right Hand Thumb rule) returns true if vlist is in the correct order based on the right hand thumb rule
function RHTwinding(vlist) { var i = vlist.length; // Argument is assumed an array of 3 3D points in order P0, P1, P2 // Calculate cross product (P1-P0)x(P2-P0) var norm = cross ( subtract ( vlist[ i - 2 ], vlist[ i - 3 ] ), subtract( vlist[ i - 1 ], vlist[ i - 3 ] ) ); retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkWindings(){\n // console.log(\"checkWindings\");\n // check if there is less than three vertices to inspect\n\n if (index < 2 ){\n return true;\n } // set initial rotation based on current winding\n else if (index == 2) {\n rotation = RHTwinding(vertices); // set initial ...
[ "0.6441441", "0.56505835", "0.5633896", "0.5590298", "0.55879146", "0.5543492", "0.5519341", "0.5487033", "0.5462522", "0.54568154", "0.5451834", "0.54415596", "0.5357216", "0.5318512", "0.530543", "0.5295104", "0.5287734", "0.52848476", "0.5280909", "0.52657217", "0.5249927"...
0.5825831
1
get the centre of the polygon by averaging the vertices entered resets vertices about the new point
function setCentre() { centre = vec3(); // Calculate model origin for triangle by averaging vertices for (var i = 0; i < vCount; i++) { centre = add(centre, vertices[i]); } centre = scale(1/vCount, centre); // Reset vertices with respect to model origin trans = scale(1, centre); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function polygonCentroid(vertices){\n var a = 0, x = 0, y = 0, l = vertices.length;\n\n for (var i = 0; i < l; i++) {\n var s = i === l - 1 ? 0 : i + 1,\n v0 = vertices[i],\n v1 = vertices[s],\n f = (v0[0] * v1[1]) - (v1[0] * v0[1]);\n\n a += f;\n x += (v0[0] + v1[0]...
[ "0.70596933", "0.70243585", "0.6894006", "0.6625066", "0.64850885", "0.63336045", "0.6226551", "0.6196267", "0.61467814", "0.61149174", "0.6101887", "0.6100294", "0.60876715", "0.6072568", "0.606465", "0.60423976", "0.60169524", "0.5989609", "0.5988147", "0.59733087", "0.5969...
0.6260218
6
reset the state machine ready to sart again
function reset(){ // I had to add the following two lines to fix a random bug // where bufferSubData returned two errors... There didn't appear to be any rhyme or rythme to // the errors :? // [.WebGLRenderContext-0x19dd9bb4300] // GL ERROR :GL_INVALID_VALUE : glBufferSubData: out of range // [...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reset() {\r\n this.state=this.initial;\r\n this.statesStack.clear();\r\n\r\n }", "reset() {\r\n this.statesDone.clear();\r\n this.statesDone.push(this.initialState);\r\n }", "reset() {\r\n this.prevState=this.currentState;\r\n this.currentState = this.config.init...
[ "0.760684", "0.7531576", "0.75173324", "0.74984235", "0.748935", "0.74464697", "0.74444747", "0.7343407", "0.7343282", "0.7335882", "0.7325422", "0.7261681", "0.7240108", "0.72146606", "0.7192436", "0.7165473", "0.71385926", "0.712297", "0.71158475", "0.70854443", "0.704922",...
0.0
-1
updates the html element with count of how many vertices are currently selected
function setHtmlUi() { // sets the count element document.getElementById("count").innerHTML = index + " of " + vCount + " Vertices selected"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateCount() {\n\t \tselected = $('.report input[type^=\"checkbox\"]:checked').length;\n\t \tselectedNode.text(selected);\n\t \tconsole.log(selected);\n\t }", "function updateSelectedCount(){\n const selectedSeats=document.querySelectorAll('.row .seat.selected');\n const selectedSeatscount=sele...
[ "0.6959612", "0.66021746", "0.65723485", "0.6517393", "0.64243764", "0.6357657", "0.6356508", "0.6338344", "0.63371956", "0.6281782", "0.6279647", "0.6234169", "0.61912", "0.6188595", "0.616014", "0.61483675", "0.6117181", "0.6108336", "0.60588604", "0.60546285", "0.60524774"...
0.72525406
0
moves th model to the canvas frame 0,0,0 position
function home() { if ( index != vCount ) { return; } // reset state variables theta = 0; trans = [0,0,0]; // issue mv = mat4(); whereami(); render(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resetCanvasPosition(): void {\n this.translate(-this.canvasPosition.x, -this.canvasPosition.y);\n this.canvasPosition = { x: 0, y: 0 };\n }", "function moveToOrigin() {\n if (visible) {\n ctx.translate(-((width / 2) - x(viewCenter.x)), -(-y(viewCenter.y) + (height / 2)));\n }\n ...
[ "0.69071275", "0.6682809", "0.6521174", "0.64539707", "0.64283574", "0.6417979", "0.63504815", "0.63118577", "0.6304292", "0.62937576", "0.6293391", "0.62848306", "0.6282802", "0.625226", "0.6234444", "0.621591", "0.61968684", "0.61911213", "0.61882913", "0.6184637", "0.61791...
0.60709345
33
function provides the what to do on keyboard event
function keyboardEvent(event){ var key = event.keyCode; switch( key ) { case 119: case 87: // w key // translate in a positive direction along Y axis of window vertical(true); break; case 115: case 83: // s key // translate in a negati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onKeyDown(event) {\n}", "HandleKeyDown(event) {}", "function cust_KeyDown(evnt) {\n //f_log(evnt.keyCode)\n}", "keyDown(_keycode) {}", "function keyPressed() {\n}", "handleKeyDown (event) {\n }", "function keyReleased() {\n\n}", "function getKeyPress(event) {\n//Keyboard press detected!\...
[ "0.76767594", "0.75347656", "0.7356643", "0.733048", "0.7272143", "0.7239134", "0.7233616", "0.7116491", "0.70428586", "0.7015044", "0.7012884", "0.6957533", "0.6943793", "0.6936581", "0.689707", "0.6873299", "0.68527704", "0.68527704", "0.68482316", "0.6839418", "0.68050426"...
0.6987029
11
below functions are for object translation and rotation // / translates the object by the vec3 t argument updates the global trans variable.
function movePolygon(t){ trans = add(trans, t); mv = mult(mv, translate(t)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "init_tran(x, y, z) {\n this.ctm = mult(this.ctm, translate(x, y, z));\n\n\n }", "function gTranslate(x,y,z) {\n modelMatrix = mult(translate(x,y,z), modelMatrix) ;\n}", "updateLocalTransAndRot(newtrs) {\n//---------------------\nthis.localTrans = newtrs.getTranslation();\nreturn this.localRot = ne...
[ "0.71481705", "0.6920212", "0.6885569", "0.6541986", "0.6500515", "0.64465916", "0.64335173", "0.64258045", "0.64258045", "0.64125", "0.63552034", "0.62865186", "0.6275795", "0.62473625", "0.6232267", "0.61836845", "0.61759305", "0.6149488", "0.61445934", "0.6133372", "0.6129...
0.5733799
93
turn the object about the z axis a true argument moves the polygon object clockwise a false argument moves the polygon object anticlockwise
function turn(clockwise){ if (index != vCount) { return; } // rotat is a temp transformation matrix var rotat; // sets the rotat matrix based on passed argument if (clockwise) { setTheta(-1 * displacementR); rotat = rotate(-1 * displacementR, [0,0,1]); } else...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rotateZ() {\n console.log('rotate about z triggered');\n var cosA = Math.cos(0.05);\n var sinA = Math.sin(0.05);\n var m = new THREE.Matrix4();\n m.set( cosA, sinA, 0, 0,\n -sinA, cosA, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1 );\n geome...
[ "0.6486836", "0.63204175", "0.629813", "0.62629426", "0.6116985", "0.6037431", "0.599173", "0.59234244", "0.59102285", "0.59045035", "0.586458", "0.58152217", "0.5718378", "0.5700584", "0.56954485", "0.5688111", "0.56472766", "0.5644552", "0.5641192", "0.56310165", "0.5629553...
0.5730682
12
converts degrees to radians
function toRadians(degrees){ return degrees * Math.PI / 180; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function degToRad(degrees) \n{\n return degrees * Math.PI / 180.0;\n}", "function rad2deg(radians) {\n return radians * 180 / Math.PI;\n}", "function degToRad(degrees) {\r\n return degrees * Math.PI / 180;\r\n}", "function degrees_to_radians(degrees)\n{\n let pi = Math.PI;\n return (degrees * ...
[ "0.8189798", "0.8144593", "0.8131871", "0.8129888", "0.8105873", "0.81058353", "0.8105779", "0.809784", "0.8096889", "0.8096889", "0.8089607", "0.8089607", "0.8089607", "0.80891764", "0.80771035", "0.8063956", "0.8063078", "0.8063078", "0.8063078", "0.8063078", "0.80506396", ...
0.81643397
1