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
Returns true if the lifecycle init method should be called for the node with the given init index.
function shouldCallLifecycleInitHook(view, initState, index) { return (1792 /* InitState_Mask */ & view.state) === initState && view.initIndex <= index && (view.initIndex = index + 1, !0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shouldCallLifecycleInitHook(view, initState, index) {\n if ((view.state & 1792 /* InitState_Mask */) === initState && view.initIndex <= index) {\n view.initIndex = index + 1;\n return true;\n }\n return false;\n}", "function shouldCallLifecycleInitHook(view, initState, index) {\n ...
[ "0.73335665", "0.73335665", "0.73335665", "0.73335665", "0.73335665", "0.73335665", "0.73335665", "0.73335665", "0.73335665", "0.73335665", "0.73335665", "0.73335665", "0.73335665", "0.73335665", "0.73335665", "0.5620375", "0.5575484", "0.55465573", "0.5528359", "0.548944", "...
0.7577341
0
Sets properties on a target object from a source object, but only if the property doesn't already exist on the target object.
function fillProperties(target, source) { for (var key in source) source.hasOwnProperty(key) && !target.hasOwnProperty(key) && (target[key] = source[key]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fillProperties(target, source) {\n for (var key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n }", "function fillProperties(target, source) {\n for (var key in source) {\n if (sour...
[ "0.78620064", "0.7851383", "0.7827916", "0.7823235", "0.7823235", "0.7823235", "0.7823235", "0.7823235", "0.7823235", "0.7823235", "0.7823235", "0.7823235", "0.7823235", "0.7823235", "0.7823235", "0.7823235", "0.77914286", "0.77810484", "0.77810484", "0.77810484", "0.77810484...
0.7988248
0
unused harmony export getSymbolIterator / harmony export (binding) / unused harmony export $$iterator PURE_IMPORTS_START PURE_IMPORTS_END
function getSymbolIterator() { return "function" == typeof Symbol && Symbol.iterator ? Symbol.iterator : "@@iterator"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSymbolIterator() {\n if (typeof Symbol !== 'function' || !Symbol.iterator) {\n return '@@iterator';\n }\n return Symbol.iterator;\n}", "[Symbol.iterator]() {\n return this;\n }", "[Symbol.iterator]() {\r\n return this._items[Symbol.iterat...
[ "0.7584885", "0.73702276", "0.7348934", "0.7279899", "0.7272657", "0.72390246", "0.72390246", "0.7195341", "0.7163196", "0.7161993", "0.7145333", "0.70842767", "0.700943", "0.70025754", "0.69967735", "0.692563", "0.68961376", "0.6892679", "0.6842049", "0.68398464", "0.6801433...
0.7801611
0
harmony import PURE_IMPORTS_START _util_isScheduler,_fromArray,_empty,_scalar PURE_IMPORTS_END
function of() { for (var args = [], _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i]; var scheduler = args[args.length - 1]; switch (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_0__.a)(scheduler) ? args.pop() : scheduler = void 0, args.length) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isScheduler(value) {\n return value && \"function\" == typeof value.schedule;\n }", "function g$1D(){return new N$J.Scheduler}", "function isScheduler(value) {\n return value && typeof value.schedule === 'function';\n}", "function eventScheduler(){}", "function scheduled(input...
[ "0.6577409", "0.64713013", "0.63880163", "0.62037665", "0.5972367", "0.5946405", "0.58866704", "0.57942814", "0.5760905", "0.5522092", "0.53757536", "0.533234", "0.5282511", "0.5226732", "0.52034235", "0.50760436", "0.507098", "0.5069453", "0.50650585", "0.5049152", "0.502967...
0.7031219
0
Creates a factory for a platform
function createPlatformFactory(parentPlatformFactory, name, providers) { void 0 === providers && (providers = []); var desc = "Platform: " + name, marker = new injection_token.a(desc); return function(extraProviders) { void 0 === extraProviders && (extraProviders = []...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createPlatformFactory(parentPlaformFactory, name, providers) {\n\t if (providers === void 0) { providers = []; }\n\t var marker = new OpaqueToken(\"Platform: \" + name);\n\t return function (extraProviders) {\n\t if (extraProviders === void 0) { extraProviders = []; }\n\t ...
[ "0.70826316", "0.7028183", "0.7025169", "0.7025169", "0.7025169", "0.7025169", "0.70107806", "0.700606", "0.69912165", "0.69912165", "0.69912165", "0.69912165", "0.69912165", "0.69912165", "0.69912165", "0.69912165", "0.69912165", "0.69912165", "0.6976101", "0.6972428", "0.69...
0.73224527
0
This should fire off `ChildActivationStart` events for each route being activated at this level. In other words, if you're activating `a` and `b` below, `path` will contain the `ActivatedRouteSnapshot`s for both and we will fire `ChildActivationStart` for both. Always return `true` so checks continue to run.
function fireChildActivationStart(snapshot, forwardEvent) { return null !== snapshot && forwardEvent && forwardEvent(new events.d(snapshot)), Object(of.a)(!0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fireChildActivationStart(snapshot, forwardEvent) {\n if (snapshot !== null && forwardEvent) {\n forwardEvent(new ChildActivationStart(snapshot));\n }\n return of(true);\n }", "function findActiveRoutes(activePath, children, _matches) {\n _matches = _matches || [];\n\n...
[ "0.6203194", "0.5741681", "0.5683418", "0.55435055", "0.55435055", "0.55435055", "0.55435055", "0.55435055", "0.55435055", "0.55435055", "0.5540666", "0.5540666", "0.53634405", "0.5311523", "0.52969265", "0.5206757", "0.5205937", "0.5205937", "0.5205937", "0.5205937", "0.5189...
0.5903217
1
Used clone a copy of a precomputed template of a styling context. A precomputed template is designed to be computed once for a given element (instructions.ts has logic for caching this). Retrieve the `StylingContext` at a given index. This method lazily creates the `StylingContext`. This is because in most cases we hav...
function getStylingContext(index, viewData) { for (var storageIndex = index, slotValue = viewData[storageIndex], wrapper = viewData; Array.isArray(slotValue); ) wrapper = slotValue, slotValue = slotValue[view.i]; if (value = wrapper, Array.isArray(value) && "number" == typeof value[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStylingContext(index) {\n var stylingContext = load(index);\n if (!Array.isArray(stylingContext)) {\n var lElement = stylingContext;\n var tNode = lElement.tNode;\n ngDevMode &&\n assertDefined(tNode.stylingTemplate, 'getStylingContext() called before elementStylin...
[ "0.74346834", "0.6264812", "0.6264812", "0.6125358", "0.6125358", "0.5378647", "0.4953772", "0.48787764", "0.48787764", "0.4844287", "0.4820033", "0.47875404", "0.4754606", "0.4748857", "0.4748857", "0.4748857", "0.4748857", "0.4748857", "0.4748857", "0.4748857", "0.47431824"...
0.6266931
1
Takes a component instance and returns the view for that component.
function getComponentViewByInstance(componentInstance) { var view, lView = Object(_util__WEBPACK_IMPORTED_MODULE_4__.x)(componentInstance); if (Array.isArray(lView)) { var nodeIndex = findViaComponent(lView, componentInstance); (context = createLContext(lView, nod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getComponentViewByInstance(componentInstance) {\n var lView = readPatchedData(componentInstance);\n var view;\n if (Array.isArray(lView)) {\n var nodeIndex = findViaComponent(lView, componentInstance);\n view = getComponentLViewByIndex(nodeIndex, lView);\n var context = creat...
[ "0.7048885", "0.70443046", "0.70443046", "0.70443046", "0.69775623", "0.69775623", "0.69775623", "0.69775623", "0.69775623", "0.69775623", "0.69775623", "0.69775623", "0.69775623", "0.69775623", "0.63154966", "0.63154966", "0.6229156", "0.61523557", "0.6148809", "0.6128531", ...
0.7228802
0
Assigns the given data to the given target (which could be a component, directive or DOM node instance) using monkeypatching.
function attachPatchData(target, data) { target[_interfaces_context__WEBPACK_IMPORTED_MODULE_2__.a] = data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function attachPatchData(target, data) {\n ngDevMode && assertDefined(target, 'Target expected');\n target[MONKEY_PATCH_KEY_NAME] = data;\n}", "function attachPatchData(target, data) {\n ngDevMode && assertDefined(target, 'Target expected');\n target[MONKEY_PATCH_KEY_NAME] = data;\n}", "function at...
[ "0.67834634", "0.67834634", "0.66683936", "0.66683936", "0.66683936", "0.66683936", "0.66683936", "0.66683936", "0.66683936", "0.66683936", "0.66683936", "0.66683936", "0.66683936", "0.66683936", "0.62940407", "0.5945387", "0.59202266", "0.5915069", "0.5886329", "0.5886329", ...
0.6822442
0
Locates the component within the given LView and returns the matching index
function findViaComponent(lView, componentInstance) { var componentIndices = lView[_interfaces_view__WEBPACK_IMPORTED_MODULE_3__.s].components; if (componentIndices) for (var i = 0; i < componentIndices.length; i++) { var elementComponentIndex = componentIndices[i]; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findViaComponent(lView, componentInstance) {\n const componentIndices = lView[TVIEW].components;\n if (componentIndices) {\n for (let i = 0; i < componentIndices.length; i++) {\n const elementComponentIndex = componentIndices[i];\n const componentView = getComponentLView...
[ "0.7603493", "0.7603493", "0.7603493", "0.7603493", "0.7603493", "0.7603493", "0.7603493", "0.7603493", "0.7603493", "0.7603493", "0.7565394", "0.7565394", "0.7565394", "0.7563044", "0.6930487", "0.6930487", "0.69272864", "0.69184965", "0.69184965", "0.69184965", "0.69184965"...
0.77044237
0
Read the `ngInjectableDef` type in a way which is immune to accidentally reading inherited value.
function getInjectableDef(type) { return type && type.hasOwnProperty(NG_INJECTABLE_DEF) ? type[NG_INJECTABLE_DEF] : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getInheritedInjectableDef(type){if(type&&type[NG_INJECTABLE_DEF]){// TODO(FW-1307): Re-add ngDevMode when closure can handle it\n// ngDevMode &&\nconsole.warn(\"DEPRECATED: DI is instantiating a token \\\"\"+type.name+\"\\\" that inherits its @Injectable decorator but does not provide one itself.\\n\"+(\"...
[ "0.729993", "0.71845084", "0.7100907", "0.70960414", "0.70960414", "0.70122993", "0.70119387", "0.69944906", "0.5864512", "0.56524265", "0.5632861", "0.5632861", "0.5632861", "0.5632861", "0.5431942", "0.5184027", "0.5184027", "0.510292", "0.5063943", "0.50302464", "0.5030246...
0.72145444
1
Read the `ngInjectorDef` type in a way which is immune to accidentally reading inherited value.
function getInjectorDef(type) { return type && type.hasOwnProperty(NG_INJECTOR_DEF) ? type[NG_INJECTOR_DEF] : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getInjectorDef(type){return type&&type.hasOwnProperty(NG_INJECTOR_DEF)?type[NG_INJECTOR_DEF]:null}", "function getInjectorDef(type) {\n return type && type.hasOwnProperty(NG_INJECTOR_DEF) ? type[NG_INJECTOR_DEF] : null;\n}", "function getInjectorDef(type) {\n return type && type.hasOwnProperty(N...
[ "0.72203434", "0.69424444", "0.69424444", "0.69424444", "0.69424444", "0.6134145", "0.61120725", "0.600972", "0.600972", "0.6007374", "0.6007374", "0.6007374", "0.6007374", "0.6007374", "0.6007374", "0.6007374", "0.6007374", "0.6003561", "0.5932258", "0.5912596", "0.5908837",...
0.6988428
1
Convert a `Params` instance to a `ParamMap`.
function convertToParamMap(params) { return new ParamsAsMap(params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertToParamMap(params) {\n return new ParamsAsMap(params);\n }", "function convertToParamMap(params) {\n return new ParamsAsMap(params);\n}", "function convertToParamMap(params) {\n return new ParamsAsMap(params);\n}", "function convertToParamMap(params) {\n return new ParamsAs...
[ "0.87475824", "0.8690492", "0.8690492", "0.8690492", "0.8690492", "0.8690492", "0.8690492", "0.8690492", "0.8690492", "0.8690492", "0.8690492", "0.8690492", "0.66753244", "0.66753244", "0.66753244", "0.66753244", "0.66753244", "0.66753244", "0.66753244", "0.66390836", "0.6574...
0.8730947
1
Matches the route configuration (`route`) against the actual URL (`segments`).
function defaultUrlMatcher(segments, segmentGroup, route) { var parts = route.path.split("/"); if (parts.length > segments.length) // The actual URL is shorter than the config, no match return null; if ("full" === route.pathMatch && (segmentGroup.hasChildren(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function defaultUrlMatcher(segments, segmentGroup, route) {\n const 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.70426023", "0.70426023", "0.70426023", "0.70426023", "0.70426023", "0.70426023", "0.70426023", "0.70426023", "0.70083785", "0.70083785", "0.70083785", "0.69815403", "0.6385541", "0.6385541", "0.6385541", "0.6385541", "0.6385541", "0.62965214", "0.6236919", "0.6217027", "0....
0.7117695
0
Returns a native sibling of a given native node.
function nativeNextSibling(renderer, node) { return Object(_interfaces_renderer__WEBPACK_IMPORTED_MODULE_7__.c)(renderer) ? renderer.nextSibling(node) : node.nextSibling; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nativeNextSibling(renderer, node) {\n return isProceduralRenderer(renderer) ? renderer.nextSibling(node) : node.nextSibling;\n}", "function nativeNextSibling(renderer, node) {\n return isProceduralRenderer(renderer) ? renderer.nextSibling(node) : node.nextSibling;\n}", "function nativeNextSiblin...
[ "0.7132569", "0.7132569", "0.7132569", "0.7132569", "0.7132569", "0.7132569", "0.7132569", "0.7132569", "0.7132569", "0.7132569", "0.7132569", "0.7132569", "0.7132569", "0.7132569", "0.6822064", "0.6787751", "0.6742815", "0.67157614", "0.67157614", "0.6693856", "0.66820526", ...
0.7209194
0
Query keys/values should have the "+" replaced first, as "+" in a query string is " ". decodeURIComponent function will not decode "+" as a space.
function decodeQuery(s) { return decode(s.replace(/\+/g, "%20")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getQueryStrings() { \n var assoc = {};\n var decode = function (s) { return decodeURIComponent(s.replace(/\\+/g, \" \")); };\n var queryString = location.search.substring(1); \n var keyValues = queryString.split('&'); \n\n for(var i in keyValues) { \n var key = keyValues[i].split('=');\n if (k...
[ "0.7420458", "0.73129183", "0.73129183", "0.73129183", "0.73129183", "0.73129183", "0.73129183", "0.73129183", "0.73129183", "0.73129183", "0.73129183", "0.73129183", "0.72556305", "0.7249874", "0.7145466", "0.7100717", "0.7069435", "0.70246315", "0.69535846", "0.69170064", "...
0.74141854
1
Runs through the initial styling data present in the context and renders them via the renderer on the element.
function renderInitialStylesAndClasses(element, context, renderer) { renderInitialStylingValues(element, renderer, context[3 /* InitialClassValuesPosition */ ], !0), renderInitialStylingValues(element, renderer, context[2 /* InitialStyleValuesPosition */ ], !1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderInitialStylesAndClasses(element, context, renderer) {\n var initialClasses = context[3 /* InitialClassValuesPosition */];\n renderInitialStylingValues(element, renderer, initialClasses, true);\n var initialStyles = context[2 /* InitialStyleValuesPosition */];\n renderInitialStylingValues...
[ "0.6669491", "0.6669491", "0.65536207", "0.6337399", "0.6316931", "0.62790614", "0.6166481", "0.6166481", "0.6110835", "0.60718405", "0.60718405", "0.59389436", "0.58725137", "0.58670294", "0.5806136", "0.57736105", "0.57449394", "0.5690006", "0.5653059", "0.5606321", "0.5602...
0.6860287
0
This function renders a given CSS class value using the provided renderer (by adding or removing it from the provided element). If a `store` value is provided then that will be used a render context instead of the provided renderer.
function setClass(native, className, add, renderer, store, playerBuilder) { store || playerBuilder ? (store && store.setValue(className, add), playerBuilder && playerBuilder.setValue(className, add)) : "" !== className && (add ? Object(_interfaces_renderer__WEBPACK_IMPORTED_MODULE_3__.c)(renderer) ? rendere...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setClass(native, className, add, renderer, store) {\n if (store) {\n store[className] = add;\n }\n else if (add) {\n ngDevMode && ngDevMode.rendererAddClass++;\n isProceduralRenderer(renderer) ? renderer.addClass(native, className) :\n native['classList'].add(class...
[ "0.64744604", "0.5840546", "0.5840546", "0.58358455", "0.56141716", "0.56141716", "0.56141716", "0.56141716", "0.56141716", "0.56141716", "0.56141716", "0.56141716", "0.56141716", "0.56141716", "0.56141716", "0.55319375", "0.55319375", "0.55319375", "0.5483409", "0.52599764", ...
0.5843021
1
Examines an attributes definition array from a node to find the index of the attribute with the specified name. NOTE: Will not find namespaced attributes.
function findAttrIndexInNode(name, attrs) { if (null === attrs) return -1; for (var selectOnlyMode = !1, i = 0; i < attrs.length; ) { var maybeAttrName = attrs[i]; if (maybeAttrName === name) return i; 0 /* NamespaceURI */ === maybeAttrName ? ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findAttrIndexInNode(name, attrs) {\n if (attrs === null)\n return -1;\n var selectOnlyMode = false;\n var i = 0;\n while (i < attrs.length) {\n var maybeAttrName = attrs[i];\n if (maybeAttrName === name) {\n return i;\n }\n else if (maybeAttrName =...
[ "0.7612944", "0.7607991", "0.7607991", "0.6906205", "0.68938774", "0.6835994", "0.6835994", "0.6835994", "0.6835994", "0.6835994", "0.6835994", "0.6835994", "0.6835994", "0.6835994", "0.6835994", "0.6615794", "0.6615794", "0.65725845", "0.64630246", "0.6355362", "0.6322383", ...
0.76354504
0
Creates a native element from a tag name, using a renderer.
function elementCreate(name, overriddenRenderer) { var rendererToUse = overriddenRenderer || Object(render3_state.m)()[interfaces_view.o]; return Object(interfaces_renderer.c)(rendererToUse) ? rendererToUse.createElement(name, _currentNamespace) : null === _currentNamespace ? rendererToUse.creat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function elementCreate(name, overriddenRenderer) {\n var native;\n var rendererToUse = overriddenRenderer || renderer;\n if (isProceduralRenderer(rendererToUse)) {\n native = rendererToUse.createElement(name, _currentNamespace);\n }\n else {\n if (_currentNamespace === null) {\n ...
[ "0.73009497", "0.7295715", "0.7295715", "0.7295658", "0.698781", "0.698781", "0.698781", "0.698781", "0.6526078", "0.64864635", "0.6399566", "0.63678414", "0.63666785", "0.63530225", "0.63505024", "0.634026", "0.634026", "0.634026", "0.634026", "0.634026", "0.634026", "0.63...
0.73803633
0
Locates the host native element, used for bootstrapping existing nodes into rendering pipeline.
function locateHostElement(factory, elementOrSelector) { var defaultRenderer = factory.createRenderer(null, null); return "string" == typeof elementOrSelector ? Object(interfaces_renderer.c)(defaultRenderer) ? defaultRenderer.selectRootElement(elementOrSelector) : defaultRenderer.querySelector(e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getHostNative(currentView) {\n ngDevMode && assertLView(currentView);\n var hostTNode = currentView[T_HOST];\n return hostTNode && hostTNode.type === 3 /* Element */ ?\n getNativeByTNode(hostTNode, getLViewParent(currentView)) :\n null;\n}", "get hostElement() {\n return th...
[ "0.6592282", "0.6523031", "0.6523031", "0.6523031", "0.6523031", "0.6421898", "0.6421898", "0.6421898", "0.6421898", "0.63681483", "0.632843", "0.632843", "0.632843", "0.62092847", "0.6194536", "0.6185654", "0.6136093", "0.6135741", "0.6135741", "0.6135741", "0.6135741", "0...
0.65499896
1
Assign static attribute values to a host element. This instruction will assign static attribute values as well as class and style values to an element within the host bindings function. Since attribute values can consist of different types of values, the `attrs` array must include the values in the following format: at...
function elementHostAttrs(directive, attrs) { var tNode = Object(render3_state.o)(); tNode.stylingTemplate || (tNode.stylingTemplate = Object(class_and_style_bindings.d)(attrs)); var lView = Object(render3_state.m)(), i = setUpAttributes(Object(render3_util.g)(tNode, lView), attrs); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "assignHostAttrs(attrs, definitionMap) {\n if (this._directiveExpr && (attrs.length || this._hasInitialValues)) {\n this.populateInitialStylingAttrs(attrs);\n definitionMap.set('hostAttrs', literalArr(attrs));\n }\n }", "function ɵɵelementHostAttrs(attrs) {\n var hostElem...
[ "0.6893984", "0.66462487", "0.6475794", "0.6475794", "0.6111451", "0.60377", "0.59562075", "0.5929445", "0.5923706", "0.59122026", "0.59086204", "0.58783257", "0.5788943", "0.57854915", "0.5774412", "0.57574886", "0.57273257", "0.5691162", "0.5691162", "0.5691162", "0.5691162...
0.6803872
1
Initializes the flags on the current node, setting all indices to the initial index, the directive count to 0, and adding the isComponent flag.
function initNodeFlags(tNode, index, numberOfDirectives) { // When the first directive is created on a node, save the index tNode.flags = 1 /* isComponent */ & tNode.flags, tNode.directiveStart = index, tNode.directiveEnd = index + numberOfDirectives, tNode.providerIndexes = index; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initNodeFlags(tNode, index, numberOfDirectives) {\n var flags = tNode.flags;\n ngDevMode && assertEqual(flags === 0 || flags === 1 /* isComponent */, true, 'expected node flags to not be initialized');\n ngDevMode && assertNotEqual(numberOfDirectives, tNode.directiveEnd - tNode.directiveStart, 'R...
[ "0.74818987", "0.737839", "0.737839", "0.63536125", "0.63518375", "0.63518375", "0.63518375", "0.63518375", "0.63518375", "0.63518375", "0.63518375", "0.63518375", "0.63518375", "0.63518375", "0.5209849", "0.5209849", "0.5209377", "0.5173027", "0.5163353", "0.5163353", "0.516...
0.7863823
0
Reporting a TContainer node queries is a 2step process as we need to: check if the container node itself is matching (query might match a node); prepare room for nodes from views that might be created based on the TemplateRef linked to this container. Those 2 operations need to happen in the specific order (match the c...
function addTContainerToQueries(lView, tContainerNode) { var queries = lView[interfaces_view.n]; queries && (lView[interfaces_view.n] = queries.addNode(tContainerNode), lView[tContainerNode.index][interfaces_view.n] = queries.container()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _queryNodeChildrenInContainerR3(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const childView = lContainer[i];\n _queryNodeChildrenR3(childView[TVIEW].node, childView, predicate, matches, elementsOnl...
[ "0.5686748", "0.56778497", "0.56485265", "0.56485265", "0.5621828", "0.5621828", "0.5621828", "0.5621828", "0.5621828", "0.5621828", "0.5621828", "0.5621828", "0.5621828", "0.5598079", "0.5331299", "0.5331299", "0.5329528", "0.53128546", "0.53128546", "0.52837145", "0.5251354...
0.6133855
0
Marks the end of the LContainer. Marking the end of LContainer is the time when to child views get inserted or removed.
function containerRefreshEnd() { var previousOrParentTNode = Object(render3_state.o)(); Object(render3_state.l)() ? Object(render3_state.z)(!1) : (previousOrParentTNode = previousOrParentTNode.parent, Object(render3_state.A)(previousOrParentTNode)); // remove extra views...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function elementContainerEnd() {\n var previousOrParentTNode = Object(render3_state.o)(), lView = Object(render3_state.m)(), tView = lView[interfaces_view.s];\n Object(render3_state.l)() ? Object(render3_state.z)(!1) : (previousOrParentTNode = previousOrParentTNode.parent, \n Objec...
[ "0.7304668", "0.71722496", "0.71722496", "0.7168628", "0.7168628", "0.6839913", "0.658808", "0.6564897", "0.64652956", "0.64294684", "0.64287746", "0.64236003", "0.64236003", "0.64227545", "0.6352536", "0.6315687", "0.61699456", "0.615686", "0.60553205", "0.60553205", "0.6055...
0.7373464
0
Marks current view and all ancestors dirty. Returns the root view because it is found as a byproduct of marking the view tree dirty, and can be used by methods that consume markViewDirty() to easily schedule change detection. Otherwise, such methods would need to traverse up the view tree an additional time to get the ...
function markViewDirty(lView) { for (;lView && !(512 /* IsRoot */ & lView[interfaces_view.g]); ) lView[interfaces_view.g] |= 64 /* Dirty */ , lView = lView[interfaces_view.m]; // Detached views do not have a PARENT and also aren't root views return lView && (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function markViewDirty(lView) {\n while (lView) {\n lView[FLAGS] |= 64 /* Dirty */;\n var parent_1 = getLViewParent(lView);\n // Stop traversing up as soon as you find a root view that wasn't attached to any container\n if (isRootView(lView) && !parent_1) {\n return lView;...
[ "0.7147178", "0.7147178", "0.70425445", "0.70425445", "0.70425445", "0.70425445", "0.70425445", "0.70425445", "0.70425445", "0.70425445", "0.70425445", "0.70425445", "0.6987135", "0.69691664", "0.69691664", "0.58398426", "0.5815145", "0.5782002", "0.5782002", "0.5782002", "0....
0.7161778
0
// Bindings & interpolations ///////////////////////////// Creates a single value binding.
function bind(value) { var lView = Object(render3_state.m)(), bindingIndex = lView[interfaces_view.a]++; return storeBindingMetadata(lView), Object(bindings.a)(lView, bindingIndex, value) ? value : tokens.a; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bind(value) {\n return bindingUpdated(value) ? value : NO_CHANGE;\n}", "function bind(value) {\n var lView = getLView();\n return bindingUpdated(lView, lView[BINDING_INDEX]++, value) ? value : NO_CHANGE;\n}", "function bind(value) {\n var lView = getLView();\n return bindingUpdated(lVie...
[ "0.6320393", "0.6152766", "0.6152766", "0.6108154", "0.60706073", "0.58445823", "0.5810854", "0.5659224", "0.55823493", "0.55758685", "0.5556168", "0.55463105", "0.55288774", "0.55245817", "0.55114883", "0.5499306", "0.54606783", "0.54503626", "0.5450352", "0.5423669", "0.539...
0.6414943
0
Allocates the necessary amount of slots for host vars.
function allocHostVars(count) { var lView = Object(render3_state.m)(), tView = lView[interfaces_view.s]; tView.firstTemplatePass && (function(tView, def, hostVars) { var expando = tView.expandoInstructions, length = expando.length; // Check whether a given `hostBi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function allocHostVars(count) {\n if (!getFirstTemplatePass())\n return;\n var lView = getLView();\n var tView = lView[TVIEW];\n queueHostBindingForCheck(tView, getCurrentDirectiveDef(), count);\n prefillHostVars(tView, lView, count);\n}", "function allocHostVars(count) {\n if (!getFirst...
[ "0.64564574", "0.64564574", "0.5830392", "0.5679726", "0.56162894", "0.56061184", "0.56061184", "0.56061184", "0.5582303", "0.5582303", "0.5582303", "0.5549041", "0.5516928", "0.53741217", "0.5372884", "0.53552717", "0.534928", "0.5291932", "0.5288171", "0.5260827", "0.521376...
0.6469721
0
Creates an interpolation binding with 3 expressions.
function interpolation3(prefix, v0, i0, v1, i1, v2, suffix) { var lView = Object(render3_state.m)(), bindingIndex = lView[interfaces_view.a], different = Object(bindings.c)(lView, bindingIndex, v0, v1, v2); if (lView[interfaces_view.a] += 3, storeBindingMetadata(lView, prefix, suffix)) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix) {\n var bindingIndex = lView[BINDING_INDEX];\n var different = bindingUpdated3(lView, bindingIndex, v0, v1, v2);\n lView[BINDING_INDEX] += 3;\n // Only set static strings the first time (data will be null subsequent runs).\n var data...
[ "0.6653525", "0.66350466", "0.65781534", "0.65781534", "0.65781534", "0.65781534", "0.65781534", "0.65781534", "0.65781534", "0.65781534", "0.65781534", "0.65781534", "0.64578855", "0.64578855", "0.62876976", "0.61676246", "0.61636186", "0.6147137", "0.6140385", "0.6120928", ...
0.6789804
0
Create an interpolation binding with 4 expressions.
function interpolation4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix) { var lView = Object(render3_state.m)(), bindingIndex = lView[interfaces_view.a], different = Object(bindings.d)(lView, bindingIndex, v0, v1, v2, v3); if (lView[interfaces_view.a] += 4, storeBindingMetadata(lView, prefix, suffix...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {\n var bindingIndex = lView[BINDING_INDEX];\n var different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n lView[BINDING_INDEX] += 4;\n // Only set static strings the first time (data will be null subsequent runs).\n...
[ "0.6606081", "0.64917624", "0.6459133", "0.6427241", "0.6427241", "0.6427241", "0.6427241", "0.6427241", "0.6427241", "0.6427241", "0.6427241", "0.6427241", "0.6427241", "0.6360374", "0.63223994", "0.63176644", "0.63051075", "0.6259303", "0.6258967", "0.6258967", "0.62200046"...
0.66396254
0
Creates an interpolation binding with 5 expressions.
function interpolation5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) { var lView = Object(render3_state.m)(), bindingIndex = lView[interfaces_view.a], different = Object(bindings.d)(lView, bindingIndex, v0, v1, v2, v3); if (different = Object(bindings.a)(lView, bindingIndex + 4, v4) || di...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {\n var bindingIndex = lView[BINDING_INDEX];\n var different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated(lView, bindingIndex + 4, v4) || different;\n lView[BINDING_INDEX] += 5;\n ...
[ "0.6598079", "0.6547591", "0.6489221", "0.6489221", "0.6409446", "0.6409446", "0.6409446", "0.6409446", "0.6409446", "0.6409446", "0.6409446", "0.6409446", "0.6409446", "0.6409446", "0.63646847", "0.62931764", "0.6222401", "0.62066585", "0.62066585", "0.62066585", "0.62066585...
0.6599577
0
Creates an interpolation binding with 6 expressions.
function interpolation6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) { var lView = Object(render3_state.m)(), bindingIndex = lView[interfaces_view.a], different = Object(bindings.d)(lView, bindingIndex, v0, v1, v2, v3); if (different = Object(bindings.b)(lView, bindingIndex + 4, v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {\n var bindingIndex = lView[BINDING_INDEX];\n var different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;\n lView[BINDING_IN...
[ "0.67810893", "0.670729", "0.6665864", "0.6635918", "0.65841895", "0.65841895", "0.65429795", "0.6542627", "0.6507769", "0.65051883", "0.65051883", "0.65051883", "0.65051883", "0.65051883", "0.65051883", "0.65051883", "0.65051883", "0.65051883", "0.65051883", "0.64715177", "0...
0.67921126
0
Creates an interpolation binding with 7 expressions.
function interpolation7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) { var lView = Object(render3_state.m)(), bindingIndex = lView[interfaces_view.a], different = Object(bindings.d)(lView, bindingIndex, v0, v1, v2, v3); if (different = Object(bindings.c)(lView, bindingInde...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {\n var bindingIndex = lView[BINDING_INDEX];\n var different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;\n lVie...
[ "0.6765252", "0.6639927", "0.6621919", "0.6621919", "0.657784", "0.65290093", "0.65290093", "0.65290093", "0.65290093", "0.65290093", "0.65290093", "0.65290093", "0.65290093", "0.65290093", "0.65290093", "0.6278124", "0.6239118", "0.616521", "0.611566", "0.60498446", "0.60339...
0.6701837
1
Creates an interpolation binding with 8 expressions.
function interpolation8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) { var lView = Object(render3_state.m)(), bindingIndex = lView[interfaces_view.a], different = Object(bindings.d)(lView, bindingIndex, v0, v1, v2, v3); if (different = Object(bindings.d)(lView, bin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {\n var bindingIndex = lView[BINDING_INDEX];\n var different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || differen...
[ "0.6645508", "0.65078884", "0.6448884", "0.6448884", "0.6448884", "0.6448884", "0.6448884", "0.6448884", "0.6448884", "0.6448884", "0.6448884", "0.6448884", "0.6412464", "0.6412464", "0.63669026", "0.63634896", "0.63210255", "0.6172359", "0.613528", "0.61249214", "0.61249214"...
0.6649922
0
Creates binding metadata for a particular binding and stores it in TView.data. These are generated in order to support DebugElement.properties. Each binding / interpolation will have one (including attribute bindings) because at the time of binding, we don't know to which instruction the binding belongs. It is always s...
function storeBindingMetadata(lView, prefix, suffix) { void 0 === prefix && (prefix = ""), void 0 === suffix && (suffix = ""); var tData = lView[interfaces_view.s].data, lastBindingIndex = lView[interfaces_view.a] - 1; return null == tData[lastBindingIndex] ? tData[lastBindingIndex] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function storeBindingMetadata(lView, prefix, suffix) {\n if (prefix === void 0) { prefix = ''; }\n if (suffix === void 0) { suffix = ''; }\n var tData = lView[TVIEW].data;\n var lastBindingIndex = lView[BINDING_INDEX] - 1;\n var value = INTERPOLATION_DELIMITER + prefix + INTERPOLATION_DELIMITER + su...
[ "0.6267212", "0.60427713", "0.56593645", "0.55850303", "0.5471504", "0.5471504", "0.5403233", "0.53985906", "0.5294107", "0.5273575", "0.5273575", "0.5267622", "0.5257634", "0.5246272", "0.52131855", "0.5172352", "0.5172352", "0.5172352", "0.5172352", "0.51494914", "0.5131228...
0.64312905
0
Returns the current OpaqueViewState instance. Used in conjunction with the restoreView() instruction to save a snapshot of the current view and restore it when listeners are invoked. This allows walking the declaration view tree in listeners to get vars from parent views.
function getCurrentView() { return Object(render3_state.m)(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getViewState() {\n return {\n moveArray: ViewStore.getMoveArray(),\n attackArray: ViewStore.getAttackArray(),\n fogOfWar: ViewStore.getMoveArray(),\n selectedShip: ViewStore.getSelectedShip(),\n selectedWeapon: ViewStore.getSelectedWeapon(),\n isLoaded: ViewStore.getLoadedState(),\n ...
[ "0.57306266", "0.5655595", "0.5655595", "0.56207705", "0.55299276", "0.5436721", "0.5388741", "0.5388741", "0.5388741", "0.5388741", "0.5388741", "0.5388741", "0.5388741", "0.5388741", "0.5388741", "0.5388741", "0.5388741", "0.5180585", "0.51686364", "0.51686364", "0.5140135"...
0.6187473
0
Handles an error thrown in an LView.
function handleError(lView, error) { var injector = lView[interfaces_view.k], errorHandler = injector ? injector.get(error_handler.a, null) : null; errorHandler && errorHandler.handleError(error); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleError(lView, error) {\n const injector = lView[INJECTOR];\n const errorHandler = injector ? injector.get(ErrorHandler, null) : null;\n errorHandler && errorHandler.handleError(error);\n}", "function handleError(lView, error) {\n const injector = lView[INJECTOR];\n const errorHandler...
[ "0.7280472", "0.7280472", "0.7280472", "0.7280472", "0.7280472", "0.7280472", "0.7280472", "0.7244458", "0.7244458", "0.7244458", "0.7138165", "0.7138165", "0.6770746", "0.65702736", "0.6520675", "0.6520675", "0.6477659", "0.64441484", "0.6094756", "0.59942347", "0.5976331", ...
0.7606708
0
Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on.
function throwErrorIfNoChangesMode(creationMode, oldValue, currValue) { var msg = "ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '" + oldValue + "'. Current value: '" + currValue + "'."; // TODO: include debug context throw ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function throwErrorIfNoChangesMode(creationMode, checkNoChangesMode, oldValue, currValue) {\n if (checkNoChangesMode) {\n var msg = \"ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '\" + oldValue + \"'. Current value: '\" + currValue + \"'.\";\n ...
[ "0.788194", "0.7601388", "0.7601388", "0.7601388", "0.75313616", "0.75313616", "0.75313616", "0.75313616", "0.75313616", "0.75313616", "0.75313616", "0.7389588", "0.7389588", "0.7389588", "0.72908247", "0.58963513", "0.58963513", "0.5894511", "0.588616", "0.588616", "0.588616...
0.76237005
1
draw terma et cetera (without clearing)
function draw(){ drawTerma(canvas,terma,TERMA_X,TERMA_Y); drawButtons(position); drawHelpIfEnabled(); drawAlertIfShowing(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "draw(){\n push();\n noFill();\n noStroke();\n rect(this.x,this.y,this.width,this.height);\n pop();\n }", "draw(){\n push();\n // fill(255,125);\n noFill();\n noStroke();\n rect(this.x,this.y,this.width,this.height);\n pop();\n }", "draw() {\n noStroke();\n fill(255);\n ...
[ "0.6989188", "0.6907482", "0.6896845", "0.68208", "0.6771648", "0.6734707", "0.67261416", "0.67236936", "0.67179084", "0.67035544", "0.66943014", "0.66823846", "0.66823846", "0.6651896", "0.6651896", "0.6643952", "0.6643952", "0.6642919", "0.6617137", "0.6614207", "0.66065025...
0.75248474
0
Verifica si existe una pregunta con el mismo id
function existePregunta (preguntas, idPregunta) { var existe = false; preguntas.forEach(function(pregunta) { if (pregunta.pregunta_id == idPregunta) existe = true; }); return existe; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filtrarPreguntas(elemento){\n for(var x = 0; x < App.leccion_nueva.preguntas.length; x++){\n if(elemento._id == App.leccion_nueva.preguntas[x].pregunta)\n return true;\n }\n return false;\n}", "id_exists(unique_id) {\n return this.participants[unique_id] !== undefined;\n }",...
[ "0.64769197", "0.6346509", "0.61450803", "0.6143777", "0.6039954", "0.59358525", "0.58880657", "0.587951", "0.5834056", "0.58301765", "0.5824975", "0.57802045", "0.57420695", "0.57126284", "0.56306064", "0.56106806", "0.559987", "0.55455893", "0.5543628", "0.5506158", "0.5499...
0.7908543
0
Modifica los datos(respuestas) de las preguntas
function modificarPregunta (preguntas, idPregunta, respuesta, comentario) { preguntas.forEach(function(pregunta) { if (pregunta.pregunta_id == idPregunta){ pregunta.alternativa = respuesta; pregunta.comentario = comentario; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "processUsers(respuesta) {\n // Se añade datos extra a la respuesta obtenida del servidor\n var res = JSON.parse(respuesta);\n var datos = res.data;\n\n try {\n for (var i = 0; datos != undefined && i < datos.length; i++) {\n var idPermiso = datos[i][0];\n ...
[ "0.6609891", "0.6460217", "0.64507806", "0.6388521", "0.63591826", "0.62952584", "0.628565", "0.62604094", "0.62260014", "0.6127018", "0.60758513", "0.6052073", "0.6051036", "0.6032876", "0.6000989", "0.59601784", "0.59576756", "0.59557533", "0.5927712", "0.58972675", "0.5885...
0.6757013
0
Obtiene las encustas de las aplicaciones
function getEncuestas() { var ids = []; $scope.aplicaciones.forEach(function(aplicacion) { ids.push(aplicacion.encuesta_id); }); EncuestasFactory.getEncuestas(ids) .then(function(response) { $scope.encuestas = response; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function encender(){\n console.log('servidor encendido');\n }", "function getEncuesta(){\n $scope.encuestaId = EncuestasFactory.getId();\n $scope.encuestaDescripcion = EncuestasFactory.getDescripcion();\n\t\t\t$scope.idAplicacion = EncuestasFactory.getIdAplicacion();\n getpre...
[ "0.60966516", "0.58579767", "0.56817615", "0.55694205", "0.54681903", "0.5436981", "0.5328525", "0.53248686", "0.53118885", "0.5305614", "0.52774805", "0.525939", "0.5251055", "0.5229312", "0.5225724", "0.52214706", "0.52056396", "0.5189998", "0.5166551", "0.5164303", "0.5163...
0.6754973
0
Guarda las respuestas de la encuesta
function guardarEncuesta() { if ($scope.preguntasRespondidas === null){ $scope.mensaje = true; $scope.msgEnviarEncuesta = 'No se ha respondido ni una pregunta'; $scope.styleEnviarEncuesta = 'error-box'; } else if ($scope.preguntasRespondidas.length < $scope.preguntasEncuesta.length){ $scope.men...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onexcute(err, res) {\n\t\t\tif (!err) {\n\t\t\t\tconsole.log(res)\n\t\t\t\tresult.Success = true;\n\t\t\t\tresult.Data=[];\n\t\t\t\tresult.Data.push(res.Item);\t\t\n\t\t\t\tconsole.log(\"success\");\n\t\t\t} else {\n\t\t\t\tresult.Success = false;\n\t\t\t\tresult.Data = [];\n\t\t\t\tresult.error = JSON.st...
[ "0.6245168", "0.59023243", "0.58778083", "0.58744323", "0.5856218", "0.5812846", "0.5783879", "0.5775953", "0.5745908", "0.57328224", "0.57025015", "0.57022274", "0.5692984", "0.5674114", "0.567269", "0.5628925", "0.55955935", "0.55267525", "0.55139494", "0.55075914", "0.5506...
0.65542847
0
Update the location list based on a change in the entered filter string
updateFilter(filter) { if (filter) { const match = new RegExp(EscapeRegExp(filter), 'i') const matchedLocations = this.state.locations.filter((location) => match.test(location.name)) this.setState({showingLocations: matchedLocations}) this.updateMarkers(matchedLoc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateFilter() {\n this.filterValue = this.filterEditedValue;\n }", "function onFilterFieldUpdate() {\n console.log('`onFilterFieldUpdate` ran');\n\n const input = $('.js-shopping-list-name-filter').val();\n\n console.log(`Updating filter to be \"${input}\"`);\n STORE.textFilter = input;\n renderShoppin...
[ "0.6621858", "0.6575143", "0.64239275", "0.6333958", "0.6308373", "0.62625265", "0.62297606", "0.6199724", "0.6183193", "0.6156804", "0.6138611", "0.6130379", "0.61253905", "0.61157256", "0.61097205", "0.60725695", "0.6049053", "0.60428506", "0.60415566", "0.60370827", "0.601...
0.7561365
0
Populate the selected location's details and bounce it's marker twice
showLocation(button) { this.state.showingLocations.map(location => { if (location.marker.title === button.innerHTML) { document.getElementsByClassName('detail-container')[0].innerHTML = location.detail location.marker.setAnimation(window.google.maps.Animation.BOUNCE) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "locationClick(e, i) {\n i = e.target.dataset.id;\n var marker = this.props.markers[i]\n marker.setAnimation(this.props.google.maps.Animation.BOUNCE);\n this.props.google.maps.event.trigger(marker, 'click');\n }", "function showInitMap(results) {\n // Hide the area to select bikes\n $('#ride-bi...
[ "0.64810336", "0.6460524", "0.64562756", "0.6451321", "0.6448533", "0.63994443", "0.638", "0.63604754", "0.6345722", "0.63450974", "0.63407165", "0.6306062", "0.6296018", "0.6295702", "0.6287155", "0.6281497", "0.6261735", "0.6243977", "0.6241317", "0.6240705", "0.6237855", ...
0.66311765
0
convert timeStamp firebase to time
static timeStampToTime(timeStamp){ // verify if exists timeStamp and typeof is method return (timeStamp && typeof timeStamp.toDate === 'function') ? Format.dateToTime(timeStamp.toDate()) : ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "timestampToDate(tstamp){\n\n return firebase.firestore.Timestamp.toDate(tstamp);\n\n }", "function timeConverter(timestamp){\n return `${timestamp.month}/${timestamp.day}/${timestamp.year}`;\n }", "function timeConverter(UNIX_timestamp){\n\treturn moment(UNIX_timestamp).format(\"DD-MM-YYYY ...
[ "0.70511097", "0.6866359", "0.6446294", "0.63638574", "0.6352411", "0.6301318", "0.6296993", "0.6292332", "0.62559175", "0.61876565", "0.6165703", "0.6154442", "0.614723", "0.6134673", "0.61316043", "0.6097713", "0.6096764", "0.60820216", "0.60801375", "0.60715294", "0.606903...
0.6996492
1
We start by checking if the browser supports the Clipboard object. If not, we need to create a contenteditable element that catches all pasted data
function wedit_registerClipboard(ed) { if (!window.Clipboard) { // We can hide the element and append it to the body, // pasteCatcher.style.opacity = 0; // document.body.appendChild(pasteCatcher); // as long as we make sure it is always in focus ed.focus(); // document.addEventListener("click", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_createPasteBin() {\n let el = this.surface.el.createElement('div')\n .attr('contenteditable', true)\n .attr('tabindex', -1)\n .css({\n position: 'fixed',\n opacity: '0.0',\n bottom: '-1000px',\n // width: '0px'\n })\n .append(\" \")\n .on('beforepaste',...
[ "0.7166307", "0.7034757", "0.7034757", "0.7034757", "0.69125015", "0.6863872", "0.67197037", "0.66462517", "0.6630168", "0.6623257", "0.6583195", "0.6555937", "0.6527424", "0.65059036", "0.65034246", "0.6496032", "0.64342797", "0.64254695", "0.6419368", "0.6418136", "0.640193...
0.70868075
1
Replace four with three
function replaceFourWithThree(){ domConstruct.place(three, four, "replace") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function divisibleReplace() {\n divisibleArray = countArray.slice();\n for (var i = 0; i < divisibleArray.length; i++) {\n if (countArray[i]%3 === 0 && countArray[i] !== 0) {\n divisibleArray.splice(i, 1, stringArray[stringArrayCounter]);\n }\n }\n}", "function replace4(str){\r\n const findInx =...
[ "0.62518615", "0.6205208", "0.60001785", "0.56886417", "0.56853944", "0.56497514", "0.56476814", "0.56096673", "0.55973876", "0.5503118", "0.5479775", "0.54744464", "0.5448427", "0.5442271", "0.5442271", "0.5327708", "0.5288279", "0.5269087", "0.5242615", "0.52046746", "0.519...
0.7607487
0
Sends one arguments to ajax/add.php: item_text: the text of the item to add to the list Returns boolean directive: does the form get submitted or not? true if Ajax functionality is not supported, false otherwise.
function add_post() { clear_error(); text = document.getElementById("item_text").value; url = "ajax_add.php?text=" + text; /* Make it so. */ if (loadXMLDoc(url)) { start_wait(); return false; // do not submit the form } else { return true; // no Ajax compatibility; submit the form } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addItem() {\n\tvar text = $(\"itemtext\").value.escapeHTML();\n\tif(text) {\n\t\tvar li = document.createElement(\"li\");\t\n\t\taddOneItem(li, text);\n\t\tli.highlight();\n\t}\n\tmakeAjaxRequest(\"post\", undefined, makeContent());\n}", "function addItem(){\n\t// This will submit the data and run the s...
[ "0.69100016", "0.6727392", "0.66102856", "0.6575035", "0.65250427", "0.6457619", "0.64042187", "0.6216726", "0.62121874", "0.6118397", "0.6116675", "0.60989255", "0.6096139", "0.6081535", "0.60790557", "0.60518014", "0.6040433", "0.6036004", "0.6013719", "0.6001356", "0.59870...
0.7695835
0
Receives the results of the add operation. the success flag of the operation: 1 if OK, 1 if failed the list index of the added item the text of the added item
function add_get() { response = req.responseXML.documentElement; success = response.getElementsByTagName('success')[0].firstChild.data; errorMsg = response.getElementsByTagName('error')[0].firstChild.data; clear_wait(); if (success != "1" ) { error("There was an error adding the item: " + errorMsg.toString())...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addItem() {}", "function addedOK(data){\n\tsay('added ok');\n}", "function add_item_success (data) {\n\tif (data.status == \"unknown_barcode\") {\n\t\talert_error(\"Could not find that item.\");\n\t} else {\n\t\t// Make sure this item isn't already on the list\n\t\tif ($(\"#restock-item-\" + data.id)....
[ "0.67125016", "0.6483639", "0.6410588", "0.6355941", "0.62898695", "0.62871546", "0.6284976", "0.62529093", "0.6184827", "0.6175127", "0.6168068", "0.6141526", "0.61283976", "0.6071337", "0.6047697", "0.6028445", "0.6026239", "0.6016629", "0.597618", "0.59656227", "0.5946846"...
0.65049106
1
Deletes stored palettes and refreshes interface.
function clearHistory () { localStorage.removeItem('palettes'); // remove the palettes from the page historyMarkupDelete(); loadHistory(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "destroy() {\n for (let key in this.data) {\n delete this.data[key];\n }\n localStorage.clear();\n }", "function deletePreset() {\r\n\tlocalStorage.removeItem('preset');\r\n\r\n\t$('.alert').hide();\r\n\t$('#alert-preset-clear').show();\r\n}", "function clearPreferences()\n{\n...
[ "0.63271534", "0.6282741", "0.60915136", "0.59683454", "0.5882605", "0.5862374", "0.58604026", "0.5816625", "0.5782205", "0.57133955", "0.57074296", "0.5697488", "0.5653314", "0.5644881", "0.56287664", "0.55992496", "0.5598181", "0.5588978", "0.55858606", "0.55708444", "0.557...
0.66680944
0
Write a function averageNumbers that receives an array of numbers and calculate the average of the numbers
function averageNumbers(numArray){ return sum / numbers.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function average(numbersArray) {\n return(total/numbersArray.length);\n}", "function averageNumbers(array) {\n\tif (array === undefined || array.length === 0) {\n\t\treturn null;\n\t}\n\tlet sum = 0;\n\tlet sumAvr;\n\tfor (let i = 0; i < array.length; i++) {\n\t\tsum = sum + array[i];\n\t\tsumAvr = sum / arra...
[ "0.8471925", "0.84668076", "0.84635174", "0.842644", "0.8363299", "0.8309602", "0.8286466", "0.8271522", "0.8260664", "0.8239177", "0.8231218", "0.8200183", "0.8194212", "0.8107989", "0.802306", "0.79813117", "0.7963828", "0.79515535", "0.79483604", "0.7939311", "0.79356843",...
0.90083796
0
Load the Google Natural Language API.
function initializeApi() { window.gapi.client.load('language', API_VERSION); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadGapi() {\n // Set the API key AIzaSyAlZqy1ElhVN_Hbutey0xNabhZ14bEpcAo\n // Ido - AIzaSyD_mrsCOGa_cip-_O9YzmruYQ831uQcqPE\n gapi.client.setApiKey('AIzaSyAlZqy1ElhVN_Hbutey0xNabhZ14bEpcAo');\n // Set: name of service, version and callback function\n gapi.client.load('birra', 'v1', getBeers);\n}", ...
[ "0.6647198", "0.65910506", "0.6544242", "0.6527482", "0.6516059", "0.6493829", "0.64765936", "0.6464663", "0.6458778", "0.64508456", "0.64438194", "0.6443756", "0.6414083", "0.63629925", "0.6353602", "0.6345494", "0.63229066", "0.63229066", "0.63229066", "0.63229066", "0.6254...
0.78667265
0
Authorize Google Natural Language API.
function authorization() { console.log('autorhisss'); window.gapi.client.setApiKey(API_KEY); window.gapi.auth.authorize({ client_id: CLIENT_ID, scope: SCOPES, immediate: false, }, (authResult) => { if (authResult && !authResult.error) { console.log('G Auth was successful!'); initiali...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function authorize() \n{\n\tvar request = require('request');\n request(\n\t{\n url: 'https://api-gw.it.umich.edu/token',\n method: 'POST',\n auth: \n\t\t{\n user: 'Client ID',\n pass: 'Client Secret'\n },\n form: \n\t\t{\n 'grant_type': 'clien...
[ "0.6202567", "0.6073392", "0.5921178", "0.58958447", "0.5855697", "0.58118063", "0.58042455", "0.5709164", "0.5697923", "0.56727016", "0.5606489", "0.55998737", "0.5596934", "0.5586184", "0.55843097", "0.5567666", "0.5565572", "0.5555515", "0.5509425", "0.5497793", "0.5466087...
0.6485813
0
Returns an array of tick angles and labels, given a group.
function groupTicks(d) { var k = (d.endAngle - d.startAngle) / d.value; return d3.range(0, d.value, 10).map(function(v, i) { return { angle: v * k + d.startAngle, label: i % 5 ? null : v / 10 }; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function groupTicks(d) {\n var k = (d.endAngle - d.startAngle) / d.value;\n return d3.range(0, d.value, 1000).map(function(v, i) {\n return {\n angle: v * k + d.startAngle,\n label: i % 5 ? null : v / 1000 + \"k\"\n ...
[ "0.6047182", "0.5947756", "0.5889069", "0.58341515", "0.5707782", "0.5688317", "0.5688317", "0.56557935", "0.56341064", "0.4917493", "0.49083075", "0.49065584", "0.4863881", "0.4857891", "0.48504248", "0.4817602", "0.47975674", "0.47727144", "0.47465742", "0.47285128", "0.472...
0.6099049
0
Arguments: cback: Callback for when things happen. options: Dictionary of settings: "type" 'isFile' renders file browser with file name box 'isDir' renders file browser with folder name box 'isCommit' renders file browser without file view, just commit box 'isProj' renders file browser without file view, just commit bo...
function Browser(cback, options) { // Public functions: // - clickSaveFile(bool noMsg): event handler for when save is clicked, if noMsg is true: ignore lack of commit msg // - clickCancelSave(): cancel and close browser // - dirSelected(): event handler for when a directory is selected in the left hand pane //...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fileBrowse(directory,doAfterType,doAfter){\n var folder;\n serverProxy.browseListFiles(directory).onReady(function(result){\n fileBrowser = result;\n resetScreen();\n var xmlPlaylistsInFolder = [];\n var selectedFile;\n document.getElementById('screen').insertA...
[ "0.60109", "0.55826414", "0.5508209", "0.54748863", "0.54557705", "0.5434687", "0.5301073", "0.5247416", "0.5247218", "0.5246369", "0.5183708", "0.51829004", "0.51803297", "0.5149417", "0.5121853", "0.5112306", "0.5083282", "0.5057162", "0.505229", "0.4988429", "0.49630517", ...
0.7151167
0
Layer and Src iframe loader
function loadidetailiframe(idetailurl, detailiframewidth, detailiframeheight, detailiframetop, detailiframeleft) { var newDiv2 = parent.document.createElement("div"); newDiv2.setAttribute("id", "whiteoutlayer"); newDiv2.innerHTML = " "; var my_div2 = parent.document.getElementById("bodypadding"); pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setup(parent, id, src, config={}){\n\t\tif( !src.startsWith('https://') ) config.src = this.getBlobURL(src, 'text/html') \n\t\telse config.src = src\n\t\tconfig.tag = 'iframe'\n\t\tconfig.frameBorder = 0\n\t\tconfig.name = id\n\t\treturn super.setup(parent, id, '', config) \n\t}", "loadOverlay(layer, src) {\n ...
[ "0.62989193", "0.6292661", "0.6272357", "0.6246102", "0.6233071", "0.6057659", "0.60314554", "0.6017083", "0.6015393", "0.60064375", "0.59796494", "0.59572166", "0.5956106", "0.5943246", "0.5905716", "0.58961385", "0.5893767", "0.5874321", "0.58212334", "0.5730495", "0.572631...
0.6314173
0
check for HTTP/HTTPS URL
function _isHTTP(url) { return (url.indexOf('http://') === 0 || url.indexOf('https://') === 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function urlCheck(url) {\n url = url.toLowerCase();\n\n if (url.startsWith(\"http:\") || url.startsWith(\"https:\") || url.startsWith(\n \"/api\")) {\n return true;\n }\n return false;\n }", "function isvalidUrl(url){\n return url.startsWith(\"http://\") || url.startsWith(\"https://\");...
[ "0.77102894", "0.75895", "0.7512495", "0.73024356", "0.7274662", "0.7258735", "0.7243917", "0.720136", "0.7161766", "0.715139", "0.7127759", "0.7074056", "0.7015977", "0.7013696", "0.6994952", "0.6976625", "0.694189", "0.6901437", "0.68070096", "0.6795064", "0.6789096", "0....
0.8053768
1
init common jsonld options
function _jsonLdOptions(command, input) { const options = {}; if(command.allow) { // split allow modes options.allow = command.allow.split(','); if(options.allow.includes('all')) { options.allow = ALLOW_ALL; } else if(options.allow.includes('none')) { options.allow = ALLOW_NONE; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _jsigsOptions(command, input) {\n var options = {};\n\n // setup base\n if(command.base) {\n // explicit base set\n options.base = command.base;\n } else if(input !== '-') {\n // only setup base if not stdin\n // use input as base if it looks like a URL\n // use a file URL otherwise\n ...
[ "0.6469586", "0.6263039", "0.6083327", "0.6055282", "0.6037374", "0.59652096", "0.59649116", "0.59649116", "0.5962653", "0.59591514", "0.59519404", "0.5884571", "0.5859908", "0.57990664", "0.5745828", "0.56977427", "0.566972", "0.5604324", "0.55465215", "0.5532257", "0.552863...
0.70345616
0
function displays all products with fewer than 200 units in stock
function viewLowInventory() { connection.query("SELECT * FROM products WHERE stock_quantity < 200", (err, res) => { if (err) throw err; console.log("\n===========LOW INVENTORY ITEMS (UNDER 200 UNITS)===========\n"); console.table(res); managerCommands(); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayLowProducts(){\n connection.connect();\n connection.query('SELECT * from products', function (error, results, fields) {\n if (error) throw error;\n for(let i =0; i < results.length; i ++){\n if(results[i].stock_quantity > 5){\n console.log(`id:${results[i...
[ "0.76738054", "0.7181188", "0.7104063", "0.6960765", "0.6912465", "0.6910313", "0.69100076", "0.6900007", "0.68753356", "0.68388736", "0.68121827", "0.67657137", "0.67416567", "0.673377", "0.67297053", "0.6728939", "0.67163455", "0.67010707", "0.6699486", "0.6695682", "0.6686...
0.7211461
1
Convert a JSKOS mapping into a Wikidata claim. Only 1to1 mappings from Wikidata to another concept scheme are supported. JSKOS fields fromScheme and toScheme are ignored.
mapMapping(mapping, options = {}) { const { simplify } = options if (!mapping.from || !mapping.to || !mapping.from.memberSet || !mapping.to.memberSet) { throw new ServiceError("incomplete JSKOS mapping object") } else if (mapping.from.memberSet.length != 1 || mapping.to.memberSet.length != 1)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapper(obj){\n return {\n has_citation_source_type: {pre:'risk',value:obj.type.toString(),type:\"string\"},\n has_citation_source_level: {pre:'risk',value:obj.level.toString(),type:\"integer\"},\n has_citation_summary: {pre:'risk',value:obj.summary.toString(),type:\"string\"},\n has...
[ "0.4962337", "0.46653068", "0.4514188", "0.4493752", "0.42488858", "0.423054", "0.423054", "0.42292297", "0.42154154", "0.42154154", "0.42132154", "0.42019102", "0.42005703", "0.41437545", "0.41134897", "0.4112224", "0.40973395", "0.40874326", "0.4066163", "0.40641385", "0.40...
0.6849105
0
This simple directive is used on forms which have a datangmodel attribute that acts as a switch in the form's datamodel, basically as a declarative, but directivebased method for doing stuff on form submit. The initial value of the datangmodel attribute can be defined dynamically as the controller is loaded, referencin...
function submitHandlerDirective($log, $window, $timeout) { return { restrict: 'A', link: function($scope, $element, $attrs) { var toggleBool = toggleBool || false; $element.on('submit', function(event) { var dataModel = event.target.getAttribute('data-ng-model'), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FormFieldDirective() {\n return {\n restrict: 'E',\n scope: {\n label: '=',\n data: '='\n },\n controller: function($scope) {\n\n $scope.isFocused = false;\n $scope.isBlurred = false;\n\n $scope.focus = function() {\n $scope.isFocused = true;\n $scope.is...
[ "0.61030906", "0.5262209", "0.5235728", "0.51639223", "0.5150917", "0.51128465", "0.51128465", "0.51128465", "0.51128465", "0.51128465", "0.51128465", "0.51128465", "0.51128465", "0.51128465", "0.4973701", "0.48838907", "0.48703715", "0.48676467", "0.48573828", "0.48424497", ...
0.58438224
1
convert pressure from dPa to mmHg
function dPaToMmHg (pressure) { return Math.round(pressure / 10 * 760.001 / 101.325); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hpaToMmhg(pressure) {\n pressure /= 1.333333;\n\treturn pressure;\n}", "function pressure (h) {\n return _calc(PRESSURE, h)\n}", "convertMPH()\n {\n this.kph = parseFloat((this.mph * 1.609344).toFixed(2));\n this.mach = parseFloat((this.mph / 761.207).toFixed(2));\n this.knots = ...
[ "0.78728974", "0.6340064", "0.6291244", "0.60840154", "0.60299057", "0.60086894", "0.6005133", "0.59354305", "0.5885801", "0.58286786", "0.57994825", "0.57742786", "0.57678145", "0.57605946", "0.5668095", "0.5650142", "0.55750924", "0.555026", "0.5543104", "0.5543104", "0.552...
0.90891266
0
return true if now is daytime based on sunrise and sunset provided
function isDaytimeNow (sunrise, sunset) { var now = Date.now(); return (now >= sunrise && now < sunset); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isDay({ sunrise, sunset }) {\n const now = new Date();\n const b4Sunrise = sunrise - (INTERVAL * MINUTES);\n const b4Sunset = sunset - (INTERVAL * MINUTES);\n return now > b4Sunrise && now < b4Sunset;\n }", "_checkSuntimes(times) {\n\t\tfunction sameDay(t1, t2) {\n\t\t\tlet\tdate = (t1.getDate() == ...
[ "0.8425633", "0.7262413", "0.7079936", "0.70200086", "0.69833124", "0.63829863", "0.62973917", "0.61450434", "0.6119444", "0.609806", "0.59577364", "0.59376246", "0.58609176", "0.58484125", "0.58236253", "0.577316", "0.57394123", "0.5719975", "0.56689584", "0.56535655", "0.56...
0.88718927
0
Check if we can sink the list.
function canSink(initialIndentationLevel, state) { /* - Keep going forward in document until indentation of the node is < than the initial - If indentation is EVER > max indentation, return true and don"t sink the list */ let currentIndentationLevel; let currentPos = state.tr.selecti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "canJoin() {\n if(this.playerList.length < this.playerLimit){\n return true\n }\n return false\n }", "function checkListAccess(list, access, res) {\n /* Check that the list exists */\n if (!list) {\n\t\tConsole.warn(`Did not find a list matching _id: ${res.locals.id}`);\n ...
[ "0.575047", "0.5734084", "0.55274916", "0.5482835", "0.54519737", "0.5430516", "0.5430516", "0.5430516", "0.5430516", "0.5392593", "0.5351999", "0.53327703", "0.53242177", "0.53178096", "0.53137696", "0.53137696", "0.53095984", "0.52616215", "0.52616215", "0.5244395", "0.5180...
0.6409576
0
Deploys different versions of the applet depending on Java version. Useful for removing warning dialogs for Java 6. This function is optional however, if used, should replace the method. Needed to address MANIFEST.MF TrustedLibrary=true discrepency between JRE6 and JRE7.
function deployQZ() { var attributes = {id: "qz", code:'qz.PrintApplet.class', archive:'/jar/qz-print.jar', width:1, height:1}; var parameters = {jnlp_href: '/jar/qz-print_jnlp.jnlp', cache_option:'plugin', disable_logging:'false', initial_focus:'false'}; if (deployJava.versionCheck("1.7+") == true) {} else i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ant_utils_checkCompatibility() {\r\n\tlet newClass = new ant_alert();\r\n\tnewClass.setButtonLabel('Just a test');\r\n\tif (document.getElementById('ant_compatibilityScript') !== null) {\r\n\t\tsetTimeout(() => {\r\n\t\t\tdocument.getElementById('ant_compatibilityScript').remove();\r\n\t\t}, 1000);\r\n\t}...
[ "0.49483326", "0.48938286", "0.48841777", "0.48753455", "0.479749", "0.47780192", "0.47431302", "0.47097623", "0.46814185", "0.46769673", "0.46311256", "0.45943132", "0.4587768", "0.45528036", "0.45447353", "0.45439568", "0.45432562", "0.45329154", "0.44923216", "0.44708323", ...
0.49102116
1
Returns whether or not the applet is not ready to print. Displays an alert if not ready.
function notReady() { // If applet is not loaded, display an error if (!isLoaded()) { return true; } // If a printer hasn't been selected, display a message. else if (!qz.getPrinter()) { alert('Please select a printer first by using the "Detect Printer" button.'); return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isLoaded() {\n\tif (!qz) {\n\t\talert('Error:\\n\\n\\tPrint plugin is NOT loaded!');\n\t\treturn false;\n\t} else {\n\t\ttry {\n\t\t\tif (!qz.isActive()) {\n\t\t\t\talert('Error:\\n\\n\\tPrint plugin is loaded but NOT active!');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch (err) {\n\t\t\talert('Error:\\n\...
[ "0.6483287", "0.57034504", "0.5684773", "0.56827116", "0.5644729", "0.5573064", "0.5558115", "0.55387795", "0.55084306", "0.54307544", "0.54046965", "0.53420246", "0.5339903", "0.53157187", "0.530072", "0.52848727", "0.52762544", "0.52743834", "0.52731323", "0.5265957", "0.52...
0.8371956
0
Automatically gets called when "qz.print()" is finished.
function qzDonePrinting() { // Alert error, if any if (qz.getException()) { alert('Error printing:\n\n\t' + qz.getException().getLocalizedMessage()); qz.clearException(); return; } // Alert success message //alert('Successfully sent print data to "' + qz.getPrinter() + '" queue.'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static complete() {\n novelData.printer.printCompleted = true;\n novelData.printer.currentOffset = 0;\n // Re-enable skip button\n UI.enableSkipButton();\n // Play missed sounds and start missed music\n this.executeBuffers();\n // Set printed text and update choices\n novelData.printer.curr...
[ "0.7033091", "0.58783597", "0.58571106", "0.567249", "0.5663791", "0.56207204", "0.5604015", "0.5594363", "0.5561882", "0.5549206", "0.5522172", "0.5521547", "0.5520746", "0.5446721", "0.5442705", "0.5442602", "0.54208976", "0.5419104", "0.54137003", "0.54091084", "0.54091084...
0.8097149
0
Fixes some html formatting for printing. Only use on text, not on tags! Very important! 1. HTML ignores white spaces, this fixes that 2. The right quotation mark breaks PostScript print formatting 3. The hyphen/dash autoflows and breaks formatting
function fixHTML(html) { return html.replace(/\n/g, "").replace(/ /g, "&nbsp;").replace(/’/g, "'").replace(/-/g,"&#8209;"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatHtml(str) {\n return str\n .replace(/\\s+/g, ' ')\n .replace(/<br *\\/*>/g, ' ')\n .replace(/`([^`]*)`/g, '<code>$1</code>');\n }", "function format_spacing(html_line) {\n\t// make space hexcode consistent\n\tlet cleaned = replace_invisible_nbsp(html_li...
[ "0.62058693", "0.6087035", "0.60770655", "0.6075621", "0.6073873", "0.60413283", "0.5907219", "0.5897245", "0.5897245", "0.5897245", "0.5884249", "0.5884249", "0.5884249", "0.5884249", "0.5884249", "0.5836532", "0.58082825", "0.58082825", "0.58082825", "0.5803405", "0.5798422...
0.696301
0
Prototype function for printing an HTML screenshot of the existing page Usage: (identical to appendImage(), but uses html2canvas for png rendering) qz.setPaperSize("8.5in", "11.0in"); // US Letter qz.setAutoSize(true); qz.appendImage($("canvas")[0].toDataURL('image/png'));
function printHTML5Page() { html2canvas(document.body, { width: 800, height: 1200, canvas: hidden_screenshot, onrendered: function() { if (notReady()) { return; } // Optional, set up custom page size. These only work for PostScript printing. // setPaperSize() must be called before setAutoSize(), setO...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function screenshot() { \n if (screen.width > 0 && screen.height > 0) {\n try {\n html2canvas(document.body, {\n allowTaint: false,\n logging: true,\n taintTest: false,\n useCORS: true,\n ...
[ "0.62218237", "0.6211272", "0.611895", "0.6104348", "0.6023415", "0.5955316", "0.5936133", "0.59251016", "0.58585346", "0.585777", "0.58482516", "0.57514614", "0.5711241", "0.5703944", "0.56969374", "0.5668169", "0.562326", "0.56060445", "0.56024885", "0.559769", "0.55717784"...
0.78006446
0
description: sends the mail param: mailOptions return: none
function sendMail(mailOptions) { transporter.sendMail(mailOptions, function(error, info){ if (error) { console.log(error); } else { console.log('Email sent: ' + info.response); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sendMail(options) {}", "function envia(mailOptions, callback){\n\ttransporter.sendMail(mailOptions, callback);\n}", "function sendMail(mailOptions) {\n MailComposer.composeAsync(mailOptions);\n // TODO: check promise resolution?\n}", "function sendEmail(mailOption, callback) {\n smtpTransport.sendMa...
[ "0.881218", "0.759237", "0.75868595", "0.74441457", "0.735579", "0.7127503", "0.71005994", "0.69959456", "0.6802336", "0.67869633", "0.6752967", "0.6747147", "0.67152566", "0.6693747", "0.6681244", "0.6661824", "0.65964115", "0.6586836", "0.65604", "0.65069187", "0.6482926", ...
0.7929703
1
calculation parameters: a = address(this).balance b = totalFunded c = buyers[buyer].totalFunded d = buyers[buyer].totalBought e = wtokensToRefund f = token decimals formula: ( ( c (a / b) ) / d ) e = (refund amount)
function calculateRefundAmount(a, b, c, d, e, f) { a = new BigNumber(a); b = new BigNumber(b); c = new BigNumber(c); d = new BigNumber(d); e = new BigNumber(e); f = new BigNumber(f); const p_com = (new BigNumber(10)).pow(f.plus(8)); const max = BigNumber.UINT_MAX.div(p_com); let re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function budgetCalculator(fridge, ac, macbook) {\n if (fridge < 0 || ac < 0 || macbook < 0) {\n return \"Error :- You are requested to enter a positive value\";\n }\n else if (fridge % 1 != 0 || ac % 1 != 0 || macbook % 1 != 0){\n return \"Error :- Enter a Float Number\" \n }\n \n //...
[ "0.6658557", "0.6536162", "0.6165503", "0.614755", "0.60919577", "0.5995534", "0.5992615", "0.5987137", "0.5982546", "0.5956672", "0.5955607", "0.59503114", "0.5937293", "0.5916307", "0.5912473", "0.59040815", "0.5900351", "0.58895075", "0.58830833", "0.5848005", "0.58305347"...
0.6689779
0
Generate an array of React components that represents the player "cards" with a button to add them to the team.
buildPlayerList() { var players = this.state.players; var res = []; var i = 0; if ( players == undefined || players.length < 1) return; for (i = 0; i < players.length; i++){ res[i] = <Col key={ i } xs={XS} sm={SM} md={MD} lg={LG}> <Thumbnail src={PLAYER...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addTeamPlayerCards(playerArray) {\n if (playerArray) {\n var playerCardHTML = '';\n\n playerArray.forEach((player) => {\n playerCardHTML += `<span class=\"team-card\"><div class=\"team-card-image\">\n <img src=\"${player.playerThumb}\" alt=\"\"></div><div class=\"team-card-playername\">...
[ "0.7290526", "0.6973563", "0.69705963", "0.6924139", "0.69067794", "0.6843178", "0.6806206", "0.674615", "0.67430675", "0.66974723", "0.6664972", "0.6624054", "0.6615825", "0.66040754", "0.660168", "0.65642786", "0.6507095", "0.6476133", "0.6469527", "0.6469077", "0.64382625"...
0.70805955
1
If this component loaded call getPlayers().
componentDidMount() { this.getPlayers(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _initPlayers() {\n return dataservice.getPlayers().then(function(players) {\n self.players = players;\n $rootScope.$broadcast('modelservice::players_loaded');\n }).catch(function(err) {\n console.error(err);\n }); \n ...
[ "0.74098164", "0.69275135", "0.6840914", "0.68355715", "0.6830226", "0.6783705", "0.67444825", "0.67260545", "0.672253", "0.6693769", "0.66532964", "0.65969473", "0.65292734", "0.6456658", "0.6454982", "0.6434106", "0.6432115", "0.6346688", "0.634013", "0.6336136", "0.6279767...
0.7173606
1
atribui a operacao escolhida ao objeto calculo
function atribuirOperacao(operador){ if(operador == "+"){ calculo.funcaoParaCalcular = somarValores; } else if (operador == "-"){ calculo.funcaoParaCalcular = subtrairValores; }else if (operador == "*"){ calculo.funcaoParaCalcular = multiplicarValores; }else if (operador == "/"){...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "calcular(){\r\n this.num1 = parseFloat(this.num1);\r\n switch(this.operador){\r\n case operacion.SUMAR:\r\n this.num1+=this.num2;\r\n break;\r\n case operacion.RESTAR:\r\n this.num1 = this.num2-this.num1;\r\n break;\r\n...
[ "0.658796", "0.65275043", "0.6524209", "0.6383715", "0.62108135", "0.61946124", "0.6172521", "0.6139676", "0.60936123", "0.60669166", "0.60271573", "0.6025381", "0.60144556", "0.59622496", "0.59295344", "0.58871996", "0.5871347", "0.58670294", "0.5865571", "0.5852706", "0.583...
0.71051073
0
Function for switching which CSS file is used when user toggles dark/light mode
function darkMode() { let darkSwitch = $("#toggle-switch").is(":checked"); if (darkSwitch === true) { $("link[rel=stylesheet]").attr({ href: "dark-style.css" }); } else { $("link[rel=stylesheet]").attr({ href: "light-style.css" }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function switchColor(){\n var style = main_css.attributes.href.value;\n console.log(style);\n style ===\"./css/light.css\"? setStyle(styles.dark):setStyle(styles.light);\n \n}", "function switchTheme() {\n dark = !dark;\n if (dark) {\n themeCSS.setAttribute(\"href\", \"css/light.css\");\...
[ "0.79671526", "0.7661467", "0.74645984", "0.7430338", "0.7331134", "0.7329288", "0.73277235", "0.73196393", "0.7277994", "0.7172119", "0.7146908", "0.7145678", "0.70443046", "0.70021915", "0.70016843", "0.699991", "0.6999788", "0.6996025", "0.69717705", "0.6880087", "0.686959...
0.79802597
0
Function for showing/hiding answers table after quiz is completed
function showAnswersTable() { console.log("show answers firing"); let answersTable = $(".answers-table"); let showBtn = $(".show-answers-btn"); if ($(showBtn).text() == "Show Answers") { $(answersTable).show(); $(showBtn).text("Hide Answers"); } else { $(answersTable).hide(); $(showBtn).text...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayQuestions() {\n $('#quizArea').show();\n }", "function showAnswer()\n {\n display_element.html(trial.base_html);\n display_element.append(\"<table id='ctrtable'><tr><td><p>You answered:<br><strong>\"+trial.answer_strings[responseIndex]+\"</strong></p></td></tr></table...
[ "0.74936986", "0.7466724", "0.7406229", "0.740105", "0.72405887", "0.72185206", "0.72157395", "0.71620953", "0.7152383", "0.7032489", "0.69747597", "0.6949553", "0.69424874", "0.6939834", "0.6932781", "0.69317853", "0.6921182", "0.69001085", "0.6893592", "0.68740606", "0.6863...
0.7617525
0
Function for savingAnswers, which is given the selectedAnswers array and currentQuestion as parameters
function saveAnswer(selectedAnswers, currentQuestion) { //Loop through the input options, and check if the radio button for that input option is checked //if it is, creating new instance of UsersAnswer and passing in that value //setting that to it's corresponding position in the selectedAnswers array for (let ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveCurrentAnswer() {\r\n const selections = UI.getSelectedAnswers();\r\n currentQuestion().userAnswers = selections;\r\n}", "function quizQuestionSave(){\n quizObject.correctAnswers = DataService.corectAnswers;\n for(i = 0; i<DataService.quizQuestionsData.length; i++){\n if(DataS...
[ "0.8057787", "0.6965885", "0.6788039", "0.6586874", "0.63787776", "0.6337936", "0.6319709", "0.63106525", "0.6302596", "0.62689596", "0.61697185", "0.6127535", "0.61233026", "0.6089194", "0.6077914", "0.60748094", "0.6044532", "0.6024966", "0.59919643", "0.59883904", "0.59815...
0.8122507
0
Automatically place decimal point in string 'n'
function autoDecimal(n) { if (!n) { return n; } var puredigits = n.replace(/\D/g, ''), //remove non-digits floatstr = (parseFloat(puredigits || 0) / 100).toString(), // add decimal decpos = floatstr.indexOf("."); if (decp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addDots(n)\r\n{\r\n\tn += '';\r\n\tvar rgx = /(\\d+)(\\d{3})/;\r\n\twhile (rgx.test(n)) {\r\n\t\tn = n.replace(rgx, '$1' + '.' + '$2');\r\n\t}\r\n\treturn n;\r\n}", "function formatDecimal(val, n) {\n n = n || 2;\n var str = \"\" + Math.round ( parseFloat(val) * Math.pow(10, n) );\n while (str....
[ "0.7472642", "0.730979", "0.71884865", "0.71169096", "0.68838036", "0.68150085", "0.68134075", "0.6805545", "0.6801709", "0.6733281", "0.6729455", "0.6679481", "0.667626", "0.6640684", "0.6640684", "0.66210175", "0.66165555", "0.66123563", "0.66051775", "0.6601055", "0.657717...
0.788866
0
Then create two additional classes Ninja and Wizard. These classes should inherit from the human class. The Ninja class should have the following properties: health (200), isAlive(true), and attack power(user passes). The Ninja class should have a method called 'meditate' that restores the instances health to full and ...
function Human () { this.health = 100; this.isAlive = true; this.attackPower = 5; this.rest = function () { this.health += 5; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Warrior(name, level, weapon) {\n //chain constructor with call\n Hero.call(this, name, level);\n //add new property\n this.weapon = weapon;\n}", "function NinjaClassI(name){\n const speed = 3;\n const strength = 3;\n this.health = 100;\n this.name = name;\n\n this.sayName = function() {...
[ "0.67547095", "0.65981746", "0.65964353", "0.6565887", "0.64499986", "0.63903505", "0.6389426", "0.6376779", "0.6370191", "0.6366688", "0.6362899", "0.63515574", "0.631038", "0.6280308", "0.6263544", "0.62633073", "0.62522113", "0.62315696", "0.62266904", "0.62210906", "0.621...
0.6754257
1
Return true if snake head's position is the same as the food's position
canEat() { let head = this.snake.getHead(); if (head.x === this.food.x && head.y === this.food.y) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isFoodPositionTaken() {\n for(var i = 0; i < snakePosition.length; i++) {\n var p = snakePosition[i];\n if(p[1] === foodPosition[1] && p[0] === foodPosition[0]) {\n return true;\n }\n }\n\n return false;\n}", "function checkFoodEaten() {\n var snakeHead = snak...
[ "0.79435384", "0.7901086", "0.77468705", "0.77218646", "0.77027327", "0.76338077", "0.76149136", "0.7557144", "0.7501764", "0.7462051", "0.74362636", "0.73918074", "0.7329035", "0.72957444", "0.7220436", "0.71270996", "0.71180004", "0.7061316", "0.70491976", "0.70482147", "0....
0.79817986
0
function to get all new released netflix data from the last 30 days then save it to the database onClick event which needs to be moved to the admin page when created
function saveNetflix(event) { event.preventDefault(); API.saveNetflix() .then(console.log("we have success")) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onDateChanged() {\n this._fetchData();\n const urlParams = MrChart.getSearchParams();\n\n // TODO(zhangtiff): Integrate with frontend routing once charts is part of the SPA.\n urlParams.set('start-date', this.startDate.toISOString().substr(0, 10));\n urlParams.set('end-date', this.endDate.toISOStri...
[ "0.58125544", "0.5601265", "0.55964935", "0.55567217", "0.54721963", "0.5463098", "0.5405548", "0.5395348", "0.53808254", "0.5352316", "0.53200185", "0.53187275", "0.52823603", "0.5260219", "0.5256704", "0.5256118", "0.52374166", "0.5231429", "0.52261245", "0.5218318", "0.515...
0.593057
0
maximize the height of an element
function maximize(element) { if (element && element.style) { element.style.height = '100%' } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function maxHeight(el){\n\t\t$(el).css('minHeight', $(window).height());\n\t}", "function updateSize(elem) {\r\n elem.style.height = \"\";\r\n elem.style.height = Math.min(elem.scrollHeight, 800) + \"px\"\r\n reviewCut(elem)\r\n}", "setOptimalHeight() { // TODO: Why the fuck it doesn't recount when th...
[ "0.74038786", "0.7047898", "0.69694495", "0.68734485", "0.6742738", "0.6738588", "0.67282945", "0.67211825", "0.6708259", "0.6707865", "0.670471", "0.66184396", "0.6608576", "0.6608025", "0.65365183", "0.6511177", "0.6476091", "0.6458233", "0.64442253", "0.6424653", "0.640544...
0.7749736
0
Autotext (buttons under chatbox with automatic replies)
function autotext_buttons() { if ( ! iss(localStorage.autotext) || ( localStorage.autotext == '' ) ) store('autotext', 'Ok\nOk?\nWait!\nThinking\nEnd my turn\nEOT') ; // Default values for autotext var autotexts = localStorage.autotext.split('\n') ; autotexts = autotexts.filter(function(param) { return ( param != ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function replyBot() {\n setTimeout(function() {\n\n //cambio valore alle proprietà dell'oggetto\n content.text = 'Ok'\n content.status = 'received';\n\n var newMessage = template(content);\n messages.append(newMessage);\n\n }, 1000);\n }",...
[ "0.67820996", "0.65470433", "0.653391", "0.65246856", "0.6469688", "0.6448818", "0.6424419", "0.6413034", "0.6356819", "0.63270766", "0.62791485", "0.6277055", "0.6269094", "0.62660253", "0.62559813", "0.6248978", "0.6228771", "0.6193297", "0.61769074", "0.61577415", "0.61546...
0.70941794
0
Payment Info hide all payment options
function hideAllPaymentOptions() { hide(creditCardPaymentDiv); hide(paypalPaymentDiv); hide(bitcoinPaymentDiv); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hidePaymentMethod(card = true, paypal = true, bitcoin = true) {\n CARD_INFO.hidden = card;\n PAYPAL_INFO.hidden = paypal;\n BITCOIN_INFO.hidden = bitcoin;\n }", "function updatePaymentMethod() {\n for (let i = 0; i < paymentOptions.length; i++) {\n const paymentOption = paymentOptions[i];\...
[ "0.74969643", "0.70408857", "0.6901645", "0.6884297", "0.6672333", "0.66508234", "0.6648227", "0.6567962", "0.6510387", "0.64802974", "0.6448457", "0.6423354", "0.6365245", "0.63076806", "0.62997925", "0.6298479", "0.6255078", "0.6229665", "0.61826754", "0.6176382", "0.616945...
0.79273874
0
add error styling to fieldset legend
function displayFieldsetError(legend, errMsg) { legend.insertAdjacentHTML('beforeend', `<span class="error sm-error"><br>${errMsg}</span>`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeFieldsetError(legend) {\n\tconst spanError = legend.querySelector('span');\n\tif (spanError) {\n\t\tlegend.removeChild(spanError);\n\t}\n}", "function HighLightError(element) {\r\n // Highlight bottom border element\r\n if (!$(element).hasClass('frmError_Validate')) {\r\n $(element).a...
[ "0.676736", "0.64649916", "0.63115305", "0.62738454", "0.6195505", "0.6147521", "0.6036596", "0.59775054", "0.5976981", "0.597653", "0.5973194", "0.5963984", "0.59599614", "0.5944452", "0.58806556", "0.5877317", "0.5871084", "0.5863245", "0.58502936", "0.5840358", "0.5822049"...
0.74240524
0
removes error styling from fieldset legend
function removeFieldsetError(legend) { const spanError = legend.querySelector('span'); if (spanError) { legend.removeChild(spanError); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeAllErrorStyling() {\n\t// select all elements with class 'error'\n\tconst errorElements = document.querySelectorAll('.error');\n\tfor (let i = 0; i < errorElements.length; i++) {\n\t\t// remove error class from all\n\t\terrorElements[i].classList.remove('error');\n\n\t\tif (errorElements[i].tagName ...
[ "0.67871565", "0.67372054", "0.6713323", "0.6451804", "0.64034426", "0.62914896", "0.62860686", "0.62270343", "0.61606747", "0.61153114", "0.60702175", "0.6069304", "0.6068507", "0.6056128", "0.6026472", "0.59803873", "0.597589", "0.5963667", "0.596261", "0.5962221", "0.59397...
0.75029224
0
removes all error styling from page
function removeAllErrorStyling() { // select all elements with class 'error' const errorElements = document.querySelectorAll('.error'); for (let i = 0; i < errorElements.length; i++) { // remove error class from all errorElements[i].classList.remove('error'); if (errorElements[i].tagName === 'LABEL') { // ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cleanErrors(){\n var selector = thisInstance.constants.selector;\n $(selector.errorMessageDiv).html(\"\");\n $(selector.errorMessageDiv).addClass(\"hide\");\n $(selector.errorStateDiv).removeClass(thisInstance.constants.classes.errorStateEnable);\n }", "function cleanOldEr...
[ "0.72236", "0.7039145", "0.6998791", "0.6957277", "0.6819805", "0.6710389", "0.6667281", "0.66642183", "0.6605246", "0.65914786", "0.6529529", "0.6508443", "0.6469341", "0.6445026", "0.6417155", "0.6355371", "0.6335962", "0.631342", "0.6313035", "0.6277657", "0.6275094", "0...
0.7648709
0
check for error on email input
function checkEmailInputErrors() { if (registration.email().length === 0) { // remove any error formatting that already exists removeInputError(emailInput); // apply new error displayInputError(emailInput, '(please provide an email address)'); // return error message return 'Please provide an email address...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emailCheck() {\r\n var errorMsg = \"\";\r\n var email = getId('email').value;\r\n var pattern = /[a-zA-Z0-9_\\-.]+@[a-zA-Z0-9\\-.]+\\.((com)|(edu)|(org)|(net)|(au))/;\r\n\r\n // input does not match pattern\r\n if (!pattern.test(email)) errorMsg = \"Wrong email format\";\r\n \r\n r...
[ "0.7416877", "0.7416408", "0.73849326", "0.7290959", "0.7256259", "0.7227609", "0.722672", "0.72084504", "0.71957046", "0.7192131", "0.71894026", "0.71893865", "0.7178435", "0.71524215", "0.71380526", "0.7137162", "0.71327305", "0.71288335", "0.71217215", "0.71208", "0.711742...
0.7679936
0
check credit card number input errors
function checkCreditCardNumberErrors() { if (registration.payment.cardNumber().length === 0) { // remove any error formatting that already exists removeInputError(ccNumInput); // apply new error displayInputError(ccNumInput, '(enter a credit card number)'); // return error msg return 'Please enter a credit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validCCNum() {\n\tlet valid = true;\n\tlet errorMessage;\n\tlet num = ccNum.value;\n\tif (num === '') {\n\t\terrorMessage = 'Please enter credit card number';\n\t\tvalid = false;\n\t} else {\n\t\tfor (let i = 0; i < num.length; i++) {\n\t\t\tif (num[i].charCodeAt() > 57 || num[i].charCodeAt() < 48) {\n\t\...
[ "0.7862528", "0.77977514", "0.7653753", "0.7652822", "0.7539258", "0.7453828", "0.7452387", "0.74490184", "0.74445885", "0.7358435", "0.73520243", "0.7337159", "0.733558", "0.73203814", "0.72803324", "0.7224836", "0.7214447", "0.7213426", "0.7203857", "0.7198103", "0.7192892"...
0.8255363
0
check zipcode input errors
function checkZipcodeInputErrors() { if (registration.payment.zipCode().length === 0) { // remove any error formatting that already exists removeInputError(zipInput); // apply new error displayInputError(zipInput); // return error msg return 'Please provide a zipcode.'; } else if (registration.payment.z...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validate_zip(value){\n var zip = clean_nonnumber(value);\n return validate(zip.length, eq, 5);\n }", "function validZipCode() {\n\tlet result = true;\n\tlet num = zipCode.value;\n\tif (num === '') result = false;\n\tfor (let i = 0; i < num.length; i++) {\n\t\tif (num[i].charCodeAt() > 57 || num[i...
[ "0.7763925", "0.7709635", "0.76727504", "0.76719946", "0.7605017", "0.7596384", "0.75854975", "0.75766444", "0.7486075", "0.7449575", "0.74084973", "0.73973906", "0.73645943", "0.73242164", "0.7303876", "0.7285098", "0.728135", "0.72391033", "0.72382444", "0.71866685", "0.718...
0.7924574
0
check cvv input errors
function checkCVVInputErrors() { if (registration.payment.cvv().length === 0) { // remove any error formatting that already exists removeInputError(cvvInput); // apply new error displayInputError(cvvInput); // return error msg return 'Please provide a cvv.'; } else if (registration.payment.cvv().length !...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkValidCVV(inputUserCVV){\n\n (regexAllDigits.test(inputUserCVV)&& inputUserCVV.length==3)? hideValidationError('cvv','cvvError') : showValidationError('cvv','Please enter a valid CVV Number.','cvvError');\n\n}", "function isValidCVV() {\n const cvvValue = cvvInput.value;\n const cvvCheck = /^...
[ "0.73594403", "0.69968534", "0.6960957", "0.6905906", "0.6812317", "0.67726034", "0.6742417", "0.6736685", "0.6721633", "0.66366965", "0.6630102", "0.6545056", "0.6365311", "0.6323815", "0.6273274", "0.6205621", "0.6124032", "0.61024946", "0.56578445", "0.56428236", "0.563201...
0.7989198
0
check that user has selected tshirt theme
function checkTShirtThemeErrors() { if (registration.tshirt.design() === 'Select Theme') { // display error displayFieldsetError(document.querySelector('fieldset.shirt legend'), 'Don\'t forget to pick a T-Shirt'); // return error msg return 'Don\'t forget to pick a T-Shirt.'; } else { // remove all error fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verifyTheme() {\n var theme = localStorage.getItem('tobaias-last-theme'); \n var body = $('body');\n var input = $('.js-change-theme');\n\n if (theme == 'clear') {\n body.removeClass('dark-mode');\n } else {\n body.addClass('dark-mode');\n ...
[ "0.68349445", "0.65145415", "0.6366401", "0.60251755", "0.5917312", "0.5890632", "0.5836632", "0.58128816", "0.5787829", "0.5787829", "0.57571", "0.57258344", "0.57225937", "0.572121", "0.5717155", "0.5660111", "0.5654883", "0.5651121", "0.5626658", "0.56126636", "0.5600937",...
0.68634534
0
Pretty print file size
function prettySize( bytes, separator=' ', postFix=''){ if (bytes) { const sizes = ['Octets', 'Ko', 'Mo', 'Go', 'To']; const i = Math.min(parseInt(Math.floor(Math.log(bytes) / Math.log(1024)).toString(), 10), sizes.length - 1); return `${(bytes / (1024 ** i)).toFixed(i ? 1 : 0)}${separator}${sizes[i]}${postFix}`; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFileSize(size) {\n let kbSize = 0;\n if (size) {\n kbSize = Math.ceil(size / 1024);\n }\n return `${kbSize} KB`;\n }", "function humanFileSize(size) {\n var i = Math.floor( Math.log(size) / Math.log(1024) );\n return ( size / Math.pow(1024, i) ).toFixed(1) * 1 + ' '...
[ "0.7052282", "0.6959201", "0.6954409", "0.68980336", "0.6886498", "0.6766472", "0.673841", "0.66841865", "0.6605286", "0.6592322", "0.6582461", "0.64539635", "0.64188856", "0.63942575", "0.63909507", "0.6377173", "0.63758475", "0.63543886", "0.634287", "0.6324226", "0.6302550...
0.71769476
1
Chance that the next character in the test string should be generated. Explanation: Case: `atLeastOne = true` (r = chance/output) length=0: r^0 (100%) =1: r^1 ... =halfPoint: r^halfPoint (50%) So: solve r^halfPoint = 0.5 r = halfPoint root of 0.5 Case: `atLeastOne = false` (r = chance/output) length=0: r^1 =1: r^2 ... ...
function getChanceForNextGeneration(halfPoint, atLeastOne = true) { if(atLeastOne) { return Math.pow(0.5, 1 / halfPoint); } return Math.pow(0.5, 1 / (halfPoint + 1)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "generate() {\n let nextSentence = '';\n for (let i = 0; i < this.sentence.length; i++) {\n let current = this.sentence.charAt(i);\n let found = false;\n for (let j = 0; j < this.rules.length; j++) {\n if (current === this.rules[j].a) {\n found = true;\n let rand = Math...
[ "0.5935799", "0.5894741", "0.58039147", "0.5543933", "0.55320686", "0.550381", "0.53917086", "0.5386987", "0.53842705", "0.53637975", "0.5306135", "0.5253482", "0.52518564", "0.523783", "0.5233394", "0.522331", "0.52208275", "0.52097744", "0.51959074", "0.5191516", "0.5177022...
0.62726635
0
Submits the score (integer) to the specified game (string), executes action (function) if the submission was successful
function submitScore(score, game, action, error) { getAjax("/scoreboard/request", function(request) { if(request !== "error") { let object = JSON.parse(request); let value = 345 + parseInt(score) * parseInt(object.y) + parseInt(object.z) - 345; postAjax("/scoreboard/...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function submitScore(score, game, action, error) {\n getAjax(\"/scoreboard/request\", function(request) {\n if(request !== \"error\") {\n let object = JSON.parse(request);\n let value = 345 + parseInt(score) * parseInt(object.y) + parseInt(object.z) - 345;\n postAjax(\"/s...
[ "0.8276201", "0.7699384", "0.67621255", "0.66609967", "0.64916176", "0.6471835", "0.64161116", "0.64133775", "0.6400788", "0.6400788", "0.63968384", "0.63371664", "0.62889713", "0.62850904", "0.6282708", "0.6243331", "0.62217396", "0.62217146", "0.61889887", "0.61579317", "0....
0.8281116
1
return address type if valid base58 address, otherwise null
function get_address_type(address) { var decoded_hex; try { decoded_hex = base58.decode(address); } catch (e) { // if decoding fails, assume invalid address return null; } // make a usable buffer from the decoded data var decoded = new Buffer(decoded_hex, 'hex'); //...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAddressComponent( place, type ) {\r\n\tvar components = place.address_components;\r\n\tfor( var i = 0; i < components.length; ++i ) {\r\n\t\tvar component = components[i], types = component.types;\r\n\t\tfor( var j = 0; j < types.length; ++j ) {\r\n\t\t\tif( types[j] == type )\r\n\t\t\t\treturn com...
[ "0.5868884", "0.5868789", "0.577807", "0.5729891", "0.5729891", "0.55841595", "0.5532274", "0.5503287", "0.5491022", "0.5295757", "0.524035", "0.5231508", "0.5202794", "0.5198517", "0.5188556", "0.5153134", "0.5148418", "0.5148418", "0.5148038", "0.51134646", "0.5111932", "...
0.80954736
0
private methods helper to perform sha256 digest
function sha256_digest(payload) { return crypto.createHash('sha256').update(payload).digest(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sha256(data){ return crypto.createHash('sha256').update(data).digest() }", "function hex_sha256(s) { return rstr2hex(rstr_sha256(str2rstr_utf8(s))); }", "function hex_sha256(s) { return rstr2hex(rstr_sha256(str2rstr_utf8(s))); }", "function computeSha256(inputStr) {\n sha256.append(Cryptograp...
[ "0.8240441", "0.7730989", "0.77108413", "0.7584012", "0.744836", "0.744836", "0.7365463", "0.735672", "0.7280685", "0.72439605", "0.7196681", "0.71003294", "0.7098669", "0.7022522", "0.70178604", "0.70178604", "0.70178604", "0.700124", "0.6997782", "0.6941154", "0.69370663", ...
0.8145272
1
decode a base58 string payload into a hex representation
function decode(payload) { var base = 58; var length = payload.length; var num = int(0); var leading_zero = 0; var seen_other = false; for (var i=0; i<length ; ++i) { var char = payload[i]; var p = positions[char]; // if we encounter an invalid character, decoding fails...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decode(string) {\n var buffer = new Buffer(base58.decode(string))\n\n var payload = buffer.slice(0, -4)\n var checksum = buffer.slice(-4)\n var newChecksum = sha256x2(payload).slice(0, 4)\n\n assert.deepEqual(newChecksum, checksum, 'Invalid checksum')\n\n return payload\n}", "function decode(strin...
[ "0.7654496", "0.7488902", "0.74722785", "0.6665998", "0.65419054", "0.65419054", "0.65419054", "0.65419054", "0.65419054", "0.65419054", "0.65419054", "0.65419054", "0.65419054", "0.65419054", "0.65419054", "0.65419054", "0.6463646", "0.6463646", "0.6461009", "0.6461009", "0....
0.8298885
0
remove leading 0's from the int
function trim_zeros(int) { while (int._d.length && int._d[0] === 0) { int._d.shift(); } return int; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeLeadingZeros(value) {\r\n\tif(value[0] === \"0\"){\r\n\t\treturn removeLeadingZeros(value.substring(1));\r\n\t} else {\r\n\t\treturn value;\r\n\t}\r\n}", "function trimStartingZero(number) {\n number = (number + '');\n if (number.substring(0,1) === \"0\") {\n number = number.substring(1, numb...
[ "0.7537327", "0.73687536", "0.73267317", "0.7313956", "0.7155208", "0.70902985", "0.7017661", "0.698411", "0.69602853", "0.693333", "0.6901606", "0.68902856", "0.6858677", "0.6849552", "0.6845824", "0.6802701", "0.6756396", "0.6707757", "0.6707394", "0.66758806", "0.66645294"...
0.75610715
0