query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Get all registered applications(root elements)
getAllRootElements() { return Array.from(this._applications.keys()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getApps() {\r\n return Array.from(_apps.values());\r\n}", "function getApps(){\n\tchrome.management.getAll(function(info){\n\t\tvar apps = [];\n\t\tfor(var i=0; i<info.length; i++){\n\t\t\tif(info[i].isApp){\n\t\t\t\tapps[apps.length] = info[i];\n\t\t\t}\n\t\t}\n\t\trebuildList(apps);\n\t});\n}", "...
[ "0.7335319", "0.73288846", "0.7245369", "0.7125846", "0.70807505", "0.70807505", "0.70807505", "0.70807505", "0.70807505", "0.70807505", "0.70391786", "0.7035139", "0.7035139", "0.7035139", "0.7033039", "0.7029016", "0.7011046", "0.7011046", "0.7011046", "0.7011046", "0.70110...
0.803562
0
Find testability of a node in the Tree
findTestabilityInTree(elem, findInAncestors = true) { return _testabilityGetter.findTestabilityInTree(this, elem, findInAncestors); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "check_if_passed() {\n const passed = this.node.value === this.correct;\n if (!passed) {\n console.error(this.describe() + \" failed!\");\n }\n return passed;\n }", "function GetTestability(){}", "function GetTestability() {}", "function GetTestability() {}", "funct...
[ "0.62937516", "0.566048", "0.56586087", "0.56586087", "0.56586087", "0.56122315", "0.55775356", "0.55594116", "0.5545182", "0.5545182", "0.5525151", "0.54974645", "0.54717886", "0.539971", "0.53976446", "0.5313215", "0.5303242", "0.529515", "0.52787405", "0.5275126", "0.52571...
0.61071014
1
Registers a listener to be called when the platform is destroyed.
onDestroy(callback) { this._destroyListeners.push(callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static onDestroy(callback) {\n if (!ForegroundServiceEmitter) {\n return null;\n }\n\n return ForegroundServiceEmitter.addListener(\n 'ForegroundService.onDestroy',\n (data) => {\n callback(data);\n },\n );\n }", "destroy() {\n window.removeEventListener('gamepadcon...
[ "0.6978193", "0.6930071", "0.69078004", "0.68715155", "0.6828066", "0.6824591", "0.6757372", "0.66197705", "0.6612441", "0.6588616", "0.65864456", "0.657338", "0.657338", "0.657338", "0.657338", "0.657338", "0.65667284", "0.65494955", "0.6541092", "0.6507739", "0.65035355", ...
0.70483184
0
Invoke this method to explicitly process change detection and its sideeffects. In development mode, `tick()` also performs a second change detection cycle to ensure that no further changes are detected. If additional changes are picked up during this second cycle, bindings in the app have sideeffects that cannot be res...
tick() { if (this._runningTick) { throw new Error('ApplicationRef.tick is called recursively'); } try { this._runningTick = true; for (let view of this._views) { view.detectChanges(); } // Note that we have still left th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "tick() {\n if (this._runningTick) {\n const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?\n 'ApplicationRef.tick is called recursively' :\n '';\n throw new RuntimeError(101 /* RECURSIVE_APPLICATION_REF_TICK */, errorMessage);\n }\...
[ "0.7182672", "0.59552026", "0.58195436", "0.58195436", "0.573809", "0.56742907", "0.545958", "0.54182273", "0.5297705", "0.5269587", "0.5258942", "0.5258904", "0.52179277", "0.52013355", "0.5169545", "0.5090936", "0.5083268", "0.50830734", "0.5071029", "0.5070555", "0.50629",...
0.74804074
0
Attaches a view so that it will be dirty checked. The view will be automatically detached when it is destroyed. This will throw if the view is already attached to a ViewContainer.
attachView(viewRef) { const view = viewRef; this._views.push(view); view.attachToAppRef(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "attachToView(componentRef, viewContainer) {\n viewContainer.insert(componentRef.hostView, 0);\n }", "bindView(_view) {\n if (!this.viewIds.includes(_view.viewId)) {\n this.viewIds.push(_view.viewId);\n }\n this._updateFlexibleDimensions();\n return this;\n }", "_maybeCacheView(view,...
[ "0.7042597", "0.6013245", "0.59056115", "0.58039", "0.5785218", "0.5785218", "0.57234454", "0.5669581", "0.56635255", "0.5656859", "0.5656859", "0.5656859", "0.5656859", "0.5656859", "0.5656859", "0.5654255", "0.5649415", "0.56221044", "0.5568569", "0.5568569", "0.5568569", ...
0.6573877
1
Returns the number of attached views.
get viewCount() { return this._views.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get views() {\n return this._data.view_count;\n }", "get length() { return this._getViews().length; }", "function uiViewDepth(uiView) {\n\t return uiView.fqn.split(\".\").length;\n\t }", "function viewcount(element) {\r\n\t\tlet component = findReact(element);\r\n\t\t// If...
[ "0.69254005", "0.6900075", "0.6568024", "0.6395431", "0.61073595", "0.61073595", "0.609789", "0.6037446", "0.6017605", "0.6017605", "0.6017605", "0.6017605", "0.5829432", "0.5799175", "0.57989603", "0.57989603", "0.57989603", "0.57989603", "0.57989603", "0.57989603", "0.57989...
0.7633501
1
Set the title of the current HTML document.
setTitle(newTitle) { this._doc.title = newTitle || ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setTitle(title) {\n document.title = title;\n }", "setTitle(title) {\r\n this.title = siteTitle + title\r\n document.title = Site.info.siteName + ' ' + siteTitle + title\r\n }", "function setPageTitle (newTitle) {\n title = newTitle;\n }", "async s...
[ "0.8108284", "0.8085937", "0.80655766", "0.79835933", "0.7976463", "0.7971842", "0.7926539", "0.7847819", "0.78016555", "0.77137005", "0.76995057", "0.76952803", "0.7694339", "0.76441896", "0.7632438", "0.761512", "0.76005936", "0.75336456", "0.75168556", "0.74745184", "0.747...
0.82783496
1
Remove a key from the store.
remove(key) { delete this.store[key]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove(key) {\n delete this.store[key];\n }", "function remove(key) {\n\tdelete this.dataStore[key];\n}", "function remove(key) {\n delete this.dataStore[key];\n }", "function remove(key) {\r\ndelete this.datastore[key];\r\n}", "static remove(key) {\n PStore.remove(key);\n }", "removeIt...
[ "0.84753895", "0.83803093", "0.83536017", "0.8068457", "0.80244523", "0.78262436", "0.77388257", "0.76783353", "0.76280993", "0.7440426", "0.7403038", "0.73981625", "0.73453844", "0.72739357", "0.7265906", "0.7228548", "0.7165261", "0.716492", "0.7147468", "0.71287304", "0.71...
0.8636107
1
Test whether a key exists in the store.
hasKey(key) { return this.store.hasOwnProperty(key); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hasKey(key) {\n return this.store.hasOwnProperty(key);\n }", "async has(key) {}", "has (key) {\n return this.keys.has(key)\n }", "has(k) {\n return k in this.kvStore;\n }", "async has (key) {\n let result = await this.client.get(this.namedKey(key));\n return !!result;\n }", "has(key) {...
[ "0.83449924", "0.7880765", "0.7590046", "0.7545932", "0.7411452", "0.7381403", "0.7231739", "0.71904975", "0.7136896", "0.70680624", "0.69874156", "0.6942839", "0.6940856", "0.6862701", "0.6842324", "0.6836568", "0.676974", "0.67309964", "0.6722353", "0.6719647", "0.67123854"...
0.83547646
1
Register a callback to provide the value for a key when `toJson` is called.
onSerialize(key, callback) { this.onSerializeCallbacks[key] = callback; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onSerialize(key, callback) {\n this.onSerializeCallbacks[key] = callback;\n }", "function wrappedCallback(value, key) {\n return callback.call(observed, wrap(value), wrap(key), observed)\n }", "function wrappedCallback(value, key) {\r\n return callback.call(observed, wrap(value), wra...
[ "0.6610614", "0.5771434", "0.5715612", "0.5704786", "0.55151266", "0.53847575", "0.530155", "0.5192173", "0.5192156", "0.5192156", "0.5155206", "0.51326895", "0.51100165", "0.50437963", "0.50342786", "0.50271505", "0.50237083", "0.50237083", "0.50237083", "0.50237083", "0.502...
0.6563449
1
Serialize the current state of the store to JSON.
toJson() { // Call the onSerialize callbacks and put those values into the store. for (const key in this.onSerializeCallbacks) { if (this.onSerializeCallbacks.hasOwnProperty(key)) { try { this.store[key] = this.onSerializeCallbacks[key](); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toJson() {\n // Call the onSerialize callbacks and put those values into the store.\n for (const key in this.onSerializeCallbacks) {\n if (this.onSerializeCallbacks.hasOwnProperty(key)) {\n try {\n this.store[key] = this.onSerializeCallbacks[key]();\n } catch (e) {\n cons...
[ "0.789174", "0.7861236", "0.7861236", "0.7465746", "0.7465746", "0.7465746", "0.7465746", "0.7003918", "0.689888", "0.689888", "0.6868876", "0.68458945", "0.68447447", "0.68375516", "0.6767056", "0.67646074", "0.6757073", "0.67471665", "0.6738951", "0.67335325", "0.66856676",...
0.8015216
0
Removes a trailing slash from a URL string if needed. Looks for the first occurrence of either ``, `?`, or the end of the line as `/` characters and removes the trailing slash if one exists.
function stripTrailingSlash(url) { const match = url.match(/#|\?|$/); const pathEndIdx = match && match.index || url.length; const droppedSlashIdx = pathEndIdx - (url[pathEndIdx - 1] === '/' ? 1 : 0); return url.slice(0, droppedSlashIdx) + url.slice(pathEndIdx); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stripTrailingSlash(url) {\n var match = url.match(/#|\\?|$/);\n var pathEndIdx = match && match.index || url.length;\n var droppedSlashIdx = pathEndIdx - (url[pathEndIdx - 1] === '/' ? 1 : 0);\n return url.slice(0, droppedSlashIdx) + url.slice(pathEndIdx);\n}", "function stripTrailingSlash(url) {\n ...
[ "0.754495", "0.7515724", "0.75014985", "0.7064069", "0.70632344", "0.6965987", "0.66709936", "0.66709936", "0.6668229", "0.65349096", "0.6464596", "0.64287627", "0.6284743", "0.62664336", "0.62454456", "0.62454456", "0.62454456", "0.62454456", "0.62454456", "0.62454456", "0.6...
0.7529901
1
Normalizes URL parameters by prepending with `?` if needed.
function normalizeQueryParams(params) { return params && params[0] !== '?' ? '?' + params : params; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalizeQueryParams(params) {\n return params && params[0] !== '?' ? '?' + params : params;\n }", "function normalizeQueryParams(params) {\n return params && params[0] !== '?' ? '?' + params : params;\n}", "function normalizeQueryParams(params) {\n return params && params[0] !== '?' ? '...
[ "0.75588673", "0.74942577", "0.74942577", "0.68607134", "0.6709715", "0.6622909", "0.6490493", "0.64393234", "0.64218926", "0.6412128", "0.6412128", "0.6389399", "0.63794315", "0.6288052", "0.6228308", "0.62086105", "0.6188981", "0.61583304", "0.6128259", "0.6069502", "0.6041...
0.7507801
1
Retrieves localespecific rules used to determine which day period to use when more than one period is defined for a locale. There is a rule for each defined day period. The first rule is applied to the first day period and so on. Fall back to AM/PM when no rules are available. A rule can specify a period as time range,...
function getLocaleExtraDayPeriodRules(locale) { const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); checkFullData(data); const rules = data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].ExtraData][2 /* ExtraDayPeriodsRules */] || []; return rules....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLocaleExtraDayPeriodRules(locale){var data=findLocaleData(locale);checkFullData(data);var rules=data[19/* ExtraData */][2/* ExtraDayPeriodsRules */]||[];return rules.map(function(rule){if(typeof rule==='string'){return extractTime(rule);}return[extractTime(rule[0]),extractTime(rule[1])];});}", "funct...
[ "0.76516026", "0.7276704", "0.7229744", "0.7223575", "0.71547854", "0.71547854", "0.71547854", "0.715295", "0.6984404", "0.6697678", "0.6612328", "0.65899867", "0.65814126", "0.65814126", "0.65814126", "0.65814126", "0.65814126", "0.6573297", "0.6560645", "0.6560645", "0.6560...
0.7368684
1
Retrieves the writing direction of a specified locale
function getLocaleDirection(locale) { const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].Directionality]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLocaleDirection(locale) {\n var data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_6__[\"ɵfindLocaleData\"])(locale);\n return data[_angular_core__WEBPACK_IMPORTED_MODULE_6__[\"ɵLocaleDataIndex\"].Directionality];\n}", "function getLocaleDirection(locale) {\n const data = (0,_angular_core__WEBPA...
[ "0.7481925", "0.74696636", "0.7468788", "0.6816457", "0.6639118", "0.6575401", "0.63706875", "0.6258714", "0.61804813", "0.6163809", "0.6149179", "0.6149179", "0.6149179", "0.6148968", "0.61374795", "0.60961753", "0.60961753", "0.6076343", "0.59610456", "0.595884", "0.5930645...
0.7504653
0
Retrieves the first value that is defined in an array, going backwards from an index position. To avoid repeating the same data (as when the "format" and "standalone" forms are the same) add the first value to the locale data arrays, and add other values only if they are different.
function getLastDefinedValue(data, index) { for (let i = index; i > -1; i--) { if (typeof data[i] !== 'undefined') { return data[i]; } } throw new Error('Locale data API: locale data undefined'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLastDefinedValue(data,index){for(var i=index;i>-1;i--){if(typeof data[i]!=='undefined'){return data[i];}}throw new Error('Locale data API: locale data undefined');}", "function getLastDefinedValue(data, index) {\n for (var i = index; i > -1; i--) {\n if (typeof data[i] !== 'undefined') {\n ...
[ "0.74097574", "0.7241937", "0.7241937", "0.7241937", "0.7241937", "0.72258276", "0.71888715", "0.71732295", "0.55640787", "0.5508775", "0.5486058", "0.53950655", "0.539243", "0.53921366", "0.5383739", "0.5381505", "0.5381505", "0.5381505", "0.5263334", "0.52297497", "0.521540...
0.72737443
1
Create a new Date object with the given date value, and the time set to midnight. We cannot use `new Date(year, month, date)` because it maps years between 0 and 99 to 19001999. See: Note that this function returns a Date object whose time is midnight in the current locale's timezone. In the future we might want to cha...
function createDate(year, month, date) { // The `newDate` is set to midnight (UTC) on January 1st 1970. // - In PST this will be December 31st 1969 at 4pm. // - In GMT this will be January 1st 1970 at 1am. // Note that they even have different years, dates and months! const newDate = new Date(0); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createDate(year, month, date) {\n // The `newDate` is set to midnight (UTC) on January 1st 1970.\n // - In PST this will be December 31st 1969 at 4pm.\n // - In GMT this will be January 1st 1970 at 1am.\n // Note that they even have different years, dates and months!\n const newDate = new Date(0); //...
[ "0.64472175", "0.6386575", "0.61955035", "0.57637465", "0.5670124", "0.5573391", "0.5442607", "0.53917044", "0.5158337", "0.50682455", "0.5044177", "0.50367826", "0.50278854", "0.49814957", "0.49805462", "0.4976443", "0.4976443", "0.4976443", "0.48779064", "0.48351493", "0.48...
0.661154
0
We need to recreate existing embedded view if: templateRef has changed context has changes We mark context object as changed when the corresponding object shape changes (new properties are added or existing properties are removed). In other words we consider context with the same properties as "the same" even if object...
_shouldRecreateView(changes) { const ctxChange = changes['ngTemplateOutletContext']; return !!changes['ngTemplateOutlet'] || (ctxChange && this._hasContextShapeChanged(ctxChange)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function propagateReplacedReferences(template, logicalId) {\n let ret = false;\n function recurse(obj) {\n if (Array.isArray(obj)) {\n obj.forEach(recurse);\n }\n if (typeof obj === 'object' && obj !== null) {\n if (!replaceReference(obj)) {\n Object....
[ "0.58627754", "0.58471805", "0.5739192", "0.5739192", "0.5727384", "0.5727384", "0.5711935", "0.56807387", "0.56805325", "0.5677384", "0.5651321", "0.5635484", "0.5625697", "0.55716604", "0.54915917", "0.54915917", "0.54915917", "0.54915917", "0.54915917", "0.54915917", "0.54...
0.6697159
1
Calls `focus` on the `focusTarget` and returns `true` if the element was focused successfully. If `false`, further steps may be necessary to determine a valid substitute to be focused instead.
attemptFocus(focusTarget) { focusTarget.focus(); return this.document.activeElement === focusTarget; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async isFocused() {\n await this._stabilize();\n return webdriver.WebElement.equals(this.element(), this.element().getDriver().switchTo().activeElement());\n }", "_containsFocus() {\n if (!this._document || !this._elementRef) {\n return false;\n }\n const stepperE...
[ "0.64778185", "0.64691424", "0.6325661", "0.620724", "0.6140154", "0.6140154", "0.6112902", "0.60908115", "0.599942", "0.5998802", "0.5998802", "0.5998802", "0.5983577", "0.5982695", "0.5971046", "0.5971046", "0.5961403", "0.59524757", "0.5940387", "0.59313667", "0.59197503",...
0.76613474
1
Matches the route configuration (`route`) against the actual URL (`segments`).
function defaultUrlMatcher(segments, segmentGroup, route) { const parts = route.path.split('/'); if (parts.length > segments.length) { // The actual URL is shorter than the config, no match return null; } if (route.pathMatch === 'full' && (segmentGroup.hasChildren() || parts.leng...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function defaultUrlMatcher(segments, segmentGroup, route) {\n var parts = route.path.split('/');\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || ...
[ "0.70083785", "0.70083785", "0.70083785", "0.70083785", "0.6942145", "0.6936596", "0.67211944", "0.6447084", "0.63863677", "0.6385541", "0.6385541", "0.6385541", "0.6385541", "0.6385541", "0.6353828", "0.62965214", "0.6245075", "0.6230288", "0.61976796", "0.61976796", "0.6180...
0.70426023
0
Number of child segments
get numberOfChildren() { return Object.keys(this.children).length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "numberOfSegments() {\n return this.segments.length;\n }", "get numChildren() {\n return this._childPaths.length;\n }", "get numberOfChildren() {\n return Object.keys(this.children).length;\n }", "get_child_count(){\n return Object.keys(this.children).length;\n }", "childCount() ...
[ "0.75103635", "0.7466596", "0.73930985", "0.7360456", "0.7285496", "0.703335", "0.6851528", "0.6820866", "0.67954737", "0.67244995", "0.6584134", "0.6583489", "0.6576454", "0.65499634", "0.6513724", "0.64582396", "0.6426981", "0.6425314", "0.6346562", "0.6325385", "0.63155967...
0.75225264
0
The configuration used to match this route.
get routeConfig() { return this._futureSnapshot.routeConfig; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get routeConfig() {\n return this._futureSnapshot.routeConfig;\n }", "static get routeConfig() {\n return RouteConfig;\n }", "config(config) {\r\n var handler;\r\n if (isPresent(config.name) && config.name[0].toUpperCase() != config.name[0]) {\r\n var suggestedName = config.nam...
[ "0.6852159", "0.67896545", "0.64272076", "0.61641896", "0.6145253", "0.6068164", "0.60581964", "0.6046734", "0.6008144", "0.6002814", "0.59917325", "0.59780264", "0.58944756", "0.5846655", "0.5658722", "0.5639069", "0.5631751", "0.5611312", "0.55938804", "0.55938804", "0.5588...
0.70692277
1
An Observable that contains a map of the required and optional parameters specific to the route. The map supports retrieving single and multiple values from the same parameter.
get paramMap() { if (!this._paramMap) { this._paramMap = this.params.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])((p) => convertToParamMap(p))); } return this._paramMap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get paramMap() {\n if (!this._paramMap) {\n this._paramMap = this.params.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.map)(p => convertToParamMap(p)));\n }\n\n return this._paramMap;\n }", "get queryParamMap() {\n if (!this._queryParamMap) {\n this._queryParamMap = this.queryParams....
[ "0.64770603", "0.6474712", "0.6387959", "0.6387959", "0.6387959", "0.6387959", "0.6387959", "0.58450544", "0.58450544", "0.5831136", "0.5831136", "0.5730318", "0.56868947", "0.54466087", "0.540119", "0.5394406", "0.53208524", "0.53208524", "0.5310897", "0.5310897", "0.5310897...
0.64982027
1
An Observable that contains a map of the query parameters available to all routes. The map supports retrieving single and multiple values from the query parameter.
get queryParamMap() { if (!this._queryParamMap) { this._queryParamMap = this.queryParams.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])((p) => convertToParamMap(p))); } return this._queryParamMap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get queryParamMap() {\n if (!this._queryParamMap) {\n this._queryParamMap = this.queryParams.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.map)(p => convertToParamMap(p)));\n }\n\n return this._queryParamMap;\n }", "get paramMap() {\n if (!this._paramMap) {\n this._paramMap...
[ "0.7647327", "0.6657371", "0.6657371", "0.6657371", "0.6657371", "0.6657371", "0.65005016", "0.6471941", "0.6438126", "0.64201915", "0.64201915", "0.6364739", "0.62691945", "0.61948895", "0.61233824", "0.60297966", "0.60251874", "0.5981351", "0.597411", "0.59548026", "0.59170...
0.7709296
1
Matches every child outlet in the `segmentGroup` to a `Route` in the config. Returns `null` if we cannot find a match for _any_ of the children.
processChildren(config, segmentGroup) { const children = []; for (const childOutlet of Object.keys(segmentGroup.children)) { const child = segmentGroup.children[childOutlet]; // Sort the config so that routes with outlets that match the one being activated appear // f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "processChildren(config, segmentGroup) {\n const children = [];\n\n for (const childOutlet of Object.keys(segmentGroup.children)) {\n const child = segmentGroup.children[childOutlet]; // Sort the config so that routes with outlets that match the one being activated appear\n // first, followed by rou...
[ "0.6912186", "0.6551266", "0.58621526", "0.58597916", "0.5730717", "0.57050633", "0.5704747", "0.5704747", "0.5704747", "0.5704747", "0.56430775", "0.5399802", "0.5392348", "0.5392348", "0.5392348", "0.5392348", "0.5392348", "0.53789926", "0.53748304", "0.5358817", "0.5319261...
0.70219606
1
Returns `false`, meaning the route (and its subtree) is never reattached
shouldAttach(route) { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shouldAttach(route) {\n return false;\n }", "shouldAttach(route) {\n // console.log('shouldAttach', route);\n return this.storedRouteHandles.has(route.routeConfig.path);\n }", "shouldDetach(route) {\n return false;\n }", "shouldDetach(route) {\n return false;\n }", ...
[ "0.6893117", "0.67678905", "0.6520376", "0.6520376", "0.6520376", "0.6520376", "0.6520376", "0.64940256", "0.6390322", "0.6121339", "0.6099352", "0.59146583", "0.5883418", "0.5840988", "0.5811199", "0.57721096", "0.57034606", "0.57034606", "0.57034606", "0.57034606", "0.57034...
0.69805616
1
Determines if a route should be reused. This strategy returns `true` when the future route config and current route config are identical.
shouldReuseRoute(future, curr) { return future.routeConfig === curr.routeConfig; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shouldReuseRoute(future, curr) {\n return future.routeConfig === curr.routeConfig;\n }", "shouldReuseRoute(future, curr) {\n // console.log('shouldReuseRoute, future:', future, 'current:', curr);\n return future.routeConfig === curr.routeConfig;\n }", "shouldDetach(route) {\n // con...
[ "0.86519337", "0.8567323", "0.61011165", "0.6049794", "0.5943708", "0.5832383", "0.555697", "0.5542805", "0.55038714", "0.5476909", "0.5472649", "0.5472649", "0.5472649", "0.5472649", "0.5472649", "0.5468525", "0.5454482", "0.5436077", "0.5435385", "0.5404602", "0.5370077", ...
0.8667027
1
Sets up the location change listener. This listener detects navigations triggered from outside the Router (the browser back/forward buttons, for example) and schedules a corresponding Router navigation so that the correct events, guards, etc. are triggered.
setUpLocationChangeListener() { // Don't need to use Zone.wrap any more, because zone.js // already patch onPopState, so location change callback will // run into ngZone if (!this.locationSubscription) { this.locationSubscription = this.location.subscribe(event => { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setUpLocationChangeListener() {\n // Don't need to use Zone.wrap any more, because zone.js\n // already patch onPopState, so location change callback will\n // run into ngZone\n if (!this.locationSubscription) {\n this.locationSubscription = this.location.subscribe(event => {\n const source...
[ "0.74854344", "0.69726145", "0.6943575", "0.6863256", "0.67526376", "0.6510922", "0.6392667", "0.6093582", "0.5968761", "0.5897439", "0.583129", "0.581384", "0.5812868", "0.5812868", "0.5812868", "0.5812868", "0.5812868", "0.5803824", "0.5785846", "0.5775162", "0.5767714", ...
0.7751651
1
Determines whether two events triggered by the Location subscription are due to the same navigation. The location subscription can fire two events (popstate and hashchange) for a single navigation. The second one should be ignored, that is, we should not schedule another navigation in the Router.
shouldScheduleNavigation(previous, current) { if (!previous) return true; const sameDestination = current.urlTree.toString() === previous.urlTree.toString(); const eventsOccurredAtSameTime = current.transitionId === previous.transitionId; if (!eventsOccurredAtSameTime || !sam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isNavigationEvent(event) {\n return (\n event.request.mode === 'navigate' ||\n (event.request.method === 'GET' &&\n event.request.headers.get('accept').includes('text/html'))\n )\n}", "function isNavigationEvent(evt) {\n return navigationKeys.has(normalizeKey(evt));\n}", "function isNavi...
[ "0.62582666", "0.6046845", "0.6042307", "0.6011376", "0.6003697", "0.5878548", "0.5878548", "0.5878548", "0.5878548", "0.5878548", "0.5813213", "0.5813213", "0.5813213", "0.5813213", "0.5813213", "0.5813213", "0.5813213", "0.5813213", "0.5813213", "0.5813213", "0.5813213", ...
0.7534265
1
Returns the current `Navigation` object when the router is navigating, and `null` when idle.
getCurrentNavigation() { return this.currentNavigation; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getCurrentNavigation() {\n return this.currentNavigation;\n }", "get navigation() {\r\n return new Navigation(this);\r\n }", "get navigation() {\r\n return this.create(NavigationService);\r\n }", "get navigation() {\n return this._navigation;\n }", "get currentRoute() {\n ...
[ "0.7150998", "0.7014299", "0.69838", "0.6889673", "0.6302823", "0.60101974", "0.5949649", "0.5598772", "0.55379015", "0.5294982", "0.52686584", "0.5254619", "0.5240809", "0.52319276", "0.52009773", "0.52009773", "0.52009773", "0.52009773", "0.52009773", "0.5196802", "0.518844...
0.7337591
1
Creates a NaCl module wrapper that encapsulates the embed element.
function NaClModule(attrs){ this.logger = new TagLogger(); //used for logging // Used in closures var thisModule = this; // Make sure that attrs includes name, src, and id. if( _.isUndefined(attrs) || _.isUndefined(attrs.name)){ throw new Error("Could not create NaCl Module. name must...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createNaclModule(nmf_path_name, width, height) {\n var nacl_elem = document.createElement(\"embed\");\n nacl_elem.setAttribute(\"name\", \"nacl_module\");\n nacl_elem.setAttribute(\"id\", \"nacl_module\");\n nacl_elem.setAttribute(\"type\", \"application/x-nacl\");\n nacl_elem.setAttribute(\"src\", n...
[ "0.6568625", "0.5947543", "0.5931432", "0.58716726", "0.5604514", "0.556985", "0.54936177", "0.53700376", "0.5345993", "0.52261466", "0.5207165", "0.5150964", "0.51476634", "0.5140466", "0.510505", "0.50959975", "0.5088317", "0.5028283", "0.49886793", "0.49868047", "0.4937835...
0.60717285
1
BBB Generator constructor Extend Yeoman base generator Launch packages manager once the installation ends
function Generator(args, options, config) { var self = this; BBBGenerator.apply(this, arguments); InitGenerator.apply(this, arguments); // Setup destination directory if (_.isString(args[0])) { if (grunt.file.isPathAbsolute(args[0])) { grunt.file.mkdir(args[0]); this.destinationRoot(args[0]);...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "default() {\n\n // compose here with others Yeoman generator\n\n }", "function scaffoldNPM() {\n // CSS Scripts\n if (cssChoice) {\n packageJSON['scripts'][cssChoice] = packageScriptTemplates[cssChoice];\n packageJSON['scripts']['build:styles'] =\n packageScriptTemplates['build:styles'].replace(...
[ "0.6597063", "0.642756", "0.6422375", "0.61664885", "0.61553276", "0.6093107", "0.6083078", "0.6030658", "0.60238534", "0.59503025", "0.58808476", "0.58699673", "0.58575815", "0.5808312", "0.5781416", "0.56985706", "0.568687", "0.5681372", "0.5672975", "0.5664694", "0.56607",...
0.68324
0
Prints the options object sorted.
function printOptionsSorted(options, loglevel) { // eslint-disable-next-line fp/no-mutating-methods const sortedKeys = Object.keys(options).sort(); const optionsString = (0, transform_1.default)(sortedKeys, (accum, key) => { accum[key] = options[key]; }, {}); print(options, optionsString, lo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "printOptions() {\n for (let i=0;i<N;i++) {\n for (let j=0;j<N;j++) {\n if (this.state[i][j] == X) {\n document.write(\"(\" + (i+1) + \",\" + (j+1) + \") : \" + this.options[i][j] + \"<br/>\")\n }\n }\n }\n }", "function printEach(title, index) { // function to print option...
[ "0.629032", "0.6243126", "0.5836237", "0.5810233", "0.5786878", "0.5738885", "0.5670655", "0.56588745", "0.56549555", "0.5634345", "0.55507594", "0.5540217", "0.55348325", "0.548116", "0.5458151", "0.54352856", "0.5430678", "0.54161865", "0.541527", "0.5403319", "0.5377933", ...
0.77141947
0
Create a table with the appropriate columns and alignment to render dependency upgrades.
function renderDependencyTable(rows) { const table = new cli_table3_1.default({ colAligns: ['left', 'right', 'right', 'right', 'left', 'left'], chars: { top: '', 'top-mid': '', 'top-left': '', 'top-right': '', bottom: '', 'botto...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createTables() {\n let tables = [];\n for (let i = 0; i < this.NUM_TABLES; ++i) {\n tables.push((\n <div key={this.TABLE_NAMES[i] + i} className=\"col-md-12 ml-sm-auto col-lg-12 px-4\">\n <main role=\"main\" className=\"col-md-12 ml-sm-auto col-lg-12 px-4\...
[ "0.63221204", "0.6321728", "0.63203424", "0.6301302", "0.62981236", "0.6273842", "0.62649673", "0.6263369", "0.6241959", "0.6241959", "0.62275994", "0.62074184", "0.6171877", "0.61707824", "0.61707824", "0.6166182", "0.6159874", "0.6151343", "0.6148512", "0.6122883", "0.61199...
0.6868195
0
Print updates that were ignored due to incompatible peer dependencies.
function printIgnoredUpdates(options, ignoredUpdates) { print(options, `\nIgnored incompatible updates (peer dependencies):\n`); const table = renderDependencyTable(Object.entries(ignoredUpdates).map(([pkgName, { from, to, reason }]) => { const strReason = 'reason: ' + Object.entries(reason)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function logUpdateAvailable(current, latest) {\n // prettier-ignore\n var newVersionLog = \"There is a new version of \" + chalk.bold(\"sulla\") + \" \" + chalk.gray(current) + \" \\u279C \" + chalk.bold.green(latest) + \"\\n\" +\n \"Update your package by running:\\n\\n\" +\n (chalk.bold('\\>...
[ "0.649529", "0.5980875", "0.5767965", "0.5680019", "0.56648827", "0.56034577", "0.5575915", "0.5552024", "0.5533839", "0.55175996", "0.55047095", "0.53735226", "0.53478205", "0.5308128", "0.527698", "0.52747726", "0.52568585", "0.524937", "0.52384716", "0.523242", "0.5214722"...
0.79376334
0
Data Organization Functions Organizes the data from a character call and stores it in the character object
function organizeDataChar(_data){ // Pulling all the neccesary info from the data object and store in the character object // Pulling Stats -------------------------------------------------------------------------------------------- // Attributes character.stats.attributes.str = _data.sta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_prepareCharacterData(actorData) {\n const data = actorData.data;\n\n // Make modifications to data here. For example:\n data.levelUpPoints = 0;\n for (let [key, value] of Object.entries(data.stats)) {\n value[\"total\"] = value[\"value\"] + value[\"mod\"] + value[\"levelUp\"]; \n da...
[ "0.6010926", "0.6004617", "0.5948496", "0.5626723", "0.54372597", "0.5420176", "0.5386282", "0.53730255", "0.53265023", "0.5326122", "0.53134584", "0.5306532", "0.52966475", "0.52954996", "0.52895033", "0.5174223", "0.5172559", "0.51675254", "0.5158984", "0.51430756", "0.5141...
0.7323679
0
Organizes the data from an item call and stores it in the character object
function organizeItemData(_data){ // Calculate the cost in gold (it's given via the API in copper cost) let copperCost = _data.buyPrice; let goldCost = 0; // If time permits, optimize further (if copperCost > 100000, go by 100000's) while (copperCost > 0){ copperCost -= 10...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function organizeDataChar(_data){\r\r\n // Pulling all the neccesary info from the data object and store in the character object\r\r\n \r\r\n // Pulling Stats --------------------------------------------------------------------------------------------\r\r\n // Attributes\r\r\n character.stats.attrib...
[ "0.6942587", "0.60967827", "0.59061044", "0.5845132", "0.56811184", "0.56754863", "0.564428", "0.5626094", "0.5587772", "0.5523765", "0.5476318", "0.54186285", "0.5412692", "0.5410278", "0.54000366", "0.53942174", "0.53677243", "0.53597075", "0.5355122", "0.5354991", "0.53481...
0.6410516
1
Function used to calculate min and max damage The formula itself might be out of date, it's from a source from early 2016 but the best I could find online
function calcDamage(_minDps, _maxDps, _power, _weaponSpeed, _mastery){ //(weaponDPS + AttackPower/3,5 ) * weapon speed = DPS let coefficient = 1 + (_mastery * 0.01); // Calculating Upper Limit character.stats.attack.dmg_high = (_maxDps + _power/3.5) * _weaponSpeed * coefficient; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function determineDamage(range) {\n if (range <= 5) {\n return 600;\n } else if (range < 20) {\n return 600 - 450 * (range - 5) / 15;\n } else {\n return 150;\n }\n}", "function calcDamage(){\n if (flankFlag == true)\n {\n return Math.floor((cannonPB.value / 12.0) * 150);\n ...
[ "0.71011996", "0.6917287", "0.6859213", "0.66983306", "0.64766705", "0.6260632", "0.619585", "0.61945873", "0.617479", "0.61219114", "0.60943174", "0.60193336", "0.6018972", "0.6013003", "0.6002226", "0.5942946", "0.59336555", "0.5922847", "0.591992", "0.5916422", "0.5910957"...
0.730561
0
Sets the field names and ids called on $onInit. Important: use underscore scope as the last in name
function _setIDNames() { var scopeId = "_" + $scope.$id; vm.firstNameId = "certFirstName" + scopeId; vm.lastNameId = "certLastName" + scopeId; vm.salutationId = "certSalut" + scopeId; vm.jobTitleId = "certJobTitle" + scopeId; vm.dateSignedId = "cer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init(){\n $scope.company = Models.CompanyInfo();\n $scope.address = Models.Address();\n }", "function _setIdNames() {\n var scopeId = \"_\" + $scope.$id;\n }", "function init() {\n\n /* Get the labels necessary for the list not to be only numbers */\n ...
[ "0.64282614", "0.6396588", "0.6173843", "0.61422735", "0.600383", "0.59942997", "0.5987585", "0.5976662", "0.5955776", "0.5910557", "0.5886707", "0.5828158", "0.58006126", "0.5800186", "0.5790596", "0.5790169", "0.57803357", "0.5773736", "0.5757167", "0.57523084", "0.5738556"...
0.7163872
0
Attending upon first divLevel2 + HEX to RGB converter + RGB to HSL converter [alghoritm]
function colorFirstDiv() { const colorForDiv = generateRandomColor(); console.log(56, colorForDiv); // Setting BGC for third divLevel2 - for changing it const colorToChange = document.querySelector("#colorToChange"); colorToChange.style.backgroundColor = colorForDiv; // Changing first divLevel2 - below co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function liveHEXtoHSL() {\n hex = document.querySelector(\"#HEXvalue3>span\").innerHTML;\n console.log(316, hex, typeof hex);\n const arrayHSL = hexToHsl(hex);\n console.log(318, arrayHSL);\n HSLvalue3 = document.querySelector(\"#HSLvalue3\");\n HSLvalue3.innerHTML = `HSL Values: <span>${arrayHSL[0]}°, ${arr...
[ "0.6771474", "0.6768306", "0.67662126", "0.6691334", "0.6475618", "0.6468701", "0.6467906", "0.6467906", "0.64419085", "0.642771", "0.6391232", "0.63891554", "0.63725793", "0.6366059", "0.63632655", "0.6330016", "0.6325924", "0.6304889", "0.6288457", "0.6232674", "0.6227154",...
0.7858381
0
Function HEX to HSL
function hexToHsl(hex) { //HEX to RGB first let red = parseInt(hex.substring(1, 3), 16); let green = parseInt(hex.substring(3, 5), 16); let blue = parseInt(hex.substring(5, 7), 16); console.log(183, "RGB colors:", red, green, blue); //RGB to HSL let r = red / 255; let g = green / 255; let b = blue / 2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toHSL(h, l) {\n if (l==undefined) {\n l = 50;\n }\n return 'hsl('+h+', 100%, '+l+'%)';\n}", "calcHSL() {\r\n let r = this.r/255;\r\n let g = this.g/255;\r\n let b = this.b/255;\r\n let max = Math.max(r, g, b)\r\n let min = Math.min(r, g, b);\r\n ...
[ "0.77054393", "0.7695373", "0.7629249", "0.7627219", "0.7581338", "0.74134916", "0.74080664", "0.7325875", "0.7311868", "0.7302004", "0.7272704", "0.72626543", "0.7257009", "0.72404015", "0.72377557", "0.7200563", "0.71992207", "0.71992207", "0.71992207", "0.71992207", "0.718...
0.80084753
0
Converting RGB to HEX Live
function RGBtoHEX() { let Red = parseInt(document.querySelector("#rangeRed").value).toString(16); let Green = parseInt(document.querySelector("#rangeGreen").value).toString( 16 ); let Blue = parseInt(document.querySelector("#rangeBlue").value).toString(16); Red = Red.padStart(2, 0); Green = Green.padSta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rgbToHex(R,G,B) { return toHex(R)+toHex(G)+toHex(B); }", "function rgb2hex(rgb) {\n rgb = rgb.match(/^rgb\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)$/);\n $val=\"#\" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3])\n return $val.toUpperCase();\n}", "function rgb2Hex(r, g, b) \n{\n var colourHex = \"\";\n var ...
[ "0.7765601", "0.7516672", "0.74895054", "0.74692017", "0.7428967", "0.7407372", "0.7399871", "0.7394623", "0.73932666", "0.7379988", "0.7353748", "0.7352532", "0.7351632", "0.7339147", "0.7334622", "0.73318374", "0.73184425", "0.73013234", "0.7300412", "0.7281407", "0.7281153...
0.76598245
1
Converting HEX to HSL Live
function liveHEXtoHSL() { hex = document.querySelector("#HEXvalue3>span").innerHTML; console.log(316, hex, typeof hex); const arrayHSL = hexToHsl(hex); console.log(318, arrayHSL); HSLvalue3 = document.querySelector("#HSLvalue3"); HSLvalue3.innerHTML = `HSL Values: <span>${arrayHSL[0]}°, ${arrayHSL[1]}%, ${a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hexToHsl(hex) {\n //HEX to RGB first\n let red = parseInt(hex.substring(1, 3), 16);\n let green = parseInt(hex.substring(3, 5), 16);\n let blue = parseInt(hex.substring(5, 7), 16);\n console.log(183, \"RGB colors:\", red, green, blue);\n //RGB to HSL\n let r = red / 255;\n let g = green / 255;\n ...
[ "0.7608213", "0.7337471", "0.7327441", "0.71028227", "0.70352024", "0.7008213", "0.6980742", "0.6963814", "0.6933109", "0.69240195", "0.6917089", "0.6907373", "0.68982524", "0.68982524", "0.6860951", "0.6834968", "0.6833811", "0.68195987", "0.680929", "0.67971945", "0.6795422...
0.78838414
0
Displaying info about BGC of the fourth divLevel2
function infoFor4DivGray() { let grayScaleBGC = document.querySelector("#grayScaleBGC").style.backgroundColor; // console.log(348, grayScaleBGC); grayScaleBGC = grayScaleBGC.substring(4, grayScaleBGC.length - 1).split(", "); grayScaleBGC = grayScaleBGC.map((elem) => (elem = parseInt(elem))); console.log(3...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bivInfo(biv, id)\n{\n var open = biv.open ? '<h2 class=\"green\">Open!</h2>' : '<h2 class=\"red\">Closed</h2>';\n \n var gallery = '';\n for(i = 0; i < biv.images; i++)\n {\n switch(i)\n {\n case 0:\n gallery += `<div class=\"cssbox\"> <a id=\"image0\...
[ "0.5987332", "0.5779615", "0.57732075", "0.5771846", "0.574192", "0.56920505", "0.56048447", "0.5571531", "0.5512161", "0.54827887", "0.5475677", "0.54687876", "0.54424465", "0.54195553", "0.5418033", "0.5368471", "0.5361825", "0.53299683", "0.5306633", "0.52981323", "0.52936...
0.5997157
0
Setting up the HSL sliders
function setSlidersHSL() { const arrayHSL = infoFor4DivHexHSL(); console.log(384, arrayHSL); document.querySelector("#rangeHue").value = arrayHSL[0]; document.querySelector("#hueValue").innerHTML = arrayHSL[0] + "°"; document.querySelector("#rangeSaturation").value = arrayHSL[1]; document.querySelector("#sa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function slidersForHSL() {\n const div4GBC = document.querySelector(\"#grayScaleBGC\");\n const rangeHue = document.querySelector(\"#rangeHue\").value;\n const rangeSaturation = document.querySelector(\"#rangeSaturation\").value;\n const rangeLightness = document.querySelector(\"#rangeLightness\").value;\n co...
[ "0.76162755", "0.6906916", "0.68866235", "0.6690498", "0.6675831", "0.6665115", "0.6650268", "0.660385", "0.65918785", "0.63125014", "0.6294437", "0.6280914", "0.6270997", "0.62535536", "0.62263566", "0.6222362", "0.61815786", "0.61600524", "0.61522377", "0.61282647", "0.6068...
0.7898395
0
Changing the Grayscale live by HSL sliders and printing Live HSL values
function slidersForHSL() { const div4GBC = document.querySelector("#grayScaleBGC"); const rangeHue = document.querySelector("#rangeHue").value; const rangeSaturation = document.querySelector("#rangeSaturation").value; const rangeLightness = document.querySelector("#rangeLightness").value; console.log(417, ran...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setSlidersHSL() {\n const arrayHSL = infoFor4DivHexHSL();\n console.log(384, arrayHSL);\n document.querySelector(\"#rangeHue\").value = arrayHSL[0];\n document.querySelector(\"#hueValue\").innerHTML = arrayHSL[0] + \"°\";\n document.querySelector(\"#rangeSaturation\").value = arrayHSL[1];\n document...
[ "0.7279177", "0.6676496", "0.64462596", "0.626259", "0.622441", "0.6186108", "0.6184633", "0.6173094", "0.6148031", "0.6146069", "0.61420345", "0.61195344", "0.6109131", "0.6108828", "0.607919", "0.60497916", "0.60492647", "0.6039832", "0.60278714", "0.6021504", "0.6020967", ...
0.76948196
0
Displaying Live RGB + HEX values
function liveRGBandHEXvalues() { let div4GBC = document.querySelector("#grayScaleBGC").style.backgroundColor; console.log(431, div4GBC, typeof div4GBC); div4GBC = div4GBC.substring(4, div4GBC.length - 1).split(", "); console.log(433, div4GBC); div4GBC = div4GBC.map((elem) => (elem = parseInt(elem))); consol...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayHex() {\n document.getElementById('hex').textContent = fullColorHex(r, g, b);\n}", "function setRGBDisplay() {\r\n redDisplay.textContent = redCorrect;\r\n greenDisplay.textContent = greenCorrect;\r\n blueDisplay.textContent = blueCorrect;\r\n}", "function showOutput() {\n const colo...
[ "0.75202966", "0.7365219", "0.7294955", "0.72462964", "0.71849865", "0.70062625", "0.700209", "0.69350713", "0.6821889", "0.681361", "0.67350954", "0.6709581", "0.66865", "0.6676385", "0.6602036", "0.659094", "0.65606356", "0.65456253", "0.6476579", "0.6464463", "0.64343387",...
0.75299484
0
RGB to CMYK conversion third divLevel2
function RGBtoCMYKthirdDiv() { arrayRGB = []; colorsRGB = document.querySelector("#colorToChange").style.backgroundColor; // console.log(496, colorsRGB); colorsRGB = colorsRGB.substring(4, colorsRGB.length - 1).split(", "); arrayRGB = colorsRGB.map((elem) => parseInt(elem)); // console.log(499, colorsRGB); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RGBtoCMYK() {\n RGBtoCMYKthirdDiv();\n RGBtoCMYKfourthDiv();\n}", "function RGBtoCMYKfourthDiv() {\n arrayRGB = [];\n colorsRGB = document.querySelector(\"#grayScaleBGC\").style.backgroundColor;\n // console.log(510, colorsRGB);\n colorsRGB = colorsRGB.substring(4, colorsRGB.length - 1).split(\", ...
[ "0.82630676", "0.7542321", "0.7189563", "0.71625733", "0.7093117", "0.68378705", "0.64746016", "0.6360319", "0.5984142", "0.5882414", "0.58677244", "0.58615375", "0.5857445", "0.58505565", "0.58505565", "0.5824224", "0.58203274", "0.5804814", "0.5804814", "0.58021295", "0.579...
0.7644718
1
RGB to CMYK conversion fourth divLevel2
function RGBtoCMYKfourthDiv() { arrayRGB = []; colorsRGB = document.querySelector("#grayScaleBGC").style.backgroundColor; // console.log(510, colorsRGB); colorsRGB = colorsRGB.substring(4, colorsRGB.length - 1).split(", "); arrayRGB = colorsRGB.map((elem) => parseInt(elem)); // console.log(513, colorsRGB); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RGBtoCMYK() {\n RGBtoCMYKthirdDiv();\n RGBtoCMYKfourthDiv();\n}", "function RGBtoCMYKthirdDiv() {\n arrayRGB = [];\n colorsRGB = document.querySelector(\"#colorToChange\").style.backgroundColor;\n // console.log(496, colorsRGB);\n colorsRGB = colorsRGB.substring(4, colorsRGB.length - 1).split(\", ...
[ "0.8264539", "0.75239176", "0.7100676", "0.70824873", "0.6949087", "0.6665844", "0.64641804", "0.63633734", "0.6156491", "0.61072713", "0.5972717", "0.5972717", "0.5931159", "0.5902894", "0.5896112", "0.589157", "0.589157", "0.589157", "0.58749104", "0.587396", "0.58647335", ...
0.7710188
1
RGB to CMYK conversion connecting functins into one function
function RGBtoCMYK() { RGBtoCMYKthirdDiv(); RGBtoCMYKfourthDiv(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rgbToCmyk (r,g,b) {\n\tvar C = 0;\n\tvar M = 0;\n\tvar Y = 0;\n\tvar K = 0;\n\t// BLACK\n\tif (r==0 && g==0 && b==0) {K = 1;return [0,0,0,1];}\n\tC = 1 - (r/255);\n\tM = 1 - (g/255);\n\tY = 1 - (b/255);\n\tvar minCMY = Math.min(C,M,Y);\n\tC = Math.round(100 * (C - minCMY) / (1 - minCMY)) ;\n\tM = Math.rou...
[ "0.73060083", "0.71888083", "0.71564406", "0.7102872", "0.6907857", "0.64240676", "0.64066464", "0.63228595", "0.629914", "0.6046065", "0.60186833", "0.5853395", "0.5846477", "0.58369046", "0.58247596", "0.5805411", "0.57843983", "0.5774628", "0.577286", "0.5739817", "0.57270...
0.7996809
0
checks if should either show the no books component if the user has no books checked out, or all bookshelves if they have at least one. If there are books, it divides them up by their "shelf" attribute
shouldDisplayBookshelves() { let jsx = ''; if (this.state.books.length === 0) { jsx = <NoBooks />; } else { const bookTypes = { currentlyReading: { title: 'Currently Reading', books: [], }, wantToRead: { title: 'Want to Read', books...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n //console.log(this.state.books);\n\t\treturn (\n\t\t\t<div className=\"list-books\"> \n <div className=\"list-books-title\">\n <h1>MyReads</h1>\n </div>\n \n <div className=\"list-books-content\">\n \n {\n ...
[ "0.67286956", "0.66541016", "0.662908", "0.65366876", "0.65329736", "0.65159875", "0.6451095", "0.6438183", "0.64362854", "0.63736755", "0.63403225", "0.63381237", "0.6333311", "0.6325064", "0.6270003", "0.61846584", "0.6101058", "0.60818857", "0.60657847", "0.6057512", "0.60...
0.6679692
1
Fetches the launch list from LaunchLibrary and returns it. Depends on state of variable launchOptions.
function fetchLaunches(callback) { return https.get(launchOptions, (response) => { var body = ''; response.on('data', (d) => { body += d; }); response.on('end', () => { callback(JSON.parse(body)); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function launcheroneLaunch()\n{\n var launcherRequest = new XMLHttpRequest();\n launcherRequest.open(\"get\",\"https://launchlibrary.net/1.4/launch?name=launcherone&next=5\");\n launcherRequest.send(null);\n launcherRequest.onreadystatechange = launcherFunction;\n\n function launcherFunction()\n ...
[ "0.53934187", "0.51634055", "0.5027846", "0.4940021", "0.48859212", "0.48310667", "0.47817728", "0.47342113", "0.47291666", "0.46981558", "0.46800813", "0.46798676", "0.4661576", "0.46074566", "0.45790383", "0.4570593", "0.4568254", "0.4536333", "0.4531114", "0.45141384", "0....
0.62886876
0
TO DO How do we want to define isCompleted? Do we want to give users the ability to select this as part of a Map config? / eslintdisable nounusedvars
isCompleted(mapLocationObject) { const { document: ml } = mapLocationObject; // return ml.entities.length > 0 || ml.query !== ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get isCompleted() { return this.result.isDefined }", "get isComplete() {\n return self.step.isComplete(self.annotations)\n }", "function setCompleted(id) {\n\n \n setToDoArr((todos) => {\n\n // map over the todos and get each value\n return todos.map(function (todo) {\n\n // if i...
[ "0.58299315", "0.55563915", "0.5495331", "0.53968483", "0.5396581", "0.53773993", "0.52937925", "0.5290529", "0.527673", "0.52683204", "0.5253191", "0.5231502", "0.5227227", "0.52140427", "0.51744163", "0.51733", "0.5170803", "0.5164136", "0.51621467", "0.5160418", "0.514894"...
0.61893725
0
funcion generadora de la fecha
function date_now(){ var fecha = new Date(); var hora = fecha.getHours(); var minutos = fecha.getMinutes(); var segundos = fecha.getSeconds(); var dia = fecha.getDate(); var mes = fecha.getMonth(); var anio = fecha.getFullYear(); var fecha_final = (round_num(segundos,min...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FormtatoFechas(fecha){\n var today = new Date(fecha); \n var dd = today.getDate(); \n var mm = today.getMonth() + 1; \n var yyyy = today.getFullYear(); \n var HH = today.getHours();\n var mi = today.getMinutes();\n\n if (dd < 10) { \n dd = '0' + dd; \n }\n if (mm < 10) { ...
[ "0.6890122", "0.68281525", "0.6813849", "0.6805323", "0.66917056", "0.66787803", "0.66452366", "0.66258764", "0.658297", "0.6579822", "0.65393585", "0.6517915", "0.6515964", "0.6512495", "0.6491752", "0.6488173", "0.6477417", "0.64766294", "0.64754224", "0.64732003", "0.64654...
0.6843348
1
Reset all preferences to defaults.
function resetValues() { setValues( Defaults ); preferences.save(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetValues () {\n Preferences.set('visualCascade', false);\n Preferences.set('browsers', Preferences.defaults.browsers);\n\n init();\n }", "static reset() {\n Preferences.preferenceCache = {};\n switch (RoKA.Utilities.getCurrentBrowser()) {\n case Browser....
[ "0.79319406", "0.74756217", "0.74756217", "0.74030083", "0.72932583", "0.7207503", "0.6892494", "0.6884568", "0.6808538", "0.68053794", "0.6799094", "0.6757548", "0.67553455", "0.67093366", "0.6608572", "0.6574333", "0.6565292", "0.65318644", "0.65318644", "0.6512375", "0.644...
0.81526023
0
Check checkboxes according to valuess in array.
function setCheckboxesFromArray( name, valueArray ) { // Walk through each checkbox in dialog with supplied name. $dialog.find( 'input[ name="' + name + '[]" ]' ).each( function( index, element ) { var $this = $( element ); // Make checkbox checked if its value is in array. $this.prop( 'checked', value...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_the_boxes(main_check_box, check_box_array)\n {\n\n $(main_check_box).change(function()\n {\n if ($(main_check_box).is(\":checked\"))\n {\n for (i=0; i < check_box_array.length; i++)\n {\n ...
[ "0.68818045", "0.6853632", "0.67812407", "0.6736742", "0.6702523", "0.6672596", "0.66336066", "0.6530496", "0.6426928", "0.6426255", "0.6416224", "0.6396636", "0.6393565", "0.6363539", "0.6351687", "0.6346727", "0.6302825", "0.629765", "0.6290724", "0.6255273", "0.6220846", ...
0.7085908
0
Provide additional admin edit form setup
static setup(block, data) { var aef = new _fpa_admin.user_access_controls.admin_edit_form(block, data) aef.setup_selectors() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _edit() {\n $('name').value = this.name;\n $('key').value = this.key;\n $('action').value = this.action;\n switchToView('edit-form');\n}", "function update_entity_edit() {\n var form_record = Domain.entities[current_entity];\n Forms.init(form_record);\n update_edit_form_display();\n...
[ "0.6606571", "0.6326027", "0.6314073", "0.6236262", "0.61070865", "0.6091848", "0.60307556", "0.6008152", "0.5997481", "0.59847975", "0.5957024", "0.5956467", "0.5943382", "0.59128183", "0.59053224", "0.5903688", "0.5901658", "0.590138", "0.5886983", "0.58773667", "0.58555526...
0.6427671
1
Binds to window.onerror. This can only happen once. Subsequent calls won't do anything.
function bindWindow() { if (windowHandler === null) { windowHandler = (msg, url, lineNo, columnNo, error) => { hijackLog('error')([ msg, url, lineNo, columnNo, error ]); return false; }; window.onerror = windowHandler; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function attachErrorHandlerIfApplicable() {\n if (window.onerror !== exceptionHandler) {\n previousErrorHandler = window.onerror;\n window.onerror = exceptionHandler;\n }\n }", "onerror(err) {\n debug(\"error\", err);\n this.emitReserved(\"error\", err);\n }", "onerror(err) {\...
[ "0.72593635", "0.7242358", "0.72359526", "0.71886724", "0.71252054", "0.7119625", "0.7118917", "0.6978603", "0.6978603", "0.6940947", "0.6936171", "0.691047", "0.68799865", "0.6670643", "0.6670643", "0.66619897", "0.66579217", "0.66209996", "0.6606427", "0.6606427", "0.645834...
0.7439355
0
Add a review: Change color of the elements according to user input onmouseover or onclick If event is onclick, set user choice in local storage. If onclick event is for a star rating, enable the button
function addColorToRating(ratingType, rating, maxRating, elementIdPrefix, addClass, isOnClick=false) { if (isOnClick == true) { localStorage.setItem(ratingType, rating); console.log("addColorToRating local storage: " + localStorage.getItem(ratingType)); // Enable post button if user has made a star rating...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setRating(rating) {\n $('.rating-button').removeClass(ICON_CLICKED);\n $('.rating-reasons').hide();\n $('#submit-instance').show();\n $('#comment-container').show();\n\n localStorage.setItem(\"instance-rating\", rating);\n\n if (rating == BAD_QUALITY) {\n $('#bad-reasons').show();...
[ "0.68619895", "0.64981616", "0.6460982", "0.64192265", "0.63761425", "0.6361946", "0.6353265", "0.6296067", "0.62669694", "0.6257852", "0.6251701", "0.621383", "0.62066644", "0.61900777", "0.61848605", "0.61012155", "0.6095385", "0.6093381", "0.60323954", "0.5973846", "0.5970...
0.7328562
0
check if user previously made a review that has not yet been submitted. Output ratings and text, if applicable. If an anonymous user has just signed in, open pop up automatically
function displaySavedRatings() { // Check if newly redirected from auth.js. Open pop up by default console.log("displaySavedRatings() called"); var redirectAfterSignIn = localStorage.getItem("redirectAfterSignIn"); console.log("redirectAfterSignIn", redirectAfterSignIn); if (redirectAfterSignIn == "businessde...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reviewButtonDisplay() {\n // Check user type\n console.log(\"isBusinessOwner()\", isBusinessOwner);\n if (isBusinessOwner == \"true\") {\n console.log(\"is a business owner\");\n hideElement(\"review-button\");\n } else {\n // Set saved ratings for the pop up and click open if it is a user \n...
[ "0.6715098", "0.66862816", "0.64601165", "0.6146818", "0.6126283", "0.6126283", "0.59506947", "0.59445584", "0.59406227", "0.58816195", "0.5704763", "0.56190795", "0.55882657", "0.55401534", "0.5514685", "0.54853225", "0.5470075", "0.5462244", "0.5460696", "0.5452759", "0.544...
0.6714571
1
Add a review: Anonymous user that attempts to post is redirect to login, then redirected back. Community member can new review to firestore, then refresh the page to see changes. Have already stored starRating (15) and priceRating (null, 1, 2, or 3) in local storage.
function newReview() { console.log("newReview()"); // Check user type var isBusinessOwner = localStorage.getItem("isBusinessOwner"); // Grab text value var reviewText = getElementValue("bd-review-comment"); if (isBusinessOwner == null) { // Anonymous user must sign in first. Will be redirect to same busines...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addReview(store) {\n db.collection(\"Stores\").doc(store).collection(\"Reviews\").doc(firebase.auth().currentUser.displayName).set({\n id: firebase.auth().currentUser.displayName,\n Reviewer_Name: firebase.auth().currentUser.displayName,\n Reviewer_Email: firebase.auth(...
[ "0.7343941", "0.7318246", "0.6927062", "0.6855868", "0.67288876", "0.6724482", "0.668575", "0.66365576", "0.6600985", "0.65782434", "0.6574886", "0.6563529", "0.65245515", "0.6502216", "0.65011567", "0.6488686", "0.6480582", "0.6465573", "0.645907", "0.6428935", "0.6408558", ...
0.77331066
0
Update sumStarRatings, numStarRatings, sumPriceRatings, sumPriceRatings if user adds a new review for the first time or again
function addOrReplaceSummaryRatings(starRating, priceRating, sumStarRatings, numStarRatings, sumPriceRatings, numPriceRatings, oldStarRating=false, oldPriceRating=false) { if (oldStarRating) { sumStarRatings -= oldStarRating; sumStarRatings += starRating; } else { sumStarRatings += starRating; numSt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "saveRating(rating) {\n if (this.obj.rating.hasOwnProperty(\"local\")) {\n // existing rating modified\n this.obj.rating.sum -= this.obj.rating.local;\n this.obj.rating.sum += rating;\n this.obj.rating.local = rating;\n } else {\n // new rating added\n this.obj.rating.sum += rati...
[ "0.70099884", "0.6841429", "0.68106693", "0.67049056", "0.6567034", "0.64657545", "0.64609146", "0.6421348", "0.63263905", "0.62526447", "0.6249646", "0.62479895", "0.6204301", "0.61943656", "0.6163058", "0.6150428", "0.6124017", "0.6122221", "0.60572875", "0.6044885", "0.604...
0.73193365
0
Update sumStarRatings, numStarRatings, sumPriceRatings, sumPriceRatings if user deletes review
function subtractSummaryRatings(oldStarRating, oldPriceRating, sumStarRatings, numStarRatings, sumPriceRatings, numPriceRatings) { console.log("subtractSummaryRatings: ", oldStarRating, oldPriceRating, sumStarRatings, numStarRatings, sumPriceRatings, numPriceRatings); sumStarRatings -= oldStarRating; numStarRatin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addOrReplaceSummaryRatings(starRating, priceRating, sumStarRatings, numStarRatings, sumPriceRatings, numPriceRatings, oldStarRating=false, oldPriceRating=false) {\n if (oldStarRating) {\n sumStarRatings -= oldStarRating;\n sumStarRatings += starRating;\n } else {\n sumStarRatings += starRating;...
[ "0.6660596", "0.6487385", "0.6387382", "0.6348063", "0.6312236", "0.6265434", "0.62634706", "0.6096394", "0.6054207", "0.604658", "0.5936673", "0.5893432", "0.5892323", "0.5887242", "0.5799792", "0.5790781", "0.57749987", "0.57534933", "0.5718344", "0.56993824", "0.5697404", ...
0.69433033
0
Create a new document in collection 'reviews'
function createReviewDocument(uid, starRating, priceRating, reviewText, update=false) { var map; if (!update) { setMap = { starRating: starRating, priceRating: priceRating, reviewText: reviewText, timestamp: firebase.firestore.FieldValue.serverTimestamp(), numLikes: 0, usersL...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createReview(req, res, next) {\n reviewService\n .save(req.body)\n .then((result) => {\n res.status(200).json(result);\n })\n .catch((err) => {\n next(err);\n });\n }", "static async addReview(restaurant, user, review, date){\n\n try{\n const ...
[ "0.7169021", "0.70917815", "0.7050724", "0.6912842", "0.6883962", "0.6801781", "0.6753835", "0.67308766", "0.6599064", "0.6555741", "0.6420956", "0.64183915", "0.6391643", "0.6380424", "0.6350302", "0.6319353", "0.6261804", "0.61720395", "0.61457074", "0.61280614", "0.6101693...
0.7117056
1
If the user is a business owner, hide 'Add a review' button. Otherwise, display button and check if there is any saved ratings info
function reviewButtonDisplay() { // Check user type console.log("isBusinessOwner()", isBusinessOwner); if (isBusinessOwner == "true") { console.log("is a business owner"); hideElement("review-button"); } else { // Set saved ratings for the pop up and click open if it is a user // returning dire...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reviewButton() {\n let reviewId = false;\n if (this.props.currentUser) {\n Object.keys(this.props.reviews).forEach(el => {\n if (this.props.reviews[el].user_id === this.props.currentUser.id) {\n reviewId = true\n }\n });\n }\n if (this.props.currentUser && reviewId) {\n...
[ "0.6666183", "0.6290751", "0.6202902", "0.6085621", "0.60806644", "0.60662395", "0.58713436", "0.5826562", "0.5826562", "0.5786219", "0.57032925", "0.5639057", "0.5624929", "0.56241053", "0.56212634", "0.56117177", "0.5589244", "0.55878013", "0.55682385", "0.5563569", "0.5549...
0.85153
0
Create a review element
function createReviewElement(docId, userName, userBlobKey, starRating, priceRating, reviewText, formattedDate, numLikes, numDislikes) { console.log("createReviewElement() called"); // Returns content containing correctly filled stars var starElements = starFillContent(starRating); // Return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addReview(yourName, yourRating, yourReview) {\n var yourReviewDetails = {\n name: yourName,\n rating: yourRating,\n review: yourReview,\n };\n var reviewsDiv = $('#reviews');\n var yourReviewHTML = '';\n yourReviewHTML += `<div class=\"restaurant-reviews\">\n ...
[ "0.695703", "0.68534434", "0.6804865", "0.6734499", "0.6732943", "0.6712778", "0.66991186", "0.66013736", "0.6567268", "0.6447546", "0.6425289", "0.63582623", "0.634263", "0.63289094", "0.6258432", "0.62339056", "0.62314343", "0.6220746", "0.6218373", "0.6208228", "0.62020564...
0.7090354
0
Returns content containing correctly filled stars
function starFillContent(starRating) { var content = ""; var starIndex; for (starIndex = 0; starIndex < starRating; starIndex++) { content += `<span class="fa fa-star fa-lg"></span>`; } while (starIndex < 5) { content += `<span class="fa fa-star-o fa-lg"></span>`; starIndex += 1; } return cont...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showStars(rows) {\n star = \"$\";\n for (let row = 1; row <= rows; row++) {\n let pattern = \"\";\n for (let i = 1; i < row; i++) {\n pattern += star;\n }\n console.log(pattern);\n }\n}", "function showStars(rows) {\n\n for(let row=1; row<=rows; row++) {\n let pattern = '';\n\...
[ "0.6833113", "0.67944086", "0.67488277", "0.6704479", "0.66799796", "0.6602793", "0.6595096", "0.65449154", "0.65442324", "0.6536805", "0.65194666", "0.65034723", "0.64974856", "0.64916027", "0.6484788", "0.6466399", "0.6444543", "0.64430696", "0.63866305", "0.63457084", "0.6...
0.78314656
0
Returns content containing number of visible and nonvisible $ signs
function priceContent(priceRating) { var content = ""; var priceIndex; for (priceIndex = 0; priceIndex < priceRating; priceIndex++) { content += `<span>$</span>`; } while (priceIndex < 3) { content += `<span class="visibility-hidden">$</span>`; priceIndex += 1; } return content; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cardValueCount(card) {\n // Trying to decide between hiding 1x. I think I want it.\n return `${card.Value}x&nbsp;`;\n}", "function writeFilterStatus() {\n\t\tvar num_visible = $('.restaurant').filter(':visible').length;\n\t\tvar num_hidden = $('.restaurant').not(':visible').length;\n\n\t\tvar status_e...
[ "0.62542856", "0.5622586", "0.5602464", "0.5573662", "0.5512982", "0.5344509", "0.5341298", "0.52461255", "0.5242193", "0.5222946", "0.5219456", "0.52162963", "0.51834595", "0.51711637", "0.51205426", "0.5107854", "0.5086803", "0.50757813", "0.5073797", "0.50722736", "0.50673...
0.5975125
1
When a user deletes their review, remove uid from usersReviewed array in 'business' collection, update summary ratings, and delete their document in the 'reviews' collection
function deleteReview(userReviewedId) { console.log("deleteReview() called ", userReviewedId); // Hide review div on front end hideElement(userReviewedId); addTextToDom("No reviews yet", "review-summary"); addTextToDom("N/A", "bd-price"); // $("#bd-price").innerHTML = "N/A"; resetSummaryStars(); // Quer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteReview(req, res) {\n //Check if the id is valid and exists in db\n \n //If they provided a query which does not include any of the required fields\n if (req.query.id){\n\n Reviews.findOne({\"_id\": req.query.id},\n\n function(err, result) {\n if (err) throw...
[ "0.6861175", "0.6717935", "0.6689541", "0.6362979", "0.6316255", "0.622514", "0.619751", "0.6171025", "0.61405617", "0.6038184", "0.603027", "0.59328926", "0.5905631", "0.58931786", "0.58803904", "0.5870365", "0.58686894", "0.5861215", "0.57795763", "0.57578677", "0.5726598",...
0.83531857
0
User likes a review. Add checks for if user has already liked review or has disliked previously.
function handleLikeOrDislike(uid, isLike) { console.log("handleLikeOrDislike() is called"); var handleLikeReq = (doc) => { if (doc.exists) { var usersLiked = doc.data().usersLiked; var usersDisliked = doc.data().usersDisliked; var numLikes = doc.data().numLikes; var numDislikes = doc.dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function like(uid, numLikes, usersLiked) {\n console.log(\"like() called\");\n // Users newly likes this review.\n // Add highlight to thumbs up\n $(\"#like-\" + uid).addClass(\"primary-dark-color\");\n // Increment number of likes. Add to DOM\n var incrementNumLikes = numLikes + 1;\n addTextToDom(increment...
[ "0.73444897", "0.68510205", "0.6826694", "0.6673301", "0.6628714", "0.6381935", "0.63562626", "0.6323594", "0.6308351", "0.62932485", "0.5987617", "0.5967405", "0.5953082", "0.5944653", "0.59274995", "0.5919951", "0.5912214", "0.59035313", "0.5894021", "0.58530754", "0.575984...
0.7060127
1
Remove a like from the review
function removeLike(uid, numLikes, usersLiked) { console.log("removeLike() called"); // Users removes likes this review. // Add highlight to thumbs up $("#like-" + uid).removeClass("primary-dark-color"); // Increment number of likes. Add to DOM var decrementNumLikes = numLikes - 1; addTextToDom(decrement...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dislike() {\n LikeService.delete(vm.user.username, $stateParams.id, vm.currentUser._id)\n .then(() => {\n // remove like from local array\n vm.likes.splice(vm.likes.findIndex(x => x._id == vm.currentUser._id), 1);\n\n vm.isLiked = false;\n ...
[ "0.7013794", "0.690183", "0.681135", "0.6808097", "0.6681348", "0.6566191", "0.63642365", "0.6361497", "0.6293712", "0.6229044", "0.62154603", "0.6207527", "0.61231977", "0.60972345", "0.6076624", "0.5988863", "0.5968205", "0.59652334", "0.5952063", "0.59354407", "0.59224397"...
0.70338845
0
Add a dislike to the review
function dislike(uid, numDislikes, usersDisliked) { console.log("usersDisliked: ", usersDisliked); console.log("dislike() called"); // Add highlight to thumbs down $("#dislike-" + uid).addClass("primary-dark-color"); console.log("Class list", document.getElementById("dislike-" + uid).classList.item(0)); // ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeDislike(uid, numDislikes, usersDisliked) {\n console.log(\"removeDislike() called\");\n // Add highlight to thumbs down\n $(\"#dislike-\" + uid).removeClass(\"primary-dark-color\");\n // Increment number of likes. Add to DOM\n var decrementNumDislikes = numDislikes - 1;\n addTextToDom(decrem...
[ "0.7114107", "0.6973341", "0.6433256", "0.628848", "0.6043166", "0.6027166", "0.59299433", "0.58499134", "0.5809708", "0.57874113", "0.5762495", "0.5736263", "0.5721887", "0.56800467", "0.56731665", "0.5665337", "0.5653299", "0.5649358", "0.56265444", "0.56247765", "0.5621372...
0.7160422
0
Remove a dislike from the review
function removeDislike(uid, numDislikes, usersDisliked) { console.log("removeDislike() called"); // Add highlight to thumbs down $("#dislike-" + uid).removeClass("primary-dark-color"); // Increment number of likes. Add to DOM var decrementNumDislikes = numDislikes - 1; addTextToDom(decrementNumDislikes.to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dislike() {\n LikeService.delete(vm.user.username, $stateParams.id, vm.currentUser._id)\n .then(() => {\n // remove like from local array\n vm.likes.splice(vm.likes.findIndex(x => x._id == vm.currentUser._id), 1);\n\n vm.isLiked = false;\n ...
[ "0.74948525", "0.6482686", "0.6469743", "0.6347454", "0.6279132", "0.62586963", "0.62580174", "0.6233963", "0.6222244", "0.6142376", "0.6135643", "0.604625", "0.60442626", "0.60027117", "0.59946924", "0.5991679", "0.59677815", "0.5931715", "0.59015197", "0.58921367", "0.58531...
0.7568554
0
Display review summary: Display the average star ratings and number of users who left a review
function displayStarReviewSummary(avgStarRatings, numStarRatings) { // If no reviews, keep default text "No reviews yet" if (numStarRatings == 0) { return; } else { // Otherwise, add star review summary to DOM, hide default text, display // Add star review summary to DOM addTextToDom(RoundDecimals(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateAverage(reviews) {\n if (reviews.length === 0) {\n return 0;\n }\n var sum = 0;\n reviews.forEach(function (element) {\n sum += element.rating;\n });\n return sum / reviews.length;\n}", "DisplayReview(review) {\n\t\tvar box = div('','review_box');\n\t\t\n\t\t\tva...
[ "0.69444984", "0.6750346", "0.6702459", "0.6607635", "0.65543926", "0.64161354", "0.64070636", "0.6375712", "0.6367456", "0.62831664", "0.6283137", "0.6278645", "0.6274809", "0.62095577", "0.6207876", "0.61774325", "0.61770874", "0.61651343", "0.6157838", "0.6145254", "0.6135...
0.7277227
0
Display review summary: If no reviews yet, default price display is N/A. Otherwise, calculate correct price rating $, $$, or $$$
function calculatePrice(avgPriceRatings, numPriceRatings) { // Default display is N/A if no price reviews have been made if (numPriceRatings != 0) { if ((1 <= avgPriceRatings) && (avgPriceRatings < 1.5)) { displayPrice("$"); } else if ((1.5 <= avgPriceRatings) && (avgPriceRatings < 2.5)) { displ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayStarReviewSummary(avgStarRatings, numStarRatings) {\n // If no reviews, keep default text \"No reviews yet\"\n if (numStarRatings == 0) {\n return;\n } else { // Otherwise, add star review summary to DOM, hide default text, display \n // Add star review summary to DOM\n addTextToDom(R...
[ "0.6837077", "0.6206963", "0.6189594", "0.6093468", "0.608124", "0.5876729", "0.58730686", "0.5827708", "0.5817809", "0.57463664", "0.5728869", "0.564517", "0.5634876", "0.5616604", "0.55988926", "0.55980706", "0.5597812", "0.55916816", "0.5590293", "0.55617464", "0.5558989",...
0.68045384
1
Our team: Iterate through each teamBlobKey. Create an image element containing their avatar
function iterateAndDisplayTeamInfo(teamBlobKeyList, teamNameList, teamPositionList, teamBioList) { var length = teamBlobKeyList.length; var teamMember; for (teamMember = 0; teamMember < length; teamMember++) { // Add avatar image blob key to the page createImageElement(teamMember, teamBlobKeyList[teamMemb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createImageElement(teamMember, teamBlobKey, teamName, teamPosition, teamBio) {\n // Create an img tag with an onclick function storing the team member's name, position, bio\n var formattedTeamName = escapeSpecialCharacters(teamName);\n var formattedTeamPosition = escapeSpecialCharacters(teamPosition);\...
[ "0.737765", "0.6163194", "0.59939396", "0.59599215", "0.58596843", "0.58162725", "0.5754579", "0.57488495", "0.5704309", "0.56615406", "0.5640994", "0.55987966", "0.5590804", "0.5524651", "0.54665685", "0.5463323", "0.5432292", "0.54259497", "0.54135257", "0.540919", "0.53972...
0.79289234
0
Our team: Return an image element with an onclick function passing in team name, position, & bio parameters. Generate unique ids to access during onclick event
function createImageElement(teamMember, teamBlobKey, teamName, teamPosition, teamBio) { // Create an img tag with an onclick function storing the team member's name, position, bio var formattedTeamName = escapeSpecialCharacters(teamName); var formattedTeamPosition = escapeSpecialCharacters(teamPosition); var fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unlockedSpecies(){\n //Populate gremlin image link\n var link = document.createElement('a');\n link.setAttribute(\"onClick\", 'setTransformSpecies(\"gremlin\",\"../images/little-goblin.png\",\"gremlin-image\");')\n\n var elem = document.createElement(\"img\");\n elem.src = \"../images/littl...
[ "0.649032", "0.6483606", "0.6325733", "0.6264737", "0.62040216", "0.61304855", "0.61082137", "0.60993254", "0.60950357", "0.6072377", "0.606842", "0.60205", "0.6004445", "0.5990636", "0.59739685", "0.5956339", "0.59539795", "0.5938152", "0.59075403", "0.59030205", "0.5892296"...
0.7408353
0
Our team: Onclick function unhighlights all team member avatars and highlight the team member of interest. Swap the existing teamName, teamPosition, and teamBio
function highlightAndDisplayTeamMemberInfo(clicked_id, formattedTeamName, formattedTeamPosition, formattedTeamBio) { console.log("called highlightAndDisplayTeamMemberInfo()"); $(".bd-avatar").removeClass("bd-team-highlight"); $("#" + clicked_id).addClass("bd-team-highlight"); addTextToDom(f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function teamClicked(e)\n{\n if(e.target.id.indexOf(\"red\") > -1)\n teamIndexes[0] = e.target.id.substring(\"red\".length) - 0 - 1;\n \n else\n teamIndexes[1] = e.target.id.substring(\"blue\".length) - 0 - 1;\n \n updateDom();\n}", "function markNoActiveTeam() {\n activeTeam = 0;\n...
[ "0.6221985", "0.60599273", "0.6049371", "0.58377093", "0.58303875", "0.57977605", "0.57959265", "0.5676486", "0.55829954", "0.5572894", "0.5566354", "0.5473777", "0.5473391", "0.5460857", "0.54561186", "0.5452841", "0.5447818", "0.54267234", "0.5411466", "0.5366971", "0.53659...
0.7605713
0
Safety info: Iterate through safety information and determine whether to display service "offered" or "not offered" visuals for each list element
function displaySafetyInfoImages(safetyInfoList) { // Determine maskBlobKey image and text to serve var isMask = safetyInfoList[0]; var maskBlobKey; var maskText; var maskTextId = "bd-mask-text"; if (isMask) { // Set to "offered" color and text maskBlobKey = blob.MASK; maskText = "Mask required up...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "displayPrice() {\n this.updatePrice();\n var tmp_show_price = false;\n for (let option_item of this.check_option_list) {\n if (option_item) {\n tmp_show_price = true;\n break;\n }\n }\n this.show_price = tmp_show_price;\n }",...
[ "0.57207316", "0.56466347", "0.55053097", "0.5501937", "0.5482057", "0.5457965", "0.5434944", "0.5416243", "0.54027444", "0.5373866", "0.5369144", "0.53453887", "0.5305892", "0.52846384", "0.5284566", "0.5278349", "0.5247863", "0.52166903", "0.5203743", "0.51837987", "0.51825...
0.6199819
0
Open Hours: Iterate through each day of the weeks' open hours and add to DOM. Check current day and highlight that day's hours on the page. Add "Open" or "Closed" closed status to Quick Info section
function displayAndHighlightOpenHours(openHoursByDay) { // Initialize a list of ids to get the elements for displaying each day var dayIdList = ["bd-sun-hrs", "bd-mon-hrs", "bd-tues-hrs", "bd-wed-hrs", "bd-thur-hrs", "bd-fri-hrs", "bd-sat-hrs"]; // Display hours for each week and add to DOM var dayOfWeek...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openingTimesWeekday(day, openingHours) {\n const checkIfToday = day === getWeekday() ? 'has-text-weight-semibold' : '';\n return `\n <div class=\"columns is-mobile\" day=\"${day}\">\n <div class=\"column is-one-quarter-fullhd is-one-third-desktop is-one-quarter-tablet\">\n ...
[ "0.6668179", "0.6576766", "0.6444092", "0.63590443", "0.62835073", "0.6194511", "0.6188447", "0.61074984", "0.5884406", "0.58658135", "0.5859092", "0.5820385", "0.57528055", "0.5744852", "0.57431036", "0.57414335", "0.571601", "0.5698395", "0.5694272", "0.56514245", "0.564849...
0.8116641
0
Open or Closed: Returns "Open" or "Closed" in the Quick Info section depending on whether current hour and minute is within the business open hours range
function openOrClosed(today, openHoursToday) { // Set return values var closed = "Closed"; var open = "Open"; // Get current hour between 0-23 currHour = today.getHours(); console.log("currHour: " + currHour); // If business is has no open hours today, display "Closed" in Quick Info section if (openHou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkIfOpen(place) {\n var targetRange = place.hours[today];\n\n if(targetRange.open === null && targetRange.close === null) {\n return false;\n }\n else {\n // set hours to a short var\n var openHour = targetRange.open.hour;\n var closeHour = targetRange.close.hour...
[ "0.6583708", "0.65771556", "0.6553329", "0.64788675", "0.63915586", "0.620521", "0.6039984", "0.60080695", "0.5960196", "0.59503067", "0.58351773", "0.5777509", "0.5712368", "0.5693681", "0.5690458", "0.5616943", "0.5614979", "0.5612458", "0.55568206", "0.55536145", "0.555298...
0.8349701
0
Order delivery: Iterate through each delivery link and add as an href for each delivery type. If the link is an empty string, hide the element
function iterateAndAddDeliveryLinkHrefs(deliveryLinks) { var deliveryLinkIdList = ["uber-eats", "postmates", "grubhub"]; var maxLen = deliveryLinkIdList.length; console.log("delivery link length: " + length); var service; var link; for (service = 0; service < maxLen; service++) { link = deliveryLinks[se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printRetailers(retailers){\n printRetailersImages(retailers);\n\n var websitePositions = [];\n for(var i = 0; i < retailers.length; i++) {\n if (!(retailers[i].website in websitePositions)) {\n websitePositions[retailers[i].website] = [];\n }\n websitePositions[retailers[i].website].push(...
[ "0.5324608", "0.51116186", "0.5020858", "0.5016323", "0.49511442", "0.48496816", "0.47599226", "0.47206467", "0.47195733", "0.46801272", "0.46409774", "0.463749", "0.46280044", "0.45952195", "0.45943123", "0.45716086", "0.45706195", "0.4547281", "0.45437688", "0.45403767", "0...
0.72040063
0
Calculate and store mesh variant (unique by draw group but not feature)
computeVariant (draw) { // Factors that determine a unique mesh rendering variant const selection = (draw.interactive ? 1 : 0); // whether feature has interactivity const normal = (draw.extrude != null ? 1 : 0); // whether feature has extrusion (need per-vertex normals) const texcoords =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function comp(list,registry,i){var key=list[i];var item=registry[key];return(item.depth?item.depth:registry[key].uniformValues[1][14])+normalizer;}//mutator function records mesh's place in previous pass", "getGeometryData (geomData) {\n let result = {};\n\n let meshData = geomData.mesh[0];\n let meshSo...
[ "0.623999", "0.611398", "0.60497534", "0.59591323", "0.5863364", "0.5855427", "0.5835055", "0.58289164", "0.5744923", "0.5724816", "0.5689266", "0.56556195", "0.5646538", "0.5602893", "0.55791056", "0.55309826", "0.55121446", "0.55119765", "0.5510869", "0.549456", "0.5486122"...
0.7100638
0
Override Create or return desired vertex layout permutation based on flags
vertexLayoutForMeshVariant (variant) { if (this.vertex_layouts[variant.key] == null) { // Attributes for this mesh variant // Optional attributes have placeholder values assigned with `static` parameter const attribs = [ { name: 'a_position', size: 4, type: gl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "makeVertexTemplate(style, mesh) {\n let i = 0;\n\n // a_position.xyz - vertex position\n // a_position.w - layer order\n this.vertex_template[i++] = 0;\n this.vertex_template[i++] = 0;\n this.vertex_template[i++] = style.z || 0;\n this.vertex_template[i++] = this.sc...
[ "0.5928204", "0.5612135", "0.55068696", "0.5417176", "0.5394422", "0.5384809", "0.53314555", "0.52901906", "0.5208817", "0.5208072", "0.5189456", "0.5188655", "0.5158371", "0.5135652", "0.51343125", "0.5105771", "0.5104293", "0.51001495", "0.5096107", "0.5078507", "0.5076229"...
0.5753331
1
A "template" that sets constant attibutes for each vertex, which is then modified per vertex or per feature. A plain JS array matching the order of the vertex layout.
makeVertexTemplate(style, mesh) { let i = 0; // a_position.xyz - vertex position // a_position.w - layer order this.vertex_template[i++] = 0; this.vertex_template[i++] = 0; this.vertex_template[i++] = style.z || 0; this.vertex_template[i++] = this.scaleOrder(styl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vertexKeyGenerator( v ){\n\t\t//this will hold the ids consistently between vertex and vec3ds\n\t\treturn \"[ x: \"+format(v.x)+ \", y: \"+format(v.y)+ \", z: \"+format(v.z)+\"]\";\n\t}", "create_vertex_arrays() {\r\n\r\n this.glTF.bufferViews.forEach(bufferView => {\r\n // console.log...
[ "0.6002206", "0.59282", "0.58829695", "0.58638567", "0.5810497", "0.5810497", "0.5602653", "0.5588946", "0.5587531", "0.5533246", "0.5515162", "0.5508211", "0.54832983", "0.54672575", "0.5439046", "0.5436878", "0.5427115", "0.5411789", "0.5407868", "0.5399823", "0.53907603", ...
0.5967876
1
We can't support all synchronous methods because we have to call out to a transaction signer. So removing the ability to serve any.
send(payload, callback) { var requests = payload; if (!(requests instanceof Array)) { requests = [requests]; } for (var request of requests) { if (request.method == "eth_sendTransaction") { throw new Error("HookedWeb3Provider does not support synchronous transactions. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_signTransaction(raw) {\n raw['from'] = this.address;\n\n return new Promise(function(resolve, reject) {\n web3.eth.sendTransaction(raw, function(err, res) {\n if (err) {\n reject(err);\n }\n resolve(res);\n });\n });\n }", "async function callContractMethod(src,...
[ "0.60667", "0.56978655", "0.569769", "0.55765086", "0.5527257", "0.54685265", "0.5437619", "0.5430641", "0.5409431", "0.54020876", "0.5369058", "0.53450894", "0.5324968", "0.5324337", "0.53157514", "0.53036773", "0.527981", "0.5276965", "0.52750045", "0.52746636", "0.52686584...
0.5740863
1
Rewrite all eth_sendTransaction payloads in the requests array. This takes care of batch requests, and updates the nonces accordingly.
rewritePayloads(index, requests, session_nonces, finished) { if (index >= requests.length) { return finished(); } var payload = requests[index]; // Function to remove code duplication for going to the next payload var next = (err) => { if (err != null) { return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "send(payload, callback) {\n var requests = payload;\n if (!(requests instanceof Array)) {\n requests = [requests];\n }\n\n for (var request of requests) {\n if (request.method == \"eth_sendTransaction\") {\n throw new Error(\"HookedWeb3Provider does not support synchronou...
[ "0.6711313", "0.57545286", "0.5667591", "0.56438756", "0.53541416", "0.5290971", "0.52457017", "0.5230898", "0.5200613", "0.5123993", "0.50497955", "0.5047132", "0.50031275", "0.49930254", "0.4942686", "0.4933279", "0.4925202", "0.48941174", "0.48866022", "0.48828843", "0.487...
0.7095764
0
this will either be StageMorph or SpriteMorph var blocks = this.originalBlockTemplates_Makers(category);
function blockBySelector(selector) { var newBlock = SpriteMorph.prototype.blockForSelector(selector, true); newBlock.isTemplate = true; return newBlock; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function overridenBlockTemplates(category) {\n var myself = this,\n blocks = [],\n varNames,\n button;\n\n var myself = this;\n\n if (!this.arduino) {\n this.arduino = {\n board : undefined, // Reference to arduino board - to be created by new firmata.Board()\n ...
[ "0.72476906", "0.61099064", "0.590692", "0.5847018", "0.5745106", "0.5683422", "0.5677277", "0.5676455", "0.5565587", "0.5565526", "0.54579294", "0.53914404", "0.5333507", "0.5333073", "0.5317003", "0.5304385", "0.5295758", "0.52862066", "0.52680033", "0.52585524", "0.522689"...
0.6218283
1
objectPath: foo.bar.foobar pathToSecret: /foo/bar/foobar
function buildPathToSecret (secretsPath, objectPath) { const pathToSecret = joinPath(secretsPath, ..._.toPath(objectPath)) return pathToSecret }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_resolveObjectPath(path, obj) {\n return path.split(\".\").reduce(function(prev, curr) {\n return prev ? prev[curr] : null;\n }, obj || self);\n }", "function authenticateObj (obj, sharedKey) {\n if (typeof obj !== 'object') {\n throw new TypeError('Input must be an object.')\n }\n if (!obj.tag...
[ "0.5484524", "0.5432524", "0.5429436", "0.54006994", "0.53619087", "0.51325107", "0.51040965", "0.5064765", "0.5029149", "0.5008084", "0.50078905", "0.4998017", "0.49708083", "0.49206108", "0.49167097", "0.49111122", "0.4883021", "0.4881348", "0.48789194", "0.4872138", "0.486...
0.7046147
0
puting in the html code the player and the computer choices calling getCOmputerPick function calling checkRound function
function playerPick(playerPick) { computerPick = getComputerPick(); playerPickElem.innerHTML = 'hits with ' + playerPick + '.'; computerPickElem.innerHTML = 'hits with ' + computerPick + '.'; checkRoundWinner(playerPick, computerPick); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playRound(playerSelection, computerSelection) {\n\n //Generates the computer's selection\n computerSelection = computerPlay();\n \n //All below if-statements compare the player and computers selections\n //It also adds 1 to the score, depending on which selection wins\n ...
[ "0.7203776", "0.7106507", "0.7102266", "0.70854294", "0.70807695", "0.7080632", "0.7078518", "0.7055631", "0.70219576", "0.70176405", "0.7008678", "0.70035714", "0.6988183", "0.6984483", "0.6972371", "0.69713944", "0.69575566", "0.69300956", "0.6922362", "0.69205", "0.6920389...
0.7218829
0
\ || Casts an object into a cljs PersistentHashMap. || noConvert: [Boolean] Do not convert string keys into Keywords. \
function toHashMap(obj, noConvert) { var hash = cljs.core.PersistentHashMap.EMPTY; _.each(obj, function(value, key) { if(!noConvert) { key = toKeyword(key); } hash = cljs.core.assoc(hash, key, value); }); return hash; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_convertObject(obj) {\n if (util_1.isArray(obj)) {\n for (let i = 0; i < obj.length; i++) {\n obj[i] = this._convertObject(obj[i]);\n }\n return obj;\n }\n else if (util_1.isObject(obj)) {\n const map = new Map();\n for (con...
[ "0.6281402", "0.6242064", "0.5934242", "0.5934242", "0.5910129", "0.5732617", "0.5510244", "0.5416156", "0.53661335", "0.5316833", "0.52923757", "0.5273529", "0.52564275", "0.5186878", "0.5155308", "0.51457196", "0.5103915", "0.5103915", "0.5103915", "0.5102212", "0.5102212",...
0.7911051
0
\ || Registers a function as a CodeMirror action. \
function addAction(commandName, command) { var CodeMirror = window.CodeMirror; if (!CodeMirror.commands[commandName]) { CodeMirror.commands[commandName] = command; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnMacro()\n{\n}", "action() {}", "function ACTION() {}", "function onFireAction(){\n \n}", "action(id, fn) {\n this._actions[id] = fn;\n return this;\n }", "registerFunctionCallback(menu, name, character, function_name){\n menu.submenu.push(\n {\n label...
[ "0.57678777", "0.57331383", "0.5708841", "0.56766266", "0.56701875", "0.5640101", "0.56170964", "0.5592635", "0.5514765", "0.5451469", "0.544974", "0.54343534", "0.5311541", "0.5311541", "0.5311541", "0.5311541", "0.5311541", "0.5311541", "0.5306151", "0.5302938", "0.5302938"...
0.68786615
0
\ || Gets the currently active tab as an html element. \
function getActiveTab() { return lt.objs.tabs.active_tab(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get activeTab() {\n var _a;\n return (_a = this.getAttribute('active-tab')) !== null && _a !== void 0 ? _a : '';\n }", "function getActiveTab() {\n return $('.nav.nav-tabs .active')\n }", "function getCurrentTab() {\n return currentTab;\n}", "function getCurrentTab() {\n retu...
[ "0.7730499", "0.7313316", "0.7063893", "0.7063893", "0.7063893", "0.7057831", "0.7027257", "0.69013935", "0.68331665", "0.68080366", "0.6776901", "0.67401695", "0.6703416", "0.66845334", "0.66827077", "0.6670346", "0.6669864", "0.66504794", "0.66504794", "0.66504794", "0.6647...
0.746535
1
\ || Gets the filepath of the currently active tab, super hacky. \
function getActiveFile() { var active = getActiveTab(); if(!active) { return false; } return lt.objs.tabs.__GT_path(active); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getCurrentTab() {\n return window.location.pathname.split('/')[2];\n }", "function get_current_page_filename()\n{\n let path = window.location.pathname;\n let page = path.split(\"/\").pop();\n return page;\n}", "function getCurrentPathName() {\n pathName = window.location.pathname;\n return pathNa...
[ "0.736579", "0.7232645", "0.7118671", "0.709226", "0.6956359", "0.6899604", "0.6865521", "0.6865521", "0.6865521", "0.6855951", "0.67375183", "0.67104673", "0.66785693", "0.6645206", "0.6583192", "0.65428454", "0.65191245", "0.6310801", "0.62979263", "0.6261741", "0.62554944"...
0.8451685
0
return the difference between the largest and smallest integers in the array.
function difference(array){ let biggest = Math.max.apply(null, array); let smallest = Math.min.apply(null, array); return biggest - smallest; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findDiff(arr) {\n\n var max = Math.max.apply(Math, arr);\n var min = Math.min.apply(Math, arr);\n var result = max - min;\n\n return result;\n}", "function diffMaxMin(arr) {\n\tvar largest = arr[0];\n\tvar smallest = arr[0];\n\tfor (let i = 0; i < arr.length; i++) {\n\t\tif (arr[i] > largest) {\n\t\...
[ "0.7854484", "0.77285856", "0.76154816", "0.7607413", "0.7543118", "0.7527767", "0.7394496", "0.7277802", "0.71023196", "0.7051495", "0.7019221", "0.6889711", "0.68135357", "0.66893464", "0.66062725", "0.6599913", "0.6592435", "0.656957", "0.6548111", "0.65467525", "0.653332"...
0.8357083
0
Text with environment variables to replace with their values.
function replaceEnvironmentVariables(text: string): string { const regex = /(?<!\$)\$\w+/g; const matches = regex.exec(text) || []; let replaced = text; for (const match of matches) { const spliced = match.substring(1, match.length); const value = process.env[spliced] || ''; replaced = replaced.rep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function replaceFromEnvVar(text, values) {\n return text.replace(/\\$\\[(.*?)\\]/gi, (a, b) => {\n var _a;\n let ret = \"undefined\";\n if (typeof b == \"string\") {\n if (b.startsWith(\"env.\")) {\n b = b.slice(4);\n ret = (_a = process.env[b]) !== ...
[ "0.72971344", "0.7282427", "0.61190003", "0.60070735", "0.5948872", "0.5912946", "0.58647317", "0.578528", "0.57693684", "0.5554122", "0.55498624", "0.54487336", "0.5393969", "0.5386907", "0.5385873", "0.5382915", "0.5316846", "0.52793366", "0.5207895", "0.5206538", "0.518883...
0.790718
0
You get an array of numbers, return the sum of all of the positives ones. Example [1,4,7,12] => 1 + 7 + 12 = 20
function positiveSum(array) { // Initiate a total sum variable // Loop through the array of numbers // If the number is positive, add to the running sum var total = 0; for (var i = 0; i < array.length; i++) { if (array[i] > 0) { total += array[i]; } } return total; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function positiveSum(arr){\nreturn arr\n .filter(positivenumbers => positivenumbers > 0)\n .reduce((a,b) => a + b, 0);\n}", "function positiveSum(arr) {\n\t// // filter the arr for positive numbers\n\t// const positive = arr.filter((element) => element > 0)\n\t// // sum up positive array and retu...
[ "0.8222376", "0.7952872", "0.7917937", "0.79114133", "0.7894453", "0.7859543", "0.7857331", "0.7831258", "0.7828468", "0.7828131", "0.78274226", "0.7826286", "0.78256977", "0.7811263", "0.77950037", "0.77846545", "0.777385", "0.7765809", "0.774611", "0.7739054", "0.77241397",...
0.7991425
1
Logic to toggle extended navigation.
function toggleNav() { function openNav() { document.getElementById("extendednav").style.left = "50px" document.getElementById("root").style.transitionDuration = ".5s" document.getElementById("root").style.marginLeft = "200px" document.getElementById("toggleArrow").style.transf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onToggleNavigationPane() {\n this._togglePageScrollability();\n this._toggleNavigationPane();\n }", "function toggleNavigation() {\r\n\tif ($('#main-container').hasClass('display-nav')) {\r\n\t\t// Close Nav\r\n\t\t$('#main-container').removeClass('display-nav');\r\n\t} else {\r\n\t\t// Open Nav\r\n\t\t$(...
[ "0.6529937", "0.64668167", "0.6439517", "0.64267755", "0.6391807", "0.638765", "0.63876414", "0.6364313", "0.62673134", "0.62349504", "0.6233793", "0.62200624", "0.61942524", "0.61910367", "0.6185079", "0.6183618", "0.6158093", "0.6152615", "0.6139903", "0.61395824", "0.61297...
0.6703519
0
Reads a special folder containing SharePoint assets which should automatically be integrated into a feature. You can think of this as a slightly more useful version of readCustomFeatures, which allows for custom features to be created, but is more cumbersome when you want to do something simple like include an upgrade ...
function readSharepointAssets(assets, featureId) { return { elementManifests: readAssetFiles(assets.elementManifests, 'Element Manifest', featureId), elementFiles: readAssetFiles(assets.elementFiles, 'Element File'), upgradeActions: readAssetFiles(assets.upgradeActions, 'Upgrade Action', fea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readCustomFeatures(options) {\n return getCustomFeatureXmlFilenames(options.paths.featureXmlDir)\n .then(function (filenames) {\n return getCustomFiles(options.paths.featureXmlDir)\n .then(function (files) {\n return {\n files: files,\n ...
[ "0.5677802", "0.5662979", "0.53024954", "0.525515", "0.5171542", "0.5090426", "0.50768137", "0.50760996", "0.50686944", "0.5013929", "0.5007583", "0.49756145", "0.4928723", "0.4913776", "0.48976195", "0.4881399", "0.48724002", "0.48720014", "0.48486006", "0.4843918", "0.48398...
0.5774488
0
FUNCION PARA AGREGAR PARES DE NUMEROS A NUESTRO ARREGLO
function agregaNumerosArreglo(cadenaNumeros){//Recibe nuestra cadena de numeros let contador = 0; let par_num = ""; let longuitud_cadena = 0; const lengthC = cadenaNumeros.length;//longuitud de nuestra cadena recibida for (let numero of cadenaNumeros) {//recorremos nuestro mensaje if(c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function soma(nnumero){\r\n let cont = 0;\r\n for (let num of numeros){\r\n cont = cont +num\r\n }\r\n return soma \r\n }", "function presionarNumero(numero){\n console.log(\"numero\",numero)\n\n calculadora.agregarNumero(numero)\n actualizarDisplay()\n}", "function funci...
[ "0.65432245", "0.64810246", "0.6448664", "0.6403216", "0.6374995", "0.6239534", "0.6185768", "0.61196065", "0.6087584", "0.60837454", "0.60794795", "0.60662514", "0.60602385", "0.60158235", "0.6014593", "0.6009995", "0.5986917", "0.59580594", "0.59301096", "0.5912923", "0.590...
0.67183894
0