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 |
|---|---|---|---|---|---|---|
Updates the direction the arrow should be pointing. If it is not sorted, the arrow should be facing the start direction. Otherwise if it is sorted, the arrow should point in the currently active sorted direction. The reason this is updated through a function is because the direction should only be changed at specific t... | _updateArrowDirection() {
this._arrowDirection = this._isSorted() ?
this._sort.direction :
(this.start || this._sort.start);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setArrowDirection() {\n if (this.arrowEl) {\n this.arrowEl.setAttribute(\"direction\", this.expand ? \"up\" : \"down\");\n }\n }",
"_getArrowDirectionState() {\n return `${this._isSorted() ? 'active-' : ''}${this._arrowDirection}`;\n }",
"function updateDirection() {\n ... | [
"0.66712195",
"0.6583684",
"0.63980377",
"0.63500655",
"0.6235243",
"0.61799693",
"0.6151829",
"0.6145502",
"0.59743243",
"0.5956929",
"0.59497225",
"0.59468114",
"0.59468114",
"0.59468114",
"0.59468114",
"0.5927889",
"0.5924631",
"0.5851596",
"0.58453125",
"0.5838228",
"0.57... | 0.8427197 | 0 |
Gets the ariasort attribute that should be applied to this sort header. If this header is not sorted, returns null so that the attribute is removed from the host element. Aria spec says that the ariasort property should only be present on one header at a time, so removing ensures this is true. | _getAriaSortAttribute() {
if (!this._isSorted()) {
return 'none';
}
return this._sort.direction == 'asc' ? 'ascending' : 'descending';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_applyDefaultSort(sortAttribute) {\n const defaultOrder = sortAttribute.defaultOrder;\n if (defaultOrder === undefined)\n return;\n\n this.sortKey = sortAttribute.key;\n this.sortType = sortAttribute.type;\n this.customSort = sortAttribute.custom;\n this.sortOrder = defaultOrder;\n this.p... | [
"0.58327866",
"0.5284882",
"0.52737665",
"0.5202473",
"0.5202473",
"0.5083491",
"0.5081484",
"0.50456727",
"0.49231634",
"0.49189892",
"0.49036518",
"0.48966223",
"0.48731187",
"0.4863285",
"0.48135135",
"0.47843137",
"0.47208387",
"0.46527734",
"0.46088782",
"0.45787963",
"0... | 0.7205667 | 0 |
Whether the arrow inside the sort header should be rendered. | _renderArrow() {
return !this._isDisabled() || this._isSorted();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isSorted() {\n return !!this.bachVizColumn.answerColumn.sort;\n }",
"isAscendingSort() {\n return !!this._getSortAscending();\n }",
"isSortKey() {\n return !_$2.isUndefined(this.deprecatedUtil.getSortAcending());\n }",
"get sortable() {\n return !!this._sortBy;\n }",
... | [
"0.6957804",
"0.66008043",
"0.656237",
"0.6494539",
"0.63080186",
"0.6207504",
"0.61885196",
"0.61859703",
"0.61476266",
"0.60823834",
"0.6071433",
"0.6056663",
"0.60542965",
"0.60427463",
"0.6041743",
"0.60196143",
"0.60174084",
"0.5996501",
"0.5992646",
"0.5990312",
"0.5990... | 0.8147642 | 0 |
Add "matcolumn" prefix in addition to "cdkcolumn" prefix. In the future, this will only add "matcolumn" and columnCssClassName will change from type string[] to string. | _updateColumnCssClassName() {
super._updateColumnCssClassName();
this._columnCssClassName.push(`mat-column-${this.cssClassFriendlyName}`);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_updateColumnCssClassName() {\n this._columnCssClassName = [`cdk-column-${this.cssClassFriendlyName}`];\n }",
"_updateColumnCssClassName() {\n this._columnCssClassName = [`cdk-column-${this.cssClassFriendlyName}`];\n }",
"_updateColumnCssClassName() {\n this._columnCssClassName = [`c... | [
"0.726117",
"0.726117",
"0.726117",
"0.65293694",
"0.65293694",
"0.65293694",
"0.61329263",
"0.5719447",
"0.5719447",
"0.55752546",
"0.55275744",
"0.5436983",
"0.53735995",
"0.5340551",
"0.5331148",
"0.52214086",
"0.51841134",
"0.51669776",
"0.51218635",
"0.5112676",
"0.50956... | 0.77303386 | 1 |
Instance of the MatSort directive used by the table to control its sorting. Sort changes emitted by the MatSort will trigger an update to the table's rendered data. | get sort() { return this._sort; } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sort() {\n index++;\n predicate = ng.isFunction(getter(scope)) ? getter(scope) : attr.stSort;\n if (index % 3 === 0 && attr.stSkipNatural === undefined) {\n //manual reset\n index = 0;\n ... | [
"0.6046511",
"0.6021268",
"0.5983923",
"0.5937135",
"0.5852669",
"0.5796884",
"0.5796884",
"0.5658909",
"0.55748856",
"0.55599886",
"0.5445029",
"0.5445029",
"0.543063",
"0.5391626",
"0.5380174",
"0.5378859",
"0.53599656",
"0.53585446",
"0.53292894",
"0.5315824",
"0.5306405",... | 0.6140787 | 1 |
Instance of the MatPaginator component used by the table to control what page of the data is displayed. Page changes emitted by the MatPaginator will trigger an update to the table's rendered data. Note that the data source uses the paginator's properties to calculate which page of data should be displayed. If the pagi... | get paginator() { return this._paginator; } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"ngOnInit() {\n /*\n * Default page size is 10.\n * The reason we set it here and not in the provider itself is because\n * we don't want pagination if this component isn't present in the datagrid.\n */\n if (!this.page.size) {\n this.page.size = 10;\n ... | [
"0.602087",
"0.5623943",
"0.5623943",
"0.5477397",
"0.54173976",
"0.54109186",
"0.54034823",
"0.5352494",
"0.5352494",
"0.5325063",
"0.5325063",
"0.5309374",
"0.53090566",
"0.5271855",
"0.5221399",
"0.5197168",
"0.5169873",
"0.5169873",
"0.5166022",
"0.5152065",
"0.51252097",... | 0.608851 | 1 |
Subscribe to changes that should trigger an update to the table's rendered rows. When the changes occur, process the current state of the filter, sort, and pagination along with the provided base data and send it to the table for rendering. | _updateChangeSubscription() {
var _a;
// Sorting and/or pagination should be watched if MatSort and/or MatPaginator are provided.
// The events should emit whenever the component emits a change or initializes, or if no
// component is provided, a stream with just a null event should be p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"applyFilters () {\n EventBus.$emit('datatable:filters-applied');\n }",
"_updateChangeSubscription() {\n // Sorting and/or pagination should be watched if MatSort and/or MatPaginator are provided.\n // The events should emit whenever the component emits a change or initializes, or ... | [
"0.67549384",
"0.63482326",
"0.621952",
"0.6139806",
"0.6139806",
"0.60449266",
"0.5931006",
"0.58735836",
"0.5820544",
"0.5789866",
"0.5777962",
"0.5772918",
"0.5743998",
"0.57131076",
"0.569127",
"0.568311",
"0.5653438",
"0.56469005",
"0.5637902",
"0.5633215",
"0.5633193",
... | 0.6487808 | 1 |
Returns a filtered data array where each filter object contains the filter string within the result of the filterTermAccessor function. If no filter is set, returns the data array as provided. | _filterData(data) {
// If there is a filter string, filter out data that does not contain it.
// Each data object is converted to a string using the function defined by filterTermAccessor.
// May be overridden for customization.
this.filteredData = (this.filter == null || this.filter ===... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_filterData(data) {\n // If there is a filter string, filter out data that does not contain it.\n // Each data object is converted to a string using the function defined by filterTermAccessor.\n // May be overridden for customization.\n this.filteredData =\n !this.filter ? da... | [
"0.65650725",
"0.6240535",
"0.5992861",
"0.5889257",
"0.58607024",
"0.57890606",
"0.5711491",
"0.5710739",
"0.56987274",
"0.5666401",
"0.5649642",
"0.56474215",
"0.5644576",
"0.5636285",
"0.5627709",
"0.5627032",
"0.56067216",
"0.5582868",
"0.55612856",
"0.55545795",
"0.55487... | 0.67155164 | 0 |
Returns a paged slice of the provided data array according to the provided MatPaginator's page index and length. If there is no paginator provided, returns the data array as provided. | _pageData(data) {
if (!this.paginator) {
return data;
}
const startIndex = this.paginator.pageIndex * this.paginator.pageSize;
return data.slice(startIndex, startIndex + this.paginator.pageSize);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function paging(fullDataset, pageSizeParam, skipParam) {\n if (pageSizeParam != null && skipParam != null) {\n const pageSize = parseInt(pageSizeParam, 10);\n const skip = parseInt(skipParam, 10);\n\n const start = pageSize * skip;\n const end = start + pageSize;\n return fullDataset.slice(start, e... | [
"0.65905607",
"0.5886192",
"0.58573383",
"0.5814664",
"0.5768053",
"0.57208717",
"0.564674",
"0.5631047",
"0.5608492",
"0.558778",
"0.55775565",
"0.5532488",
"0.5513432",
"0.54811734",
"0.54811734",
"0.54811734",
"0.54811734",
"0.5475298",
"0.5407709",
"0.54020846",
"0.539835... | 0.66642904 | 1 |
Updates the paginator to reflect the length of the filtered data, and makes sure that the page index does not exceed the paginator's last page. Values are changed in a resolved promise to guard against making property changes within a round of change detection. | _updatePaginator(filteredDataLength) {
Promise.resolve().then(() => {
const paginator = this.paginator;
if (!paginator) {
return;
}
paginator.length = filteredDataLength;
// If the page index is set beyond the page, reduce it to the las... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_changePage() {\n // If we know we have pagination but the page size hasn't been set yet, we wait for it.\n if (this.uninitialized || (this._page.activated && this._page.size === 0)) {\n return;\n }\n if (this._page.size > 0) {\n this._displayed = this._filtered.sl... | [
"0.61207455",
"0.60865575",
"0.58248454",
"0.5769892",
"0.57270837",
"0.571515",
"0.571515",
"0.571515",
"0.571515",
"0.56672055",
"0.5575527",
"0.55438375",
"0.55386144",
"0.5507469",
"0.5506535",
"0.5493176",
"0.5483363",
"0.5483363",
"0.5483363",
"0.54815996",
"0.5476509",... | 0.7817805 | 1 |
Hides the tooltip after the delay in ms, defaults to tooltipdelayhide or 0ms if no input | hide(delay = this.hideDelay) {
if (this._tooltipInstance) {
this._tooltipInstance.hide(delay);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hide() {\n // First things first: we don't show it anymore.\n scope.tt_isOpen = false;\n\n //if tooltip is going to be shown after delay, we must cancel this\n $timeout.cancel( popupTimeout );\n popupTimeout = null;\n\n // And n... | [
"0.75925225",
"0.7515157",
"0.7511761",
"0.7511761",
"0.7511761",
"0.7511761",
"0.74643046",
"0.74611235",
"0.74239695",
"0.73835206",
"0.73835206",
"0.7326043",
"0.73049426",
"0.7204172",
"0.7141634",
"0.70958596",
"0.6982736",
"0.6976865",
"0.69194937",
"0.68772656",
"0.686... | 0.7923203 | 1 |
Returns true if the tooltip is currently visible to the user | _isTooltipVisible() {
return !!this._tooltipInstance && this._tooltipInstance.isVisible();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isVisible()\t{ return this._behavior('is visible'); }",
"get isShown() {\n return u(this.element, m);\n }",
"isVisible() {\n return this.deprecatedUtil.isVisible();\n }",
"checkIfVisible() {\n return this.elementBottom > viewport.positions.top && this.elementTop < viewport.positions.bott... | [
"0.68267965",
"0.6809555",
"0.6799078",
"0.67738724",
"0.67191577",
"0.67191577",
"0.6660548",
"0.6592849",
"0.65285385",
"0.65072256",
"0.6479565",
"0.6415987",
"0.6415987",
"0.63928306",
"0.63868725",
"0.63462204",
"0.63276076",
"0.6318853",
"0.6318261",
"0.63076377",
"0.62... | 0.8663986 | 1 |
Detaches the currentlyattached tooltip. | _detach() {
if (this._overlayRef && this._overlayRef.hasAttached()) {
this._overlayRef.detach();
}
this._tooltipInstance = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearTooltip(){\n if (tooltip.getContent()){\n tooltip.getContent().remove();\n }\n if (hoverTimeout){\n //Prevent 'sticky' hovers\n clearTimeout(hoverTimeout);\n }\n }",
"func... | [
"0.6727261",
"0.6618634",
"0.6618634",
"0.6618634",
"0.66131973",
"0.6470958",
"0.63486236",
"0.6333146",
"0.6328341",
"0.6272446",
"0.62682915",
"0.6254478",
"0.62162226",
"0.62162226",
"0.614133",
"0.6098839",
"0.60894924",
"0.60894924",
"0.608147",
"0.607992",
"0.6069992",... | 0.7829978 | 1 |
Adds the configured offset to a position. Used as a hook for child classes. | _addOffset(position) {
return position;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"adjustPos(XOffset, YOffset) {\n this.x += XOffset;\n this.y += YOffset;\n }",
"withOffsetX(offset) {\n this._positionStrategy.withDefaultOffsetX(offset);\n return this;\n }",
"withOffsetX(offset) {\n this._positionStrategy.withDefaultOffsetX(offset);\n return thi... | [
"0.7078188",
"0.6720564",
"0.6720564",
"0.6720564",
"0.6720564",
"0.66941345",
"0.65700203",
"0.65700203",
"0.65700203",
"0.65700203",
"0.65700203",
"0.65700203",
"0.65700203",
"0.65700203",
"0.65700203",
"0.65700203",
"0.64294875",
"0.62936074",
"0.62936074",
"0.62936074",
"... | 0.7479931 | 0 |
Returns the overlay position and a fallback position based on the user's preference | _getOverlayPosition() {
const isLtr = !this._dir || this._dir.value == 'ltr';
const position = this.position;
let overlayPosition;
if (position == 'above') {
overlayPosition = { overlayX: 'center', overlayY: 'bottom' };
}
else if (position == 'below') {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function FallbackPosition() { }",
"_updatePosition() {\n const position = this._overlayRef.getConfig().positionStrategy;\n const origin = this._getOrigin();\n const overlay = this._getOverlayPosition();\n position.withPositions([\n Object.assign(Object.assign({}, origin.mai... | [
"0.6790959",
"0.6502777",
"0.6421835",
"0.6416141",
"0.62793815",
"0.62793815",
"0.6277636",
"0.6276256",
"0.6262092",
"0.6262092",
"0.62294996",
"0.62294996",
"0.62294996",
"0.62294996",
"0.6209649",
"0.61699086",
"0.6145157",
"0.6145157",
"0.6145157",
"0.6138777",
"0.613877... | 0.7403727 | 1 |
Updates the tooltip message and repositions the overlay according to the new message length | _updateTooltipMessage() {
// Must wait for the message to be painted to the tooltip so that the overlay can properly
// calculate the correct positioning based on the size of the text.
if (this._tooltipInstance) {
this._tooltipInstance.message = this.message;
this._toolti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_updateTooltipMessage() {\n // Must wait for the message to be painted to the tooltip so that the overlay can properly\n // calculate the correct positioning based on the size of the text.\n if (this._tooltipInstance) {\n this._tooltipInstance.message = this.message;\n th... | [
"0.77607894",
"0.69654536",
"0.6840831",
"0.6425566",
"0.63804305",
"0.6272683",
"0.6258232",
"0.6238353",
"0.6238353",
"0.6212615",
"0.615643",
"0.6152242",
"0.60917044",
"0.5946332",
"0.5888566",
"0.5887203",
"0.5879544",
"0.5859549",
"0.5849231",
"0.5849231",
"0.58431536",... | 0.775329 | 1 |
Updates the class on the overlay panel based on the current position of the tooltip. | _updateCurrentPositionClass(connectionPair) {
const { overlayY, originX, originY } = connectionPair;
let newPosition;
// If the overlay is in the middle along the Y axis,
// it means that it's either before or after.
if (overlayY === 'center') {
// Note that since thi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get tooltipClass() { return this._tooltipClass; }",
"get tooltipClass() { return this._tooltipClass; }",
"openTooltip( event ) {\n if ( !event.target.matches( '.toolbar-color' ) ) return\n this.id = event.target.dataset.id\n //get specific coordinates where the user is hovering over the no... | [
"0.6115294",
"0.6115294",
"0.5884756",
"0.58699846",
"0.58342844",
"0.58315766",
"0.5829558",
"0.58102274",
"0.58102274",
"0.5768717",
"0.57516724",
"0.57384264",
"0.56977427",
"0.56953967",
"0.5671361",
"0.565151",
"0.56285936",
"0.5604887",
"0.5587506",
"0.55747825",
"0.557... | 0.6606046 | 0 |
Disables the native browser gestures, based on how the tooltip has been configured. | _disableNativeGesturesIfNecessary() {
const gestures = this.touchGestures;
if (gestures !== 'off') {
const element = this._elementRef.nativeElement;
const style = element.style;
// If gestures are set to `auto`, we don't disable text selection on inputs and
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"disable() {\n _.off(document, 'mousedown', this._onTapStart);\n }",
"disable() {\n _off(document, 'mousedown', this._onTapStart);\n }",
"function webotsDisablePointerEvents() {\n document.body.style['pointer-events'] = 'none';\n}",
"function disablePoint(){if(!_enabled){return;}_... | [
"0.69896036",
"0.69336",
"0.6818821",
"0.66569877",
"0.64816284",
"0.6350468",
"0.62596095",
"0.62596095",
"0.62596095",
"0.6236379",
"0.6214792",
"0.6205293",
"0.61476874",
"0.61431354",
"0.61424506",
"0.6117319",
"0.60957384",
"0.6094732",
"0.6089802",
"0.60761",
"0.6069445... | 0.6994373 | 1 |
Include another html file | function includeHTML(id) {
var elmnt = document.getElementById(id)
var file = elmnt.getAttribute("html-file");
var xhttp = new XMLHttpRequest();
xhttp.open("GET", file, true);
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function include (filename) {\n return HtmlService.createHtmlOutputFromFile(filename).getContent()\n}",
"function includeHTML() {\n var z, i, elmnt, file, xhttp;\n /* Loop through a collection of all HTML elements: */\n z = document.getElementsByTagName(\"*\");\n for (i = 0; i < z.length; i++) {\n elmnt ... | [
"0.69486946",
"0.6943588",
"0.69187224",
"0.69187224",
"0.6906398",
"0.6906398",
"0.6906398",
"0.68840003",
"0.6879551",
"0.68594325",
"0.6749232",
"0.63987124",
"0.63001937",
"0.6249587",
"0.62450117",
"0.6050394",
"0.6049988",
"0.59631073",
"0.59606105",
"0.5940672",
"0.594... | 0.7289445 | 0 |
Toggle domains dropdown menu | function domain_toggle() {
$('.dropdown-submenu a.dropdown-title').on("click", function(d){
$(this).parent().siblings().children().filter('ul').hide();
$(this).next('ul').toggle();
d.stopPropagation();
d.preventDefault();
});
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showDomains()\n\t{\n\t\t$('#domainMain').show();\n\t\t$('#changeDomain').attr('value',searchDomainTextOn);\n\t\tclickedDomains=1;\n\n\t}",
"function hideDomains()\n\t{\n\t\t$('#domainMain').hide();\n\t\t$('#changeDomain').attr('value',searchDomainTextOff);\n\t\tclickedDomains=0;\n\n\t}",
"function tog... | [
"0.71697414",
"0.67399114",
"0.6361544",
"0.6227159",
"0.6214019",
"0.61963725",
"0.6193541",
"0.6181973",
"0.61380213",
"0.61309475",
"0.6124065",
"0.6104021",
"0.61022925",
"0.6099594",
"0.60967773",
"0.6085473",
"0.60773283",
"0.60710615",
"0.605657",
"0.60556674",
"0.6046... | 0.8384388 | 0 |
helper function to build an FTP connection based on our configuration | function getFtpConnection() {
return ftp.create({
host: host,
port: port,
user: user,
password: password,
parallel: 5,
log: gutil.log,
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getFtpConnection() {\n return ftp.create({\n host: host,\n port: port,\n user: user,\n password: password,\n parallel: 5,\n log: gutil.log\n });\n}",
"function getFtpConnection() {\n\treturn ftp.create({\n\t\thost: '190.61.4.77',\n\t\tport: 21,\n\t\tuser: ... | [
"0.6991937",
"0.68052703",
"0.6386587",
"0.593269",
"0.58197975",
"0.56672925",
"0.55195296",
"0.5271417",
"0.49501175",
"0.4825707",
"0.47713724",
"0.45957977",
"0.4591129",
"0.45735514",
"0.45560747",
"0.45429966",
"0.45398095",
"0.4537828",
"0.4533754",
"0.4533754",
"0.453... | 0.7012585 | 0 |
Deploy task. Copies the new files to the server Usage: `FTP_USER=someuser FTP_PWD=somepwd gulp ftpdeploy` | function deploy(cb) {
var conn = getFtpConnection()
src(localFilesGlob, { base: './dist', buffer: false })
.pipe(conn.newer(remoteFolder)) // only upload newer files
.pipe(conn.dest(remoteFolder))
cb()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deploy(cb) {\r\n return gulp.src('_site/**')\r\n .pipe(rsync({\r\n root: '_site',\r\n username: 'USERNAME',\r\n hostname: 'HOSTNAME.TLD',\r\n destination: 'destination/to/blog/',\r\n compress: true,\r\n incremental: true,\r\n }));\r\n}",
"function exp(cb)\n{\n var... | [
"0.692237",
"0.65925705",
"0.64031076",
"0.61965615",
"0.6102447",
"0.6018047",
"0.59276664",
"0.59216446",
"0.5920915",
"0.5799259",
"0.5764357",
"0.5751276",
"0.5746595",
"0.5736667",
"0.5671442",
"0.5612932",
"0.5601253",
"0.5535369",
"0.5523635",
"0.545066",
"0.5415899",
... | 0.7859039 | 0 |
Export this certificate from the stack | export() {
return {
certificateArn: new cdk_1.Output(this, 'Arn', { value: this.certificateArn }).makeImportValue().toString()
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CertificateStore() {\n}",
"sendCertificate () {\n this.sendHandshakeMessage(HandshakeType.CERTIFICATE,\n prepend24(concat([prepend24(this.certDer)])))\n }",
"function Certificate() {\n if (!(this instanceof Certificate))\n return new Certificate();\n}",
"exportStack(stackName) {\n ... | [
"0.55052835",
"0.5384735",
"0.52812535",
"0.5262277",
"0.52551055",
"0.5194585",
"0.5109982",
"0.50110644",
"0.49626872",
"0.49431786",
"0.48872098",
"0.4840084",
"0.48275557",
"0.48217162",
"0.48199537",
"0.48166686",
"0.47845784",
"0.47803864",
"0.47802496",
"0.4774471",
"0... | 0.57428586 | 0 |
Adds a listener to every item in the selection, which will display a readout on mouse over. | function readout( selection ) {
selection.on('mouseover', function(d) {
div
.html( tohtml(d) )
.style( 'left', d3.event.pageX+"px" )
.style( 'top', d3.event.pageY+"px" );
// TODO intelligently position the readout
div
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"itemSelectionChanged() {\n this.selectionHelper.setItemSelection(this.getItemSelection());\n this.updateLineUpStats();\n super.itemSelectionChanged();\n }",
"onSelectionBox( callback ){\n\t\t$(\"div.item\", this.selectionbox).on('click', callback);\n\t}",
"function SelectionChange() {}"... | [
"0.6054899",
"0.6020182",
"0.5927296",
"0.5825647",
"0.58027864",
"0.57895",
"0.5783208",
"0.57609093",
"0.57609093",
"0.5747279",
"0.5738476",
"0.567137",
"0.5596475",
"0.5593436",
"0.5552961",
"0.5531925",
"0.5530515",
"0.5520253",
"0.5512577",
"0.5500072",
"0.54873157",
... | 0.60594374 | 0 |
demo for skins, macros, filters | function skins_action() {
var context = {
title: 'Skin Demo',
name: 'Luisa',
names: ['Benni', 'Emma', 'Luca', 'Selma']
};
render('skins/skins.html', context);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SceneSetup(){\r\n //Demo\r\n fiveSetsOfSwirls();\r\n //Alt demo (Uncomment and comment other fiveSetsOfSwirls())\r\n //GrowingRWBQI();\r\n //More demos available in savedFunctions.js\r\n}",
"function load_samples(){\n\tconsole.log(\"loading samples\")\n $('#samples').show();\n $('he... | [
"0.6124656",
"0.5767539",
"0.5432729",
"0.52351636",
"0.52090496",
"0.52037036",
"0.51710755",
"0.5147051",
"0.5123657",
"0.50731546",
"0.50663775",
"0.5065422",
"0.50640047",
"0.5059922",
"0.5054902",
"0.5052517",
"0.50309056",
"0.50295997",
"0.50213265",
"0.50027275",
"0.50... | 0.5968218 | 1 |
demo for continuation support | function continuation_action() {
if (req.params.helma_continuation == null) {
// set query param so helma knows to switch rhino optimization level to -1
res.redirect(req.path + "?helma_continuation=");
}
// render first page
render('skins/continuation.html', {
title: "Continuatio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeContinuation(name,body) {\n var ctn = {\n $continuation: true,\n type:'FunctionDeclaration',\n id:ident(name),\n params:[],\n body:{type:'BlockStatement',body:cloneNode(body)}\n } ;\n\n continuations[name] ... | [
"0.6476042",
"0.6402273",
"0.63567615",
"0.62295175",
"0.6208351",
"0.62046117",
"0.59736997",
"0.59103626",
"0.59103626",
"0.59103626",
"0.58946866",
"0.58946866",
"0.5819779",
"0.57957757",
"0.577057",
"0.5745759",
"0.5725662",
"0.5701486",
"0.5697779",
"0.5697779",
"0.5697... | 0.6640401 | 0 |
main method called to start application | function main() {
app.start();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static main() {\r\n\t\tthis.init();\r\n\t}",
"function main()\n{\n application.args = processCommandLine();\n application.exitCode = exit_code.SUCCESS;\n registerMimeTypes();\n spawnStaticServer();\n spawnContentServer();\n spawnControlServer();\n}",
"function main() {\n console.log(\"... | [
"0.7475461",
"0.7172614",
"0.71629727",
"0.7096434",
"0.7014009",
"0.6985645",
"0.686334",
"0.6862799",
"0.6827846",
"0.68212724",
"0.6793531",
"0.6790798",
"0.6779308",
"0.6779308",
"0.6779308",
"0.6779308",
"0.67728794",
"0.669541",
"0.669316",
"0.66637564",
"0.6651365",
... | 0.7553744 | 0 |
Render appearance settings fields | function AppearanceSettings() {
return (
<div className="fade-in">
<GroupColorsField />
<ThemeField />
<ReleasesOrderField />
<CoversField />
<MetaField />
</div>
)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get appearance() { return this._appearance; }",
"displaySettings() {\n return (\n <Dialog\n open={this.state.showSettingsDialog}\n onClose={() => this.setState({ showSettingsDialog: false })}\n aria-labelledby=\"editorAppearanceSettings\"\n ... | [
"0.61663526",
"0.5873345",
"0.5847002",
"0.5746679",
"0.56870204",
"0.5522912",
"0.5513959",
"0.54833496",
"0.54768306",
"0.54746515",
"0.5467166",
"0.5453366",
"0.54406506",
"0.5424233",
"0.5414696",
"0.53993577",
"0.53861684",
"0.53770965",
"0.5373537",
"0.53706706",
"0.532... | 0.73371905 | 0 |
3. Print a random integer (whole number) between 50 and 100 to the console Reference: | function PrintRandomInteger(min, max) {
return console.log((Math.floor(Math.random() * (max - min)) + min));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function startRandomInt() {\n randomInt = Math.floor(Math.random()* 100 + 1)\n console.log(randomInt)\n}",
"function get_rand() {\n\tvar numb = Math.random();\n\tnumb *= 100;\n\t//numb = numb * 100;\n\tdocument.write(numb.toFixed(0));\n}",
"function rndint () {\n return Math.ceil(Math.random() * 100)\n}",... | [
"0.7032432",
"0.6982685",
"0.69166",
"0.68900084",
"0.68808264",
"0.6877401",
"0.68744946",
"0.68061304",
"0.6726473",
"0.67224944",
"0.6710593",
"0.67026615",
"0.66879225",
"0.6680258",
"0.6649897",
"0.6634597",
"0.66305566",
"0.66298",
"0.6621683",
"0.65723675",
"0.65664274... | 0.73137814 | 0 |
retrieve upcoming booking data from firestore | getBookingDetails() {
var roomid = this.props.navigation.getParam("bookingid");
db.collection("userBookings4")
.doc(roomid)
.get()
.then(doc => {
if (!doc.exists) {
console.log("No such document!");
} else {
details = doc.data();
this.setState({ g... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getAppointment() {\n try {\n const db = firebase.firestore();\n const querySnapshot = await db.collection(\"appointment\").get();\n let uuers = [];\n querySnapshot.forEach((doc) => {\n let dd = doc.data();\n console.log(dd.appointmentDate.toDate());\n let ... | [
"0.7586112",
"0.6486901",
"0.63158697",
"0.6243797",
"0.59092546",
"0.59054816",
"0.5876776",
"0.58276093",
"0.58271015",
"0.5825206",
"0.5822139",
"0.58203423",
"0.5806492",
"0.57989556",
"0.57619905",
"0.57519245",
"0.5743324",
"0.5741715",
"0.5736519",
"0.573501",
"0.57256... | 0.68370754 | 1 |
Function that updates the map with the new coordinate weights to change layout of heat map | function updateMap() {
const center = new google.maps.LatLng(40.736071, -73.888207);
map = new google.maps.Map(
document.getElementById('map'), {
zoom: 11,
center: center
});
heatMap = new google.maps.visualization.HeatmapLayer({
data: coords,
map: map
})
heatMap.setMap(map);
h... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dataHandlerHeatmapWeight(data){\n var newLoc = new Array(); \n var preValue;\n\n var bounds = new google.maps.LatLngBounds();\n for(i = 0; i < data.rows.length; i++) {\n var point = new google.maps.LatLng(\n data.rows[i][0], \n data.rows[i][1]);\n var val... | [
"0.69200194",
"0.63791084",
"0.6348938",
"0.62147397",
"0.6213429",
"0.61325234",
"0.60913384",
"0.60539037",
"0.5985121",
"0.5982247",
"0.59705424",
"0.59206444",
"0.59156615",
"0.59014815",
"0.5893275",
"0.5886077",
"0.5868864",
"0.5856111",
"0.5843337",
"0.58362937",
"0.58... | 0.69108504 | 1 |
validates that the entry is 16 characters long | function isLen16(elem) {
var str = elem.value;
var re = /\b.{16}\b/;
if (!str.match(re)) {
alert("Entry does not contain the required 16 characters.");
setTimeout("focusElement('" + elem.form.name + "', '" + elem.name + "')", 0);
return false;
} else {
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkMaxlength(field,fieldLength){\r\n\tvar str = field.value;\r\n\tvar checkStr = \"\";\r\n\tvar checkLength = 0 ;\r\n\tfor (var i = 0; i < str.length; i++){\r\n\t\tif(str.charCodeAt(i) >127){\r\n\t\t\tcheckLength+=2;\r\n\t\t}else{\r\n\t\t\tcheckLength+=1;\r\n\t\t}\r\n\t\tif(checkLength >fieldLength){\r\... | [
"0.66467386",
"0.65531534",
"0.65266734",
"0.6491213",
"0.6393607",
"0.6259016",
"0.6236785",
"0.62165076",
"0.61910766",
"0.6187306",
"0.6160379",
"0.61470413",
"0.6140809",
"0.6140809",
"0.6140809",
"0.6097732",
"0.6090067",
"0.6070133",
"0.6031554",
"0.60122013",
"0.600870... | 0.7516934 | 0 |
launchProgram Launches the classification .exe file. Inputs: None Outputs: Uses "child" to launch label_image.exe file as a child process Returns: None | function launchProgram(){
//Parameter is the relative path to the images the classifier uses
parameters = ["maps/"];
displayLoader(true);
document.getElementById("textOutput").value += "Quarry recognition started...\n";
document.getElementById("textOutput").value += "this may take some time.\n";
disableButtons(tr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function launch() {} //ๆๅผๆไปถๆๅฏๅจ็จๅบ็็ฑป๏ผ็ฑป๏ผ๏ผ ",
"function launch() {}",
"function launch() {}",
"async interactivelyForkPackage () {\n const forkedName = await this.world().prompt([\n 'New Forked Package\\n', {},\n 'Please enter a name for the forked class and its package:', { fontSize: 16,... | [
"0.544372",
"0.53269076",
"0.53269076",
"0.5023024",
"0.49847543",
"0.49033296",
"0.48088074",
"0.48066437",
"0.47727787",
"0.4712835",
"0.47072572",
"0.46580127",
"0.4625682",
"0.45745143",
"0.4557306",
"0.45566297",
"0.45462197",
"0.45320028",
"0.45068172",
"0.44991463",
"0... | 0.7451956 | 0 |
Unmap events in the specified event controller | function unmap_events(ec) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"clear(){\n this.m_map.clear();//remove all event mappings\n }",
"function removeMapEvents(scope, eventListeners, mapObject) {\n angular.forEach(eventListeners, function (listener, eventName) {\n mapObject.removeEventListener(eventName, listener);\n });\n }",
"clearActionEvents() {\n const ac... | [
"0.59658587",
"0.59378296",
"0.5791699",
"0.57849437",
"0.5678145",
"0.56436855",
"0.56262505",
"0.5603384",
"0.5595376",
"0.554277",
"0.54870284",
"0.54841554",
"0.5474291",
"0.54739493",
"0.5421901",
"0.5377411",
"0.53678465",
"0.5357346",
"0.53071254",
"0.5299107",
"0.5297... | 0.7259578 | 0 |
The below method is used to render the step action for the Stepper. | renderStepActions(step) {
return (
<div style={{ margin: '12px 0' }}>
<Button
disabled={this.state.stepIndex === 0}
onClick={this.handlePrev}
className={classes.button}
>
Back
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"dispatchStepClick() {\n /**\n * Event that fires when clicking on step.\n *\n * @event\n * @name stepclick\n * @public\n */\n this.dispatchEvent(new CustomEvent('stepclick'));\n }",
"onStepClicked(step) {\n if (this.props.hasOwnProperty('onStepC... | [
"0.6333131",
"0.6329366",
"0.62934864",
"0.6267382",
"0.61663294",
"0.6152953",
"0.61325824",
"0.6029091",
"0.5807753",
"0.57943827",
"0.5790923",
"0.5760691",
"0.57148147",
"0.5713471",
"0.56891316",
"0.5668881",
"0.5668315",
"0.56625944",
"0.56006974",
"0.55643195",
"0.5559... | 0.66496474 | 0 |
Renders a PDF page to a canvas | function renderPage(page) {
// const container = document.getElementById('pdf-container');
var canvas = document.getElementById('pdf-canvas');
var context = canvas.getContext('2d');
var viewport = page.getViewport({scale: scaleUnit});
canvas.width = viewport.width;
canvas.height = view... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderPage(num) {\n canvas = document.getElementById(`the-canvas-${num}`);\n ctx = canvas.getContext(\"2d\");\n pageRendering = true;\n // Using promise to fetch the page\n pdfDoc.getPage(num).then(function(page) {\n var viewport = page.getViewport({ scale: scale });\n canvas.height = viewport.... | [
"0.7642013",
"0.755521",
"0.75294",
"0.73834056",
"0.7153281",
"0.71471256",
"0.71209717",
"0.7109008",
"0.7078779",
"0.70458",
"0.70362276",
"0.7028427",
"0.69589144",
"0.67930144",
"0.67799",
"0.6771613",
"0.6766666",
"0.6699416",
"0.66914505",
"0.6687356",
"0.66779923",
... | 0.7897112 | 0 |
When the cart in the top right navigation bar is clicked, send alert message to page "cart is empty throught cartAlert functin | function cartAlert(){
alert("The cart is Empty!");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function basketEmpty() {\n if (cartItem === null) {\n alert(\"ATTENTION : Votre panier est vide. \\n Cliquez sur ''OK'' pour revenir ร l'accueil.\")\n window.location = \"/HTML/index.html\";\n }\n}",
"function CheckOut() {\n if (document.getElementById(\"updateShoppingPrice\").children.len... | [
"0.7865452",
"0.69825715",
"0.6883198",
"0.68545157",
"0.68371856",
"0.6715392",
"0.6700755",
"0.6700711",
"0.6671123",
"0.6659396",
"0.662607",
"0.6542253",
"0.6538258",
"0.6523216",
"0.6517044",
"0.6485465",
"0.64757633",
"0.6469252",
"0.64547145",
"0.6407304",
"0.639376",
... | 0.7857551 | 1 |
Get the terrain type that is assigned to a specified grid tile. Parameters: | getTerrainType(row, column) {
var tile = this.terrainGridTiles.getTile(row, column);
if (tile === this.towerTerrainOpen) {
return "towerTerrainOpen";
} else if (tile === this.towerTerrainOccupied) {
return "towerTerrainOccupied";
} else if (tile === this.path) {
return "path";
} else if (tile === thi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function map_get_tile_type(map, x, y) {\n var pos = map_get_tile_at(map, x, y);\n return map.tiles[pos.row][pos.col];\n}",
"function get_terrain() {\n\tif (map[hero.row_coordinate][hero.column_coordinate].terrain == 1)\n \t\treturn \"Forest\";\n \telse if (map[hero.row_coordinate][hero.column_coor... | [
"0.72202706",
"0.68423724",
"0.6547326",
"0.640135",
"0.62936574",
"0.62354016",
"0.6210077",
"0.6210077",
"0.61934483",
"0.6174593",
"0.6119587",
"0.60726565",
"0.60601026",
"0.5990801",
"0.5990801",
"0.59854233",
"0.5960569",
"0.59545577",
"0.5902191",
"0.5876833",
"0.58463... | 0.78772634 | 0 |
Add all mouse event listeners needed for interaction with this level to HTML canvas. | implementMouseInteractions() {
// mouse click interactions
this.ctx.canvas.addEventListener("click", this.levelMouseClick, false);
// mouse move interactions
this.ctx.canvas.addEventListener("mousemove", this.levelMouseMove, false);
// mouse out interactions
this.ctx.canvas.addEventListener("m... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addMouseListeners() {\n // canvas events\n gCanvas.addEventListener('mousemove', onMove)\n gCanvas.addEventListener('mousedown', onDown)\n gCanvas.addEventListener('mouseup', onUp)\n}",
"function InitMouseEvents() {\r\n oCanvas.addEventListener('mousedown', MouseDownEvent, false);\r\n ... | [
"0.7576948",
"0.69956803",
"0.6949869",
"0.6927974",
"0.6843885",
"0.67480946",
"0.66748244",
"0.6663874",
"0.6600298",
"0.6575911",
"0.6572544",
"0.64565897",
"0.6420345",
"0.63993126",
"0.63718563",
"0.6368186",
"0.63621134",
"0.632705",
"0.6322506",
"0.63025516",
"0.626115... | 0.7771938 | 0 |
Remove all mouse event listeners associated with this Level object from the HTML canvas. | removeMouseInteractions() {
this.ctx.canvas.removeEventListener("click", this.levelMouseClick, false);
this.ctx.canvas.removeEventListener("mousemove", this.levelMouseMove, false);
this.ctx.canvas.removeEventListener("mouseout", this.levelMouseOut, false);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"remove() {\n if (this.canvas.removeEventListener) {\n this.canvas.removeEventListener('click', this.mouseEventHandler);\n this.canvas.removeEventListener('dblclick', this.mouseEventHandler);\n this.canvas.removeEventListener('keydown', this.keyEventHandler);\n thi... | [
"0.69800586",
"0.6912654",
"0.6874675",
"0.6864314",
"0.6812636",
"0.675924",
"0.671681",
"0.66321284",
"0.66228974",
"0.66052336",
"0.6581734",
"0.6581734",
"0.6560133",
"0.65320265",
"0.6526015",
"0.64993113",
"0.6492557",
"0.64882106",
"0.64634377",
"0.64168507",
"0.640509... | 0.831833 | 0 |
Remove a tower that is already placed on the map (happens only when 'Undo' user icon is successfully clicked on) Parameters: | removeTower(row, column) {
var gridTile = this.terrainGridTiles.getTile(row, column);
if ( gridTile === this.towerTerrainOccupied ) {
var towerTile = this.mapOfTowers[row][column].getTilePosition();
if (this.newestTower !== null) {
var tileOfNewestTower = this.newestTower.getTilePosition();
if ( tower... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static undo()\n {\n if(Action.stack.length == 0)\n {\n return;\n }\n\n let lastAction = Action.stack.pop();\n Action.undoAction(lastAction);\n Action.popped.push(lastAction);\n\n Notification.add(\"Undo: \" + lastAction.type);\n\n viewports[\"map\"].draw();\n }",
"function deleteOn... | [
"0.6420313",
"0.6340144",
"0.62824434",
"0.62816167",
"0.61776924",
"0.6166277",
"0.615957",
"0.61227006",
"0.61186767",
"0.6110382",
"0.6099802",
"0.6057942",
"0.60519856",
"0.60410565",
"0.60405177",
"0.6028517",
"0.5978769",
"0.5938812",
"0.5910092",
"0.59093964",
"0.58909... | 0.6804624 | 0 |
Return the tile grid that this level uses | getGrid() {
return this.terrainGridTiles;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static get TileSize() { return Level._tileSize; }",
"function getTILE(gridLoc) {\n\n return TILEs.iterate(\"id\", calcTILEId(gridLoc.x, gridLoc.y), Phaser.Group.RETURN_CHILD);\n\n}",
"getTileSetPath(){\n return this.allMaps[this.levelNr].tileset;\n }",
"getGrid () {\n return this.grid;\n ... | [
"0.6683024",
"0.6545154",
"0.6494509",
"0.6484193",
"0.64474285",
"0.64421827",
"0.64214396",
"0.63965565",
"0.63525176",
"0.63042414",
"0.6279503",
"0.62719893",
"0.6260897",
"0.6240459",
"0.6225612",
"0.6211034",
"0.61814505",
"0.6177297",
"0.61683345",
"0.61497205",
"0.614... | 0.82435286 | 0 |
Constructor for the LevelTerrainMap Parameter: | constructor(level) {
Object.assign(this, { level });
// The grid map array itself
this.mapArray = null;
this.xCanvas = this.level.xCanvas;
this.yCanvas = this.level.yCanvas;
// Number of tile rows and columns, the pixel length of each tile, and thickness of tile border
this.numOfTileRows = null;
t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Terrain(descr) {\n\n // Common inherited setup logic from Entity\n this.setup(descr);\n \n // get sprite:\n this.sprite = spriteManager.spriteTerrain(this.type);\n\n}",
"function Level(data) {\n this.map = data.map;\n this.height = data.map.length;\n this.width = data.map[0].length;\... | [
"0.6615391",
"0.65303636",
"0.6389145",
"0.635811",
"0.631936",
"0.63059545",
"0.6299554",
"0.6282543",
"0.6276454",
"0.6245586",
"0.6244777",
"0.6230719",
"0.61888987",
"0.6174096",
"0.616467",
"0.614832",
"0.61458504",
"0.6054491",
"0.5986587",
"0.5985654",
"0.5964733",
"... | 0.70992696 | 0 |
Initialize the grid map for the specified level. | initializeGridMap() {
if (this.level.mapLevel === 1) {
this.setLevelMapGridProperities(levelOneGrid); // 'levelOneGrid' from 'levelMapProperties.js'
} else if (this.level.mapLevel === 2) {
this.setLevelMapGridProperities(levelTwoGrid); // 'levelTwoGrid' from 'levelMapProperties.js'
} else if (this.level... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(level) {\n\t\tObject.assign(this, { level });\n\t\t\n\t\t// The grid map array itself\n\t\tthis.mapArray = null;\n\t\tthis.xCanvas = this.level.xCanvas;\n\t\tthis.yCanvas = this.level.yCanvas;\n\t\t\n\t\t// Number of tile rows and columns, the pixel length of each tile, and thickness of tile border\n\t... | [
"0.7664461",
"0.6882063",
"0.6726541",
"0.67104995",
"0.6559401",
"0.65371805",
"0.6534391",
"0.6397217",
"0.635206",
"0.63500834",
"0.62944454",
"0.62848866",
"0.6259131",
"0.62572044",
"0.6240614",
"0.6198635",
"0.6176791",
"0.6171916",
"0.61711985",
"0.6169984",
"0.6168916... | 0.8038362 | 0 |
Initialize the array that contains all the tiles in which the path changes direction on the tile grid, and that each tile contains the xy coordinates marking their tile center in which the enemy changes direction on Parameter: | initializePathTurns(tileTurns) {
// values used to calculate a square tile's center coordinates
var tileSideLength = this.level.drawScale * this.squareTileSidePixelLength;
var tileCenterOffset = tileSideLength / 2;
for (var i = 0; i < tileTurns.length; i++) {
var turnRow = tileTurns[i].row;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"populateCoordinates() {\n for (let col = 0; col < tileCount; col++) {\n this.coordinatesArray[col] = new Array(tileCount);\n }\n for (let col = 0; col < tileCount; col++) {\n for (let row = 0; row < tileCount; row++) {\n this.coordinatesArray[col][row] = row;\n }\n }\n }",
"ini... | [
"0.7039209",
"0.69030315",
"0.6867482",
"0.67254335",
"0.670936",
"0.67061645",
"0.66954124",
"0.66453284",
"0.6645164",
"0.6635023",
"0.6540838",
"0.6518256",
"0.65170866",
"0.6492383",
"0.6489711",
"0.6440946",
"0.64258575",
"0.64240766",
"0.642178",
"0.63660276",
"0.635246... | 0.6973776 | 1 |
Get the number of rows of the 2D terrain array | getNumOfRows() {
return this.numOfTileRows;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getNumberOfRows() {\n return Math.floor((window.innerHeight - 64 - 56) / 67);\n}",
"function countRows() {\n return GRID.length;\n}",
"function countRows() {\n return GRID.length;\n}",
"function dimension(cells) {\n var d = 0\n , max = Math.max\n for(var i=0, il=cells.length; i<il; ++i) {\n ... | [
"0.7149579",
"0.6492097",
"0.6492097",
"0.64872706",
"0.64872706",
"0.64872706",
"0.64872706",
"0.64872706",
"0.647356",
"0.64016426",
"0.6387707",
"0.6378025",
"0.6378025",
"0.6378025",
"0.6348322",
"0.6339673",
"0.63228345",
"0.63114136",
"0.6304862",
"0.6302699",
"0.629569... | 0.7066153 | 1 |
Get the number of columns of the 2D terrain array | getNumOfColumns() {
return this.numOfTileColumns;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dimension(cells) {\n var d = 0\n , max = Math.max\n for(var i=0, il=cells.length; i<il; ++i) {\n d = max(d, cells[i].length)\n }\n return d-1\n}",
"function dimension(cells) {\n var d = 0\n , max = Math.max\n for(var i=0, il=cells.length; i<il; ++i) {\n d = max(d, cells[i].length)\n }... | [
"0.6909868",
"0.6909868",
"0.6909868",
"0.6909868",
"0.6909868",
"0.68153596",
"0.68153596",
"0.68153596",
"0.6769704",
"0.67077863",
"0.64729965",
"0.6436647",
"0.63860047",
"0.6311386",
"0.6288256",
"0.6288256",
"0.62776077",
"0.6240246",
"0.62185067",
"0.6215335",
"0.61745... | 0.71723306 | 0 |
Return the value of a specific tile of the 2D terrain map array Parameters: | getTile(row, column) {
if ( row >= 0
&& row < this.getNumOfRows()
&& column >= 0
&& column < this.getNumOfColumns()
) {
return this.mapArray[row][column];
} else {
return "off_grid";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function map_get_tile_at(map, x, y) {\n var col = Math.floor(x / TILE_SIZE);\n var row = Math.floor(y / TILE_SIZE);\n return {row: row, col: col};\n}",
"function getTile(x,y,cellmod,rowmod){\n var rowmod = rowmod || 0,\n cellmod = cellmod || 0,\n row = Math.floor(y / tileHeight),\n ... | [
"0.70880353",
"0.70140606",
"0.69736516",
"0.69287956",
"0.6808805",
"0.67633945",
"0.6694046",
"0.6670488",
"0.6670488",
"0.6612005",
"0.656269",
"0.6557329",
"0.64894944",
"0.64894944",
"0.64886",
"0.6419621",
"0.64159226",
"0.64003825",
"0.6365596",
"0.63209206",
"0.631763... | 0.71186626 | 0 |
Set the value of a specific tile of the 2D terrain map array Parameters: | setTile(row, column, newValue) {
if (
row >= 0 &&
row < this.getNumOfRows() &&
column >= 0 &&
column < this.getNumOfColumns()
) {
this.mapArray[row][column] = newValue;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setTileAt(coord, value){\n this.messageToComponent(\"TileMap\", \"setTile\", {coord: coord, val: value});\n this.messageToComponent(\"Renderer\", \"markDirty\");\n }",
"alterMapTile(x,y,tid) {\n console.log(`alterMapTile(${x},${y},${tid}`);\n this.tilemap.setTile(Math.floor(x),Math.floor(y),... | [
"0.70817995",
"0.68036675",
"0.6647631",
"0.65524644",
"0.6524012",
"0.62622195",
"0.62179375",
"0.61994547",
"0.6190773",
"0.6126388",
"0.6119773",
"0.6074477",
"0.60581195",
"0.6044211",
"0.60314876",
"0.60051906",
"0.59918714",
"0.5988013",
"0.5980554",
"0.5879943",
"0.587... | 0.7429984 | 0 |
Return the tile that is marked the start tile on this tile grid | getStart() {
// Commented out 3/2/21 return this.startTile;
return this.startTiles;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getFirstTile(){\n\t\t\t\t\n\t\treturn g_objInner.children(\".ug-thumb-wrapper\").first();\n\t}",
"getStartingTile(title) {\n let splitRoom = title.split(\"_\");\n let roomNumber = Number(splitRoom[1]);\n let row = Math.floor(roomNumber / 10);\n let column = (roomNumber % 10) - 1;\n ... | [
"0.7166523",
"0.6876205",
"0.6661579",
"0.6661579",
"0.6495957",
"0.64183533",
"0.63126725",
"0.63126725",
"0.63078195",
"0.60664696",
"0.6056488",
"0.60464674",
"0.60394156",
"0.60173625",
"0.6009135",
"0.5994479",
"0.5976909",
"0.59581625",
"0.59386754",
"0.5919375",
"0.591... | 0.7757509 | 0 |
Return the tile that is marked the destination tile on this tile grid | getDestination() {
// Commented out 3/2/21 return this.destinationTile;
return this.destinationTiles;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTile(e) {\n var g = grid();\n var regExp = new RegExp(gm.tileRegexp());\n for (var i = 0; i < g.length; i++) {\n if (e) {\n var isInside = ((g[i][0] <= e.y) &&\n ((g[i][0] + 256) > e.y) &&\n (g[i][1] <= e.x) &&\n ... | [
"0.7072236",
"0.7072236",
"0.6962093",
"0.68080485",
"0.6756774",
"0.6756774",
"0.6638917",
"0.64786476",
"0.64386415",
"0.6292705",
"0.6281374",
"0.6156379",
"0.6152653",
"0.6151732",
"0.6137196",
"0.6038141",
"0.59861857",
"0.5973239",
"0.5891481",
"0.58862615",
"0.5883253"... | 0.72571945 | 0 |
Return the pixel length of the side of the grid tile | getSquareTileSidePixelLength() {
return this.squareTileSidePixelLength;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calculateTileDimensions() {\n tileW = canvas.width / tiles.length;\n tileH = canvas.height / tiles[0].length;\n}",
"function calculateSideLength(width, height, gridWidth, gridHeight){\n let boardWidth = (1.5*gridWidth)+1;\n let boardHeight = (2*Math.sin(Math.PI/3)*gridHeight)+(1.5*Math.sin(Mat... | [
"0.7511924",
"0.7479049",
"0.7425702",
"0.7266833",
"0.72029024",
"0.7121649",
"0.7118434",
"0.7090508",
"0.69644946",
"0.69181275",
"0.6876878",
"0.68301874",
"0.68264115",
"0.681158",
"0.68094206",
"0.66452956",
"0.6639068",
"0.66030425",
"0.65081954",
"0.6490941",
"0.64896... | 0.75708395 | 0 |
Return the pixel length of the side of the grid tile, but it is scaled to the map drawn on cavnas | getScaledSquareTilePixelLength() {
return this.squareTileSidePixelLength * this.level.drawScale;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calculateTileDimensions() {\n tileW = canvas.width / tiles.length;\n tileH = canvas.height / tiles[0].length;\n}",
"function width(tile)\n {\n var scale = Math.pow(2, coord.z - tile.z);\n return Math.ceil(scale * tileSize.w)+'px'; \n }",
"getSquareTileSidePixelLength() {\n r... | [
"0.7448012",
"0.732665",
"0.72029215",
"0.7116904",
"0.7017433",
"0.6856203",
"0.68485856",
"0.68118536",
"0.671262",
"0.6706929",
"0.6668828",
"0.6654922",
"0.6632892",
"0.65910596",
"0.6566613",
"0.65457946",
"0.6527981",
"0.6523667",
"0.64988315",
"0.6489402",
"0.648433",
... | 0.7805604 | 0 |
useOrgFeatures is a hook to subscribe to the current org feature set. | function useOrgFeatures() {
const [features, setFeatures] = useState();
const { orgRef } = useFirestore();
useEffect(() => {
if (!orgRef) return;
return orgRef.collection("features").onSnapshot((snapshot) => {
const newFeatures = {};
snapshot.docs.forEach((doc) => {
newFeatures[doc.i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setFeatures() {\n overwolf.games.events.setRequiredFeatures(g_interestedInFeatures, function(info) {\n if (info.status == \"error\") {\n //console.log(\"Could not set required features: \" + info.reason);\n //console.log(\"Trying in 2 seconds\");\n window.setTime... | [
"0.5197819",
"0.47405353",
"0.47397134",
"0.4728717",
"0.4684911",
"0.4684911",
"0.46797606",
"0.46364248",
"0.4631653",
"0.45722735",
"0.45691666",
"0.45691666",
"0.45589554",
"0.454756",
"0.4514013",
"0.45109838",
"0.45076355",
"0.44713318",
"0.44703895",
"0.446712",
"0.446... | 0.69658184 | 0 |
parse returns an object with a name and optional value if node contains an attribute string with ff name = the string after ff; ffset => name: 'set' & value = the value of attribute; ffset="foo=1" => value: 'foo=1' else if tagName is name = the type attribute surronded by []; => name: '[number]' else name = tagName ; =... | function parse() {
var attrs = $this[0] && $this[0].attributes,
result, name,
type = $this.attr("type"),
tagName = $this[0] && $this[0].tagName.toLowerCase();
$(attrs).each(function (i, elm) {
if (elm.name.substring(0, 3) === ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseTagAndAttrs(parts, pos) {\n var m = /^([-\\w:]+)/.exec(parts[pos]);\n var tag = {};\n tag.name = m[1].toLowerCase();\n tag.eflags = html4.ELEMENTS[tag.name];\n var buf = parts[pos].substr(m[0].length);\n // Find the next '>'. We optimistically assume this '>' is not in a\n // qu... | [
"0.64306617",
"0.64306617",
"0.64306617",
"0.64306617",
"0.64306617",
"0.64139825",
"0.6095918",
"0.6059825",
"0.6053659",
"0.60260385",
"0.59829813",
"0.5713101",
"0.56980026",
"0.5646993",
"0.5568728",
"0.5566557",
"0.5538493",
"0.5538493",
"0.553796",
"0.5525221",
"0.54917... | 0.7075055 | 0 |
Register schema configuration. As schema configuration object or as passing a function that acts as schema resolver. | registerSchema(config) {
if (_.isFunction(config)) {
this.schemaResolvers.push(config);
} else if (_.isObject(config)) {
validateSchemaConfig(config);
this.schemaConfigs[config.schema] = config;
} else {
throw new Error('Schema argument is invalid. Only object of function are allowed... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function registerSchema(schema) {\n Object(_metadata_MetadataStorage__WEBPACK_IMPORTED_MODULE_0__[\"getMetadataStorage\"])().addValidationSchema(schema);\n}",
"function GraphQLSchema(config) {\n _defineProperty(this, \"astNode\", void 0);\n\n _defineProperty(this, \"extensionASTNodes\", void 0);\n\n ... | [
"0.66183865",
"0.61187893",
"0.60234827",
"0.6003125",
"0.5758924",
"0.5738291",
"0.5706345",
"0.56943077",
"0.5616873",
"0.5616873",
"0.555799",
"0.5553956",
"0.55316067",
"0.55313915",
"0.55309033",
"0.55285925",
"0.5495804",
"0.5486239",
"0.5422649",
"0.54015577",
"0.53433... | 0.8274431 | 0 |
Register source type for data standardization. | registerSourceType(sourceType, standardizer) {
if (!_.isString(sourceType)) {
throw new Error('rio.registerSourceType sourceType argument must be string.');
}
if (_.isEmpty(sourceType)) {
throw new Error('rio.registerSourceType sourceType is empty.');
}
if (!_.isFunction(standardizer)) {... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function InputSource (name, type) {\n this.name = name;\n this.type = type;\n}",
"function getDataSourceType(dataSource) {\n if (typeof dataSource === 'string') {\n return '';\n }\n return 'match' in dataSource ? 'rdfjsSource' : dataSource.type;\n}",
"function registerMutableSourceForHydratio... | [
"0.53540546",
"0.51830393",
"0.5138609",
"0.50784326",
"0.50784326",
"0.50784326",
"0.50600255",
"0.50300217",
"0.50300217",
"0.50300217",
"0.50300217",
"0.50300217",
"0.50300217",
"0.50300217",
"0.50300217",
"0.50300217",
"0.50300217",
"0.50300217",
"0.50300217",
"0.50300217",... | 0.64687157 | 0 |
Get standardizer function based on source type. | getStandardizer(sourceType) {
if (!_.isString(sourceType)) {
throw new Error('rio.getStandardizer sourceType argument must be string.');
}
if (_.isEmpty(sourceType)) {
throw new Error('rio.getStandardizer sourceType is empty.');
}
return this.standardizers[sourceType];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getFilterFunction(filter) {\n\t if (typeof filter === \"function\") {\n\t return filter;\n\t }\n\t switch (filter) {\n\t case \"fuzzy\":\n\t return fuzzyFilter;\n\t case \"case-insensitive\":\n\t return caseInsensitiveFilter;\n\t case \"none\":\n\... | [
"0.5538918",
"0.5060606",
"0.5060606",
"0.5060606",
"0.505698",
"0.5045803",
"0.5041071",
"0.50217235",
"0.50217235",
"0.49530658",
"0.49530658",
"0.49530658",
"0.49530658",
"0.49530658",
"0.49530658",
"0.49530658",
"0.49530658",
"0.49530658",
"0.4867477",
"0.4845795",
"0.482... | 0.66607666 | 0 |
Set instance of configured denormalizer used for denormalization with Rio. | setDenormalizer(denormalizer) {
this.denormalizer = denormalizer;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_initDenormalization() {\n if (!this.linkConfig.denormalize || !Meteor.isServer) {\n return;\n }\n\n const packageExists = !!Package['herteby:denormalize'];\n if (!packageExists) {\n throw new Meteor.Error(\n 'missing-package',\n `Plea... | [
"0.55962014",
"0.5148853",
"0.492499",
"0.44534934",
"0.43070024",
"0.42124617",
"0.41777036",
"0.41673008",
"0.41498947",
"0.4095753",
"0.4065928",
"0.405801",
"0.40447655",
"0.40387562",
"0.40241674",
"0.4003126",
"0.39730772",
"0.39673755",
"0.39595735",
"0.3955428",
"0.39... | 0.8129397 | 0 |
Clears registered collections and resolvers | clear() {
this.schemaConfigs = {};
this.schemaResolvers = [];
this.schemaPaths = {};
this.denormalizer = null;
this.standardizers = {};
// Default standardizer for json-api
this.registerSourceType(JSON_API_SOURCE, transform);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearCollections() {\n for (var collection in mongoose.connection.collections) {\n mongoose.connection.collections[collection].remove(function () {});\n }\n }",
"clear () {\n\t\tthis.lookups = [];\n\t}",
"function clear() {\n blueprintDictionary.clear();\n ... | [
"0.70520884",
"0.6855826",
"0.6829144",
"0.6731087",
"0.6723643",
"0.6665197",
"0.6636481",
"0.6607649",
"0.6607649",
"0.65559816",
"0.65524673",
"0.6550483",
"0.64961225",
"0.6419688",
"0.63877356",
"0.6384773",
"0.6375355",
"0.6352226",
"0.6326135",
"0.6319792",
"0.63147986... | 0.69249 | 1 |
Optimize Slider Image BG | function optimizeSliderImageBG() {
$(".slider-img-bg").each(function () {
var imgHeight = $(this)
.closest("div")
.height();
if ($(".banner-parallax").children(".banner-slider").length > 0) {
$(".banner-parallax").height($(".banner-slider").height());
}
$(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function optimizeSliderImageBG() {\n\t$( \".slider-img-bg\" ).each( function() {\n\t\tvar imgHeight = $( this ).closest( \"div\" ).height();\n\n\t\tif ( $( \".banner-parallax\" ).children( \".banner-slider\" ).length > 0 ) {\n\t\t\t$( \".banner-parallax\" ).height( $( \".banner-slider\" ).height() );\n\t\t}\n\n\t\... | [
"0.7177315",
"0.7132965",
"0.7044285",
"0.70205444",
"0.70054406",
"0.70054406",
"0.68095607",
"0.6617858",
"0.6582026",
"0.6566388",
"0.6551024",
"0.65425897",
"0.6491693",
"0.64909273",
"0.64411014",
"0.6436186",
"0.64273953",
"0.63827366",
"0.6378544",
"0.63336456",
"0.633... | 0.7187813 | 0 |
picks a random response for the chatbot to use. | function randResponse() {
var r = Math.floor(Math.random() * 11);
reply = '';
switch (r) {
case 0:
reply =
'In the evening I finished reading a book, and because I was feeling so alone, I buried the book on the edge of the forest with a borrowed spade';
break;
case 1:
re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getRandomAnswer() {\n var randomIndex = Math.floor(Math.random() * responses.length);\n var randomElement = responses[randomIndex];\n return randomElement;\n}",
"function randomMsg() {\r\n /*establish possible replies*/\r\n var choices = ['if you say so', 'oh really?', 'cool, cool', 'okay, then', '... | [
"0.77199805",
"0.7493016",
"0.74402267",
"0.7131997",
"0.7010418",
"0.6898502",
"0.6790162",
"0.6727226",
"0.67031246",
"0.67003405",
"0.66680866",
"0.6624455",
"0.66214347",
"0.6597012",
"0.6527545",
"0.64863205",
"0.6453673",
"0.63022536",
"0.62770265",
"0.62467974",
"0.624... | 0.76841545 | 1 |
Creates a new Object3D with the mesh corresponding to the card we scanned. | function createObject()
{
scannedCard = getCardDetails();
//var mat = new THREE.MeshStandardMaterial( {color: 0xffffff });
var mat = new THREE.MeshBasicMaterial({color: scannedCard.color});
mat.wireframe = true;
// Creating a FBX Model Loader object in prerperation for loading a mesh
var loader = new THREE.FBXL... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"init (asset) {\n let name = asset || this.asset || 'default';\n let mesh = objects[name].clone();\n mesh.position.set(this.x, this.y, this.z);\n this.obj = mesh;\n return mesh;\n }",
"createDuck (){\n let duck = new THREE.Object3D();\n duck.cabeza = new THREE.M... | [
"0.6871864",
"0.6573803",
"0.65668666",
"0.63536465",
"0.63206273",
"0.6307186",
"0.62736565",
"0.6202152",
"0.6154371",
"0.6149038",
"0.6145178",
"0.614198",
"0.6079019",
"0.5972696",
"0.5963459",
"0.5945487",
"0.5924363",
"0.59168464",
"0.5903523",
"0.5888281",
"0.58858776"... | 0.71584713 | 0 |
Retrieves the card details from the cardData JSON. | function getCardDetails()
{
var match;
var i;
// Here we now want to look up which model we want to display. This will be done
// by loading the JSON file containing all of the data for the cards in the future.
// For now we just use an if statement.
const urlParam = new URLSearchParams(window.location.search);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"card() {\n return this.mu.http.get('/card')\n .then(res => this._getRes(res, this._setCard))\n .catch(() => this._setCard(null));\n }",
"function getJSONCard() {\n httpGet('http://localhost:3000/cards', function(response) {\n cards = JSON.parse(response);\n setColCards();\n });\... | [
"0.68914527",
"0.6874665",
"0.65133536",
"0.6499392",
"0.6437429",
"0.6428913",
"0.64257807",
"0.63880783",
"0.6336013",
"0.6281167",
"0.62719184",
"0.6182157",
"0.61403036",
"0.61288226",
"0.61288226",
"0.6113639",
"0.61028963",
"0.60888714",
"0.6059068",
"0.60524017",
"0.60... | 0.7023846 | 0 |
update function will update the gameState in the database to a value passed to it inside the () | update(state) {
database.ref('/').update({ gameState: state })
gameState = state;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function update(state)\r\n{\r\nย database.ref('/').update({\r\nย ย gameState:stateย })\r\n}",
"update(state) {\r\n database.ref('/').update({\r\n gameState: state\r\n });\r\n }",
"update(state){\r\n database.ref('/').update({\r\n gameState:state\r\n });\r\n }",
... | [
"0.82696104",
"0.81301796",
"0.81038666",
"0.81037223",
"0.7967368",
"0.7921133",
"0.7916742",
"0.7898354",
"0.7877424",
"0.78312004",
"0.7826438",
"0.77993304",
"0.7774008",
"0.7742384",
"0.7739639",
"0.7706597",
"0.76287234",
"0.76080865",
"0.75326675",
"0.741014",
"0.73284... | 0.8323971 | 0 |
Go to forgot PIN page, if user clicks on "Forgot the PIN" | function goToForgotPin () {
$state.go('^.forgot-pin')
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function forgotPass() {\n\twindow.location.href= \"/forgot\"\n}",
"function forgotPassword() {\n var username = $('#username').val();\n var url = 'http://cryogen.live/recover';\n if (username)\n url += '?username=' + username;\n shell.openExternal(url);\n }",
"function... | [
"0.7296711",
"0.6949318",
"0.68283206",
"0.6775386",
"0.6573687",
"0.6432813",
"0.6343463",
"0.6322598",
"0.62795",
"0.6277329",
"0.6230158",
"0.619205",
"0.61577696",
"0.6094136",
"0.60790765",
"0.6002614",
"0.5999428",
"0.5977487",
"0.59688145",
"0.59553933",
"0.5932276",
... | 0.7945934 | 0 |
Handles users opening text bubbles | function openBubble(position, text){
if(!bubble){
bubble = new H.ui.InfoBubble(
position,
{content: text});
ui.addBubble(bubble);
} else {
bubble.setPosition(position);
bubble.setContent(text);
bubble.open();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function OpenPopupInTextPage($link, $this) {\n\t\t$dialogText.dialog({\n \tautoOpen: false,\n \tappendTo: \".container\",\n \tposition: { my: \"right-30\", at: \"right\", of: window },\n \tcloseText: \"x\",\n \tmodal: true,\n \twidth: $popWidth,\n\t \t});\n\t \t$dialogText.load($link + \" .contai... | [
"0.6237427",
"0.6041114",
"0.60154957",
"0.60094863",
"0.58524615",
"0.5771907",
"0.57396996",
"0.5736775",
"0.57006127",
"0.56758386",
"0.56576127",
"0.5626944",
"0.55736864",
"0.55352867",
"0.55241054",
"0.54688907",
"0.54420936",
"0.5430429",
"0.54234236",
"0.5411397",
"0.... | 0.69348454 | 0 |
Return the nearby locations in the desired category | function placesNearby(center, category, radius) {
var explore = new H.places.Explore(platform.getPlacesService());
var params = {
'cat': category,
'in': center + ";r=" + radius.toString()
};
explore.request(params, {}, onResult, onError);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function searchForEntries () {\n // calculate bounds to search for\n if (userLocation.map.getBounds() !== undefined) {\n var bounds = userLocation.map.getBounds();\n var max_lat = bounds.getNorthEast().lat().toFixed(10);\n var max_lon = bounds.getNorthEast().lng().toFixed(10);\n v... | [
"0.6125377",
"0.61109513",
"0.602024",
"0.600719",
"0.6001111",
"0.59810644",
"0.5947271",
"0.5905314",
"0.5896621",
"0.58954436",
"0.589326",
"0.589326",
"0.5892198",
"0.58503413",
"0.58164066",
"0.5808901",
"0.5799005",
"0.5796794",
"0.5775351",
"0.5773294",
"0.5762097",
... | 0.6644185 | 0 |
Draw the route obtained by the routing on the map | function drawRoute(result) {
var route = result.response.route[0];
console.log(route);
meetingPointCoords = result.response.route[0].shape[Math.floor(route.shape.length/2)];
console.log(meetingPointCoords);
var meetingPointCoordsS = meetingPointCoords.split(",");
meetingPoint = {lat: meetingPointCoordsS[0],... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"renderRoute(start, end) {\n //const map = this.state.map;\n //var canvas = map.getCanvasContainer();\n\n //canvas.style.cursor = '';\n\n //this.labelPoint('start', start);\n //this.labelPoint('end', end);\n\n this.requestRoute(start, end, false);\n }",
"function drawRouteToCurPos(from, to) {\n... | [
"0.7426915",
"0.73392034",
"0.7239106",
"0.72134817",
"0.7181655",
"0.7106274",
"0.6995657",
"0.69782203",
"0.6964762",
"0.6961389",
"0.6959547",
"0.69382095",
"0.6935126",
"0.69053483",
"0.6879117",
"0.68731403",
"0.68718827",
"0.6864324",
"0.68084943",
"0.6800879",
"0.68004... | 0.73696357 | 1 |
Check for required access when application bootstraps | function checkAccessDuringApplicationBootstrap(auth, authomator){
if(auth.isLoggedIn()){
return;
}
if(!authomator.getAccessToken()){
auth.redirectToLoginPage();
throw new Error('No access token, redirect to login');
}
if(!authomator.getIdentityToken()){
auth.redirectToLogi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _initApp(){\n\t\t\tconsole.log('[ app_logic.js ] : ' + 'initiating app ..'); // debug message > app is launching\n\t\t\t_check_modules(); // check if the necessary modules are present\n\t\t\t_initial_setup_app_init(); // actually init the app's 'initial setup' config/params (..)\n\t\t\t\n\t\t}",
"functi... | [
"0.5986111",
"0.58604527",
"0.5858179",
"0.578486",
"0.5747272",
"0.57090074",
"0.56861025",
"0.56844145",
"0.5672877",
"0.5671833",
"0.563283",
"0.55989945",
"0.55986005",
"0.5544603",
"0.55438554",
"0.55321175",
"0.55284905",
"0.5519144",
"0.5517983",
"0.5500888",
"0.550065... | 0.6468265 | 0 |
for POSTing raw code snippets new Snippet("rnorm(100)") | function Snippet(code){
this.code = code || "NULL";
this.getCode = function(){
return code;
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Snippet(code) {\n this.code = code || \"NULL\";\n\n this.getCode = function () {\n return code;\n };\n }",
"function Snippets() {}",
"createSnippet() {\r\n var snippet = this.newInstance();\r\n var snippetContainer = snippet.create({\r\n type: 'container',\r\n id: Docume... | [
"0.71877897",
"0.6955721",
"0.67424726",
"0.62130547",
"0.6187917",
"0.61679107",
"0.6074334",
"0.5984828",
"0.5861586",
"0.58493954",
"0.57710737",
"0.5694238",
"0.56632304",
"0.56295764",
"0.5597181",
"0.5594109",
"0.5588385",
"0.5561445",
"0.5560425",
"0.55516285",
"0.5543... | 0.7251092 | 0 |
for POSTing files new Upload($('file')[0].files) | function Upload(file){
if(file instanceof File){
this.file = file;
} else if(file instanceof FileList){
this.file = file[0];
} else if (file.files instanceof FileList){
this.file = file.files[0];
} else if (file.length > 0 && file[0].files instanceof FileList){
this.file ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clickUploadFile() {\n console.log(\"Upload file\")\n var myfile = document.getElementById(\"myfile\")\n\n let file = myfile.files\n console.log(file)\n upload_files(file)\n}",
"handleFileUpload(){\n\t this.file = this.$refs.file.files[0];\n\t }",
"function Upload(file) {\n ... | [
"0.7053882",
"0.70266175",
"0.6964183",
"0.6687411",
"0.6685011",
"0.66745806",
"0.6667389",
"0.6641309",
"0.66343796",
"0.65993",
"0.6591979",
"0.658189",
"0.65764564",
"0.6554266",
"0.6540921",
"0.6537217",
"0.6529356",
"0.6497749",
"0.64340985",
"0.6432679",
"0.64324796",
... | 0.7055077 | 0 |
call function using url encoding needs to wrap arguments in quotes, etc | function r_fun_call_urlencoded(fun, args, handler){
var data = {};
$.each(args, function(key, val){
data[key] = stringify(val);
});
return r_fun_ajax(fun, {
data: $.param(data)
}, handler);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function r_fun_call_urlencoded(fun, args, handler) {\n var data = {};\n $.each(args, function (key, val) {\n data[key] = stringify(val);\n });\n return r_fun_ajax(fun, {\n data: $.param(data)\n }, handler);\n }",
"UrlEncode() {}",
"function runWithString(argument)\n{\n LaunchBar.op... | [
"0.6923885",
"0.61623573",
"0.5972597",
"0.5829922",
"0.5829922",
"0.5829922",
"0.58149654",
"0.5770495",
"0.5760604",
"0.57264817",
"0.5681771",
"0.56708723",
"0.56708723",
"0.56708723",
"0.56708723",
"0.56708723",
"0.56708723",
"0.55976635",
"0.5564055",
"0.55496776",
"0.55... | 0.6864507 | 1 |
call a function using multipart/formdata use for file uploads. Requires HTML5 | function r_fun_call_multipart(fun, args, handler){
testhtml5();
var formdata = new FormData();
$.each(args, function(key, value) {
formdata.append(key, stringify(value));
});
return r_fun_ajax(fun, {
data: formdata,
cache: false,
contentType: false,
processDat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function r_fun_call_multipart(fun, args, handler) {\n testhtml5();\n var formdata = new FormData();\n $.each(args, function (key, value) {\n formdata.append(key, stringify(value));\n });\n return r_fun_ajax(fun, {\n data: formdata,\n cache: false,\n contentType: false,\n pro... | [
"0.7951697",
"0.667862",
"0.6614455",
"0.6604098",
"0.65787977",
"0.65294206",
"0.64585304",
"0.6444086",
"0.6408711",
"0.63700485",
"0.63677824",
"0.63400996",
"0.6336377",
"0.625473",
"0.6246367",
"0.6219329",
"0.6217145",
"0.6207294",
"0.61695683",
"0.6138998",
"0.61353266... | 0.80613977 | 0 |
mute all events except the one selected | function muteAllEvents(e) {
e.preventDefault();
var $this = $(this);
var eventType = $this.data('event');
App.Timeline.filter = [];
App.Timeline.coll.reset();
App.Timeline.exclusive = eventType;
if (App.Timeline.filter.indexOf(eventType) == -1) {
App.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function muteEvent(e) {\n e.preventDefault();\n var $this = $(this);\n var eventType = $this.data('event');\n\n App.Timeline.exclusive = '';\n if (App.Timeline.filter.indexOf(eventType) == -1) {\n App.Timeline.coll.add({name: eventType});\n App.Timeline.filt... | [
"0.71462965",
"0.68543565",
"0.67452043",
"0.664832",
"0.65986717",
"0.6540882",
"0.640193",
"0.6392957",
"0.632146",
"0.6285012",
"0.6282143",
"0.627855",
"0.6251363",
"0.62458",
"0.6222472",
"0.620305",
"0.61939454",
"0.61716866",
"0.6132433",
"0.6130507",
"0.60407335",
"... | 0.76120585 | 0 |
delete artist page function | function deleteArtistPage(songId) {
var remove = confirm("Do you really want to delete this muscian/band page?");
if (remove == true) {
var a = document.createElement("a");
a.href = "/removeArtistsPage/" + songId + "/" + theToken;
document.body.appendChild(a);
a.click();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteArtist(liID)\r\n{\r\n console.log(\"Lewis is barking from the delete artist fucntion\");\r\n document.getElementById(liID).remove();\r\n \r\n}",
"function deleteArtist(ulID)\n{\n console.log(\"Lewis is barking from the delete artist fucntion\");\n document.getElementById(ulID).remov... | [
"0.71503633",
"0.70377964",
"0.6796711",
"0.67852986",
"0.67378724",
"0.6301912",
"0.62532246",
"0.62000763",
"0.618396",
"0.61285543",
"0.6083242",
"0.60780066",
"0.60617024",
"0.59858817",
"0.597985",
"0.59137267",
"0.5902474",
"0.5896252",
"0.5877428",
"0.5874958",
"0.5871... | 0.7562836 | 0 |
The connection is idling. Sends a NOOP or IDLE command IDLE details: | enterIdle () {
if (this._enteredIdle) {
return
}
const supportsIdle = this._capability.indexOf('IDLE') >= 0
this._enteredIdle = supportsIdle && this._selectedMailbox ? 'IDLE' : 'NOOP'
this.logger.debug('Entering idle with ' + this._enteredIdle)
if (this._enteredIdle === 'NOOP') {
th... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_onIdle () {\n if (!this._authenticated || this._enteredIdle) {\n // No need to IDLE when not logged in or already idling\n return\n }\n\n this.logger.debug('Client started idling')\n this.enterIdle()\n }",
"breakIdle () {\n if (!this._enteredIdle) {\n return\n }\n\n clearTim... | [
"0.6015927",
"0.60143125",
"0.5872493",
"0.57432896",
"0.5510531",
"0.5476193",
"0.5455166",
"0.5407002",
"0.5381195",
"0.5361057",
"0.5360488",
"0.5360488",
"0.53388196",
"0.53026676",
"0.530113",
"0.5276758",
"0.52750844",
"0.52557087",
"0.5250478",
"0.5245669",
"0.5241451"... | 0.6903407 | 0 |
Stops actions related idling, if IDLE is supported, sends DONE to stop it | breakIdle () {
if (!this._enteredIdle) {
return
}
clearTimeout(this._idleTimeout)
if (this._enteredIdle === 'IDLE') {
this.client.send('DONE\r\n')
this.logger.debug('Idle terminated')
}
this._enteredIdle = false
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"done() {\n this.action.stop();\n }",
"function stop(id) {\r\n id(false);\r\n}",
"function stop(id) {\r\n id(false);\r\n}",
"function stop(id) {\r\n id(false);\r\n}",
"function stop(id) {\r\n id(false);\r\n}",
"function stop(id) {\n id(false);\n}",
"function stop(id) {\n id(f... | [
"0.6745595",
"0.6257953",
"0.6257953",
"0.6257953",
"0.6257953",
"0.6219211",
"0.6219211",
"0.6219211",
"0.6219211",
"0.6219211",
"0.6219211",
"0.6219211",
"0.6219211",
"0.6219211",
"0.6219211",
"0.6219211",
"0.6219211",
"0.6219211",
"0.6166694",
"0.6159913",
"0.6134449",
"... | 0.6601029 | 1 |
Private helpers Indicates that the connection started idling. Initiates a cycle of NOOPs or IDLEs to receive notifications about updates in the server | _onIdle () {
if (!this._authenticated || this._enteredIdle) {
// No need to IDLE when not logged in or already idling
return
}
this.logger.debug('Client started idling')
this.enterIdle()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function connectionID() {\n socket.emit(\"start-game\", socket.id);\n console.log(\"connected to \" + URI);\n}",
"function synch_connection_start( ajax )\n{\n\tjQuery('#connections-synch-status').html( 'Synching each Connection.' );\n}",
"function check_connection_start( ajax )\n{\n\tjQuery('#connections... | [
"0.6033949",
"0.5897896",
"0.58765364",
"0.5824994",
"0.57433605",
"0.5710961",
"0.5710961",
"0.5679729",
"0.56485176",
"0.5632477",
"0.5632477",
"0.5632477",
"0.5632477",
"0.5626397",
"0.5626397",
"0.5626397",
"0.5626397",
"0.5626397",
"0.5626397",
"0.5626397",
"0.5626397",
... | 0.7090292 | 0 |
'public' function to bind an import handler to a filetype (i.e., suffix, including '.', e.g., .css, .js | function addImportHandler(fileType, handler) {
importHandlers[fileType] = handler
} // addImportHandler(fileType, handler) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dispatchImportHandler(url) {\n\t\tvar returnValue\n\t\tvar absurl = composeURL(url)\n\t\tvar fileSuffix = absurl.substring(absurl.lastIndexOf('.'))\n\t\tvar importHandler = importHandlers[fileSuffix]\n\t\tif (importHandler) {\n\t\t\tloadpath.unshift(directory(absurl))\t// push new loadpath\n\t\t\treturnVa... | [
"0.670887",
"0.63316464",
"0.63316464",
"0.63316464",
"0.63316464",
"0.62633336",
"0.58350855",
"0.5652479",
"0.56008905",
"0.56008905",
"0.56008905",
"0.56008905",
"0.56008905",
"0.56008905",
"0.56008905",
"0.56008905",
"0.56008905",
"0.56008905",
"0.56008905",
"0.56008905",
... | 0.7462896 | 0 |
'public' function to select import handler based on URL suffix, and call it also handles relative URL semantics using composeURL and loadpath returns HTML string (possibly an error report) for inclusion in document | function dispatchImportHandler(url) {
var returnValue
var absurl = composeURL(url)
var fileSuffix = absurl.substring(absurl.lastIndexOf('.'))
var importHandler = importHandlers[fileSuffix]
if (importHandler) {
loadpath.unshift(directory(absurl)) // push new loadpath
returnValue = importHandler.call(null... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"resolveImport(url, fromImport, checkDirectory) {\n let stylesheetPath;\n try {\n stylesheetPath = (0, node_url_1.fileURLToPath)(url);\n }\n catch {\n // Only file protocol URLs are supported by this importer\n return null;\n }\n const direc... | [
"0.545322",
"0.54077274",
"0.5324816",
"0.53154343",
"0.5301293",
"0.52814484",
"0.515186",
"0.5133089",
"0.5085218",
"0.50679725",
"0.50504214",
"0.49798942",
"0.49644306",
"0.49574426",
"0.49563748",
"0.4937506",
"0.4920908",
"0.4903162",
"0.490165",
"0.48947144",
"0.486867... | 0.67184985 | 0 |
Event o route user to payment page | proceedToPay () {
this.$router.push({ path: 'payment' })
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onPaymentsClick_() {\n Router.getInstance().navigateTo(routes.PAYMENTS);\n }",
"function mypayment() {\n location.href = \"#pay\";\n}",
"finishPay() {\n let payLink = Cache.get(\"payLink\", \"user/balance\");\n this.context.router.push(payLink);\n }",
"function payNow() {\n window.location.h... | [
"0.77874607",
"0.7075465",
"0.6857",
"0.6855216",
"0.6732482",
"0.65960294",
"0.6586172",
"0.6373387",
"0.63662237",
"0.6338675",
"0.6330243",
"0.63260853",
"0.63179755",
"0.62536484",
"0.6237071",
"0.6221932",
"0.6214156",
"0.6166095",
"0.615459",
"0.6120824",
"0.61083883",
... | 0.7240014 | 1 |
show alert for each menu item click | OnMenuClick(title) {
NavigationService.ShowAlert({
message: `You clicked ${title}!`,
confirmButtonText: "Okay",
showDeclineButton: false,
svgImage: AlertSVG,
cancelable: true,
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleMenuClick(e) {\n message.info(\"Click on menu item.\");\n console.log(\"click\", e);\n}",
"_handleClickItem (item) {\n // Make necessary calls to do w/e you want when clicking on item identified by id\n isDevMode() && alert(\"clicked on item: \" + item.title);\n }",
"itemC... | [
"0.69389856",
"0.65296906",
"0.6396776",
"0.6369739",
"0.6356331",
"0.6275903",
"0.6275299",
"0.6256151",
"0.6219059",
"0.61705214",
"0.61606175",
"0.6138595",
"0.6123593",
"0.607373",
"0.6067855",
"0.6061423",
"0.6006235",
"0.60012394",
"0.5988044",
"0.5963951",
"0.5956289",... | 0.66140723 | 1 |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Public Functions XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX create static SVG code this includes the actual data param | type | desc data_id | Number | ID of the dataset to visualize cols | Number | ID of the column to be mapped on the columns (xaxis) rows | Number | ID of the column to b... | async function getStaticSVG( document, d3, param ) {
// augment with default parameters
const usedParam = Object.assign( {
'id': ('Rows' + Date.now()),
'width': 960,
'height': 500,
}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static svg (){\r\n\t\treturn new ExampleData(\"exampleDataSvg.jsonld\");\r\n\t}",
"function info_makeSvg(id, width, height, frame) {\n info_clearSvg(id);\n var newSvg = d3.select(\"#\" + id)\n .append(\"svg\")\n .attr(\"width\", width + 2 * frame)\n .attr(\"height\", height + 2 * frame... | [
"0.63301283",
"0.60290545",
"0.5765295",
"0.5736266",
"0.5711281",
"0.570945",
"0.56319994",
"0.5622233",
"0.5608158",
"0.5582663",
"0.54995555",
"0.5495592",
"0.54640377",
"0.54607147",
"0.5459892",
"0.54525304",
"0.5420654",
"0.5408131",
"0.53939843",
"0.5393633",
"0.537970... | 0.6558961 | 0 |
This function maps each item in the array to the Listing component declared above. | listingList()
{
return this.state.listings.map( function( currentListing, i )
{
return <Listing listing={ currentListing } key={ i } />;
} );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"listParser(ings){\n var z=ings.map(i=>{\n return(\n <li className=\"list-group-item\">{i}</li>\n )\n })\n return z;\n }",
"makeList() {\r\n return this.state.items.map((value, i) => (\r\n <li \r\n className=\"list-group-item\" \r\n key={... | [
"0.6054188",
"0.58881336",
"0.58837205",
"0.5876675",
"0.57665664",
"0.5741154",
"0.56804836",
"0.56548214",
"0.5636625",
"0.56158954",
"0.5578785",
"0.555653",
"0.5554377",
"0.5541625",
"0.55179316",
"0.54863566",
"0.54665256",
"0.545251",
"0.54510915",
"0.5446639",
"0.54290... | 0.6722958 | 0 |
change f into int, remove Decimal. just for code compression | function toInt(f) {
return parseInt(f);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toInt (f) {\n return parseInt(f, 10)\n}",
"function tempConvert(f){\n return (f - 32) * 5/9\n}",
"function f_int(x) {\n return +x;\n}",
"function int(float) {\n return Math.floor(float);\n}",
"function fnum(x){\r\n if(isNaN(x)) return x;\r\n \r\n if(Math.abs(x) < 999){\r\n ... | [
"0.71914136",
"0.70064926",
"0.66129124",
"0.6491262",
"0.6413636",
"0.63760346",
"0.634069",
"0.6229746",
"0.6214608",
"0.619719",
"0.6187817",
"0.6171064",
"0.61197203",
"0.61064243",
"0.6093217",
"0.6093217",
"0.60705584",
"0.60684484",
"0.6039414",
"0.5998416",
"0.5983304... | 0.7430209 | 0 |
format the diff second to time ago, with setting locale | function formatDiff(diff, locale, defaultLocale) {
// if locale is not exist, use defaultLocale.
// if defaultLocale is not exist, use build-in `en`.
// be sure of no error when locale is not exist.
locale = locales[locale] ? locale : (locales[defaultLocale] ? defaultLocale : 'en');
// if (! lo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formatDiff (diff, locale) {\n // if locale is not exist, use defaultLocale.\n // if defaultLocale is not exist, use build-in `en`.\n // be sure of no error when locale is not exist.\n locale = locales[locale] ? locale : 'zhCN'\n // if (! locales[locale]) locale = defaultLocale;\n let i = 0\n const ... | [
"0.762765",
"0.6790543",
"0.6700358",
"0.66630286",
"0.66630286",
"0.66630286",
"0.66630286",
"0.66630286",
"0.66630286",
"0.6631077",
"0.6544884",
"0.6497682",
"0.64587945",
"0.6423418",
"0.6417144",
"0.6412986",
"0.6381963",
"0.6381109",
"0.6381109",
"0.6381109",
"0.6381109... | 0.7251918 | 1 |
calculate the diff second between date to be formated an now date. | function diffSec(date, nowDate) {
nowDate = nowDate ? toDate(nowDate) : new Date();
return (nowDate - toDate(date)) / 1000;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"dateDiff(first, second) {\n const firstDate = new Date(first.getFullYear(), first.getMonth(), first.getDate(), 0, 0, 0)\n const secondDate = new Date(second.getFullYear(), second.getMonth(), second.getDate(), 0, 0, 0)\n return Math.round((secondDate-firstDate)/(1000*60*60*24))\n }",
"function diffSec (... | [
"0.71086776",
"0.7055621",
"0.69730854",
"0.69729376",
"0.6824059",
"0.6816694",
"0.6601878",
"0.65542716",
"0.65292084",
"0.6496749",
"0.639293",
"0.6387788",
"0.6318836",
"0.62749934",
"0.62108606",
"0.61923224",
"0.6171616",
"0.61591613",
"0.6145158",
"0.60865545",
"0.6085... | 0.75267977 | 0 |
nextInterval: calculate the next interval time. diff: the diff sec between now and date to be formated. What's the meaning? diff = 61 then return 59 diff = 3601 (an hour + 1 second), then return 3599 make the interval with high performace. | function nextInterval(diff) {
var rst = 1, i = 0, d = Math.abs(diff);
for (; diff >= SEC_ARRAY[i] && i < SEC_ARRAY_LEN; i++) {
diff /= SEC_ARRAY[i];
rst *= SEC_ARRAY[i];
}
// return leftSec(d, rst);
d = d % rst;
d = d ? rst - d : rst;
return Math.ceil(d);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getNextInterval(){\n\t//find the next valid time interval\n\tfor(INTERVAL_NODE = INTERVAL_NODE.next(); INTERVAL_NODE.length != 0; INTERVAL_NODE = INTERVAL_NODE.next()){\n\t\tif(checkValidInput(INTERVAL_NODE.children(\".iHours\").val()) != \"0\" ||\n\t\t checkValidInput(INTERVAL_NODE.children(\".iMinutes... | [
"0.55143166",
"0.51938397",
"0.50996506",
"0.5039604",
"0.50200504",
"0.50033855",
"0.49567392",
"0.49153408",
"0.49036062",
"0.48135027",
"0.47860578",
"0.478329",
"0.47430474",
"0.4734846",
"0.4734846",
"0.46819654",
"0.463546",
"0.46219623",
"0.46017632",
"0.45741993",
"0.... | 0.7363193 | 0 |
get the datetime attribute, jQuery and DOM | function getDateAttr(node) {
if(node.dataset.timeago) return node.dataset.timeago;
if (node.getAttribute) return node.getAttribute(ATTR_DATETIME);
if(node.attr) return node.attr(ATTR_DATETIME);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _captureDate($this) {\n var date = new Date($this.attr(\"datetime\"));\n\n day = date.getDate();\n month = date.getMonth();\n year = date.getFullYear();\n }",
"function dateFromAttributes() {\n return ovationDate(attr.date);\n }",
"function itemDate() {\n const i... | [
"0.67556524",
"0.6444663",
"0.62970686",
"0.60936344",
"0.6039882",
"0.60059667",
"0.59712917",
"0.58906543",
"0.588771",
"0.5845211",
"0.58068067",
"0.57839423",
"0.5777144",
"0.57741654",
"0.57521075",
"0.5713307",
"0.5713307",
"0.56461513",
"0.5617239",
"0.5580319",
"0.557... | 0.7006833 | 0 |
Identify and Extract the entity | function extractEntity(message, callback) {
//Get the prediction from LUIS
predictLanguage(message, function(prediction) {
var intent = sortHighestIntent(prediction);
var sys = "";
var env = "";
if (intent == "intent.IdentifyEntity") {
//Extract the entities
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static entityFromScrape (scrape) {\n //If the entity exists\n if (entities.hasOwnProperty(scrape.type)) {\n return entities[scrape.type].fromScrape(scrape);\n }\n //Else\n return null;\n }",
"get entity() { return this._entity; }",
"getEntity(id) {\n retu... | [
"0.63413703",
"0.61332005",
"0.58620626",
"0.58038336",
"0.5799586",
"0.57499945",
"0.5690194",
"0.5670271",
"0.56675",
"0.5621206",
"0.56141496",
"0.55673784",
"0.5534283",
"0.5503093",
"0.55018556",
"0.5495803",
"0.5458316",
"0.543249",
"0.53734106",
"0.53624",
"0.53553903"... | 0.64361954 | 0 |
Sort and return the highest score prediction | function sortHighestIntent(prediction) {
var score = 0;
var intent = "";
var i;
//Check for Entity Extraction
for (i = 0; i < prediction.IntentsResults.length; i++) {
if (prediction.IntentsResults[i].score > score) {
score = prediction.IntentsResults[i].score;
intent ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getFittest() {\n if (this.population[this.population.length - 1].score == undefined) {\n this.evaluate();\n }\n if (this.population[0].score < this.population[1].score) {\n this.sort();\n }\n return this.population[0];\n }",
"function ranking() { \n let higherThan = userRanking... | [
"0.6893926",
"0.6781715",
"0.67581093",
"0.6660819",
"0.6647254",
"0.6593181",
"0.64932895",
"0.64799094",
"0.64713466",
"0.64452636",
"0.64402413",
"0.63746136",
"0.6351001",
"0.63375676",
"0.6276154",
"0.6272962",
"0.62484586",
"0.62337834",
"0.61878836",
"0.6185559",
"0.61... | 0.7428834 | 0 |
Drink a HP or MP Potion | function DrinkPotion() {
if (hpLow()) {
parent.use('hp')
}
if (mpLow()) {
parent.use('mp');
}
return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Potion(type, power, amount, available,id,name) {\n this.type = type;\n this.power = power;\n this.amount = amount;\n this.available = available;\n this.id = id;\n this.name = name;\n}",
"function perk(){\n\tif(this.player.perks.length!= 0)\n\t{\n\t\tfor(var i =0; i<this.player.perks.le... | [
"0.593872",
"0.5882836",
"0.5835971",
"0.5822195",
"0.57739216",
"0.57689005",
"0.5712797",
"0.5698938",
"0.5692274",
"0.56906426",
"0.5687332",
"0.56837386",
"0.5641816",
"0.56302345",
"0.56241834",
"0.5572079",
"0.5527266",
"0.5512568",
"0.55046034",
"0.5474479",
"0.5461505... | 0.76198 | 0 |
Loot Functions Loot the chests | function Loot() {
loot();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"generateLootTable(){\n\t\tvar lootAmount = 1;\n\t\tvar roll = Math.floor((Math.random() * 100) + 1);\n\t\tvar reqChance = (10 * (1 + (LUK/100)));\n\t\tif(roll <= reqChance){\n\t\t\tlootAmount += 1;\n\t\t}\n\t\tthis.lootTable = [];\n\t\tfor (var i = 0; i < lootAmount; i++){\n\t\t\tthis.lootTable[i] = generateLoot(t... | [
"0.73399454",
"0.6991535",
"0.67224914",
"0.67094123",
"0.6620759",
"0.6601341",
"0.64953345",
"0.6467197",
"0.63300735",
"0.6318127",
"0.63131815",
"0.6261791",
"0.6247187",
"0.62405324",
"0.6237367",
"0.6227698",
"0.61540955",
"0.61318624",
"0.6096523",
"0.6086255",
"0.6050... | 0.72817343 | 1 |
Move towards Target If possible | function Move(target) {
if (!target) {
if (attack_target_off!=null){
// Go to Friend
MoveTo(attack_target_off)
return;
}
// Just Move Around
MoveAround()
return;
}
if(!in_attack_range(target)) {
// Get Closer to it
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function move_to_target(target) {\n if (can_move_to(target.real_x, target.real_y)) {\n smart.moving = false;\n smart.searching = false;\n move(\n character.real_x + (target.real_x - character.real_x) / 2,\n character.real_y + (target.real_y - character.real_y) / 2\n ... | [
"0.68740076",
"0.66502506",
"0.65993506",
"0.65936583",
"0.65753824",
"0.6532392",
"0.65184903",
"0.6495682",
"0.6360338",
"0.63229483",
"0.6300378",
"0.6276889",
"0.625875",
"0.6248874",
"0.6247192",
"0.6244471",
"0.62399226",
"0.6237851",
"0.62375975",
"0.6223432",
"0.61851... | 0.69147605 | 0 |
Move to Specific Player | function MoveTo(player) {
set_message("Go to " + player.name)
move(
character.real_x+(player.real_x-character.real_x-1),
character.real_y+(player.real_y-character.real_y-1)
);
return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function playerMove(){\n\t\tvar moveP = $(this).attr('id');\n\t\t$('#' + moveP).html(signP);\n\t\tplayer.push(Number(moveP));\n\t\tvar set = checkWin(player);\n\t\tif(set && set.length === 3){\n\t\t\tgameOver('player', set);\n\t\t}\n\t\tavailable.splice(available.indexOf(Number(moveP)), 1);\n\t\tif(available.lengt... | [
"0.71063554",
"0.68728644",
"0.6864579",
"0.6857145",
"0.6849249",
"0.6833881",
"0.6804112",
"0.6774651",
"0.67576826",
"0.6753636",
"0.67267436",
"0.6677863",
"0.66581416",
"0.6649912",
"0.6648659",
"0.66479796",
"0.6636645",
"0.6632368",
"0.6630791",
"0.65790725",
"0.657743... | 0.8026276 | 0 |
Get the Item according to ItemName | function FindItem(ItemName) {
// Finds First Item of the Name
for (i=0; i<character.items.length; i++) {
// Check out the Item
item = character.items[i]
// Does it fit?
if (item && item["name"] == ItemName) {
return item;
}
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function itemByNameWithinItemCollection(itemName, itemType, itemCollection) {\n for (var i = 1; i <= itemCollection.length; i++) {\n var curItem = itemCollection[i];\n if (curItem instanceof eval(itemType) && curItem.name == itemName) return curItem;\n }\n\n return null;\... | [
"0.7290872",
"0.7071354",
"0.70671076",
"0.67902195",
"0.6777728",
"0.6749522",
"0.67313343",
"0.66424936",
"0.66065174",
"0.6600323",
"0.65919614",
"0.6579492",
"0.6562817",
"0.6510846",
"0.65077037",
"0.65070176",
"0.6451812",
"0.6425051",
"0.6423241",
"0.6398888",
"0.63556... | 0.7940857 | 0 |
Equip the Item if its better than SlotLevel | function EquipItem(ItemName, SlotLevel) {
// Check out the item
item = FindItem(ItemName)
// Does it exists?
if (!item) return;
// Is it better?
if (item.level > SlotLevel) {
game_log("Equipping " + item["name"])
equip(ItemIndex(ItemName))
return;
}
return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function shouldEquip(newItem) {\n var compareTo;\n var slot;\n switch(newItem.type) {\n case ItemType.HELM:\n slot = isBetterThan(game.equipment.helm(), newItem) ? 0 : -1;\n break;\n case ItemType.SHOULDERS:\n slot = isBetterThan(game.equipment.shoulders(), newItem) ? 1 : -1;\n break;\... | [
"0.76300466",
"0.6693827",
"0.6639448",
"0.65883976",
"0.6584656",
"0.65407616",
"0.6525958",
"0.6491638",
"0.64829063",
"0.64815253",
"0.6420173",
"0.63917816",
"0.6357583",
"0.62565666",
"0.62431973",
"0.6213789",
"0.61936235",
"0.61351854",
"0.6119659",
"0.61157113",
"0.61... | 0.77449733 | 0 |
First approach: use the length of the list. walk down the whole list, counting nodes, to get the total listLength. subtract kk from the listLength to get the distance from the head node to the target node (the kth to last node). walk that distance from the head to arrive at the target node. | function kthToLastNode(k, head) {
if (k < 1) {
throw new Error(`Impossible to find less than first to last node: ${k}`);
}
// STEP 1: get the length of the list
// Start at 1, not 0
// else we'd fail to count the head node!
let listLength = 1;
let currentNode = head;
// Traver... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function kthToLastNode(k, head) {\n\n // STEP 1: get the length of the list\n // start at 1, not 0\n // else we'd fail to count the head node!\n var listLength = 1;\n var currentNode = head;\n\n // traverse the whole list,\n // counting all the nodes\n while (currentNode.next) {\n cu... | [
"0.7578117",
"0.71651894",
"0.7069038",
"0.7006795",
"0.6940811",
"0.6915803",
"0.6762122",
"0.67466944",
"0.66952443",
"0.66368836",
"0.6606876",
"0.66017294",
"0.6592489",
"0.65507287",
"0.65214443",
"0.6389066",
"0.6384877",
"0.6348953",
"0.62946653",
"0.6265861",
"0.61555... | 0.7316857 | 1 |
TimeLogger Create a TimeLogger object | function TimeLogger(id) {
if (!id)
id = "default";
if (loggers[id])
return loggers[id];
var logger = {};
logger.timestamp = [];
// keep track of the different timestamps
/**
* log
* Log a message
*
* @param type Can be either info, warn or error
* @param message The message to log
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Logger(iLogElement, iCommandTemplate, iResponseTemplate) {\r\n this.log = iLogElement;\r\n this.commandTemplate = iCommandTemplate;\r\n this.responseTemplate = iResponseTemplate;\r\n}",
"function newLogger() {\n\n const logger = {\n logObj: {\n logLevel: '',\n ac... | [
"0.6170466",
"0.6018589",
"0.5878549",
"0.5809438",
"0.57747614",
"0.57173395",
"0.5712395",
"0.5668922",
"0.5663269",
"0.5620865",
"0.55998033",
"0.55862844",
"0.55604655",
"0.55503",
"0.551028",
"0.55064833",
"0.55014336",
"0.547967",
"0.54442996",
"0.5443306",
"0.5437451",... | 0.7037959 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.