query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
define a function to toggle timeline show for button 1 define a function to toggle timeline and timeline reverse for button 2
function timelineShow () { $('.timeline').toggleClass('show'); $('.intro-reverse').toggleClass('show'); $('html, body').animate({scrollTop: header, duration: 1200}, 'easeOut'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleTimeline() {\n\tif ($(window).width() < 768) {\n\t\t$(\".timeline-icon\").click(function() {\n\t\t\t$(this).parent().parent().find(\".timeline-info\").css(\"z-index\", \"1000\");\n\t\t\taddBlurDarken();\n\t\t\tif ($(this).hasClass(\"fa-sun\")) {\n\t\t\t\tremoveBlurDarken();\n\t\t\t}\n\t\t});\n\t\t$(...
[ "0.66879404", "0.6404605", "0.6310949", "0.626978", "0.62482905", "0.6238179", "0.6224434", "0.6219596", "0.6201128", "0.6143641", "0.6092602", "0.6064503", "0.59707004", "0.594664", "0.5935825", "0.59120816", "0.59033215", "0.5896133", "0.58911604", "0.58889025", "0.5882129"...
0.66823775
1
define functions to toggle info after click event on date
function showInfo1 () { $('.info.1').toggleClass('show'); $('.date.1').toggleClass('date-selected'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clickedButton (){\n \n let currentDay= document.getElementById('date');\n if(currentDay.style.display==='none'){\n currentDay.style.display= 'block';\n }else {\n currentDay.style.display='none';\n }\n /*For testing purposes\n console.log('click test2'); */\n }", "function d...
[ "0.704734", "0.69756454", "0.69638914", "0.6757986", "0.6679708", "0.6551728", "0.6518803", "0.6465694", "0.6412419", "0.6409602", "0.63175607", "0.63132447", "0.62966365", "0.62607896", "0.6234727", "0.62256175", "0.6198191", "0.6190957", "0.6181307", "0.6147715", "0.6125242...
0.7231953
0
Called when the user specifies an intent for this skill.
function onIntent(intentRequest, session, callback) { console.log(`onIntent requestId=${intentRequest.requestId}, sessionId=${session.sessionId}`); const intent = intentRequest.intent; const intentName = intentRequest.intent.name; // Dispatch to your skill's intent handlers if (intentName =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onIntent(intentRequest, session, callback) {\n console.log(\"onIntent requestId=\" + intentRequest.requestId\n + \", sessionId=\" + session.sessionId);\n var intent = intentRequest.intent,\n intentName = intentRequest.intent.name; \n if (\"AMAZON.StartOverIntent\" === i...
[ "0.7036835", "0.6709917", "0.6661379", "0.6629904", "0.6628138", "0.65792876", "0.65665", "0.6564381", "0.65547866", "0.6544013", "0.6527212", "0.64768934", "0.64718294", "0.6467834", "0.6453462", "0.6453462", "0.6453462", "0.6450144", "0.6450144", "0.6450144", "0.6450144", ...
0.6729381
1
Con la siguiente notacion se llama al metodo para llamada al metodo pasando como parametro el id y la lista de campos gracias a la notacion, loadBears es llamado automaticamente cuando el componente carga o el record id cambia
@wire(getRecord, { recordId: '$recordId', fields }) loadBear({ error, data}){ if(error){ //Handle error } else if (data){ //Get bear Data this.name = data.fields.Name.value; const Latitude = data.fields.Location__Latitude__s.value; const Lo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadBook(id){\n\t\n\tvar found = books.where({oid:id});\n\tif(found.length==1){\n\t\tmybook = found[0];\n\t\t$.name.value = mybook.get('name');\n\t\t$.isbn.value = mybook.get('isbn');\n\t\t$.author.value = mybook.get('author');\n\t\t$.genre.value = mybook.get('genre');\t\n\t}\n\telse{\n\t\talert('Error ge...
[ "0.5730185", "0.5662324", "0.5321534", "0.53005946", "0.52388626", "0.5226072", "0.5186393", "0.51761127", "0.5172493", "0.5171532", "0.51550627", "0.51266557", "0.5119528", "0.5109882", "0.50677717", "0.5054478", "0.504508", "0.4990848", "0.49773353", "0.4975042", "0.4971917...
0.5829055
0
gauge bar color selected based on washing frequency. should map redyellowgreen continuously. total overkill given our inputs are discrete values, this was more for me to make a continous color scale.
function GaugeBarColor (s) { var colorScale = d3.scaleLinear() .domain([0,9]) .range([0,255]); //red is (255,0,0), yellow is (255,255,0), green is (0,255,0) //between red and yellow we need to add to the green channel //between yellow and green we need to subtract from the red channel //ha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function colorforgauge(percent){\r\n if (percent < 20) {\r\n return \"rgb(12, 26, 182)\";\r\n } else if (percent < 40) {\r\n return \"rgb(100, 149, 192)\";\r\n } else if (percent < 60) {\r\n return \"rgb(245, 180, 1)\";\r\n } else if (percent < 80) {\r\n return \"rgb(207, 111, 2)\";\r\n } ...
[ "0.68401176", "0.6389549", "0.6366236", "0.63412166", "0.62246275", "0.62053865", "0.62047064", "0.61862403", "0.61775327", "0.61750585", "0.617335", "0.6172779", "0.6151721", "0.6147165", "0.6143423", "0.61409813", "0.61340564", "0.6088784", "0.60692495", "0.60532194", "0.60...
0.7388289
0
Listen for errors on the element and if there are any replace the source with the fallback source
function error() { if (element[0].src !== newSrc) { element[0].src = newSrc; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function defaultSrc(e) {\n e.target.src=error404pic\n }", "function onImgSrcError(img, defaultUrl){\n img.onerror = null;\n img.src = defaultUrl;\n return true;\n}", "function replaceSrc(element) {\n element.src = element.dataset.src;\n removeDataSrc(element);\n}", "function addNetworkOrSr...
[ "0.6541174", "0.5963768", "0.5887626", "0.5870733", "0.5780515", "0.56223375", "0.55216175", "0.55205476", "0.5518652", "0.5511352", "0.53708875", "0.53696066", "0.5325364", "0.5309362", "0.5309362", "0.5290949", "0.5290949", "0.5290949", "0.5284692", "0.5284692", "0.5284692"...
0.7067228
0
proxy passed data into the generic log as an XHR event
function _logXHR (data) { _log(EVENTS.XHR, data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function logData(trigger) {\r\n\t// ajax call to database to store interactions\r\n}", "log(message) {\n // Send http request\n console.log(message);\n\n //Raised an event\n // commented out of app.js after adding into logger.js\n\n this.emit('messageLogged', {id: 1, url: 'http:' }); \n }", ...
[ "0.633289", "0.61432457", "0.60980004", "0.60980004", "0.6050268", "0.60458785", "0.60458785", "0.60458785", "0.5959782", "0.5929975", "0.5886786", "0.5884173", "0.5815006", "0.5811742", "0.5802582", "0.5793097", "0.57794994", "0.57672435", "0.57607967", "0.57442117", "0.5719...
0.7218252
0
Create subnamespaces. Usage (creates and returns dk.my.sub.ns):: myns = dk.namespace('my.sub.ns'); To create a namespace on e.g. window, use:: myns = dk.namespace.call(window, 'my.sub.ns'); value is optional and becomes the value of the last part of the dotted name (but only if it doesn't allready exist).
create_namespace(dotted_name, value) { let parent = this; let parts = dotted_name.split('.'); parts.forEach((part, i) => { if (parent[part] === undefined) { if (i === parts.length - 1 && value !== undefined) { parent[part] = value; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function namespace(ns) {\n 'use strict';\n \n if (namespaces.indexOf(ns) === -1) {\n var segments = ns.split(\".\").reverse(),\n /*\n Inner recursive function to add a new object if not defined\n */\n createSegment = function (segments, currentSegment) {...
[ "0.6600711", "0.5822356", "0.5822356", "0.5700393", "0.56917775", "0.5671661", "0.55940133", "0.55457306", "0.55246174", "0.52834827", "0.5226586", "0.52062595", "0.51882505", "0.51766646", "0.5112643", "0.5096038", "0.5067922", "0.5067922", "0.5058723", "0.50563836", "0.5014...
0.62319684
1
Look up the path in the object. path is a dotted string ('foo.bar.baz') that can start with `this`.
traverse(obj, path) { if (path == null) return undefined; let pelems = path.split('.'); let res = obj; pelems.forEach(function (item) { res = item === 'this' ? obj : res[item]; }); return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_resolveObjectPath(path, obj) {\n return path.split(\".\").reduce(function(prev, curr) {\n return prev ? prev[curr] : null;\n }, obj || self);\n }", "function getPropFromPath(obj, path) {\n var keys = path.split('.');\n var targetKey = keys.pop();\n var objRef = obj;\n\n for...
[ "0.7188463", "0.70760846", "0.70760846", "0.69686854", "0.69369656", "0.6932816", "0.6877801", "0.6877801", "0.6877801", "0.6877801", "0.6877801", "0.6877801", "0.6877801", "0.68565", "0.68311834", "0.67823726", "0.66937244", "0.66536635", "0.6615954", "0.66016316", "0.655749...
0.7305893
0
set position of current node default is pointer of head node
setDefaulltPointer() { this.tempPos = this.head; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setNode(pos, val){\r\n let curr = this.head;\r\n\r\n for(let i = 0; i < this.length; i++){\r\n if(i === pos){\r\n curr.val = val;\r\n }else{\r\n curr = curr.next;\r\n }\r\n }\r\n return undefined;\r\n }", "setNodePositi...
[ "0.6970748", "0.65709627", "0.6513175", "0.640667", "0.62851393", "0.6283207", "0.62609726", "0.62295634", "0.6221993", "0.62160224", "0.61820537", "0.61541814", "0.61138755", "0.61138755", "0.6097366", "0.60654014", "0.6064673", "0.606375", "0.60584486", "0.60374475", "0.600...
0.7554177
0
check for position of node
nodePosition() { if (this.tempPos.next == null) { return -1; // last pos } else if (this.tempPos.prev == null) { return 1; // first pos } else { return 0; // middle pos } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "FetchNodeIndex(position)\n {\n return position.x + (position.y * grid.resolution);\n }", "function isOccupied(position) {\n let div = document.getElementById(position)\n // if (div == null)\n // return false;\n console.log(position)\n if (div.firstChild.classNa...
[ "0.6599487", "0.6466503", "0.6304193", "0.6278878", "0.62671375", "0.6235664", "0.6216608", "0.62074167", "0.6199801", "0.61865187", "0.61696327", "0.61609936", "0.6155269", "0.61258936", "0.61258936", "0.6073032", "0.6070938", "0.6065001", "0.60588366", "0.60430056", "0.6010...
0.7060121
0
Open an IO stream for reading/writing to the file corresponding to the given path.
function open(path, options) { options = checkOptions(options); var file = resolveFile(path); var {read, write, append, update, binary, charset} = options; if (!read && !write && !append && !update) { read = true; } var stream = new Stream(read ? new FileInputStream(file) : n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openFile(path) {\n\treturn new Promise(function (resolve, reject) {\n\t\tfs.readFile(path, \"utf8\", (err, data) => {\n\t\t\tif (err) reject(err);\n\t\t\tresolve(data);\n\t\t});\n\t});\n}", "function openOverwrite(path){\n let oldData=fs.readFileSync(path);\n let fd=fs.openSync(path, 'w+'); \n ...
[ "0.6615814", "0.58816665", "0.567769", "0.5614438", "0.5584639", "0.55693626", "0.5471996", "0.5441576", "0.54350686", "0.54306847", "0.5388435", "0.53762895", "0.5317337", "0.5291803", "0.52001745", "0.51841843", "0.5174938", "0.51382226", "0.5127563", "0.51274973", "0.51233...
0.72352713
0
Open, write, flush, and close a file, writing the given content. If content is a binary.ByteArray or binary.ByteString, binary mode is implied.
function write(path, content, options) { options = options === undefined ? {} : checkOptions(options) options.write = true options.binary = content instanceof Binary var stream = open(path, options); try { stream.write(content); stream.flush(); } finally { stream.close();...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "writeFile(path, content) {\n return when.promise(function (resolve, reject) {\n var stream = fs.createWriteStream(path);\n stream.on('open', function (fd) {\n stream.end(content, 'utf8', function () {\n fs.fsync(fd, resolve);\n });\n ...
[ "0.6527102", "0.6491916", "0.633945", "0.619242", "0.6086189", "0.6086189", "0.6038776", "0.6004887", "0.59856415", "0.5980323", "0.5958997", "0.58519006", "0.58454573", "0.5794104", "0.57473016", "0.5744813", "0.5740702", "0.57104146", "0.5666454", "0.55863655", "0.5543055",...
0.75210786
0
Read data from one file and write it into another using binary mode.
function copy(from, to) { var source = resolveFile(from); var target = resolveFile(to); var input = new FileInputStream(source).getChannel(); var output = new FileOutputStream(target).getChannel(); var size = source.length(); try { input.transferTo(0, size, output); } finally { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copyFile( sourceFilePath, targetFilePath )\n{\n var f = new File;\n\n f.openForReading( sourceFilePath );\n var buffer = f.read( DataType_ByteArray, f.size );\n f.close();\n\n f.createForWriting( targetFilePath );\n f.write( buffer );\n //f.flush(); // optional; remove if immediate writing i...
[ "0.5444003", "0.52512217", "0.5201167", "0.51917", "0.5163092", "0.5124605", "0.50172025", "0.49705148", "0.49061662", "0.4803526", "0.47512278", "0.47512278", "0.47512278", "0.47512278", "0.47512278", "0.47512278", "0.47512278", "0.47512278", "0.47512278", "0.47512278", "0.4...
0.549289
0
Return an array with all directories below (and including) the given path, as discovered by depthfirst traversal. Entries are in lexically sorted order within directories. Symbolic links to directories are not traversed into.
function listDirectoryTree(path) { path = path === '' ? '.' : String(path); var result = ['']; fsBase.list(path).forEach(function (child) { var childPath = join(path, child); if (fsBase.isDirectory(childPath)) { if (!fsBase.isLink(childPath)) { result.push.apply(r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function recursiveGetDirectoriesFor(path) {\n\tlet stack = [path];\n\tlet directories = [];\n\twhile(stack.length) {\n\t\tlet current = stack.pop();\n\t\tconst subdirs = _getDirectoriesFor(current);\n\t\tstack = [...stack, ...subdirs];\n\t\tdirectories = [...directories, ...subdirs];\n\t}\n\treturn directories;\n}...
[ "0.7807171", "0.70575523", "0.70517874", "0.69932896", "0.6877209", "0.67409784", "0.6693775", "0.6687572", "0.6615869", "0.66002744", "0.66002744", "0.66002744", "0.66002744", "0.66002744", "0.6331978", "0.62725407", "0.627034", "0.62286305", "0.61182535", "0.61182535", "0.6...
0.7268837
1
Check whether the given pathname is absolute. This is a nonstandard extension, not part of CommonJS Filesystem/A.
function isAbsolute(path) { return new File(path).isAbsolute(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isAbsolute(path) {\n\t\t\treturn new java.io.File(path).isAbsolute();\n\t\t}", "function isAbsolutePath (path) {\n return path[0] === '/';\n}", "function isAbsolutePath(file) {\n var regexp = process.platform === 'win32' ?\n /^\\w:/ :\n /^\\//;\n return regexp.test(file);\n}", "...
[ "0.81228745", "0.776494", "0.76451015", "0.75969374", "0.755225", "0.7507306", "0.72859204", "0.6861077", "0.67400444", "0.66901475", "0.66901475", "0.66901475", "0.66901475", "0.66901475", "0.66777325", "0.6654751", "0.64933974", "0.64627093", "0.6450626", "0.6416248", "0.63...
0.8122671
1
Check wheter the given pathname is relative (i.e. not absolute). This is a nonstandard extension, not part of CommonJS Filesystem/A.
function isRelative(path) { return !isAbsolute(path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function relative(path) {\n const char = path.substr(0, 1);\n return char !== '/' && char !== '@';\n }", "function isRelative(href) {\n try {\n var parsed = url.parse(href);\n\n return !!(!parsed.protocol && parsed.path);\n } catch(err) {\n return true;\n }\n}", "static rel...
[ "0.7239482", "0.7155819", "0.6983634", "0.67711", "0.67316175", "0.66799456", "0.6605728", "0.6605461", "0.66052717", "0.65362513", "0.65362513", "0.65362513", "0.65362513", "0.65362513", "0.65362513", "0.65362513", "0.65362513", "0.6534461", "0.65051866", "0.6339082", "0.633...
0.7979084
0
Make the given path absolute by resolving it against the current working directory.
function absolute(path) { return resolve(fsBase.workingDirectory(), path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resolve() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : '/';\n\n // Skip empty and invalid entries\n ...
[ "0.7092837", "0.7090088", "0.6999216", "0.6999216", "0.6999216", "0.6999216", "0.6999216", "0.6932548", "0.69297314", "0.6926025", "0.6926025", "0.6926025", "0.6907849", "0.68521404", "0.68521404", "0.68521404", "0.679916", "0.67816985", "0.67257255", "0.6708239", "0.66668355...
0.7755852
0
Return the extension of a given path. That is everything after the last dot in the basename of the given path, including the last dot. Returns an empty string if no valid extension exists.
function extension(path) { var name = base(path); if (!name) { return ''; } name = name.replace(/^\.+/, ''); var index = name.lastIndexOf('.'); return index > 0 ? name.substring(index) : ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getExtension(path) {\n let basename = path.split(/[\\\\/]/).pop()\n ,pos = basename.lastIndexOf(\".\");\n\n if (basename === \"\" || pos < 1) return \"\";\n\n return basename.slice(pos + 1);\n }", "function getFileExtension( path ) {\n\n if ( path.indexOf( \".\" ) > -...
[ "0.8472165", "0.8235986", "0.8131828", "0.8016517", "0.7645665", "0.7645665", "0.7602801", "0.7380849", "0.7354581", "0.72917247", "0.71794164", "0.7115689", "0.711377", "0.711377", "0.7003275", "0.69423157", "0.6930855", "0.6926207", "0.69034696", "0.69005424", "0.685941", ...
0.8588896
0
Split a given path into an array of path components.
function split(path) { if (!path) { return []; } return String(path).split(SEPARATOR_RE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pathSplit(path) {\n return path.split(\"/\");\n}", "static splitPath(path) {\n\t\treturn path.slice(1).split('/')\n\t}", "static split(path) {\n if (!path || typeof path !== \"string\") {\n throw new Error(\"Path.split() - Invalid path.\");\n }\n\n const result = path....
[ "0.8186208", "0.8110469", "0.804994", "0.7751421", "0.7320581", "0.7320581", "0.7274914", "0.7274914", "0.7274914", "0.7117181", "0.70417327", "0.6998949", "0.69365996", "0.68822217", "0.6819859", "0.6798283", "0.67004645", "0.66684973", "0.66543365", "0.65561324", "0.6540233...
0.84304374
0
Adapted from narwhal. Establish the relative path that links source to target by strictly traversing up ('..') to find a common ancestor of both paths. If the target is omitted, returns the path to the source from the current working directory.
function relative(source, target) { if (!target) { target = source; source = fsBase.workingDirectory(); } source = absolute(source); target = absolute(target); source = source.split(SEPARATOR_RE); target = target.split(SEPARATOR_RE); source.pop(); while ( source.l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function simplisticRelativePathResolve(filePathOrigin, filePathTarget) {\n // if either start with ./, remove.\n\n if (filePathOrigin.slice(0, 2) === './') {\n filePathOrigin = filePathOrigin.slice(2, filePathOrigin.length);\n }\n if (filePathTarget.slice(0, 2) === './') {\n filePathTarget = filePathTarg...
[ "0.6354627", "0.6327255", "0.5914047", "0.58974826", "0.58974826", "0.5812028", "0.57984865", "0.5770469", "0.5763435", "0.5763435", "0.57629955", "0.57509136", "0.57436454", "0.5723886", "0.57124484", "0.5710174", "0.5710174", "0.5710174", "0.5709879", "0.5709879", "0.570987...
0.75034714
0
Path constructor. Path is a chainable shorthand for working with paths.
function Path() { if (!(this instanceof Path)) { return new Path(join.apply(null, arguments)); } var path = join.apply(null, arguments) this.toString = function() path; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function path() {\n return new Path(join.apply(null, arguments));\n}", "function Path ( path ) {\n \t// If the input given is already a pathd path,\n \t// return it unchanged.\n \tif ( path && arguments.length == 1 && path.constructor == Path ) {\n \t\treturn path;\n \t}\n \n \t// Can be called as eit...
[ "0.7835361", "0.7732213", "0.69127035", "0.68377495", "0.67682695", "0.659035", "0.65487427", "0.6524386", "0.6487134", "0.6487134", "0.6487134", "0.64824593", "0.6389119", "0.6386688", "0.6367952", "0.63118714", "0.6308826", "0.6295957", "0.6283732", "0.613598", "0.613598", ...
0.8300005
0
Get attached room info from persistent memory
get_persistent_info() { return Memory.rooms[this.name] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getMemAddr(room) {\n let memRoomAddr;\n if (room == this.roomName) {\n return this.memoryAddr;\n } else {\n let remoteRoom = this.remoteRooms[room];\n if (remoteRoom) {\n memRoomAddr = this.memoryAddr.remoteRooms[room];\n } else {\n ...
[ "0.62849563", "0.61881095", "0.5755743", "0.57291853", "0.56992733", "0.56689715", "0.5630455", "0.5623735", "0.56000185", "0.55622864", "0.55107486", "0.54515654", "0.52987194", "0.520231", "0.5135053", "0.51349545", "0.51319975", "0.5130168", "0.50942427", "0.50641096", "0....
0.758632
0
Check whether room is available for scanning
is_available() { return _.isObject(this.room) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function availabilityCheck() {\n if (chosenHours.date !== \"\" && chosenHours.startTime !== \"\" && chosenHours.endTime !== \"\" && (!(freeRooms.length + busyRooms.length === 23))) {\n //looping through all rooms in compartment and making freebusy query\n requestConfigure()\n currentColor =...
[ "0.65681136", "0.6477239", "0.64719796", "0.6470881", "0.64472187", "0.64383394", "0.6350549", "0.6331353", "0.632959", "0.6286763", "0.62329185", "0.62115175", "0.6051456", "0.60430545", "0.6030989", "0.5987431", "0.5975134", "0.5925475", "0.59198135", "0.59070456", "0.58774...
0.7416667
0
Get RoomPosition of the logistics center
getLogisticsCenter() { return new RoomPosition(this.center[0], this.center[1], this.name) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getCenterPosition() {\n\t\tlet center = this.getCenter();\n\t\treturn {\n\t\t\tx: this.x + center.x,\n\t\t\ty: this.y + center.y\n\t\t};\n\t}", "function calcPos() {\n\t\t// Current coordinates\n\t\tvar coords = sphoords.getCoordinates();\n\t\tvar coords_deg = sphoords.getCoordinatesInDegrees();\n\n\t\t// Corres...
[ "0.6159724", "0.60277784", "0.593621", "0.5871654", "0.586911", "0.58663994", "0.57889414", "0.57737875", "0.5763038", "0.57601184", "0.5746249", "0.57332325", "0.5731181", "0.57199043", "0.5714481", "0.5705681", "0.5703735", "0.5679979", "0.56783205", "0.5674967", "0.5671496...
0.8586676
0
Sum two key>number tables
function sum_table(a, b) { var result = clone(a) for(var i in b) { if(!(i in result)) result[i] = b[i] else { result[i] += b[i] } } return result }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function union(key1, key2) {\n let p1 = find(key1), p2 = find(key2);\n if (p1 === p2) return p1;\n // Do not bother implementing union by rank. This is pretty fast too.\n // n.b., http://stackoverflow.com/a/2326676/265298\n unioned[p2] = p1;\n size...
[ "0.5878881", "0.5821628", "0.5733158", "0.5672122", "0.55790055", "0.5576281", "0.5557166", "0.5513854", "0.5443095", "0.5404731", "0.5380361", "0.53799874", "0.537855", "0.5370996", "0.5368036", "0.5221513", "0.5197787", "0.5173782", "0.51737034", "0.51633644", "0.512509", ...
0.6484036
0
function handling index query
function dbIndexQuery(index, indexName){ var tx = dbRequest.result.transaction('task') var store = tx.objectStore('task'); const statusIndex= store.index(index); const getStatus=statusIndex.getAll(indexName); getStatus.onsuccess=(e)=>{ let web= e.target.result let webKey=getStatus.key ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function index() {\n\t\tdebug('index request');\n\t\t// query here plz\n\t\tvar query = table.select(table.star()).from(table).toQuery();\n\t\tdb.query(query.text, query.values, function(err, resp){\n\t\t\tdebug('index resp:', err);\n\t\t\tif (err) {\n\t\t\t\temit(routes.index, {\"error\": \"db error\"}); // TODO ...
[ "0.76165587", "0.69023144", "0.6869812", "0.6635139", "0.65557706", "0.6447098", "0.6446999", "0.6413582", "0.62632865", "0.6180412", "0.616386", "0.615202", "0.61278385", "0.6095013", "0.6066777", "0.60565674", "0.603735", "0.6028723", "0.6020001", "0.6017491", "0.59978247",...
0.7033806
1
Retorna o Storage de Armazenamento do Firebase
static hd() { return firebase.storage(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fillstorage() {\n const obj_1 = 'some_content';\n const obj_2 = {bar: 'baz'};\n\n// save to file\n const id = storage.put(obj_2);\n console.log(id)\n const everything = storage.all();\n console.log(everything)\n}", "_storage() {\n return getStorage(get(this, '_storageType'));\n }",...
[ "0.6602149", "0.6469261", "0.6438958", "0.63762707", "0.63593537", "0.63181627", "0.6304511", "0.6271492", "0.6256796", "0.6177441", "0.61579055", "0.614969", "0.6132274", "0.6085832", "0.6049768", "0.60353726", "0.6015318", "0.5996691", "0.5995227", "0.5986364", "0.5986364",...
0.73273176
0
Para manejar errores en promesas con asyncawait se ocupan bloques try catch
async function errors() { try { let promesa = await Promise.reject("Error en el async"); } catch (error) { console.log(error); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function f4() {\n await Promise.reject(new Error(\"에러 발생!\"));\n}", "async function foo() {\n try {\n return await waitAndReject()\n } catch(err) {\n // console.log(err)\n console.log('caught')\n // throw 'catch block error'\n }\n}", "async function fails () {\n ...
[ "0.71401846", "0.6971024", "0.68620664", "0.6723467", "0.6693296", "0.65378", "0.6417949", "0.6334741", "0.63239527", "0.62445635", "0.6208606", "0.61666894", "0.6110808", "0.6038266", "0.6027732", "0.60121804", "0.5977676", "0.59607434", "0.5886867", "0.58796644", "0.58626",...
0.8350402
0
Generates a traversible menu of links given an appropriate xml file.
function generateMenuFromFile(htmlContainer, xmlFile) { links = loadXMLDoc(xmlFile); contents = links.getElementsByTagName("contents")[0]; generateMenu(htmlContainer, contents); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function quickLinks(){\n\t\tvar menu = find(\"//td[@class='menu']\", XPFirst);\n\t\tfor (var j = 0; j < 2; j++) for (var i = 0; i < menu.childNodes.length; i++) if (menu.childNodes[i].nodeName == 'BR') removeElement(menu.childNodes[i]);\n\t\tmenu.innerHTML += '<hr/>';\n\t\tmenu.innerHTML += '<a href=\"login.php\">...
[ "0.60448396", "0.6012572", "0.58986324", "0.57612675", "0.56764865", "0.5630392", "0.55616736", "0.54253674", "0.53908056", "0.53724307", "0.5324983", "0.5323464", "0.528526", "0.5281375", "0.5276894", "0.527562", "0.52310914", "0.52131385", "0.5201086", "0.51973534", "0.5195...
0.73636895
0
Recursive function that generates a menu from the contents of an xml file.
function generateMenu(htmlContainer, xmlMenu) { htmlContainer.innerHTML += "<ul></ul>"; htmlContainer = htmlContainer.getElementsByTagName('ul')[0]; // Adds border-color attribute if the parent node is a topMenu/ if (xmlMenu.parentNode.nodeName == 'topMenu') { htmlContainer.setAttribute...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateMenuFromFile(htmlContainer, xmlFile) {\r\n links = loadXMLDoc(xmlFile);\r\n contents = links.getElementsByTagName(\"contents\")[0];\r\n generateMenu(htmlContainer, contents);\r\n}", "function parseMenu(xml) {\r\n\t\t\tvar menuHtml = '';\r\n\t\t\txml.find('option').each(function(i) {\r\n...
[ "0.75040525", "0.5955678", "0.5954664", "0.58941865", "0.5707588", "0.56214386", "0.5494147", "0.54049885", "0.5326539", "0.5316385", "0.5316385", "0.52820975", "0.52631587", "0.5260402", "0.52464205", "0.5239803", "0.5219772", "0.5216333", "0.5212138", "0.5198754", "0.516842...
0.6176929
1
this method will save and link the rating to the created element and link the aggregation element to a insurance product
function saveRating(myReviewAnchor, insuranceId, productId, ratingValue, callback/*(err)*/){ //preperation of anchors and data var aggregationElementId = "$insurance-"+insuranceId+"-product-"+productId; var voteElementId = myReviewAnchor; var aspect = 'percentage'; //pass values...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveRecommendationScore(){\n let currentInsuraceType = $stateParams.insurancetype;\n let data = {industry_weights: $scope.industry_weights};\n metaService.saveIndustryRecommendationScore(currentInsuraceType,data,()=>{\n console.log(\"successfully saved Industry weight\")\n }, er...
[ "0.6400094", "0.61647683", "0.59642786", "0.59418356", "0.59206206", "0.58914816", "0.5861016", "0.5844494", "0.5701437", "0.56874025", "0.56473804", "0.5578448", "0.5562436", "0.5543837", "0.5528659", "0.54731655", "0.5458576", "0.54382646", "0.542453", "0.5423845", "0.54235...
0.6939538
0
TODO: check if the query exists in the cache
checkCharonKey(query, variables) { // need to handle if the query string doesnt exist // if it doesnt exist then find its charon key and iterate through cache // returns a boolean const charonKey = generateCharonKeyFromQuery(query, variables); // grabs fields from the query const queryFields = p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkExistingQuery () {\n\t\treturn null;\n\t}", "cachedFetch(queryParams, deferName) {\n if( !this.gotCache ) {\n // tell ccHost to use a cache if it's there\n var qp = Object.assign( {}, queryParams);\n qp['cache'] = '_' + hashParams(queryParams).hashCode();\n // we're only doing this on...
[ "0.6693528", "0.6270333", "0.6213777", "0.6203495", "0.61744136", "0.61401236", "0.613518", "0.6114414", "0.5984619", "0.5978546", "0.59755903", "0.59703404", "0.59703404", "0.59703404", "0.5966974", "0.5966974", "0.5959388", "0.5947429", "0.5945907", "0.5945907", "0.5945907"...
0.6379917
1
FUNCTIONS //////////////////////////////////////////////// drag fly function
function dragFly() { $fly.draggable(); $fly.on('mousedown',function() { buzzSFX.play(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drag(){\n console.log(\"Being dragged around\");\n}", "onDrag(mousePosition) {\n }", "function mouseDragged(){\r\n inputForMDragging(mouseX, mouseY);\r\n\r\n\r\n}", "function drag(e){\ndraggedItem=e.target;\ndragging=true;\n}", "mouseDrag(prev, pt) {}", "mouseDrag(prev, pt) {}", "startD...
[ "0.7153899", "0.6980545", "0.69687337", "0.6883085", "0.68805337", "0.68805337", "0.6855073", "0.68376166", "0.6799843", "0.67944396", "0.67860067", "0.6761127", "0.6705173", "0.6704321", "0.66429", "0.66202754", "0.66001034", "0.66001034", "0.6592284", "0.65393966", "0.65393...
0.7716302
0
returns true if mode is changed
function setMode(newMode) { if (_self.mode !== newMode) { _self.mode = newMode; if (!_self.current.parent) { _self.browseCurrent = _self.current; } else { _self.browseCurrent = _self.current.parent; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get modeChanged() {\n return this._modeChanged;\n }", "isMode(mode) {\n return this.state.mode === mode;\n }", "function modeChanged(fn) {\n bind('modeChanged', fn);\n }", "function toggleMode(){\n if(mode == 3){\n mode = 2;\n console.log(\"RC mode : 2...
[ "0.7660157", "0.69967145", "0.6783497", "0.67755157", "0.66504353", "0.63638973", "0.6324796", "0.6324796", "0.6303519", "0.628651", "0.628651", "0.62763304", "0.62288135", "0.6224958", "0.62139", "0.6197016", "0.6197016", "0.6197016", "0.6183565", "0.6149222", "0.61417496", ...
0.7309675
1
Defines a custom file loader for the Ejs engine that allows to use the builtin source repository.
static setup(){ ejs.fileLoader = (filePath) => { return SourceRepository.fetchSync(filePath); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function loader(\n args\n ) {\n try {\n const isCommonjs = args.namespace.endsWith('commonjs');\n \n const key = removeEndingSlash(args.path);\n const contents = polyfilledBuiltins.get(key) || polyfillLib[key + '.js'];\n const resolveDir = path....
[ "0.6089511", "0.6069951", "0.5949093", "0.5840746", "0.5794828", "0.5718351", "0.5639343", "0.5616272", "0.5598889", "0.5581304", "0.55219555", "0.54793644", "0.5359244", "0.5349357", "0.5325711", "0.53083825", "0.527723", "0.52399015", "0.52284765", "0.52271336", "0.5226591"...
0.67984337
0
cleanGrid will remove the table rows, if there are any
function cleanGrid(){ trList.forEach(function (tr) { tr.remove(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleting_grid()\n {\n for (var n=table_grid.rows.length ; n>=2; n--)\n {\n table_grid.removeChild(table_grid.childNodes[n]);\n }\n\n }", "function removeGrid(){\n\n\tconst table= document.getElementsByTagName('table').item(0);\n\tconst i = table.rows.length-1;\n\n\twhile (i>=0){\n\t...
[ "0.76957166", "0.76167506", "0.7559829", "0.73485404", "0.73413956", "0.7274936", "0.7180754", "0.71452516", "0.7090032", "0.7082947", "0.7074282", "0.705398", "0.7043055", "0.70158076", "0.6980838", "0.69797546", "0.6969944", "0.6962001", "0.6951465", "0.69514084", "0.693546...
0.8728039
0
constructor function: should create a new PickupLocation with properties
function PickupLocation (address, city) { this.address = address; this.city = city; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(props) {\t\t\t\t\t\t\t\t\t\t\t\t//SINCE ADDRESS WITHOUT LOCATION IS POINTLESS\r\n\t\tsuper(props);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//AND WE'RE NOT GONNA LET THEM HAVE A LOCATION WITHOUT ADDRESS\r\n\t\tthis.state = {};\r\n\t}", "constructor(location, parcels) {\n this.location = location;\n this.pa...
[ "0.6684191", "0.6678812", "0.647813", "0.62796265", "0.61385447", "0.6104964", "0.60966784", "0.6058653", "0.6046655", "0.60325533", "0.6020967", "0.6005995", "0.5987879", "0.59670746", "0.5955519", "0.593092", "0.586029", "0.5850147", "0.5742303", "0.572816", "0.5723937", ...
0.79104316
0
Retrieves the encoded query.
getEncodedQuery() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getQuery() {\n return this._query ? this._query.toString() : undefined;\n }", "getQuery() {\n return this._query ? this._query.toString() : undefined;\n }", "function getQuery(){\n\t\treturn this.query;\n\t}", "getQuery() {\n return this.query;\n }", "function get_query() {\...
[ "0.7324862", "0.7324862", "0.6892528", "0.6527279", "0.64846617", "0.6461759", "0.6323182", "0.62108386", "0.62108386", "0.6118462", "0.6107667", "0.6065261", "0.60644966", "0.6033813", "0.60224205", "0.5964301", "0.59228", "0.5887244", "0.58814365", "0.5860492", "0.5845858",...
0.8329854
0
A granular sampler which looks back over previous samples and recycles them, altering playback speed etc. Lots of experimentation with this so pretty messy, may separate out the operation modes to different methods or different components altogether in future. INIT
function Resampler() { this.s = 0; this.c = 0; this.i = -1; this.r = 0; this.sp = 3; this.l = 5000; this.m = [0,0]; this.mc = 0; this.lastInd = -1; this.mode = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TemporalSuperSampling (frames) {\n var haltonSequence = [];\n\n for (var i = 0; i < 30; i++) {\n haltonSequence.push([Object(__WEBPACK_IMPORTED_MODULE_0__halton__[\"a\" /* default */])(i, 2), Object(__WEBPACK_IMPORTED_MODULE_0__halton__[\"a\" /* default */])(i, 3)]);\n }\n\n this._halto...
[ "0.6519673", "0.628723", "0.6285624", "0.61836547", "0.61174244", "0.6058737", "0.60361147", "0.5986575", "0.59760755", "0.59549826", "0.58659905", "0.5854954", "0.5824556", "0.5822292", "0.5782127", "0.57461697", "0.5706349", "0.57029366", "0.56897396", "0.56834334", "0.5678...
0.7001516
0
Calling an ajax request in order to switch the table information to make it show info of arriving trains
function switchTableArrival(){ tableDelete(); departure = false; var index = document.getElementById('select_station').selectedIndex; var id = index; var s = '{"id":'; s += id; s += '}'; var js_object = JSON.parse(s); $.getJSON("ajax/arrivals.php", js_object) .done(function(d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function request(res) {\n\n \n\n var indexTrainNumber = 0;\n var stationData = res[\"Stations\"];\n var trainData = res[\"trains\"];\n if (trainData == \"1\") {\n alert(\"אין רכבות ליעד המבוקש\");\n }\n else {\n\n allData = res;\n\n var userTime = new Date(new Date().toDat...
[ "0.7008272", "0.66780037", "0.66215587", "0.65912396", "0.65716743", "0.65553224", "0.65363795", "0.6535664", "0.6518182", "0.6481536", "0.6477095", "0.6468481", "0.6453017", "0.6438038", "0.6434967", "0.6404418", "0.63812256", "0.6379655", "0.6378993", "0.6362694", "0.633942...
0.67968416
1
YComponent is a class that handles storing the stableId and the percentage offset in the y direction of all tracks within a specific viewX and viewY coordinate.
function YComponent(stableId, yPercentOffset) { this.stableId = stableId; this.yPercentOffset = yPercentOffset; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get yPosition() { return this._yPosition; }", "set y(value) {this._y = value;}", "function yComponent(x, y, image){InputComponent.call(this,x,y,image)}", "get y()\n\t{\n\t\tif (this._y != null)\n\t\t\treturn this._y;\n\n\t\t/*\n\t\tlet list = this.isInput ?\n\t\t\tthis.node.inputPlugs : this.node.outputPlugs...
[ "0.6142543", "0.6117094", "0.6108224", "0.6107609", "0.59491074", "0.5932365", "0.58301234", "0.5801209", "0.57942295", "0.5791656", "0.578638", "0.5767101", "0.57103217", "0.5708324", "0.5705229", "0.56459916", "0.5617409", "0.5612159", "0.55714124", "0.5519226", "0.55157995...
0.7818011
0
Use recursion to find the maximum numeric value in an array of arrays
function findMax1(ar) { var max = -Infinity; // Cycle through all the elements of the array for(var i = 0; i < ar.length; i++) { var el = ar[i]; // If an element is of type array then invoke the same function // to find out the maximum element of that subarray if ( Arra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findMax(array) {\n}", "function findMax(array) {\n maxValue = Math.max.apply(null, array);\n console.log(maxValue);\n}", "function findMax(arr){\n //sort the array\n //Math.max\n //array.reduce\n //use for loops and if statements\n //return Math.max(...arr);\n return arr.reduce(function(val, c...
[ "0.7904731", "0.7829058", "0.78288895", "0.7786057", "0.76978135", "0.7695089", "0.7688524", "0.76538575", "0.7644993", "0.7639848", "0.7608481", "0.76015294", "0.75977784", "0.7589835", "0.7578463", "0.75700235", "0.7567899", "0.75669885", "0.75557816", "0.7538467", "0.75362...
0.78743947
1
Called after broker created.
created(broker) {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "__broker_setup() {\n this.mqttServer.authenticate = this.__broker_auth;\n this.mqttServer.authorizePublish = this.__broker_allow_pub;\n this.mqttServer.authorizeSubscribe = this.__broker_allow_sub;\n this.mqttServer.on('clientConnected', this.__broker_connected);\n this.mqttServe...
[ "0.73684657", "0.7206365", "0.68512493", "0.64242196", "0.6321438", "0.62935513", "0.62353796", "0.6225617", "0.607675", "0.6062981", "0.588102", "0.5841233", "0.5841233", "0.5819057", "0.57868135", "0.5781343", "0.57500577", "0.57500577", "0.5748797", "0.5739006", "0.5728554...
0.739971
0
Called after broker started.
async started(broker) {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "__broker_setup() {\n this.mqttServer.authenticate = this.__broker_auth;\n this.mqttServer.authorizePublish = this.__broker_allow_pub;\n this.mqttServer.authorizeSubscribe = this.__broker_allow_sub;\n this.mqttServer.on('clientConnected', this.__broker_connected);\n this.mqttServe...
[ "0.7494482", "0.6720403", "0.6583207", "0.65403867", "0.6523754", "0.6276787", "0.62045044", "0.6195799", "0.6143408", "0.60883665", "0.6027521", "0.60065854", "0.5967578", "0.5946424", "0.5946424", "0.59191746", "0.5906758", "0.5906758", "0.5906758", "0.5906758", "0.5906758"...
0.75309616
0
Called after broker stopped.
async stopped(broker) {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "stop() {\n\t\t// Call service `started` handlers\n\t\tthis.services.forEach(service => {\n\t\t\tif (service && service.schema && isFunction(service.schema.stopped)) {\n\t\t\t\tservice.schema.stopped.call(service);\n\t\t\t}\n\t\t});\n\n\t\tif (this.metricsTimer) {\n\t\t\tclearInterval(this.metricsTimer);\n\t\t\tthi...
[ "0.6976342", "0.67773116", "0.64787364", "0.6451234", "0.643433", "0.64197195", "0.64197195", "0.64197195", "0.64197195", "0.64197195", "0.64197195", "0.64197195", "0.64197195", "0.64197195", "0.6252225", "0.6246276", "0.6235608", "0.6235608", "0.6235608", "0.6235608", "0.623...
0.8286503
0
Create char2id, id2char and vocab_size from printable ascii characters.
function createDictionary() { const printable = ('\t\n !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRST' + 'UVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~').split('') // prepend the null character printable.unshift('') const char2id = new Map() const id2char = new Map() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildASCII() {\n for (var i = 1; i < 127; i++) {\n asciiObj[String.fromCharCode(i)] = i;\n }\n}", "decode([...chars]) {\n return String.fromCharCode(...chars.map((char, i) =>\n ((char.charCodeAt(0) - ASCII_START) - (this.#keyShift[i % this.#keyShift.length]) + ASCII_LENGTH)\n % ASCII_L...
[ "0.5280217", "0.5267253", "0.5204561", "0.5198356", "0.5117839", "0.50523263", "0.502937", "0.5021415", "0.50126904", "0.5003985", "0.49839365", "0.49790767", "0.4958176", "0.49507496", "0.4923548", "0.4910477", "0.49094397", "0.4885238", "0.48737845", "0.48510963", "0.483205...
0.665503
0
Links the profile to the admin student/teacher profile
linkToProfile() { const id = this.props.person.id; const isStudent = this.props.person.customer_id ? true : false /* Use the customer_id field to check whether the person is a student or a teacher. */ if (isStudent) { window.location = RouteConstants.admin.studentProfile(id); } else {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function goProfile() {\n $state.go('profile');\n }", "function viewFullProfile() {\n history.push('/supported-employees/'+employee.id)\n }", "get editProfileLink() {\r\n return this.clone(UserProfileQuery, \"EditProfileLink\").get();\r\n }", "function _updateProfileView(req,re...
[ "0.63412297", "0.62180316", "0.60193485", "0.5992087", "0.5981979", "0.5926172", "0.583873", "0.58330005", "0.5829864", "0.5799356", "0.5793124", "0.5770179", "0.5724029", "0.5682491", "0.56780535", "0.56769943", "0.5676604", "0.5630487", "0.56270784", "0.55988014", "0.555318...
0.7747929
0
Carnegie Mellon University, Human Computer Interaction Institute Copyright 2005 All Rights Reserved Author: Benjamin Billings Version: $Revision: 10610 $ Last modified by: $Author: alida $ Last modified on: $Date: 20140221 15:10:45 0500 (Fri, 21 Feb 2014) $ $KeyWordsOff: $ This class is designed to add inline editing t...
function InlineEditor(aElement, aFormFieldType, aTarget, options) { this.element = aElement; //element which contains the text to edit. if (aTarget == null ) { this.target = window.location; } else { this.target = aTarget; } if (!aFormFieldType) { this.formFie...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function aef_editor() {\n this.wysiwyg_id = 'aefwysiwyg';\n this.textarea_id = 'post';\n this.text = '';\n this.on = false;\n this.flashw = 200;\n this.flashh = 200;\n this.toggle = function () {\n if (this.on) {\n this.to_normal()\n } else {\n this.to_wysiw...
[ "0.6116719", "0.6069202", "0.5979774", "0.5914664", "0.588737", "0.5826979", "0.5757376", "0.57087386", "0.56869674", "0.56720495", "0.5616474", "0.55944", "0.5592062", "0.5566673", "0.55637765", "0.55220807", "0.5495092", "0.5481782", "0.5440248", "0.5438697", "0.5404256", ...
0.62154585
0
Log the countdown number
function printNum(){ if (coundownCount > 0){ //if the n console.log(coundownCount); setTimeout(printNum , 1000); } else{ //Once the countdownCount comes to 0, stop console.log("DONE!"); } //countdown count go down 1 coundownCount --; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countdown() {\n console.log(5)\n console.log(4)\n console.log(3)\n console.log(2)\n console.log(1)\n}", "function countDown() {\r\n tick();\r\n var countDownString = numToString(min) + \" : \" +\r\n numToString(sec);\r\n const printTimer = document.getElementById(\"timer\"...
[ "0.7612082", "0.7060189", "0.69265926", "0.67852443", "0.6749954", "0.66957736", "0.66914374", "0.6688072", "0.66766024", "0.66187173", "0.65757585", "0.65682125", "0.6556256", "0.65497404", "0.6506404", "0.64955294", "0.6481226", "0.6442863", "0.64373106", "0.6403146", "0.63...
0.7120081
1
clean the HTML up, such as giving links their full paths, or making psuedo links into plain text
function cleanHTML(html){ html = giveLinksFullUrls(html); return html; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "stripHtml( text, removeUrls ) {\n let div = document.createElement( 'div' );\n div.innerHTML = String( text || '' );\n let output = String( div.textContent || div.innerText || '' );\n if ( removeUrls ) output = output.replace( /(https?\\:\\/\\/[\\w\\-\\.\\?\\=\\&\\%\\/\\#]+)/gi, '' );\n return outpu...
[ "0.6815752", "0.66717863", "0.6484984", "0.62859964", "0.6253883", "0.62135446", "0.6191949", "0.6158699", "0.6083992", "0.6068407", "0.60617274", "0.6056238", "0.6049934", "0.600927", "0.5990674", "0.59672886", "0.59626365", "0.5961509", "0.5951359", "0.59507823", "0.5949737...
0.79919046
0
make a clip object from the page selection
function getClipFromPage(){ var clip = {'url':'','html':''}; var selection = window.getSelection(); if (selection.rangeCount > 0) { var range = selection.getRangeAt(0); var clonedSelection = range.cloneContents(); var div = document.createElement('div'); div.appendChild(clonedSelection); clip ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@action handleClipSelect(dom, clip) {\n this.getActiveScene().setClip(clip);\n }", "function Main(curDoc, sel, amountofselectedobjects, clipobject){\n if (amountofselectedobjects){\n if(curDoc.activeLayer.locked || !curDoc.activeLayer.visible){\n alert(\"Please select objects on an unloc...
[ "0.62486386", "0.6043865", "0.5946638", "0.5919147", "0.5783846", "0.5635782", "0.5623924", "0.5618747", "0.5594239", "0.5584638", "0.55319685", "0.55148137", "0.55025095", "0.5499748", "0.5404018", "0.53891945", "0.53597295", "0.53468716", "0.53369415", "0.532426", "0.531427...
0.75168216
0
check to see if EB has initialized
function initialize() { if (!EB.isInitialized()) { EB.addEventListener( EBG.EventName.EB_INITIALIZED, handleEBInit ); } else { handleEBInit(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isInitialized() {\n return throwIfUninitialized !== throwUninitializedError;\n }", "function handleEBInit() {\n // Create the event.\n var event = document.createEvent('Event');\n event.initEvent('READY', true, true);\n document.dispatchEvent(event);\n\n docu...
[ "0.66846335", "0.6592468", "0.6589816", "0.6421185", "0.6309501", "0.62898207", "0.6196171", "0.6161598", "0.6153386", "0.6151047", "0.60900986", "0.6061085", "0.60334796", "0.602699", "0.6009365", "0.5984744", "0.598278", "0.5981598", "0.59577334", "0.59341043", "0.59324414"...
0.6820697
0
Runs when EB is ready.
function handleEBInit() { // Create the event. var event = document.createEvent('Event'); event.initEvent('READY', true, true); document.dispatchEvent(event); document.getElementById('button-exit').addEventListener('click', handleExit, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setHBReady() {\n hbReady = true;\n}", "function setHBReady() {\r\n hbReady = true;\r\n}", "ready() {}", "ready() {}", "ready() {}", "ready() {\r\n\t\tsuper.ready();\r\n\t}", "ready() { }", "ready() { }", "ready() { }", "ready() { }", "ready() { }", "ready() { }", "ready() { }...
[ "0.6977023", "0.69432396", "0.6943232", "0.6943232", "0.6943232", "0.6875406", "0.6840007", "0.6840007", "0.6840007", "0.6840007", "0.6840007", "0.6840007", "0.6840007", "0.6840007", "0.6808854", "0.68066454", "0.6781827", "0.6781827", "0.67701536", "0.67701536", "0.67701536"...
0.7618342
0
Display the required configuration nodes
showConfigs () { const activeConfigs = this.dag.requiredConfigNodes() // returns an array of DagNode references console.log('ACTIVE CONFIGS:') activeConfigs.forEach(cfg => { console.log(cfg.key(), cfg.value()) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "show() {\n for (let node of this.nodes) {\n node.show();\n node.showLinks();\n }\n }", "printNodes() {\n console.log(\"Information about Nodes:\")\n for (var key in this.nodes) {\n this.log(\" NodeId: \" + key);\n for (var mater...
[ "0.64966697", "0.6037029", "0.60275644", "0.5860436", "0.58225155", "0.5811302", "0.5731624", "0.5671249", "0.56703514", "0.5663158", "0.5631636", "0.56025416", "0.5572456", "0.5544691", "0.55367434", "0.55341274", "0.551324", "0.5491252", "0.54296786", "0.54167765", "0.53997...
0.7046322
0
Display the required input nodes
showInputs () { const requiredInputs = this.dag.requiredInputNodes() // returns an array of DagNode references console.log('REQUIRED INPUTS:') requiredInputs.forEach(node => { console.log(node.key()) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayNodesinfo() {\n\n\t\tvar ptx = 0,\n\t\t\tpty = 0,\n\t\t\tarrpt = [],\n\t\t\tt;\n\t\tvar svgg = theSvgElement.getElementsByClassName('textsqueleton');\n\t\tfor (var i = 0; i <= svgg.length - 1; i += 1) {\n\t\t\tsvgg[i].addEventListener('mouseover', function(evt) {\n\t\t\t\tt = evt.target;\n\t\t\t\ta...
[ "0.61979204", "0.5784143", "0.5764244", "0.57121694", "0.5700903", "0.55973107", "0.5561165", "0.54840297", "0.5469295", "0.5446875", "0.54376453", "0.5426549", "0.54185826", "0.5409745", "0.53994197", "0.534444", "0.5327228", "0.5286473", "0.52808475", "0.5279422", "0.525571...
0.72491556
0
translates the board matrix into coordinates, colours, etc of the pieces Mapear as posicoes x,y,x das pecas para mostrar no tabuleioro
translateBoard() { this.pieces = []; for (var i = 0; i < this.board.length; i++) { for (var j = 0; j < this.board[i].length; j++) { if (this.board[i][j] != "empty") { var tmp = new Piece(this.scene); tmp.active = true; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function piece2Grid() {\n for (var i = 0; i < active.location.length; i++) {\n grid[active.location[i][0]][active.location[i][1]] = active.color;\n\n }\n}", "function drawPieces(){\r\n tetrisGrid.fillStyle = 'white'; // white canvas (game board)\r\n tetrisGrid.fillRect(0,0, canvas.width, canva...
[ "0.68686277", "0.6855727", "0.680552", "0.67932606", "0.677626", "0.67358756", "0.6600565", "0.659058", "0.6546084", "0.6525711", "0.6469917", "0.64596176", "0.6457916", "0.63928574", "0.63558173", "0.6355184", "0.6354343", "0.63464224", "0.6340552", "0.6337621", "0.63343334"...
0.7345735
0
called when a piece is picked twice, denoting that the first time was an error unpicks the former picked piece
resetPickedPiece() { this.pickedPiece = 0; this.tmpPiece = 0; this.piece2Move = null; this.state = STATES.READY_TO_PICK_PIECE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "logPicking() {\n if (!this.pickMode && this.pickResults\n && this.pickResults.length > 0 && this.gameOrchestrator.playerMoves) {\n\n this.gameOrchestrator.possibleMoves.splice(0, this.gameOrchestrator.possibleMoves.length);\n const validResults = this.pickResults.filter(result => result[0]);\n ...
[ "0.6298148", "0.59359646", "0.57905287", "0.57856953", "0.5773467", "0.5743113", "0.5724288", "0.5708496", "0.5605009", "0.5566808", "0.55584234", "0.553265", "0.55243534", "0.55120856", "0.5481847", "0.54619694", "0.54602903", "0.5453208", "0.5442444", "0.5423541", "0.541569...
0.6967332
0
drawZombies represents the enemies
drawZombies() { var ctx = myGameArea.context; var img = new Image() img.src = './images/zombie.gif' ctx.drawImage(img, this.x, this.y, this.width, this.height); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function paintEnemies(enemies) {\n enemies.forEach(function (enemy) {\n enemy.y += 5;\n enemy.x += getRandomInt(-15, 15);\n\n // Paint only if not dead\n if (!enemy.isDead) {\n paintTriangle(enemy.x, enemy.y, 20, '#ff0000', 'down');\n }\n\n // Paint enemy shots\n enemy.shots.forEach(func...
[ "0.6773338", "0.66939825", "0.66828376", "0.6588852", "0.6510857", "0.6429781", "0.63912016", "0.6384693", "0.63462335", "0.6340913", "0.6326649", "0.6296529", "0.6278315", "0.6272333", "0.6230441", "0.6204486", "0.61870605", "0.61821", "0.61589885", "0.61562943", "0.61215067...
0.7324138
0
Adapter is an object own by a given device controller that handle data connection
function DevAdapter (controller) { this.id = controller.svc; this.uid = "//" + controller.svcopts.adapter + "/" + controller.svc + ":" + controller.svcopts.port;; this.control = 'tcpsock'; this.info = 'Tk102-Gps103'; this.debug = controller.svcopts.debug; this.controller...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DevAdapter (controller) {\n this.id = controller.svc;\n this.uid = \"//\" + controller.svcopts.adapter + \"/\" + controller.svc + \":\" + controller.svcopts.port;;\n this.info = 'json2ais';\n this.control = 'tcpsock'; // this wait for AIS clients to connect...
[ "0.7084886", "0.63113374", "0.60020864", "0.598125", "0.59481245", "0.59006417", "0.5893421", "0.5815714", "0.57292974", "0.55490863", "0.5541071", "0.5522952", "0.55192304", "0.5469257", "0.54571724", "0.5440101", "0.5428973", "0.53659135", "0.5328026", "0.5313551", "0.52648...
0.6506458
1
Build all of the dot views.
function buildViews() { gridDot = createDotGraphic(10, 0x0d47a0); gridDotUpper = createDotGraphic(25, 0x536dfd); gridDotUpper.alpha = 0; gridDotUpper.buttonMode = true; gridDotUpper.mouseover = function(){ gridDotChild.tint = 0x1156B0; }; gridDotUpper.mouseout = funct...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "generateViews() {\n let views_constructor = new ViewConstructor(openapi_dictionary, this.models);\n return views_constructor.generateViews(View, this.api.openapi);\n }", "function buildViews()\n{\n const viewsDiv = $(\"<div></div>\");\n viewsDiv.attr(\"id\", \"views\");\n const para = $(\"<p>...
[ "0.6626372", "0.61140925", "0.5924275", "0.58880484", "0.56841475", "0.5656011", "0.54712504", "0.5470547", "0.54663014", "0.5451", "0.5416308", "0.54126567", "0.53183424", "0.52793455", "0.52793455", "0.52793455", "0.52793455", "0.52688545", "0.5250731", "0.5231274", "0.5226...
0.7199256
0
When position updates, update the position of the dot.
function onUpdatePosition() { gridDotUpper.position = position; gridDot.position = position; gridDotMiddle.position = position; if (guitarString) { guitarString.updateDotPosition(self); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updatePosition() {\r\n\t\t\tcircle.attr('transform', `translate(${point.x * graph.cell_size + graph.offset.x} ${point.y * graph.cell_size + graph.offset.y})`);\r\n\t\t}", "function position(dot) {\n dot\n .attr(\"cx\", function(d) { return xScale(x(d)); })\n .att...
[ "0.7112445", "0.7087512", "0.7073255", "0.70305324", "0.7029326", "0.7029326", "0.7029326", "0.70090926", "0.696693", "0.696693", "0.696693", "0.69659173", "0.6942837", "0.6893027", "0.67773235", "0.66779315", "0.6654472", "0.6648543", "0.65736115", "0.65555364", "0.64902616"...
0.73083895
0
Function to initialize the global variables.
function initializeGlobalVariables() { selectedElements = []; totalMoves = 0; totalMatchFound = 0; starRating = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function initGlobal(){\n\n\t//\n\t// START TIMER\n\tif($('message_time_wrap...
[ "0.7100675", "0.7100675", "0.7100675", "0.7100675", "0.7100675", "0.7100675", "0.7100675", "0.7100675", "0.7100675", "0.7100675", "0.7025702", "0.69316983", "0.69316983", "0.69316983", "0.691288", "0.691288", "0.69104195", "0.69100446", "0.6904673", "0.68731034", "0.68722427"...
0.7627344
0
Updates the game score board that comprises of stars and moves.
function updateScoreBoard() { totalMoves++; $('#moves-counter').text(totalMoves); if (totalMoves > 15 && totalMoves <= 20) { setStars(2); } else if (totalMoves > 20) { setStars(1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateScore() {\n moveCounter += 1;\n document.getElementsByClassName('moves')[0].textContent = moveCounter;\n const stars = document.getElementsByClassName('stars')[0];\n switch (moveCounter) {\n case 16:\n setStarEmpty(stars.children[2].children[0]);\n starCounter = 2;\n break;\n ...
[ "0.7878992", "0.745773", "0.7400996", "0.7277762", "0.7258326", "0.7234629", "0.70780075", "0.6942181", "0.6923596", "0.6904423", "0.6879707", "0.6875355", "0.68432695", "0.6798255", "0.6796543", "0.6788267", "0.6733588", "0.671151", "0.67111635", "0.67084956", "0.6691995", ...
0.7628832
1
6. Update a button's attributes
function updateButtonAttributes(button){ // Change the clicked button's attributes button.value = diceSum button.innerHTML = diceSum button.setAttribute('readonly', 'true') // Update the aria-label attribute for screen readers let oldLabel = button.getAttribute('aria-label') let newLabel = oldLabel.replac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateButtonValue() {\n const shadow = this.shadowRoot;\n const buttonInput = shadow.querySelector(\"button\");\n\n // Set native type of button\n buttonInput.setAttribute(\"type\", this.getAttribute(\"native-type\") ? this.getAttribute(\"native-type\"): \"button\");\n if (this.hasAttribute(\"autofo...
[ "0.72849894", "0.69275904", "0.666026", "0.65278697", "0.642022", "0.63759685", "0.63160604", "0.62721586", "0.62562615", "0.6246424", "0.6206275", "0.62048274", "0.61982465", "0.6197239", "0.6194748", "0.61726534", "0.6164669", "0.6151017", "0.61470133", "0.6116481", "0.6111...
0.7440511
0
8. Build a set of button values from a querySelector
function buildSet(querySelector){ // .1. Get the needed buttons with the query selectors let buttonSet = document.querySelectorAll(querySelector[0]) // 2. Put every button's value in an array let setValues = new Array() for (let button of buttonSet) setValues.push(parseInt(button.value)) // 3. If it contain...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getGameBoardButtons() {\r\n\treturn document.querySelectorAll(\"#gameBoard > button\");\r\n}", "function getValues(btn){\n\tvar sel = btn.substring(0,(btn.length - 6));\n\tsel = \"#\" + sel;\n\tvar selectedValues = $(sel).val();\n\treturn selectedValues;\n}", "function ArregloBotones() {\r\n var elem...
[ "0.65371644", "0.64846855", "0.6458845", "0.6342555", "0.6335491", "0.6215152", "0.6177417", "0.60110563", "0.5941604", "0.5939943", "0.5926805", "0.59240115", "0.592266", "0.5888437", "0.58838856", "0.5871132", "0.5854166", "0.5850911", "0.5820973", "0.5820397", "0.58129233"...
0.6886038
0
9. Calculate a set's score / 9.1 Overall function, returning the score
function calculateSetScore(array){ // Sort array from low to high, the logic depends on this order array.sort(function(a, b){return a-b}) // Check for the possible scores, in the right order if (isSomeOak(array) == 5) return scores['5-oak'] if (isStraight(array)) { // Check if it contains a 7 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function performScoreCalculation() {\r\n var totalScore = 0; // calculated total score\r\n var score; // score in a category\r\n var ratio; // ratio of a category within the total score\r\n $(\"[id$='_score']\").each(function() {\r\n ratio = parseFloat($(this).attr(\"data-ratio\"));\r\n s...
[ "0.7084607", "0.70192873", "0.7006414", "0.68719625", "0.6652703", "0.6639072", "0.6585248", "0.6574957", "0.6570729", "0.6554908", "0.655176", "0.653455", "0.6526574", "0.6526217", "0.6506164", "0.6503808", "0.6499696", "0.64838076", "0.6480618", "0.6480613", "0.6476199", ...
0.73084646
0
Initializes a polygon's attributes.
function initPolygon(polygon, time, imageIndex, parentColor) { polygon.attrs = { addedAt: time, completeAt: time + POLYGON_TRANSITION_MS, imageIndex, replacedAt: null, deleteAt: null, parentColor, color: null, stddev: null, }; return polygon; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function polygon()\n{\n\tthis.poly = new Array();\n\tthis.normals = new Array();\n\tthis.uvs = new Array();\n\tthis.end = 0;\n}", "function Polygon (pathArray) {\n //Convert keys to 'latitude' and 'longitude', from 'k' and 'B' (gmaps)\n this.region_name = null; //TODO: User sets this\n this.id = n...
[ "0.7315704", "0.67085356", "0.6419469", "0.6320959", "0.60611814", "0.60322005", "0.60189605", "0.5981406", "0.59710914", "0.5944259", "0.5944259", "0.5944259", "0.59371454", "0.5925747", "0.59153324", "0.59153324", "0.59153324", "0.59153324", "0.5879432", "0.5879432", "0.587...
0.6777535
1
Marks a polygon as having been shattered and removed at the given time.
function markPolygonForRemoval(polygon, time) { polygon.attrs.replacedAt = time; polygon.attrs.deleteAt = time + POLYGON_TRANSITION_MS; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shatterPolygon(polygon, point, time) {\n if (!(polygon.isInside(point) && !polygon.isOn(point))) {\n return null;\n }\n\n const imageIndex = polygon.attrs.imageIndex;\n const edges = [...segmentPolygon(polygon).pairs()];\n\n const shatterPoint = {...point, key: true, newPt: true};\n...
[ "0.591074", "0.575657", "0.54938567", "0.53455627", "0.5341924", "0.5325576", "0.52942336", "0.5219882", "0.5195405", "0.517542", "0.50965285", "0.50636154", "0.5049498", "0.49960187", "0.4984667", "0.49414188", "0.49269953", "0.49194887", "0.4915737", "0.49147847", "0.490960...
0.821221
0
Copies attributes from the src polygon to the dst polygon, returning dst.
function copyAttrs(src, dst) { dst.attrs = {...src.attrs}; return dst; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copyVertex(dest, orig) {\n\tfor (var prop in orig) {\n\t\tif (orig.hasOwnProperty(prop))\n\t\t\tdest[prop] = orig[prop];\n\t}\n\t/*dest.x = orig.x;\n\tdest.y = orig.y;\n\tdest.z = orig.z;\n\tdest.r = orig.r;\n\tdest.g = orig.g;\n\tdest.b = orig.b;\n\tdest.u = orig.u;\n\tdest.v = orig.v;\n\tdest.w = orig.w...
[ "0.6164578", "0.6068096", "0.59605443", "0.59333754", "0.5930774", "0.5895475", "0.58944964", "0.58944964", "0.58944964", "0.58944964", "0.58944964", "0.58723813", "0.58723813", "0.58723813", "0.58723813", "0.58723813", "0.58723813", "0.58723813", "0.58723813", "0.58487386", ...
0.6586362
0
Divides each edge in polygon into segmentsPerEdge equal length edges. This gives the shatter algorithm more vertices to work with.
function segmentPolygon(polygon) { const newPoints = []; for (const [p0, p1] of polygon.pairs()) { const delta = sub(p1, p0); for (var j = 1; j < SEGMENTS_PER_EDGE; j++) { const frac = j / SEGMENTS_PER_EDGE; const newP = add(p0, scale(delta, frac)); newP.key = false; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createSegmentsArray(subPolygon) {\n // Q1. Declare the \"segments\" multidimensional array\n segments = [];\n // Q2. Create \"points\" array consisting of anchor points comprising the subPolygon polygon\n points = [];\n for (var j = 0; j < subPolygon.pathPoints.length; j++) {\n points....
[ "0.5523431", "0.5439597", "0.5439597", "0.53823465", "0.5277478", "0.52688175", "0.525899", "0.5094005", "0.5072685", "0.5031442", "0.50200546", "0.50200546", "0.50200546", "0.50200546", "0.5012905", "0.5005892", "0.50046206", "0.50046206", "0.50046206", "0.49990773", "0.4993...
0.6200736
0
This removes all vertices from polygon that have key set to false, i.e. they were added in segmentPolygon but were not used by the shatter function.
function desegmentPolygon(polygon) { const newPoints = polygon.points.filter(p => p.key); return copyAttrs(polygon, new Polygon(newPoints)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeSelectionPolygon() {\t\t\t\n\t\t\t\tselection_polygon.setPath([]);\n\t\t\t\tselection_polygon.setMap(null);\n\t\t\t}", "function segmentPolygon(polygon) {\n const newPoints = [];\n for (const [p0, p1] of polygon.pairs()) {\n const delta = sub(p1, p0);\n for (var j = 1; j < SEGMENTS...
[ "0.63341147", "0.5848346", "0.57703084", "0.56151664", "0.5610844", "0.5598729", "0.55787814", "0.5467612", "0.5458616", "0.54366136", "0.54366136", "0.54257435", "0.54235464", "0.54066545", "0.5361312", "0.5359938", "0.53598535", "0.53177375", "0.5300856", "0.52981097", "0.5...
0.6522302
0
Computes some stats about the image data within the given polygon.
processPolygon(polygon) { const instance = this.instances[polygon.attrs.imageIndex]; const image = this.images[instance.url]; const inverseScale = 1.0 / instance.scale; const resized = polygon .translate({x: -instance.x, y: -instance.y}) .scale(inverseScale, inverseScale); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeArea(input_img, polygon, year)\n{\n // Calculate area\n var areaImage = input_img.multiply(ee.Image.pixelArea());\n var stats = areaImage.reduceRegion(\n {\n 'reducer': ee.Reducer.sum(),\n 'geometry': polygon,\n 'maxPixels': 5e9,\n 'scale': area_scale,\n 'bestEffort':...
[ "0.6815016", "0.60106885", "0.5866807", "0.58212775", "0.56912667", "0.56292427", "0.560169", "0.55726814", "0.55527085", "0.5533953", "0.54951084", "0.5484894", "0.5417984", "0.5411619", "0.53768647", "0.53566283", "0.53446704", "0.529427", "0.5294233", "0.5278485", "0.52660...
0.7318236
0
Shatters the polygon with the highest weight.
shatterNextPoint(time) { let maxWeight = 0; let maxWeightPolygon = null; for (const polygon of this.polygons) { if (polygon.attrs.replacedAt) { continue; } // Don't shatter polygons that are still trying to appear. if (time < polygon.attrs.completedAt) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "weighdown() {\n if(this.type === Node.TARGET || this.type === Node.START) return;\n if(this.type === Node.WALL) this.makeNormal();\n this.pweighted = true;\n this.psquare.classList.add('square--weighted');\n }", "function get_shade(weight) {\n if (weight < 6) {\n return 1...
[ "0.54587865", "0.53987813", "0.5165061", "0.50531775", "0.49956015", "0.49879557", "0.48231497", "0.4806888", "0.47898865", "0.47872114", "0.4785588", "0.4777711", "0.47762516", "0.4754912", "0.47523332", "0.4750011", "0.4725311", "0.4725311", "0.4725311", "0.4725311", "0.472...
0.59096336
0
Shatters polygons at a fixed rate from the first tick to the server module, up to the given time.
shatterUntil(time) { // if (this.polygons.length == 1) { // console.dir(this.polygons, {depth: null, colors: true}); // this.shatterNextPoint(time); // console.dir(this.polygons, {depth: null, colors: true}); // } // return; if (this.shatterTime === null) { this.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runTimeFrame() {\n g.beginPath();\n evolve();\n draw();\n g.stroke();\n }", "function changeShape() {\n instrumentMode = 3; // we are in change_shape_mode!\n myTimeout = setTimeout(function() {\n instrumentMode = 7;\n maxNumShapes++;\n numCus...
[ "0.60077983", "0.5745138", "0.5624291", "0.56157964", "0.55301595", "0.5496935", "0.548091", "0.5462556", "0.54448617", "0.53081244", "0.53043", "0.530168", "0.52719223", "0.5264969", "0.52379245", "0.521145", "0.5195542", "0.51835954", "0.5176106", "0.51372796", "0.51311034"...
0.68463516
0
When called, expires all the old polygons, and starts over with a new set of images.
restart(time) { this.lastRestart = time; for (const polygon of this.polygons) { if (polygon.attrs.deleteAt === null) { markPolygonForRemoval(polygon, time); } } this.tileHorizontally(time); this.shatterUntil(time + PRECOMPUTE_MS); // Advance the images play...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n this.canvas.clear();\n for (const id in this.imagesMapping) {\n delete this.imagesMapping[id];\n }\n this.imagesMapping = {};\n }", "function resetMap() {\n clearMap();\n removePolygon();\n }", "function polygon() {\n let bottom = hspace + ( collection....
[ "0.620045", "0.5805537", "0.5782492", "0.5720128", "0.57034856", "0.5637067", "0.5636727", "0.56310505", "0.5603795", "0.5600717", "0.55934227", "0.55677617", "0.553722", "0.552616", "0.5477766", "0.5470222", "0.5464514", "0.54594916", "0.5458076", "0.5455294", "0.543783", ...
0.6604099
0
create connection to Database with setting
init() { this.connection = mysql.createConnection(this.setting); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "connectToDatabase () {\n this.database = pgp(connectionDatas)\n _checkDatabaseConnection(this.database)\n }", "getConnection(){\n\t\tlet config = this.getDataBaseConfig();\n\t\treturn mysql.createConnection({\n\t\t\thost: config[\"host\"],\n\t\t\tuser: config[\"user\"],\n\t\t\tpassword: config[\"password\...
[ "0.74243426", "0.7365081", "0.7269172", "0.723513", "0.7123456", "0.71082413", "0.7028202", "0.7017566", "0.700713", "0.69924545", "0.69809604", "0.69796073", "0.69626606", "0.69179934", "0.6872598", "0.6869532", "0.681607", "0.67563176", "0.67481285", "0.67379826", "0.672928...
0.7495241
0
Utility function to extract first digit value from input[start: end] substring Return a tuple of parsed value and value end index. Example: func('2(3)(1)', 0) => [2, 1], 1 is the end index of value '2'. func('2(3)(1)', 2) => [3, 3], 3 is the end index of value '3' The end index will be index of a '(' or ')' or end of t...
function extractNumber(input, start) { if(start >= input.length){ return [ NaN, -1] } let isNeg = 1; let number = 0; let i; for(i = start; i < input.length; i++) { if(input[i] === '-'){ isNeg = -1; }else if(input[i] === '(' || input[i] === ')'){ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extractTwo(str){\n return console.log(str.match(/\\d+/g).map(item=> parseInt(item)))\n}", "function parseFirstInt(input) {\n\nlet inputToParse = input;\n\nfor (let i = 0; i < input.length; i++) {\n let firstInt = parseInt(inputToParse);\n if (!Number.isNaN(firstInt)) {\n return firstInt;\n ...
[ "0.607015", "0.6063126", "0.59872645", "0.5887965", "0.5802072", "0.5788287", "0.577634", "0.57422614", "0.5648213", "0.55222213", "0.5511596", "0.54947114", "0.54947114", "0.5467849", "0.5444666", "0.53523123", "0.5323184", "0.53106314", "0.5286927", "0.5282497", "0.52144694...
0.6289202
0
payload : quizFinal, year, chapter
QUIZ_VALIDE_PARTITION(context, payload) { var bodyFormData = new FormData(); if (payload.quizFinal) { context.commit("modifyQuizFinalPartition", payload); bodyFormData.append("mgq_id", 5); bodyFormData.append("score", payload.score); bodyFormData.append("evaluated", 1); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ENTRAINEMENT_VALIDE(context, payload) {\n console.log(payload);\n if (payload.score > 0.75) {\n context.commit(\"entrainementValide\", payload);\n }\n\n let total = 0;\n let nbTrue = 0;\n var bodyFormData = new FormData();\n bodyFormData.append(\"mgq_id\", payload.id);\n ...
[ "0.5964918", "0.5539503", "0.5507767", "0.54655194", "0.536464", "0.53600365", "0.5311961", "0.5304895", "0.5282917", "0.5268084", "0.52269745", "0.5221625", "0.5214126", "0.5198776", "0.5198776", "0.5116468", "0.51074874", "0.5107098", "0.5103572", "0.51030385", "0.50857985"...
0.55948603
1
========================================================================// Define some functions and objects that are needed. // ========================================================================// Function to filer the marker cluster. Leaflet doesn't have a filter option. Here we loop over the geoJsonLayer and a...
function filterCluster(_filter) { geoJsonLayer.eachLayer(function(l) { if (_filter(l.feature)) { if (!markers.hasLayer(l)) { markers.addLayer(l); } } else { if (markers.hasLayer(l)) { markers.removeLayer(l); } } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addMarkerCluster(json) {\n //to modify\n $.each(json.features, function (index, object) {\n //console.log(object.geometry.coordinates);\n // console.log(coordsToLatLng(object.geometry.coordinates));\n //console.log(object.properties['Y_ADDR']);\n var marker = L.marker(new ...
[ "0.7028005", "0.6766947", "0.67374015", "0.65499264", "0.6257002", "0.618465", "0.61656743", "0.61650443", "0.6147325", "0.6122512", "0.60801405", "0.60561657", "0.60342014", "0.6018422", "0.59654653", "0.59396154", "0.5934329", "0.5923539", "0.5919845", "0.59179354", "0.5916...
0.77304506
0
Create invaders and add to array num is number of required invaders maxXLoc is maximum x location for invader placement
function createInvaders(num){ for(var i = 0; i < num; i++){ var color = 'rgb(' + Math.floor(Math.random() * 255) + ', ' + Math.floor(Math.random() * 255) + ',' + Math.floor(Math.random() * 255) + ')'; Invaders.push(new Invader(color)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addInvaders() {\n invaders.forEach(invader => cells[invader].classList.add('spaceInvader'))\n if (invaders.length === 0){\n newLevel()\n }\n }", "function populate_game() {\n while (invaders.length <= 20) {\n default_x = 20;\n for (let i =0; i< 4; i++){\n let c...
[ "0.61470485", "0.5983423", "0.58277696", "0.5735401", "0.5664994", "0.56636876", "0.551765", "0.551456", "0.5472874", "0.54522276", "0.5418079", "0.54118365", "0.5402014", "0.5363731", "0.53513694", "0.53179324", "0.5313905", "0.5274632", "0.526108", "0.52516145", "0.5146587"...
0.6785369
0
Tests if an invader is present if no invaders return true if there is an invader removeVisibility of invader and return false
function testForInvaders(bullet){ var score = document.getElementById('score'); var bulletX = bullet.getLocation()[0], bulletY = bullet.getLocation()[1]; for(var i = 0; i < Invaders.length; i++){ var invaderX = Invaders[i].getLocation()[0], invaderY = Invaders[i].getLocation()[1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeInvaders() {\n invaders.forEach(invader => cells[invader].classList.remove('spaceInvader'))\n }", "function moveInvaders() {\n const leftEdge = alienInvaders[0] % width === 0;\n const rightEdge = alienInvaders[alienInvaders.length-1] % width === width-1;\n\n if( (leftEdge ...
[ "0.6024858", "0.56332815", "0.5625149", "0.55276823", "0.5526447", "0.543267", "0.53646183", "0.5330031", "0.5329027", "0.53142744", "0.53084975", "0.52903366", "0.52823496", "0.5270635", "0.52119935", "0.51843715", "0.51691544", "0.51671994", "0.51585025", "0.513466", "0.511...
0.5877806
1
define the options of line chart used in creating chart.js object options
function line_options(element,data,canvas_id,chart_id,chart_datas){ y_subset_max = 0 y_overall_max = 0 data.datas.forEach(function(item,i){ if(i==0){ y_subset_max = Math.max(...item.data) }else{ y_overall_max = Math.max(...item.data) } }) y_max = 0 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lineOptions(labels = []) {\n return{\n responsive: true,\n maintainAspectRatio: true,\n animation: {\n duration: 0,\n },\n legend: {\n // display: false\n labels: {\n filter: (item, chart) => {\n if (item.text) return !item.text.includes('none');\n ret...
[ "0.72553647", "0.69676113", "0.67743313", "0.65579015", "0.64787996", "0.6457197", "0.6438702", "0.6424674", "0.63961565", "0.63908315", "0.6390603", "0.6390603", "0.6390603", "0.6390603", "0.6390603", "0.6390603", "0.63822395", "0.63809705", "0.6356077", "0.63556194", "0.635...
0.72084004
1
Note which style has the highest probability for the image Create little message
function highest_style_prob(max_style) { if (!document.contains(document.getElementById("likely_style"))){ var par = document.createElement("p"); var node = document.createTextNode("The model believes that the most likely style" + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get styleMsg() { return Object.assign({}, this.style.msg); }", "function speechBubble(){\r\n\t// array will be 9 elements later\r\n\tvar teach = new Array(\"Mixing Colours/MixGreenCircle.png\", \"Mixing Colours/MixGreenSquare.png\",\r\n\t\t\"Mixing Colours/MixGreenTriangle.png\", \"Mixing Colours/MixOrangeCircle...
[ "0.58079714", "0.5621485", "0.5620068", "0.5609116", "0.5608545", "0.56067604", "0.5606622", "0.56005794", "0.5588603", "0.55856735", "0.5579144", "0.5579144", "0.553322", "0.5511869", "0.5471024", "0.5461837", "0.54588085", "0.5454789", "0.54468703", "0.5420879", "0.5410062"...
0.63530445
0
Gets the one unique string from a STR_ARRAY, if none or more than one, return null
function get_unique(str_array) { var s = str_array[0]; if (str_array.length == 2) { return s; } var diff = []; for (var i = 1; i < str_array.length; i++) { if (str_array[i] != s) { diff.push(str_array[i]); } } if (diff.length == 1) { return dif...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function array(arr){\n\n return arr.split(\",\").slice(1,-1).join(\" \") || null\n }", "function findUnique(wordsArr) {\n const uniqueWords = wordsArr.filter((el, i, arr) => arr.indexOf(el) === i);\n if (uniqueWords !== []) {\n return uniqueWords[0];\n } else return false;\n}", "function getUniqueVal...
[ "0.6206866", "0.6049655", "0.6042373", "0.6037954", "0.5979117", "0.5706097", "0.56694335", "0.5651326", "0.5640652", "0.56388074", "0.5629845", "0.5629845", "0.5611793", "0.5577883", "0.5574879", "0.55037975", "0.5449704", "0.5448158", "0.5422427", "0.54183173", "0.53525645"...
0.72341806
0
Gets the element with the link to the next page using a specified ATTR to compare the page number elements from PAGES
function get_next_page(attr, next) { var attr_list = []; for (var i = 0; i < pages.length; i++) { attr_list.push(attr(pages[i])); } var u_attr = get_unique(attr_list); if (u_attr == null) { return null; } console.log(u_attr) console.log(pages) for (i = 0; i < pages.le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_next_page(){\n\t\treturn cache.$current == cache.$next ? config.page + 1 : config.page - 1;\n\t}", "nextPage () {\n const { page, itemsPerPage } = this.computedPagination\n if (this.lastItemIndex > 0 && page * itemsPerPage < this.filteredIcons.length) {\n this.setPagination({ page: ...
[ "0.6011982", "0.5931539", "0.5929644", "0.5849474", "0.5836521", "0.5720703", "0.5709549", "0.57036495", "0.5695989", "0.5692009", "0.56852746", "0.567835", "0.5633021", "0.56286335", "0.55940604", "0.55895257", "0.55814105", "0.5570267", "0.5546368", "0.55160767", "0.5501994...
0.73899657
0
show successors using JSON
ShowSuccessorsJSON(node_id){ let keys = Object.keys(this.graphObject); let values = Object.values(this.graphObject); let index = keys.find(element => element ==node_id); console.log(values[index].link); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSuccess(json) {\n\tallMovies = json;\n\tconsole.log(\"Got all movies\");\n\trender();\n}", "function _success_callback(resp, man){\n\t// The response is a generic bbop.rest.response.json.\n\t// Peel out the graph and render it.\n\tif( resp.okay() ){\n\t add_to_graph(resp.raw());\n\t}else{\n\t ...
[ "0.671181", "0.6166901", "0.60366154", "0.59858894", "0.5947326", "0.59431756", "0.5938348", "0.5901375", "0.5886744", "0.5855765", "0.5853802", "0.5845681", "0.5840235", "0.583981", "0.58390146", "0.5831001", "0.58305526", "0.57971215", "0.57844836", "0.57761794", "0.5772736...
0.633333
1
USEUNIT Button USEUNIT InitializationEnviornment USEUNIT Listbox USEUNIT POSObjectMapping USEUNIT SelectPackageAndSubPackage USEUNIT SelectQuantityFromHeader Select package and subpackageFunctionality
function SelectPackage() { InitializationEnviornment.initiliaze(); AppLoginLogout.login(); Listbox.SelectListboxItems("Daily Admission"); selectQuantity(31); selectPackage("Open Dated","Under 3"); selectPackage("Open Dated","Adult"); selectPackage("Open Dated","Children (Ages 3...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _0001485874456152_33_PromoCodes_Cash()\n{\nLog.AppendFolder(\"_0001485874456152_33_PromoCodes_Cash\");\ntry{\n InitializationEnviornment.initiliaze();\n AppLoginLogout.login();\n var keyWordNm =\"Promo Codes\";\n var packageNm = \"1:1 Comp Ratio\";\n var subPakNm =\"Indi...
[ "0.5995929", "0.59341335", "0.57720435", "0.57440865", "0.5657315", "0.5627785", "0.56141496", "0.56043935", "0.5599415", "0.5583065", "0.5561006", "0.55261743", "0.5488415", "0.54824233", "0.5480504", "0.54768646", "0.5460044", "0.543846", "0.5423961", "0.54155874", "0.54108...
0.7260169
0
The function returns the userdefined parsing functions for the list of axiom names.
function getParsingFunctions(axiomNames) { if (hasUnknownEntries(axiomNames)) { throw new Error('A request for an unknown axiom.') } let functions = null const convertPred = p => convertToSimplifyPredicate(p, functions) const convertExpr = e => convertToSimplifyIntExpr(e, functions) const convertVar =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeParseFunction (attributeName, keyNames) {\n return function parseFunction (elem) { \n let attributesString = elem.getAttribute(attributeName); // e.g. \"switchName(no-auto, parent) switchName2(auto, parent)\"\n\n if (!attributesString) {\n return [];\n }\n\n let parsedAttributeValues...
[ "0.54155684", "0.5342727", "0.5156416", "0.513097", "0.49819064", "0.4968974", "0.4825553", "0.4825433", "0.48248488", "0.47842494", "0.47488123", "0.46607673", "0.46466464", "0.463269", "0.46202773", "0.46080732", "0.46028486", "0.45950562", "0.45687428", "0.4555311", "0.455...
0.74726367
0
Adds a file descriptor into the list of descriptors
addDescriptor(title, driver, id) { // TODO: if already exists, throw an error let d = { title: title, driver: driver, // or google drive, ... id: id // driver specific file identifier } this.descriptors.push(d) return d }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "AddSocketIoFct(ModuleName, Fct){\n let apiobject = new Object()\n apiobject.ModuleName = ModuleName\n apiobject.Fct = Fct\n this._SocketIoFctList.push(apiobject)\n }", "function add(file) {\n var self = this;\n\n if (typeof file === 'string') {\n file = vfile$2(file);\n }\n\n...
[ "0.5068965", "0.5050841", "0.49931425", "0.49759653", "0.49742863", "0.49271232", "0.49017748", "0.48949504", "0.4826585", "0.48161644", "0.479666", "0.47845128", "0.4759193", "0.47439432", "0.47439432", "0.4689461", "0.46894044", "0.4665719", "0.4603017", "0.4583005", "0.455...
0.54196614
0
Returns file string of a given descriptor
loadFile(descriptor) { return this.drivers[descriptor.driver].getFile(descriptor.id) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fileString() {\n return this.id + \" \" + this.type + \" \" + this.note + \" \" + this.amount;\n }", "function filePathToString(path) {\n return new Promise(function (c, e) {\n fs_1.default.readFile(path, { encoding: 'utf8' }, function (err, data) {\n err ? e(err) : c(data);\n });...
[ "0.5287245", "0.5222196", "0.51259637", "0.50549597", "0.5044497", "0.50385773", "0.5022496", "0.50086737", "0.49371687", "0.49181277", "0.4916364", "0.48762715", "0.4832106", "0.48146597", "0.4804042", "0.47819847", "0.47339162", "0.4732721", "0.47271395", "0.47155002", "0.4...
0.5657735
0
Stores a file string into a location given by a descriptor
saveFile(descriptor, contents) { this.drivers[descriptor.driver].storeFile( descriptor.id, contents ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static writeFile(evt, {path=null, str=null}){\n // must have file name\n if(!path){\n let err = \"No file name provided (path is null).\";\n IpcResponder.respond(evt, \"file-write\", {err});\n return;\n }\n // must have string to write \n if(str =...
[ "0.5257847", "0.5238505", "0.5181993", "0.50572884", "0.50554067", "0.5026225", "0.50162226", "0.50003606", "0.4983652", "0.49748024", "0.4956041", "0.49180794", "0.49051452", "0.4848168", "0.48461077", "0.48324776", "0.4817667", "0.4813386", "0.4812972", "0.48033053", "0.479...
0.6599037
0
Returns variation of the ideal ID that is unique among existing IDs
uniqueId(idealId) { // if unique already if (this.descriptors.filter(x => x.id == idealId).length == 0) return idealId // add a number at the end let counter = 2 while (this.descriptors.filter(x => x.id == idealId + "-" + counter).length > 0) counter+...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RandomIdNoRepeated() {\n if (ConfiguratorMode == 'assembly') {\n max = 999;\n min = 1;\n } else if (ConfiguratorMode == 'CBC') {\n max = 1999;\n min = 1001;\n }\n pointId = Math.floor(Math.random() * (max - min + 1) + min);\n pointId = pointId.toString();\n ma...
[ "0.63192", "0.6283697", "0.6196517", "0.61960334", "0.6114595", "0.6083979", "0.6061564", "0.6051264", "0.59803855", "0.5961339", "0.5951084", "0.5944909", "0.5941733", "0.59398484", "0.5924666", "0.5924666", "0.5921394", "0.5913541", "0.59010637", "0.5899554", "0.5887268", ...
0.71139675
0
Hashrelated functions Get the hash part from a dat:// URL. Note that it technically returns the domain part of the URL. The function is named to_hash for simplicity, though, as we're dealing with hashes more often in the dat network.
function to_hash(url) { if (url && url.url) url = url.url; if (!url) return null; // This is microoptimized heavily because it's called often. // "Make slow things fast" applies here, but not literally: // "Make medium-fast things being called very often even faster." if ( url.length > 6 && ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getHashFromUrl(url) {\n\tconsole.log(String(url).slice(String(url).search('#') + 1));\n\treturn String(url).slice(String(url).search('#') + 1);\n}", "function getHashedURL(hash_URL) {\r\n\r\n if (hash_URL.indexOf(location.host) >= 0) {\r\n hash_URL = hash_URL.replace(\"http://\" + location.hos...
[ "0.6690477", "0.6679505", "0.64971197", "0.64861", "0.6408739", "0.6367913", "0.6367913", "0.6367913", "0.63568026", "0.6284409", "0.6188881", "0.6177169", "0.61751395", "0.5966162", "0.59534943", "0.58862495", "0.58656675", "0.5823049", "0.5810317", "0.5774869", "0.5769979",...
0.7393116
0
Compares hashes_a against hashes_b. hashes_a can be either a portal, array of URLs, array of hashes or Set of hashes. hashes_b can be everything hashes_a can be, or a string for convenience. This function calls to_hash on every string, except for strings in Sets.
function has_hash(hashes_a, hashes_b) { // Passed a portal (or something giving hashes) as hashes_a or hashes_b. var set_a = hashes_a instanceof Set ? hashes_a : null; if (hashes_a) { if (typeof(hashes_a.hashes_set) === "function") set_a = hashes_a.hashes_set(); if (typeof(hashes_a.hashes) === "func...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hash(a) {\n if (isNumber(a)) {\n return a;\n }\n var str = isString(a) ? a : jsonStableStringify(a);\n // short strings can be used as hash directly, longer strings are hashed to reduce memory usage\n if (str.length < 100) {\n return str;\n }\n // from ...
[ "0.58721447", "0.58022994", "0.5686271", "0.56188834", "0.5513026", "0.54209375", "0.53339183", "0.5320782", "0.5310856", "0.52234477", "0.52028674", "0.5167418", "0.515208", "0.51443666", "0.51197976", "0.5106322", "0.50687873", "0.50514925", "0.50266683", "0.5025015", "0.50...
0.7242304
0
Try to get the portal name from the given URL. Returns early with URLs starting with $ (f.e. $rotonde). If no matching portal can be found, it shortens the URL.
function name_from_hash(url) { if (url.length > 0 && url[0] == "$") return url; var hash = to_hash(url); var portal = r.home.feed.get_portal(hash, true); if (portal) return portal.name; if (hash.length > 16) return hash.substr(0,12)+".."+hash.substr(hash.length-3,2); return hash; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extractName(url) {\n const domain = url\n .replace('http://', '')\n .replace('https://', '')\n .split(/[/?#]/)[0];\n if (domain.split('.').length > 2) {\n return domain.split('.')[domain.split('.').length - 2];\n }\n return domain.split('.')[0];\n}", "function get_name(url){\n\t\tvar str...
[ "0.6068959", "0.5944223", "0.58737016", "0.5797834", "0.57685596", "0.5717885", "0.5699159", "0.56313825", "0.56313825", "0.56313825", "0.56313825", "0.56313825", "0.56313825", "0.56313825", "0.5622468", "0.55919796", "0.5548062", "0.5526666", "0.54639244", "0.54496384", "0.5...
0.6551838
0
Try to get the relationship rune from r.home.portal to the given URL. Returns the "rotonde" rune ($) with URLs starting with $ (f.e. $rotonde). If no matching portal can be found, it returns the "follow" rune (~).
function relationship_from_hash(url) { if (url.length > 0 && url[0] == "$") return create_rune("portal", "rotonde"); if (url === r.client_url) return create_rune("portal", "rotonde"); if (has_hash(r.home.portal, url)) return create_rune("portal", "self"); var portal = r.home.feed.get_portal(url, true); if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_url(element) {\r\n\r\n if (element.length > 0) {\r\n GM_log(element.length);\r\n var rhapURL = \"\"\r\n // Remove punctuation but leave the accented chars\r\n , match_re2 = new RegExp(/_|[^\\w\\dáÁâÂàÀåÅãÃäÄæÆçÇðÐéÉêÊèÈëËíÍîÎìÌïÏñÑóÓôÔòÒøØõÕöÖßþÞúÚûÛùÙüÜýÝÿ\\s]+/g)\r\n // Bel...
[ "0.52542835", "0.49440336", "0.46266544", "0.45253965", "0.4499796", "0.44755378", "0.43837875", "0.43742082", "0.43441358", "0.4339433", "0.43083534", "0.43002167", "0.42751148", "0.4243328", "0.4232974", "0.4231793", "0.42109266", "0.41907096", "0.4169447", "0.41613054", "0...
0.6717464
0
DOMrelated functions Creates a rune element for the given context and type.
function create_rune(context, type) { context = escape_attr(context); type = escape_attr(type); return `<i class='rune rune-${context} rune-${context}-${type}'></i>`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createTextElm(type, text) {\r\n var elm = document.createElement(type);\r\n var t = document.createTextNode(text);\r\n elm.appendChild(t);\r\n return elm;\r\n}", "function makeElement(type) {\n\t\treturn document.createElement(type);\n\t}", "function createEl(text){\n return document.createElem...
[ "0.6476228", "0.6325587", "0.6216869", "0.6200178", "0.6179957", "0.6146442", "0.6117764", "0.60913676", "0.60889035", "0.59943527", "0.5993525", "0.59636074", "0.59585667", "0.5956784", "0.5914174", "0.59050643", "0.59047306", "0.58862156", "0.587298", "0.5871505", "0.586293...
0.8196302
0
visibility button of compete todos section
function completeVisibilityToggle() { var content = document.getElementById(COMPELTE_TODO_ID); if(content.style.display == 'none') content.style.display = 'block'; else content.style.display = 'none'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteVisibilityToggle() {\n var content = document.getElementById(DELETE_TODO_ID);\n if(content.style.display == 'none')\n content.style.display = 'block';\n else\n content.style.display = 'none';\n}", "function showCreateTodo() {\n $('.form-create-todo').show()\n $('.my-todo')...
[ "0.6726288", "0.66917217", "0.66478026", "0.6561261", "0.64977205", "0.6457253", "0.6443626", "0.6332753", "0.6307964", "0.6303848", "0.6274773", "0.6266107", "0.62605137", "0.62405825", "0.6231056", "0.62255716", "0.6205679", "0.6204598", "0.6180625", "0.6179867", "0.6179238...
0.683555
0
aqui terina la seccion para el slider var currentSong = document.getElementById("ukuleleMusic"); var currentControls = document.getElementById("ukuleleControls");
function play(controls, musica) { // currentSong.pause(); // currentControls.querySelector('i.fas').classList.add('fa-play'); // currentControls.querySelector('i.fas').classList.remove('fa-pause'); const reproducir = document.getElementById(controls); /*play*/ var music = document.getElementById(mu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init(){\ndocument.querySelector('#power').onclick=openClose;\ndocument.querySelector('#sliderBack').onmouseout=slideStart;\ndocument.querySelector('#sliderBack').onmousedown=slideStop;\ndocument.querySelector('#sliderBack').onmousemove=slider;\ndocument.querySelector('#playButton').onmousedown=startPlayin...
[ "0.6786514", "0.6747193", "0.67394805", "0.66689473", "0.6489192", "0.6464242", "0.6394153", "0.6377893", "0.6363409", "0.635101", "0.63143426", "0.6297712", "0.6277999", "0.62764275", "0.6251637", "0.6222264", "0.62196946", "0.6213884", "0.6206673", "0.620304", "0.61719227",...
0.69638324
0