Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Wraps addEventListener to capture UI breadcrumbs
function domEventHandler(name, handler, debounce) { if (debounce === void 0) { debounce = false; } return function (event) { // reset keypress timeout; e.g. triggering a 'click' after // a 'keypress' will reset the keypress debounce so that a new // set of keypresses can be recorded keypressTimeout = undefined; // It's possible this handler might trigger multiple times for the same // event (e.g. event propagation through node ancestors). Ignore if we've // already captured the event. if (!event || lastCapturedEvent === event) { return; } lastCapturedEvent = event; if (debounceTimer) { clearTimeout(debounceTimer); } if (debounce) { debounceTimer = setTimeout(function () { handler({ event: event, name: name }); }); } else { handler({ event: event, name: name }); } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ready(){super.ready();let root=this;root.__breadcrumbs=document.createElement(\"rich-text-editor-breadcrumbs\");document.body.appendChild(root.__breadcrumbs);root.__breadcrumbs.addEventListener(\"breadcrumb-tap\",root._handleBreadcrumb.bind(root));this._stickyChanged()}", "_createCustomBreadcrumb(breadcrumb) {\n...
[ "0.704246", "0.6735263", "0.6622724", "0.6514452", "0.64408505", "0.6408898", "0.63610303", "0.63193476", "0.6208438", "0.61376977", "0.60940075", "0.5994608", "0.5973832", "0.5948128", "0.5930501", "0.5881445", "0.58801144", "0.5864432", "0.5862348", "0.58268285", "0.5826828...
0.0
-1
Wraps addEventListener to capture keypress UI events
function keypressEventHandler(handler) { // TODO: if somehow user switches keypress target before // debounce timeout is triggered, we will only capture // a single breadcrumb from the FIRST target (acceptable?) return function (event) { var target; try { target = event.target; } catch (e) { // just accessing event properties can throw an exception in some rare circumstances // see: https://github.com/getsentry/raven-js/issues/838 return; } var tagName = target && target.tagName; // only consider keypress events on actual input elements // this will disregard keypresses targeting body (e.g. tabbing // through elements, hotkeys, etc) if (!tagName || (tagName !== 'INPUT' && tagName !== 'TEXTAREA' && !target.isContentEditable)) { return; } // record first keypress in a series, but ignore subsequent // keypresses until debounce clears if (!keypressTimeout) { domEventHandler('input', handler)(event); } clearTimeout(keypressTimeout); keypressTimeout = setTimeout(function () { keypressTimeout = undefined; }, debounceDuration); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onElementKeyPress(event) {}", "onElementKeyPress(event) {}", "_registerKeyPressEvents() {\n window.addEventListener(\"keydown\", ((event) => {\n const increase = 1;\n this._handleKeyEvent(event.keyCode, increase);\n }));\n window.addEventListener(\"keyup\", ((event) => {\n const increas...
[ "0.7511093", "0.7511093", "0.7385871", "0.7310685", "0.7279947", "0.72450763", "0.6906862", "0.6886166", "0.68537796", "0.68148106", "0.6799994", "0.6776772", "0.6749719", "0.67320675", "0.67041856", "0.6669992", "0.66390294", "0.663687", "0.65940875", "0.65940875", "0.658906...
0.0
-1
Creates a new Browser SDK instance.
function BrowserClient(options) { if (options === void 0) { options = {}; } return _super.call(this, backend_BrowserBackend, options) || this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function createInstance() {\n // Private method to create a new instance of the browser\n const newInstance = await puppeteer.launch({\n headless: 'new',\n executablePath: \"/usr/bin/chromium-browser\",\n args: [\"--no-sandbox\", \"--disable-setuid-sandbox\", \"--run-all-compositor-stage...
[ "0.6634029", "0.5996018", "0.59461725", "0.59461725", "0.5860824", "0.5532018", "0.55178505", "0.55124", "0.5498515", "0.5480728", "0.54473406", "0.543767", "0.54267293", "0.5426521", "0.5405011", "0.5371086", "0.5360678", "0.5356838", "0.52900726", "0.52738893", "0.5259392",...
0.5506262
8
Present the user with a report dialog.
function showReportDialog(options) { if (options === void 0) { options = {}; } if (!options.eventId) { options.eventId = hub_getCurrentHub().lastEventId(); } var client = hub_getCurrentHub().getClient(); if (client) { client.showReportDialog(options); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showReportDialog() {\n return;\n}", "function showReportDialog(options) {\r\n if (options === void 0) {\r\n options = {};\r\n }\r\n if (!options.eventId) {\r\n options.eventId = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__[\"getCurrentHub\"])().lastEventId();\r\n }\r\n ...
[ "0.76670206", "0.7275469", "0.72505516", "0.68038166", "0.6778175", "0.6692404", "0.66070193", "0.6514185", "0.6461248", "0.6453411", "0.6404945", "0.6345106", "0.61511767", "0.6120984", "0.60982496", "0.6069775", "0.60486877", "0.5928666", "0.59062123", "0.58739394", "0.5863...
0.7562877
1
This is the getter for lastEventId.
function lastEventId() { return hub_getCurrentHub().lastEventId(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lastEventId() {\n\t return getCurrentHub().lastEventId();\n\t}", "function lastEventId() {\n return core.getCurrentHub().lastEventId();\n}", "function lastEventId() {\n return core_1.getCurrentHub().lastEventId();\n}", "get eventId() {\n return this._eventData.id;\n }", "get eventId...
[ "0.79700005", "0.79668206", "0.7807068", "0.71792233", "0.71792233", "0.71561086", "0.7094254", "0.66781336", "0.6424028", "0.60172457", "0.60172457", "0.59468675", "0.59468675", "0.59381956", "0.5925975", "0.5906", "0.58846474", "0.5879715", "0.5864876", "0.58641136", "0.580...
0.7679224
3
This function is here to be API compatible with the loader.
function forceLoad() { // Noop }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LocalLoader() { }", "function Loader() {\n\n}", "load() {}", "load() {}", "initLoader(loaderName) {\n loaderName = true;\n }", "lateLoad() {\n\n }", "transient private protected internal function m182() {}", "function LoaderProto() {}", "function LoaderProto() {}", "function LoaderP...
[ "0.67016244", "0.6482633", "0.63876814", "0.63876814", "0.627492", "0.62743604", "0.6266905", "0.6228069", "0.6228069", "0.6228069", "0.61503536", "0.60480213", "0.60456216", "0.5990577", "0.59856623", "0.5981982", "0.59621817", "0.594965", "0.5887062", "0.5842174", "0.582690...
0.0
-1
This function is here to be API compatible with the loader.
function onLoad(callback) { callback(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LocalLoader() { }", "function Loader() {\n\n}", "load() {}", "load() {}", "initLoader(loaderName) {\n loaderName = true;\n }", "lateLoad() {\n\n }", "transient private protected internal function m182() {}", "function LoaderProto() {}", "function LoaderProto() {}", "function LoaderP...
[ "0.67003626", "0.6482175", "0.63854223", "0.63854223", "0.6273288", "0.6272162", "0.62713087", "0.6226564", "0.6226564", "0.6226564", "0.61486953", "0.605238", "0.6043744", "0.59952253", "0.5985659", "0.5981532", "0.5960925", "0.5954019", "0.58916694", "0.5846652", "0.5831625...
0.0
-1
A promise that resolves when all current events have been sent. If you provide a timeout and the queue takes longer to drain the promise returns false.
function flush(timeout) { var client = hub_getCurrentHub().getClient(); if (client) { return client.flush(timeout); } return syncpromise_SyncPromise.reject(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drain(timeout) {\n return new syncpromise.SyncPromise((resolve, reject) => {\n let counter = buffer.length;\n\n if (!counter) {\n return resolve(true);\n }\n\n // wait for `timeout` ms and then resolve to `false` (if not cancelled first)\n const capturedSetTimeout = setT...
[ "0.6735874", "0.66713154", "0.6627388", "0.6355362", "0.6202156", "0.60480195", "0.6021893", "0.5971303", "0.5971303", "0.59321934", "0.5791965", "0.5651994", "0.5579035", "0.55449414", "0.5516379", "0.5484764", "0.54521686", "0.5447947", "0.5388345", "0.53577274", "0.5356543...
0.57021
11
A promise that resolves when all current events have been sent. If you provide a timeout and the queue takes longer to drain the promise returns false.
function sdk_close(timeout) { var client = hub_getCurrentHub().getClient(); if (client) { return client.close(timeout); } return syncpromise_SyncPromise.reject(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drain(timeout) {\n return new syncpromise.SyncPromise((resolve, reject) => {\n let counter = buffer.length;\n\n if (!counter) {\n return resolve(true);\n }\n\n // wait for `timeout` ms and then resolve to `false` (if not cancelled first)\n const capturedSetTimeout = setT...
[ "0.6735874", "0.66713154", "0.6627388", "0.6355362", "0.6202156", "0.60480195", "0.6021893", "0.5971303", "0.5971303", "0.59321934", "0.5791965", "0.57021", "0.5651994", "0.5579035", "0.55449414", "0.5516379", "0.5484764", "0.54521686", "0.5447947", "0.5388345", "0.53577274",...
0.0
-1
Wrap code within a try/catch block so the SDK is able to capture errors.
function sdk_wrap(fn) { return wrap(fn)(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "run() {\n\t\tthrow new Error;\n\t}", "function executeWithRaygunHandling(fn) {\n try {\n fn();\n } catch (e) {\n Raygun.send(e);\n }\n}", "static try(fn) {\n try {\n return Ok(fn())\n } catch (error) {\n return Err(error)\n }\n }", "function t(fn) { fn().catch(()=>{}); }", "fun...
[ "0.56149614", "0.56072515", "0.5600202", "0.5545256", "0.5490343", "0.53815824", "0.5357493", "0.5329493", "0.5329493", "0.53221285", "0.53221285", "0.53221285", "0.53221285", "0.53221285", "0.5315415", "0.53129834", "0.5312114", "0.52945846", "0.52945644", "0.5266173", "0.52...
0.0
-1
Enable automatic Session Tracking for the initial page load.
function startSessionTracking() { var window = Object(misc["e" /* getGlobalObject */])(); var hub = hub_getCurrentHub(); /** * We should be using `Promise.all([windowLoaded, firstContentfulPaint])` here, * but, as always, it's not available in the IE10-11. Thanks IE. */ var loadResolved = document.readyState === 'complete'; var fcpResolved = false; var possiblyEndSession = function () { if (fcpResolved && loadResolved) { hub.endSession(); } }; var resolveWindowLoaded = function () { loadResolved = true; possiblyEndSession(); window.removeEventListener('load', resolveWindowLoaded); }; hub.startSession(); if (!loadResolved) { // IE doesn't support `{ once: true }` for event listeners, so we have to manually // attach and then detach it once completed. window.addEventListener('load', resolveWindowLoaded); } try { var po = new PerformanceObserver(function (entryList, po) { entryList.getEntries().forEach(function (entry) { if (entry.name === 'first-contentful-paint' && entry.startTime < firstHiddenTime_1) { po.disconnect(); fcpResolved = true; possiblyEndSession(); } }); }); // There's no need to even attach this listener if `PerformanceObserver` constructor will fail, // so we do it below here. var firstHiddenTime_1 = document.visibilityState === 'hidden' ? 0 : Infinity; document.addEventListener('visibilitychange', function (event) { firstHiddenTime_1 = Math.min(firstHiddenTime_1, event.timeStamp); }, { once: true }); po.observe({ type: 'paint', buffered: true, }); } catch (e) { fcpResolved = true; possiblyEndSession(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startSessionTracking() {\n if (typeof WINDOW$2.document === 'undefined') {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&\n logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');\n return;\n }\n\n const hub = getCurr...
[ "0.7250156", "0.7194145", "0.71638817", "0.6897567", "0.6540723", "0.65276074", "0.64314497", "0.6408434", "0.6397561", "0.6355102", "0.6355102", "0.6355102", "0.6355102", "0.629443", "0.6239869", "0.6214304", "0.60800105", "0.6074651", "0.60626525", "0.60545546", "0.60320866...
0.6291641
14
path.resolve([from ...], to) posix version JSDoc
function path_resolve() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } var resolvedPath = ''; var resolvedAbsolute = false; for (var i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) { var path = i >= 0 ? args[i] : '/'; // Skip empty entries if (!path) { continue; } resolvedPath = path + "/" + resolvedPath; resolvedAbsolute = path.charAt(0) === '/'; } // At this point the path should be resolved to a full absolute path, but // handle relative paths to be safe (might happen when process.cwd() fails) // Normalize the path resolvedPath = normalizeArray(resolvedPath.split('/').filter(function (p) { return !!p; }), !resolvedAbsolute).join('/'); return (resolvedAbsolute ? '/' : '') + resolvedPath || '.'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resolveAsPath() { }", "function resolve(...input) {\n return path.resolve(...input)\n}", "function relative(from, to) {\r\n // tslint:disable:no-parameter-reassignment\r\n from = resolve(from).substr(1);\r\n to = resolve(to).substr(1);\r\n var fromParts = trim(from.split('/'));\r\n var toParts ...
[ "0.561329", "0.5468767", "0.5371159", "0.53127426", "0.53127426", "0.53046995", "0.5275564", "0.52286774", "0.5175212", "0.5140978", "0.5136547", "0.51263016", "0.5103508", "0.50814635", "0.5074827", "0.5045705", "0.50193274", "0.50193274", "0.50193274", "0.50096285", "0.5009...
0.0
-1
path.relative(from, to) posix version JSDoc
function relative(from, to) { /* eslint-disable no-param-reassign */ from = path_resolve(from).substr(1); to = path_resolve(to).substr(1); /* eslint-enable no-param-reassign */ var fromParts = trim(from.split('/')); var toParts = trim(to.split('/')); var length = Math.min(fromParts.length, toParts.length); var samePartsLength = length; for (var i = 0; i < length; i++) { if (fromParts[i] !== toParts[i]) { samePartsLength = i; break; } } var outputParts = []; for (var i = samePartsLength; i < fromParts.length; i++) { outputParts.push('..'); } outputParts = outputParts.concat(toParts.slice(samePartsLength)); return outputParts.join('/'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "rel (relativePath) {\n return nodePath.normalize(relativePath);\n }", "abs (relativePath) {\n return nodePath.resolve(relativePath);\n }", "relativePosix() {\n if (this.sep === '/')\n return this.relative();\n if (this.#relativePosix !== undefined)\n return t...
[ "0.6016257", "0.58232063", "0.57706845", "0.57446754", "0.5674279", "0.5635745", "0.5611134", "0.5571413", "0.5571413", "0.5532752", "0.55225337", "0.5517745", "0.5502026", "0.5496969", "0.5490298", "0.5460884", "0.5430811", "0.54135466", "0.5404939", "0.5404939", "0.5404939"...
0.51966155
42
path.normalize(path) posix version JSDoc
function normalizePath(path) { var isPathAbsolute = isAbsolute(path); var trailingSlash = path.substr(-1) === '/'; // Normalize the path var normalizedPath = normalizeArray(path.split('/').filter(function (p) { return !!p; }), !isPathAbsolute).join('/'); if (!normalizedPath && !isPathAbsolute) { normalizedPath = '.'; } if (normalizedPath && trailingSlash) { normalizedPath += '/'; } return (isPathAbsolute ? '/' : '') + normalizedPath; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalizePath(p) {\n return fslib_1.npath.toPortablePath(p);\n }", "function normalizePath(path) { return path.replace(/\\\\/g, '/') }", "function GetNormalizedPath() {\n}", "static normalize(path) {\n // Ensure forward slashes\n path = path.replace(/\\\\/g, \"/\");\n // Rem...
[ "0.614444", "0.6134857", "0.600149", "0.59661615", "0.5818625", "0.5758178", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0...
0.0
-1
Grabs active transaction off scope
function getActiveTransaction(hub) { if (hub && hub.getScope) { var scope = hub.getScope(); if (scope) { return scope.getTransaction(); } } return undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getActiveTransaction(hub) {\r\n if (hub && hub.getScope) {\r\n var scope = hub.getScope();\r\n if (scope) {\r\n return scope.getTransaction();\r\n }\r\n }\r\n return undefined;\r\n}", "function getActiveTransaction(maybeHub) {\n\t const hub = maybeHub || getCurr...
[ "0.71320355", "0.6801526", "0.67532086", "0.66450465", "0.66363716", "0.65982896", "0.64260983", "0.63593644", "0.6305192", "0.6264725", "0.6010928", "0.5956395", "0.59120536", "0.5901681", "0.5845219", "0.5836138", "0.5835769", "0.58170676", "0.5812717", "0.5795866", "0.5762...
0.7096723
1
Sanitizes html special characters from input strings. For mitigating risk of XSS attacks.
function escapeHtml(rawText) { return rawText .replace(/</g, '&lt;') .replace(/>/g, '&gt;') .replace(/"/g, '&quot;') .replace(/'/g, '&apos;') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "xss(str) {\n const lt = /</g;\n const gt = />/g;\n const ap = /'/g;\n const ic = /\"/g;\n return str.toString().replace(lt, \"&lt;\").replace(gt, \"&gt;\").replace(ap, \"&#39;\").replace(ic, \"&#34;\");\n }", "function sanitizeHTML(strings) {\n const entities = {'&': '&amp;...
[ "0.759199", "0.7562956", "0.7422235", "0.7403453", "0.73513234", "0.72910386", "0.72886336", "0.7118319", "0.6977197", "0.6956721", "0.6944392", "0.68856907", "0.6882707", "0.6863947", "0.6841094", "0.6834821", "0.6822679", "0.6810356", "0.6803345", "0.6783052", "0.6728569", ...
0.0
-1
Strip quotes from a string
function stripQuotes (str) { var a = str.charCodeAt(0); var b = str.charCodeAt(str.length - 1); return a === b && (a === 0x22 || a === 0x27) ? str.slice(1, -1) : str }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stripQuotes(theStr) {\r var theQuote;\r if (theStr.length > 1) { //if possibly quoted\r theQuote = theStr.charAt(0);\r if ((theQuote == \"'\" || theQuote == '\"') &&\r theStr.charAt(theStr.length-1) == theQuote)\r theStr = theStr.substring(1,theStr.length-1);\r }\r return theStr\r}",...
[ "0.7901178", "0.7812025", "0.780733", "0.7762566", "0.7762566", "0.7762566", "0.77615565", "0.7645416", "0.75609374", "0.75251627", "0.7522459", "0.7522459", "0.7522459", "0.7482644", "0.73682815", "0.7356931", "0.70602924", "0.703072", "0.69941694", "0.6988756", "0.6988756",...
0.78178227
10
Determine the type of a character in a keypath.
function getPathCharType (ch) { if (ch === undefined || ch === null) { return 'eof' } var code = ch.charCodeAt(0); switch (code) { case 0x5B: // [ case 0x5D: // ] case 0x2E: // . case 0x22: // " case 0x27: // ' return ch case 0x5F: // _ case 0x24: // $ case 0x2D: // - return 'ident' case 0x09: // Tab case 0x0A: // Newline case 0x0D: // Return case 0xA0: // No-break space case 0xFEFF: // Byte Order Mark case 0x2028: // Line Separator case 0x2029: // Paragraph Separator return 'ws' } return 'ident' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPathCharType(ch) {\n if (ch === undefined || ch === null) {\n return 'eof';\n }\n\n var code = ch.charCodeAt(0);\n\n switch (code) {\n case 0x5B: // [\n\n case 0x5D: // ]\n\n case 0x2E: // .\n\n case 0x22: // \"\n\n case 0x27: // '\n\n case 0x30:\n // 0\n return ch;\n...
[ "0.6661384", "0.6553067", "0.6553067", "0.6553067", "0.6520842", "0.6520842", "0.6520842", "0.6509395", "0.64543176", "0.5893024", "0.5843903", "0.5683862", "0.5586334", "0.5586334", "0.55530554", "0.5509329", "0.5456027", "0.5448259", "0.54441583", "0.54234093", "0.54234093"...
0.6530318
10
Format a subPath, return its plain form if it is a literal string or number. Otherwise prepend the dynamic indicator ().
function formatSubPath (path) { var trimmed = path.trim(); // invalid leading 0 if (path.charAt(0) === '0' && isNaN(path)) { return false } return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatSubPath(path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) {return false;}\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed;\n}", "function formatSubPath(path) {\n var trimmed = path.trim();\n // invalid leading 0\n i...
[ "0.7757966", "0.7757966", "0.7757966", "0.77383876", "0.75277257", "0.5522842", "0.545122", "0.5359274", "0.5325281", "0.5295737", "0.52854866", "0.5267375", "0.5253298", "0.5253298", "0.5248702", "0.51918644", "0.5165298", "0.5164079", "0.51384604", "0.51203215", "0.51203215...
0.77525383
12
Parse a string path into an array of segments
function parse$1 (path) { var keys = []; var index = -1; var mode = BEFORE_PATH; var subPathDepth = 0; var c; var key; var newChar; var type; var transition; var action; var typeMap; var actions = []; actions[PUSH] = function () { if (key !== undefined) { keys.push(key); key = undefined; } }; actions[APPEND] = function () { if (key === undefined) { key = newChar; } else { key += newChar; } }; actions[INC_SUB_PATH_DEPTH] = function () { actions[APPEND](); subPathDepth++; }; actions[PUSH_SUB_PATH] = function () { if (subPathDepth > 0) { subPathDepth--; mode = IN_SUB_PATH; actions[APPEND](); } else { subPathDepth = 0; if (key === undefined) { return false } key = formatSubPath(key); if (key === false) { return false } else { actions[PUSH](); } } }; function maybeUnescapeQuote () { var nextChar = path[index + 1]; if ((mode === IN_SINGLE_QUOTE && nextChar === "'") || (mode === IN_DOUBLE_QUOTE && nextChar === '"')) { index++; newChar = '\\' + nextChar; actions[APPEND](); return true } } while (mode !== null) { index++; c = path[index]; if (c === '\\' && maybeUnescapeQuote()) { continue } type = getPathCharType(c); typeMap = pathStateMachine[mode]; transition = typeMap[type] || typeMap['else'] || ERROR; if (transition === ERROR) { return // parse error } mode = transition[0]; action = actions[transition[1]]; if (action) { newChar = transition[2]; newChar = newChar === undefined ? c : newChar; if (action() === false) { return } } if (mode === AFTER_PATH) { return keys } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parsePath(path) {\n const paths = path.split('.');\n return paths.length > 1 ? paths : [paths[0]];\n}", "function getPathSegments(path) {\n var pathArray = path.split(\".\");\n var parts = [];\n for (var i = 0; i < pathArray.length; i++) {\n var p = pathArray[i];\n while (p[...
[ "0.65657526", "0.6555807", "0.654861", "0.6486956", "0.6282637", "0.6269213", "0.62553126", "0.62264353", "0.6216586", "0.6216586", "0.6216586", "0.6214373", "0.6189918", "0.6161804", "0.61454546", "0.61372876", "0.61096174", "0.60890704", "0.60795474", "0.6030243", "0.600847...
0.57493114
50
CONCATENATED MODULE: ./src/views/ChartPanel/components/dataPanel.vue?vue&type=template&id=ea8bbf24&scoped=true& CONCATENATED MODULE: ./src/api/source.js
function addSource(data) { return fetch({ url: 'source/create', method: 'POST', data }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BO(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "component() {\n return import(/* webpackChunkName: \"about\" */ '../views/About...
[ "0.58857095", "0.57021075", "0.56790245", "0.5672658", "0.5602884", "0.5599977", "0.5513555", "0.55087477", "0.54444987", "0.5416769", "0.5388699", "0.5381284", "0.537469", "0.5358846", "0.53166306", "0.5296982", "0.5293724", "0.5263554", "0.52481985", "0.52404064", "0.523288...
0.0
-1
TODO Draggable for group FIXME Draggable on element which has parent rotation or scale
function Draggable() { this.on('mousedown', this._dragStart, this); this.on('mousemove', this._drag, this); this.on('mouseup', this._dragEnd, this); // `mosuemove` and `mouseup` can be continue to fire when dragging. // See [Drag outside] in `Handler.js`. So we do not need to trigger // `_dragEnd` when globalout. That would brings better user experience. // this.on('globalout', this._dragEnd, this); // this._dropTarget = null; // this._draggingTarget = null; // this._x = 0; // this._y = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setDragElements(obj) {\n\n var move = function (dx, dy) {\n\n var paperScaleX = this.paper.transform().localMatrix.a;\n var paperScaleY = this.paper.transform().localMatrix.d;\n\n this.attr({\n transform: this.data('origTransform') + (this.data('origTransform') ? \"T\" :...
[ "0.61123204", "0.6081963", "0.5974425", "0.58198386", "0.5803953", "0.57410455", "0.5732408", "0.5727432", "0.5722066", "0.5688679", "0.5679193", "0.5624485", "0.560131", "0.55745864", "0.5566543", "0.5559153", "0.554501", "0.5529941", "0.55170584", "0.5488922", "0.5485738", ...
0.0
-1
| Procedures in renderNode |
function renderBackground(group, bg, useUpperLabel) { // For tooltip. bg.dataIndex = thisNode.dataIndex; bg.seriesIndex = seriesModel.seriesIndex; bg.setShape({ x: 0, y: 0, width: thisWidth, height: thisHeight }); if (thisInvisible) { // If invisible, do not set visual, otherwise the element will // change immediately before animation. We think it is OK to // remain its origin color when moving out of the view window. processInvisible(bg); } else { bg.invisible = false; var visualBorderColor = thisNode.getVisual('borderColor', true); var emphasisBorderColor = itemStyleEmphasisModel.get('borderColor'); var normalStyle = getItemStyleNormal(itemStyleNormalModel); normalStyle.fill = visualBorderColor; var emphasisStyle = getItemStyleEmphasis(itemStyleEmphasisModel); emphasisStyle.fill = emphasisBorderColor; if (useUpperLabel) { var upperLabelWidth = thisWidth - 2 * borderWidth; prepareText(normalStyle, emphasisStyle, visualBorderColor, upperLabelWidth, upperHeight, { x: borderWidth, y: 0, width: upperLabelWidth, height: upperHeight }); } // For old bg. else { normalStyle.text = emphasisStyle.text = null; } bg.setStyle(normalStyle); graphic.setElementHoverStyle(bg, emphasisStyle); } group.add(bg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_render() {}", "render() {}", "render() {}", "render() {}", "function render() {\n\t\t\n\t}", "render() {\n\n\t}", "render() {\n\n\t}", "render() { }", "function render() {\n\t}", "static rendered () {}", "static rendered () {}", "function render() {\n\n\t\t\t}", "function render() {\n\t\t\...
[ "0.7804213", "0.7781378", "0.7781378", "0.7781378", "0.7779666", "0.7751212", "0.7751212", "0.77304775", "0.76755935", "0.7616766", "0.7616766", "0.76145667", "0.7603221", "0.758931", "0.758931", "0.745217", "0.7431533", "0.7423107", "0.7374434", "0.7340493", "0.7340493", "...
0.0
-1
otherwise it will looks strange when 'zoomToNode'.
function prepareAnimationWhenNoOld(lasts, element, storageName) { var lastCfg = lasts[thisRawIndex] = {}; var parentNode = thisNode.parentNode; if (parentNode && (!reRoot || reRoot.direction === 'drillDown')) { var parentOldX = 0; var parentOldY = 0; // New nodes appear from right-bottom corner in 'zoomToNode' animation. // For convenience, get old bounding rect from background. var parentOldBg = lastsForAnimation.background[parentNode.getRawIndex()]; if (!reRoot && parentOldBg && parentOldBg.old) { parentOldX = parentOldBg.old.width; parentOldY = parentOldBg.old.height; } // When no parent old shape found, its parent is new too, // so we can just use {x:0, y:0}. lastCfg.old = storageName === 'nodeGroup' ? [0, parentOldY] : { x: parentOldX, y: parentOldY, width: 0, height: 0 }; } // Fade in, user can be aware that these nodes are new. lastCfg.fadein = storageName !== 'nodeGroup'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zoom(node){\n\tif (node.zoomed) {\n\t\tupdate(node.prev);\t\t// zoom out to the previous node;\n\t\tprev = node.prev;\t\t// set prev to the node that you zoomed out to\n\t\tnode.zoomed = false;\n\t} else {\n\t\tupdate(node);\t\t\t// zoom to the clicked node\n\t\tnode.zoomed = true;\n\n\t\tif (prev) {\n\t\...
[ "0.69734824", "0.6860572", "0.6723954", "0.6696952", "0.6536562", "0.643769", "0.63896275", "0.63575", "0.6356016", "0.6353609", "0.6297368", "0.6293824", "0.62618995", "0.6260596", "0.62486815", "0.62362343", "0.6226763", "0.6226763", "0.6196347", "0.6186906", "0.61808586", ...
0.0
-1
drill down and roll up differ background creation sequence from tree hierarchy sequence, which cause that lowser background element overlap upper ones. So we calculate z based on depth. Moreover, we try to shrink down z interval to [0, 1] to avoid that treemap with large z overlaps other components.
function calculateZ(depth, zInLevel) { var zb = depth * Z_BASE + zInLevel; return (zb - 1) / zb; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateZ(depth,zInLevel){var zb=depth * Z_BASE + zInLevel;return (zb - 1) / zb;}", "function calculateZ(depth, zInLevel) {\n\t var zb = depth * Z_BASE + zInLevel;\n\t return (zb - 1) / zb;\n\t }", "function calculateZ(depth, zInLevel) {\n\t var zb = depth * Z_BASE + zInLevel;\n\t ...
[ "0.692601", "0.64672476", "0.64490134", "0.62117696", "0.59978294", "0.5924424", "0.5889413", "0.58626413", "0.58525366", "0.58176625", "0.58069456", "0.57727456", "0.5749385", "0.56843436", "0.5664976", "0.5660208", "0.56331307", "0.560288", "0.5593327", "0.55618757", "0.555...
0.6321998
8
MUST be called after `prepareSource` called Here we need to make auto series, especially for auto legend. But we do not modify series.name in option to avoid side effects.
function autoSeriesName(seriesModel) { // User specified name has higher priority, otherwise it may cause // series can not be queried unexpectedly. var name = seriesModel.name; if (!modelUtil.isNameSpecified(seriesModel)) { seriesModel.name = getSeriesAutoName(seriesModel) || name; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function autoSeriesName(seriesModel) {\n\t // User specified name has higher priority, otherwise it may cause\n\t // series can not be queried unexpectedly.\n\t var name = seriesModel.name;\n\t\n\t if (!isNameSpecified(seriesModel)) {\n\t seriesModel.name = getSeriesAutoName(seriesModel)...
[ "0.60257244", "0.57195324", "0.55616117", "0.55496806", "0.5541335", "0.55334026", "0.55303097", "0.55199957", "0.5486875", "0.5467299", "0.5464967", "0.5463103", "0.5456786", "0.54505247", "0.5441329", "0.54402953", "0.5410441", "0.5368964", "0.535817", "0.532579", "0.527258...
0.58042413
3
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function parsePosition(seriesModel, api) { var center = seriesModel.get('center'); var width = api.getWidth(); var height = api.getHeight(); var size = Math.min(width, height); var cx = parsePercent(center[0], api.getWidth()); var cy = parsePercent(center[1], api.getHeight()); var r = parsePercent(seriesModel.get('radius'), size / 2); return { cx: cx, cy: cy, r: r }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio pla...
[ "0.53504926", "0.4896905", "0.48514667", "0.48116106", "0.4775166", "0.4743932", "0.47342455", "0.47035336", "0.4694186", "0.4694186", "0.46744877", "0.46453032", "0.46394095", "0.4629355", "0.46211302", "0.45832416", "0.45812932", "0.45752546", "0.45698234", "0.45625272", "0...
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Parse and decode geo json
function decode(json) { if (!json.UTF8Encoding) { return json; } var encodeScale = json.UTF8Scale; if (encodeScale == null) { encodeScale = 1024; } var features = json.features; for (var f = 0; f < features.length; f++) { var feature = features[f]; var geometry = feature.geometry; var coordinates = geometry.coordinates; var encodeOffsets = geometry.encodeOffsets; for (var c = 0; c < coordinates.length; c++) { var coordinate = coordinates[c]; if (geometry.type === 'Polygon') { coordinates[c] = decodePolygon(coordinate, encodeOffsets[c], encodeScale); } else if (geometry.type === 'MultiPolygon') { for (var c2 = 0; c2 < coordinate.length; c2++) { var polygon = coordinate[c2]; coordinate[c2] = decodePolygon(polygon, encodeOffsets[c][c2], encodeScale); } } } } // Has been decoded json.UTF8Encoding = false; return json; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getGeoJson() {\n return {\n \"type\": \"FeatureCollection\",\n \"features\": [\n {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"LineString\",\n \"coordinates\": [\n [\n 13.25441561846926,\n ...
[ "0.6401467", "0.6251229", "0.6087593", "0.5867118", "0.5793363", "0.5769249", "0.57245433", "0.5660727", "0.5587197", "0.5554582", "0.5480767", "0.5463705", "0.54294145", "0.53844434", "0.53714746", "0.5360499", "0.5350253", "0.5340355", "0.5337533", "0.5335312", "0.53113735"...
0.6084094
9
src\components\TabContent.svelte generated by Svelte v3.6.7
function get_each_context$c(ctx, list, i) { const child_ctx = Object.create(ctx); child_ctx.tab = list[i]; child_ctx.idx = i; return child_ctx; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Tabs_svelte_create_fragment(ctx) {\n\tlet div;\n\tlet current;\n\tconst default_slot_template = /*#slots*/ ctx[1].default;\n\tconst default_slot = (0,internal/* create_slot */.nu)(default_slot_template, ctx, /*$$scope*/ ctx[0], null);\n\n\treturn {\n\t\tc() {\n\t\t\tdiv = (0,internal/* element */.bG)(\"di...
[ "0.6424573", "0.638433", "0.6185069", "0.6143935", "0.6136994", "0.6111044", "0.5904215", "0.5894308", "0.5869632", "0.58674836", "0.58598167", "0.5859411", "0.58085215", "0.57447934", "0.5737777", "0.57284594", "0.57153296", "0.5700014", "0.5686242", "0.56757814", "0.5652525...
0.0
-1
This function will check if the user has visited the site before, and decides whether or not to toggle the popup
function checkVisits(){ if(localStorage.visits == 1){ //No class will be toggled, the popup will remain invisible to user and screenreader. console.log("User has visited this site before."); }else{ setTimeout(makeVisible, 3000); //Delays the popup for 3 seconds console.log("User has never visited this site before."); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function desktopSite() {\n // Uses an element only visable on desktop site\n return $(\"#aboutBack\").is(\":visible\");\n}", "function checkFirstVisit(){\n\t\t\tif (!localStorage.reinzCheck) {\n\t\t\t navIndicator();\n\t\t\t localStorage.reinzCheck = 'yes';\n\t\t\t}\n\t\t}", "function has_visited()...
[ "0.65340424", "0.6345465", "0.6290756", "0.6242805", "0.60805815", "0.6073969", "0.6059425", "0.6028703", "0.5980151", "0.5967161", "0.59525716", "0.59186614", "0.5861938", "0.5853165", "0.58449024", "0.58416235", "0.5837869", "0.5833222", "0.5831223", "0.5830909", "0.5826195...
0.77089685
0
This will make the popup visible after 3 seconds
function makeVisible(){ popwrap.classList.remove("no-read"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showWithDelay() {\n\t\t\t\t\t\t\t\t\tif (scope.tt_popupDelay) {\n\t\t\t\t\t\t\t\t\t\tpopupTimeout = $timeout(show, scope.tt_popupDelay);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tscope.$apply(show);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}", "function myHidePopup(delay) {\n popupTimeout = set...
[ "0.7532173", "0.74352777", "0.730349", "0.7113208", "0.70908403", "0.7055426", "0.69194937", "0.6870865", "0.68691087", "0.68533784", "0.68525547", "0.68421865", "0.6816742", "0.68023306", "0.67967963", "0.6762519", "0.67327374", "0.6701707", "0.6701043", "0.6674456", "0.6672...
0.0
-1
This will toggle the classes that make a parallax effect
function animateShavings() { var topDistance = window.scrollY; //Detecting and storing the distance the user has scrolled from the top of the page //console.log(topDistance); //Modifying the margin-top property of the chisel and shaving in congruence with the value of topDistance shave.style.marginTop = topDistance+"px"; chisel.style.marginTop = "-"+topDistance+"px"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parallaxEffect() {\n $('.bg-parallax').parallax();\n }", "function setParallax() {\n if( $(window).width() > 1024 ) {\n if( $('#testimonial').hasClass('parallax') ) {\n $('#testimonial').parallax(0, 0.1);\n }\n }\n }", "function changePar...
[ "0.71267295", "0.67138356", "0.67019784", "0.67006934", "0.66072565", "0.66039675", "0.64794314", "0.64312214", "0.63257366", "0.6320193", "0.61819607", "0.6168852", "0.61629343", "0.61558247", "0.61356336", "0.6132324", "0.6131049", "0.60918564", "0.60825837", "0.60825837", ...
0.0
-1
This function will toggle a class that will hide the popup and remove it from the reach of screenreaders
function exitPopup(){ //console.log("You have clicked the exit button"); popwrap.classList.add("no-read"); localStorage.visits = 1; //After the popup has been closed once, the visit is logged and it should not appear again. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function togglePopUp() {\n const popUp = document.querySelector('.popup_bg');\n popUp.classList.toggle('hide');\n}", "function togglePopup() {\n const popup = document.querySelector('.popup-background');\n popup.classList.toggle('hide');\n}", "function abrePopUp() {\n var popup = document.getElement...
[ "0.7655588", "0.75250065", "0.7509573", "0.7331084", "0.7328386", "0.73172617", "0.7310545", "0.73006773", "0.7299035", "0.72883826", "0.7263516", "0.7229421", "0.7197134", "0.7194573", "0.7152891", "0.7048279", "0.70073974", "0.69959456", "0.69944704", "0.6974485", "0.693562...
0.0
-1
Sends an asynchronous GET request to given url Input: theUrl the url to send the GET request to Output: None
function httpGetAsync(theUrl) { var xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) { // Use GET response to create map markers markbrewery(JSON.parse(xmlHttp.responseText)); } } xmlHttp.open("GET", theUrl, true); // true for asynchronous xmlHttp.send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function httpGetAsync(theUrl, callback) {\n // create the request object\n var xmlHttp = new XMLHttpRequest();\n\n // set the state change callback to capture when the response comes in\n xmlHttp.onreadystatechange = function () {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {\n ...
[ "0.77745205", "0.77059096", "0.76376075", "0.7568487", "0.7531437", "0.7522523", "0.75204927", "0.7380678", "0.736289", "0.71998364", "0.7192449", "0.712689", "0.70654875", "0.70123464", "0.70034814", "0.69854504", "0.6979662", "0.69178206", "0.6894386", "0.68795055", "0.6869...
0.0
-1
Initialize Google Map API Input: None Output: None
function initMap() { // Styles a map map = new google.maps.Map(document.getElementById('map'), { center: { lat: 41.878, lng: -87.629 }, zoom: 8, styles: [{ "elementType": "geometry", "stylers": [{ "color": "#ebe3cd" }] }, { "elementType": "labels.text.fill", "stylers": [{ "color": "#523735" }] }, { "elementType": "labels.text.stroke", "stylers": [{ "color": "#f5f1e6" }] }, { "featureType": "administrative", "elementType": "geometry.stroke", "stylers": [{ "color": "#c9b2a6" }] }, { "featureType": "administrative.land_parcel", "elementType": "geometry.stroke", "stylers": [{ "color": "#dcd2be" }] }, { "featureType": "administrative.land_parcel", "elementType": "labels.text.fill", "stylers": [{ "color": "#ae9e90" }] }, { "featureType": "landscape.natural", "elementType": "geometry", "stylers": [{ "color": "#dfd2ae" }] }, { "featureType": "poi", "elementType": "geometry", "stylers": [{ "color": "#dfd2ae" }] }, { "featureType": "poi", "elementType": "labels.text.fill", "stylers": [{ "color": "#93817c" }] }, { "featureType": "poi.business", "stylers": [{ "visibility": "off" }] }, { "featureType": "poi.park", "elementType": "geometry.fill", "stylers": [{ "color": "#a5b076" }] }, { "featureType": "poi.park", "elementType": "labels.text", "stylers": [{ "visibility": "off" }] }, { "featureType": "poi.park", "elementType": "labels.text.fill", "stylers": [{ "color": "#447530" }] }, { "featureType": "road", "elementType": "geometry", "stylers": [{ "color": "#f5f1e6" }] }, { "featureType": "road.arterial", "elementType": "geometry", "stylers": [{ "color": "#fdfcf8" }] }, { "featureType": "road.highway", "elementType": "geometry", "stylers": [{ "color": "#f8c967" }] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [{ "color": "#e9bc62" }] }, { "featureType": "road.highway.controlled_access", "elementType": "geometry", "stylers": [{ "color": "#e98d58" }] }, { "featureType": "road.highway.controlled_access", "elementType": "geometry.stroke", "stylers": [{ "color": "#db8555" }] }, { "featureType": "road.local", "elementType": "labels.text.fill", "stylers": [{ "color": "#806b63" }] }, { "featureType": "transit.line", "elementType": "geometry", "stylers": [{ "color": "#dfd2ae" }] }, { "featureType": "transit.line", "elementType": "labels.text.fill", "stylers": [{ "color": "#8f7d77" }] }, { "featureType": "transit.line", "elementType": "labels.text.stroke", "stylers": [{ "color": "#ebe3cd" }] }, { "featureType": "transit.station", "elementType": "geometry", "stylers": [{ "color": "#dfd2ae" }] }, { "featureType": "water", "elementType": "geometry.fill", "stylers": [{ "color": "#b9d3c2" }] }, { "featureType": "water", "elementType": "labels.text.fill", "stylers": [{ "color": "#92998d" }] } ] }); var curr_page = 1; //Current page of GET response var num_pages = 1; //Initialize number of pages response has var url = "http://api.brewerydb.com/v2/locations/?p=" + curr_page.toString() + "&region=Illinois&key=481d514448fd7365873ba9501d928e10&format=json"; //URL to get breweries in Illinois // Request first page of info var xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) { var response = JSON.parse(xmlHttp.responseText); //Parse json response num_pages = response["numberOfPages"]; //Set number of pages response has markbrewery(response); //Mark first page of response //Request and mark each page of response for (curr_page = 2; curr_page <= num_pages; curr_page++) { url = "http://api.brewerydb.com/v2/locations/?p=" + curr_page.toString() + "&region=Illinois&key=481d514448fd7365873ba9501d928e10&format=json"; httpGetAsync(url); } } } xmlHttp.open("GET", url, true); // true for asynchronous xmlHttp.send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function googleMapSetup() {\n map.initialise();\n}", "function googleMapSetup() {\n map.initialise();\n}", "function gmap_initialize() {\n var gmap_options = {\n center: new google.maps.LatLng(40, -80),\n zoom: 2,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\...
[ "0.80599904", "0.80599904", "0.7980042", "0.7723783", "0.77199185", "0.77018386", "0.7700086", "0.76938725", "0.7669481", "0.7656553", "0.7645756", "0.7644751", "0.76354754", "0.76334745", "0.7612384", "0.7602398", "0.7601075", "0.75961095", "0.7591788", "0.75827205", "0.7581...
0.0
-1
PRIVATE FUNCTIONS Only for testing!
function getRandomActivities() { var activities = []; var id = 1000; var date = new Date().getTime() - 60 * 60 * 10000; var x; for (var i = 0; i < 1053; i++) { var track = [ { speed : (Math.random() + 0.1) * 30 } ]; var rand = Math.random() + 0.1; var start = Math.floor(date - Math.random() * 60 * 60 * 10); var end = Math .floor(start + rand * 60 * 60 * 2); date = start - 14400; if (rand < 0.5) { activities.push(new Activity(id--, 'Running', start, end, track, '', (Math.random() + 0.1) * 12000, user.userId)); } else { activities.push(new Activity(id--, 'Biking', start, end, track, '', (Math.random() + 0.1) * 12000, user.userId)); } } return activities; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "transient private protected internal function m182() {}", "protected internal function m252() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "static private internal fun...
[ "0.717471", "0.7081855", "0.68225026", "0.66627", "0.6637731", "0.65628535", "0.6459469", "0.631019", "0.6303821", "0.62679374", "0.6217863", "0.6200486", "0.61943644", "0.61411273", "0.6085985", "0.601497", "0.60118306", "0.59402305", "0.58367556", "0.58319014", "0.58152074"...
0.0
-1
just to make sure the generate code works
function display() { generate(); // generate 36,000 combinations var data = "<h1> Data </h1>"; data += "<table border=2>"; data += "<caption> <strong>Rolling Dice</strong></caption>"; data += "<thead><tr><th>Sum</th><th># Rolls</th><th>Percentage</th></tr>"; data += "<tbody>"; for(var j = 2; j < 13; j++) { data += "<tr><td>"+ j + "</td>"; // the sum. data += "<td>" + sumDict[j] +"</td>";// total occurance of the sum data += "<td>" + (sumDict[j] / 36000).toFixed(2) + "</td></tr>" // percentage of that sum } data += "</tbody></table>"; document.getElementById('stats').innerHTML = data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateCode(){\n\n}", "function generateTest() {\n // TODO\n}", "async buildCode() {\n\t\tawait this._codeSource.generated.generate();\n\t}", "function cw_generationZero() {\n cw_materializeGeneration();\n\n}", "generate (type) {\n return generate(type)\n }", "function genStart() {\...
[ "0.6754435", "0.6682694", "0.6527891", "0.6449227", "0.6251575", "0.6236547", "0.61819977", "0.61348766", "0.61144525", "0.60363275", "0.6018648", "0.60072106", "0.5992213", "0.5939109", "0.59282625", "0.5920184", "0.5901952", "0.58872604", "0.58656126", "0.57781905", "0.5774...
0.0
-1
Callback for when the open dialog animation has finished. Intended to be called by subclasses that use different animation implementations.
_openAnimationDone(totalTime) { if (this._config.delayFocusTrap) { this._trapFocus(); } this._animationStateChanged.next({ state: 'opened', totalTime }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function animcompleted() {\n\t\t\t\t\t\t}", "notifyAnimationEnd() {}", "onAnimationEnd() {\n\n }", "#onAnimationFinish(state) {\n\t\t// Set the open attribute based on the parameter\n\t\tthis.state = state;\n\t\t// Clear the stored animation\n\t\tthis.animation = null;\n\t\t// Reset isClosing & isExpandin...
[ "0.6741527", "0.6605322", "0.65447015", "0.64482516", "0.63265663", "0.63265663", "0.6319347", "0.6309637", "0.6224005", "0.6187193", "0.61681455", "0.61416805", "0.6082098", "0.6034852", "0.6005933", "0.6005933", "0.5998334", "0.5998334", "0.59752095", "0.5930326", "0.591614...
0.6350242
4
Callback, invoked whenever an animation on the host completes.
_onAnimationDone({ toState, totalTime }) { if (toState === 'enter') { this._openAnimationDone(totalTime); } else if (toState === 'exit') { this._animationStateChanged.next({ state: 'closed', totalTime }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "notifyAnimationEnd() {}", "onAnimationEnd() {\n\n }", "function animcompleted() {\n\t\t\t\t\t\t}", "static complete() {\n\t\tconsole.log('Animation.complete()')\n\t\tVelvet.capture.adComplete()\n\n\t}", "_onAnimationEnd() {\n // Clean up the old container. This is done after the animation to avoid ...
[ "0.8057842", "0.78386694", "0.7649008", "0.73289657", "0.7301747", "0.7249075", "0.7248529", "0.7237071", "0.7159387", "0.701882", "0.6959625", "0.6929186", "0.68912584", "0.68254286", "0.6811096", "0.6809392", "0.6793606", "0.6724227", "0.66507226", "0.66507226", "0.6615359"...
0.63677025
30
Callback, invoked when an animation on the host starts.
_onAnimationStart({ toState, totalTime }) { if (toState === 'enter') { this._animationStateChanged.next({ state: 'opening', totalTime }); } else if (toState === 'exit' || toState === 'void') { this._animationStateChanged.next({ state: 'closing', totalTime }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initAnimation() {\n}", "function start () {\n animationInt = window.setInterval(animationManager, animatorIntervalTime);\n }", "start() {\n this._enableAnimation = true;\n this._numberOfAnimationCycles = 0;\n }", "_animationStartListener(event) {\n this....
[ "0.71801573", "0.69497263", "0.69406104", "0.6932655", "0.687876", "0.6804701", "0.67395705", "0.6734049", "0.6663561", "0.6655559", "0.652832", "0.6419603", "0.64195", "0.64070904", "0.6376037", "0.6369497", "0.63631326", "0.63578624", "0.63562286", "0.6339053", "0.63387954"...
0.618038
33
Starts the dialog exit animation.
_startExitAnimation() { this._state = 'exit'; // Mark the container for check so it can react if the // view container is using OnPush change detection. this._changeDetectorRef.markForCheck(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "exit() {\n if (!this._destroyed) {\n this._animationState = 'hidden';\n this._changeDetectorRef.markForCheck();\n }\n }", "function dismiss() {\n $.background.animate({\n opacity: 0,\n duration: animationSpeed\n }, () => {\n // Second parameter fo...
[ "0.6604248", "0.6442514", "0.62992615", "0.62992615", "0.62651527", "0.6246106", "0.6246106", "0.62339425", "0.62141335", "0.61103755", "0.6090828", "0.60824037", "0.6032996", "0.5962788", "0.5953788", "0.59476644", "0.59216994", "0.590694", "0.590559", "0.59020495", "0.58974...
0.6357485
4
Gets an observable that is notified when the dialog is finished opening.
afterOpened() { return this._afterOpened; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get afterOpen() {\n return this.mcAfterOpen.asObservable();\n }", "get afterClose() {\n return this.mcAfterClose.asObservable();\n }", "signalComplete() {\n this.observableFunctions.complete();\n }", "get hasStableDialog() {\n return this.dlg && this.dlg.connected;\n }", "...
[ "0.6235541", "0.57292295", "0.544824", "0.5104611", "0.50832826", "0.5079857", "0.50388193", "0.50360566", "0.50360566", "0.5029044", "0.5024414", "0.5024414", "0.5012694", "0.5012694", "0.5012694", "0.49499366", "0.49229214", "0.48979545", "0.48979545", "0.48709005", "0.4852...
0.5032514
10
Gets an observable that is notified when the dialog is finished closing.
afterClosed() { return this._ref.closed; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get afterClose() {\n return this.mcAfterClose.asObservable();\n }", "close() {\n if (!this.isOpen) {\n return;\n }\n this.onClose.emit(this);\n this.isOpen = false;\n this.changeDetection.markForCheck();\n this.onClosed.emit(this);\n }", "_onClo...
[ "0.6678862", "0.6028456", "0.5999963", "0.59336567", "0.59089553", "0.59089553", "0.5831476", "0.58273757", "0.58273757", "0.5818462", "0.58016217", "0.5769973", "0.5590012", "0.55193794", "0.55115783", "0.550094", "0.54051006", "0.53953403", "0.53724563", "0.5359441", "0.531...
0.577739
12
Gets an observable that is notified when the dialog has started closing.
beforeClosed() { return this._beforeClosed; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get afterClose() {\n return this.mcAfterClose.asObservable();\n }", "_onClosed() {\n this.emit(\"closed\");\n }", "onClosed() {\r\n // Stub\r\n }", "_onClosing() {\n this._watcher.stop();\n this.emit(\"closing\");\n }", "close() {\n if (!this.isOpen) {\n ret...
[ "0.64080805", "0.606997", "0.59130985", "0.5909122", "0.59062463", "0.57707673", "0.57707673", "0.56869036", "0.556136", "0.5535582", "0.5488211", "0.5380322", "0.5365876", "0.53258806", "0.52992374", "0.5269795", "0.52052695", "0.5198437", "0.51977926", "0.51956517", "0.5192...
0.5162402
26
Gets an observable that emits when the overlay's backdrop has been clicked.
backdropClick() { return this._ref.backdropClick; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "backdropClick() {\n return this._overlayRef.backdropClick();\n }", "backdropClick() {\n return this._backdropClick;\n }", "function handleBackdropClick(event) {\n overlays.forEach(function(overlay) {\n if (typeof overlay.instance.backdropClickedCallback === 'function') {\n ov...
[ "0.6887702", "0.65635705", "0.6365651", "0.61065006", "0.59164095", "0.5809578", "0.5785322", "0.5737036", "0.5669105", "0.564863", "0.5517033", "0.55141735", "0.55141735", "0.5461777", "0.54358107", "0.5408771", "0.5369369", "0.5363778", "0.529492", "0.5140833", "0.5129217",...
0.6537389
3
Gets an observable that emits when keydown events are targeted on the overlay.
keydownEvents() { return this._ref.keydownEvents; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "keydownEvents() {\n return this._overlayRef.keydownEvents();\n }", "keydownEvents() {\n return this._keydownEvents;\n }", "getKeyControlDown() {\nreturn this._keyControlDown;\n}", "keyDown(e) {\n this._modifiers(e);\n const _keyCode = this.translateKeyCodes(e.keyCode);\n const _w...
[ "0.7377901", "0.66555864", "0.5811591", "0.57188696", "0.57188696", "0.5625074", "0.5625074", "0.55653155", "0.55653155", "0.5547744", "0.55371225", "0.54708576", "0.541459", "0.5395512", "0.5394707", "0.5372348", "0.5368321", "0.5313045", "0.52713305", "0.52500796", "0.52309...
0.6385792
3
Updates the dialog's position.
updatePosition(position) { let strategy = this._ref.config.positionStrategy; if (position && (position.left || position.right)) { position.left ? strategy.left(position.left) : strategy.right(position.right); } else { strategy.centerHorizontally(); } if (position && (position.top || position.bottom)) { position.top ? strategy.top(position.top) : strategy.bottom(position.bottom); } else { strategy.centerVertically(); } this._ref.updatePosition(); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_position() {\n var dlgLeft = ($(document).width()/2) - ($('#dlg-box-content-container').width()/2) - 20;\n $('#dlg-box-content-container').css('left', dlgLeft);\n $('#dlg-box-content-container').css('top', '8%');\n }", "updatePosition() {\n this.position = getPositionForPop...
[ "0.757042", "0.7461063", "0.7111469", "0.70222586", "0.68252146", "0.6813239", "0.67854536", "0.6779687", "0.66002077", "0.6576248", "0.65392804", "0.65336835", "0.651607", "0.6513099", "0.6494823", "0.6448593", "0.6428878", "0.64042133", "0.6372772", "0.63476413", "0.6261388...
0.0
-1
Updates the dialog's width and height.
updateSize(width = '', height = '') { this._ref.updateSize(width, height); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateSize() {\n this.w = this.ent.width + this.wo;\n this.h = this.ent.height + this.ho;\n }", "updateSize() {\n windowWidth = Math.min(\n this.handler.getMaxGameWidth(),\n window.innerWidth\n )\n windowHeight = Math.min(\n this.handler.getMaxGameHeig...
[ "0.688389", "0.68189067", "0.650368", "0.64399314", "0.6436595", "0.6431291", "0.6418697", "0.6384462", "0.63689333", "0.63553935", "0.6355038", "0.6301114", "0.62491226", "0.6232512", "0.6214462", "0.6174061", "0.61720806", "0.6158587", "0.61061627", "0.6073626", "0.6051642"...
0.60143965
23
Add a CSS class or an array of classes to the overlay pane.
addPanelClass(classes) { this._ref.addPanelClass(classes); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_addPanelClasses(cssClasses) {\n if (this._pane) {\n Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceArray\"])(cssClasses).forEach(cssClass => {\n if (cssClass !== '' && this._appliedPanelClasses.indexOf(cssClass) === -1) {\n this._appliedPanelC...
[ "0.6802812", "0.6662932", "0.66179687", "0.65104145", "0.6420611", "0.6319864", "0.6266014", "0.6134859", "0.6133349", "0.604855", "0.6003801", "0.6003801", "0.5996183", "0.5954547", "0.5875076", "0.5859327", "0.5858932", "0.5856695", "0.5855528", "0.5831775", "0.57766855", ...
0.55825406
45
Remove a CSS class or an array of classes from the overlay pane.
removePanelClass(classes) { this._ref.removePanelClass(classes); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_clearPanelClasses() {\n if (this._pane) {\n this._appliedPanelClasses.forEach(cssClass => {\n this._pane.classList.remove(cssClass);\n });\n this._appliedPanelClasses = [];\n }\n }", "removePanelClass(classes) {\n if (this._pane) {\n ...
[ "0.702097", "0.67840517", "0.67471254", "0.67445874", "0.6681233", "0.6679959", "0.66741395", "0.6567679", "0.6562862", "0.6525584", "0.64825255", "0.64626575", "0.6422464", "0.6418374", "0.63363826", "0.6328601", "0.63218987", "0.63218987", "0.63180834", "0.6314455", "0.6313...
0.0
-1
Gets the current state of the dialog's lifecycle.
getState() { return this._state; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "state() {\n return this.eventContext.state();\n }", "function getState() {\n return state;\n }", "get state() {\n return this._current().state;\n }", "state() {\n\t\treturn this._state;\n\t}", "function getState() {\n\t\t\tvar data = this.data('timeline');\n\t\t\tif (t...
[ "0.6653352", "0.6611362", "0.65158635", "0.6486249", "0.6465978", "0.64471936", "0.63721544", "0.62975746", "0.6291692", "0.6286584", "0.6286584", "0.6286584", "0.6256539", "0.616064", "0.61257744", "0.61009055", "0.60936815", "0.60936815", "0.60678", "0.6064159", "0.6029409"...
0.65686625
3
Finishes the dialog close by updating the state of the dialog and disposing the overlay.
_finishDialogClose() { this._state = 2 /* MatDialogState.CLOSED */; this._ref.close(this._result, { focusOrigin: this._closeInteractionType }); this.componentInstance = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_finishDialogClose() {\n this._state = 2 /* CLOSED */;\n this._overlayRef.dispose();\n }", "_finishDismiss() {\n this._overlayRef.dispose();\n if (!this._onAction.closed) {\n this._onAction.complete();\n }\n this._afterDismissed.next({ dismissedByAction: th...
[ "0.8550732", "0.7405404", "0.7260153", "0.7104279", "0.7083736", "0.7083736", "0.6985526", "0.6908111", "0.6902874", "0.6829207", "0.6791973", "0.67579216", "0.67488986", "0.66696763", "0.6605422", "0.66041255", "0.66039455", "0.6574522", "0.65394133", "0.65226835", "0.650449...
0.7378775
3
Closes the dialog with the specified interaction type. This is currently not part of `MatDialogRef` as that would conflict with custom dialog ref mocks provided in tests. More details. See: TODO: Move this back into `MatDialogRef` when we provide an official mock dialog ref.
function _closeDialogVia(ref, interactionType, result) { ref._closeInteractionType = interactionType; return ref.close(result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _closeDialogVia(ref, interactionType, result) {\n // Some mock dialog ref instances in tests do not have the `_containerInstance` property.\n // For those, we keep the behavior as is and do not deal with the interaction type.\n if (ref._containerInstance !== undefined) {\n ref._containerInstance._cl...
[ "0.77614063", "0.7740571", "0.7727459", "0.57818717", "0.57818717", "0.5589683", "0.53552485", "0.53342915", "0.5184275", "0.50898427", "0.508408", "0.5065508", "0.50612366", "0.49840567", "0.49190772", "0.4885232", "0.48799348", "0.48679402", "0.48160487", "0.48160487", "0.4...
0.77259135
3
Keeps track of the currentlyopen dialogs.
get openDialogs() { return this._parentDialog ? this._parentDialog.openDialogs : this._openDialogsAtThisLevel; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOpeningIds() {\n var ids = [];\n try {\n ids = JSON.parse(localStorage.openWhenComplete);\n } catch (e) {\n localStorage.openWhenComplete = JSON.stringify(ids);\n }\n return ids;\n}", "function resetOpen() {\n open = [];\n}", "function removeAllDialogs() {\n for (var i = 0; ...
[ "0.5882049", "0.5790425", "0.56959325", "0.5524715", "0.5524715", "0.5524715", "0.5510946", "0.535889", "0.53493553", "0.5322622", "0.5261911", "0.5261911", "0.5191203", "0.5185792", "0.5171016", "0.51417994", "0.51417994", "0.51417994", "0.51164967", "0.51149267", "0.5112687...
0.6404366
2
Stream that emits when a dialog has been opened.
get afterOpened() { return this._parentDialog ? this._parentDialog.afterOpened : this._afterOpenedAtThisLevel; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "openDialog() {\n var message = this.getQuestion() + chalk.dim(this.messageCTA + ' Waiting...');\n this.screen.render(message, '');\n\n // Pause Readline to prevent stdin and stdout from being modified while the editor is showing\n this.rl.pause();\n this.dialog.open(this.endDialog.bind(this));\n }"...
[ "0.5878268", "0.5762913", "0.56209415", "0.5611367", "0.5559547", "0.55561626", "0.55001247", "0.5469724", "0.54484016", "0.5429138", "0.53921634", "0.5391304", "0.53793484", "0.5360101", "0.5360101", "0.5349593", "0.53403217", "0.5258222", "0.5255514", "0.5255279", "0.524398...
0.0
-1
Closes all of the currentlyopen dialogs.
closeAll() { this._closeDialogs(this.openDialogs); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "closeAll() {\n let i = this.openModals.length;\n while (i--) {\n this.openModals[i].close();\n }\n }", "function closeAll() {\n\t\t\t$.each( menuItems, function( index ) {\n\t\t\t\tmenuItems[index].close();\n\t\t\t});\n\t\t}", "function closeAllInfoWindows() {\n\tfor (var i=0...
[ "0.7218156", "0.7095193", "0.7060914", "0.70241266", "0.69022053", "0.68948585", "0.68916386", "0.68800557", "0.68800557", "0.685714", "0.6801596", "0.67541283", "0.6698916", "0.66701514", "0.6663062", "0.66136086", "0.65285623", "0.6444135", "0.6401621", "0.63858783", "0.635...
0.8642801
2
Finds an open dialog by its id.
getDialogById(id) { return this.openDialogs.find(dialog => dialog.id === id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findDialog(dialogId) {\n return this.dialogs.find(dialogId);\n }", "function getClosestDialog(element, openDialogs) {\n var parent = element.nativeElement.parentElement;\n\n while (parent && !parent.classList.contains('mat-dialog-container')) {\n parent = parent.parentElement;\n ...
[ "0.7865522", "0.657214", "0.65183777", "0.65183777", "0.65183777", "0.6498772", "0.6016974", "0.59315944", "0.5923269", "0.58757794", "0.5782433", "0.57787436", "0.57787436", "0.57718843", "0.5771227", "0.57551366", "0.5711225", "0.5662793", "0.5639442", "0.5636406", "0.56214...
0.7984786
2
TODO(crisbeto): this utility shouldn't be necessary anymore, because the dialog ref is provided both to component and template dialogs through DI. We need to keep it around, because there are some internal wrappers around `MatDialog` that happened to work by accident, because we had this fallback logic in place. Finds the closest MatDialogRef to an element by looking at the DOM.
function getClosestDialog(element, openDialogs) { let parent = element.nativeElement.parentElement; while (parent && !parent.classList.contains('mat-dialog-container')) { parent = parent.parentElement; } return parent ? openDialogs.find(dialog => dialog.id === parent.id) : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getClosestDialog(element, openDialogs) {\n var parent = element.nativeElement.parentElement;\n\n while (parent && !parent.classList.contains('mat-dialog-container')) {\n parent = parent.parentElement;\n }\n\n return parent ? openDialogs.find(function (dialog) {\n return dialog.id === parent.id;\...
[ "0.7377395", "0.7346077", "0.5886794", "0.5758184", "0.5689209", "0.5654649", "0.5633039", "0.5499711", "0.54976517", "0.546422", "0.5449927", "0.5406385", "0.5356184", "0.53408223", "0.53274596", "0.53274596", "0.53274596", "0.5318093", "0.53067136", "0.5289948", "0.52897835...
0.7366127
3
setUserDefaultsStringForKey Store a string in NSUserDefaults The string is retrieved and double checked that it matches
function setUserDefaultsStringForKey(string, key, callback) { NativeBridge.call('setUserDefaultsStringForKey', [string, key], callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveSettingValue(str){\n const settingsValues = getSettingsValues();\n if(!str || settingsValues.indexOf(str) > -1){\n return false;\n }\n settingsValues.push(str);\n localStorage.setItem('settingValues', JSON.stringify(settingsValues) );\n return true;\n}", "function setPrefStr...
[ "0.63622683", "0.61682576", "0.59449196", "0.56228584", "0.5621431", "0.55960524", "0.55917424", "0.5587894", "0.55821836", "0.5505531", "0.5492015", "0.54420793", "0.5421833", "0.53816736", "0.5344939", "0.5321491", "0.5271883", "0.5271159", "0.5269831", "0.52665496", "0.525...
0.7059272
0
readUserDefaultsForKey Read a string from NSUserDefaults
function readUserDefaultsForKey(key, callback) { NativeBridge.call('readUserDefaultsForKey', [key], callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readSetting (szKey)\n{\n var szResult = '';\n \n if(typeof(Storage) !== \"undefined\")\n {\n szResult = localStorage.getItem(szKey);\n }\n \n return szResult;\n}", "function getPrefString(absolutePrefPath){\r\n\r\n var value = Services.prefs.getStringPref(absolutePrefPat...
[ "0.63825715", "0.6351416", "0.585623", "0.5758448", "0.5758448", "0.57503474", "0.5748897", "0.56163406", "0.55749416", "0.5496849", "0.54894114", "0.54374826", "0.543673", "0.53017104", "0.5291851", "0.52913225", "0.528739", "0.52725315", "0.5269205", "0.52665883", "0.525669...
0.64231205
0
deleteUserDefaultsForKey Delete an object from NSUserDefaults
function deleteUserDefaultsForKey(key, callback) { NativeBridge.call('deleteUserDefaultsStringForKey', [key], callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove(key) {\n delete this.#defaults[key];\n }", "nuke(key) {\n delete localStorage[key];\n chrome.storage.local.remove(key);\n if (chrome.storage.sync != null) {\n chrome.storage.sync.remove(key);\n }\n }", "function deletePreferences() {\n PropertiesService.getUserProperties().deleteA...
[ "0.61938435", "0.5947393", "0.59291816", "0.5828678", "0.5826418", "0.5790587", "0.57888454", "0.55974674", "0.55716825", "0.54869825", "0.5403751", "0.53822756", "0.536381", "0.5341044", "0.53243905", "0.532011", "0.5317304", "0.5315965", "0.52945316", "0.52945316", "0.52934...
0.7343193
0
showAlert Display either a UIAlertView or UIAlertController (Depending on iOS version)
function showAlert(title, message, buttons, inputField, callback) { NativeBridge.call('showAlert', [title||'', message||'', buttons||[], inputField], callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayAlert(title, message){\n Alert.alert(title,message);\n}", "function showAlert() {\n navigator.notification.alert(\n 'AVF-1207', // message\n alertDismissed, // callback\n 'Carol Gaylor', ...
[ "0.6532519", "0.641785", "0.6324318", "0.63139725", "0.6297081", "0.62598234", "0.6259525", "0.6204711", "0.62025195", "0.61807126", "0.6135315", "0.61304265", "0.6115432", "0.6099899", "0.6090424", "0.6090424", "0.60879445", "0.60844815", "0.60686433", "0.60430866", "0.60382...
0.6359892
2
complete Signifies to ObjectiveC that you are finished which then fires the completionBlock in ObjectiveC
function complete(string) { NativeBridge.call('complete', [string]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "complete() {}", "function complete() {\n\tconsole.log('Completed');\n}", "completed(data) {}", "function async_completed() {\n\tasync_completions += 1;\n\tD.log(\"completions: \" + async_completions + \" out of \" + async_completions_waiting);\n\tif ( async_completions == async_completions_waiting ) {\n\t ...
[ "0.73951834", "0.7260894", "0.67804396", "0.6717048", "0.66836447", "0.66746163", "0.66746163", "0.66746163", "0.66746163", "0.65883726", "0.64684737", "0.64595824", "0.6423679", "0.64217687", "0.64076614", "0.6377386", "0.63698685", "0.63645506", "0.6360161", "0.62960315", "...
0.6644375
9
Create a new ChaCha generator seeded from the given KEY and IV. Both KEY and IV must be ArrayBuffer objects of at least the appropriate byte lengths (CHACHA_KEYSIZE, CHACHA_IVSIZE). Bytes beyond the specified length are ignored. Returns a closure that takes no arguments. This closure, when invoked, returns a 64byte ArrayBuffer of the next 64 bytes of output. Note: This buffer object is "owned" by the closure, and the same buffer object is always returned, each time filled with fresh output.
function ChaCha(key, iv) { "use strict"; if (key.byteLength < CHACHA_KEYSIZE) throw new Error('key too short'); if (iv.byteLength < CHACHA_IVSIZE) throw new Error('IV too short'); const state = new Uint32Array(16); let view = new DataView(key); state[ 0] = 0x61707865; // "expand 32-byte k" state[ 1] = 0x3320646e; // state[ 2] = 0x79622d32; // state[ 3] = 0x6b206574; // state[ 4] = view.getUint32( 0, true); state[ 5] = view.getUint32( 4, true); state[ 6] = view.getUint32( 8, true); state[ 7] = view.getUint32(12, true); state[ 8] = view.getUint32(16, true); state[ 9] = view.getUint32(20, true); state[10] = view.getUint32(24, true); state[11] = view.getUint32(28, true); view = new DataView(iv); state[14] = view.getUint32( 0, true); state[15] = view.getUint32( 4, true); /* Generator */ const output = new Uint32Array(16); const outview = new DataView(output.buffer); return function() { function quarterround(x, a, b, c, d) { function rotate(v, n) { return (v << n) | (v >>> (32 - n)); } x[a] += x[b]; x[d] = rotate(x[d] ^ x[a], 16); x[c] += x[d]; x[b] = rotate(x[b] ^ x[c], 12); x[a] += x[b]; x[d] = rotate(x[d] ^ x[a], 8); x[c] += x[d]; x[b] = rotate(x[b] ^ x[c], 7); } output.set(state); for (let i = 0; i < CHACHA_ROUNDS; i += 2) { quarterround(output, 0, 4, 8, 12); quarterround(output, 1, 5, 9, 13); quarterround(output, 2, 6, 10, 14); quarterround(output, 3, 7, 11, 15); quarterround(output, 0, 5, 10, 15); quarterround(output, 1, 6, 11, 12); quarterround(output, 2, 7, 8, 13); quarterround(output, 3, 4, 9, 14); } for (let i = 0; i < 16; i++) outview.setUint32(i * 4, output[i] + state[i], true); state[12]++; if (state[12] == 0) { state[13]++; if (state[13] == 0) { /* One zebibyte of output reached! */ throw new Error('output exhausted'); } } return output.buffer; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "encryptWithkey(buffer, key){\n var cipher = crypto.createCipheriv('aes-256-ecb',key,new Buffer(0));\n var crypted = cipher.update(buffer,'utf8','base64');\n crypted = crypted+ cipher.final('base64');\n console.log('printed: ', crypted);\n r...
[ "0.5142523", "0.51319706", "0.49789298", "0.49736062", "0.4965462", "0.4965462", "0.4965462", "0.4965462", "0.4965462", "0.4965462", "0.49273297", "0.49273297", "0.4814365", "0.4731254", "0.4719029", "0.46989232", "0.4698656", "0.46806735", "0.46806735", "0.46806735", "0.4680...
0.686839
0
this method is called when your extension is activated your extension is activated the very first time the command is executed
function activate(context) { // Use the console to output diagnostic information (console.log) and errors (console.error) // This line of code will only be executed once when your extension is activated console.log('Congratulations, your extension "c51" is now active!'); // The command has been defined in the package.json file // Now provide the implementation of the command with registerCommand // The commandId parameter must match the command field in package.json let disposable = vscode.commands.registerCommand('extension.buildC51', function () { // The code you place here will be executed every time your command is executed // Display a message box to the user var cmd=null; for (let i = 0; i < vscode.window.terminals.length; i++) { if(vscode.window.terminals[i].name=="CMD")cmd=vscode.window.terminals[i]; } if(cmd==null){ cmd=vscode.window.createTerminal("CMD","C:\\Windows\\System32\\cmd.exe"); } cmd.show(); var log=vscode.window.createOutputChannel("C51"); var binDir=vscode.workspace.getConfiguration("C51").get("binDir"); var hexFile=vscode.workspace.getConfiguration("C51").get("OnlyOutputHexFile"); var workDir=vscode.workspace.rootPath; if(workDir==undefined){ vscode.window.showErrorMessage("请先打开工作目录"); return; } if(vscode.workspace.textDocuments.length<=0){ vscode.window.showErrorMessage("请先打开一个文件"); return; } var filePath=vscode.workspace.textDocuments[0].fileName; filePath=filePath.replace(".c",""); cmd.sendText("cls"); cmd.sendText("\""+binDir+"\\C51.exe"+"\" "+"\""+filePath+".c\"",true); cmd.sendText("\""+binDir+"\\BL51.exe"+"\" "+"\""+filePath+".OBJ\"",true); cmd.sendText("\""+binDir+"\\OH51.exe"+"\" "+"\""+filePath+"\"",true); if(hexFile){ cmd.sendText("del "+filePath+".OBJ"); cmd.sendText("del "+filePath+".LST"); cmd.sendText("del "+filePath+".M51"); cmd.sendText("del "+filePath); } }); context.subscriptions.push(disposable); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function activateExtension() {\n Privly.options.setInjectionEnabled(true);\n updateActivateStatus(true);\n}", "function activate(context) {\n console.log('Congratulations, your extension \"funne\" is now active!');\n let disposable = vscode.commands.registerCommand('funne.init', () => {\n vscode.w...
[ "0.7663007", "0.6947059", "0.6820627", "0.6794852", "0.6790117", "0.6739728", "0.6689884", "0.66443366", "0.6542393", "0.6512419", "0.6511836", "0.6502952", "0.6485095", "0.6482592", "0.6447026", "0.6446627", "0.6429264", "0.6413805", "0.64109546", "0.6405974", "0.6392081", ...
0.57213634
57
this method is called when your extension is deactivated
function deactivate() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deactivate() {\n\tconsole.log('关闭扩展')\n}", "function deactivate() {\n example.deactivate();\n console.log(`Extension(${example.name}) is deactivated.`);\n}", "function deactivateExtension() {\n Privly.options.setInjectionEnabled(false);\n updateActivateStatus(false);\n}", "function deactivat...
[ "0.8011084", "0.7815618", "0.7768406", "0.76137966", "0.7570413", "0.75452274", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", ...
0.0
-1
Set up the canvas and game objects (Executed by d3)
function setup() { createCanvas(600, 600); frameRate(FRAME_RATE); var cols = floor(width / ITEMS_SCALE) var rows = floor(height / ITEMS_SCALE) environment=new Environment(cols,rows); environment.init(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setup() {\n let canvas = createCanvas(canvasContainer.clientWidth, canvasContainer.clientHeight);\n canvas.parent(\"canvas-container\");\n\n rectMode(CENTER);\n ellipseMode(CENTER);\n noStroke();\n\n // Initialize global game objects.\n pong = new Pong();\n ball = new Ball();\n controller = new P...
[ "0.77229285", "0.7714343", "0.7528946", "0.7351579", "0.73130625", "0.72914696", "0.7288986", "0.72774637", "0.7268133", "0.7224917", "0.72179705", "0.7195941", "0.71698034", "0.7162266", "0.71571875", "0.7149469", "0.71475816", "0.714474", "0.71308744", "0.7125858", "0.70962...
0.7048346
30
Draw every tick of the clock (FRAME_RATE)
function draw() { background(10,0,40); environment.draw() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clockLoop(){\n\t//update the time\n\tupdate();\n\n\t//draw the clock\n\tdraw();\n}", "function drawClock() {\r\n drawFace(ctx,radius);\r\n drawNumbers(ctx,radius);\r\n drawTime(ctx,radius);\r\n}", "function drawClock() {\n drawFace(ctx, radius);\n drawNumbers(ctx, radius);\n drawTime...
[ "0.7908788", "0.7850909", "0.7777773", "0.7712145", "0.7663644", "0.7486984", "0.7486984", "0.74633825", "0.7458211", "0.74477315", "0.7404649", "0.73671913", "0.72880125", "0.7235867", "0.72325844", "0.72000074", "0.7106527", "0.7100267", "0.7075389", "0.7051553", "0.7035438...
0.0
-1
Environment object, holds the user interface and the game
function Environment(cols,rows){ this.init=function(){ this.game = new Game(cols,rows); this.game.init() } this.manageInput = function(keyCode){ if(this.game.started){ this.game.manageInput(keyCode) } else if (keyCode === ENTER) { this.game.init(); this.game.start(); } } this.showGameOver=function(){ let gameOverMessage = "GAME OVER" let optionsMessage = "Press ENTER to play again" textFont(game_font); textSize(height / 6); textAlign(CENTER, CENTER); fill(200,0,0); text(gameOverMessage, width*0.1, height/4, width*0.8, height/6); textSize(height / 10); fill(200,0,180); text(optionsMessage, width*0.1, height/2, width*0.8, height/6); } this.draw=function(){ if(this.game.started){ this.game.draw() }else{ this.showGameOver() } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "environment() {\n if (!this.visible) {\n if(scorebox.score >= this.totalStars) {\n push();\n // custom texture of environment simulation\n texture(venusEnviro);\n\n // calling the superclass environment() method\n super.environment();\n pop();\n }\n }\n }"...
[ "0.70051646", "0.6926149", "0.65775865", "0.64752847", "0.6363604", "0.6296091", "0.62769145", "0.6237525", "0.62159944", "0.6214841", "0.6214795", "0.61867076", "0.6126275", "0.61189485", "0.6085924", "0.608459", "0.6083135", "0.6063203", "0.6055547", "0.60475576", "0.603910...
0.7006322
0
Game object, holds the game related objects
function Game(cols,rows){ started=false /* Initialize the snake and the food location */ this.init = function(){ this.score=0 this.snake = new Snake() this.pickFoodLocation(); } /* Start the game */ this.start = function(){ this.started = true; } /* Pick a random position and put a coin there */ this.pickFoodLocation = function() { this.food = createVector(floor(random(cols)), floor(random(rows))) this.food.mult(ITEMS_SCALE) } this.manageInput=function(keyCode){ if (keyCode === UP_ARROW) { this.snake.dir(0, -1); } else if (keyCode === DOWN_ARROW) { this.snake.dir(0, 1); } else if (keyCode === RIGHT_ARROW) { this.snake.dir(1, 0); } else if (keyCode === LEFT_ARROW) { this.snake.dir(-1, 0); } } /* Draw the components of the game */ this.draw = function(){ if (this.snake.eat(this.food)) { this.pickFoodLocation(); if (coin_sound.isPlaying()) { coin_sound.stop(); } coin_sound.play(); this.score += BASIC_FOOD_SCORE } if(this.started){ this.snake.update(); } if(this.snake.checkSelfCollision()){ if (game_over_sound.isPlaying()) { game_over_sound.stop(); } game_over_sound.play(); this.started = false; } textFont(game_font); textSize(height / 6); textAlign(CENTER, CENTER); fill(20,200,200); text(this.score+'', width*0.8, 0, width*0.2, height/6); this.snake.show(); fill(255, 200, 0); rect(this.food.x, this.food.y, ITEMS_SCALE, ITEMS_SCALE); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Game() {\n // Module constants and variables\n var _this = this;\n _this.gameObjects = {};\n /**\n * Initialize the Game and call the custom init function if a custom\n * init function is connected to the Game.\n *\n * @function init\n * @para...
[ "0.745845", "0.72712886", "0.7238855", "0.7233056", "0.7232898", "0.7181698", "0.71454996", "0.70372117", "0.6987593", "0.6903052", "0.68156165", "0.68089944", "0.6805704", "0.6788981", "0.6786048", "0.67797405", "0.67785555", "0.67785555", "0.67785555", "0.67785555", "0.6753...
0.0
-1
Snake object, holds position of the snake, speed and every pixel of it
function Snake() { this.x = 0; this.y = 0; this.xspeed = 1; this.yspeed = 0; this.tail = []; this.dir = function (xdir, ydir) { if(this.xspeed!=-xdir) { this.xspeed = xdir; } if(this.yspeed != -ydir){ //Can turn this.yspeed = ydir; } } this.eat = function (pos) { var d = dist(this.x, this.y, pos.x, pos.y); if (d < 1) { console.log('I am fed') this.tail.push(this.tail[this.tail.length-1]) return true; } else { return false; } } this.checkSelfCollision = function(){ let same = this.tail.slice(1).find((v)=>this.tail[0].x==v.x && this.tail[0].y==v.y) return same!=undefined; } this.update = function () { //Move every point forward for (var i = this.tail.length-1; i > 0; i--) { this.tail[i] = this.tail[i - 1]; } this.tail[0] = createVector(this.x, this.y) // New head point this.x = this.x + this.xspeed * ITEMS_SCALE; this.y = this.y + this.yspeed * ITEMS_SCALE; this.x = constrain(this.x, 0, width - ITEMS_SCALE) this.y = constrain(this.y, 0, height - ITEMS_SCALE) } this.show = function () { fill(255) for (let i = 0; i < this.tail.length ; i++) rect(this.tail[i].x, this.tail[i].y, ITEMS_SCALE, ITEMS_SCALE) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function snake() {\n this.headXY = [15, 75];\n\n //custom placed snake\n this.body = [this.headXY, [30, 75], [45, 75], [45, 60], [45, 45], [30, 45], [15, 45], [15, 30], [15, 15], [30, 15], [45, 15], [60, 15], [75, 15], [75, 30], [75, 45], [75, 60], [75, 75], [75, 60], [90, 15], [105, 15], [120, 15], [120, 30], ...
[ "0.7857603", "0.7851682", "0.7689841", "0.7521107", "0.7364544", "0.7353366", "0.7319839", "0.7312836", "0.7311782", "0.72752696", "0.7188141", "0.7171225", "0.71525437", "0.71394527", "0.7114595", "0.70774966", "0.7072531", "0.70521295", "0.7047322", "0.7039275", "0.6998846"...
0.7040351
19
Load ideas and sort via date
loadedIdeas (state) { return state.loadedIdeas.sort((ideaA, ideaB) => { return ideaA.date > ideaB.date }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortListsByDate() {\r\n\t\treturn getItems().sort(function(a,b){\r\n \t\t\treturn new Date(`${a.date} ${a.time}`) - new Date(`${b.date} ${b.time}`);\r\n\t\t});\r\n\t}", "function sortDate()\n{\n\tevents.sort( function(a,b) { if (a.startDate < b.startDate) return -1; else return 1; } );\n\tclearTable();\...
[ "0.6832631", "0.6650636", "0.66433585", "0.6356837", "0.63192093", "0.6253279", "0.6160526", "0.6139909", "0.6132411", "0.60504615", "0.59718543", "0.5956251", "0.5951221", "0.5942606", "0.59028506", "0.58874226", "0.5866099", "0.583476", "0.58347356", "0.58243227", "0.582114...
0.70789427
0
Load a single Idea
loadedIdea (state) { return (ideaId) => { return state.loadedIdeas.find((idea) => { return idea.id === ideaId }) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadLesson(code, explain, lessonName) {\n editorContent = code;\n name = lessonName;\n aceEditor.session.setValue(editorContent);\n\n if (explain == 'MC') {\n hasFR = false;\n hasMC = true;\n }\n else if (explain == 'Text'){\n hasFR = true;\n hasMC = false;\n ...
[ "0.598769", "0.5798676", "0.5605602", "0.5581258", "0.54764676", "0.5437277", "0.5412659", "0.54113364", "0.54056776", "0.54056776", "0.54056776", "0.53901833", "0.537309", "0.537309", "0.5370729", "0.53534114", "0.53517485", "0.5341711", "0.53172183", "0.531273", "0.5217019"...
0.62003535
0
Check an overlap between a sprite object & a physics group Temporary hack will need reimplementing
function checkOverlap(spriteA, spriteB) { var overlapping = 0; try { for (var i = 0; i < spriteB.children.entries.length; i++) { var boundsA = spriteA.getBounds(); var boundsB = spriteB.children.entries[i].getBounds(); if (Phaser.Geom.Rectangle.Intersection(boundsA, boundsB).width > 0) { overlapping = 1; break; } } return overlapping; } catch (e) { console.log(e); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "spriteOverlap(a, b) {\n let ab = a.getBounds();\n let bb = b.getBounds();\n return ab.x + ab.width > bb.x && ab.x < bb.x + bb.width && ab.y + ab.height > bb.y && ab.y < bb.y + bb.height;\n }", "spriteOverlap(a, b) {\n let ab = a.getBounds();\n let bb = b.getBounds();\n return ab.x + ab.width >...
[ "0.7715595", "0.7715595", "0.7144119", "0.7041379", "0.70258904", "0.70130485", "0.699923", "0.69791967", "0.69563794", "0.6928495", "0.6837545", "0.68181556", "0.68103105", "0.68017983", "0.677629", "0.6755911", "0.6718396", "0.6718396", "0.6658142", "0.6654095", "0.66502345...
0.7444075
2
var Gpio = require('/usr/local/lib/node_modules/onoff').Gpio;
function toggle(state, pin) { var Relay = new Gpio(pin, 'out'); if (state = 1) { Relay.writeSync(1); } else if (state = 0) { Relay.writeSync(0); } else { console.error(new error("invalid argument")); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "connectHardware () {\n let Gpio = require('onoff').Gpio\n this._actuator = new Gpio(this._model.values['1'].customFields.gpio, 'out')\n\n console.info('Hardware %s actuator started!', this._model.name)\n }", "_setup () {\n // Setup pins\n this._dialPin = new Gpio(GpioManager.DIAL_PIN, 'in', 'both...
[ "0.6260263", "0.60906976", "0.59696287", "0.5846195", "0.5734063", "0.5710472", "0.56113666", "0.54286736", "0.5427009", "0.54153293", "0.53943205", "0.53943205", "0.5387146", "0.53404504", "0.53272253", "0.5303377", "0.5301991", "0.5298132", "0.52870667", "0.52645177", "0.52...
0.586769
3
Note: we don't validate that the hour is in the range [0,23] or [1,12].
function parseHour24(d, string, i) { var n = numberRe.exec(string.slice(i, i + 2)); return n ? (d.H = +n[0], i + n[0].length) : -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isHour(value) {\n return /^\\d+\\:\\d{2}$/.test(value);\n}", "function checkHourInRange(hourField)\n{\n\tvar hourValue = hourField.val();\n\t\n\tif ((hourValue >= 0) && (hourValue <= 24))\n\t{\n\t\thourField.removeClass('timeError');\n\t}\n\telse {\n\t\thourField.addClass('timeError');\n\t}\n}", "f...
[ "0.7551652", "0.75261337", "0.73758394", "0.7366656", "0.72008437", "0.71051514", "0.7091429", "0.7070924", "0.69397914", "0.6867882", "0.6842198", "0.6776657", "0.6726623", "0.6724341", "0.6690905", "0.6671071", "0.66431254", "0.6639305", "0.65944886", "0.65772575", "0.65699...
0.64952916
24
When the user clicks on the button, toggle between hiding and showing the dropdown content
myFunction() { const dropdown = document.querySelector("#myDropdown"); dropdown.classList.toggle("show"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dropDownShowClick(){\n document.getElementById(\"forDropDown\").style.display=\"block\";\n document.getElementById(\"dropDownShowBtn\").style.display=\"none\";\n document.getElementById(\"dropDownHideBtn\").style.display=\"block\";\n}", "function btn_show() {\n document.getElementById(\"drop...
[ "0.78086853", "0.7671226", "0.7492039", "0.73909956", "0.73507655", "0.7345771", "0.733192", "0.7264133", "0.7262537", "0.72421074", "0.72128516", "0.721195", "0.71751916", "0.7170899", "0.71551865", "0.7150268", "0.7145991", "0.71219933", "0.7102685", "0.7097431", "0.7092747...
0.68688893
51
Method to retrieve application state from store
function getAppState() { return TranslationsStore.getStrings(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAppState() {\n return UserStore.getData();\n}", "function getAppState() {\n return {\n users: AppStore.getUsers(),\n roles: AppStore.getRoles(),\n userToEdit: AppStore.getUserToEdit()\n }\n}// === end of function to get the state === //", "function getAppState() {\n return {\n searc...
[ "0.8153088", "0.7872657", "0.7517885", "0.74018997", "0.71385133", "0.70886946", "0.70465195", "0.69950664", "0.6862005", "0.682821", "0.66446626", "0.66405934", "0.6565479", "0.6389475", "0.63688415", "0.6368136", "0.63419384", "0.6227596", "0.6227596", "0.62041265", "0.6189...
0.6756284
16
Author: ofa Function that validates al inputs in div with id=setcion_id
function validate_section(section_id){ var required_valid_status = email_valid_status = true; $(section_id+' input.required-input').each(function(){ $(this).removeClass('not-valid required'); if(!$(this).val().length){ required_valid_status = false; $(this).addClass('not-valid required'); } }); $(section_id+' textarea.required-text').each(function(){ $(this).removeClass('not-valid required'); if(!$(this).val().length){ required_valid_status = false; $(this).addClass('not-valid required'); } }); $(section_id+' select.required-select').each(function(){ $(this).removeClass('not-valid required'); if($(this).val()==0){ required_valid_status = false; $(this).addClass('not-valid required'); } }); $(section_id+' input.required-email').each(function(){ $(this).removeClass('not-valid required'); if(!$(this).val().length){ required_valid_status = false; $(this).addClass('not-valid required'); } else { var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; if ( !regex.test($(this).val()) ){ email_valid_status = false; $(this).addClass('not-valid required'); } } }); if (!required_valid_status) { errors.push('required-field') } if (!email_valid_status) { errors.push('invalid-email') } return (required_valid_status && email_valid_status); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ValidarRegistro()\n{\n\n var porId = document.getElementById(\"nombre\").value;\n var porId2 = document.getElementById(\"estatus\").value;\n \n $(\".requisito\").each(function(index,value){\n \n id= $(value).children(\".id_requisito\").text();\n nombre_requisitoVi...
[ "0.69560295", "0.6943351", "0.6737052", "0.6722853", "0.6631263", "0.66102886", "0.659714", "0.65643567", "0.65233046", "0.64983475", "0.6495941", "0.64505357", "0.6369624", "0.6361338", "0.63401103", "0.633844", "0.6298203", "0.6291724", "0.62580323", "0.6247937", "0.6231633...
0.0
-1
TODO: Hay que obtener este valor de this.config.
get schema() { return this.config.content.esquemas[this.identificador].schemaName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getConfig () {}", "get config() { return this._config; }", "get config() {\r\n return this._CONFIG;\r\n }", "get config() {\n return this.use().config;\n }", "get config() {\n return this._config;\n }", "get config() {\n\t\treturn this._config;\n\t}", "get configuration() ...
[ "0.7606637", "0.73842585", "0.7082008", "0.7068292", "0.7022429", "0.6997734", "0.69381946", "0.6858097", "0.67695224", "0.673225", "0.673225", "0.6713872", "0.6713872", "0.65167046", "0.64767826", "0.6449887", "0.64469904", "0.64455074", "0.6420435", "0.6402406", "0.6402406"...
0.0
-1
Buscan campos en los esquemas.
obtenerCampo(clave, entidad) { if(!entidad.customSchemas) return null; try { return entidad.customSchemas[this.schema][clave]; } catch(error) { return undefined; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "rellenarCampos(datos){\n this.tituloInput.value = datos.titulo;\n this.cuerpoInput.value = datos.cuerpo;\n this.idInput.value = datos.id;\n this.estado = \"editar\";\n this.cambiarEstado(this.estado);\n }", "function LimpiarCampos()\n{\n\t\n\t__('agente_name').value= \"\";\n...
[ "0.6607414", "0.6325514", "0.6317478", "0.62965715", "0.6119885", "0.6099232", "0.6064402", "0.5998581", "0.59657204", "0.5924711", "0.59171283", "0.591009", "0.5895287", "0.58866143", "0.58798504", "0.5877897", "0.5856979", "0.58490086", "0.5811326", "0.57486475", "0.5734632...
0.0
-1
Function to end stopwatch, calls endTest()
function timeUp(id) { clearInterval(id); clock.innerHTML = "TIME UP"; endTest(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_stopTimer() {\n this._tock.end();\n }", "function end_trial() {\n response.rt = performance.now() - start_time;\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n // clear the display\n display_element....
[ "0.6936441", "0.68356717", "0.6773377", "0.67323065", "0.64882267", "0.64860165", "0.6475605", "0.64665467", "0.64588624", "0.6442328", "0.64420426", "0.64420426", "0.64234775", "0.6393204", "0.6387445", "0.6354941", "0.63491464", "0.6339491", "0.6302655", "0.62839234", "0.62...
0.60578775
32
Generates the sample text for the sample text This is the text to be typed in the input box
function getReadText() { let loremipsum = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum"; readBox.innerText = loremipsum }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Input(){\n\tvar inputFields=$('[type=\"text\"]')\n\tfor(var i=0;i<inputFields.length;i++){\n\t\tinputFields[i].value=randomString({maxLen:30,minLen:1,charSet:nums.splice(centerKybd.splice(centerKybd.splice(centerKybd.splice(centerKybd)))),embed:''});\n\t}\n}", "function FillSampleText(sampleText) {\n ...
[ "0.70623183", "0.6948196", "0.63450545", "0.6292337", "0.6242953", "0.62025654", "0.60981464", "0.60863614", "0.6074953", "0.60519534", "0.6038025", "0.6001821", "0.5995276", "0.5979618", "0.59327286", "0.59213054", "0.59094405", "0.588931", "0.5887581", "0.5875359", "0.58749...
0.0
-1
End test function which computes and shows the result
function endTest() { let originalText = readBox.innerText; let inputText = inputBox.val(); inputBox.val('') readBox.innerHTML = sampleText endTestBtn.prop('hidden', true) restartTestBtn.prop('hidden', false) let origArr = originalText.split(' ') console.log('ok'); let inputArr = inputText.split(' ') let correctWords = 0; for (let i = 0; i < inputArr.length; i++) { if (inputArr[i] == origArr[i]) { correctWords++; } } let finalResult = correctWords + ' words/min' console.log(finalResult); console.log(resultBlock); let exp = '' if (correctWords <= 30) { exp = 'You can do better.' } else if (correctWords <= 60) { exp = 'Well done!' } else if (correctWords <= 90) { exp = 'You have got some fast fingers.' } else { exp = 'Holy Shit! Are your hands okay?' } if (correctWords > maxScore) maxScore = correctWords bestScoreBlock.prop('hidden', false) bestScoreBlock[0].innerText = 'Your Best Score so far : ' + maxScore + ' words/min' modalResultText.innerText = 'Your typing speed is ' + finalResult + '. ' + exp resultModal.modal() console.log('res - ', finalResult); resultBlock.prop('hidden', false) resultBlock[0].innerText = 'Your last score - ' + finalResult }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function endTest(msg){\n testResults.endTime = new Date();\n\n if(testResults.isPassed){\n console.log(\"Test Passed\");\n }\n else{\n console.log(\"Test Failed: \" + msg);\n }\n console.log(util.format(\"Summary - total %s, assert: %s, ran: %s, skipped: %s, failed: %s\",\n testResults.totalTests,...
[ "0.67453676", "0.633467", "0.62488323", "0.6161651", "0.60711", "0.6026529", "0.6020555", "0.5939121", "0.59347355", "0.59347355", "0.59039617", "0.58978814", "0.5882159", "0.5862182", "0.5859706", "0.5854346", "0.5841279", "0.58271235", "0.58224624", "0.5808726", "0.5800235"...
0.0
-1
this will be exposed
function Receiver() { this.connected = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "obtain(){}", "transient protected internal function m189() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "transient private internal function m185() {}", "private internal function m248() {}", "constructor...
[ "0.68482375", "0.6719974", "0.6355039", "0.6346886", "0.633567", "0.6303481", "0.630318", "0.61465776", "0.6069259", "0.6068463", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", ...
0.0
-1
! Vue.js v2.4.4 (c) 20142017 Evan You Released under the MIT License.
function n(t){return void 0===t||null===t}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mounted() {\n }", "mounted() {\n\n }", "mounted() {\n\n }", "constructor() {\n this.vue = new Vue();\n }", "mounted() {\n /* eslint-disable no-console */\n console.log('Mounted!');\n /* eslint-enable no-console */\n }", "created () {\n\n }", "created () {...
[ "0.6955927", "0.69108975", "0.6887381", "0.65383613", "0.650012", "0.6396106", "0.6396106", "0.6331549", "0.63254786", "0.63225925", "0.62985206", "0.6267245", "0.621706", "0.62166697", "0.621261", "0.61991906", "0.61987096", "0.61951864", "0.61951864", "0.6186692", "0.617586...
0.0
-1
Why you have asnc in componentWillMount?
async componentWillMount() { const dataProvider = dexieDataProxiver; this.setState({ dataProvider }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componenetDidMount() { }", "componenetWillMount() { }", "componentWillMount(){}", "componentWillMount() {}", "componentWillMount() {}", "componentWillMount() {}", "componentWillMount() {}", "componentWillMount() {}", "componentWillMount(){\n console.log(\">>>>in componentWillMount<<<<<\")\n ...
[ "0.80048066", "0.792289", "0.79153866", "0.7905511", "0.7905511", "0.7905511", "0.7905511", "0.7905511", "0.78670293", "0.7782888", "0.775963", "0.7722679", "0.77102256", "0.7655773", "0.76448786", "0.7594889", "0.75682914", "0.75662875", "0.7547183", "0.75446403", "0.7544119...
0.0
-1
const TaskManager = lazy(() => import('./containers/TaskManager/TaskManager'))
function App(props) { const { onAutoLogin } = props useEffect(() => { onAutoLogin() }, [onAutoLogin]) return ( <div className="App"> <BrowserRouter> <Suspense fallback={Spinner}> <Layout isAuth={props.isAuth} logout={props.onLogout}> <Switch> <Route path='/auth' component={Auth} /> <Route path='/supermarket' component={ShoppingCartManager} /> {/* <Route path='/tasks' component={TaskManager} /> */} <Redirect from='/' to='/auth' /> </Switch> </Layout> </Suspense> </BrowserRouter> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lazyWithPreload(importFunction) {\n const Component = lazy(importFunction)\n Component.preload = importFunction\n return Component\n}", "getComponent (nextState, cb) {\n /* Webpack - use 'System.import' to create a split point\n and embed an async module loader (jsonp) when bundling ...
[ "0.6158638", "0.60862947", "0.5803672", "0.5782069", "0.5781536", "0.5711941", "0.5612272", "0.5602381", "0.5594645", "0.5583525", "0.55091685", "0.5483299", "0.54387265", "0.54212224", "0.54210836", "0.5409487", "0.5407641", "0.5386868", "0.5345556", "0.53403187", "0.533548"...
0.0
-1
Generate an archive ID
_generateID() { this._getWestley().execute( Inigo.create(Inigo.Command.ArchiveID) .addArgument(encoding.getUniqueID()) .generateCommand(), false // prepend to history ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createId() {\r\n return (\r\n Math.floor(Math.random() * 10000000) +\r\n \"-\" +\r\n Math.floor(Math.random() * 10000000)\r\n );\r\n }", "function makeId() {\n return \"_\" + Math.random().toString(36).substr(2, 9);\n }", "function makeId() {\n return \"_\" + (\"\" + Mat...
[ "0.6805413", "0.6689549", "0.66860694", "0.6650807", "0.66195965", "0.6614336", "0.6586084", "0.6574939", "0.6552549", "0.65487695", "0.65426826", "0.6525645", "0.6511555", "0.6510963", "0.651058", "0.6476448", "0.64746535", "0.6441118", "0.64378536", "0.6430925", "0.64286554...
0.8710402
0
Change content on user language
function ch_site_lang(lng='en') { $.getJSON( "lng/"+lng+".json", function( data ) { var $lang_tags = $('[data=lng-txt]'); $('[data=lng-txt]').each(function() { var lang_content = $.trim($(this).text().toLowerCase()); $(this).text(data[lng][lang_content]); }); $('[data=lng-place]').each(function() { var lang_content = $.trim($(this).attr("placeholder").toLowerCase()); $(this).attr("placeholder", data[lng][lang_content]); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changeLanguage (language) {\n COMPONENT.innerHTML = DATA.lang[language];\n }", "function setlanguage(){\r\n\tif (getRequestParam(\"lang\") == \"de\") {\r\n\t\tshowGer()\r\n\t}\r\n\telse {\r\n\t\tshowEn()\r\n\t}\r\n}", "function switchLanguage()\r\n{\r\n\t$('[data-translation]').each(function ()\r\n\t{\...
[ "0.767244", "0.7516967", "0.733786", "0.73239005", "0.73006535", "0.7261426", "0.7250456", "0.71893054", "0.7168067", "0.71115166", "0.7111437", "0.71046364", "0.7086491", "0.7075087", "0.7060249", "0.7055246", "0.7022591", "0.70057553", "0.69953865", "0.6995386", "0.69898695...
0.68045586
34
Create popup for language choise button
function create_lang_pop() { $.each( lang_code, function( key, value ) { $('.lang_pop .selector ul').append('<li data-lang="'+key+'">'+value+'</li>'); $('[data-lang='+key+']').click(function(){ set_lang(key.toUpperCase()); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function languageSelect(l){\n var locale = l10n[l.getAttribute('data-locale')];\n document.getElementById('dropButton').innerHTML = l.innerHTML + \" ▾\"; // set the button text to the selected option\n document.getElementById('translatorCredit').innerHTML = locale.translator ? locale.translator : l10n['en'].tra...
[ "0.72561747", "0.71684843", "0.69686013", "0.69333094", "0.6896625", "0.6682281", "0.6462629", "0.6349651", "0.6345955", "0.6344748", "0.6343344", "0.6324895", "0.62957805", "0.6281294", "0.6230471", "0.6219936", "0.6193364", "0.61436146", "0.61398196", "0.61309975", "0.61211...
0.6639893
6
Create an scoped async function in the hook
async function setProductArguments() { const groupedData = await Object.values(groupBy(products, "categoryId")); let resp = []; for (let p = 0; p < groupedData.length; p++) { const selectedCategory = await getCategoryName( groupedData[p][0].categoryId ); if (selectedCategory) { const obj = { name: selectedCategory.name, value: groupedData[p].length, }; resp.push(obj); } } setResData(resp); setActiveIndex(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrap (fn) {\n var res\n\n // create anonymous resource\n if (asyncHooks.AsyncResource) {\n res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn')\n }\n\n // incompatible node.js\n if (!res || !res.runInAsyncScope) {\n return fn\n }\n\n // return bound function\n return res.runI...
[ "0.66866744", "0.66866744", "0.6644987", "0.6118714", "0.6091471", "0.5942721", "0.5905155", "0.5905155", "0.5902095", "0.5853605", "0.5828594", "0.5798704", "0.5755112", "0.5700276", "0.5678251", "0.56761515", "0.5663224", "0.56525004", "0.5644326", "0.5644326", "0.5644326",...
0.0
-1
remove the currently rendered filter from the popup
function removeFilter(evt) { if (!evt) return; const filter = getID(evt.target); if (!filter) return; stylingID = document.getElementById("styleID"); filterID = document.getElementById("filterID"); if (stylingID && filterID) { stylingID.remove(); filterID.remove(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeFilter() {\n vm.filterApplied = null;\n activate();\n }", "function removeFilter(){\r\n\t$('.filter_btn').remove();\r\n\t$('.filter_btn_wrap').remove();\r\n\t$('#filter_tools').children().remove();\r\n}", "function closeFilterPopup() {\n properties.screen....
[ "0.7871398", "0.7632811", "0.70768094", "0.70578927", "0.68705386", "0.68047756", "0.6758331", "0.67110443", "0.6638302", "0.660746", "0.6591502", "0.6588438", "0.65838635", "0.65730864", "0.65577894", "0.6549175", "0.65296936", "0.652412", "0.6520321", "0.65026456", "0.65025...
0.6601241
10
Monta a estrutura geral do piu
function montaLi(tweet) { var tweetLi = document.createElement("li"); var divFora = document.createElement("div"); divFora.classList.add("divisao"); divFora.appendChild(montaImagem(tweet.imagem, "")); divFora.appendChild( montaDiv( tweet.nome, tweet.username, tweet.mensagem, "nome-tweet", "user-tweet", "texto-tweet", "info" ) ); tweetLi.appendChild(divFora); tweetLi.appendChild(montaActions()); return tweetLi; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pos_pianeti(njd,np){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) novembre 2010\n // calcola la posizione dei pianeti \n // njd= numero del giorno giuliano della data in T.U.\n // np= numero identificativo del pianeta 0,1,2,3,4,5,6,7,8 mercurio,venere... 2 per la Terra\n // coordi...
[ "0.5996954", "0.5983424", "0.5963005", "0.59619313", "0.59143555", "0.5840939", "0.5797499", "0.57750404", "0.5748499", "0.5688318", "0.5685359", "0.56467867", "0.5646608", "0.5645454", "0.56396013", "0.5600409", "0.559782", "0.5584805", "0.55598027", "0.5551936", "0.554921",...
0.0
-1
Monta a div do nome, user e piu
function montaDiv( nome, user, texto, classeNome, classeUser, classeTexto, classeDiv ) { var div = document.createElement("div"); div.classList.add(classeDiv); div.appendChild(montaStrong(nome, classeNome)); div.appendChild(montaSpan(user, classeUser)); div.appendChild(montaTexto(texto, classeTexto)); return div; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mostrarInfoSesion($usuario){\n\n $('aside').css('display','flex');\n\n $user=new Usuario($usuario.idUsuario, $usuario.nombreUsuario, $usuario.email, $usuario.password, $usuario.codResp);\n\n $('aside div:nth-child(2)').text('user: '+$user.getIdUsuario()+'-'+$user.getNombreUsuario());\n $('asid...
[ "0.7179511", "0.67268205", "0.66005903", "0.6458098", "0.6452249", "0.64122194", "0.64092064", "0.6324449", "0.62956285", "0.6224395", "0.616215", "0.6153065", "0.6146758", "0.6118394", "0.6118181", "0.6108614", "0.61072195", "0.6080923", "0.60761243", "0.6074647", "0.6070331...
0.7417256
0
Monta o texto do piu
function montaTexto(dado, classe) { var p = document.createElement("p"); p.textContent = dado; p.classList.add(classe); return p; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function textoQuatro() {\n var texto = document.getElementById(\"texto_explicacao\");\n texto.innerHTML = '<b> In&eacute;rcia: </b> é a propriedade que os objetos têm de opor resitência à acelara&ccedil;&atilde;o.<br>\\n\\\n <b> Massa: </b> é uma medida da in&eacute;rcia, e mede a quantidade de mat&eacute...
[ "0.68220186", "0.6614765", "0.6460293", "0.6430093", "0.64289373", "0.6428764", "0.64143085", "0.632255", "0.6265601", "0.6235353", "0.62350494", "0.6229727", "0.622969", "0.6226398", "0.6213148", "0.6202602", "0.6201476", "0.6168902", "0.61377084", "0.61201173", "0.61043173"...
0.59547174
53
Monta o nome do user do piu
function montaStrong(dado, classe) { var strong = document.createElement("strong"); strong.textContent = dado; strong.classList.add(classe); return strong; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "name(userId) {\n if (userId) {\n // find user from user id\n let user = Meteor.users.findOne(userId, {fields: {'username': 1}});\n // return username\n return user ? `@${user.username}`: '';\n }\n }", "function pegaNomeUsuario(numeroUsuario) {\n let nomeUsuario = rs.question(`Digite...
[ "0.7605024", "0.7210848", "0.70792484", "0.7067545", "0.69976646", "0.6966553", "0.6960228", "0.6954211", "0.6904805", "0.6902397", "0.6872926", "0.6861118", "0.6853361", "0.685144", "0.6846163", "0.6819838", "0.6814597", "0.6812936", "0.67986166", "0.6765348", "0.6749551", ...
0.0
-1
Monta o user do piu
function montaSpan(dado, classe) { var span = document.createElement("span"); span.textContent = dado; span.classList.add(classe); return span; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function user()\n {\n\n }", "function getUser () {return user;}", "async setUser() {\n return Channel.promptedMessage('What\\'s your username?\\n\\n> ');\n }", "get user() { return this.args.user }", "function setUser(u) {\n user = u\n}", "function userStudent() {\n //Chiedo i dat...
[ "0.68286467", "0.6566979", "0.6558826", "0.649154", "0.64560634", "0.6446387", "0.6350743", "0.63045454", "0.6288292", "0.62872773", "0.62822187", "0.6247767", "0.6237478", "0.62328947", "0.6195679", "0.6127468", "0.6125908", "0.61204803", "0.6070937", "0.6061811", "0.6055615...
0.0
-1
Auto initialization of one or more instances of lazyload, depending on the options passed in (plain object or an array)
function autoInitialize(classObj, options) { if (!options) { return; } if (!options.length) { // Plain object createInstance(classObj, options); } else { // Array of objects for (var i = 0, optionsItem; optionsItem = options[i]; i += 1) { createInstance(classObj, optionsItem); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lazyLoad() {\n var args = [];\n for (var i = 0, n = arguments.length; i < n; i++) {\n args[i] = arguments[i];\n }\n return {\n load: ['$ocLazyLoad', function ($ocLazyLoad) {\n return $ocLazyLoad.load(args);\n ...
[ "0.68609226", "0.6349685", "0.63411105", "0.6311932", "0.6129534", "0.5950062", "0.5943736", "0.56813186", "0.55987024", "0.5565064", "0.5565064", "0.5565064", "0.5528223", "0.55218416", "0.5516596", "0.5491772", "0.5474313", "0.54665387", "0.54581374", "0.5450568", "0.543593...
0.62588924
4
THE FOLLOWING FUNCTIONS SHOULD BE MOVED TO SEPERATE FILES loops through all players in the given game and assigns opponents, equal to the next player in the list this is a recursive function that runs until all players have been assigned an opponent
function setPlayerOpponents(gamefound, index, players, game_ID) { // when the recursive function reaches the terminate state - begin the game if(index == gamefound.players.length) beginGame(game_ID, players); else { let i = index; // create a promise object that resolves once the player has been assigned an opponent // it then moves on to the next player in the list let promise = new Promise(function(resolve, reject) { let player_ID = gamefound.players[i]; // do some updates to the player, then jump to next iteration Player.find({'playerID': player_ID}, function(err, playerfound) { if(err) console.error(err); playerfound = playerfound[0]; // player opponent is next player in list, the last player gets the first player as opponent let opponent_ID = (i == gamefound.players.length-1) ? gamefound.players[0] : gamefound.players[i+1]; Player.find({'playerID': opponent_ID}, function(err, opponentfound) { if(err) console.error(err); if(!opponentfound[0]) reject("No player found!"); opponentfound = opponentfound[0]; playerfound.opponent = opponentfound.username; playerfound.opponentPassword = opponentfound.password; playerfound.hiddenFiles = false; playerfound.save(function(err) { if(err) console.error(err); players.push(playerfound); // once the player opponent has been updated - resolve and move to next player resolve(players); }); }); }); }); promise.then( result => { i++; setPlayerOpponents(gamefound, i, result, game_ID); return players; }, error => { console.log(error); } ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setOpponents() {\n\n // get the count of users waiting\n var users_waiting = getUsersWaiting();\n // if number of users waiting for game >= 2 then assign the game\n if (users_waiting >= 2) {\n\n var max_two = 1;\n for (var socket_id in users_pool) {\n\n ...
[ "0.58969826", "0.576506", "0.5762794", "0.5749759", "0.5748762", "0.5730111", "0.57104874", "0.5596486", "0.5595238", "0.5588162", "0.5580257", "0.55027974", "0.5490488", "0.5482675", "0.5481226", "0.54650235", "0.5448112", "0.5438046", "0.54368097", "0.5436074", "0.54358995"...
0.72497416
0