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 |
|---|---|---|---|---|---|---|
prepares drilldown menu by setting attributes to links and elements sets a min height to prevent content jumping wraps the element if not already wrapped | _prepareMenu() {
var _this = this;
// if(!this.options.holdOpen){
// this._menuLinkEvents();
// }
this.$submenuAnchors.each(function(){
var $link = $(this);
var $sub = $link.parent();
if(_this.options.parentLink){
$link.clone().prependTo($sub.children('[data-submenu]')).w... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setSubmenuBoundries(li) { var bodyWidth = jQueryBuddha(\"body\").width(); var headerOffset = 1000; if (jQueryBuddha(li).find(\">ul.mm-submenu.simple\").length > 0 || jQueryBuddha(li).find(\">ul.mm-submenu.tabbed\").length > 0) { if (jQueryBuddha(li).closest(\".horizontal-mega-menu\").length > 0) { /* get ... | [
"0.5893167",
"0.5768929",
"0.5602508",
"0.5474754",
"0.54559875",
"0.53623945",
"0.53580487",
"0.5341598",
"0.529312",
"0.5285492",
"0.5232412",
"0.5224198",
"0.51993346",
"0.51588666",
"0.5135212",
"0.50793743",
"0.5076118",
"0.504271",
"0.50135636",
"0.50112706",
"0.4969474... | 0.6202451 | 0 |
Iterates through the nested menus to calculate the minheight, and maxwidth for the menu. Prevents content jumping. | _getMaxDims() {
var maxHeight = 0, result = {}, _this = this;
this.$submenus.add(this.$element).each(function(){
var numOfElems = $(this).children('li').length;
var height = Foundation.Box.GetDimensions(this).height;
maxHeight = height > maxHeight ? height : maxHeight;
if(_this.options.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_update_menu_min_size () {\n let work_area = Main.layoutManager.getWorkAreaForMonitor(Main.layoutManager.findIndexForActor(this.menu.actor));\n let monitor = Main.layoutManager.findMonitorForActor(this.menu.actor);\n let scale_factor = St.ThemeContext.get_for_stage(global.stage).scale_... | [
"0.6610396",
"0.64107275",
"0.630104",
"0.6263093",
"0.6182837",
"0.5869039",
"0.58309025",
"0.5804247",
"0.5793062",
"0.575836",
"0.57241476",
"0.5714161",
"0.57097125",
"0.57015234",
"0.56876445",
"0.5668848",
"0.5654305",
"0.56442493",
"0.5620495",
"0.5618219",
"0.5615134"... | 0.6795419 | 0 |
Destroys the Drilldown Menu | destroy() {
if(this.options.scrollTop) this.$element.off('.zf.drilldown',this._bindHandler);
this._hideAll();
this.$element.off('mutateme.zf.trigger');
Foundation.Nest.Burn(this.$element, 'drilldown');
this.$element.unwrap()
.find('.js-drilldown-back, .is-submenu-parent-item').remove... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"destroy() {\n\t\t\n\t\tthis.menuItems.forEach((item) => {\n\t\t\titem.destroy();\n\t\t});\n\t\tthis.menuItems = null;\n\t\t\n\t\tthis.container.parentNode.removeChild(this.container);\n\t\tthis.container = null;\n\t}",
"destroy() {\n if (this.contextMenuInstance) {\n this.contextMenuInstance.de... | [
"0.73209417",
"0.70702577",
"0.6837633",
"0.6837633",
"0.68363357",
"0.6815418",
"0.674977",
"0.67279595",
"0.6644377",
"0.6570757",
"0.656885",
"0.656885",
"0.656885",
"0.65374434",
"0.64884907",
"0.6486547",
"0.64752316",
"0.64476275",
"0.64233416",
"0.63902557",
"0.6377224... | 0.7207615 | 1 |
Initializes the plugin by setting/checking options and attributes, adding helper variables, and saving the anchor. | _init() {
var $id = this.$element.attr('id');
this.$anchor = $(`[data-toggle="${$id}"]`).length ? $(`[data-toggle="${$id}"]`) : $(`[data-open="${$id}"]`);
this.$anchor.attr({
'aria-controls': $id,
'data-is-focus': false,
'data-yeti-box': $id,
'aria-haspopup': true,
'aria-expan... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_initAnchors() {\n //\tInvoke \"before\" hook.\n this.trigger('initAnchors:before');\n document.addEventListener('click', evnt => {\n /** The clicked element. */\n var target = evnt.target.closest('a[href]');\n if (!target) {\n return;\n ... | [
"0.61352134",
"0.59314525",
"0.5928267",
"0.57689303",
"0.57445276",
"0.57356954",
"0.57356954",
"0.5714945",
"0.56478775",
"0.56478775",
"0.56167865",
"0.5555325",
"0.5549539",
"0.55253905",
"0.55090797",
"0.54822016",
"0.54727584",
"0.5472028",
"0.5451312",
"0.5439561",
"0.... | 0.6063338 | 1 |
Adds an event handler to the body to close any dropdowns on a click. | _addBodyHandler() {
var $body = $(document.body).not(this.$element),
_this = this;
$body.off('click.zf.dropdown')
.on('click.zf.dropdown', function(e){
if(_this.$anchor.is(e.target) || _this.$anchor.find(e.target).length) {
return;
}
if(_thi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"close () {\n\t\t\tthis.el.classList.remove('dropdown_open');\n\t\t\tthis.trigger(\"close\");\n\t\t\tdocument.removeEventListener('click', this._documentClick);\n\t\t}",
"_addBodyHandler() {\n var $body = $(document.body),\n _this = this;\n $body.off('mouseup.zf.dropdownmenu touchend.zf.dropdownmenu'... | [
"0.7193893",
"0.71666163",
"0.70770746",
"0.7075531",
"0.69761693",
"0.6967474",
"0.69432575",
"0.68337584",
"0.6734249",
"0.6701479",
"0.66396785",
"0.66015726",
"0.65936387",
"0.6400106",
"0.63844854",
"0.63557297",
"0.63203603",
"0.63193613",
"0.63193613",
"0.62656754",
"0... | 0.7682796 | 0 |
Initializes the Equalizer plugin and calls functions to get equalizer functioning on load. | _init() {
var eqId = this.$element.attr('data-equalizer') || '';
var $watched = this.$element.find(`[data-equalizer-watch="${eqId}"]`);
this.$watched = $watched.length ? $watched : this.$element.find('[data-equalizer-watch]');
this.$element.attr('data-resize', (eqId || Foundation.GetYoDigits(6, 'eq')))... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"initialize() {\n\t\tthis.updateFaves();\n\t\tthis.CALCULATOR.initialize();\n\t\t\n\t\t// initialize unit converter\n\t\tthis.populateCategories();\n\t\tthis.populateUnitMenus();\n\t\tthis.switchToFaveConv();\n\t\tthis.convertHandler();\n\t\t\n\t\t// initialize constants\n\t\tthis.populateConstants();\n\t\tif(this.... | [
"0.5865556",
"0.57499355",
"0.5728156",
"0.5681701",
"0.5679252",
"0.56609404",
"0.5659613",
"0.5637565",
"0.5635002",
"0.5604657",
"0.5600834",
"0.5594741",
"0.55921125",
"0.5562509",
"0.5544842",
"0.5537981",
"0.5537981",
"0.55307776",
"0.5514816",
"0.54957545",
"0.54734594... | 0.6976637 | 0 |
function to handle $elements resizeme.zf.trigger, with bound this on _bindHandler.onResizeMeBound | _onResizeMe(e) {
this._reflow();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_events() {\n $(window).on('resize.zf.interchange', Foundation.util.throttle(() => {\n this._reflow();\n }, 50));\n }",
"_resizeHandler() {\n this.refit();\n }",
"function doResize(){\n\t//$(document).trigger('beforeResize');\n\t// Reserved for centering elements, etc\n\t$(document).trigger... | [
"0.7338158",
"0.7126446",
"0.6917497",
"0.6917497",
"0.68935496",
"0.688122",
"0.6851873",
"0.68422705",
"0.68422705",
"0.68165386",
"0.68017507",
"0.68017507",
"0.68017507",
"0.67810225",
"0.67715",
"0.67477095",
"0.67388594",
"0.6730773",
"0.6722145",
"0.6703494",
"0.667726... | 0.72275394 | 1 |
function to handle $elements postequalized.zf.equalizer, with bound this on _bindHandler.onPostEqualizedBound | _onPostEqualized(e) {
if(e.target !== this.$element[0]){ this._reflow(); }
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function equalizeElements(){\n $(\"[data-equalizer]\").each(function(index, groupToEqualize){\n // Calcul du max height et stockage de chaque hauteur occupée\n\t var maxHeight = 0;\n\t var $children = $(groupToEqualize).children(\"[data-equalizer-watch]\");\n\n\t var heights = $child... | [
"0.5879968",
"0.5640224",
"0.49670345",
"0.49619642",
"0.48282313",
"0.47861847",
"0.4749698",
"0.4731305",
"0.47055385",
"0.4604294",
"0.45520228",
"0.45030662",
"0.44914544",
"0.44820863",
"0.44726622",
"0.4464004",
"0.4452203",
"0.44502392",
"0.43942416",
"0.43585905",
"0.... | 0.57784164 | 1 |
Manually determines if the first 2 elements are NOT stacked. | _isStacked() {
if (!this.$watched[0] || !this.$watched[1]) {
return true;
}
return this.$watched[0].getBoundingClientRect().top !== this.$watched[1].getBoundingClientRect().top;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isStacked() {\n return opts.transform === \"stack\";\n }",
"function isStackEmpty(stack){\n return !(stack.length>0);\n }",
"function ignoreExteriorBorders(a, b) { return a !== b }",
"function areNoCardsFlipped() {\n return (tiles_values.length === 0);\n}",
"isStacked() {\n return ... | [
"0.627825",
"0.5882528",
"0.58735675",
"0.5859563",
"0.5845625",
"0.58171535",
"0.577411",
"0.57629114",
"0.5739326",
"0.57345086",
"0.5734421",
"0.5664684",
"0.5628899",
"0.5540901",
"0.546803",
"0.54565996",
"0.54464614",
"0.5426434",
"0.5426232",
"0.5426232",
"0.5426232",
... | 0.6576978 | 0 |
Gets the Foundation breakpoints and adds them to the Interchange.SPECIAL_QUERIES object. | _addBreakpoints() {
for (var i in Foundation.MediaQuery.queries) {
if (Foundation.MediaQuery.queries.hasOwnProperty(i)) {
var query = Foundation.MediaQuery.queries[i];
Interchange.SPECIAL_QUERIES[query.name] = query.value;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get breakpoints() {\n return this.globals.breakpoints;\n }",
"_registerBreakpoints() {\n const self = this;\n\n self.$win.mediaQueryEvents({\n breakpoints: self.opts.breakpoints\n });\n }",
"getBreakpoints() {\n return this.breakpoints;\n }",
"constructor() {\n super(...argume... | [
"0.6382362",
"0.6365771",
"0.6178695",
"0.5388389",
"0.53266305",
"0.5296801",
"0.5275337",
"0.5205196",
"0.5169771",
"0.51327896",
"0.5124751",
"0.5103829",
"0.5091909",
"0.49589473",
"0.4914631",
"0.48823527",
"0.48447508",
"0.47694343",
"0.4741791",
"0.47190872",
"0.471759... | 0.795819 | 0 |
Destroys an instance of Magellan and resets the url of the window. | destroy() {
this.$element.off('.zf.trigger .zf.magellan')
.find(`.${this.options.activeClass}`).removeClass(this.options.activeClass);
if(this.options.deepLinking){
var hash = this.$active[0].getAttribute('href');
window.location.hash.replace(hash, '');
}
Foundation.unregisterPlugi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"destroy() {\n this.$element.find('[data-tab-content]').stop(true).slideUp(0).css('display', '');\n this.$element.find('a').off('.zf.accordion');\n if(this.options.deepLink) {\n $(window).off('popstate', this._checkDeepLink);\n }\n\n Foundation.unregisterPlugin(this);\n }",
"destroy() {\n ... | [
"0.6315543",
"0.62812644",
"0.61477804",
"0.608169",
"0.6033157",
"0.6022049",
"0.59545416",
"0.59166753",
"0.58752215",
"0.5873559",
"0.5843398",
"0.58342624",
"0.58195114",
"0.5799376",
"0.57887834",
"0.57818174",
"0.5776442",
"0.57468665",
"0.5743205",
"0.5740853",
"0.5739... | 0.7100616 | 0 |
Adds event handlers to the offcanvas wrapper and the exit overlay. | _events() {
this.$element.off('.zf.trigger .zf.offcanvas').on({
'open.zf.trigger': this.open.bind(this),
'close.zf.trigger': this.close.bind(this),
'toggle.zf.trigger': this.toggle.bind(this),
'keydown.zf.offcanvas': this._handleKeyboard.bind(this)
});
if (this.options.closeOnClick ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addListeners() {\n creative.dom.exit.addEventListener('click', exitClickHandler);\n}",
"function addListeners() {\r\n\tcreative.dom.exit.addEventListener('click', exitClickHandler);\r\n}",
"function _events () {\n if ($overlayTrigger !== undefined) {\n $overlayTrigger.on('cl... | [
"0.6530262",
"0.6451061",
"0.64291286",
"0.63689494",
"0.61856484",
"0.61726487",
"0.611932",
"0.60815746",
"0.6010268",
"0.599759",
"0.5940037",
"0.59279656",
"0.58489144",
"0.58444965",
"0.5814604",
"0.5809987",
"0.5745079",
"0.5724539",
"0.57135713",
"0.57031155",
"0.56864... | 0.7431642 | 0 |
Handles keyboard input when detected. When the escape key is pressed, the offcanvas menu closes, and focus is restored to the element that opened the menu. | _handleKeyboard(e) {
Foundation.Keyboard.handleKey(e, 'OffCanvas', {
close: () => {
this.close();
this.$lastTrigger.focus();
return true;
},
handled: () => {
e.stopPropagation();
e.preventDefault();
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onInternalKeyDown(event) {\n const sourceWidget = IdHelper.fromElement(event),\n isFromWidget = sourceWidget && sourceWidget !== this && !(sourceWidget instanceof MenuItem);\n\n if (event.key === 'Escape') {\n // Only close this menu if the ESC was in a child input Widget\n (isFromWidget ? thi... | [
"0.6955813",
"0.6924114",
"0.68156636",
"0.6801148",
"0.6799179",
"0.6710283",
"0.6680858",
"0.65046316",
"0.64732873",
"0.6463215",
"0.64192015",
"0.63907754",
"0.63695204",
"0.63665324",
"0.63545674",
"0.6325156",
"0.6314818",
"0.629674",
"0.6246455",
"0.6198178",
"0.617892... | 0.694021 | 1 |
Destroys the offcanvas plugin. | destroy() {
this.close();
this.$element.off('.zf.trigger .zf.offcanvas');
this.$overlay.off('.zf.offcanvas');
Foundation.unregisterPlugin(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"destroy() {\n if (this.options.overlay) {\n this.$element.appendTo($(this.options.appendTo)); // move $element outside of $overlay to prevent error unregisterPlugin()\n this.$overlay.hide().off().remove();\n }\n this.$element.hide().off();\n this.$anchor.off('.zf');\n $(window).off(`.zf.re... | [
"0.73057574",
"0.7243004",
"0.7187899",
"0.7159536",
"0.71378666",
"0.71363884",
"0.70651394",
"0.7056094",
"0.69865906",
"0.6971364",
"0.69681156",
"0.6956432",
"0.69518423",
"0.6942964",
"0.6928201",
"0.6925356",
"0.6918449",
"0.68937594",
"0.6865775",
"0.6865704",
"0.68394... | 0.79566133 | 0 |
Initializes the plugin by creating jQuery collections, setting attributes, and starting the animation. | _init() {
// @TODO: consider discussion on PR #9278 about DOM pollution by changeSlide
this._reset();
this.$wrapper = this.$element.find(`.${this.options.containerClass}`);
this.$slides = this.$element.find(`.${this.options.slideClass}`);
var $images = this.$element.find('img'),
initActive... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_init() {\n var input;\n // Parse animation classes if they were set\n if (this.options.animate) {\n input = this.options.animate.split(' ');\n\n this.animationIn = input[0];\n this.animationOut = input[1] || null;\n }\n // Otherwise, parse toggle class\n else {\n input = this... | [
"0.66914004",
"0.66145396",
"0.6527523",
"0.63611466",
"0.63265425",
"0.63240486",
"0.6322792",
"0.6288266",
"0.62724084",
"0.6223384",
"0.61756164",
"0.61532754",
"0.6151472",
"0.61494607",
"0.6143852",
"0.6120779",
"0.61006594",
"0.6045145",
"0.60447943",
"0.60366064",
"0.6... | 0.66820514 | 1 |
Sets wrapper and slide heights for the orbit. | _prepareForOrbit() {
var _this = this;
this._setWrapperHeight();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_setSliderHeight() {\n // If fullscreen, do nothing\n if (!this.$el.hasClass('fullscreen')) {\n if (this.options.indicators) {\n // Add height if indicators are present\n this.$el.css('height', (this.options.height + 40) + 'px');\n }\n else {\n this.$el.css... | [
"0.65905565",
"0.640104",
"0.6370018",
"0.6346771",
"0.63406557",
"0.63278174",
"0.6235657",
"0.61600953",
"0.61409295",
"0.60923594",
"0.60123104",
"0.5977443",
"0.5952842",
"0.594387",
"0.59184164",
"0.59091",
"0.58907443",
"0.58796394",
"0.5857314",
"0.58563966",
"0.585258... | 0.67071784 | 0 |
Sets the maxheight of each slide. | _setSlideHeight(height) {
this.$slides.each(function() {
$(this).css('max-height', height);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setHeight() {\n $('.voyage').css('height', 'auto');\n var maxHeight = Math.max.apply(null, $(\".voyage\").map(function() {\n return $(this).height();\n }).get());\n $('.voyage').height(maxHeight);\n }",
"function adjustHeight() {\n var img = slides[currentSlide].... | [
"0.76146376",
"0.72124755",
"0.7111288",
"0.7108914",
"0.7075756",
"0.68395954",
"0.6814873",
"0.6739867",
"0.66997135",
"0.66964346",
"0.6585565",
"0.6560121",
"0.65148",
"0.6495771",
"0.64612365",
"0.64422613",
"0.6384232",
"0.6373103",
"0.6356937",
"0.63306445",
"0.6323364... | 0.8380567 | 0 |
Checks the current screen width against available media queries. If the media query has changed, and the plugin needed has changed, the plugins will swap out. | _checkMediaQueries() {
var matchedMq, _this = this;
// Iterate through each rule and find the last matching rule
$.each(this.rules, function(key) {
if (Foundation.MediaQuery.atLeast(key)) {
matchedMq = key;
}
});
// No match? No dice
if (!matchedMq) return;
// Plugin al... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_checkMediaQueries() {\n var matchedMq, _this = this;\n // Iterate through each rule and find the last matching rule\n $.each(this.rules, function(key) {\n if (Foundation.MediaQuery.atLeast(key)) {\n matchedMq = key;\n }\n });\n\n // No match? No dice\n if (!matchedMq) return;\n\... | [
"0.6319522",
"0.6261961",
"0.62262547",
"0.61686784",
"0.6156464",
"0.6156464",
"0.6087794",
"0.60738325",
"0.5849984",
"0.5823529",
"0.5813513",
"0.5763634",
"0.5752228",
"0.573307",
"0.5714474",
"0.5709369",
"0.5681573",
"0.5670616",
"0.5670356",
"0.56604564",
"0.5652543",
... | 0.6748426 | 0 |
Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out. | destroy() {
this.currentPlugin.destroy();
$(window).off('.zf.ResponsiveMenu');
Foundation.unregisterPlugin(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"destroy() {\n if (this.currentPlugin) this.currentPlugin.destroy();\n $(window).off('.zf.ResponsiveAccordionTabs');\n Foundation.unregisterPlugin(this);\n }",
"function destroy() {\n // Iterate over each matching element.\n $el.each(function() {\n var el = this;\n var $el = $(th... | [
"0.79692847",
"0.78067064",
"0.780114",
"0.7565519",
"0.75439817",
"0.7483644",
"0.7447377",
"0.74049354",
"0.7373204",
"0.733396",
"0.7287516",
"0.7277884",
"0.72258705",
"0.7204928",
"0.7204537",
"0.7189412",
"0.71822643",
"0.7163511",
"0.7109164",
"0.7092609",
"0.70612806"... | 0.79718167 | 0 |
Creates an overlay div to display behind the modal. | _makeOverlay() {
return $('<div></div>')
.addClass('reveal-overlay')
.appendTo(this.options.appendTo);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayOverlay() {\n $(\"<div id='overlay'></div>\").css({\n \"position\": \"fixed\",\n \"top\": 0,\n \"left\": 0,\n \"width\": \"100%\",\n \"height\": \"100%\",\n \"background-color\": \"rgba(0,0,0,.7)\",\n \"z-index\": 2,\n \"vertical-align\": \... | [
"0.742897",
"0.72273153",
"0.707693",
"0.7060298",
"0.7031949",
"0.70150536",
"0.6848157",
"0.6839557",
"0.67853844",
"0.67596525",
"0.67580837",
"0.6663246",
"0.6656966",
"0.66462237",
"0.664431",
"0.657317",
"0.656178",
"0.65462214",
"0.6517637",
"0.64848965",
"0.645059",
... | 0.7428606 | 1 |
Destroys the slider plugin. | destroy() {
this.handles.off('.zf.slider');
this.inputs.off('.zf.slider');
this.$element.off('.zf.slider');
clearTimeout(this.timeout);
Foundation.unregisterPlugin(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"destroy() {\n // destroy everything related to the slider\n this.destroySlider();\n }",
"function destroy() {\n dispatchSliderEvent('before', 'destroy');\n\n // remove event listeners\n frame.removeEventListener(prefixes.transitionEnd, onTransitionEnd);\n frame.remove... | [
"0.8583031",
"0.77110094",
"0.7679389",
"0.765743",
"0.765743",
"0.765743",
"0.765743",
"0.7586554",
"0.7576078",
"0.7576078",
"0.7541944",
"0.7541944",
"0.7541944",
"0.7541944",
"0.7541944",
"0.7541944",
"0.7541944",
"0.7541944",
"0.7541944",
"0.7541944",
"0.7541944",
"0.7... | 0.8481353 | 1 |
Causes the $element to become stuck. Adds `position: fixed;`, and helper classes. | _setSticky() {
var _this = this,
stickTo = this.options.stickTo,
mrgn = stickTo === 'top' ? 'marginTop' : 'marginBottom',
notStuckTo = stickTo === 'top' ? 'bottom' : 'top',
css = {};
css[mrgn] = `${this.options[mrgn]}em`;
css[stickTo] = 0;
css[notStuckTo] = 'auto';
t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeSticky() {\n setTransitionDuration([popper], isIE ? 0 : instance.props.updateDuration);\n\n function updatePosition() {\n instance.popperInstance.scheduleUpdate();\n\n if (instance.state.isMounted) {\n requestAnimationFrame(updatePosition);\n } else {\n setTransition... | [
"0.6151912",
"0.59914786",
"0.59784365",
"0.5955976",
"0.5943115",
"0.5933604",
"0.5931315",
"0.58252484",
"0.5793616",
"0.5756916",
"0.57265025",
"0.5702176",
"0.56978345",
"0.5665315",
"0.5606916",
"0.55767864",
"0.553355",
"0.5530897",
"0.55251896",
"0.5482397",
"0.5446827... | 0.61712885 | 0 |
Destroys the current sticky element. Resets the element to the top position first. Removes event listeners, JSadded css properties and classes, and unwraps the $element if the JS added the $container. | destroy() {
this._removeSticky(true);
this.$element.removeClass(`${this.options.stickyClass} is-anchored is-at-top`)
.css({
height: '',
top: '',
bottom: '',
'max-width': ''
})
.off('re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"destroySticky() {\n this.isEnabled = false;\n this.isActive = false;\n this.setInactive();\n this.removePlaceholder();\n window.clearTimeout(this._resizeTimeout);\n window.clearInterval(this._updateInterval);\n window.removeEventListener('resize', this._boundEnableS... | [
"0.67174053",
"0.61194193",
"0.6109712",
"0.6101892",
"0.59133554",
"0.5847176",
"0.5844479",
"0.58188325",
"0.5811713",
"0.5809819",
"0.58056295",
"0.579448",
"0.5790882",
"0.5761762",
"0.5749455",
"0.5703587",
"0.56640035",
"0.56395966",
"0.5609447",
"0.5601089",
"0.5590687... | 0.69404733 | 0 |
Adds keyboard event handlers for items within the tabs. | _addKeyHandler() {
var _this = this;
this.$tabTitles.off('keydown.zf.tabs').on('keydown.zf.tabs', function(e){
if (e.which === 9) return;
var $element = $(this),
$elements = $element.parent('ul').children('li'),
$prevElement,
$nextElement;
$elements.each(function(i)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bindEvents() {\n var tabs = that._elements[\"tab\"];\n if (tabs) {\n for (var i = 0; i < tabs.length; i++) {\n (function(index) {\n tabs[i].addEventListener(\"click\", function(event) {\n navigateAndF... | [
"0.7107758",
"0.7107758",
"0.6828666",
"0.6536788",
"0.6506828",
"0.6348155",
"0.62324196",
"0.61742944",
"0.61246777",
"0.6122558",
"0.6118601",
"0.61178696",
"0.60920703",
"0.6078618",
"0.6043163",
"0.60355246",
"0.60354537",
"0.60312945",
"0.6020984",
"0.599366",
"0.597812... | 0.7218106 | 0 |
Sets the height of each panel to the height of the tallest panel. If enabled in options, gets called on media query change. If loading content via external source, can be called directly or with _reflow. If enabled with `datamatchheight="true"`, tabs sets to equal height | _setHeight() {
var max = 0,
_this = this; // Lock down the `this` value for the root tabs object
this.$tabContent
.find(`.${this.options.panelClass}`)
.css('height', '')
.each(function() {
var panel = $(this),
isActive = panel.hasClass(`${_this.options.panelActive... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setPanelHeight(size) {\n if (size === 'small') {\n var heightOffset = viewport.max - viewport.min;\n var navHeight = $('.nav-container').height();\n\n $('#hero').css('height', viewport.min - navHeight);\n $('article').css('height', viewport.max);\n } else {\n $('#hero').css(... | [
"0.67784446",
"0.66085345",
"0.64903486",
"0.64711106",
"0.6375802",
"0.6365413",
"0.6253635",
"0.62459344",
"0.62300533",
"0.61556405",
"0.61556405",
"0.6092149",
"0.6091835",
"0.60074085",
"0.59913486",
"0.59580743",
"0.5907288",
"0.59023046",
"0.5900274",
"0.5893646",
"0.5... | 0.7181337 | 0 |
Initializes the Toggler plugin by parsing the toggle class from datatoggler, or animation classes from dataanimate. | _init() {
var input;
// Parse animation classes if they were set
if (this.options.animate) {
input = this.options.animate.split(' ');
this.animationIn = input[0];
this.animationOut = input[1] || null;
}
// Otherwise, parse toggle class
else {
input = this.$element.data('... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_init() {\n var targetID = this.$element.data('responsive-toggle');\n if (!targetID) {\n console.error('Your tab bar needs an ID of a Menu as the value of data-tab-bar.');\n }\n\n this.$targetMenu = $(`#${targetID}`);\n this.$toggler = this.$element.find('[data-toggle]').filter(function() {\n ... | [
"0.66225785",
"0.5993556",
"0.56491464",
"0.55737394",
"0.55252504",
"0.5451778",
"0.54406714",
"0.5432289",
"0.5398282",
"0.53750795",
"0.53510666",
"0.5343001",
"0.5240344",
"0.5222237",
"0.52204746",
"0.51923627",
"0.51734936",
"0.5168952",
"0.5166373",
"0.5152698",
"0.515... | 0.7129672 | 0 |
Initializes the tooltip by setting the creating the tip element, adding it's text, setting private variables and setting attributes on the anchor. | _init() {
var elemId = this.$element.attr('aria-describedby') || Foundation.GetYoDigits(6, 'tooltip');
this.options.positionClass = this.options.positionClass || this._getPositionClass(this.$element);
this.options.tipText = this.options.tipText || this.$element.attr('title');
this.template = this.optio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initTooltip() {\n if (!tooltip) {\n var body;\n if (chartContainer) {\n body = chartContainer;\n } else {\n body = document.body;\n }\n //Create new tooltip div if it doesn't exist o... | [
"0.70755976",
"0.70465785",
"0.70465785",
"0.698568",
"0.69670373",
"0.6939861",
"0.69204736",
"0.6875013",
"0.6847541",
"0.6807972",
"0.6771693",
"0.6766945",
"0.6765018",
"0.6725435",
"0.66374475",
"0.6608367",
"0.6591371",
"0.65889376",
"0.65865433",
"0.65523195",
"0.65463... | 0.72754794 | 0 |
Grabs the current positioning class, if present, and returns the value or an empty string. | _getPositionClass(element) {
if (!element) { return ''; }
// var position = element.attr('class').match(/top|left|right/g);
var position = element[0].className.match(/\b(top|left|right)\b/g);
position = position ? position[0] : '';
return position;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPositionClass(position) {\n\treturn 'position-' + position.x + '-' + position.y;\n}",
"get cssPosition() {\n return this.__cssPosition || 'absolute';\n }",
"function posToDivClass(pos){\n\n var divClassNum = pos.replace(/\\_/, \"\\-\");\n var divClass = \".pos\" + divClassNum;\n return divCl... | [
"0.6893134",
"0.6006647",
"0.59278965",
"0.5806372",
"0.5545349",
"0.5536445",
"0.55191875",
"0.5506575",
"0.54507834",
"0.54100746",
"0.53942865",
"0.5359067",
"0.5323411",
"0.5322879",
"0.5317345",
"0.5307733",
"0.53050613",
"0.5294374",
"0.52724135",
"0.5251828",
"0.524926... | 0.7418081 | 0 |
builds the tooltip element, adds attributes, and returns the template. | _buildTemplate(id) {
var templateClasses = (`${this.options.tooltipClass} ${this.options.positionClass} ${this.options.templateClasses}`).trim();
var $template = $('<div></div>').addClass(templateClasses).attr({
'role': 'tooltip',
'aria-hidden': true,
'data-is-active': false,
'data-is-f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get tooltipTemplate() {\n return html`<simple-tooltip\n id=\"tooltip\"\n for=\"button\"\n ?hidden=\"${!this.currentTooltip && !this.currentLabel}\"\n position=\"${this.tooltipDirection || \"bottom\"}\"\n >${this.currentTooltip || this.currentLabel}</simple-tooltip\n >`;... | [
"0.7364653",
"0.7122641",
"0.6797256",
"0.67491066",
"0.65252686",
"0.6524746",
"0.65119",
"0.64915574",
"0.6477196",
"0.6462866",
"0.6394203",
"0.6380271",
"0.6339548",
"0.6307645",
"0.63045305",
"0.62859833",
"0.6277592",
"0.6237172",
"0.61965615",
"0.61965615",
"0.61965615... | 0.7402894 | 0 |
Hides the current tooltip, and resets the positioning class if it was changed due to collision | hide() {
// console.log('hiding', this.$element.data('yeti-box'));
var _this = this;
this.template.stop().attr({
'aria-hidden': true,
'data-is-active': false
}).fadeOut(this.options.fadeOutDuration, function() {
_this.isActive = false;
_this.isClick = false;
if (_this.class... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hide() {\n if (tooltip) {\n tooltip.parentNode.removeChild(tooltip);\n tooltip = null;\n }\n }",
"function hideTooltip() {\n tooltip.style('opacity', 0.0);\n }",
"function hideTooltips() {\n\t\t\t\t\ttooltipObject.remove();\n\t\t\t\t}",
"tooltipHide(vis) ... | [
"0.74126405",
"0.73791146",
"0.73191947",
"0.7279705",
"0.72627044",
"0.7249235",
"0.7247104",
"0.7222728",
"0.7216465",
"0.7204661",
"0.7204661",
"0.7204661",
"0.71444273",
"0.70671123",
"0.7040119",
"0.7039442",
"0.7030673",
"0.70070267",
"0.69937855",
"0.69861764",
"0.6940... | 0.74020344 | 1 |
Initializes the media query helper, by extracting the breakpoint list from the CSS and activating the breakpoint watcher. | _init() {
var self = this;
var extractedStyles = $('.foundation-mq').css('font-family');
var namedQueries;
namedQueries = parseStyleToObject(extractedStyles);
for (var key in namedQueries) {
if(namedQueries.hasOwnProperty(key)) {
self.queries.push({
name: key,
val... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_addBreakpoints() {\n for (var i in Foundation.MediaQuery.queries) {\n if (Foundation.MediaQuery.queries.hasOwnProperty(i)) {\n var query = Foundation.MediaQuery.queries[i];\n Interchange.SPECIAL_QUERIES[query.name] = query.value;\n }\n }\n }",
"_registerBreakpoints() {\n const ... | [
"0.6437956",
"0.6431438",
"0.61840373",
"0.6077139",
"0.5814134",
"0.57602644",
"0.5727289",
"0.5676921",
"0.55494326",
"0.5476511",
"0.5423465",
"0.5337793",
"0.5329713",
"0.5269242",
"0.5269181",
"0.5252867",
"0.52386016",
"0.52386016",
"0.52386016",
"0.52386016",
"0.523860... | 0.673753 | 0 |
Hides the element (for out animations), resets the element, and runs a callback | function finish() {
if (!isIn) element.hide();
reset();
if (cb) cb.apply(element);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }",
"function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }",
"function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb... | [
"0.7273628",
"0.7273628",
"0.7273628",
"0.7273628",
"0.7249682",
"0.71665215",
"0.712526",
"0.71114117",
"0.7054",
"0.6799334",
"0.6799334",
"0.6760112",
"0.67108464",
"0.66932327",
"0.66927284",
"0.6690226",
"0.6660347",
"0.66484374",
"0.658639",
"0.65746146",
"0.65735734",
... | 0.7333867 | 1 |
Resets transitions and removes motionspecific classes | function reset() {
element[0].style.transitionDuration = 0;
element.removeClass(`${initClass} ${activeClass} ${animation}`);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"clearAnims(){\n document.querySelectorAll('.activated, .sequence').forEach( el => {\n el.classList.remove('activated', 'sequence');\n })\n }",
"function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }",
"functio... | [
"0.7570513",
"0.7513849",
"0.75058436",
"0.75058436",
"0.75058436",
"0.75058436",
"0.74954087",
"0.74904054",
"0.69066733",
"0.6886799",
"0.67184937",
"0.6713044",
"0.6663456",
"0.6631944",
"0.65879035",
"0.65867764",
"0.6577335",
"0.650732",
"0.648983",
"0.6484452",
"0.64510... | 0.7537411 | 1 |
Checks the current screen width against available media queries. If the media query has changed, and the plugin needed has changed, the plugins will swap out. | _checkMediaQueries() {
var matchedMq, _this = this;
// Iterate through each rule and find the last matching rule
$.each(this.rules, function(key) {
if (Foundation.MediaQuery.atLeast(key)) {
matchedMq = key;
}
});
// No match? No dice
if (!matchedMq) return;
// Plugin al... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_checkMediaQueries() {\n var matchedMq, _this = this;\n // Iterate through each rule and find the last matching rule\n $.each(this.rules, function(key) {\n if (Foundation.MediaQuery.atLeast(key)) {\n matchedMq = key;\n }\n });\n\n // No match? No dice\n if (!matchedMq) return;\n\... | [
"0.6747267",
"0.6260635",
"0.622534",
"0.61682695",
"0.61561155",
"0.61561155",
"0.6087504",
"0.6074455",
"0.5848973",
"0.58226013",
"0.58128464",
"0.5761601",
"0.5750678",
"0.5733128",
"0.57137805",
"0.57087797",
"0.5680301",
"0.5669437",
"0.5669381",
"0.5659447",
"0.5652501... | 0.63183856 | 1 |
Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out. | destroy() {
if (this.currentPlugin) this.currentPlugin.destroy();
$(window).off('.zf.ResponsiveAccordionTabs');
Foundation.unregisterPlugin(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"destroy() {\n this.currentPlugin.destroy();\n $(window).off('.zf.ResponsiveMenu');\n Foundation.unregisterPlugin(this);\n }",
"function destroy() {\n // Iterate over each matching element.\n $el.each(function() {\n var el = this;\n var $el = $(this);\n \n // Add code to r... | [
"0.7972641",
"0.78065604",
"0.78012747",
"0.75661254",
"0.7544234",
"0.7483828",
"0.74474627",
"0.7406409",
"0.7373625",
"0.7333262",
"0.7287376",
"0.7277991",
"0.7226834",
"0.7205693",
"0.72051036",
"0.71886605",
"0.7182839",
"0.7163542",
"0.7108582",
"0.7092828",
"0.7061129... | 0.7970115 | 1 |
Returns if x is a dom node. | function isDomNode(x) {
return (x.nodeType != undefined);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isElement(domNode) {\n return domNode.nodeType !== undefined;\n}",
"function isNode(x) {\n return x !== null && typeof x === \"object\" && typeof x.type === \"string\";\n}",
"function _isNode(o){\n return (\n typeof Node === \"object\" ? o instanceof Node : \n o && typeof o === \"ob... | [
"0.7343148",
"0.7321488",
"0.7218496",
"0.7177435",
"0.7141822",
"0.7125837",
"0.709523",
"0.70829844",
"0.7075995",
"0.7072018",
"0.69778055",
"0.6956536",
"0.68390536",
"0.6808361",
"0.6781245",
"0.6719658",
"0.67043114",
"0.6674395",
"0.6671078",
"0.666982",
"0.6647341",
... | 0.7915325 | 0 |
Save new threshold value on popupclose (means Primary click) Use widgetView to get widgetsView and save new values Current widget is updated too (without redrawing) | saveThreshold () {
let preparedThresholds = this.get('sliderHandlersManager.preparedThresholds');
this.get('widgetView').saveWidgetThresholds(preparedThresholds);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateThreshold() {\n let sliderValues = utils.getSliderMinMax(\"threshold\", DATA_REAL_MIN, DATA_REAL_MAX);\n if (get(\"cboxthreshold\").checked) {\n get(\"faceSetThreshold\").setAttribute(\"lowerbound\", sliderValues.min);\n get(\"faceSetThreshold\").setAttribute(\"upperbound\", sliderValues... | [
"0.5629754",
"0.5393222",
"0.53327703",
"0.5285718",
"0.5282127",
"0.52664703",
"0.52094346",
"0.5196249",
"0.5161952",
"0.5090192",
"0.5041905",
"0.50407517",
"0.50076985",
"0.5007171",
"0.4949525",
"0.49090058",
"0.49020004",
"0.49008828",
"0.4886746",
"0.48825115",
"0.4858... | 0.71284133 | 0 |
Create slider in the popup when it's opened | createSlider() {
var self = this;
let sliderHandlersManager = this.get('sliderHandlersManager');
var handlers = this.get('sliderHandlers');
$('#slider-range').slider({
range: this.get('sliderIsRange'),
min: this.get('sliderMinValue'),
max: this.get('sliderMaxValue'),
disabled: t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_spawn() {\n const parentElement = document.querySelector(this.parentSelector);\n parentElement.appendChild(this.sliderElement);\n this.ready = true;\n }",
"function createSlider() {\n noUiSlider.create(bgColourSlider[0], {\n start: sliderStartPos,\n step: 1,\n ... | [
"0.66414744",
"0.6417364",
"0.6373123",
"0.6305366",
"0.6240857",
"0.61906564",
"0.6185709",
"0.61222285",
"0.61180925",
"0.61053824",
"0.6075648",
"0.6072642",
"0.6070365",
"0.60417765",
"0.60285336",
"0.60054475",
"0.59821856",
"0.5981927",
"0.5959514",
"0.5950487",
"0.5941... | 0.64697886 | 1 |
Detects any character in the Unicode categories "Uppercase letter (Lu)", "Lowercase letter (Ll)", "Titlecase letter (Lt)", "Modifier letter (Lm)", "Other letter (Lo)", or "Letter number (Nl)". Both approach and unicodeLetterTable were borrowed from Google's Traceur. | function isUnicodeLetter(code) {
for (var _i = 0; _i < unicodeLetterTable.length;) {
if (code < unicodeLetterTable[_i++]) {
return false;
}
if (code <= unicodeLetterTable[_i++]) {
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isLetter (c)\n{\nvar lowercaseLetters = \"abcdefghijklmnopqrstuvwxyzáéíóúñü.,\"\nvar uppercaseLetters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZÁÉÍÓÚÑ\"\n return( ( uppercaseLetters.indexOf( c ) != -1 ) ||\n ( lowercaseLetters.indexOf( c ) != -1 ) )\n}",
"function lettersAccentComaAndPoint(field){\n ... | [
"0.67011154",
"0.6415792",
"0.63593465",
"0.63593465",
"0.6341967",
"0.6335088",
"0.6313814",
"0.62675107",
"0.6242504",
"0.62385017",
"0.61734855",
"0.6150164",
"0.6138775",
"0.61187327",
"0.6118207",
"0.6099726",
"0.60692763",
"0.60684294",
"0.5998107",
"0.5994439",
"0.5980... | 0.64276123 | 1 |
there genes are the path they will take through the maze such as L R U D R L if they attempt to move into a block that is a barrier, they simply remain where they are. Survival Evos take this one further... they have a lifespan, and die if they've lived too many ticks or if they are too hungry every x ticks (where x is... | function SurvivalEvo(block, block_width, world, speed, path_length,size, route){
this.block = block;
this.speed = speed;
this.block_width = block_width;
this.route = route;
this.size = size
this.hunger = 0;
this.max_hunger = 8;
this.diseased = false;
this.dead = false;
this.cause_of_death = "nothing... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function genMaze() {\n //var alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','aa','bb','cc','dd','ee','ff','gg','hh','ii','jj','kk','ll','mm','nn','oo','pp','qq','rr','ss','tt','aaa','bbb','ccc','ddd','eee','fff','ggg','hhh','iii','jjj','kkk','lll','mmm','nnn','ooo','... | [
"0.6568675",
"0.6386536",
"0.63175285",
"0.6273396",
"0.6265372",
"0.6115795",
"0.6102906",
"0.6035509",
"0.598718",
"0.5961227",
"0.59562427",
"0.59551394",
"0.59364617",
"0.586102",
"0.58590126",
"0.5855571",
"0.58549255",
"0.5839996",
"0.5837889",
"0.58316875",
"0.5827404"... | 0.6771319 | 0 |
Filtering Sets all filter buttons to btnsecondary | function resetFilterButtons() {
$("#filter-all").removeClass("btn-primary");
$("#filter-all").addClass("btn-secondary");
$("#filter-incomplete").removeClass("btn-primary");
$("#filter-incomplete").addClass("btn-secondary");
$("#filter-complete").removeClass("btn-primary");
$("#filter-complete"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initFilterBtnsHandler()\n\t{\n\t\t$('.catalog-filter__btn').on('click', function(e){\n\t\t\te.preventDefault();\n\t\t\t\n\t\t\tif ( $(this).hasClass('catalog-filter__btn--close') )\n\t\t\t{\n\t\t\t\t$(this).siblings().removeClass('active');\n\t\t\t}\n\t\t\telse\n\t\t\t{\t\n\t\t\t\t$(this).toggleClass('act... | [
"0.73781896",
"0.7187598",
"0.71673036",
"0.690011",
"0.68106204",
"0.6759292",
"0.66734505",
"0.66692835",
"0.66616476",
"0.6634887",
"0.66268516",
"0.65292066",
"0.6521892",
"0.65205145",
"0.6489116",
"0.64838415",
"0.6483252",
"0.64744073",
"0.64603853",
"0.6438145",
"0.64... | 0.7477778 | 0 |
pop up de google earth | function popup(url,ancho,alto) {
var posicion_x;
var posicion_y;
posicion_x=(screen.width/2)-(ancho/2);
posicion_y=(screen.height/2)-(alto/2);
window.open(url,"https://www.google.com/maps/place/Sant+Cugat+del+Vall%C3%A8s,+Barcelona/@41.4755291,2.0378619,13z/data=!3m1!4b1!4m5!3m4!1s0x12a496c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showPopup2(e) {\n // Show the popup at the coordinates with some data\n popup\n .setLngLat(e.lngLat)\n .setHTML(\n e.features[0].properties.name + \n \"<br><a href='https://waba.org/20x20map/' target='blank'><button class=blue-button2>Get I... | [
"0.6872452",
"0.6801689",
"0.66013783",
"0.65903056",
"0.6586257",
"0.6570523",
"0.64703095",
"0.6446544",
"0.6444946",
"0.64293325",
"0.64265907",
"0.6411011",
"0.63924897",
"0.63769114",
"0.6376453",
"0.63757694",
"0.63746786",
"0.637372",
"0.6336411",
"0.6309056",
"0.63086... | 0.7090546 | 0 |
Creates the InterestType collection. | constructor() {
super('InterestType');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createRegionTypes() {\n if (REGIONS == undefined) {\n REGIONS = {}\n }\n for (var rtype in REGIONS.metadata) {\n if (REGIONS.metadata.hasOwnProperty(rtype)) {\n var md = REGIONS.metadata[rtype];\n layers[rtype] = new RegionSet(md.nam... | [
"0.5786589",
"0.56288856",
"0.55163926",
"0.5241714",
"0.51286364",
"0.49934164",
"0.49537152",
"0.48995215",
"0.48657286",
"0.4849285",
"0.4836328",
"0.48201028",
"0.48062423",
"0.47770247",
"0.47742656",
"0.4750631",
"0.4738125",
"0.47307906",
"0.47245735",
"0.4704613",
"0.... | 0.5696489 | 1 |
eslintdisable noparamreassign / Generates HTML and dimensions for nodes and subnodes. | prepareNodes() {
const render = (node) => {
node.html = nodeToHTML(node);
node.nodesHTML = subnodesToHTML(node.nodes);
const dimensions = getDimensions(node.html, {}, 'mindmap-node');
node.width = dimensions.width;
node.height = dimensions.height;
const nodesDimensions = getDim... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function EqnNodeRenderer() { }",
"function TreeGrid_TreeView_CreateHTML(theObject, treeViewData, nHeight)\n{\n\t//helpers\n\tvar imgDiv;\n\t//our node data\n\tvar nodeData = treeViewData.Nodes[theObject.Row];\n\t//get the image\n\tnodeData.NodeImage = Get_Number(theObject.Properties[__NEMESIS_PROPERTY_IMAGE], fa... | [
"0.5902273",
"0.5776758",
"0.5774553",
"0.5701596",
"0.5688724",
"0.55985135",
"0.55919415",
"0.5563202",
"0.55380774",
"0.54495627",
"0.54388404",
"0.54208976",
"0.5420661",
"0.54023945",
"0.53952926",
"0.5385595",
"0.53842795",
"0.53720844",
"0.5339945",
"0.5337881",
"0.532... | 0.7261281 | 0 |
eslintenable noparamreassign / Render mind map using D3. | renderMap() {
const svg = select(this.refs.mountPoint);
// Clear the SVG in case there's stuff already there.
svg.selectAll('*').remove();
// Add subnode group
svg.append('g').attr('id', 'mindmap-subnodes');
this.prepareNodes();
// Bind data to SVG elements and set all the properties to r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function map(div, id) {\n\n var margin = {\n top: 10,\n right: 5,\n bottom: 10,\n left: 5\n };\n\n if ($GRAPHDIV.width() <= MOBILE_THRESHOLD) {\n isMobile = true;\n } else {\n isMobile = false;\n }\n\n if (isMobile) {}\n\n\n var width = $GRAPHDIV.width... | [
"0.68249434",
"0.6750579",
"0.6745456",
"0.6712169",
"0.67108047",
"0.66349083",
"0.6621746",
"0.660856",
"0.65343505",
"0.6502198",
"0.6496552",
"0.64714545",
"0.64554024",
"0.64499205",
"0.6445039",
"0.64267755",
"0.64235574",
"0.642343",
"0.6414656",
"0.63980013",
"0.63948... | 0.7043094 | 0 |
filtering functions "match all" function (as opposed to "match any"). Returns true if every element in the subset array is inlcuded in the superset array | function arrayContainsArray(superset, subset) {
if (0 === subset.length) {
return false;
}
return subset.every(function(value) {
return superset.indexOf(value) >= 0;
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function socialCheck(superset, subset) {\n if (0 === subset.length) {\n return false;\n }\n return subset.every(function(value) {\n return superset.indexOf(value) >= 0;\n });\n}",
"subset(otherSet) {\n const firstSet = this.values()\n\n return firstSet.every(value => {\n return otherSet.has(... | [
"0.7182023",
"0.7106379",
"0.7083918",
"0.68806666",
"0.68397945",
"0.6781066",
"0.6680079",
"0.66686463",
"0.66686463",
"0.66686463",
"0.66686463",
"0.6553382",
"0.6533643",
"0.6493843",
"0.64738965",
"0.64700025",
"0.644482",
"0.64053255",
"0.639827",
"0.63839394",
"0.63471... | 0.7374079 | 0 |
get info of coop to delete | static async getDelInfo(req,res){
try{
const{coopName}=req.body;
const findOne = await Coop.findOne({where:{coopName}});
if (findOne != null) {
return res.render('del-coop',{
findOne,
user:req.user.userFind,
role:{
isEax:req.user.role.isEax(req.user.userFind),
isCoop:req.user.r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static delete(to,t,p,op,couleur,cb){\n\t\tconsole.log(couleur.substr(couleur.length -1));\n\t\tquery.execute(conn, 'echec','delete data {:cell'+to+' rdf:type <'+op+'> . :cell'+to+' rdf:type <'+couleur+'>}',\n\t\t'application/sparql-results+json', {\n\t\t\toffset:0,\n\t\t\treasoning: true\n\t\t}).then(res =>{\n\t\t... | [
"0.62332237",
"0.5662385",
"0.5483911",
"0.5476977",
"0.54731774",
"0.546168",
"0.53317565",
"0.53087413",
"0.5294092",
"0.5262445",
"0.5233348",
"0.52158374",
"0.51878005",
"0.5186974",
"0.51802",
"0.5165245",
"0.5089292",
"0.5082096",
"0.5081064",
"0.5078998",
"0.50757027",... | 0.6667538 | 0 |
message router e3de01bb17fdfbb055b2f49abbdc19c40f574a51 fffffffffffffffffffffffffffffffffffffffff | function router(message) {
// { destID: , data: }
log('message arrived', message);
if(bigInt(message.destId, 16).greater(bigInt(id, 16))) {
// If the difference between me and my sucessor is positive, means we
// are looping the ring
if((bigInt(id, 16).minus(bigInt(fManager.sucessor... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"encode(id, route, msg) {\n let msgStr = JSON.stringify(msg);\n if (route.length > 255) {\n throw new Error('route maxlength is overflow');\n }\n let byteArray = new Uint16Array(HEADER + route.length + msgStr.length);\n let index = 0;\n byteArray[index++] = (id >... | [
"0.6324527",
"0.5810677",
"0.5781485",
"0.5730124",
"0.57006407",
"0.56360084",
"0.5634626",
"0.5615002",
"0.54182744",
"0.5408936",
"0.5373568",
"0.5373568",
"0.53588796",
"0.5321894",
"0.53074706",
"0.53051734",
"0.5286523",
"0.5261974",
"0.52604663",
"0.52425116",
"0.52323... | 0.64679074 | 0 |
This function automatically converts a string of text into a phone number It includes a translater of AZ to corresponding keys | function FormatPhoneNumber(val)
{
if ((val.length == 0) || (val.charAt(0) == "0"))
return val;
var ext = "";
var temp = val;
var vTempExt = "";
var extFound = false;
var isInter = false;
var extAtBegin = false;
var i = -1;
if (val.charAt(0) == "+")
{
isInter... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ParseForNumber1(object){\n phonevalue1 = ParseChar(object.value, zChar);\n}",
"function parsePhone(phone){\n // changes (###)-###-#### to ##########\n}",
"function transformPhoneNumber(number) {\n \n number = number.replace(/\\D/gi, \"\"); //clear off the plus symbol from the front along wit... | [
"0.6383292",
"0.6333798",
"0.62182504",
"0.6208272",
"0.60765254",
"0.6053261",
"0.60367024",
"0.60367024",
"0.60367024",
"0.60327446",
"0.60206294",
"0.5964565",
"0.5911636",
"0.5865047",
"0.58547497",
"0.5833672",
"0.58027387",
"0.57997936",
"0.57535297",
"0.57438135",
"0.5... | 0.6393344 | 0 |
this is the callback from the PickList_GetList() method | function PickList_HandleHttpResponse(results) {
if (results == "NOTAUTHENTICATED")
{
window.location.reload(true);
return;
}
if (this.multiSelect == "True")
{
document.getElementById(this.listId).innerHTML = results;
var listDiv = document.getElementById(this.lis... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function PickList_GetList()\n{\n var list = document.getElementById(this.listId);\n if ((this.multiSelect == \"True\") || (list.options.length == 0))\n {\n if (typeof(xmlhttp) == \"undefined\") {\n xmlhttp = YAHOO.util.Connect.createXhrObject().conn;\n }\n var current = doc... | [
"0.69447327",
"0.62709725",
"0.62048477",
"0.6156275",
"0.6056064",
"0.6050643",
"0.60383695",
"0.6027354",
"0.60223764",
"0.5998169",
"0.5977901",
"0.5974912",
"0.5953059",
"0.59388745",
"0.5909122",
"0.58962244",
"0.58806205",
"0.58678764",
"0.5866981",
"0.58427143",
"0.583... | 0.65370554 | 1 |
creates comment edit box. | function buildCommentEditBox(data){
var _data = data[0];
var $container = $("<div></div>")
.attr(
{id: 'edit-comment-container'}
);
var $textArea = $("<textArea></textArea>")
.attr({
id: 'textArea-edit-comment',
data: _data.comment_timeposted + ',' + _data.post_id
})
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createNewCommentForm() {\n var userSession = RB.UserSession.instance,\n yourcomment_id = \"yourcomment_\" + review_id + \"_\" +\n context_type;\n if (sectionId) {\n yourcomment_id += \"_\" + sectionId;\n }\n\n yourcomment_id += ... | [
"0.7212949",
"0.6830043",
"0.68065995",
"0.66798884",
"0.6576589",
"0.6566196",
"0.6536798",
"0.6532157",
"0.652562",
"0.6359375",
"0.6333659",
"0.6271346",
"0.6270766",
"0.6240516",
"0.62357223",
"0.6230933",
"0.61944073",
"0.6181577",
"0.6173634",
"0.6117028",
"0.6083524",
... | 0.7829359 | 0 |
console.log(addFive(5)); Make a function named isMultipleOfFive(input) | function isMultipleOfFive(input) {
return input % 5 == 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isFive(input) {\n\n}",
"function multipleOfFive(number) {\n if (verbose) {\n console.log('mulitpleOfFive() -> number', number);\n }\n return number % 5 === 0;\n}",
"function isMultipleOfFive(input) {\n return input % 5 === 0;\n}",
"function isMultipleOfFive(number){\n if(number%5 ==... | [
"0.8289716",
"0.805839",
"0.8016315",
"0.77471334",
"0.76721114",
"0.74556065",
"0.73791564",
"0.73520076",
"0.71937644",
"0.7186723",
"0.7155202",
"0.7129999",
"0.7071861",
"0.70184165",
"0.7016469",
"0.6970114",
"0.6950967",
"0.69445634",
"0.6940912",
"0.69208366",
"0.68841... | 0.8116857 | 1 |
Make a function named isThree(input) | function isThree(input) {
return input == 3;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isThree(input) {\n\n}",
"function isMultipleOfThree(input) {\n\n}",
"function isMultipleOfThree(input) {\n return input % 3 == 0; \n }",
"function isMultipleOfThree(input){\n if(input%3 === 0){\n return true;\n } return false;\n}",
"function three () {}",
"function isDivisibleBy... | [
"0.8765913",
"0.71767485",
"0.6772074",
"0.6667872",
"0.6249498",
"0.6239599",
"0.6122953",
"0.60608727",
"0.60578805",
"0.60519797",
"0.59946656",
"0.59066767",
"0.5855003",
"0.57890946",
"0.5769866",
"0.5768831",
"0.57633823",
"0.57343376",
"0.57279587",
"0.5721764",
"0.571... | 0.7994967 | 1 |
Make a function named isMultipleOfThree(input) | function isMultipleOfThree(input) {
return input % 3 == 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isMultipleOfThree(input) {\n\n}",
"function isMultipleOfThree(input){\n if(input%3 === 0){\n return true;\n } return false;\n}",
"function multipleOf3 (number) {\n if(number%3===0) {\n return true;\n } else {\n return false;\n }\n}",
"function multipleThree(num){\n\tif(num%3 ==... | [
"0.92523354",
"0.859762",
"0.81373954",
"0.7760615",
"0.7735044",
"0.7725463",
"0.7723294",
"0.7503836",
"0.7389733",
"0.7384594",
"0.7369377",
"0.73680913",
"0.7253928",
"0.72197175",
"0.6899108",
"0.68529814",
"0.68165445",
"0.6788804",
"0.6749768",
"0.6651453",
"0.66411096... | 0.86603445 | 1 |
Make a function named isMultipleOf(target, n) which checks if target is evenly divisible by n | function isMultipleOf(target, n) {
return (n % target == 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isMultipleOf(target, n) {\n return target % n === 0\n}",
"function isMultiple(number1, number2) {\r\n if (number1 % number2 === 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}",
"function isMultipleOfFive(input) {\n return input % 5 === 0;\n}",
"function ... | [
"0.91634876",
"0.7307194",
"0.7228285",
"0.72152853",
"0.71759814",
"0.7155064",
"0.7136217",
"0.71169114",
"0.7096301",
"0.70872116",
"0.69762427",
"0.69574374",
"0.6952674",
"0.6934285",
"0.6901164",
"0.68965083",
"0.68877",
"0.6867177",
"0.68608624",
"0.6849714",
"0.680550... | 0.89241886 | 1 |
Make a function named isTrue(boolean) | function isTrue(bool) {
return bool;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isTrue(bool){\n \n return (Object.is(true,bool));\n\n }",
"function isTrue(boolean){\n return boolean == 1;\n}",
"function isSomethingTrue(x){\n return x;\n}",
"function myBoolean() {\n return true;\n}",
"function Boolean() {}",
"function isTrue(value) {\n return value == \"... | [
"0.76878995",
"0.7586959",
"0.7550988",
"0.75337523",
"0.7365615",
"0.7351469",
"0.7206656",
"0.71192163",
"0.70853186",
"0.7035651",
"0.7027875",
"0.6988065",
"0.6974274",
"0.6945269",
"0.69143105",
"0.6914116",
"0.690077",
"0.6875429",
"0.6849723",
"0.6831284",
"0.6826899",... | 0.760289 | 1 |
Make a function named isZero(number) | function isZero(num) {
return num == 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isZero($number) {\n return $number === 0;\n }",
"function sc_isZero(x) {\n return (x === 0);\n}",
"function isZero(num){\n\treturn num===\"0\"|| num===\"-0\";\n}",
"function numiszero(x)\n{\n if (typeof(x) == 'number') return x==0;\n if (typeof(x) == 'bigint') return x==0n;\n return x.iszero(... | [
"0.8477679",
"0.782706",
"0.76344305",
"0.75910836",
"0.74570376",
"0.7448577",
"0.74164116",
"0.72781223",
"0.72509843",
"0.7010982",
"0.6953901",
"0.6888458",
"0.676494",
"0.676494",
"0.67258805",
"0.6713252",
"0.6706384",
"0.6700267",
"0.6655973",
"0.66507655",
"0.65802443... | 0.7869618 | 1 |
Make a function named notZero(input) that returns true if the input is not zero | function notZero(num) {
return num !== 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isZero($number) {\n return $number === 0;\n }",
"isNonZero(): boolean {\n return this.value !== 0;\n }",
"function sc_isZero(x) {\n return (x === 0);\n}",
"function numiszero(x)\n{\n if (typeof(x) == 'number') return x==0;\n if (typeof(x) == 'bigint') return x==0n;\n return x.iszero();\n}... | [
"0.7704067",
"0.77004653",
"0.75654435",
"0.7471933",
"0.7384104",
"0.7328102",
"0.73101175",
"0.72239846",
"0.71923375",
"0.71685547",
"0.7069357",
"0.70628285",
"0.7062491",
"0.69997907",
"0.6995755",
"0.69607043",
"0.68780744",
"0.6865524",
"0.6864821",
"0.68641424",
"0.68... | 0.8098704 | 0 |
Write a function named quadruple(n) that returns a number times 4 | function quadruple(n) {
return n * 4;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function quadrado(n) {\n return n * n;\n}",
"function triple(n) { return n * 3 }",
"function triple(n){\n return n*3;\n}",
"function triple(n) {\n return n * 3;\n }",
"function mult4(i) {\r\n\treturn i*4;\r\n}",
"function mult4(i) {\n\treturn i*4;\n}",
"function triangular(n) {\n \n}",
"... | [
"0.7687705",
"0.71469045",
"0.7048207",
"0.6893903",
"0.6874567",
"0.68571854",
"0.6815994",
"0.67691845",
"0.6753613",
"0.6535146",
"0.6474803",
"0.6411363",
"0.6408478",
"0.63674146",
"0.63615656",
"0.63178474",
"0.63174593",
"0.62722635",
"0.61561126",
"0.611548",
"0.61048... | 0.9145871 | 0 |
Write a function named half(n) that returns 1/2 of the provided input | function half(n) {
return n * .5;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function half(n){\n return n/2;\n}",
"function half(num){\n calcHalf = num/2\n return calcHalf;\n}",
"function half(x) {\n var val = x;\n return val * 2;\n}",
"function half(cup){\n\t// divide by 2\n}",
"function halfNumber(number){\n\tvar halfResult = number /2;\n\tconsole.log('Half of '+ number + ' ... | [
"0.90339875",
"0.8186938",
"0.7888114",
"0.77436686",
"0.76978385",
"0.7589951",
"0.7558626",
"0.7535043",
"0.73813283",
"0.73450327",
"0.73267215",
"0.71223044",
"0.70495725",
"0.6905499",
"0.6880911",
"0.6855705",
"0.68535465",
"0.67826366",
"0.6734763",
"0.67320997",
"0.66... | 0.8659573 | 1 |
Write a function named squareRoot(n) that returns the square root of the input | function squareRoot(n) {
return Math.pow(n, 2);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function doubleSquareRootOf(num) {\n // your code here\n}",
"function squareRoot(number) {\n return Math.sqrt(number);\n}",
"function squareRoot(num){\n\n return (num**0.5)\n}",
"function square_root(x) {\n return Math.sqrt(x);\n}",
"function squareRoot( number){\n return Math.sqr... | [
"0.8181323",
"0.8036365",
"0.80240315",
"0.80172837",
"0.7944049",
"0.78756654",
"0.78741044",
"0.786091",
"0.7783513",
"0.7682255",
"0.74316126",
"0.74256474",
"0.74223614",
"0.7324252",
"0.7316368",
"0.72761714",
"0.7262081",
"0.71906227",
"0.7189107",
"0.71861684",
"0.7168... | 0.8601872 | 0 |
Write a function named cubeRoot(n) that returns the cube root of the input | function cubeRoot(n) {
return Math.power(n, 3);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cubeSquareRoot(num) {\n return Math.sqrt(num * num * num);\n}",
"function cube(n) {\n return n * n * n; \n }",
"function cube(x){\n return Math.pow(x, 3);\n}",
"function calculateCube(num) {\n\tconsole.log(Math.pow(num,3));\n}",
"function cube( x ) {\n return Math.pow( x, 3 );\n}",
... | [
"0.7678008",
"0.7328747",
"0.7013569",
"0.6956063",
"0.69119155",
"0.6887562",
"0.67484",
"0.6688227",
"0.66867715",
"0.6685775",
"0.6651717",
"0.664486",
"0.66109234",
"0.6586321",
"0.6570093",
"0.65604675",
"0.64877325",
"0.64462376",
"0.64281106",
"0.6322262",
"0.61770725"... | 0.8746515 | 0 |
Write a function named invertSign(number) that returns a negative version of a postive number, a positve version of negative, and false for all else. | function invertSign(n) {
return -(n);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function invert_negatives(num){\n if(num > 0){\n return num*-1;\n }\n else if(num < 0){\n return num;\n }\n else{\n return false;\n }\n}",
"function opposite(number) {\n return(-number);\n}",
"function opposite(number) {\n return -number;\n}",
"function opposite(num... | [
"0.8102332",
"0.73612845",
"0.72604376",
"0.7186407",
"0.71653175",
"0.7147652",
"0.7080282",
"0.7056459",
"0.70494264",
"0.67902184",
"0.67537737",
"0.64796364",
"0.6408247",
"0.6399885",
"0.63902247",
"0.6323818",
"0.6323115",
"0.6296749",
"0.6292846",
"0.6271617",
"0.62638... | 0.7755696 | 1 |
Write a function named degreesToRadians(number) | function degreesToRadians(n) {
return (n * (Math.PI / 180));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function degreeToRadians(n){\n return (n / 180 * Math.PI).toFixed(2);\n}",
"toRadians(number) {\n return number * (Math.PI / 180);\n }",
"function toRadians(degrees){\n return degrees * Math.PI / 180; \n}",
"function degrees2Radians(degrees)\n{\n return degrees * (Math.PI / 180);\n}",
"function... | [
"0.85186625",
"0.83966297",
"0.8277452",
"0.8199322",
"0.8177517",
"0.8168246",
"0.8028246",
"0.80250144",
"0.80126786",
"0.80124754",
"0.80052704",
"0.80052704",
"0.7997301",
"0.7997301",
"0.7995084",
"0.79913145",
"0.7982458",
"0.7982458",
"0.7982458",
"0.7941477",
"0.78876... | 0.85626405 | 0 |
Write a function named radiansToDegrees(number) | function radiansToDegrees(n) {
return ((180 / Math.PI) * n);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function radiansToDegrees(radians)\n{\n return radians * 180 / Math.PI;\n}",
"function degreeToRadians(n){\n return (n / 180 * Math.PI).toFixed(2);\n}",
"function radiansToDegrees(radians) {\n return radians * 180 / Math.PI;\n}",
"function radiansToDegrees(radians) {\n return radians * 180 / Math.PI;\n... | [
"0.79526174",
"0.7946416",
"0.77939147",
"0.77939147",
"0.7759937",
"0.77531326",
"0.77531326",
"0.7699742",
"0.7658819",
"0.76327276",
"0.76056975",
"0.76046175",
"0.759607",
"0.7567832",
"0.75623",
"0.75438035",
"0.7535502",
"0.7534713",
"0.7531824",
"0.75205994",
"0.751147... | 0.8401968 | 0 |
Make a function named isBlank(input) that determines if a given input is spaces, newline characters, or tabs. | function isBlank(input) {
return (input == " ") || (input == "\n") || (input == "\t");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function is_Blank(input) {\n return input === \"\";\n}",
"function isBlank (input) {\n if (input === \"\" ) {\n return true\n } \n return false \n}",
"function is_Blank(input){\n if (input.length === 0)\n return true;\n else \n return false;\n}",
"function i... | [
"0.8277143",
"0.7942953",
"0.7736108",
"0.76298666",
"0.7388939",
"0.7369038",
"0.7298456",
"0.7295639",
"0.72779125",
"0.72748536",
"0.72206724",
"0.7218178",
"0.72174793",
"0.71121234",
"0.7111809",
"0.7078452",
"0.7059338",
"0.7039301",
"0.69597274",
"0.69557095",
"0.69251... | 0.8683391 | 0 |
Make a function named areEqual(input1, input2) that returns if both inputs have the same value | function areEqual(inp1, inp2) {
return inp1 == inp2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function areIdentical(inp1, inp2) {\n return inp1 === inp2;\n }",
"function matchWithTwoParameters(inputOne, inputTwo){\n if(inputOne === inputTwo){\n return true;\n }else{\n return false;\n }\n}",
"function isEqual(a,b){\n return a === b\n}",
"function checkEqual (a,b){\n return a==b? tru... | [
"0.7965738",
"0.73222667",
"0.72651327",
"0.7104541",
"0.7059763",
"0.6981034",
"0.69339824",
"0.69247997",
"0.6912726",
"0.6900092",
"0.6884905",
"0.68791157",
"0.6878733",
"0.6867615",
"0.68653",
"0.6801213",
"0.6801213",
"0.6801213",
"0.6801213",
"0.6801213",
"0.6801213",
... | 0.8328776 | 0 |
Make a function named areIdentical(input1, input2) that returns if both inputs are same value and data type. | function areIdentical(inp1, inp2) {
return inp1 === inp2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function typeChecker(x, y) {\n if (typeof x === typeof y) {\n console.log(\"Variables Have the same type of data\");\n } else {\n console.log(\"They are not the same\");\n }\n}",
"function sameType(a, b) {\n return typeof a === typeof b\n}",
"function areEqual(inp1, inp2) {\n return ... | [
"0.6786537",
"0.6758395",
"0.66931087",
"0.6545721",
"0.65047914",
"0.65047914",
"0.65047914",
"0.65047914",
"0.65047914",
"0.65047914",
"0.65047914",
"0.65047914",
"0.65047914",
"0.65047914",
"0.65047914",
"0.65047914",
"0.65047914",
"0.65047914",
"0.65047914",
"0.6496016",
... | 0.7364581 | 0 |
Make a function named not(input) returns the input with a flipped boolean | function not(input) {
return !(input);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function not(x) { return !x; }",
"function not(p) {\n return (x) => !p(x);\n }",
"function negate(fn){\n return function not(...args){\n return !fn(...args)\n }\n}",
"function not(b){ return !b; }",
"function not(x) {\n return !x;\n }",
"function not(f) {\n return (...args) => !f(..... | [
"0.76870906",
"0.7680772",
"0.7624328",
"0.756564",
"0.73728895",
"0.7270944",
"0.69310814",
"0.68942153",
"0.68675035",
"0.6779991",
"0.6778299",
"0.6770476",
"0.6770476",
"0.6770476",
"0.66675746",
"0.6642611",
"0.6642611",
"0.66212994",
"0.6512908",
"0.63561743",
"0.635617... | 0.79472375 | 0 |
Make a function named and(predicate1, predicate2) that returns the logical operation of AND | function and(predicate1, predicate2) {
return predicate1 && predicate2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function and(...predicates) {\n return (x) => {\n let result = true;\n for (const predicate of predicates) {\n result = result && checkedPredicate('argument of and', predicate)(x);\n }\n return result;\n };\n }",
"function and() {\n var _args = arguments;\n var _an... | [
"0.8301785",
"0.79342914",
"0.7906038",
"0.7906038",
"0.7906038",
"0.7906038",
"0.7900561",
"0.7834048",
"0.7808687",
"0.77918416",
"0.7785777",
"0.77692425",
"0.7754975",
"0.77541995",
"0.7638099",
"0.7638099",
"0.76295066",
"0.7584871",
"0.7572399",
"0.75443625",
"0.7523840... | 0.8751124 | 0 |
Simple Function Drills Make a function called returnTwo() that returns the number 2 when called | function returnTwo() {
return 2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function returnTwo() {\n\treturn 2;\n}",
"function returnTwo() {\n return 2\n}",
"function two() {\n console.log('two');\n return 2;\n}",
"function returnTwo() {\n return 2; // otherwise it should rather just be a constant.\n}",
"function two() {\r\n console.log('work 2');\r\n return 54;\r\n}... | [
"0.88185185",
"0.8718443",
"0.80192703",
"0.77483803",
"0.7718979",
"0.7673583",
"0.76699793",
"0.7408916",
"0.7354649",
"0.7294071",
"0.7294071",
"0.7171693",
"0.71173745",
"0.7102401",
"0.7097133",
"0.7010088",
"0.69836116",
"0.69005734",
"0.6874171",
"0.68641555",
"0.66794... | 0.8902657 | 0 |
Remember this function does not need a defined return value Make a function called returnName() that returns the string of your name | function returnName(name) {
console.log(name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function returnName() {\n return 'Stuart Hamblin';\n}",
"function returnMyName() {\n return myName;\n}",
"function returnMyName() {\n return myName;\n}",
"function returnMyName () {\n return 'jacob'\n}",
"function MyNameReturn(name) {\n return \"Hello \" + name;\n}",
"function get_my_name(na... | [
"0.88713413",
"0.8634587",
"0.8634587",
"0.82379353",
"0.81623834",
"0.8159735",
"0.81444687",
"0.8054402",
"0.80134976",
"0.7920546",
"0.78708845",
"0.78394914",
"0.7819552",
"0.78120726",
"0.7778601",
"0.7769004",
"0.774799",
"0.76802665",
"0.7672046",
"0.7648349",
"0.76343... | 0.8635929 | 1 |
Make a function called addThree() which takes in a number input and returns the number plus 3. | function addThree(num) {
return num + 3;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addThree(numberinput) {\n return numberinput + 3;\n}",
"function plusThree(num) {\n return num + 3;\n }",
"function plusThree(num) {\n return num + 3;\n}",
"function plusThree(num) {\n return num + 3;\n}",
"function addThree(num1, num2, num3){\n\treturn num1+num2+num3;\n}",
"function addT... | [
"0.8976461",
"0.873344",
"0.8577705",
"0.8577705",
"0.850609",
"0.82055616",
"0.8112138",
"0.7936896",
"0.7713327",
"0.77085495",
"0.7707761",
"0.7575804",
"0.75613135",
"0.7493176",
"0.7493176",
"0.7461157",
"0.7461157",
"0.7461157",
"0.7460396",
"0.7458861",
"0.74550265",
... | 0.9005748 | 0 |
Make a function called sayString() which returns the string input passed in. | function sayString(str) {
return str;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sayString(stringinput) {\n return stringinput;\n}",
"function sayHello(string) {\n return string;\n}",
"function sayMyName(myName) {\n return (\"Hello, my name is \" + myName);\n}",
"function sayHello(name) {\n return (\"Hello, \" + name);\n}",
"function sayHi(name, age) {\n return \"Hi... | [
"0.8967875",
"0.8276764",
"0.7407029",
"0.73576045",
"0.72839296",
"0.72426385",
"0.7226668",
"0.7220458",
"0.72032493",
"0.71792215",
"0.7156865",
"0.7106493",
"0.7092533",
"0.70830035",
"0.7074069",
"0.7067531",
"0.7067531",
"0.70495045",
"0.70246357",
"0.70076114",
"0.7007... | 0.840684 | 1 |
Challenge Function Drills Write a function called identity(input) that takes in an argument called input and returns that input. | function identity(input) {
return input;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function identity(input){\n return input;\n}",
"function identity(input) {\n return input;\n }",
"function identity(input) {\n return input;\n}",
"function identity(argument) {\n return argument }",
"function identity(x) {\n return x;\n}",
"function identity(x) {\n return x;\n}",
"fu... | [
"0.81934035",
"0.8183722",
"0.818371",
"0.68196493",
"0.681474",
"0.681474",
"0.681474",
"0.6814417",
"0.6814417",
"0.6814417",
"0.6814417",
"0.6814417",
"0.6814417",
"0.6814417",
"0.6814417",
"0.6814417",
"0.6814417",
"0.6814417",
"0.6814417",
"0.6814417",
"0.6814417",
"0.... | 0.8199805 | 1 |
Write a function called rest(input) that returns everything but the first character of a string. | function rest(input) {
return input.substring(1, (input.length));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rest(input) {\n var notFirst = input.slice(1);\n return notFirst;\n}",
"function rest(inputss) {\n return inputss.substring(1, inputss.length);\n}",
"function first(input) {\n return input.substring(0, 1);\n}",
"function get_rest(str) {\n return str.substr(0, str.length - 3);\n }",
... | [
"0.848793",
"0.8173953",
"0.72865283",
"0.6641939",
"0.6568541",
"0.6555498",
"0.6494132",
"0.6471768",
"0.64526176",
"0.6435892",
"0.63949883",
"0.63568246",
"0.63488775",
"0.6294532",
"0.62813157",
"0.62427306",
"0.6221824",
"0.61828196",
"0.6181724",
"0.61566484",
"0.60666... | 0.8876756 | 0 |
Write a function called isNumeric(input) that takes an input and returns a boolean if the input is numeric. | function isNumeric(input) {
return (typeof input) == "number";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isNumeric(input) {\n var numericBoolean = !isNaN(input);\n return numericBoolean\n}",
"function isNumeric(input) {\n if(isNaN(parseFloat(input))) {\n return false;\n } else {\n return true;\n }\n}",
"function isNumeric(input) {\n return input !== undefined\n && input !... | [
"0.88800645",
"0.82701683",
"0.81801134",
"0.8148476",
"0.79433113",
"0.7820047",
"0.7803956",
"0.7757889",
"0.7757889",
"0.7757889",
"0.7757889",
"0.7757889",
"0.7757889",
"0.7757889",
"0.7757889",
"0.7757889",
"0.7757889",
"0.7757889",
"0.7757889",
"0.7757889",
"0.77483624"... | 0.88434464 | 1 |
Write a function called count(input) that takes in a string and returns the number of characters. | function count(str) {
return str.length;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function count(input) {\n var numberChar = input.length;\n return numberChar;\n}",
"function numberofCharacters(input) {\n const num = input.length\n console.log( input + \" \" + \"has\" + \" \" + num + \" \" + \"characters\");\n}",
"static countSubString(input, strToCount) {\n if (!input || !st... | [
"0.85068005",
"0.7608623",
"0.7469922",
"0.74568605",
"0.740128",
"0.7325665",
"0.72870517",
"0.7275115",
"0.72538227",
"0.71647614",
"0.71647614",
"0.7149819",
"0.71370596",
"0.71284086",
"0.71113193",
"0.70887995",
"0.70887995",
"0.7076059",
"0.70538694",
"0.7050828",
"0.70... | 0.7931207 | 1 |
Return true if the string start with a lowercase char | function startsWithLowercase (str)
{
return str.charAt(0).toUpperCase() !== str.charAt(0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isLowerCase(str) {\n return str == str.toLowerCase() && str != str.toUpperCase();\n}",
"function isLower(c){\r\n return c.toLowerCase() == c;\r\n}",
"function containsLowerCase(s) {\n return s != s.toUpperCase();\n}",
"function sc_isCharLowerCase(c)\n { return sc_isCharOfClass(c.val, SC_... | [
"0.792119",
"0.79086196",
"0.78335583",
"0.7786649",
"0.76886296",
"0.76629984",
"0.76337785",
"0.75116974",
"0.7503816",
"0.74767673",
"0.7473092",
"0.7464218",
"0.74487734",
"0.74257326",
"0.7422363",
"0.7357665",
"0.73429793",
"0.7262225",
"0.7262225",
"0.7239833",
"0.7227... | 0.8549838 | 0 |
Wrap the text in lines of max length maxLineLength . | function wrapText (text, maxLineLength)
{
const words = text.replace(/[\r\n]+/g, ' ').split(' ');
let lineLength = 0;
// use functional reduce, instead of for loop
return words.reduce((result, word) => {
if (lineLength + word.length >... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function textWrap(maxLength, input) {\n let lines = [];\n let line = '';\n function pushLine(str, ws) {\n if (line.length && ws) line += ws;\n line += str;\n while (line.length > maxLength) {\n lines.push(line.slice(0, maxLength));\n line = line.slice(maxLength);\n }\n }\n let split = in... | [
"0.784817",
"0.7837567",
"0.74704814",
"0.74009037",
"0.74009037",
"0.7305176",
"0.7216871",
"0.7110812",
"0.71101755",
"0.7107226",
"0.7035977",
"0.6946497",
"0.6946497",
"0.6896849",
"0.6887975",
"0.6848045",
"0.67538023",
"0.67311245",
"0.6687419",
"0.66855925",
"0.6669922... | 0.8031947 | 0 |
Create an empty interface with a comment and return the code | function makeEmptyInferface (name, comment)
{
return makeComment(0, comment) + 'export interface ' + name + '\n{\n\n}\n';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function implementationCode(snippet)\n{\n var implementationSnippetPart = snippet[@\"implementation\"]\n\n return renderItems([NSArray arrayWithObjects:implementationSnippetPart[@\"imports\"],\n implementationSnippetPart[@\"implementation_tag\"][0],\n implementatio... | [
"0.6306075",
"0.6256199",
"0.6199101",
"0.59552276",
"0.5790135",
"0.56118584",
"0.56118584",
"0.5458047",
"0.543542",
"0.5424816",
"0.541219",
"0.52854884",
"0.52854884",
"0.5253675",
"0.5210164",
"0.52098364",
"0.5198204",
"0.51451206",
"0.5139713",
"0.5109844",
"0.5109844"... | 0.7417698 | 0 |
callback to change speed (FPS) on OPS slidebar change | function set_speed() {
frameRate(speed_box.value * 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changeSpeed(e) {\n const y = e.pageY - this.offsetTop;\n const percent = y / this.offsetHeight;\n const [max, min] = [4, 0.4];\n const playbackRate = (percent * (max - min) + min).toFixed(2);\n console.log(playbackRate);\n speedBar.style.height = `${Math.round(percent * 100)}%`;\n speedBar.textCont... | [
"0.7455892",
"0.71660006",
"0.6819073",
"0.6717093",
"0.65600365",
"0.6451927",
"0.6435405",
"0.6427074",
"0.63831687",
"0.6367638",
"0.6366447",
"0.6349063",
"0.63467807",
"0.63309115",
"0.62718916",
"0.6271471",
"0.6268576",
"0.624838",
"0.623001",
"0.6210057",
"0.61792547"... | 0.7185218 | 1 |
Gets the boolean value of the given bit | function bit(value, bit) {
return (value & (1 << bit)) > 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bit (value) {\n\t return value === 0 || value === 1\n\t}",
"isBit(val) {\n return val === 0 || val === 1;\n }",
"get boolValue() {}",
"function getBit(x, i) {\n return (x >>> i & 1) != 0;\n }",
"function getBit(num, i){\n return (num & (1 << i)) !== 0\n}",
"getBoolean() {\n ... | [
"0.7106115",
"0.69439805",
"0.6830052",
"0.6763821",
"0.67099196",
"0.6682064",
"0.6452908",
"0.64095545",
"0.6392742",
"0.63340616",
"0.6326843",
"0.6326843",
"0.6326843",
"0.6326843",
"0.6300218",
"0.6275703",
"0.62692606",
"0.62502474",
"0.62452644",
"0.6229249",
"0.621642... | 0.72551113 | 0 |
Renders weather data . | function renderWeatherData(data){
const city = data.name;
const main = data.main;
const wind = data.wind;
const weather = data.weather;
const sys = data.sys;
const sunrise = time(sys.sunrise);
const sunset = time(sys.sunset);
let html = '<div class="row">';
html += '<div class="col s1"><h5> '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderWeather(data) {\n\toutputLocation.textContent = data.name + \", \" + data.sys.country;\n\toutputTemp.textContent = Math.round(data.main.temp);\n\toutputDesc.textContent = \" \" + data.weather[0].description;\n\toutputMaxTemp.textContent = \" \" + Math.round(data.main.temp_max);\n\toutputMinTemp.text... | [
"0.85064924",
"0.78974575",
"0.78033245",
"0.77349603",
"0.7659056",
"0.7610899",
"0.75756353",
"0.74539405",
"0.73594713",
"0.7346745",
"0.7327087",
"0.73194003",
"0.73091376",
"0.73025584",
"0.7293074",
"0.7261811",
"0.72428",
"0.7229026",
"0.7223853",
"0.7215916",
"0.72152... | 0.7980586 | 1 |
Load a schema associated with a PATCH, POST or PUT resource and render a form based on the schema. | function loadSchema(resource, method, schemaUrl) {
//$resourceInput.prop('disabled', true);
// Read schema using GET
$.ajax({
timeout: xhrTimeout,
type: 'GET',
url: schemaUrl,
})
.done(function(data) {
const schema = cachedData["template"];... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function requestSchema () {\n // Reset greenEdges / greenNodes to false (so data does not persist)\n dispatch({\n type: \"greenEdges\",\n payload: false\n })\n dispatch({\n type: \"greenNodes\",\n payload: false\n })\n\t\tfetch('http://localhost:3000/getSchema')\n\t\t\t.then(res ... | [
"0.589906",
"0.57080084",
"0.5317894",
"0.5289356",
"0.5267461",
"0.521143",
"0.51627237",
"0.5129329",
"0.511671",
"0.51037073",
"0.50493157",
"0.50461257",
"0.5044073",
"0.5019207",
"0.5003903",
"0.49865106",
"0.4964104",
"0.49508855",
"0.4929247",
"0.49168116",
"0.4896085"... | 0.73331046 | 0 |
Formats a title value by uppercasing the first letter and replacing underscores with spaces. | function formatTitle(title) {
var title = title.replace(/[^\w\s]/gi, '')
return title.slice(0, 1).toUpperCase() + title.slice(1).replace(/_/g, ' ');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function titleize(value) {\n\t return humanize(underscore(value)).replace(/\\b('?[a-z])/g, m => m.toUpperCase());\n\t} // Capitalizes the first word and turns underscores into spaces and strips a",
"function transform_title(title) {\n return title.toLowerCase().replace(/ /g, \"_\");\n}",
"function normaliz... | [
"0.7868299",
"0.7756199",
"0.76040244",
"0.76040244",
"0.75367886",
"0.74054724",
"0.7263819",
"0.72583264",
"0.72517693",
"0.72342676",
"0.7201451",
"0.71753216",
"0.71572",
"0.7101551",
"0.7065923",
"0.6909514",
"0.67324835",
"0.6686789",
"0.66762996",
"0.6656615",
"0.66454... | 0.8115154 | 0 |
Build a resource link (i.e. that has class `resourcelink`). | function createLink(href, title, method = 'GET', schemaUrl = '') {
return `
<a
class="resource-link"
href="${escapeAttr(href)}"
data-method="${escapeAttr(method)}"
data-schema-url="${escapeAttr(schemaUrl)}"
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createAndLink(fromResource, useProperty, type, dataCallback) {\n RDFAUTHOR_START_FIX = \"linkAndCreate\";\n var serviceUri = urlBase + 'service/rdfauthorinit';\n\n // check if an resource is in editing mode\n if (typeof RDFAUTHOR_STATUS != 'undefined') {\n if(RDFAUTHOR_STATUS === 'activ... | [
"0.6357768",
"0.62246174",
"0.6178926",
"0.6053784",
"0.60456175",
"0.6039336",
"0.587422",
"0.5790987",
"0.5757347",
"0.57029784",
"0.5681839",
"0.5681238",
"0.5667626",
"0.5648408",
"0.5634596",
"0.5543463",
"0.55390066",
"0.5476205",
"0.54281175",
"0.54219794",
"0.53992885... | 0.62579966 | 1 |
Escape values being printed as HTML to prevent XSS injections Arrays are converted such that each element of the array gets escaped individually. | function escapeHtml(value) {
if (Array.isArray(value)) {
return value.map(val => escapeHtml(val));
}
if (typeof value !== 'string') {
return value;
}
return value.replace(/</g, '<').replace(/>/g, '>');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function escape(value) {\n return value.replace(/>/g, '>').replace(/</g, '<');\n }",
"function escapeHTML(value) {\n return String(value)\n .replace(/&/g, '&')\n .replace(/</g, '<');\n }",
"function escapeHTML(value) {\n return String(value)\n .replace(/&/g, '... | [
"0.65799755",
"0.65636384",
"0.6406947",
"0.6403371",
"0.6388876",
"0.6296512",
"0.6263485",
"0.61826485",
"0.6172541",
"0.6161658",
"0.610483",
"0.610483",
"0.610483",
"0.61003226",
"0.6078851",
"0.6054096",
"0.59947324",
"0.5910468",
"0.58921933",
"0.5890444",
"0.5881223",
... | 0.7617605 | 0 |
Escape an attribute enclosed in double quotes. | function escapeAttr(value) {
if (typeof value !== 'string') {
return value;
}
// If not string then convert double quotes
return value.replace(/"/g, '"');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function escapeAttribute(value) {\n return value.replace(/&/g, '&').replace(/'/g, ''').replace(/</g, '<').replace(/>/g, '>').replace(/\"/g, '"');\n}",
"function escapeAttribute(value) {\n return value.replace(/&/g, '&').replace(/'/g, ''').replace(/</g, '<').replace(/>/g, '&g... | [
"0.77954066",
"0.77954066",
"0.77954066",
"0.7772799",
"0.7710922",
"0.7164524",
"0.7034465",
"0.680758",
"0.6772222",
"0.6657693",
"0.6547349",
"0.653502",
"0.65022135",
"0.6472842",
"0.6385783",
"0.63668793",
"0.632955",
"0.632955",
"0.632955",
"0.632955",
"0.61832035",
"... | 0.81985116 | 0 |
Formats a value being printed to a table. Nulls get enclosed in `` tags for visual sexiness. Arrays get joined with a comma plus a space. Other values are left intact. | function formatTableValue(value) {
if (value === null) {
return '<code>null</code>';
} else if (Array.isArray(value)) {
return value.join(', ');
} else {
return value;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tabletypeformatter(value, row, index) { \n let multiple = false; \n if (value === null || value === '' || value === undefined) \n { \n return \"\";\n } \n if (multiple) { \n let valarray = value.split(','); \n let result = tabletypedatasource.filter(item => vala... | [
"0.67348176",
"0.65550727",
"0.6524361",
"0.6414102",
"0.63740724",
"0.634535",
"0.6235853",
"0.6204728",
"0.6121289",
"0.6119399",
"0.60857165",
"0.6061396",
"0.60131836",
"0.60131836",
"0.598991",
"0.5981595",
"0.5971391",
"0.5969614",
"0.5969194",
"0.5969194",
"0.59666663"... | 0.8469254 | 0 |
remove geneSetIdForGsea from the query parameters when it is closed | onHide() {
// Defer setting the query parameters. When a user navigates away from
// the page with the modal open (viewing a job, for example), the
// query parameter is cleared before the route changes. This means
// that when the user hits the back button, the query parameter won't
// ex... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"dispose() {\n const addBtn = document.getElementById(this.buttonId);\n if (addBtn) {\n addBtn.parentElement.removeChild(addBtn);\n Object.keys(this.selectedParams, (searchItemId) =>\n this.removeParam(searchItemId)\n );\n }\n }",
"function unloadParams() {\r\n try {\r\n ... | [
"0.53151184",
"0.52667737",
"0.51083547",
"0.5045871",
"0.5002106",
"0.4937653",
"0.48885298",
"0.48583332",
"0.47834522",
"0.47795302",
"0.4770108",
"0.47690403",
"0.47604972",
"0.47288257",
"0.47199526",
"0.46994",
"0.46994",
"0.4690018",
"0.46836528",
"0.46573114",
"0.4647... | 0.6094718 | 0 |
Gets the text as html encoded This is a delegate for $.val() | function fnGetHtmlText(i, value) {
var html = $("<div/>").text(value).html();
return $.trim(html);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function htmlEncode(value){\r\n return $(document.createElement('div')).text(value).html();\r\n }",
"function pl_html_input( text ) {\n\t\n\tif( typeof text != 'string')\n\t\treturn text\n\telse \t\n\t\treturn jQuery.trim( pl_htmlEntities( pl_stripSlashes( text ) ) )\n}",
"function valuetext(va... | [
"0.70143974",
"0.6739233",
"0.66431475",
"0.65868944",
"0.6535493",
"0.6535493",
"0.64377767",
"0.64182985",
"0.6342604",
"0.6336228",
"0.6336228",
"0.6336228",
"0.6336228",
"0.6273652",
"0.61948705",
"0.61756516",
"0.61157715",
"0.6113528",
"0.6103835",
"0.6092132",
"0.60904... | 0.7206743 | 0 |
Sets the numeric format in esCO culture. Places decimal "." and thousand "," separator | function fnNumericFormat(obj) {
var _isDOM = input.isText(obj),
_text = _isDOM ? obj.value : obj.toString();
var x = _text.replace(/\./g, "").split(",") || [""];
var num = x[0].replace(/\B(?=(\d{3})+(?!\d))/g, ".");
var dec = x.length > 1 ? "," + x[1] : "";
if (_isDOM... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function number_format(numero, decimal, decimal_separador, milhar_separador) {\n numero = (numero + '').replace(/[^0-9+\\-Ee.]/g, '');\n var n = !isFinite(+numero) ? 0 : +numero,\n prec = !isFinite(+decimal) ? 0 : Math.abs(decimal),\n sep = (typeof milhar_separador === 'undefined') ? ',... | [
"0.6536505",
"0.6488356",
"0.6392444",
"0.6355214",
"0.63144064",
"0.6269923",
"0.62577933",
"0.6234737",
"0.61807317",
"0.6160163",
"0.6139448",
"0.61344254",
"0.61274767",
"0.6114461",
"0.61137795",
"0.6105557",
"0.6104619",
"0.60753554",
"0.6022257",
"0.59768146",
"0.59633... | 0.6540078 | 0 |
Validates the format of text, depending on the type supplied. Date validations are performed according to esCO culture | function fnIsValidFormat(obj, _type) {
var _pattern = null,
_text = input.isText(obj) ? obj.value : obj.toString();
switch (_type) {
case "d": //Validates Date format: dd/MM/yyyy
_pattern = /^((0[1-9])|([1-2][0-9])|(3[0-1]))\/((0[1-9])|(1[0-2]))\/([1-2][0,9][0-9][... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isValidDateFormat (str_date, lingua) {\n\t\n\tvar invalidFormatMsg = \"Formato di data non valido\";\n\tvar validFormatMsg = \"Il formato consentito e' gg/mm/yyyy.\";\n\tvar allowedValueMsg = \"I valori consentiti sono interi senza segno.\";\n\tvar invalidDayMsg = \"Valore del giorno del mese non valido\"... | [
"0.6684475",
"0.64335144",
"0.6267879",
"0.62498",
"0.61995226",
"0.6087723",
"0.6059682",
"0.6059528",
"0.59979653",
"0.5890497",
"0.5835156",
"0.58278173",
"0.5819138",
"0.5786478",
"0.57467115",
"0.5721625",
"0.57119155",
"0.5711575",
"0.5698436",
"0.56309104",
"0.56255215... | 0.6976309 | 0 |
Check whether a source file needs to be parsed for imports. This is a performance shortcircuit, which saves us from creating a TypeScript AST unnecessarily. | function hasImportOrReexportStatements(source) {
return /(?:import|export)[\s\S]+?(["'])(?:\\\1|.)+?\1/.test(source);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkSourceFileWorker(node) {\n var links = getNodeLinks(node);\n if (!(links.flags & 1 /* TypeChecked */)) {\n // If skipLibCheck is enabled, skip type checking if file is a declaration file.\n // If skipDefaultLibCheck is enabled, skip type checking if... | [
"0.61898446",
"0.5985274",
"0.5978311",
"0.59717196",
"0.59393466",
"0.5921379",
"0.5921379",
"0.5921379",
"0.5921379",
"0.5921379",
"0.57871836",
"0.5752654",
"0.57250744",
"0.56834614",
"0.56019515",
"0.5555433",
"0.5531923",
"0.5486371",
"0.5486371",
"0.5454508",
"0.537863... | 0.62445533 | 0 |
Check whether the given statement is an import with a string literal module specifier. | function isStringImportOrReexport(stmt) {
return ts.isImportDeclaration(stmt) ||
ts.isExportDeclaration(stmt) && !!stmt.moduleSpecifier &&
ts.isStringLiteral(stmt.moduleSpecifier);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tryConsumeImport() {\n var token = scanner.getToken();\n if (token === 89 /* ImportKeyword */) {\n token = nextToken();\n if (token === 9 /* StringLiteral */) {\n // import \"mod\";\n recordModuleName();\n ... | [
"0.664727",
"0.6220677",
"0.6111079",
"0.6064971",
"0.6064971",
"0.5873745",
"0.58698875",
"0.5837436",
"0.58260465",
"0.5818379",
"0.5818379",
"0.5818379",
"0.5818379",
"0.5818379",
"0.5789798",
"0.57186204",
"0.56844956",
"0.55732447",
"0.5568721",
"0.5560913",
"0.5543934",... | 0.74798083 | 0 |
We will calculate the maximum heart rate of a person, measured in beat per minute which is also calculated using the age of a person. The formular is 206.9 (0.67 age) => applied for ages between 18 and 81. | function maxHeartRate(el) {
if (el >= 18 && el <= 81) {
return Math.round(206.9 - 0.67 * el);
} else {
return -1;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function maxHeartRate(ele) {\n if (ele >= 18 && ele <= 81) {\n return Math.round(206.9 - 0.67 * ele);\n } else {\n return -1;\n }\n}",
"function maxHeartRate(element) {\n if (element >= 18 && element <= 81) {\n return Math.round(206.9 - (0.67 * element));\n } else {\n return -1;\n ... | [
"0.740899",
"0.71790713",
"0.58493555",
"0.58194625",
"0.57027197",
"0.5649108",
"0.56414384",
"0.56305134",
"0.56223655",
"0.5577138",
"0.5574759",
"0.55507225",
"0.55472875",
"0.5545709",
"0.5538669",
"0.55317414",
"0.54847443",
"0.5474719",
"0.5473947",
"0.54671806",
"0.54... | 0.7379862 | 1 |
Fetch data from Guppy server and return raw data, for only given fields This funciton will not update this.state.rawData and this.state.totalCount | handleFetchRawDataByFields({fields, offset=0, size=20, sort=[]}) {
let targetFields = fields;
if (typeof fields === 'undefined') {
targetFields = this.state.allFields;
}
return this.getDataFromGuppy(targetFields, sort, false, offset, size);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleFetchRawData({offset=0, size=20, sort=[]}) {\n return this.getDataFromGuppy(this.state.allFields, sort, false, offset, size);\n }",
"handleFetchAndUpdateRawData({offset=0, size=20, sort=[]}) {\n return this.getDataFromGuppy(this.state.allFields, sort, true, offset, size);\n }",
"function rawData(... | [
"0.6540895",
"0.63555944",
"0.5825539",
"0.58025277",
"0.577258",
"0.57267565",
"0.5590721",
"0.5588525",
"0.5588525",
"0.5567321",
"0.5506716",
"0.55063885",
"0.547442",
"0.5451534",
"0.5426264",
"0.5423437",
"0.54044574",
"0.537908",
"0.5377369",
"0.53690034",
"0.53682446",... | 0.68296117 | 0 |
sorts user interest categories input is array of user selected interests eg. Art, Science etc. iterates through list of companies, pushing to companyList array if there's a match for companies with multiple categories, checks that company isn't already in companyList array | function sortInterest (categories) {
for (var j = 0; j < categories.length; j++) {
for (var i = 0; i < companies.length; i++) {
if (categories[j] == companies[i].category) {
companyList.push(companies[i]);
}
}
}
return companyList;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"parseUniqueCategories(dataSet) {\n return dataSet.businesses.reduce((accum, business) => {\n business.categories.forEach((item) => {\n if (!(accum.findIndex(ele => ele.displayTitle === item[0]) + 1)) {\n const newObject = {\n displayTitle: item[0],\n imageUrl: business... | [
"0.5703428",
"0.5460583",
"0.53776777",
"0.5299016",
"0.5204118",
"0.51955485",
"0.5082339",
"0.50560266",
"0.50554234",
"0.5016368",
"0.4996055",
"0.49618995",
"0.4956479",
"0.4949725",
"0.4943682",
"0.49414206",
"0.49200508",
"0.48933372",
"0.48864263",
"0.48831084",
"0.485... | 0.7710911 | 0 |
Using a Defined Matrix, we render the DOM with it... | MatrixDom(Matrix, ActiveColumn, ActiveRow)
{
const ConditionalClass = (index, targetIndex, ClassName) => index === targetIndex ? " "+ClassName : "";
this.DomLocation.innerHTML = Matrix.map((RowData, RowIndex) => {
return `<div class='matrixRow'>` + RowData.map((MatrixValue, ColumnIndex... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderMatrix() {\n let templateStr = ``;\n for (let i = 0; i < 20; i++) {\n templateStr += `<tr>`\n for (let j = 0; j < 20; j++) {\n templateStr += `\n <td data-row=${j} data-col=${i}></td>\n `\n }\n templateStr += `</tr>`\n }\n ... | [
"0.760532",
"0.72557014",
"0.6784495",
"0.67103046",
"0.66990805",
"0.6536924",
"0.6526858",
"0.6512996",
"0.63228524",
"0.6321623",
"0.6320143",
"0.6270662",
"0.62424177",
"0.62417156",
"0.6237137",
"0.6189809",
"0.6179926",
"0.6151804",
"0.6142705",
"0.6128361",
"0.61185837... | 0.75774425 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.