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 |
|---|---|---|---|---|---|---|
Gets the scrolling settings depending on the plugin autoScrolling option | function getScrollSettings(top) {
var options = getOptions();
var position;
var element; //top property animation
if (options.autoScrolling && !options.scrollBar) {
position = -top;
element = $(WRAPPER_SEL)[0];
} //window real scrolling
else {
position = top;... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getScrollSettings(top){\n var scroll = {};\n\n //top property animation\n if(options.autoScrolling && !options.scrollBar){\n scroll.options = -top;\n scroll.element = $(WRAPPER_SEL)[0];\n }\n\n //window real scrolling\n ... | [
"0.72776747",
"0.72776747",
"0.7200187",
"0.7187466",
"0.7098573",
"0.70851624",
"0.7048597",
"0.7043184",
"0.7043184",
"0.7043184",
"0.7043184",
"0.7043184",
"0.7043184",
"0.6249885",
"0.6144424",
"0.59806854",
"0.5899482",
"0.5899482",
"0.5899482",
"0.5899482",
"0.5885391",... | 0.73449135 | 0 |
Retuns `up` or `down` depending on the scrolling movement to reach its destination from the current section. | function getYmovement(activeSection, destiny) {
var fromIndex = activeSection.index();
var toIndex = index(destiny, SECTION_SEL);
if (fromIndex == toIndex) {
return 'none';
}
if (fromIndex > toIndex) {
return 'up';
}
return 'down';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getScrollDirection(currentScroll) {\n var direction = currentScroll > lastScroll ? 'down' : 'up';\n lastScroll = currentScroll; //needed for auto-height sections to determine if we want to scroll to the top or bottom of the destination\n\n previousDestTop = currentScroll;\n return dire... | [
"0.6806405",
"0.6778732",
"0.6778732",
"0.6778732",
"0.6778732",
"0.6778732",
"0.67240685",
"0.67193455",
"0.67193455",
"0.67193455",
"0.65758693",
"0.654901",
"0.65422976",
"0.6527647",
"0.6526379",
"0.6526379",
"0.6524218",
"0.6485899",
"0.6485899",
"0.6485899",
"0.6485438"... | 0.6984414 | 0 |
Defines the scrolling speed | function setScrollingSpeed(value, type) {
setVariableState('scrollingSpeed', value, type);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setScrollingSpeed(value, type){\n setVariableState('scrollingSpeed', value, type);\n }",
"function setScrollingSpeed(value, type){\n setVariableState('scrollingSpeed', value, type);\n }",
"function setScrollingSpeed(value, type){\n setVariableState('scrol... | [
"0.8264073",
"0.8264073",
"0.8264073",
"0.8264073",
"0.8264073",
"0.82606244",
"0.82606244",
"0.82606244",
"0.7422778",
"0.68024606",
"0.6716315",
"0.6555001",
"0.65116686",
"0.6485007",
"0.64758295",
"0.6449079",
"0.6449079",
"0.6449079",
"0.6449079",
"0.6449079",
"0.6417088... | 0.83207226 | 1 |
Plays a youtube video | function playYoutube(element) {
element.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function playYoutubeVideo(videoId) {\n s_youtubePlayer = new YT.Player('yb-player', {\n height: '480',\n width: '640',\n // videoId: '7YL_-y7fc3I',\n videoId: videoId,\n playerVars: { 'autoplay': 0, 'controls':0 },\n events: {\n 'onReady': onPlayerReady,\n ... | [
"0.7680546",
"0.7633897",
"0.7633897",
"0.7633897",
"0.762031",
"0.762031",
"0.762031",
"0.762031",
"0.762031",
"0.73869663",
"0.7077367",
"0.7062351",
"0.7050492",
"0.70138043",
"0.70027673",
"0.6950666",
"0.6942101",
"0.6930579",
"0.68335205",
"0.6826336",
"0.6820024",
"0... | 0.77145976 | 1 |
Sets a class for the body of the page depending on the active section / slide | function setBodyClass() {
var section = getState().activeSection.item;
var slide = getState().activeSection.activeSlide;
var sectionAnchor = getAnchor(section);
var text = String(sectionAnchor);
if (slide) {
var slideAnchor = getAnchor(slide.item);
text = text + '-' + slid... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setBodyClass() {\n var section = $(SECTION_ACTIVE_SEL);\n var slide = section.find(SLIDE_ACTIVE_SEL);\n var sectionAnchor = getAnchor(section);\n var slideAnchor = getAnchor(slide);\n var text = String(sectionAnchor);\n\n if (slide.length) {\n text = text + '-' + slide... | [
"0.8017123",
"0.7933119",
"0.79267657",
"0.79267657",
"0.79267657",
"0.7919276",
"0.7899371",
"0.7899371",
"0.7898751",
"0.7898751",
"0.7851016",
"0.7851016",
"0.7829707",
"0.7048902",
"0.68661547",
"0.684251",
"0.6773579",
"0.6769274",
"0.6745807",
"0.67300135",
"0.66792476"... | 0.7985378 | 1 |
Gets the name for screen readers for a section/slide navigation bullet. | function getBulletLinkName(i, defaultName, item) {
var anchor = defaultName === 'Section' ? getOptions().anchors[i] : getAttr(item, 'data-anchor');
return encodeURI(getOptions().navigationTooltips[i] || anchor || defaultName + ' ' + (i + 1));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getBulletLinkName(i, defaultName, item){\n var anchor = defaultName === 'Section' ? options.anchors[i] : item.getAttribute('data-anchor');\n return options.navigationTooltips[i]\n || anchor\n || defaultName + ' ' + (i+1);\n }",
"function getBull... | [
"0.66215086",
"0.6352261",
"0.6242657",
"0.6088398",
"0.58273685",
"0.562833",
"0.5528405",
"0.5528405",
"0.5519197",
"0.5518973",
"0.54697746",
"0.5416293",
"0.54152316",
"0.5376189",
"0.5346145",
"0.5343852",
"0.5336179",
"0.533563",
"0.53272027",
"0.5295825",
"0.529053",
... | 0.6503403 | 1 |
Creates the control arrows for the given section | function createSlideArrows(section) {
var sectionElem = section.item;
var arrows = [createElementFromHTML(getOptions().controlArrowsHTML[0]), createElementFromHTML(getOptions().controlArrowsHTML[1])];
after($(SLIDES_WRAPPER_SEL, sectionElem)[0], arrows);
addClass(arrows, SLIDES_ARROW);
add... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createSlideArrows(section) {\n var arrows = [createElementFromHTML('<div class=\"' + SLIDES_ARROW_PREV + '\"></div>'), createElementFromHTML('<div class=\"' + SLIDES_ARROW_NEXT + '\"></div>')];\n after($(SLIDES_WRAPPER_SEL, section)[0], arrows);\n\n if (options.controlArro... | [
"0.7923658",
"0.79206455",
"0.79206455",
"0.78714824",
"0.7859364",
"0.7859364",
"0.78356403",
"0.78356403",
"0.78356403",
"0.78356403",
"0.78356403",
"0.78356403",
"0.78034097",
"0.6313757",
"0.6155624",
"0.60662687",
"0.60127354",
"0.5998095",
"0.58375245",
"0.5781972",
"0.... | 0.80656916 | 0 |
Makes sure lazyload is done for other sections in the viewport that are not the active one. | function lazyLoadOthers() {
var hasAutoHeightSections = $(AUTO_HEIGHT_SEL)[0] || isResponsiveMode() && $(AUTO_HEIGHT_RESPONSIVE_SEL)[0]; //quitting when it doesn't apply
if (!getOptions().lazyLoading || !hasAutoHeightSections) {
return;
} //making sure to lazy load auto-height sections that a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lazyLoadOthers(){\n var hasAutoHeightSections = $(AUTO_HEIGHT_SEL)[0] || isResponsiveMode() && $(AUTO_HEIGHT_RESPONSIVE_SEL)[0];\n\n //quitting when it doesn't apply\n if (!options.lazyLoading || !hasAutoHeightSections){\n return;\n }\n\n ... | [
"0.783689",
"0.6996277",
"0.6695114",
"0.6694245",
"0.66082644",
"0.660162",
"0.6598444",
"0.656478",
"0.655444",
"0.6484536",
"0.6484536",
"0.634164",
"0.62503463",
"0.6247115",
"0.6210934",
"0.6210934",
"0.61627525",
"0.614874",
"0.6137682",
"0.61132455",
"0.6063533",
"0.... | 0.7976323 | 0 |
Activating the website main menu elements according to the given slide name. | function activateMenuElement(name) {
if (getOptions().menu && getOptions().menu.length) {
$(getOptions().menu).forEach(function (menu) {
if (menu != null) {
removeClass($(ACTIVE_SEL, menu), ACTIVE);
addClass($('[data-menuanchor="' + name + '"]', menu), ACTIVE);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function activateMenuElement(name){\n $(options.menu).forEach(function(menu) {\n if(options.menu && menu != null){\n removeClass($(ACTIVE_SEL, menu), ACTIVE);\n addClass($('[data-menuanchor=\"'+name+'\"]', menu), ACTIVE);\n }\n ... | [
"0.65811205",
"0.64244336",
"0.64244336",
"0.6414985",
"0.6384849",
"0.6384849",
"0.6384849",
"0.6384849",
"0.6384849",
"0.6384849",
"0.63532674",
"0.6272797",
"0.62205184",
"0.60357314",
"0.58725655",
"0.5846151",
"0.58332473",
"0.58226675",
"0.58056605",
"0.5787996",
"0.576... | 0.6532393 | 1 |
Determines whether fullpage.js is in responsive mode or not. | function isResponsiveMode() {
return hasClass($body, RESPONSIVE);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isResponsiveMode(){\n return hasClass($body, RESPONSIVE);\n }",
"isResponsive() {\n const { responsive } = this\n return responsive === '' ? true : responsive\n }",
"function responsive(){\r\n var widthLimit = options.responsive || options.responsiveWidth; //ba... | [
"0.81213576",
"0.7715709",
"0.7567426",
"0.7068432",
"0.7068432",
"0.69719553",
"0.6960167",
"0.69274783",
"0.68816864",
"0.6867325",
"0.68475264",
"0.68455726",
"0.68407154",
"0.682822",
"0.682822",
"0.682822",
"0.6808493",
"0.6808493",
"0.6733317",
"0.6696032",
"0.6657075",... | 0.8246621 | 0 |
Gets the active section. | function getActiveSection() {
return getState().activeSection;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getActiveSection() {\n return new Section($(SECTION_ACTIVE_SEL)[0]);\n }",
"function getActiveSection(){\n return new Section($(SECTION_ACTIVE_SEL)[0]);\n }",
"function getActiveSection(){\n return new Section($(SECTION_ACTIVE_SEL)[0]);\n }",
"fu... | [
"0.86274",
"0.86258054",
"0.86258054",
"0.8267873",
"0.80688083",
"0.75148326",
"0.7122796",
"0.6967655",
"0.69142306",
"0.6911131",
"0.68964034",
"0.68001664",
"0.68001664",
"0.67859435",
"0.66122174",
"0.66118246",
"0.65101016",
"0.6502571",
"0.64417446",
"0.6403306",
"0.63... | 0.878366 | 0 |
Styles the horizontal slides for a section. | function styleSlides(section) {
var numSlides = section.slides.length;
var slidesElems = section.allSlidesItems;
var slides = section.slides;
var sliderWidth = numSlides * 100;
var slideWidth = 100 / numSlides;
if (!$(SLIDES_WRAPPER_SEL, section.item)[0]) {
var slidesWrapper... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function styleSlides(section, slides, numSlides){\r\n var sliderWidth = numSlides * 100;\r\n var slideWidth = 100 / numSlides;\r\n\r\n slides.wrapAll('<div class=\"' + SLIDES_CONTAINER + '\" />');\r\n slides.parent().wrap('<div class=\"' + SLIDES_WRAPPER + '\" />');\r\n\... | [
"0.7184263",
"0.7179711",
"0.7179711",
"0.71771157",
"0.71771157",
"0.7157938",
"0.71347535",
"0.71347535",
"0.7128051",
"0.7122831",
"0.70942646",
"0.64249355",
"0.62364525",
"0.62364525",
"0.62135464",
"0.6211179",
"0.6211179",
"0.6211179",
"0.6211179",
"0.6211179",
"0.6211... | 0.7290863 | 0 |
Creates a Mutation observer. | function createObserver(target, callback, config) {
var observer = new MutationObserver(callback);
observer.observe(target, config);
return observer;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(observerFunction) {\n this.observerFunction = observerFunction;\n this.observer = new MutationObserver(this.observerFunction);\n }",
"_setupObserver() {\n this.mutationObserver = new MutationObserver(m => { this._observerCallback(m) });\n let config = {\n childList: true,\n sub... | [
"0.7642635",
"0.7362716",
"0.7131331",
"0.6806366",
"0.6721781",
"0.6688267",
"0.6588693",
"0.65865093",
"0.6444247",
"0.6423209",
"0.62739843",
"0.6246498",
"0.6240231",
"0.60665506",
"0.6053693",
"0.6051033",
"0.6000622",
"0.59805584",
"0.5953813",
"0.5874052",
"0.5811036",... | 0.74952334 | 1 |
Moves the page down one section. | function moveSectionDown() {
var next = getState().activeSection.next(); //looping to the top if there's no more sections below
if (!next && (getOptions().loopBottom || getOptions().continuousVertical)) {
next = getState().sections[0];
}
if (next != null) {
scrollPage(next, nul... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moveSectionDown() {\n var next = $(SECTION_ACTIVE_SEL).next(SECTION_SEL);\n\n //looping to the top if there's no more sections below\n if (!next.length && (options.loopBottom || options.continuousVertical)) {\n next = $(SECTION_SEL).first();\n }\n... | [
"0.76216537",
"0.76064223",
"0.7605438",
"0.7605438",
"0.7605438",
"0.7600398",
"0.7533071",
"0.7533071",
"0.75181043",
"0.7050037",
"0.70255446",
"0.6927227",
"0.6927227",
"0.6927227",
"0.6911484",
"0.6911484",
"0.6904819",
"0.68627334",
"0.68627334",
"0.6836211",
"0.6631343... | 0.7758213 | 0 |
Moves the page up one section. | function moveSectionUp() {
var prev = getState().activeSection.prev(); //looping to the bottom if there's no more sections above
if (!prev && (getOptions().loopTop || getOptions().continuousVertical)) {
prev = getLast(getState().sections);
}
if (prev != null) {
scrollPage(prev,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moveSectionUp() {\n var prev = $(SECTION_ACTIVE_SEL).prev(SECTION_SEL);\n\n //looping to the bottom if there's no more sections above\n if (!prev.length && (options.loopTop || options.continuousVertical)) {\n prev = $(SECTION_SEL).last();\n }\n\n ... | [
"0.77571607",
"0.77571607",
"0.7748189",
"0.7748189",
"0.7748189",
"0.77386826",
"0.7685739",
"0.7683661",
"0.7683661",
"0.73237646",
"0.7269678",
"0.7198192",
"0.7198192",
"0.7198192",
"0.7173298",
"0.7161117",
"0.7152107",
"0.715014",
"0.715014",
"0.70985764",
"0.7051717",
... | 0.7928454 | 0 |
As IE >= 10 fires both touch and mouse events when using a mouse in a touchscreen this way we make sure that is really a touch event what IE is detecting. | function isReallyTouch(e) {
//if is not IE || IE is detecting `touch` or `pen`
return typeof e.pointerType === 'undefined' || e.pointerType != 'mouse';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isReallyTouch(e) {\n //if is not IE || IE is detecting `touch` or `pen`\n return typeof e.pointerType === 'undefined' || e.pointerType != 'mouse';\n }",
"function isReallyTouch(e) {\n //if is not IE || IE is detecting `touch` or `pen`\n return typ... | [
"0.78795695",
"0.78795695",
"0.78795695",
"0.7850992",
"0.7850992",
"0.7850992",
"0.7850992",
"0.7850992",
"0.7850992",
"0.7850992",
"0.7850992",
"0.78406537",
"0.76004034",
"0.72928894",
"0.72928894",
"0.72928894",
"0.72928894",
"0.72928894",
"0.72928894",
"0.72928894",
"0.7... | 0.7938089 | 1 |
Slides left the slider of the active section. Optional `section` param. | function moveSlideLeft(section) {
moveSlide('left', section);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moveSlideLeft(section) {\n moveSlide('left', section);\n }",
"function moveSlideLeft(section) {\n moveSlide('left', section);\n }",
"function moveSlideLeft(section) {\n moveSlide('left', section);\n }",
"function moveSlideLeft(section){\n ... | [
"0.82014734",
"0.82014734",
"0.82014734",
"0.8188693",
"0.8188693",
"0.8188693",
"0.8188693",
"0.8188693",
"0.73441815",
"0.72983503",
"0.7265804",
"0.7265804",
"0.7265255",
"0.7250018",
"0.7113216",
"0.70589316",
"0.67979515",
"0.6789728",
"0.6496246",
"0.6438452",
"0.642492... | 0.8282248 | 1 |
Slides right the slider of the active section. Optional `section` param. | function moveSlideRight(section) {
moveSlide('right', section);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moveSlideRight(section){\n moveSlide('right', section);\n }",
"function moveSlideRight(section){\n moveSlide('right', section);\n }",
"function moveSlideRight(section){\n moveSlide('right', section);\n }",
"function moveSlideRight(section){\n ... | [
"0.7217333",
"0.7217333",
"0.7217333",
"0.7217333",
"0.7217333",
"0.7153712",
"0.7153712",
"0.7153712",
"0.698442",
"0.6882585",
"0.6882585",
"0.6664745",
"0.6664745",
"0.66454095",
"0.66255397",
"0.654398",
"0.654398",
"0.6541556",
"0.6540698",
"0.6540698",
"0.65198576",
"... | 0.7254034 | 1 |
Makes sure the tab key will only focus elements within the current section/slide preventing this way from breaking the page. Based on "Modals and keyboard traps" from | function onTab(e) {
var isShiftPressed = e.shiftKey;
var activeElement = doc.activeElement;
var focusableElements = getFocusables(getSlideOrSection(getState().activeSection.item));
function preventAndFocusFirst(e) {
preventDefault(e);
return focusableElements[0] ? focusableEleme... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onTab(e) {\n var isShiftPressed = e.shiftKey;\n var activeElement = $(':focus');\n var activeSection = $(SECTION_ACTIVE_SEL);\n var activeSlide = activeSection.find(SLIDE_ACTIVE_SEL);\n var focusableWrapper = activeSlide.length ? activeSlide : activeSection;\n var focusableEl... | [
"0.7920718",
"0.7879741",
"0.77509093",
"0.77471584",
"0.77471584",
"0.75345063",
"0.74702954",
"0.7313667",
"0.7213791",
"0.71848774",
"0.71522677",
"0.69135255",
"0.6906025",
"0.6892199",
"0.6884147",
"0.68786544",
"0.68702257",
"0.68702257",
"0.68694544",
"0.6840677",
"0.6... | 0.7990554 | 0 |
Determines whether the focus is outside fullpage.js sections/slides or not. | function isFocusOutside(e) {
var allFocusables = getFocusables(doc);
var currentFocusIndex = allFocusables.indexOf(doc.activeElement);
var focusDestinationIndex = e.shiftKey ? currentFocusIndex - 1 : currentFocusIndex + 1;
var focusDestination = allFocusables[focusDestinationIndex];
var de... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isFocusOutside(e){\n var allFocusables = getFocusables(document);\n var currentFocusIndex = allFocusables.indexOf(document.activeElement);\n var focusDestinationIndex = e.shiftKey ? currentFocusIndex - 1 : currentFocusIndex + 1;\n var focusDestination = allFocus... | [
"0.73758966",
"0.73758966",
"0.7302292",
"0.6353283",
"0.60576475",
"0.60029244",
"0.5982166",
"0.596984",
"0.5957786",
"0.58851165",
"0.58851165",
"0.58851165",
"0.58851165",
"0.58310294",
"0.58310294",
"0.58310294",
"0.58310294",
"0.58310294",
"0.58310294",
"0.58310294",
"0... | 0.7426337 | 0 |
Adds or remove the mouse wheel hijacking | function setMouseHijack(value) {
if (value) {
setMouseWheelScrolling(true);
addTouchHandler();
} else {
setMouseWheelScrolling(false);
removeTouchHandler();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"enableWheel () {\n let onPush = ( e ) => {\n let target = this.__getTarget( e.offsetX, e.offsetY )\n if ( target && target.interactive ) {\n target.emit( this.__getEventName( 'wheel' ), e )\n }\n }\n\n this.__renderer.view.addEventListener( 'wheel', onPush, { passive: false } )\n ... | [
"0.76939434",
"0.7372006",
"0.7372006",
"0.7331271",
"0.7143198",
"0.6998588",
"0.6973369",
"0.69613785",
"0.6953223",
"0.6915114",
"0.6838957",
"0.6820429",
"0.6803405",
"0.6803405",
"0.6803405",
"0.6803405",
"0.67524",
"0.67284346",
"0.67229384",
"0.67229384",
"0.671424",
... | 0.74222267 | 1 |
Defining the value in px of a VH unit. (Used for autoScrolling: false) To fix the height issue on mobile devices when using VH units. | function setVhUnits() {
if (!getOptions().autoScrolling || getOptions().scrollBar) {
// First we get the viewport height and we multiple it by 1% to get a value for a vh unit
var vh = win.innerHeight * 0.01; // Then we set the value in the --vh custom property to the root of the document
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function vh(v) {\n\tvar h = Math.max(paper.view.viewSize.height || 0);\n\treturn (v * h) / 100;\n}",
"function setVhVar() {\n var vh = window.innerHeight * 0.01;\n // Then we set the value in the --vh custom property to the root of the document\n document.documentElement.style.setProperty('-... | [
"0.74972755",
"0.69606715",
"0.68378717",
"0.6615204",
"0.6557983",
"0.6512779",
"0.6465618",
"0.64057714",
"0.64024025",
"0.63899136",
"0.6380322",
"0.6313787",
"0.62674725",
"0.6237081",
"0.6221609",
"0.61740506",
"0.6164388",
"0.6125946",
"0.6125946",
"0.6125946",
"0.61017... | 0.7670623 | 0 |
Gets the active slide. | function getActiveSlide() {
return nullOrSlide(getState().activeSection.activeSlide);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getActiveSlide() {\n var activeSlide = $(SLIDE_ACTIVE_SEL, $(SECTION_ACTIVE_SEL)[0])[0];\n return nullOrSlide(activeSlide);\n }",
"function getActiveSlide(){\n var activeSlide = $(SLIDE_ACTIVE_SEL, $(SECTION_ACTIVE_SEL)[0])[0];\n return nullOrSlide(acti... | [
"0.86207277",
"0.8549033",
"0.8549033",
"0.79047865",
"0.7842807",
"0.78405803",
"0.7667568",
"0.7639181",
"0.7273218",
"0.7225548",
"0.71921206",
"0.67917025",
"0.6770882",
"0.66991735",
"0.6604705",
"0.6603902",
"0.65654576",
"0.6521508",
"0.6423518",
"0.63950074",
"0.63738... | 0.8687325 | 0 |
=== HELPERS === makeUrl: Takes an endpoint (found on Riot API site) and returns the url to make a request, attaching the api key | function makeUrl (endpoint) {
return BASE_URL + endpoint + "?api_key=" + RIOT_KEY;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeRequest(url) {\n var request = \"https://api.mywot.com/0.4/public_link_json2?hosts=\".concat(url, \"&callback=process&key=\", API_KEY);\n console.log(request);\n return request;\n}",
"function getApiUrl(endpoint) {\n let trimmed = endpoint;\n if (trimmed.startsWith('/')) {\n trimmed = ... | [
"0.69340795",
"0.6766191",
"0.66725296",
"0.6671724",
"0.6590579",
"0.6497337",
"0.6475742",
"0.6449528",
"0.63668764",
"0.63668764",
"0.6252523",
"0.62313235",
"0.62149733",
"0.6166762",
"0.6127244",
"0.61216",
"0.6093723",
"0.6080083",
"0.60348",
"0.60232234",
"0.5997287",
... | 0.8461005 | 0 |
getIdFromName: Given a summoner name, returns the summoner id | function getIdFromName(app) {
app.ask(`Your summoner ID is: ${app.data.summoner.id}`);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSummonerIdByName(name) {\n\tvar data;\n\t$.ajax({\n\t\turl: 'https://euw.api.pvp.net/api/lol/euw/v1.4/summoner/by-name/'+name+'?api_key=' + API_KEY,\n\t\ttype: 'GET',\n\t\tdataType: 'json',\n\t\tdata: data,\n\t\tasync: false,\n\t\tsuccess: function (jsonSummonerId) {\n\t\t\tdata = jsonSummonerId[name]... | [
"0.71855456",
"0.7110937",
"0.70623046",
"0.6799316",
"0.65524465",
"0.64408296",
"0.64141786",
"0.6201965",
"0.6183788",
"0.61199737",
"0.60468173",
"0.6017177",
"0.5948468",
"0.59428066",
"0.5910496",
"0.5809601",
"0.5764718",
"0.5760776",
"0.5758911",
"0.5747088",
"0.57313... | 0.77152556 | 0 |
winRate: Returns the winrate | function winRate (wins, losses) {
return losses == 0? "100 percent" : parseInt(( (wins/(wins+losses))+0.005)*100) + " percent";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getWinRate(player){\n var children = $(\"div#bettors\"+player+\" p\").clone();\n $(children[1]).find('span').remove();\n var winrate = $(children[1]).html().replace('%',''); \n \n return parseInt(winrate ? winrate : 0, 10);\n }",
"rate(): number {\n return this... | [
"0.75978196",
"0.6148147",
"0.6098529",
"0.60047245",
"0.5990611",
"0.5951827",
"0.5949366",
"0.59156847",
"0.59135324",
"0.5909066",
"0.5871497",
"0.585898",
"0.58587074",
"0.5854524",
"0.5831728",
"0.5827906",
"0.5822445",
"0.5822445",
"0.57998514",
"0.57885635",
"0.5786902... | 0.7416535 | 1 |
getCurrentGame: Returns data on the game the summoner is currently playing Refer to currentGame.json | function getCurrentGame(app) {
let callback = (obj => obj);
let url = makeUrl(`/lol/spectator/v3/active-games/by-summoner/${app.data.summoner.id}`);
request(url, function (error, response, body) {
obj = JSON.parse(body);
console.log(obj);
console.log(obj.status.message);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"currentGame(callback, summonerId, options) {\n\t\trequest(callback, {\n\t\t\tregion: options.region,\n\t\t\tpath: \"/observer-mode/rest/consumer/getSpectatorGameInfo/${platformId}/${summonerId}\",\n\t\t\tpathParameters: {\n\t\t\t\tplatformId: regions[options.region].id,\n\t\t\t\tsummonerId\n\t\t\t}\n\t\t});\n\t}",... | [
"0.7396393",
"0.7328882",
"0.7184374",
"0.68771416",
"0.6782105",
"0.67233753",
"0.67233753",
"0.6582348",
"0.6439014",
"0.64324576",
"0.6424603",
"0.6340094",
"0.62953144",
"0.6256597",
"0.62555075",
"0.6252217",
"0.6246243",
"0.6176251",
"0.6145403",
"0.6138325",
"0.6033423... | 0.7599059 | 0 |
ACTION MAP viewTeam: Returns simplified ranked stats of summoner's allied or enemy team viewAlly is a boolean | function viewOwnTeam(app) {
let callback = (obj => {
if (!obj.participants) {
app.ask("You are not in game!!");
} else {
let ppl = [];
obj.participants.forEach((summoner) => {
if (summoner.teamId === 100 && summoner.summonerName != app.data.summoner.name) ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function winningTeam() {\n const homeTeamStats = Object.values(homeTeam().players);\n const awayteamStats = Object.values(awayTeam().players);\n const homePoints = homeTeamStats.reduce((a, b) => a + b.points, 0);\n const awayPoints = awayteamStats.reduce((a, b) => a + b.points, 0);\n return homePoints > awayP... | [
"0.6284228",
"0.60387516",
"0.58915114",
"0.5838072",
"0.5827602",
"0.5798505",
"0.56834435",
"0.5660286",
"0.5595936",
"0.54915905",
"0.54514927",
"0.5428758",
"0.54223865",
"0.5394493",
"0.53687525",
"0.5364284",
"0.5358423",
"0.53459626",
"0.53242964",
"0.5302411",
"0.5279... | 0.6186929 | 1 |
winStreak: Returns an array of all the players currently on a winstreak | function winStreak(user, callback) {
let players = []
let itemsProcessed = 0;
getCurrentGame(user, (gameData) => {
if (gameData.participants) {
gameData.participants.forEach( (summoner) => {
getRankedById(summoner.summonerId, (stats) => {
// This sum... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getWinners(outcome) {\n var winners = [];\n var bestScore = null;\n players.forEach(function(player) {\n var score = scorePicks(player.picks, outcome);\n if(bestScore == null || score > bestScore) { // first score or new best score\n winners = [pla... | [
"0.66179705",
"0.6584171",
"0.6419897",
"0.6418818",
"0.63543844",
"0.62977976",
"0.6252715",
"0.6239369",
"0.6233445",
"0.6163982",
"0.61627495",
"0.61521333",
"0.6142688",
"0.614076",
"0.61387724",
"0.61244136",
"0.6115897",
"0.6115709",
"0.6113639",
"0.60995746",
"0.608590... | 0.70576495 | 0 |
Get an array of user objects who the given user has been sent friend requests bys | async getFriendRequests(_, { userId }, context) {
await userResolvers.Mutation.authenticateUserByContext(_, {}, context);
const targetUser = await User.findById(userId);
if (!targetUser) {
throw new UserInputError("Invalid input ");
} else if (targetUser.requesterIds.length != 0) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getFriends() {\n\tusersFriends = [];\n\tfor (j = 0; j < friends.length; j++) {\n\t\tvar thisFriend = findUserByUsername(friends[j].username);\n\t\tusersFriends.push(thisFriend);\n\t}\n}",
"getFriendshipRequest(userId, callback) {\n this.friend.find({ \n $and: [\n {\n confirmed: false... | [
"0.71632475",
"0.6964818",
"0.68568534",
"0.6847778",
"0.6805864",
"0.67733884",
"0.6690838",
"0.6688967",
"0.66533065",
"0.66134",
"0.6380241",
"0.633697",
"0.63202137",
"0.6299613",
"0.6293757",
"0.6263368",
"0.62278324",
"0.61557144",
"0.6143242",
"0.61200607",
"0.61154056... | 0.7235912 | 0 |
Sends a friend request from the requesterId User to receiverId User | async sendFriendRequest(_, { requesterId, receiverId }, context) {
await userResolvers.Mutation.authenticateUserByContext(_, {}, context);
const requester = await User.findById(requesterId);
const receiver = await User.findById(receiverId);
if (!requester || !receiver) {
throw new UserI... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeFriendRequest(requester, friend){\n if(!existsUser(requester))\n throw new Meteor.Error(ErrorCode.INTERNAL_ERROR, \"No user exists with _id: \" + requester);\n\n if(!existsUser(friend))\n throw new Meteor.Error(ErrorCode.INTERNAL_ERROR, \"No user exists with _id: \"... | [
"0.73672956",
"0.7045674",
"0.69588387",
"0.68931353",
"0.6880296",
"0.6880296",
"0.68269986",
"0.6706868",
"0.65852964",
"0.64595985",
"0.64368343",
"0.64361674",
"0.6404835",
"0.6321195",
"0.62329686",
"0.6222434",
"0.61970496",
"0.61797965",
"0.6140808",
"0.6132584",
"0.61... | 0.776093 | 0 |
Adds requesterId User to userId User's friend list, and vice versa ONLY if there was a request made | async addFriend(_, { requesterId, userId }, context) {
await userResolvers.Mutation.authenticateUserByContext(_, {}, context);
const requester = await User.findById(requesterId);
const user = await User.findById(userId);
if (!requester || !user) {
throw new UserInputError("Invalid inpu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async sendFriendRequest(_, { requesterId, receiverId }, context) {\n await userResolvers.Mutation.authenticateUserByContext(_, {}, context);\n\n const requester = await User.findById(requesterId);\n const receiver = await User.findById(receiverId);\n if (!requester || !receiver) {\n thro... | [
"0.756932",
"0.7495508",
"0.7391423",
"0.72360015",
"0.67750674",
"0.66657823",
"0.6661464",
"0.66411555",
"0.6630622",
"0.6480092",
"0.6405498",
"0.6403075",
"0.63965464",
"0.63164693",
"0.6272193",
"0.6233439",
"0.6205196",
"0.61826915",
"0.607851",
"0.60633963",
"0.604717"... | 0.8532591 | 0 |
Removes userId User from friendId User's friend list and vice versa only if they are friends | async removeFriend(_, { friendId, userId }, context) {
await userResolvers.Mutation.authenticateUserByContext(_, {}, context);
const friend = await User.findById(friendId);
const user = await User.findById(userId);
if (
!friend ||
!user ||
!user.friendIds.includes(frien... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteReceivedFriendRequest(userId, friendId){\r\n let user = getUserFromId(userId);\r\n if(user.receivedFriendRequests.includes(friendId)){\r\n user.receivedFriendRequests = user.receivedFriendRequests.filter(id => id != friendId);\r\n }\r\n}",
"function deleteSentFriendRequest(userId, friendId){... | [
"0.75046957",
"0.74972415",
"0.7188533",
"0.70211506",
"0.6877623",
"0.6840857",
"0.6769817",
"0.6734798",
"0.6731057",
"0.6714434",
"0.66756994",
"0.6637197",
"0.6622982",
"0.65926665",
"0.6582429",
"0.658124",
"0.6546962",
"0.65386605",
"0.6523921",
"0.6436131",
"0.6430896"... | 0.8103481 | 0 |
Knockout JS for Bet | function Bet(data)
{
this.BetAmt = ko.observable(data.BetAmt);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ready(){\n ko.applyBindings(new ViewModel());\n}",
"get name() {\n return ko;\n }",
"function bindPageVM() {\n oGridster = hookGridster();\n\n // Grab configuration window for future reference\n mask = $(\"#divMask\");\n popup = $(\"#divConfiguration\");\n\n // Construct view model... | [
"0.63004273",
"0.6123586",
"0.5935897",
"0.59302235",
"0.57893515",
"0.57770514",
"0.57770514",
"0.5766615",
"0.5672425",
"0.56416917",
"0.5581707",
"0.5576865",
"0.55521595",
"0.5531484",
"0.5488139",
"0.54807997",
"0.54681075",
"0.54512537",
"0.54454976",
"0.5433462",
"0.54... | 0.7046343 | 0 |
fetches genre count hashmap from /api/youtube and updates html used in HTML eslintdisablenextline nounusedvars | async function displayMusicGenre() {
// keep track of num_videos in URL w/o reload
history.pushState('', '', `youtube-genre.html`);
const response = await fetch(`/api/youtube`);
if (response.status == 401) {
// no oauth login so redirect to new page
window.open('/api/oauth/login/youtube');
}
const... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getNumberOfSongsInGenre(genre, accessToken) {\n let url = \"https://api.spotify.com/v1/search\" + \"?q=\" + genre + \"&type=track\" + \"&limit=50\";\n try {\n let data = await fetch(url, {\n method: 'GET',\n headers: {\n 'Authorization': 'Bearer ' + ... | [
"0.6100104",
"0.6031614",
"0.5935558",
"0.5923447",
"0.589863",
"0.58608484",
"0.58545274",
"0.58391005",
"0.5818316",
"0.57653487",
"0.56815994",
"0.5677677",
"0.56605697",
"0.5598358",
"0.558477",
"0.558477",
"0.558477",
"0.558477",
"0.558477",
"0.558477",
"0.558477",
"0.... | 0.7491505 | 0 |
this function uses sort method to sort accounts argument by last name from lowest to highest letter value | function sortAccountsByLastName(accounts) {
const sortedAccounts = accounts.sort((first, second) =>
first.name.last > second.name.last ? 1 : -1
);
return sortedAccounts;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sortByName() {\n const sorted = employees.sort((a, b) =>\n a.name.last.localeCompare(b.name.last)\n );\n displayEmployees(sorted);\n}",
"function sort_usernames(temp) {\n\t\ttemp.sort(function (a, b) {\n\t\t\tvar entryA = a.company + a.username;\n\t\t\tvar entryB = b.company + b.username;\n\t\t\ti... | [
"0.7391949",
"0.7353664",
"0.72628456",
"0.7140412",
"0.7005508",
"0.6968725",
"0.69646627",
"0.6917338",
"0.69032514",
"0.6899744",
"0.6846336",
"0.68317974",
"0.6815267",
"0.67988175",
"0.67907286",
"0.6772154",
"0.6734266",
"0.6697367",
"0.6689973",
"0.66877216",
"0.668596... | 0.7999202 | 0 |
this function loops through books array (specifically the borrows array inside each book object) and during each loop (for each book) uses filter method to search through the borrow array and return only the borrow that matches the id for the account argument. It then adds the length of that filtered array to a 'total'... | function getTotalNumberOfBorrows(account, books) {
let total = 0;
for (let i = 0; i < books.length; i++) {
const borrows = books[i].borrows;
const borrowCaseMatchesIdArray = borrows.filter(
(borrow) => borrow.id === account.id
);
total += borrowCaseMatchesIdArray.length;
}
return total;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTotalNumberOfBorrows(account, books) {\n let total = 0;\n\n books.forEach((book) => {\n let totalArr = book.borrows.filter((book => book.id.includes(account.id)));\n total += totalArr.length;\n });\n \n return total; \n}",
"function getBooksBorrowedCount(books) {\n let borrowedCount = 0\n... | [
"0.73035514",
"0.6581454",
"0.6364883",
"0.60901034",
"0.60515183",
"0.6035128",
"0.5849574",
"0.57788634",
"0.5531245",
"0.5519645",
"0.5502518",
"0.54785335",
"0.547638",
"0.54522395",
"0.5426512",
"0.54168695",
"0.5390661",
"0.5295555",
"0.5244864",
"0.52287936",
"0.520163... | 0.7255515 | 1 |
component allows you to write a CSS stylesheet for your component. Target your component with `&` and its children with `& selectors`. Be specific. | static css () {
return (`
& .github {
position: absolute;
top: 0;
right: 0;
border: 0;
}
& {
font-family: sans-serif;
color: #0df;
padding: 10px 30px 30px;
width: 443px;
margin: 10px auto;
background: #222;
}
`);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CriticalCareComponentStyle()\r\n{\r\n this.initByNamespace(\"cc\");\r\n}",
"function componentCSS (component) {\n const collection = getComponentStyles(component)\n return toCSS(Object.values(collection).join('\\n'))\n}",
"render(){\n return (\n <div class='CSSComponentCard'>\n ... | [
"0.5546468",
"0.5521755",
"0.5464196",
"0.54312915",
"0.53866464",
"0.535059",
"0.53452134",
"0.5339099",
"0.5311994",
"0.52664757",
"0.52508956",
"0.5239931",
"0.51930857",
"0.5154725",
"0.5138447",
"0.51369417",
"0.5123215",
"0.5103497",
"0.5097131",
"0.50968194",
"0.509631... | 0.5584887 | 0 |
call a callback when all HTMLImports in the document at call (or at least document ready) time have loaded. 1. ensure the document is in a ready state (has dom), then 2. watch for loading of imports and call callback when done | function whenImportsReady(callback, doc) {
doc = doc || mainDoc;
// if document is loading, wait and try again
whenDocumentReady(function() {
watchImportsLoad(callback, doc);
}, doc);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function whenImportsReady(callback, doc) {\n doc = doc || mainDoc;\n // if document is loading, wait and try again\n whenDocumentReady(function() {\n watchImportsLoad(callback, doc);\n }, doc);\n}",
"function whenImportsReady(cb) {\n if (window.HTMLImports) {\n HTMLImports.whenReady(cb);\n } else {\n... | [
"0.78907114",
"0.7475658",
"0.7475658",
"0.7469186",
"0.7356478",
"0.73189193",
"0.7290574",
"0.6393447",
"0.6298464",
"0.6298464",
"0.6298464",
"0.6295566",
"0.62868124",
"0.62611294",
"0.62611294",
"0.61658657",
"0.61304414",
"0.59989965",
"0.5980356",
"0.59659743",
"0.5963... | 0.7927013 | 0 |
databaseInit() initialize firebase for retrieval | function databaseInit()
{
var config = {
apiKey: "AIzaSyAJtiy-xB69zjg7VRdBiEDmtupBeoGgS9A",
authDomain: "nasa-7a363.firebaseapp.com",
databaseURL: "https://nasa-7a363.firebaseio.com",
projectId: "nasa-7a363",
storageBucket: "nasa-7a363.appspot.com",
messagingSenderId: "885889218553"
};
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initFirebase() {\n // API config\n var config = {\n apiKey: \"AIzaSyDqBdI91HIVFwk6UhLGvfuGP8Lg42FQp80\",\n authDomain: \"tower-finder-30aa8.firebaseapp.com\",\n databaseURL: \"https://tower-finder-30aa8.firebaseio.com\",\n storageBucket: \"gs://tower-finder-7c3ef.appspot.com/\"\n };\n fire... | [
"0.81102884",
"0.78047526",
"0.7778386",
"0.77112925",
"0.770887",
"0.76333725",
"0.7590689",
"0.74908113",
"0.7430174",
"0.7333226",
"0.72919416",
"0.7153139",
"0.70785606",
"0.7018479",
"0.69557154",
"0.6950926",
"0.69470954",
"0.6911587",
"0.68238294",
"0.6800642",
"0.6733... | 0.81435686 | 0 |
replaceDate() this routine was created because the new noncatcher approach didn't add the date to records. Now it does Thu Apr 18 11:51:42 2019 but there are early morning records that don't have dates. So this routine will take the "updated" date and copy it to date. | function replaceDate(targetComp,callback)
{
databaseLoad(false,
(snapshot) => {
var output = "";
var data = snapshot.val();
for(var robot in data) {
if(robot != METADATA) {
for(var competition in data[robot]) {
if(competition == targetComp) {
for(var match in data[r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"replaceCitationDate(newval) {\n this.nanopub.citation.date = newval;\n this.pubmed.bel.mismatch.date = false;\n this.refreshNanopubObjBinding();\n }",
"function replaceDate(date) {\n return date.replace(/-/g, '/');;\n}",
"function fixDateRange() {\n var range = SpreadsheetApp.getAct... | [
"0.63226277",
"0.58948684",
"0.5662644",
"0.5590282",
"0.55313194",
"0.5513619",
"0.5510169",
"0.5510169",
"0.5496076",
"0.5493948",
"0.54276407",
"0.5387316",
"0.5382523",
"0.5352335",
"0.53340036",
"0.53340036",
"0.52972025",
"0.52592045",
"0.5252722",
"0.52401584",
"0.5240... | 0.61006105 | 1 |
[summary] Constructor for the material. [params] ambient: The ambient component of the material, a Vector3 object. diffuse: The diffuse component of the material, a Vector3 object. specular: The specular component of the material, a Vector3 object. coSpec: The power (Phong exponent) of the specular component. reflect: ... | function Material(
ambient, diffuse, specular, coSpec,
reflect, idxRefr, refract) {
this.ambient = ambient || new Vector3();
this.diffuse = diffuse || new Vector3();
this.specular = specular || new Vector3();
this.coSpec = coSpec || new Vector3();
this.reflect = reflect || new Vector3();
this.idxRefr = idxRefr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Material()\n{\n this.ambientIntensity = 0.2; \t\t\t\t\t// ambient intensity\n this.diffuseColor = new Color(0.8, 0.8, 0.8); \t// diffuse color\n // this.emissiveColor; \t\t\t\t\t\t// emissive color - not implemented\n this.specularColor = new Color(1, 1, 1); \t// specular color\n ... | [
"0.7508286",
"0.7097593",
"0.70582765",
"0.7049264",
"0.686441",
"0.6443492",
"0.6363186",
"0.6344145",
"0.6256247",
"0.6242121",
"0.6169842",
"0.6130121",
"0.6127985",
"0.6109595",
"0.6053418",
"0.60375255",
"0.60305125",
"0.5974213",
"0.5969892",
"0.5940265",
"0.5935779",
... | 0.8985744 | 0 |
Populate the allSpies list from an AJAX call to get all spy data | function loadSpies(){
$.ajax("/listSpies/list", {
success: function(data){
allSpies = data;
// Show all spies to begin
showSpies(allSpies);
},
error: function(){
alert("Something went wrong while loading spy data. Please try again later.");
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadDisasters(){\nvar disasterData = [];\n\n$.ajax({\n type: 'GET',\n contentType: 'application/json',\n url: '/disasters',\n success: function (response) {\n disasterData.push(response);\n \n var rows = \"\";\n $.each(response, function () {\n rows += \"<t... | [
"0.6548002",
"0.6435542",
"0.64282435",
"0.6412028",
"0.6394242",
"0.6358206",
"0.63387936",
"0.63387936",
"0.62764287",
"0.62390375",
"0.62197",
"0.62188804",
"0.6173154",
"0.6168339",
"0.6155016",
"0.6151854",
"0.61400336",
"0.61362165",
"0.60863864",
"0.60530144",
"0.60442... | 0.8520749 | 0 |
Render the given list of spies on the map | function showSpies(spyList, maxAge){
// Clear all markers so they aren't added twice.
markers.clearLayers();
// For each spy, create a marker at the location and a popup with the name and info.
$.each(spyList, function(index, value){
// If there is a max age, then the spy's age must not be greater
if (parseInt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"RenderToCubemap() {}",
"function renderMap(str) {\n str = trim(str);\n \n\tctx.fillStyle = 'rgb(0,0,0)';\n ctx.fillRect(0, 0, BOX_SIZE * MAP_WIDTH, BOX_SIZE * MAP_HEIGTH);\n \n let x = 0;\n let y = 0;\n\n for (let i = 0; i < str.length; i++) {\n\n if (i > 0 && i % MAP_WIDTH == 0) {\n ... | [
"0.6160823",
"0.5837897",
"0.5797617",
"0.5783492",
"0.5774413",
"0.57383406",
"0.5719032",
"0.56902736",
"0.5592488",
"0.5592117",
"0.55588406",
"0.55505514",
"0.5543617",
"0.5540847",
"0.55250144",
"0.54943633",
"0.5482208",
"0.5480826",
"0.54774314",
"0.54680264",
"0.54668... | 0.60912037 | 1 |
IF YOU WISH TO HANDLE MORE EVENTS, BE SURE TO ADD THEM IN initEvents(client, bot) adding anything here would require a full bot restart!! examples for channelCreate/Delete, GuildCreate/Delete are shown if you need to add other events, copy the formatting and use this cheatsheet for reference | function initEvents(client, bot) {
client.on("message", (message) => {
if (!message.guild) return;
try {
client.events.get("message").func(bot, message);
} catch (err) {
console.error(err);
}
});
client.on("ready", ()=>{
try {
client.events.get("ready").func(bot);
} catch (err) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"[_eventsInit]() {\n const slack = this[_registry].get('Slack');\n\n // the client has successfully connected to the server\n slack.rtmClient.on('hello', () => {\n this._log.debug(`rtm hello`);\n });\n // The server intends to close the connection soon.\n slack.rtmClient.on('goodbye', () => {... | [
"0.6754415",
"0.6368869",
"0.629842",
"0.6085819",
"0.60393167",
"0.60165274",
"0.6015542",
"0.5912936",
"0.5910686",
"0.5891395",
"0.5866866",
"0.5837001",
"0.5836236",
"0.57995176",
"0.5790286",
"0.576687",
"0.5761258",
"0.57463306",
"0.5745982",
"0.57446057",
"0.57214016",... | 0.76255906 | 0 |
Appends the remaining input from cursor to the end into row, saves the row, calls step, and returns the results. | function finish()
{
row.push(input.substr(cursor));
data.push(row);
cursor = inputLen; // important in case parsing is paused
if (stepIsFunction)
doStep();
return returnable();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function finish(value)\n\t\t\t\t{\n\t\t\t\t\tif (ignoreLastRow)\n\t\t\t\t\t\treturn returnable();\n\t\t\t\t\tif (typeof value === 'undefined')\n\t\t\t\t\t\tvalue = input.substr(cursor);\n\t\t\t\t\trow.push(value);\n\t\t\t\t\tcursor = inputLen;\t// important in case parsing is paused\n\t\t\t\t\tpushRow(row);\n\t\t\... | [
"0.6898286",
"0.68238616",
"0.68238616",
"0.68238616",
"0.68238616",
"0.68238616",
"0.6698175",
"0.5800355",
"0.5714983",
"0.5714983",
"0.57090056",
"0.56600344",
"0.56600344",
"0.56600344",
"0.56600344",
"0.56600344",
"0.5536981",
"0.543098",
"0.53482574",
"0.5337074",
"0.53... | 0.69563293 | 1 |
Appends the current row to the results. It sets the cursor to newCursor and finds the nextNewline. The caller should take care to execute user's step function and check for preview and end parsing if necessary. | function saveRow(newCursor)
{
data.push(row);
row = [];
cursor = newCursor;
nextNewline = input.indexOf(newline, cursor);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function saveRow(newCursor)\n \t\t\t{\n \t\t\t\tcursor = newCursor;\n \t\t\t\tpushRow(row);\n \t\t\t\trow = [];\n \t\t\t\tnextNewline = input.indexOf(newline, cursor);\n \t\t\t}",
"function saveRow(newCursor)\n\t\t\t\t{\n\t\t\t\t\tcursor = newCursor;\n\t\t\t\t\tpushRow(row);\n\t\t\t\t\trow = [];\n\t\t\t\t\... | [
"0.6327838",
"0.62887186",
"0.6236315",
"0.6236315",
"0.6236315",
"0.6236315",
"0.6236315",
"0.6223657",
"0.61212087",
"0.61212087",
"0.59606826",
"0.58056647",
"0.5665937",
"0.56651175",
"0.5656051",
"0.5622665",
"0.5622665",
"0.5622665",
"0.5622665",
"0.5622665",
"0.5542710... | 0.64005816 | 1 |
Replaces bad config values with good, default ones | function copyAndValidateConfig(origConfig)
{
if (typeof origConfig !== 'object')
origConfig = {};
var config = copy(origConfig);
if (typeof config.delimiter !== 'string'
|| config.delimiter.length != 1
|| Baby.BAD_DELIMITERS.indexOf(config.delimiter) > -1)
config.delimiter = DEFAULTS.delimiter;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function copyAndValidateConfig(origConfig)\n\t{\n\t\tif (typeof origConfig !== 'object')\n\t\t\torigConfig = {};\n\n\t\tvar config = copy(origConfig);\n\n\t\tif (typeof config.delimiter !== 'string'\n\t\t\t|| config.delimiter.length != 1\n\t\t\t|| Baby.BAD_DELIMITERS.indexOf(config.delimiter) > -1)\n\t\t\tconfig.d... | [
"0.64304674",
"0.62972647",
"0.6207108",
"0.58997166",
"0.56647617",
"0.5643691",
"0.5492809",
"0.5472646",
"0.54500365",
"0.5440196",
"0.54343516",
"0.5405582",
"0.54011023",
"0.5375417",
"0.536984",
"0.53687257",
"0.53412837",
"0.5324254",
"0.5324254",
"0.5324254",
"0.53242... | 0.6447914 | 1 |
Set a status on an error object, if ones does not exist | function setErrorStatus(error, status) {
if (!error.status && !error.statusCode) {
error.status = status
error.statusCode = status
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setErrorStatus(error, status) {\n if (!error.status && !error.statusCode) {\n error.status = status;\n error.statusCode = status;\n }\n}",
"function setStatus(status, message) {\n return {\n type: SET_ERROR,\n status: status,\n message: message\n };\n}",
"function setStatusError(mes... | [
"0.78908694",
"0.69518656",
"0.6598645",
"0.6558586",
"0.64132977",
"0.6357978",
"0.63516563",
"0.6295012",
"0.6260366",
"0.6250941",
"0.6185538",
"0.6176106",
"0.61527497",
"0.61484176",
"0.61484176",
"0.611915",
"0.61056006",
"0.60682476",
"0.6041998",
"0.60386395",
"0.6001... | 0.79262555 | 1 |
Map html `files`, returning an html unordered list. | function createHtmlFileList(files, dir, useIcons, view) {
var html = '<ul id="files" class="view-' + escapeHtml(view) + '">'
+ (view == 'details' ? (
'<li class="header">'
+ '<span class="name">Name</span>'
+ '<span class="size">Size</span>'
+ '<span class="date">Modified</span>'
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function listFiles() {\n var files = $(\"#files\")[0].files;\n var result = \"<strong><u>Queued Files</u></strong><br><ul>\";\n\n\n for (var i = 0; i < files.length; i++) {\n result += \"<li>\" + files[i].name + \"</li>\";\n }\n result += \"</ul>\"\n $(\"#filesList\").html(result);\n}",
... | [
"0.6700786",
"0.65470415",
"0.63405734",
"0.6326934",
"0.6207647",
"0.61843675",
"0.6163626",
"0.61229396",
"0.60616153",
"0.60269797",
"0.5993623",
"0.5990503",
"0.5985904",
"0.59401155",
"0.5865462",
"0.58642006",
"0.58448285",
"0.57584995",
"0.56505316",
"0.56171185",
"0.5... | 0.74165106 | 0 |
Sort function for with directories first. | function fileSort(a, b) {
// sort ".." to the top
if (a.name === '..' || b.name === '..') {
return a.name === b.name ? 0
: a.name === '..' ? -1 : 1;
}
return Number(b.stat && b.stat.isDirectory()) - Number(a.stat && a.stat.isDirectory()) ||
String(a.name).toLocaleLowerCase().localeCompare... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function nameSort(a, b)\n {\n return a._directory.dirName.localeCompare(b._directory.dirName);\n }",
"function orderFolders() {\n return folder_list.order();\n }",
"function sort(items, state) {\n const copy = toArray(items);\n const reverse = state.direction === 'descending'... | [
"0.6945037",
"0.66627556",
"0.6662348",
"0.6552341",
"0.6517582",
"0.6203234",
"0.6180478",
"0.61693347",
"0.61329854",
"0.61124724",
"0.60969996",
"0.60404146",
"0.6039764",
"0.60031897",
"0.5965681",
"0.5928179",
"0.59096426",
"0.58803785",
"0.5801879",
"0.5757614",
"0.5739... | 0.70636123 | 0 |
Map html `dir`, returning a linked path. | function htmlPath(dir) {
var parts = dir.split('/');
var crumb = new Array(parts.length);
for (var i = 0; i < parts.length; i++) {
var part = parts[i];
if (part) {
parts[i] = encodeURIComponent(part);
crumb[i] = '<a href="' + escapeHtml(parts.slice(0, i + 1).join('/')) + '">' + esca... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDirectoryHtml(path, callback){\n var directory = {\n title : getTitle(path),\n seoBullshit : getRandomBullshit()\n };\n\n if (path === currentPath){\n directory.folders = makeDirectoryJson(path, $(selectors.apacheHtml).html());\n callback... | [
"0.5889549",
"0.58134335",
"0.5694746",
"0.56449187",
"0.5514866",
"0.5511015",
"0.55024016",
"0.5408121",
"0.5408036",
"0.54028684",
"0.54028684",
"0.54028684",
"0.5351496",
"0.5351496",
"0.5343476",
"0.5320664",
"0.53104323",
"0.530566",
"0.530566",
"0.530566",
"0.5248901",... | 0.7241685 | 0 |
Load icon images, return css string. | function iconStyle(files, useIcons) {
if (!useIcons) return '';
var className;
var i;
var iconName;
var list = [];
var rules = {};
var selector;
var selectors = {};
var style = '';
for (i = 0; i < files.length; i++) {
var file = files[i];
var isDir = file.stat && file.stat.is... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"load() {\n this.iconImage_.load();\n }",
"function getIcons(icon) {\n var iconurl = \"https://openweathermap.org/img/w/\" + icon + \".png\";\n return iconurl;\n}",
"function renderIcons() {}",
"function Icons(props) {\n\n \treturn(\n\t\t<div className=\"catcha-icons\">\n\t\t\t<div className=\... | [
"0.6468829",
"0.6282545",
"0.6146837",
"0.6089415",
"0.6060421",
"0.6029359",
"0.60233134",
"0.60064304",
"0.59641224",
"0.59556264",
"0.58927834",
"0.58873546",
"0.5868014",
"0.5775992",
"0.5681879",
"0.567972",
"0.5673497",
"0.56721467",
"0.566376",
"0.565845",
"0.5646067",... | 0.6834378 | 0 |
Stat all files and return array of stat in same order. | function stat(dir, files, cb) {
var batch = new Batch();
batch.concurrency(10);
files.forEach(function(file){
batch.push(function(done){
fs.stat(join(dir, file), function(err, stat){
if (err && err.code !== 'ENOENT') return done(err);
// pass ENOENT as null stat, not error
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDates(files) {\n return Promise.all(\n files.map(async function (fileName) {\n var dateOfFile = await stat(directoryPath + '/' + fileName)\n return {fileDate: dateOfFile.mtime, fileName: fileName } \n })\n )\n}",
"async list() {\n const path = this.ge... | [
"0.6061724",
"0.59618807",
"0.59615827",
"0.5893582",
"0.58667046",
"0.58583564",
"0.5852708",
"0.58351296",
"0.57754457",
"0.56811315",
"0.55584407",
"0.55393606",
"0.55318666",
"0.5522032",
"0.55123496",
"0.5496347",
"0.54932624",
"0.5456195",
"0.54551774",
"0.5446033",
"0.... | 0.60253763 | 1 |
Hide vide on mobile | function hideVideoOnMobile(){
var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
if(iOS){
$('video').hide();
$('body').addClass('iOs');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hide() {\n getStream(rtc_uid, 'remote').getVideoTracks()[0].enabled = false;\n }",
"function unhide() {\n getStream(rtc_uid, 'remote').getVideoTracks()[0].enabled = true;\n }",
"function hideVideoControl() {\n TweenLite.to(videocontrol, 1, {opacity: 0});\n }",
"function modifyFor... | [
"0.7466018",
"0.7381565",
"0.71907383",
"0.69650537",
"0.6676565",
"0.6579961",
"0.6563886",
"0.6500085",
"0.64936656",
"0.6493602",
"0.64712656",
"0.6464807",
"0.6462218",
"0.6457272",
"0.6457272",
"0.6457272",
"0.64287585",
"0.64200854",
"0.64131",
"0.6392917",
"0.6390764",... | 0.7916624 | 0 |
Inicializa a matriz com valores 1 | function criaMatriz(lines, column) {
var matriz = []
for (var i = 0; i < lines; i++) {
var vetor = []
for (var j = 0; j < column; j++) {
vetor.push(1)
}
matriz.push(vetor)
}
return matriz
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initCheckMatrix(){\n var mat=[];\n for(var i=0;i<GAME_SIZE;i++){\n mat.push([]);\n for(var j=0;j<GAME_SIZE;j++){\n mat[i].push(1);\n }\n\n }\n return mat;\n }",
"initMatrix() {\n const rows = this.rows();\n const co... | [
"0.70790845",
"0.6877782",
"0.6786486",
"0.6677537",
"0.6672931",
"0.6669351",
"0.66512257",
"0.66419685",
"0.65712804",
"0.65620863",
"0.65616816",
"0.65373236",
"0.65225315",
"0.6506176",
"0.64638406",
"0.6448924",
"0.64232796",
"0.6419495",
"0.64082146",
"0.6404096",
"0.63... | 0.71522486 | 0 |
Initialize middleware stack Initialize middleware stack | function initMiddleware() {
// set up views
app.set('views', __dirname + '/../app/views');
app.set('view engine', 'js');
app.engine('js', viewEngine);
// for 404 and 500 pages. rendr's viewEngine is stupid.
hbs.registerHelper('view', function() { return ''; });
hbs.registerHelper('json', function() { retu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor () {\n this.middleware = [];\n\n this.context = Object.create(context);\n }",
"setMiddlewares() {\n this.middlewares = new Middlewares(this.app);\n }",
"function init() {\n var deferred = require('q').defer(),\n server = require('express')(),\n middleware = require('./mi... | [
"0.66628844",
"0.66120636",
"0.6555599",
"0.6141262",
"0.6099448",
"0.6096043",
"0.6073489",
"0.6000167",
"0.5957497",
"0.5957497",
"0.5952909",
"0.59462017",
"0.5910239",
"0.5896453",
"0.58172566",
"0.58157367",
"0.57959014",
"0.57678264",
"0.5767717",
"0.5745927",
"0.572587... | 0.67089933 | 0 |
Adds already existing (persisted) entity into the UI state | addExistingEntity (entity) {
this.store.dispatch(entities.actions.addExisting(entity))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_doAdd(entity) {\n\t\tentity.markSaved();\n\t\treturn true;\n\t}",
"addEntity(entity) {\n this.entities.push(entity); \n }",
"addChild (entity) {\n entity.changed = true;\n this.children.push(entity);\n }",
"addEntity(entity) {\n if (!entity.id) {\n console.error('canno... | [
"0.6635834",
"0.6437353",
"0.63095355",
"0.6058695",
"0.60010743",
"0.5988104",
"0.59691465",
"0.58614403",
"0.58498573",
"0.5822603",
"0.5797958",
"0.5767186",
"0.55473256",
"0.5528066",
"0.5514229",
"0.55129296",
"0.55102307",
"0.54642975",
"0.5458944",
"0.5448432",
"0.5447... | 0.7027323 | 0 |
Returns true if it's a valid notification given the filters | isFilteredNotification(notification) {
const { event } = notification;
const filters = this.get().notificationFilters;
if (!filters.showHidden && notification.hidden) return false
switch (event) {
case 'bits': {
if (!filters.showBits) return false;
return notification.bits >= filte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static isValidPushPayload(rawData) {\n try {\n const payload = rawData.json();\n if (payload &&\n payload.custom &&\n payload.custom.i &&\n OneSignalUtils.isValidUuid(payload.custom.i)) {\n return true;\n }\n ... | [
"0.60365725",
"0.5824689",
"0.5740849",
"0.546147",
"0.5426284",
"0.5414197",
"0.54112667",
"0.5323735",
"0.5312346",
"0.5305688",
"0.52964073",
"0.52810395",
"0.5234966",
"0.52269435",
"0.518627",
"0.5179724",
"0.5176338",
"0.51684856",
"0.51451325",
"0.51441926",
"0.5132988... | 0.71395856 | 0 |
Will return the NEDB notification style filters | getNEDBNotificationFilters() {
// For now we just use $where. Quick benchmarks said it takes about the same time as other filters,
// but I am not sure about it when we get to bigger datastores.
// The normal filters are included below
const self = this;
return { $where: function () { return self.is... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAttachmentFilters() {\n return {};\n}",
"isFilteredNotification(notification) {\n const { event } = notification;\n const filters = this.get().notificationFilters;\n if (!filters.showHidden && notification.hidden) return false\n switch (event) {\n case 'bits': {\n if (!filt... | [
"0.6184375",
"0.59351647",
"0.5657836",
"0.565393",
"0.55765533",
"0.55620974",
"0.5552274",
"0.5548272",
"0.5512132",
"0.54872245",
"0.5485291",
"0.5453045",
"0.5342278",
"0.5324643",
"0.5315285",
"0.5310934",
"0.5299807",
"0.52908015",
"0.52831155",
"0.5281229",
"0.524002",... | 0.7328061 | 0 |
Returns true if the newObj has different values from oldObj (only compares similar keys) | function compare(oldObj, newObj) {
for (const key in newObj) {
if (oldObj.hasOwnProperty(key)) {
if (typeof (oldObj[key]) === 'object' && oldObj[key] !== null) {
if (compare(oldObj[key], newObj[key])) return true;
} else {
if (oldObj[key] !== newObj[key]) return true;
}
}
}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function diff(oldObj, newObj) {\n const V = 'Version';\n const out = {};\n let hasChange = false;\n for(const key in newObj) {\n if(key.substr(key.length - V.length) === V) { continue; }\n\n if(typeof newObj[key] === 'object') {\n if(newObj[key + V]) {\n if(newOb... | [
"0.7559709",
"0.7479073",
"0.702646",
"0.66636604",
"0.6597138",
"0.65794337",
"0.65001893",
"0.64787847",
"0.6475041",
"0.64697593",
"0.6455187",
"0.6429801",
"0.6397171",
"0.6339896",
"0.6332938",
"0.630621",
"0.6296945",
"0.62924606",
"0.62757367",
"0.6275438",
"0.62265974... | 0.79295874 | 0 |
Constructor for bid object | function bid(uname, IP, amount){
this.uname = uname;
this.IP = IP;
this.amount = amount;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function auction(productname, neighborIP, bid){\n\tthis.productname = productname;\n\tthis.neighborIP = neighborIP;\n\tthis.bid = bid;\n}",
"function Bid(statusCode, bidRequest) {\n var _bidId = bidRequest && bidRequest.bidId || utils.getUniqueIdentifierStr();\n var _statusCode = statusCode || 0;\n\n ... | [
"0.70774853",
"0.67576474",
"0.6646891",
"0.65815234",
"0.6570995",
"0.65100783",
"0.6469759",
"0.6413382",
"0.63185865",
"0.6317117",
"0.63069725",
"0.62720454",
"0.62376267",
"0.6190524",
"0.6186673",
"0.61634743",
"0.60797334",
"0.60625464",
"0.6038353",
"0.60366035",
"0.6... | 0.70674753 | 1 |
Constructor for auction object | function auction(productname, neighborIP, bid){
this.productname = productname;
this.neighborIP = neighborIP;
this.bid = bid;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(id, title, author, genre, pageCount, publisherID, ISBN, checkoutDate, checkoutMember, dueReturnDate, availability) {\n this.book = new BookFactory(title, author, genre, pageCount, publisherID, ISBN);\n\n bookRecordDatabase[id] = {\n checkoutMember,\n checkoutDate,\n dueReturnDate,\... | [
"0.6641287",
"0.66061205",
"0.6398318",
"0.633197",
"0.6190294",
"0.6164378",
"0.6130642",
"0.61281866",
"0.6092579",
"0.60764986",
"0.60492",
"0.6028331",
"0.6010219",
"0.6004878",
"0.60048527",
"0.5996902",
"0.599163",
"0.5971262",
"0.59697163",
"0.59419185",
"0.59383374",
... | 0.7373779 | 0 |
Stores new auctions into local storage | function storeAuction(){
if (((document.getElementById('productName_Text').value) == '') &&
((document.getElementById('neighborIP_Text').value) == '')
&& ((document.getElementById('Bid_Text').value) == '')){
alert('Please enter values');
}
else{
var productname = document.getElementById('productName_Text'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addBid(){\n\tvar testindex = document.getElementById('index_Text2').value;\n\tvar myauction = JSON.parse(window.localStorage[\"TestAuction\" + testindex]);\n\tvar uname = document.getElementById('Uname_Text2').value;\n\tvar IP = document.getElementById('IP_Text2').value;\n\tvar bidvalue = document.getEle... | [
"0.70892394",
"0.6821881",
"0.67136806",
"0.66572285",
"0.6588428",
"0.6585464",
"0.652321",
"0.64823484",
"0.6433319",
"0.64332205",
"0.642974",
"0.6412606",
"0.640898",
"0.6402297",
"0.639464",
"0.6381342",
"0.63690126",
"0.6326331",
"0.6326331",
"0.63197935",
"0.63023585",... | 0.73795366 | 0 |
Retrieves auction based on Auction ID from local storage | function retrieveAuction(){
var testindex = document.getElementById('index_Text').value;
if (testindex == ''){
alert("Enter something!");
}
else{
var myauction = JSON.parse(window.localStorage["TestAuction" + testindex]);
if (myauction != null){
document.getElementById('index_Text').value = '';
docume... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadAuction(id){\n var url = 'http://barrettjacksonservices.azurewebsites.net/api/auction/' + id;\n $http.get(url).then(function (data) {\n debugger;\n auction = data;\n }, function (err) {\n debugger;\n });\n }",
"_fetch(id) {\n con... | [
"0.7011491",
"0.6219315",
"0.61106753",
"0.6047924",
"0.6027868",
"0.6019557",
"0.5935212",
"0.592124",
"0.581894",
"0.5765506",
"0.5760883",
"0.5723186",
"0.5682461",
"0.56784075",
"0.5641088",
"0.55912405",
"0.5579792",
"0.55675876",
"0.5563125",
"0.5542892",
"0.5529317",
... | 0.6997125 | 1 |
Remove bid or auction based on auction ID and username | function remove(){
var testindex = document.getElementById('index_Text3').value;
var testAuction = document.getElementById('checkbox1').checked;
if (testAuction == true){
window.localStorage.removeItem("TestAuction" + testindex);
alert("Auction No " + testindex + " withdrawn.");
}
else{
var myauction = JSON... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeBike(evt) {\n\t\n\t// get user email\n\temail = cookieRead(\"login_uemail\");\n\t\n\t// if cookie exists\n\tif (email !== \"\" && email != \"0\") {\n\t\t// get id for bike row\n\t\tvar parentID = evt.target.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.id;\n\t\t... | [
"0.6562756",
"0.6028721",
"0.594206",
"0.5938925",
"0.58951217",
"0.58036935",
"0.58015615",
"0.5800476",
"0.575807",
"0.5751357",
"0.57378685",
"0.5734505",
"0.5729551",
"0.56977177",
"0.56867564",
"0.56856966",
"0.56785256",
"0.566927",
"0.56593204",
"0.5626475",
"0.5615419... | 0.6922662 | 0 |
for RightTriangle that takes 3 arguments side1 side2 base The object should have two functions area() returns the area of this triangle perimeter() returns the perimeter of this triangle 2 Create two instances of the RightTriangle object. Console log the results of calling both functions on both instances. | function RightTriangle (side1, side2, base) {
this.side1 = side1;
this.side2 = side2;
this.base = base;
this.area = function () {
return (this.side1 * this.side2) / 2;
}
this.perimeter = function () {
return this.side1 + this.side2 + this.base;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function RightTriangle (side1, side2, base){\n function area(side1, side2, base){\n var area = (base * side1) / 2;\n }\n function perimeter(side1, side2, base){\n var perimeter = side1 + side2 + base;\n }\n}",
"function RightTriangle(side1, side2, base){\n function area(){\n return (side1 * base) /... | [
"0.83046705",
"0.8231486",
"0.65032256",
"0.6453247",
"0.6416088",
"0.6261662",
"0.5981004",
"0.59706634",
"0.5932903",
"0.5875651",
"0.5853766",
"0.58046925",
"0.5801191",
"0.5773024",
"0.5754988",
"0.57517177",
"0.57410455",
"0.5735392",
"0.57179904",
"0.5619704",
"0.561428... | 0.84276617 | 0 |
plays the game music | function playGameMusic() {
game_music.play();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function playMusic(){\n\t\t\tgetRandomSong();\n\t\t\tmyAudio.play();\n\t\t}",
"function playMusic() {\n fightMusic.play();\n}",
"function playMusic()\n\t{\n\t\taudioCtx.resume(); // needed for chrome to play music\n\t\taudio.play();\n\t\tstate = \"Play\";\n\t\tisPaused = false;\n\t\t\n\t\t// this needs to b... | [
"0.8707727",
"0.8359415",
"0.83467805",
"0.8285339",
"0.8233686",
"0.8148263",
"0.79960454",
"0.7977706",
"0.7973107",
"0.7798564",
"0.77916914",
"0.7766836",
"0.7744922",
"0.7736293",
"0.77240694",
"0.7715777",
"0.7685322",
"0.7651799",
"0.76375055",
"0.76299524",
"0.7606745... | 0.8692033 | 1 |
This is sort of like the table lookup version (crc32c), but using a 256way switch statement instead. The expressions for g1, g2, ..., g7 are determined by examining what the CRC32 algorithm does to a byte of value 1, 2, 4, 8, 16, 32, 64, and 128, respectively. g6 and g7 are complicated because the rightmost 1bit in g0 ... | function crc32f(message) {
let i;
let byte, crc, c;
const g0 = 0xEDB88320;
const g1 = g0>>1, g2 = g0>>2, g3 = g0>>3,
g4 = g0>>4, g5 = g0>>5, g6 = (g0>>6)^g0,
g7 = ((g0>>6)^g0)>>1;
i = 0;
crc = 0xFFFFFFFF;
while ((byte = message[i]) != 0) { // Get next byte.
crc = crc ^ byte;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rfc2083_make_crc_table()\n{\n var c;\n var n, k;\n for (n = 0; n < 256; n++)\n {\n c = n;\n for (k = 0; k < 8; k++)\n {\n if (c & 1)\n c = ((0xedb88320 ^ (c >>> 1)) >>> 0) & 0xffffffff;\n else\n c = c >>> 1;\n }\n ... | [
"0.5788171",
"0.567453",
"0.559918",
"0.5562421",
"0.5488837",
"0.5456342",
"0.5416943",
"0.53683513",
"0.5365592",
"0.5363628",
"0.5358095",
"0.5340898",
"0.5325881",
"0.5267579",
"0.5244086",
"0.5217525",
"0.5192195",
"0.51274246",
"0.51138705",
"0.51125026",
"0.51125026",
... | 0.6117615 | 0 |
crc32cx / This is crc32b modified to load the message a fullword at a time. It assumes the message is word aligned and consists of an integral number of words before the 0byte that marks the end of the message. This works only on a littleendian machine. Not counting the table setup (which would probably be a separate f... | function crc32cx(message) {
let j;
let byte, crc, mask, word;
let table = [];
/* Set up the table, if necessary. */
if (table[1] == 0) {
for (byte = 0; byte <= 255; byte++) {
crc = byte;
for (j = 7; j >= 0; j--) { // Do eight times.
mask = -(crc & 1);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function crc32c(message) {\n let i, j;\n let byte, crc, mask;\n let table = [];\n\n /* Set up the table, if necessary. */\n // X32+X26+X23+X22+X16+X12+X11+X10+X8+X7+X5+X4+X2+X1+1\n // 1111 1111 1111 1111 \n // 1111 1111 1111 0111\n if (table[1] == 0) {\n for (byte = 0; byte <= 255; byte++) {\n... | [
"0.66260785",
"0.6325166",
"0.6320257",
"0.6276288",
"0.60817623",
"0.6057176",
"0.6011138",
"0.6009306",
"0.577629",
"0.5665926",
"0.56300056",
"0.55287975",
"0.5526322",
"0.54961634",
"0.54684216",
"0.53778565",
"0.5371847",
"0.5353848",
"0.5337865",
"0.53320676",
"0.532292... | 0.6792358 | 0 |
look up for xpath element | function lookupElementByXPath(path) {
var evaluator = new XPathEvaluator();
var result = evaluator.evaluate(path, document.documentElement, null,XPathResult.FIRST_ORDERED_NODE_TYPE, null);
return result.singleNodeValue;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lookupElementByXPath(path) {\n var evaluator = new XPathEvaluator();\n var result = evaluator.evaluate(path, document.documentElement, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n console.log(path)\n console.log(result.snapshotLength)\n return result.snapshotL... | [
"0.71074826",
"0.7097141",
"0.70258284",
"0.6934637",
"0.69302535",
"0.6888716",
"0.6878307",
"0.6832453",
"0.6792682",
"0.66110486",
"0.6534283",
"0.6531974",
"0.6449113",
"0.634826",
"0.62345266",
"0.62240046",
"0.6197183",
"0.6133696",
"0.6132635",
"0.6128776",
"0.6106601"... | 0.78637904 | 0 |
enrollStudent: Enrolls a student in a course. addGrade: Adds the grade of a student for a course. getReportCard: Logs the grades of a student for all courses. If the course has no grade, it uses "In progress" as the grade. courseReport: Logs the grades of all students for a given course name. Only student with grades a... | function createSchool() {
return {
students: [],
addStudent(studentObj) {
if (this.isValidStudent(studentObj.year)) {
this.students.push(studentObj);
}
},
isValidStudent(year) {
return /(1st|2nd|3rd|4th|5th)/.test(year);
},
isEnrolledStudent(studentObj) {
ret... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getStudentReport( student ){\n var report = '<h2> Student: ' + student.name + '</h2>';\n report += '<p> Track: ' + student.track + '</p>';\n report += '<p> Points: ' + student.points + '</p>';\n report += '<p> Achievements: ' + student.achievements + '</p>';\n return report;\n}",
"function updateAs... | [
"0.6114401",
"0.5825678",
"0.5775081",
"0.5715799",
"0.5605555",
"0.55776227",
"0.54085904",
"0.5405886",
"0.5373583",
"0.5364099",
"0.535604",
"0.5318253",
"0.5297289",
"0.529341",
"0.52855784",
"0.5280985",
"0.52698606",
"0.526742",
"0.526545",
"0.5263371",
"0.5249207",
"... | 0.601402 | 1 |
clean a name according to the needs of CellGraph.vue for name matching | function cleanName(name) {
return name.replace(/-/g, " ")
.replace(/\(/g, "")
.replace(/\)/g, "")
.replace(/,/, "")
.replace(/\//g, "-");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get sanitizedName () {\n return this._name.replace(/#\\w*/gi, '');\n }",
"function normalizeName(name) {\n return name\n .toLowerCase()\n .trim()\n .replace(/ /g, \"-\")\n .replace(/[^-_a-z0-9@/]/g, \"\");\n}",
"function cleanName(name) {\n return name.replace(/[[\\]!]/g, ''... | [
"0.6322085",
"0.6027577",
"0.60181606",
"0.6014098",
"0.5948389",
"0.5938428",
"0.5938428",
"0.5791316",
"0.5774046",
"0.5774046",
"0.5774046",
"0.5760126",
"0.57181585",
"0.5714401",
"0.56999886",
"0.56848985",
"0.5676316",
"0.56377554",
"0.562933",
"0.5626276",
"0.5611888",... | 0.60952723 | 1 |
Loop through all kendo layouts and views and spit their HTML into the BODY | function onBeforeInit() {
var i,
item,
objects = [kendoLayouts, kendoViews],
htmlBuffer = [];
for (i=0; i<objects.length; i++) {
for (item in objects[i]) {
if (objects[i].hasOwnProperty(item) && objects[i][item].hasOwnProperty('html')) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Layout() {\n \tWalkDescendants(angular.element($document[0].body),function(element) {\n \t\tif(element.scope().hasOwnProperty(\"jngRequestLayout\"))\n \t\t\telement.scope().jngRequestLayout();\n \t\telse\n \t\t\tconsole.log(element.attr(\"id\"),\"has no jngRequestLayout\... | [
"0.5696991",
"0.5525098",
"0.5514454",
"0.54934597",
"0.5404085",
"0.53751135",
"0.53649694",
"0.53510034",
"0.5344609",
"0.5344609",
"0.52568376",
"0.5252128",
"0.52427894",
"0.521495",
"0.5207605",
"0.5199841",
"0.5199336",
"0.51864886",
"0.5172839",
"0.51676065",
"0.516760... | 0.68877447 | 0 |
CREATE SPACE AND WALLS. | function createWorld(){
space = chipmunk.cpSpaceNew(); // Allocates and initializes a cpSpace struct
chipmunk.cpSpaceSetGravity(space, v(0, gravity)); // Global gravity applied to the space
chipmunk.cpSpaceSetSleepTimeThreshold(space, 0.5); // Time a group of bodies... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createBoth() {\n\tcreateTime();\n\tcreatePlace();\n}",
"function createBoard() {\r\n // Create table element\r\n var board = document.createElement('table'),\r\n indicator = 1,\r\n i, j,\r\n row, cell;\r\n board.border = 1;\r\n\r\n // Create cells for the table\r\n for (i... | [
"0.62553114",
"0.6053098",
"0.6038679",
"0.6000562",
"0.595268",
"0.5807726",
"0.5788102",
"0.5757272",
"0.57034713",
"0.5694327",
"0.56870466",
"0.56743884",
"0.5666344",
"0.5661154",
"0.565501",
"0.56502134",
"0.5646182",
"0.5633403",
"0.5564179",
"0.55593354",
"0.55568427"... | 0.6584039 | 0 |
constructTree Given a string, a start separator, an end separator, and a parent node, produces a new tree initialized at parent. Returns true if validate returns true, otherwise false. str is an argument vector formed with a valid syntactic notation; it sets definitions for nodes, the subconstituents of said nodes, etc... | function constructTree(str, sep1, sep2, parent) {
if (!validate(str, sep1, sep2))
return false
// Clean str, store info about the node, and initialize node
str = strip(str, sep1, sep2)
const [content, phrase] = extract(str, sep1, sep2)
let node = parent.attachChild(initNode(phrase, content)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function constructTreeW (str, ntabs, parent) {\n const arr = str.split('\\n')\n const children = arr.map((str, i) => {\n if (enumtabs(str) == ntabs + 1) {\n return [str, i]\n }\n }).filter(str => str != undefined)\n\n const nchildren = children.map((el, i) => {\n let next_el = i != children.lengt... | [
"0.65188205",
"0.6109043",
"0.5764161",
"0.5645883",
"0.5362887",
"0.53514886",
"0.51284134",
"0.4993712",
"0.49611518",
"0.49293947",
"0.49138305",
"0.4904041",
"0.48525646",
"0.484682",
"0.48158962",
"0.4781692",
"0.47708732",
"0.475066",
"0.47492325",
"0.4705529",
"0.46663... | 0.71225744 | 0 |
isSubstring Create a function that check is substring is part of a string | function isSubstring(fullString, subString) {
return fullString.indexOf(subString) > -1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isSubstring(string, substring) {\n return string.includes(substring);\n}",
"function isSubstring(searchString, subString) {\n return searchString.includes(subString);\n}",
"function isSubstring(str, substr) {\n return str.includes(substr);\n}",
"function isSubstring(searchString, subString) {\n ... | [
"0.8334118",
"0.80352056",
"0.8021228",
"0.79668",
"0.79252905",
"0.78579015",
"0.7829166",
"0.77970994",
"0.779126",
"0.7782395",
"0.77805024",
"0.7621251",
"0.7610844",
"0.75923836",
"0.7487169",
"0.74843246",
"0.74221474",
"0.72265965",
"0.72265965",
"0.71536756",
"0.71385... | 0.80755717 | 1 |
Provided by Curriculum Used to omit key:value pairs from an Object | omit (obj, keyToOmit) {
return Object.entries(obj).reduce(
(newObj, [key, value]) =>
key === keyToOmit ? newObj : { ...newObj, [key]: value },
{}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function omit(obj){var copy={};var keys=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));for(var key in obj) {if(indexOf(keys,key) == -1)copy[key] = obj[key];}return copy;}",
"function myOmit (object,key) {\n delete object[key]\n return object\n}",
"function getWithou... | [
"0.6613501",
"0.6596971",
"0.64839226",
"0.64530563",
"0.62827945",
"0.6247738",
"0.61847466",
"0.6155968",
"0.61034685",
"0.6084961",
"0.60816056",
"0.598219",
"0.5958264",
"0.59195966",
"0.5891991",
"0.5889056",
"0.58550817",
"0.58550817",
"0.58550817",
"0.58550817",
"0.583... | 0.7128844 | 0 |
show the hided empty rows. | function showEmptySlot(){
$("#innerTbl tr").each(function(index,element){
var val = element.style.display;
if(val == 'none'){
element.style.display = '';
}
});
mark = 1;
$("#hide_btn").text("Hide");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showAllRows() {\n for(var i =0 ; i < rowsLength; i ++){\n tbUsers.rows[i].style.display = \"\";\n }\n showOnlineAndTotalCount();\n }",
"function showAllRows() {\n for(var i =0 ; i < rowsLength; i ++){\n tbUsers.rows[i].style.display = \"\";\n }... | [
"0.7065002",
"0.7065002",
"0.69904643",
"0.6920841",
"0.6846342",
"0.6643791",
"0.652359",
"0.64496136",
"0.6418389",
"0.6398131",
"0.639351",
"0.63834673",
"0.63785154",
"0.63358027",
"0.6255642",
"0.61990637",
"0.6192689",
"0.61878574",
"0.6181213",
"0.6162643",
"0.61548704... | 0.7455134 | 0 |
Search on bing for search_str, parse bing response with callback | function query_search(search_str, resolve,reject, callback,type,filters,pos) {
console.log("Searching with bing for "+search_str);
if(!filters) filters="";
var search_URIBing='https://www.bing.com/search?q='+
encodeURIComponent(search_str)+"&filters="+filters+"&first=1&rdr=1";
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function query_search(search_str, resolve,reject, callback,name) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n\t encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n\tGM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n ... | [
"0.74394727",
"0.7419736",
"0.7414053",
"0.7414053",
"0.73907745",
"0.73907745",
"0.73907745",
"0.73907745",
"0.73907745",
"0.73907745",
"0.7355317",
"0.73543155",
"0.73543155",
"0.73543155",
"0.73543155",
"0.734075",
"0.71854126",
"0.65894073",
"0.6587285",
"0.6541081",
"0.6... | 0.761717 | 0 |
Get the user's current region e.g. US South | function getRegion() {
var region = 'unknown';
try{
region = document.querySelector('.current-region').getAttribute('data-name');
}
catch(err){}
return region;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getUserRegion() {\n\tif ($(\".STANDOUT:eq(1)\").attr(\"href\")) {\n\t\treturn $(\".STANDOUT:eq(1)\").attr(\"href\").substring(7);\n\t}\n\treturn \"\";\n}",
"getRegion(){\n // get all input fields in the dropdown\n const allRegions = document.getElementById('regionInput');\n //extrac... | [
"0.6978652",
"0.6900738",
"0.6720556",
"0.66285104",
"0.6607763",
"0.6569672",
"0.65348977",
"0.64351946",
"0.63666356",
"0.6309448",
"0.61870444",
"0.60454947",
"0.5939008",
"0.5887118",
"0.5861443",
"0.5836136",
"0.58137476",
"0.5809281",
"0.5780672",
"0.5748386",
"0.573684... | 0.72032136 | 0 |
Get a subcategory for the current page e.g. "Compute" | function getSubCategory() {
//Handle account management seperately, incorrectly tagged + dojo code.
if ( getCategory() == 'Account Management' ){
var query_params = getQueryParameters();
var selected_nav = query_params['/userAccount/selected_nav'];
if ( selected_nav == 'nav_support'){
re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get subCategory () {\n return this._subCategory\n }",
"function getCategory() {\n\n var page_info = window.analytics_config.page_info;\n \tvar pageID = page_info.pageId || 'BLUEMIX PAGE (OTHER)';\n \tvar hash = window.location.hash;\n\n \tif ( pageID == 'IBMBLUEMIX'){\n \t\treturn 'Home';\... | [
"0.7136501",
"0.705749",
"0.6599799",
"0.64263475",
"0.6271436",
"0.61927694",
"0.600697",
"0.59154624",
"0.59154624",
"0.588786",
"0.5848325",
"0.5833266",
"0.5829699",
"0.5793137",
"0.5774495",
"0.5743725",
"0.5743142",
"0.57338655",
"0.57200927",
"0.5711864",
"0.5690842",
... | 0.7606553 | 0 |
Return the page category (a name for a group of related pages) | function getCategory() {
var page_info = window.analytics_config.page_info;
var pageID = page_info.pageId || 'BLUEMIX PAGE (OTHER)';
var hash = window.location.hash;
if ( pageID == 'IBMBLUEMIX'){
return 'Home';
}
else if (hash && hash.indexOf('userAccount') > -1 ){
return ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getCategory(c){ //*D4EL\n debugger;\n\treturn getCategoryObject(categorizeArticle(printArticle(c.term)));\n}",
"function groupByCategory(allPages) {\n var groups = group_by__WEBPACK_IMPORTED_MODULE_5___default()(allPages.edges, function (edge) {\n return edge.node.context.category;\n });\n return... | [
"0.6561731",
"0.6320113",
"0.63015944",
"0.6036267",
"0.6032751",
"0.6032751",
"0.59874904",
"0.59841233",
"0.5963654",
"0.5747707",
"0.57383764",
"0.57249784",
"0.5722748",
"0.5704932",
"0.5694476",
"0.5686537",
"0.5630295",
"0.5608544",
"0.55800503",
"0.55727726",
"0.555037... | 0.72736377 | 0 |
Find the first empty place | function getempty(loc){
for (var i=0;i<position[loc][2];++i)
if (position[loc][3][i]<time-timeout)
return i;
position[loc][3].push(0);
position[loc][2]+=1;
return position[loc][2]-1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getfirstempty(array){\n for(var i = 0 ; i < array.length ; i++) {\n if(array[i] == undefined) {\n return i;\n }\n }\n return array.length;\n}",
"findNextEmpty(row, col) {\n if (col >= this.N) {\n row++;\n col = 0;\n }\n\n // Fi... | [
"0.6470684",
"0.61475873",
"0.6097793",
"0.604675",
"0.6022902",
"0.60203576",
"0.5979806",
"0.5909205",
"0.5855111",
"0.5850445",
"0.5810052",
"0.57282287",
"0.5722836",
"0.5713813",
"0.5703193",
"0.5702533",
"0.568784",
"0.5665269",
"0.56454396",
"0.5642377",
"0.56277347",
... | 0.6167244 | 1 |
removes the selected class from the state box | function removeSelect() {
let stateSelect = document.querySelector('.state.selected');
stateSelect.classList.remove('selected');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeClass() {\n selected().className = 'color';\n}",
"function removeClassSelected(){\n\tfor(var i = 0; i < difficultyDisplay.length; i++) {\n\t\tdifficultyDisplay[i].classList.remove(\"selected\");\n\t}\n}",
"function removeAllClasses() {\r\n\tfor( var i =0; i< modeButtons.length; i++ )\r\n\t\tmod... | [
"0.777126",
"0.7459367",
"0.73969454",
"0.7314576",
"0.71892947",
"0.71892947",
"0.7179262",
"0.7171281",
"0.7136777",
"0.71249574",
"0.7081879",
"0.70495176",
"0.7035543",
"0.70214564",
"0.70214564",
"0.6983168",
"0.6968957",
"0.6932603",
"0.6930581",
"0.6912485",
"0.6903000... | 0.8113892 | 0 |
Compiles a let statement | async compileLet() {
await this.output([`<letStatement>` + os.EOL]);
this.incrementSpacer();
const letKeyword = this.tokenStream.getNext().composeTag();
const name = this.tokenStream.getNext().composeTag();
await this.output([letKeyword, name]);
if (this.tokenStream.peekN... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function let_macro(symbol) {\n var name;\n\n switch (symbol) {\n case Symbol[\"for\"]('letrec'):\n name = 'letrec';\n break;\n\n case Symbol[\"for\"]('let'):\n name = 'let';\n break;\n\n case Symbol[\"for\"]('let*'):\n name = 'let*';\n break;\n\n ... | [
"0.6786993",
"0.6604533",
"0.64456695",
"0.5938175",
"0.58883905",
"0.5694777",
"0.5626241",
"0.559557",
"0.5589583",
"0.55825645",
"0.5572472",
"0.55708784",
"0.55653834",
"0.55648667",
"0.55640763",
"0.5558734",
"0.55401987",
"0.55374974",
"0.5521105",
"0.55047506",
"0.5495... | 0.78290105 | 0 |
Compiles an if statement, possibly with a trailing else clause | async compileIf() {
await this.output([`<ifStatement>` + os.EOL]);
const ifKeyword = this.tokenStream.getNext().composeTag();
const openPareths = this.tokenStream.getNext().composeTag();
this.incrementSpacer();
await this.output([ifKeyword, openPareths]);
await this.compi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rewriteCompressedIfStatements(ast) {\n // BEFORE: x && y && (z(), zz = 1);\n // AFTER: if(x && y) { z(); zz = 1; }\n query(ast, 'ExpressionStatement > LogicalExpression[right.type=/SequenceExpression|CallExpression|AssignmentExpression/]').forEach(function (node) {\n // NOTE: Logicals are parsed ri... | [
"0.7189138",
"0.6801335",
"0.6780418",
"0.67297244",
"0.65758514",
"0.6554303",
"0.65401304",
"0.65401304",
"0.64919007",
"0.64654624",
"0.64246714",
"0.6400157",
"0.6400157",
"0.6400157",
"0.6400157",
"0.6400157",
"0.63769084",
"0.6373885",
"0.63355726",
"0.6311204",
"0.6296... | 0.7558874 | 0 |
Compiles a while statement | async compileWhile() {
await this.output([`<whileStatement>` + os.EOL]);
const whileKeyword = this.tokenStream.getNext().composeTag();
const openPareths = this.tokenStream.getNext().composeTag();
this.incrementSpacer();
await this.output([whileKeyword, openPareths]);
awai... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function jsen_while( condition ) {\n return {\n callName: \"jsen_while\",\n params: condition,\n };\n}",
"function parse_while() {\n skip_kw(\"while\");\n const cond = parse_key_args();\n input.next();\n let custom;\n\n if (input.peek().type === \"str\") {\n custom = input.next();\n ... | [
"0.7302272",
"0.7099502",
"0.7019122",
"0.6937415",
"0.6937357",
"0.6916695",
"0.68568975",
"0.67047286",
"0.6682484",
"0.6682484",
"0.6641588",
"0.6641186",
"0.6606431",
"0.65299666",
"0.6529164",
"0.65238273",
"0.65238273",
"0.65238273",
"0.65238273",
"0.65238273",
"0.64975... | 0.8207141 | 0 |
Compiles a do statement | async compileDo() {
await this.output([`<doStatement>` + os.EOL]);
const doKeyword = this.tokenStream.getNext().composeTag();
const identifier1 = this.tokenStream.getNext().composeTag();
this.incrementSpacer();
await this.output([doKeyword, identifier1]);
if (this.tokenSt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function visitDoStatement(node) {\n return ts.updateDo(node, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, ts.liftToBlock), ts.visitNode(node.expression, destructuringAndImportCallVisitor, ts.isExpression));\n }",
"function visitDoStatement(node) {\n ... | [
"0.6867239",
"0.6866626",
"0.6829581",
"0.65293366",
"0.6432205",
"0.6128026",
"0.6128026",
"0.57540524",
"0.56575114",
"0.56575114",
"0.56138915",
"0.56138915",
"0.56138915",
"0.56138915",
"0.56138915",
"0.55681723",
"0.5476882",
"0.5447801",
"0.53242385",
"0.52260673",
"0.5... | 0.8220402 | 0 |
Compiles a return statement | async compileReturn() {
await this.output([`<returnStatement>` + os.EOL]);
const returnKeyword = this.tokenStream.getNext().composeTag();
this.incrementSpacer();
await this.output([returnKeyword]);
if (this.tokenStream.peekNext().token !== Constants_1.Symbol.semicolon) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function returnExpr(code){\n return 'return (' + code + ');';\n}",
"function ReturnStatement() {\n}",
"function returnWriter(returnStr){\n return \"return \" + correctBoolExprForC(returnStr) + \";\";\n}",
"function parseReturnStatement() {\n\t var argument = null, marker = markerCreate();\n\t\n\t ... | [
"0.754195",
"0.74318606",
"0.6956142",
"0.6748145",
"0.6744955",
"0.67269915",
"0.6683339",
"0.66700476",
"0.6660274",
"0.66193897",
"0.66193897",
"0.66193897",
"0.66193897",
"0.66193897",
"0.65960693",
"0.65873885",
"0.65873885",
"0.65873885",
"0.65873885",
"0.65873885",
"0.... | 0.77278656 | 0 |
Compiles a term. If the current token is an identifier, the routine distinguishes between a variable, an array entry, or a subroutine call. A single lookahead token, which may be one of "["", "("", or "." suffices to distinguish between the possibilities. Any other token is not part of this term and should not be advan... | async compileTerm() {
this.incrementSpacer();
await this.output([`<term>` + os.EOL]);
const peekNextToken = this.tokenStream.peekNext().token;
switch (peekNextToken) {
case Constants_1.Symbol.minus:
case Constants_1.Symbol.tilda:
const symbol = thi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"term(ctx) {\n if (this.lexer.skip(Token.LAMBDA)) {\n const id = this.lexer.token(Token.LCID);\n this.lexer.match(Token.DOT);\n const term = this.term([id].concat(ctx));\n return new Abstraction(new Pattern(PatternType.Id, id), term);\n } \n \n else if (this.lexer.ski... | [
"0.60935247",
"0.5721144",
"0.57014215",
"0.5657461",
"0.5572817",
"0.5496019",
"0.5466295",
"0.5383469",
"0.53622407",
"0.53379464",
"0.5329853",
"0.5317436",
"0.52994925",
"0.52658594",
"0.5244964",
"0.5240235",
"0.5240235",
"0.5240235",
"0.5240235",
"0.51634216",
"0.515362... | 0.576865 | 1 |
Compiles a possibly empty commaseparated list of expressions | async compileExpressionList() {
const openParenths = this.tokenStream.getNext().composeTag();
await this.output([openParenths, `<expressionList>` + os.EOL]);
if (this.tokenStream.peekNext().token != Constants_1.Symbol.closeParenths) {
this.incrementSpacer();
await this.co... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function compile(list) {\n\t\t\t\treturn list\n\t\t\t\t\t.reduce(function(result, item, index, all) {\n\t\t\t\t\t\tvar next = index + 1 < all.length ? all[index + 1] : null,\n\t\t\t\t\t\t\tforce = ('force' in item && item.force) || (next && next.type === 'key'),\n\t\t\t\t\t\t\toutput = item.type === 'text' ? quote... | [
"0.65381306",
"0.5892701",
"0.57263845",
"0.5714652",
"0.5642083",
"0.5642083",
"0.56086624",
"0.5535165",
"0.5533296",
"0.5533296",
"0.5533296",
"0.5533296",
"0.5531087",
"0.54521525",
"0.5444291",
"0.5433518",
"0.5433281",
"0.5361556",
"0.5311823",
"0.5255221",
"0.5246657",... | 0.67102176 | 0 |
Add a wasm function to the table. | function addFunctionWasm(func, sig) {
var table = wasmTable;
var ret = table.length;
// Grow the table
try {
table.grow(1);
} catch (err) {
if (!(err instanceof RangeError)) {
throw err;
}
throw 'Unable to grow wasm table. Use a higher value for R... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addFunctionWasm(func, sig) {\r\n var table = wasmTable;\r\n var ret = table.length;\r\n\r\n // Grow the table\r\n try {\r\n table.grow(1);\r\n } catch (err) {\r\n if (!(err instanceof RangeError)) {\r\n throw err;\r\n }\r\n throw 'Unable to grow wasm table. Use a higher value for RES... | [
"0.68590426",
"0.68028504",
"0.68028504",
"0.6699937",
"0.6699937",
"0.66403455",
"0.66403455",
"0.65120226",
"0.6036863",
"0.6036863",
"0.6036863",
"0.601768",
"0.601768",
"0.55315477",
"0.5520441",
"0.5450908",
"0.54423827",
"0.5391615",
"0.5357729",
"0.53428173",
"0.532244... | 0.6948674 | 0 |
Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr', nullterminated and encoded in ASCII form. The copy will require at most str.length+1 bytes of space in the HEAP. | function stringToAscii(str, outPtr) {
return writeAsciiToMemory(str, outPtr, false);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stringToAscii(str, outPtr) {\r\n return writeAsciiToMemory(str, outPtr, false);\r\n}",
"function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}",
"function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}",
"function stringToAscii(... | [
"0.7304427",
"0.7227695",
"0.7227695",
"0.7227695",
"0.7227695",
"0.7227695",
"0.7227695",
"0.7227695",
"0.7227695",
"0.7227695",
"0.7227695",
"0.7227695",
"0.7227695",
"0.7227695",
"0.7227695",
"0.7227695",
"0.7227695",
"0.7227695",
"0.7227695",
"0.7227695",
"0.7227695",
"... | 0.7269095 | 1 |
Copies the given Javascript String object 'str' to the given byte array at address 'outIdx', encoded in UTF8 form and nullterminated. The copy will require at most str.length4+1 bytes of space in the HEAP. Use the function lengthBytesUTF8 to compute the exact number of bytes (excluding null terminator) that this functi... | function stringToUTF8Array(str, outU8Array, outIdx, maxBytesToWrite) {
if (!(maxBytesToWrite > 0))
// Parameter maxBytesToWrite is not optional. Negative values, 0, null, undefined and false each don't write out any bytes.
return 0;
var startIdx = outIdx;
var endIdx = outIdx + maxByte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stringToUTF8Array(str, outU8Array, outIdx, maxBytesToWrite) {\r\n if (!(maxBytesToWrite > 0)) // Parameter maxBytesToWrite is not optional. Negative values, 0, null, undefined and false each don't write out any bytes.\r\n return 0;\r\n\r\n var startIdx = outIdx;\r\n var endIdx = outIdx + maxBytesToW... | [
"0.7733459",
"0.7732834",
"0.7732834",
"0.7732834",
"0.7732834",
"0.7732834",
"0.767023",
"0.767023",
"0.767023",
"0.767023",
"0.767023",
"0.767023",
"0.767023",
"0.767023",
"0.767023",
"0.767023",
"0.767023",
"0.767023",
"0.767023",
"0.767023",
"0.767023",
"0.767023",
"0... | 0.7852107 | 0 |
Returns the number of bytes the given Javascript string takes if encoded as a UTF8 byte array, EXCLUDING the null terminator byte. | function lengthBytesUTF8(str) {
var len = 0;
for (var i = 0; i < str.length; ++i) {
// Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! So decode UTF16->UTF32->UTF8.
// See http://unicode.org/faq/utf_bom.html#utf16-3
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stringToUTF8(str, outPtr, maxBytesToWrite) {\n return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite);\n } // Returns the number of bytes the given Javascript string takes if encoded as a UTF8 byte array, EXCLUDING the null terminator byte.",
"function lengthBytesUTF8(str) {\n var len = 0;\... | [
"0.7806903",
"0.74015385",
"0.7385386",
"0.7385386",
"0.7385386",
"0.7385386",
"0.7385386",
"0.7385386",
"0.7385386",
"0.7385386",
"0.7385386",
"0.7385386",
"0.7385386",
"0.7385386",
"0.7385386",
"0.7385386",
"0.7385386",
"0.7385386",
"0.73341924",
"0.73341924",
"0.73341924",... | 0.74146175 | 1 |
Allocate stack space for a JS string, and write it there. | function allocateUTF8OnStack(str) {
var size = lengthBytesUTF8(str) + 1;
var ret = stackAlloc(size);
stringToUTF8Array(str, HEAP8, ret, size);
return ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function allocateUTF8OnStack(str) {\r\n var size = lengthBytesUTF8(str) + 1;\r\n var ret = stackAlloc(size);\r\n stringToUTF8Array(str, HEAP8, ret, size);\r\n return ret;\r\n}",
"function allocateUTF8OnStack(str) {\n var size = lengthBytesUTF8(str) + 1;\n var ret = stackAlloc(size);\n stringToUTF8Array(st... | [
"0.6341655",
"0.63325155",
"0.63325155",
"0.63325155",
"0.63325155",
"0.63325155",
"0.63325155",
"0.63325155",
"0.63325155",
"0.5982892",
"0.58904535",
"0.58756566",
"0.5856557",
"0.5856557",
"0.5800614",
"0.5800614",
"0.5800614",
"0.5800614",
"0.5800614",
"0.5800614",
"0.580... | 0.64325255 | 0 |
Selects a filter clicked by the user | function selectFilter() {
//unselect all filters
$('li').css({'background-color': 'rgba(0, 0, 0, 0)', 'color': 'white'});
$('li').data('selected', false);
//select the filter the user is interested in
$('#'+ this.id).css({'background-color': 'rgba(255, 255, 2... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function selectFilter(event) {\n const filter = event.target.dataset.filter;\n //console.log(`User selected ${filter}`);\n\n //filterList(filter);\n setFilter(filter);\n}",
"onFilterSelected(filter) {\n\n let newFilterValue = !this.state[filter];\n\n let actionData = {\n \"changedPar... | [
"0.795626",
"0.7028658",
"0.6984592",
"0.69236",
"0.685851",
"0.6823423",
"0.6737539",
"0.6672456",
"0.6658115",
"0.6645861",
"0.662263",
"0.6615962",
"0.6577929",
"0.6570529",
"0.6567804",
"0.6563519",
"0.65391034",
"0.65090454",
"0.6492166",
"0.64891195",
"0.6470338",
"0.... | 0.76541334 | 1 |
Create a remote reference from a remote's name | static fromName(name) {
return new RemoteRef(name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"remoteAt(remote) {\n return BranchRef.fromName(`${remote.name}/${this.name}`);\n }",
"static createInNewButtonUnderEntityRef(container) {\n internal.createInVersionCheck(container.model, DirectEntityRef.structureTypeName, { start: \"7.11.0\", end: \"7.16.0\" });\n return i... | [
"0.6047187",
"0.54770297",
"0.54331964",
"0.53619623",
"0.5335513",
"0.52851295",
"0.52200514",
"0.52046055",
"0.5151042",
"0.51330584",
"0.5077399",
"0.5045824",
"0.50232565",
"0.50012434",
"0.49690348",
"0.49578932",
"0.49558133",
"0.49442735",
"0.49145472",
"0.4889722",
"0... | 0.7644648 | 0 |
Get a git config value | function get(setting) {
return __awaiter(this, void 0, void 0, function* () {
const result = yield cmd_1.cmd.execute(git.info.path, ['config', '--get', setting]);
if (result.retc) {
return null;
}
return result.stdout.trim()... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get(name) {\n const value = config.get(name)\n console.assert(value != null && value != undefined, \"Missing config param \" + name)\n return value\n}",
"getConfigValue(key) {\n const option = this.config[key];\n\n if (!option) {\n return;\n }\n\n if (process.env[option.environmentVa... | [
"0.68472266",
"0.67287457",
"0.64656824",
"0.6391882",
"0.62774986",
"0.6186762",
"0.6133392",
"0.61322576",
"0.6130421",
"0.6119611",
"0.60560215",
"0.6037165",
"0.5999514",
"0.5994724",
"0.59681803",
"0.59662855",
"0.5906616",
"0.5857938",
"0.58312535",
"0.5804581",
"0.5791... | 0.6971428 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.