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 |
|---|---|---|---|---|---|---|
carouselRightArrow carousel controls on bottom | function carouselRightArrow(){
if($('#tdList-20').attr('videoID') === '') {
return;
} else if ($('#tdList-40').attr('videoID') === '' && currentSlideNumber % 2 === 0) {
return;
}
$(".carousel").carousel('next');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function carouselLeftArrow(){\n $(\".carousel\").carousel('prev');\n}",
"function slideRight() {\n var parent = $(this).closest('.carousel');\n var items = $.makeArray(parent.find('.item.hidden'));\n if (items.length == 0) {\n //already at the beginning\n return;\n }\n parent.find('.item.active').r... | [
"0.7415362",
"0.70778155",
"0.6995402",
"0.6639654",
"0.6595513",
"0.65020454",
"0.6482783",
"0.6459831",
"0.6432182",
"0.64101416",
"0.63862795",
"0.635222",
"0.6346088",
"0.633173",
"0.62737274",
"0.62360436",
"0.62141234",
"0.6191207",
"0.61566764",
"0.61306673",
"0.612369... | 0.7360407 | 1 |
tooltipFunctions set timeouts for tool tips after hover | function tooltipFunctions() {
$('[data-toggle="tooltip"]').tooltip(); //needed for tooltip
$('[data-toggle="popover"]').popover();
$('.tdPlaylistButton').mouseenter(function(){
setTimeout(function(){
$('.tdPlaylistButton').tooltip('hide');
},1000);
});
$('.browseChannelBu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onMouseoverHdlr() {\t// on 'mouseover' handler\n\tsetTimeout(function(){ $(document).tooltip('disable');}, 10000);\n}",
"function loadTooltips() {\n $('.hover-tooltip').tooltip({\n title: hoverGetData,\n html: true,\n container: 'body',\n placement: 'left',\n delay: {\n \"show\": 10... | [
"0.71992403",
"0.7113785",
"0.70022094",
"0.69793123",
"0.6839762",
"0.6703711",
"0.66234237",
"0.6610458",
"0.6593985",
"0.659266",
"0.6567556",
"0.65529037",
"0.653938",
"0.6533368",
"0.6518657",
"0.6509811",
"0.646731",
"0.6464809",
"0.6459965",
"0.64533097",
"0.6444338",
... | 0.7206725 | 0 |
Manhattan distance function heuristic(node) = dx = abs(node.x goal.x) dy = abs(node.y goal.y) return D (dx + dy)} cb | function manhattanDist(node, goal) {
const dx = Math.abs(node.coord.x - goal.coord.x);
const dy = Math.abs(node.coord.y - goal.coord.y);
const D = 1; // cost to move.
return D * (dx + dy);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ManhattanDistance(Point, Goal)\n\n{\n\n// linear movement - no diagonals - just cardinal directions (NSEW)\n\nreturn abs(Point.x - Goal.x) + abs(Point.y - Goal.y);\n\n}",
"function getManhattanDistance(node1, node2) {\n return Math.abs(node1.row - node2.row) + Math.abs(node1.col - node2.col);\n}",
"f... | [
"0.7753011",
"0.76770097",
"0.74512357",
"0.73419005",
"0.7307843",
"0.7224117",
"0.7218975",
"0.7211172",
"0.71770227",
"0.71761674",
"0.71761674",
"0.7127225",
"0.7118624",
"0.69770825",
"0.69427145",
"0.6941074",
"0.68061817",
"0.6786723",
"0.66226685",
"0.65429634",
"0.65... | 0.8752469 | 0 |
Setup Impagination of Recent Users | setupImpaginationOfRecentUsers() {
let _this = this;
let dataset = new Dataset({
pageSize: 6,
loadHorizon: 2,
observe(datasetState) {
_this.setState({datasetState});
},
// Where to fetch the data from.
fetch(pageOffset, pageSize, stats) {
return Api.search(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function appendUsers() {\n queryRequest(uniqueProjectUsers);\n usersWithNumberOfIssues.length = 0;\n uniqueProjectUsers.forEach(function (user) {\n var numberOfIssues = 0;\n issuesOfProject.forEach(function (issue) {\n if (issue.assignee == user) {\n numberOfIssues+... | [
"0.55737907",
"0.5531107",
"0.5467993",
"0.54639083",
"0.54386425",
"0.5284423",
"0.5276269",
"0.5271331",
"0.5246111",
"0.522518",
"0.522354",
"0.5222928",
"0.5182142",
"0.5179097",
"0.5175135",
"0.5166545",
"0.5164172",
"0.5163359",
"0.5151947",
"0.5141215",
"0.5135702",
... | 0.68643004 | 0 |
Setup Impagination of Interest favourite Users | setupImpaginationOfInterestFavourite() {
let _this = this;
let dataset = new Dataset({
pageSize: 15,
loadHorizon: 15,
observe(datasetStateOfInterestFavourite) {
_this.setState({datasetStateOfInterestFavourite});
},
// Where to fetch the data from.
fetch(pageOffset, pa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setupImpaginationOfInterestFavouritedMe() {\n let _this = this;\n let dataset = new Dataset({\n pageSize: 15,\n loadHorizon: 15,\n observe(datasetStateOfInterestFavouritedMe) {\n _this.setState({datasetStateOfInterestFavouritedMe});\n },\n // Where to fetch the data from.\n ... | [
"0.67429227",
"0.6103769",
"0.5748758",
"0.5719483",
"0.5714232",
"0.5703462",
"0.5660014",
"0.5633649",
"0.56332153",
"0.56228095",
"0.5611474",
"0.5599124",
"0.55891955",
"0.5562773",
"0.5557516",
"0.555512",
"0.55184865",
"0.55113345",
"0.5509464",
"0.5507145",
"0.54890865... | 0.6741619 | 1 |
Setup Impagination of favourited Me Users | setupImpaginationOfInterestFavouritedMe() {
let _this = this;
let dataset = new Dataset({
pageSize: 15,
loadHorizon: 15,
observe(datasetStateOfInterestFavouritedMe) {
_this.setState({datasetStateOfInterestFavouritedMe});
},
// Where to fetch the data from.
fetch(pageO... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initializeUsers() {\n username = localStorage.getItem('staySignedInAs')\n if (username !== null) {\n useDefaults = localStorage.getItem('Defaults Used?' + username + 'Kixley@65810')\n useDefaults = parseBool(useDefaults)\n if (useDefaults === false) {\n useDefaultDiff = localStorage.getIte... | [
"0.60749894",
"0.5985546",
"0.58625597",
"0.5838326",
"0.5786993",
"0.5782261",
"0.5764704",
"0.5751174",
"0.5722505",
"0.57159996",
"0.5688538",
"0.56795555",
"0.5676403",
"0.56520355",
"0.5623378",
"0.5611906",
"0.56118363",
"0.5596111",
"0.55949455",
"0.5582101",
"0.557686... | 0.61645764 | 0 |
This function reads a series of incomes from comma separated values in the string text and then formats the income and tax in a table and returns the string | function incomeList(text)
{
var incomes = text.split(",");
var result = [];
var taxes = [];
for (var i = 0; i < incomes.length; ++i) {
taxes.push(calculateTax(incomes[i]));
result.push(incomes[i]+","+taxes[i]);
}
return resul... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formatData(strng){\n\twhile(strng.includes(',')){\n\t\tstrng = strng.replace(',', '.');\n\t}\n\treturn strng;\n}",
"function generalCsv(data1,string){\n var rows=data1.toString().split(\"\\r\\n\");\n headers=rows[0].split(\",\");\n //console.log(headers);\n for(var i=1;i<rows.length-1;i++){\n ... | [
"0.55876917",
"0.5577501",
"0.5101294",
"0.5040687",
"0.49587247",
"0.49327037",
"0.4917613",
"0.48893017",
"0.48555085",
"0.48480105",
"0.48451138",
"0.47711718",
"0.47321877",
"0.47220477",
"0.47209045",
"0.47204733",
"0.47196254",
"0.47135848",
"0.46891782",
"0.468384",
"0... | 0.6810599 | 0 |
Adds StyleInfo to the Footer (Link to Github uvm) | function addStyleBy() {
// check if can find footer element else exit this function
var footer = document.getElementById('pageFooter');
if(footer === undefined || footer === null)
return;
var footerContent = footer.getElementsByClassName('footerContent')[0];
if(footerContent === undefined || footerContent... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Footer() {\n return (\n <footer className=\"footer fixed-bottom\">\n <span className=\"bg-info\">\n <a\n href=\"https://github.com/Karlelisa\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <i className=\"fab fa-github mr-2\"></i>Karlelis... | [
"0.62667",
"0.6112618",
"0.60512996",
"0.6045475",
"0.6011048",
"0.58833",
"0.5870987",
"0.58429146",
"0.5822146",
"0.58212376",
"0.5781214",
"0.5706013",
"0.5696709",
"0.5685122",
"0.5672404",
"0.5655897",
"0.56544733",
"0.56410474",
"0.5632018",
"0.5631681",
"0.56021553",
... | 0.73439527 | 0 |
Returns a controller object for setting a timeout that is properly cleaned up once the component unmounts. New timeouts cancel and replace existing ones. | function useTimeout() {
var isMounted = Object(_useMounted__WEBPACK_IMPORTED_MODULE_2__["default"])();
var handle = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])();
var clear = function clear() {
return clearTimeout(handle.current);
};
Object(_useWillUnmount__WEBPACK_IMPORTED_MODULE_1__["default"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function useTimeout () {\n let timer = null;\n const vm = vue.getCurrentInstance();\n\n function removeTimeout () {\n if (timer !== null) {\n clearTimeout(timer);\n timer = null;\n }\n }\n\n vue.onDeactivated(removeTimeout);\n vue.onBeforeUnmount(removeTimeout);\n\n ret... | [
"0.59614664",
"0.56049776",
"0.5577963",
"0.5490032",
"0.53819746",
"0.53819746",
"0.53819746",
"0.53819746",
"0.5364445",
"0.52735806",
"0.51561654",
"0.5131061",
"0.51134",
"0.5094438",
"0.5089148",
"0.50206435",
"0.50079304",
"0.4987263",
"0.49868378",
"0.4974295",
"0.4947... | 0.5744796 | 1 |
`Dropdown` is set of structural components for building, accessible dropdown menus with closeonclick, keyboard navigation, and correct focus handling. As with all the reactoverlay's components its BYOS (bring your own styles). Dropdown is primarily built from three base components, you should compose to build your Drop... | function Dropdown(_ref) {
var drop = _ref.drop,
alignEnd = _ref.alignEnd,
defaultShow = _ref.defaultShow,
rawShow = _ref.show,
rawOnToggle = _ref.onToggle,
itemSelector = _ref.itemSelector,
focusFirstItemOnShow = _ref.focusFirstItemOnShow,
children = _ref.children;
var forc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DropdownMenu(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n direction = props.direction,\n open = props.open,\n scrolling = props.scrolling;\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(direction, Objec... | [
"0.7379139",
"0.73551315",
"0.7344111",
"0.7344111",
"0.731457",
"0.7248382",
"0.7141513",
"0.7104771",
"0.7096492",
"0.70610046",
"0.70362496",
"0.7033354",
"0.7033354",
"0.6974389",
"0.6948965",
"0.6941215",
"0.68353075",
"0.68135256",
"0.67828226",
"0.67828226",
"0.6773039... | 0.7876001 | 1 |
Wires up Dropdown toggle functinality, returning a set a props to attach to the element that functions as the dropdown toggle (generally a button). | function useDropdownToggle() {
var _useContext = Object(react__WEBPACK_IMPORTED_MODULE_1__["useContext"])(_DropdownContext__WEBPACK_IMPORTED_MODULE_2__["default"]),
show = _useContext.show,
toggle = _useContext.toggle,
setToggle = _useContext.setToggle;
return [{
ref: setToggle,
'aria-has... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function useDropdownToggle() {\n var _ref = Object(react__WEBPACK_IMPORTED_MODULE_1__[\"useContext\"])(_DropdownContext__WEBPACK_IMPORTED_MODULE_2__[\"default\"]) || {},\n _ref$show = _ref.show,\n show = _ref$show === void 0 ? false : _ref$show,\n _ref$toggle = _ref.toggle,\n toggle = _ref$tog... | [
"0.6736121",
"0.6736121",
"0.6667571",
"0.6605897",
"0.6605897",
"0.6524257",
"0.62852407",
"0.62826455",
"0.61889184",
"0.60012704",
"0.5964195",
"0.5922878",
"0.5922878",
"0.5890954",
"0.5890954",
"0.58881706",
"0.58881706",
"0.58873236",
"0.58767843",
"0.586028",
"0.581652... | 0.68878376 | 1 |
Filters for the users choice | function filterUser(value) {
const filterIndex = select.selectedIndex
let filter = select.options[select.selectedIndex].text
if (value.length >= 3) {
filteredUsers = users.filter((user) => {
if (user[filter].toLowerCase().includes(value.toLowerCase())) {
return user[filte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function filterUser(value) {\n switch (value) {\n case Constants.UserManagementDDLOptions[1]:\n GetAllUsersFromDB();\n break;\n case Constants.UserManagementDDLOptions[2]:\n GetActivatedUserList();\n ... | [
"0.72708374",
"0.679569",
"0.6711983",
"0.6538668",
"0.649803",
"0.64871246",
"0.64749736",
"0.6357838",
"0.63390577",
"0.6314583",
"0.627644",
"0.6237066",
"0.6229025",
"0.61880636",
"0.61710256",
"0.61697626",
"0.6146438",
"0.61458665",
"0.61189294",
"0.6091811",
"0.6090958... | 0.72810113 | 0 |
var rot = getDegreeElementById(squarel); | function getDegreeElementById(squarel) {
var element = document.getElementById('squarel');
var style = window.getComputedStyle(element, null);
// получаем значение стилей
var valueStyle = style.getPropertyValue("-webkit-transform") ||
style.getPropertyValue("-moz-transform") ||
style.get... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rotateDeg(wise){\n\tvar outer = document.getElementById('inner'),\n inner = document.getElementById('mainPhoto'),\n rotator = setRotator(inner);\n\n\tif(wise == 'clock'){\n\t\tdegrees += 90;\n\t} else{\n\t\tdegrees -= 90;\n\t}\n\n\n if (degrees >= 360) {\n degrees = 0;\n }\n\n rotato... | [
"0.6531213",
"0.63352966",
"0.6269987",
"0.6139909",
"0.61005616",
"0.608561",
"0.6082949",
"0.60627574",
"0.60535675",
"0.6043049",
"0.5984824",
"0.59722203",
"0.5964407",
"0.5905762",
"0.5875156",
"0.58679813",
"0.5867697",
"0.586679",
"0.58649486",
"0.585485",
"0.5847462",... | 0.82226104 | 0 |
keep only a n decimals in geojson coordinates | function simplifyGeojson(geo, n){
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function coord1(value) {\n\t return value\n\t .replace(removeSpace, \"\")\n\t .split(\",\")\n\t .map(parseFloat)\n\t .filter((num) => !isNaN(num))\n\t .slice(0, 3);\n\t}",
"function normalizeLng( value ) {\n const rotation = Math.floor( ( value + 180 ) / 360 );\n c... | [
"0.61190784",
"0.5901839",
"0.58294755",
"0.5709085",
"0.5706951",
"0.5681709",
"0.5644305",
"0.55318093",
"0.55226123",
"0.5419712",
"0.5400155",
"0.53726745",
"0.53726745",
"0.5368304",
"0.5363918",
"0.5339507",
"0.5334838",
"0.53333217",
"0.5324105",
"0.5297405",
"0.528224... | 0.6902684 | 0 |
Generate the query for specific method | _getQuery(method, data, params) {
let query;
switch (method) {
case 'find': query = this._getQueryGeocode(data, params); break;
case 'reverseGeocode': query = this._getQueryReverse(data, params); break;
case 'suggest': query = this._getQuerySuggest(data, params); break;
case 'findAddress... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CustomQuery() {\n\n}",
"async function queryDynamicDb( layer, method, props ){\n let obj = ''; let event = ''; let field = '';\n if (layer.host=='bniaApi'){obj=new BniaSearch(layer); }\n if (layer.host=='arcgis') {obj=new EsriSearch(layer); }\n if (layer.host=='socrata'){obj=new SocrataSearch(layer)... | [
"0.65071005",
"0.6415638",
"0.6402205",
"0.6333182",
"0.6295627",
"0.62335473",
"0.6158737",
"0.6100864",
"0.60952926",
"0.6053628",
"0.6033982",
"0.60304505",
"0.6028751",
"0.6028751",
"0.6028751",
"0.60283583",
"0.60283583",
"0.60283583",
"0.60277146",
"0.5974114",
"0.59583... | 0.71529335 | 0 |
Prepare the query for suggest | _getQuerySuggest(data, params) {
return {
text: data,
outFields: params.outFields || '*',
maxSuggestions: params.maxSuggestions || 10,
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"searchSuggest(query) {\r\n let finalQuery;\r\n if (typeof query === \"string\") {\r\n finalQuery = { querytext: query };\r\n }\r\n else {\r\n finalQuery = query;\r\n }\r\n return this.create(SearchSuggest).execute(finalQuery);\r\n }",
"function i... | [
"0.6536917",
"0.59518266",
"0.5936315",
"0.59145284",
"0.59036714",
"0.5865288",
"0.58625966",
"0.5832799",
"0.580762",
"0.5793396",
"0.57455236",
"0.5742793",
"0.5720012",
"0.5669403",
"0.5638431",
"0.5627923",
"0.5602946",
"0.55935067",
"0.5590696",
"0.5549595",
"0.55457467... | 0.6718893 | 0 |
Prepare the query for findAddressCandidates | _getQueryFindAddressCandidates(data) {
if (isString(data)) return { SingleLine: data };
if (isObject(data)) return data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_getQueryGeocodeAddresses(data) {\n const records = [];\n data.forEach((address, index) => {\n if (isString(address)) {\n records.push({\n attributes: {\n OBJECTID: index,\n SingleLine: address,\n },\n });\n } else {\n // allow user to sp... | [
"0.58243704",
"0.57239884",
"0.5703757",
"0.54517096",
"0.53788304",
"0.534403",
"0.5332851",
"0.53037864",
"0.53025126",
"0.52685165",
"0.52350086",
"0.52340424",
"0.52103925",
"0.5157994",
"0.5131981",
"0.51285034",
"0.51061934",
"0.5088926",
"0.5086893",
"0.50531393",
"0.5... | 0.6143717 | 0 |
Prepare the query for geocodeAddresses | _getQueryGeocodeAddresses(data) {
const records = [];
data.forEach((address, index) => {
if (isString(address)) {
records.push({
attributes: {
OBJECTID: index,
SingleLine: address,
},
});
} else {
// allow user to specify their own ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fillInAddressSource() {\n var coords = sourceQuery.getPlace().geometry.location;\n lat = coords.lat();\n lon = coords.lng();\n}",
"_getQueryGeocode(data, params) {\n return {\n text: data,\n outFields: params.outFields || '*',\n maxLocations: params.maxLocations || 10,\n };\n }"... | [
"0.6659336",
"0.650398",
"0.60950613",
"0.60516804",
"0.6016699",
"0.6010526",
"0.6007574",
"0.5975601",
"0.59680796",
"0.58689475",
"0.5868109",
"0.58561164",
"0.58160007",
"0.5812755",
"0.5785749",
"0.5750603",
"0.5721056",
"0.5718395",
"0.56995296",
"0.56814253",
"0.566315... | 0.71950936 | 0 |
Parsing error and return error object | parseError(error) {
if (error.code === 400 && (error.details && error.details.length)) {
return {
code: error.code,
msg: get(error, 'details')[0] || 'Error',
};
}
return error;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ParserError(e,t){this.message=e,this.error=t}",
"function parseError(err, path){\n app.logger.log(err, path); \n \n if(typeof err == 'string')\n return err;\n return 'Unknown error';\n }",
"function parseError(input, contents, err) {\n var errLines = err.me... | [
"0.7639631",
"0.72706497",
"0.71979725",
"0.70759445",
"0.70511776",
"0.69986945",
"0.6817068",
"0.67343694",
"0.67053854",
"0.6647787",
"0.65015846",
"0.64899427",
"0.6364251",
"0.6264464",
"0.6232777",
"0.6219385",
"0.6184491",
"0.6124249",
"0.6114782",
"0.61146456",
"0.611... | 0.7544482 | 1 |
Process the image by applying the kernel. | function ApplyKernel(img, kern) {
let height = img.height;
let width = img.width
// Create and allocate a new array to hold the new image.
let new_image = new Uint8ClampedArray(4 * height * width);
new_image.fill(255);
// Iterate through each of the channels: R,G,B
for(var channel = 0; chann... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"run(imageData, imgWidth, imgHeight) {\n let kernel = this.kernels[this.kernelOperator].kernel;\n let sum = this.kernels[this.kernelOperator].sum;\n return this.convolve(imageData, imgWidth, imgHeight, kernel, 1/sum);\n }",
"apply() {\n // Get the source image and create the result ... | [
"0.66036105",
"0.62568533",
"0.6216518",
"0.61938566",
"0.58362776",
"0.5509829",
"0.54928154",
"0.54900795",
"0.5464914",
"0.54426533",
"0.5434077",
"0.53780484",
"0.52914435",
"0.5285847",
"0.52688164",
"0.5246969",
"0.52456605",
"0.52403015",
"0.5228871",
"0.5190686",
"0.5... | 0.7529932 | 0 |
This pulls out the computations from the component and computes them with the optimizer. | _isolatedComputeForWrapper(component) {
const computations = ReactInterpreter.computations(component);
return this.optimizer.compute(computations);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_precomputeComputeForWrapper(component) {\n const computations = ReactInterpreter.computations(component);\n const computedValues = this.optimizer.compute(computations);\n this.renderer.notifyAboutCompute(component, computations, computedValues);\n return computedValues;\n }",
"compute()\n {\n ... | [
"0.7077152",
"0.62705755",
"0.62705755",
"0.6016874",
"0.59885037",
"0.5929261",
"0.59225583",
"0.5918945",
"0.58713543",
"0.5763892",
"0.5751716",
"0.5737336",
"0.57049686",
"0.5602473",
"0.5596236",
"0.5586118",
"0.55707955",
"0.55706054",
"0.54861856",
"0.54546505",
"0.545... | 0.68461645 | 1 |
This requires cooperation between the optimizer and the renderer, so we create a loggit API that allows that. It also breaks the loggit.compute method to take a component instead of just a description of computation. | _withPrecomputeRenderer(reactClass, el, log, optimizerClass) {
const optimizer = new optimizerClass(log);
const loggit = {
recordFact: log.recordFact.bind(log),
computeFor: this._precomputeComputeForWrapper.bind(this),
experimental: {
forceCompaction: this._experimentalCompaction.bind(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_precomputeComputeForWrapper(component) {\n const computations = ReactInterpreter.computations(component);\n const computedValues = this.optimizer.compute(computations);\n this.renderer.notifyAboutCompute(component, computations, computedValues);\n return computedValues;\n }",
"_isolatedComputeForWr... | [
"0.6324974",
"0.60579836",
"0.574137",
"0.5167757",
"0.5159222",
"0.5096611",
"0.49962747",
"0.49663883",
"0.491505",
"0.49148515",
"0.49041876",
"0.48896286",
"0.48692617",
"0.47789705",
"0.47723264",
"0.47723264",
"0.4755875",
"0.47449255",
"0.47398564",
"0.4701247",
"0.465... | 0.6140315 | 1 |
This inform the renderer that something has occurred. It can decide whether to respond synchronously, or to batch, etc. | _notifyRenderer() {
this.renderer.notify();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"rendererReady() {\n const message = new Message(Message.rendererReadyTitle, 'void').toString();\n this.ipc.send('update-message', message);\n }",
"IsFinishedRendering() {}",
"function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_429( 'Received a render event. Re-emitting...' );\n\t\targs = new A... | [
"0.60688233",
"0.59487796",
"0.57427925",
"0.57325476",
"0.57306087",
"0.57235336",
"0.5721346",
"0.5706901",
"0.56946576",
"0.56925815",
"0.5691034",
"0.5683223",
"0.56808984",
"0.56759024",
"0.56724757",
"0.5670946",
"0.56447506",
"0.5576912",
"0.55661",
"0.55142295",
"0.55... | 0.61903167 | 0 |
Ottiene i dati dal GPS | function getDataFromGPS(position){
$("#geo-information").html('<div class="alert alert-info text-center" role="alert">⌛ Aggiornamento... <div class="spinner-grow spinner-grow-sm float-right" role="status"></div></div>');
truelat = position.coords.latitude;
truelon = position.coords.longitude;
updateData(truela... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function geoloc() {\n let coords = navigator.geolocation.getCurrentPosition((pos) => {\n coords = pos;\n let lat = coords.coords.latitude;\n let long = coords.coords.longitude;\n ll = `?_ll=${lat},${long}`;\n document.querySelector(\".change-hour h1 span\").textContent = \"ma position\";\n getDa... | [
"0.6806493",
"0.6790628",
"0.674347",
"0.6673686",
"0.6665772",
"0.66496015",
"0.6642753",
"0.6626201",
"0.66116124",
"0.65597874",
"0.6546017",
"0.65106773",
"0.6471653",
"0.6456484",
"0.633452",
"0.62265366",
"0.6222223",
"0.62213564",
"0.6143627",
"0.61407936",
"0.61323166... | 0.69579315 | 0 |
Aggiunge marker al click e ferma la localizzazione | function addMarkerClick(e){
maxDist = 0.8 / 110.574;
distGPStoSelection = Math.sqrt(Math.pow(e.latlng.lat - truelat, 2) + Math.pow(e.latlng.lng - truelon, 2));
// Controlla se la distanza non è eccessiva
if(distGPStoSelection <= maxDist && stato == 1){
updateData(e.latlng.lat, e.latlng.lng);
stopLocation(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clickMarker(e) {\n deselectCurrentMarker();\n var markerComponent = mly.getComponent('marker');\n var marker = e.target || e;\n marker.options.tags = marker.options.tags || {};\n selectedMarker = marker;\n marker.setIcon(redIcon);\n markerId = marker.id;\n currentMarkerId = markerId;\n markerComp... | [
"0.73829496",
"0.7328061",
"0.7317792",
"0.7284404",
"0.72814536",
"0.7237583",
"0.72132736",
"0.7191674",
"0.7135163",
"0.7121554",
"0.70174956",
"0.7004344",
"0.6958005",
"0.69403994",
"0.6860577",
"0.6844564",
"0.68438077",
"0.6829785",
"0.68135905",
"0.67789155",
"0.67584... | 0.76976025 | 0 |
sorts tabs then displays in square grid for easy navigation | function organizeTabs(){
chrome.tabs.query({currentWindow:true}, function(tabs) { //selects all tabs from current window
console.log(tabs);//check the console for more tab information
//sorts array of obj's. Source: http://stackoverflow.com/users/43452/stobor
tabs.sort(function(a, b) {
return a['url'].localeC... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toevoegen_card_tabs_in_grid() {\n card_tabs_data__arr.map( (card_tab__obj, idx) => {\n $x('.grid_' + eval(idx + 1)).append( aanmaken_card_tabs(idx))\n })\n }",
"function display_tabs( tabs ) {\n var tabs_code = $(tabs);\n\n set_active_tab( tabs_code );\n ... | [
"0.6578337",
"0.631205",
"0.6259668",
"0.6255593",
"0.62150013",
"0.619272",
"0.6178225",
"0.6119733",
"0.6092266",
"0.60863256",
"0.60732603",
"0.60263723",
"0.60049015",
"0.59749115",
"0.596604",
"0.5961076",
"0.5957652",
"0.5955172",
"0.5948951",
"0.59252095",
"0.59230083"... | 0.6483174 | 1 |
Calculates the hypotenuse given sideA and sideB | function hypotenuse(sideA, sideB) {
if (isNaN(sideA) || isNaN(sideB)) {
return NaN;
}
return Math.sqrt(sideA**2 + sideB**2);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lengthOfHypotenuse(side1, side2){\n \n //hypotenuse squared = side1 squared + side2 squared\n var hypotenuse = Math.sqrt((side1 * side1) + (side2 * side2));\n return hypotenuse;\n}",
"function hypotenuse(a, b) {\n return Math.sqrt(a * a + b * b);\n}",
"function hypoteneuse(a, b){\n retur... | [
"0.82282203",
"0.7890947",
"0.75940454",
"0.74378896",
"0.74118584",
"0.73922896",
"0.73908",
"0.7390663",
"0.7387037",
"0.7245202",
"0.7073672",
"0.6983835",
"0.68348914",
"0.68130314",
"0.6734878",
"0.67297643",
"0.6571513",
"0.6560006",
"0.6445917",
"0.6185874",
"0.6159060... | 0.86003286 | 0 |
Return the entreprise corresponding to the id parameter | function getEntreprise(req, res, next) {
var id = parseInt(req.params.id);
db.query("SELECT * FROM entreprises WHERE id = ?", id, function (error, results, fields) {
if (error)
res.status(500)
.json({
status: "ko",
data: "error"
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get(id) {\n return internal(this).idToEntity.get(id);\n }",
"getEmpireById(id) {\n return client({\n method: 'GET',\n path: `${ROOT}/empires/${id}`,\n });\n }",
"getById(id) {\r\n return this._byId[id]\r\n }",
"function getEntityById(id) {\n return enti... | [
"0.7146589",
"0.68520635",
"0.68410945",
"0.67418903",
"0.66265833",
"0.6572946",
"0.656409",
"0.6505309",
"0.6464359",
"0.6446938",
"0.64382064",
"0.6430203",
"0.6423881",
"0.6368593",
"0.6353878",
"0.63314104",
"0.6327672",
"0.6297064",
"0.6292475",
"0.62807417",
"0.6280741... | 0.68777204 | 1 |
Return employees of the entreprise corresponding to the id parameter | function getEmployees(req, res, next) {
var id = parseInt(req.params.id);
db.query("SELECT * FROM users WHERE id_entreprise = ?", id, function (error, results, fields) {
if (error)
res.status(500)
.json({
status: "ko",
data: "error"
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getEmployeeById (id) {\n var i;\n for (i = 0; i < employees.length; i++) {\n if (employees[i].id === id) {\n return employees[i];\n }\n }\n\n return undefined\n}",
"async findById(id) {\n\t\tlet sqlRequest = \"SELECT * FROM employee WHERE id=$id\";\n\t\tlet sqlParams = {$id: id};\n\t\tcon... | [
"0.73206043",
"0.7212194",
"0.71006846",
"0.6989848",
"0.69851136",
"0.6932782",
"0.6797988",
"0.67077446",
"0.6678182",
"0.66624117",
"0.6643086",
"0.6540766",
"0.6519953",
"0.6517105",
"0.64350927",
"0.64248246",
"0.64130837",
"0.64055556",
"0.6401281",
"0.63880527",
"0.635... | 0.75134283 | 0 |
Deletes the entreprise corresponding to the id parameter | function deleteEntreprise(req, res, next) {
var id = parseInt(req.params.id);
db.query("DELETE FROM entreprises WHERE id = ?", id, function (errors, results, fields) {
if (errors)
res.status(500)
.json({
status: "ko",
data: "error"
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteEntityById(id) {\n delete entities[id];\n}",
"remove(id, params) {}",
"deleteById(req, res) {\n let id = req.params.id;\n\n this.tradeDao.deleteById(id)\n .then(this.common.editSuccess(res))\n .catch(this.common.serverError(res));\n }",
"async deleteById... | [
"0.72522163",
"0.7210319",
"0.706414",
"0.70603603",
"0.7036229",
"0.6943367",
"0.6933638",
"0.6892575",
"0.6861884",
"0.68562645",
"0.68396944",
"0.6826325",
"0.6823247",
"0.6802406",
"0.6780316",
"0.6768397",
"0.67428386",
"0.6737749",
"0.6723371",
"0.6702689",
"0.6681091",... | 0.75582635 | 0 |
Change "Add to eBay" Value | function addItemToEbay() {
addToEbay.value = '1';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateBasketTotal(addToTotal) {\n currTotal = $(\"#basket-total\").text();\n currTotal = Number(currTotal.substring(1,currTotal.length));\n basketTotal = currTotal + Number(addToTotal);\n \n basketTotal = \"£\" + Number(basketTotal).toFixed(2);\n $(\"#basket-total\").html(basketTota... | [
"0.6014025",
"0.56391364",
"0.5621171",
"0.5555007",
"0.549761",
"0.54732794",
"0.5471149",
"0.54103446",
"0.5397586",
"0.5373796",
"0.5363409",
"0.53546286",
"0.53546286",
"0.5322086",
"0.5315493",
"0.5299758",
"0.5290246",
"0.5273022",
"0.5255665",
"0.5246356",
"0.52452147"... | 0.8097996 | 0 |
Set template for Long Description | function setDescriptionTemplate(){
CKEDITOR.instances.app_bundle_product_form_longDescription.setData(`<p>Your satisfaction is our number one goal. Keep in mind that we offer hassle-free returns if needed. If you have any questions or problems, please contact us.</p>
<p>Please Note: All included items are s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createMarkupForProjectDescription() {\n if (project.projectDescription) {\n return {\n __html: project.projectDescription,\n };\n } else {\n return;\n }\n }",
"function... | [
"0.6644738",
"0.6422635",
"0.63019973",
"0.6284039",
"0.6265662",
"0.6168046",
"0.61362284",
"0.60829526",
"0.60827804",
"0.60525",
"0.5930345",
"0.59264666",
"0.59192073",
"0.58818763",
"0.58609194",
"0.57896096",
"0.57769364",
"0.57747084",
"0.5774313",
"0.571282",
"0.56970... | 0.7869298 | 0 |
? Slightly unsure what componentDidMount does but the login within states that if the localstorage item "InstagramUsername is not null then it sets the loggedIn state to true. | componentDidMount() {
console.log('Local storage: ', localStorage.getItem('InstagramUsername'));
if (localStorage.getItem('InstagramUsername') !== null) {
this.setState({ loggedIn: true });
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"componentDidMount() {\n if (localStorage.getItem(\"username\")) {\n this.setState({\n loggedIn: true\n });\n }\n }",
"componentDidMount() {\n const loggedinUser = localStorage.getItem('user');\n if (loggedinUser) {\n const foundUser = JSON.parse(loggedinUser)\n ... | [
"0.8137776",
"0.7863055",
"0.77652735",
"0.76302534",
"0.7619947",
"0.7585621",
"0.7585155",
"0.754558",
"0.75434893",
"0.75077903",
"0.7450265",
"0.739251",
"0.7340621",
"0.733691",
"0.7334462",
"0.73220026",
"0.72790533",
"0.72748995",
"0.7248442",
"0.7228316",
"0.7182825",... | 0.8776838 | 0 |
This render if statement asks if this.state.loggedIn is true or not if it is true, we'll return to the App component. If it isn't true then we'll be redirected to the Login component. | render() {
let output = this.state.loggedIn ? <App /> : <Login />;
return output;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"render() {\n if(this.state.isLoggedIn){\n return <HomePage/>\n }\n else{\n return <Login/>\n }\n }",
"checkLoginState() {\n if (this.state.loggedIn === 1) return <HomePageRouter />;\n else return <AuthPageRouter />;\n }",
"render() {\n if (this... | [
"0.7644102",
"0.7482524",
"0.7387048",
"0.7373826",
"0.7294971",
"0.7215456",
"0.7190083",
"0.6951658",
"0.695033",
"0.6878216",
"0.684731",
"0.68447506",
"0.6838123",
"0.67867166",
"0.6775981",
"0.67657447",
"0.6748171",
"0.6745615",
"0.6698352",
"0.6674586",
"0.66703814",
... | 0.7722254 | 0 |
GET Return all the customer users' userId, name, and email. URL /customers | function getCustomers(req, res) {
var answer = [];
User.find({}, function(err, users) {
if (err) throw err;
for(var i = 0; i<users.length; i++) {
if(!users[i].admin) {
answer.push({userId: users[i]._id, name: users[i].name, email: users[i].email});
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"list() {\n return this.iugu.makePagedRequest('GET', '/customers');\n }",
"fetchSpecificCustomers(id) {\r\n return Api().get('/customers/' + id)\r\n }",
"function getCustomerList() {\n\t// TODO: add logic to call backend system\n\n\n}",
"function getCustomers() {\n console.log('8');\n $.ge... | [
"0.7320257",
"0.69984657",
"0.69642913",
"0.69195944",
"0.6819917",
"0.6808778",
"0.67777574",
"0.6683724",
"0.6607724",
"0.6588683",
"0.65830487",
"0.65676874",
"0.655043",
"0.65014905",
"0.6461242",
"0.6438895",
"0.6412948",
"0.6408919",
"0.6408402",
"0.6404305",
"0.6385692... | 0.72981346 | 1 |
GET Return the order status of the specified order. URL /status?orderID=584342b42f98df8965985b69 | function getOrderStatus(req, res) {
if(req.query.orderID === undefined) {
return res.send("Error: orderID undefined");
}
Order.findOne({_id: req.query.orderID}, function(err, order) {
if (err) throw err;
return res.send(order.status);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getOrderStatus(orderId) {\n return __awaiter(this, void 0, void 0, function* () {\n let response = yield request({\n method: 'get',\n json: true,\n uri: `${this.EFoodAPIOrigin}/api/v1/order/status/${orderId}/`,\n headers: { 'x-core-sessi... | [
"0.77244294",
"0.70756054",
"0.6543379",
"0.65101004",
"0.6164444",
"0.6100166",
"0.6081409",
"0.60803556",
"0.6078036",
"0.6032109",
"0.5950874",
"0.5931992",
"0.583974",
"0.5837124",
"0.58181816",
"0.5800978",
"0.57797563",
"0.5718791",
"0.569007",
"0.56722325",
"0.5647904"... | 0.8065022 | 0 |
Admin requests GET Return all customer orders that have been placed but not delivered. URL /activeOrders | function getActiveOrders(req, res) {
Order.find({status: { $in: activeStatus}}, function(err, orders) {
if (err) throw err;
return res.json(orders);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function adminOrdersFetchCall() {\n return request('get', urls.ADMIN_ORDER_URL);\n}",
"static async listCurrentOrders() {\n const query = `\n SELECT order.id AS \"orId\",\n order.customer_id AS \"cusId\",\n order.delivery_address AS \"addy\"\n FROM orders\n ... | [
"0.6732341",
"0.6476649",
"0.6447403",
"0.6374412",
"0.63644636",
"0.63600934",
"0.63565886",
"0.6307102",
"0.62942594",
"0.6257828",
"0.621339",
"0.6211291",
"0.61896956",
"0.6077949",
"0.6066741",
"0.60649157",
"0.60630685",
"0.60585505",
"0.6005015",
"0.59920233",
"0.59844... | 0.7574684 | 0 |
POST Store the new order status for a specific order. URL /orderStatus | function updateOrderStatus(req, res) {
if(req.body.orderID === undefined) {
return res.send("Error: no orderID specified");
}
Order.findOne({_id: req.body.orderID}, function(err, order) {
if (err) throw err;
if(order === null){
return res.send("Error: no such order exi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"placeOrder() {\n // add item to statuses and store as status \"in progress\"\n console.log(\"Your order is ready.\");\n }",
"savePurchaseOrder(purchaseOrder) {\n\n purchaseOrder.status = PURCHASE_ORDER_STATUS_IN_PROGRESS;\n this.updatePurchaseOrder(purchaseOrder);\n\n }",
"function upda... | [
"0.65965843",
"0.63118184",
"0.6147358",
"0.59851485",
"0.59711236",
"0.59115696",
"0.5888942",
"0.57751507",
"0.5727981",
"0.5726496",
"0.5698549",
"0.5656904",
"0.5646944",
"0.5643262",
"0.55878913",
"0.5584915",
"0.5542042",
"0.55406237",
"0.5510089",
"0.5474984",
"0.54523... | 0.6920921 | 0 |
POST Store new menu item and return it. URL /menu | function addMenuItem(req, res) {
var newItem = new FoodItem(req.body);
console.log(newItem);
newItem.save(function(err, newItem) {
if (err) throw err;
return res.json(newItem);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"insertNewMenu(){\n\t\tfetch(\"/reactui/menu\", {\n method: 'POST',\n\t\t\theaders: {\n\t\t\t\t'Accept': 'application/json',\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t},\n\t\t\tbody: JSON.stringify(this.state.newMenu)\n }).then((resp) => {\n\t\t\treturn resp;\n\t\t}).then((respMessage) =>... | [
"0.76003313",
"0.70412725",
"0.6812183",
"0.6765626",
"0.67256147",
"0.6705598",
"0.66559154",
"0.64652056",
"0.64190185",
"0.6384572",
"0.63171047",
"0.63049644",
"0.62860453",
"0.62209165",
"0.62006783",
"0.6073996",
"0.605232",
"0.6038891",
"0.6031468",
"0.600662",
"0.5994... | 0.7081679 | 1 |
DELETE Remove specified menu item from database. URL /menu | function deleteMenuItem(req, res) {
FoodItem.findOne({_id: req.body.itemID}, function(err, item) {
if (err) throw err;
if(item === null) {
return res.send("Error: no such item");
}
item.remove(function(err) {
if (err) throw err;
return res.send("Su... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeMenu(id){\n return db('menu')\n .where({ id })\n .del()\n}",
"function menuBorrar(req, res) {\n const idParams = req.params.id;\n errorParams(idParams, res);\n Menu.findByIdAndRemove(idParams).exec((err, respDB) => {\n errorBD(err, respDB,res);\n res.status(200).json({\n ok:... | [
"0.7927207",
"0.7103373",
"0.6887212",
"0.6881293",
"0.6808459",
"0.6805908",
"0.671129",
"0.6667769",
"0.666174",
"0.66494745",
"0.6569481",
"0.6563609",
"0.6555546",
"0.6538083",
"0.65164757",
"0.651534",
"0.6506378",
"0.6495212",
"0.64711535",
"0.64637095",
"0.6455055",
... | 0.78458667 | 1 |
fetching data from errorlog table for rerun the scheduler | function errorDataCollection() {
let today = new Date()
let pendingSchedule = ['']
let currentTime = new Date()
let timePeriod = new Date(currentTime.setMinutes(currentTime.getMinutes() - 8));
client.query(`SELECT * from schedule_error WHERE error_area != 'email validation' AND status != 'Suc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"refreshAnomalyTable() {\n const { anomalyIds, exploreDimensions } = this.currentModel;\n if (anomalyIds && anomalyIds.length) {\n get(this, 'loadAnomalyData').perform(anomalyIds, exploreDimensions);\n }\n }",
"function get_data_from_log_table(func)\n{\n\tif(typeof static_local_db=='undef... | [
"0.625712",
"0.56987184",
"0.55910146",
"0.54449993",
"0.54331005",
"0.54055744",
"0.5359964",
"0.53308415",
"0.52409154",
"0.522169",
"0.52164537",
"0.5203963",
"0.51914084",
"0.5180849",
"0.51371044",
"0.51195794",
"0.5112088",
"0.5087484",
"0.5078544",
"0.5068073",
"0.5056... | 0.7026856 | 0 |
remove loadig mask from modal | function unmaskModal() {
var $maskTarget = $(".modal-body");
$maskTarget.closest('.modal-dialog').find('[type="submit"]').removeAttr('disabled');
$(".modal-mask").remove();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function closeModal() {\n $(\".mask\").removeClass(\"active-modal\");\n}",
"_remove() {\n this.backdrop.remove();\n this.modal.remove();\n Utils.removeClass(document.body, 'modal-mode');\n }",
"function removeModal() {\n modal.innerHTML = \"\";\n removeClass(modal... | [
"0.71414036",
"0.6967064",
"0.6928043",
"0.6900116",
"0.6839112",
"0.682834",
"0.67987084",
"0.67844504",
"0.67694855",
"0.6729312",
"0.66909117",
"0.6657209",
"0.6653627",
"0.6600607",
"0.65530455",
"0.6522409",
"0.64977694",
"0.6493927",
"0.6480022",
"0.64788026",
"0.646669... | 0.77769476 | 0 |
abort ajax request on modal close. console.log(dialogFx); | function CloseFxDialog(e) {
$('#app-ajax-modal .modal-dynamic-content').html('');
// console.log('modal close events',e);
// $(this).find(".modal-dialog").removeClass("modal-lg").addClass("mini-modal");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abort() {\n if ( this.xhr ) {\n this.xhr.abort();\n }\n }",
"abort () {\n this.request.abort();\n }",
"abort() {\n if (this.xhr) {\n this.xhr.abort();\n }\n }",
"close() {\n window.http.xmlHtpRequest.abort();\n }",
"cancel() {\n $('... | [
"0.69036615",
"0.6819364",
"0.6784362",
"0.67662436",
"0.671851",
"0.6714289",
"0.6650974",
"0.66455555",
"0.6547914",
"0.64068896",
"0.6378657",
"0.6334685",
"0.6310845",
"0.6302307",
"0.6302307",
"0.62889886",
"0.62829703",
"0.6265919",
"0.6260881",
"0.6260623",
"0.62488747... | 0.70408756 | 0 |
Adds an authorization rule to this endpoint. | addAuthorizationRule(id, props) {
return new client_vpn_authorization_rule_1.ClientVpnAuthorizationRule(this, id, {
...props,
clientVpnEndoint: this,
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function internal_initialiseAclRule(access) {\n let newRule = createThing();\n newRule = setIri(newRule, rdf.type, acl.Authorization);\n if (access.read) {\n newRule = addIri(newRule, acl.mode, internal_accessModeIriStrings.read);\n }\n if (access.append && !access.write) {\n newRule = addIri(newRule, a... | [
"0.53518724",
"0.530408",
"0.5295703",
"0.5171888",
"0.4973788",
"0.4855524",
"0.46431932",
"0.45918423",
"0.4578135",
"0.45691445",
"0.45688903",
"0.45602107",
"0.44586676",
"0.44305253",
"0.4387325",
"0.4367352",
"0.4365117",
"0.43496346",
"0.4349448",
"0.433964",
"0.433628... | 0.6404505 | 0 |
constructor arguments: cl:: object of type [CL11](cl11.html) handle:: OpenCL handle | function CLWrapper(cl, handle, releaseFunction) {
assert(cl instanceof CL11, "Argument 'cl' is not a CL11 instance.");
assert(ref.getType(handle) === ref.types.void, "Argument 'handle' is not a pointer.");
assert(!ref.isNull(handle), "Handle is null.");
Disposable.call(this, releaseFunction);
// #... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(options) {\n super();\n this._kernel = new KernelConnector(options);\n this._context = new ContextConnector(options);\n }",
"function gen_op_ldl_kernel()\n{\n gen_opc_ptr.push({func:op_ldl_kernel});\n}",
"function createLContext(lView,nodeIndex,_native2){return{lView:lVie... | [
"0.5168888",
"0.51356775",
"0.50367385",
"0.49625137",
"0.4949822",
"0.4907119",
"0.48962805",
"0.48678347",
"0.48567903",
"0.4853583",
"0.48302686",
"0.48228937",
"0.48228937",
"0.48228937",
"0.48228937",
"0.48228937",
"0.48228937",
"0.481383",
"0.480489",
"0.4803235",
"0.47... | 0.81737417 | 0 |
Closes the milestone by number | closeMilestone(number) {
return this.patch(`milestones/${number}`, { state: 'closed' }).then(
({ code, body }) => {
if (code !== 200) return Promise.reject(body);
else return body;
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function close(n){\n\t\treturn barsAgo(CLOSE,n);\n\t}",
"_close() {\n set(this, 'isOpen', false);\n set(this, 'isToStep', false);\n\n let action = get(this, 'attrs.closeAction');\n let vals = get(this, '_dates');\n let isRange = get(this, 'range');\n\n if (action) {\n action(isRange ? vals... | [
"0.61144936",
"0.5881121",
"0.5792084",
"0.5696418",
"0.567205",
"0.5663822",
"0.55725956",
"0.5498331",
"0.53649366",
"0.53035235",
"0.5291249",
"0.5291249",
"0.5208043",
"0.52034384",
"0.520063",
"0.51972425",
"0.5183096",
"0.51806325",
"0.5175055",
"0.51574785",
"0.5107038... | 0.81170195 | 0 |
Hack for replacing response body vars with dynamic URI params | function parseUriVars(uriVars, reqUrl, respBody) {
var k = null;
for (var k in uriVars) {
if (uriVars.hasOwnProperty(k)) {
var replacementValue = reqUrl.split('/').filter(el => {return !!el})[k];
respBody = respBody.replace(URL_VAR_REGEX, replacementValue);
}
}
re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rewriteURIForGET(chosenURI, body) {\n // Implement the standard HTTP GET serialization, plus 'extensions'. Note\n // the extra level of JSON serialization!\n var queryParams = [];\n var addQueryParam = function (key, value) {\n queryParams.push(key + \"=\" + encodeURIComponent(value));\... | [
"0.5775589",
"0.5758471",
"0.5758471",
"0.57027376",
"0.56722003",
"0.56715554",
"0.56715554",
"0.5544978",
"0.55126494",
"0.5461489",
"0.53812575",
"0.53673273",
"0.53009576",
"0.53003883",
"0.527321",
"0.52616066",
"0.5228786",
"0.5202805",
"0.5154325",
"0.5144916",
"0.5087... | 0.67443967 | 0 |
Return a challenge corresponding to the given challegeID. | challenges(challengeID) {
return __awaiter(this, void 0, void 0, function* () {
const deployed = this.requireDeployed();
return yield deployed.methods.challenges(challengeID).call();
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getChallenge(challengeId) {\n return wordChallenges.findOne({ _id: challengeId });\n }",
"getChallengeID() {\r\n let matches = this._challengeURLMatches();\r\n return matches[1];\r\n }",
"function _getChallengeById(req, res, next) {\n var json = {};\n var query = { \"_id\": new Object... | [
"0.6971245",
"0.62784463",
"0.58492416",
"0.55079806",
"0.54730904",
"0.5441973",
"0.5395898",
"0.51554036",
"0.5043459",
"0.5019115",
"0.4908836",
"0.48976633",
"0.48744273",
"0.4806224",
"0.4806224",
"0.48039496",
"0.48034048",
"0.4802444",
"0.4792775",
"0.47824928",
"0.475... | 0.6414845 | 1 |
Pepare the deploy options, passing them along with the instantiated web3 and optional contract options to the super class' _deploy method. | deploy(web3, params, opts) {
const _super = name => super[name];
return __awaiter(this, void 0, void 0, function* () {
const dp = {
abi: Registry_json_1.default.abi,
bytecode: Registry_json_1.default.bytecode,
args: [
params... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"deploy(web3, params, opts) {\n const _super = name => super[name];\n return __awaiter(this, void 0, void 0, function* () {\n const dp = {\n abi: Parameterizer_json_1.default.abi,\n bytecode: Parameterizer_json_1.default.bytecode,\n args: [\n ... | [
"0.7261169",
"0.6316964",
"0.57954097",
"0.55136895",
"0.5453097",
"0.5438545",
"0.5392325",
"0.53471273",
"0.5239186",
"0.5185985",
"0.5051503",
"0.5004959",
"0.4959975",
"0.49317",
"0.49084374",
"0.4884491",
"0.4848416",
"0.48382464",
"0.48246276",
"0.4811499",
"0.47355208"... | 0.6881086 | 1 |
Return a bool indicating if this listing has been whitelisted | isWhitelisted(listing) {
return __awaiter(this, void 0, void 0, function* () {
const deployed = this.requireDeployed();
return yield deployed.methods.isWhitelisted(listing).call();
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isBlacklisted() {\n\t var blacklist = this.opts.blacklist;\n\t return blacklist && blacklist.indexOf(this.node.type) > -1;\n\t}",
"function isBlacklisted() {\n\t var blacklist = this.opts.blacklist;\n\t return blacklist && blacklist.indexOf(this.node.type) > -1;\n\t}",
"function isBlacklisted() {\... | [
"0.6541155",
"0.6541155",
"0.6449632",
"0.6285243",
"0.5984127",
"0.59645337",
"0.591445",
"0.59121346",
"0.580228",
"0.57853556",
"0.5738085",
"0.5717761",
"0.56691015",
"0.5668057",
"0.5640495",
"0.5622889",
"0.559966",
"0.55952406",
"0.5587593",
"0.5568334",
"0.5550307",
... | 0.6948313 | 0 |
Return the name passed to this contract instance at deploy time | name() {
return __awaiter(this, void 0, void 0, function* () {
const deployed = this.requireDeployed();
return yield deployed.methods.name().call();
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deploySingle(contractName){\n return `\n const A = artifacts.require(\"${contractName}\");\n module.exports = function(deployer) { deployer.deploy(A) };\n `;\n}",
"function getAssetName(assetAddr){\n return tokenContract.methods.getContractName(assetAddr).call();\n }",
"function getName() ... | [
"0.63645667",
"0.60966045",
"0.5953498",
"0.59323144",
"0.58770484",
"0.57235014",
"0.566225",
"0.5619028",
"0.56117105",
"0.55981636",
"0.5573826",
"0.5566985",
"0.55458844",
"0.55158335",
"0.5502829",
"0.55023736",
"0.54788876",
"0.54555434",
"0.54370517",
"0.5435066",
"0.5... | 0.616771 | 1 |
Updates a listingHash's status from 'application' to 'listing' or resolves a challenge if one exists. Delegates to `whitelistApplication` or `resolveChallenge` | updateStatus(listing, opts) {
return __awaiter(this, void 0, void 0, function* () {
const account = this.requireAccount(opts), deployed = this.requireDeployed();
return yield deployed.methods.updateStatus(listing).send({ from: account });
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"appWasMade(listing) {\n return __awaiter(this, void 0, void 0, function* () {\n const deployed = this.requireDeployed();\n return deployed.methods.appWasMade(listing).call();\n });\n }",
"function handleUpdateListing(e) {\n //e.preventDefault();\n\n // get new data from m... | [
"0.5223855",
"0.4951868",
"0.48654446",
"0.4864351",
"0.4799458",
"0.47674277",
"0.46703455",
"0.4588139",
"0.45853782",
"0.45470458",
"0.45210463",
"0.44564027",
"0.44555843",
"0.44072017",
"0.4376598",
"0.43688685",
"0.43531272",
"0.432941",
"0.43260267",
"0.43152893",
"0.4... | 0.62385035 | 0 |
The study feature. variation: study info about particular client study variation studyUtils: the configured studyUtils singleton. reasonName: string of bootstrap.js startup/shutdown reason logLevel: the log level from Config.jsm ( uses same level as bootstrap.js) | constructor({variation, studyUtils, reasonName, logLevel}) {
this.treatment = variation.name;
this.studyUtils = studyUtils;
this.reasonName = reasonName;
// Randomize frame script URL due to bug 1051238.
this.FRAME_SCRIPT_URL =
`resource://${STUDY}/content/new-tab-variation.js?${Math.random()}`,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getStudyState() {\n return this.study_state;\n }",
"getStudyStatus() {\n return this.study_status;\n }",
"function getScenario (name) {\n var scenario = { name: name }\n scenario.config = require(`../examples/${name}/webpack.config`)\n\n try {\n var manifest = require(`../examples/${name}/package... | [
"0.5128658",
"0.50991416",
"0.49080807",
"0.49036923",
"0.48992968",
"0.48587966",
"0.47773543",
"0.471713",
"0.4692595",
"0.4628808",
"0.46274167",
"0.4625167",
"0.45750666",
"0.44930327",
"0.44772887",
"0.44549042",
"0.44508377",
"0.44479096",
"0.44365692",
"0.4416215",
"0.... | 0.54558784 | 0 |
add a horizontal reference line (and rescale chart if necessary) | function addReferenceLine(chart, value, yaxis) {
yaxis = yaxis || 0;
// add reference line
chart.yAxis[yaxis].addPlotLine({
value: value,
color: 'red',
dashStyle: 'dot',
width: 2
});
// add to the values that should be included on the chart (ie. rescale list)
chartInc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addLine () {\n\tconst linksCoords = this.getBoundingClientRect();\n\tline.style.width = `${linksCoords.width}px`;\n\tline.style.transform = `translate(${linksCoords.left}px, ${linksCoords.top}px)`;\n\tline.style.opacity = 1;\n}",
"function renderAxisLine() {\n ctx.save();\n ... | [
"0.6873988",
"0.6289484",
"0.62650836",
"0.6237712",
"0.60501766",
"0.60153943",
"0.59681445",
"0.594657",
"0.5936607",
"0.583125",
"0.58251613",
"0.5798592",
"0.5762405",
"0.57575756",
"0.5748796",
"0.57458395",
"0.574221",
"0.57418716",
"0.574093",
"0.5739442",
"0.5731919",... | 0.7033804 | 0 |
set y axis title and label color | function setYAxisColor(chart, color, yaxis) {
yaxis = yaxis || 0;
chart.yAxis[yaxis].update({
title: { style: { color: color } },
labels: { style: { color: color } }
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setYAxisTitleFtn(chart, index, labels) {\n $log.info('setting the Y Axis title: ' + labels[index]);\n chart.options.vAxis.title = labels[index];\n }",
"function setYAxisTitleFtn(chart, index, labels) {\n $log.info('setting the Y Axis title: ' + labels[index]);\n chart.op... | [
"0.7211678",
"0.7211678",
"0.69628364",
"0.6746738",
"0.6605784",
"0.65127677",
"0.63657725",
"0.6360708",
"0.61986953",
"0.61933553",
"0.60415703",
"0.58542657",
"0.57747245",
"0.5773445",
"0.5767792",
"0.576734",
"0.576734",
"0.5737276",
"0.5737276",
"0.57358855",
"0.572392... | 0.73200464 | 0 |
get the user's project count to implement pagination | async function fetchProjectCount() {
if (loggedInUser) {
const projectCountResult = await fetch(
`/searchProjects/${loggedInUser._id}/count/${query}`,
{
method: "GET",
}
);
const parsedProjectsData = await projectCountResult.json();
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function numPages(){\n let no_pages = Math.ceil(all_projects.length/per_page);\n return parseInt(no_pages);\n }",
"function projectCount() {\n $http.get('../api/project/count')\n .success(function (data, status, headers, config) {\n cons... | [
"0.72571236",
"0.698243",
"0.6689139",
"0.6434947",
"0.6403922",
"0.62969476",
"0.6218683",
"0.61550844",
"0.6129921",
"0.610201",
"0.60687286",
"0.60455346",
"0.6043784",
"0.6022392",
"0.6004966",
"0.596928",
"0.5943809",
"0.59359586",
"0.59309965",
"0.58342564",
"0.5809787"... | 0.80330926 | 0 |
Adds focus event to the input. On focus selects the text content of the input. | addFocusEventListener() {
this.input.addEventListener('focus', () => this.input.select());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function focusInputElement () {\n elements.input.focus();\n }",
"function focusInputElement () {\n elements.input.focus();\n }",
"focus() {\n this.$.input._focusableElement.focus();\n }",
"focus () {\n const { textInput } = this;\n textInput && textInput.focus();\n }",
"focus() {\n ... | [
"0.7055412",
"0.7055412",
"0.68872213",
"0.6880144",
"0.6875773",
"0.6875565",
"0.68479896",
"0.68452066",
"0.6843065",
"0.6797068",
"0.679039",
"0.6767311",
"0.66292423",
"0.6601434",
"0.6599773",
"0.6553613",
"0.6477195",
"0.6431828",
"0.6429465",
"0.6407373",
"0.63576",
... | 0.73644197 | 0 |
Add Event Listeners Adds a click event listener to the reset button. On click sets the value to every entry in the input matrix to a blank string. | addResetButtonListener() {
this.resetBtn.addEventListener('click', () => this.entries().forEach(entry => entry.value = ""));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addResetListener() {\n\t\t$('#reset').on('click', resetBoard)\n\t\t\n\t}",
"function addResetListener() {\n var resetButton = document.getElementById('reset');\n resetButton.addEventListener('click', resetBoard);\n}",
"function reset() {\r\n turn = 1;\r\n clickCounter = 0;\r\n win1 = -1;\r\... | [
"0.6735011",
"0.6689606",
"0.6662631",
"0.66318655",
"0.66318655",
"0.65800375",
"0.6569994",
"0.65472484",
"0.6508659",
"0.6502485",
"0.64979905",
"0.64452064",
"0.64181393",
"0.6368874",
"0.635599",
"0.63265955",
"0.6323387",
"0.6309487",
"0.6270637",
"0.6253161",
"0.622866... | 0.7311259 | 0 |
Initialize Matrix Input Grid Generates the initial entries for the input matrix. | initMatrix() {
const rows = this.rows();
const columns = this.columns();
for (let row = 0; row < rows; row++) {
for (let col = 0; col < columns; col++) {
this.matrix.appendChild(this.createMatrixEntry(row, col, this.ID));
}
}
this.setMatrixGridRows(rows);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createInitialGrid() {\n let gridArray = [];\n for(let row = 0; row < this.gridData.getSize(); row++){\n for(let col = 0; col < this.gridData.getSize(); col++){\n let cell = new Cell(row, col);\n gridArray.push(cell);\n }\n }\n\n this._... | [
"0.72385544",
"0.71468896",
"0.70017624",
"0.6849892",
"0.66762555",
"0.667294",
"0.6483828",
"0.6481032",
"0.64789253",
"0.64389604",
"0.6355339",
"0.62756467",
"0.6231351",
"0.62100494",
"0.62091005",
"0.61918527",
"0.6187529",
"0.6180396",
"0.6161365",
"0.6132321",
"0.6129... | 0.7775112 | 0 |
Constructs a new RoomPool and sets listeners and emitters from the given socket.io instance. | constructor(socketIoInstance) {
this.rooms = {};
SafeSocket.socketsOn(socketIoInstance, 'connection', (socket) => {
Logger.logInfo('socket ' + socket.id + ' connected');
socket.emit('clientConnectedToServer', {
socketId: socket.id
});
// Default socket.io actions
socket.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function RoomSocket(io, roomId){\n this.roomId = roomId;\n this.io = io;\n}",
"constructor(socket, logger, socketManager) {\n this.socket = socket;\n this.logger = logger;\n this.socketManager = socketManager;\n\n /**\n * Create a map of event handlers to be used during the\n * handler bind... | [
"0.69521755",
"0.6355749",
"0.6265657",
"0.6171448",
"0.59839207",
"0.5929215",
"0.5885986",
"0.5880528",
"0.57616717",
"0.5724911",
"0.5722843",
"0.5722817",
"0.56957006",
"0.56906736",
"0.5675947",
"0.5657708",
"0.565391",
"0.5651382",
"0.5636755",
"0.56223243",
"0.5620404"... | 0.6916228 | 1 |
PRIVATE METHODS Attempts to add a player identified by the given username and socket to the room identified by the given room code. Returns true if successful, false if unsuccessful. | _addPlayerToRoom(socket, username, roomCode) {
if (!this.roomExists(roomCode)) {
return false;
}
return this.rooms[roomCode].addPlayer(socket, username);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addPlayer(socket, username) {\n if (this.playerMap.getPlayerCount() >= MAX_PLAYERS) {\n return false;\n }\n\n if (!this.playerMap.containsUsername(username) && !this.gameServer.isInGame()) {\n this.playerMap.putPlayer(new Player(socket, username));\n\n if (this.hostSocket === undefined) {\n... | [
"0.7259357",
"0.6986688",
"0.65623856",
"0.6164955",
"0.616157",
"0.60117674",
"0.58439666",
"0.5842452",
"0.58084244",
"0.5745237",
"0.57409793",
"0.57213867",
"0.5685096",
"0.5671052",
"0.56618416",
"0.5655997",
"0.56455445",
"0.5608213",
"0.55980283",
"0.5526065",
"0.55140... | 0.902076 | 0 |
Returns the room code associated with the given socket. Returns undefined if none exists. | _getRoomCodeFromSocket(socket) {
if (socket && socket.rooms) {
return socket.rooms[Object.keys(socket.rooms)[1]];
}
return undefined;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getRoomInfo(socket, game) {\n if(socket && game) {\n const room = Array.from(socket.rooms)[1];\n const existingGame = game.map(game => game.roomId).indexOf(room);\n return existingGame;\n }\n else {\n return -1;\n }\n}",
"function GetRoomHost(RequestingSocket, Roo... | [
"0.677028",
"0.64517397",
"0.6379158",
"0.63646704",
"0.6343907",
"0.6165044",
"0.6035847",
"0.60143197",
"0.5894607",
"0.5782973",
"0.576276",
"0.56828135",
"0.55689883",
"0.54989797",
"0.5497969",
"0.5470038",
"0.54437405",
"0.54031354",
"0.54011744",
"0.5392365",
"0.537356... | 0.89912665 | 0 |
Returns the sanitized username from the given data object. Returns empty string if unsuccessful. | _getSanitizedUsername(data) {
if (!data || !data.username) {
return "";
}
return StringSanitizer.getHtmlSanitized(data.username).substring(0, MAX_USERNAME_LENGTH);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getUserName(authData) {\n switch (authData.provider) {\n // case 'password':\n // return authData.password.email.replace(/@.*/, '');\n case 'twitter':\n return authData.twitter.username;\n // case 'facebook':\n ... | [
"0.6556607",
"0.6441322",
"0.6351614",
"0.62824726",
"0.62534326",
"0.6222458",
"0.62051564",
"0.593441",
"0.58392864",
"0.57818395",
"0.5737936",
"0.5735899",
"0.57323736",
"0.5671924",
"0.567183",
"0.5656397",
"0.5636011",
"0.560751",
"0.560013",
"0.5596617",
"0.55797195",
... | 0.8672377 | 0 |
PUBLIC METHODS Returns the number of active rooms within the RoomPool. | getNumRooms() {
return Object.keys(this.rooms).length;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static numActiveGames() {\n return Rooms.getAll()\n .filter(({isActive}) => isActive)\n .length;\n }",
"static totalNumPlayers() {\n return Rooms.getAll()\n .filter(({isActive}) => isActive)\n .reduce((count, {players}) => {\n return count + players.filter(x => x.isConnected && ... | [
"0.7090985",
"0.6865184",
"0.6586705",
"0.65550524",
"0.6523901",
"0.6487544",
"0.6442403",
"0.63598233",
"0.63311267",
"0.6260583",
"0.6251814",
"0.61382014",
"0.59974605",
"0.598827",
"0.59823996",
"0.5964406",
"0.59638923",
"0.5648914",
"0.5622821",
"0.5615856",
"0.5610976... | 0.73321277 | 0 |
Returns the room associated with the given room code. | getRoom(roomCode) {
return this.rooms[roomCode];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getRoom(roomCode) {\n var ref = firebase.database().ref(\"Rooms/\" + roomCode);\n var room = $firebaseObject(ref);\n \n return room;\n }",
"getRoom() {\n const id = this.roomName;\n\n if (!activeRooms.hasOwnProperty(id)) {\n throw new... | [
"0.81037015",
"0.6867597",
"0.68174833",
"0.65568066",
"0.6457666",
"0.6432544",
"0.63360745",
"0.62797904",
"0.62742895",
"0.62188333",
"0.6176027",
"0.6173807",
"0.61285734",
"0.60923064",
"0.60649204",
"0.59586626",
"0.59307027",
"0.59038717",
"0.58686805",
"0.5835802",
"0... | 0.83012074 | 0 |
Removes the Room associated with the given room code from the pool. | removeRoom(roomCode) {
Logger.logInfo('Removing room: ' + roomCode);
this.rooms[roomCode].forceEndGame();
delete this.rooms[roomCode];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteRoom(roomCode){\n let room = rooms[roomCode];\n if(room){\n let players = room.players;\n for(let i = 0; i < players.length; i++){\n let player = players[i];\n delete socks[player].room;\n }\n delete rooms[roomCode];\n }\n}",
"function removeRoom(room) {\n\n // Get the ... | [
"0.77561486",
"0.68303543",
"0.6174956",
"0.5931559",
"0.58749324",
"0.58472323",
"0.58472323",
"0.57995254",
"0.57529414",
"0.57374996",
"0.5692177",
"0.5665478",
"0.5627274",
"0.5608368",
"0.5488951",
"0.54682386",
"0.5447557",
"0.5413424",
"0.5396953",
"0.5335224",
"0.5323... | 0.83133036 | 0 |
Reserves a new room with a new, random, and unused room code. Returns the new room code. | reserveNewRoom() {
var newRoomCode;
do {
newRoomCode = Hasher.genHash(ROOM_CODE_LENGTH);
} while(this.roomExists(newRoomCode));
this.rooms[newRoomCode] = new Room(newRoomCode);
return newRoomCode;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function genRoomCode() {\n const roomSeed = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',\n rooms = io.sockets.adapter.rooms;\n let code\n do {\n code = ''\n for (var i = 0; i < 5; i++) {\n code += roomSeed[getRandomInt(roomSeed.lengt... | [
"0.6878282",
"0.65021133",
"0.6363232",
"0.63338953",
"0.6167534",
"0.6124831",
"0.6070692",
"0.59665966",
"0.5927118",
"0.590617",
"0.5899809",
"0.58489764",
"0.5801537",
"0.57892317",
"0.5769441",
"0.57183534",
"0.57066935",
"0.5628291",
"0.55877244",
"0.55680364",
"0.55564... | 0.85030913 | 0 |
Returns whether a room exists for the given room code. | roomExists(roomCode) {
return this.rooms.hasOwnProperty(roomCode);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function roomExists(code) {\r\n try {\r\n console.log(\"checking if room with code: \" + code + \" exists\");\r\n console.log(rooms[code]);\r\n if(code == null || code == undefined || typeof code != 'string' || !rooms[code]) {\r\n console.log(\"it's bad\");\r\n return ... | [
"0.8155792",
"0.6707367",
"0.66065294",
"0.6592731",
"0.6389099",
"0.6184209",
"0.61693615",
"0.61344033",
"0.59396476",
"0.58948386",
"0.58383",
"0.57602453",
"0.57387096",
"0.56388247",
"0.5636944",
"0.5549528",
"0.5495908",
"0.5493824",
"0.54198974",
"0.53347903",
"0.53254... | 0.8139524 | 1 |
SOCKET LISTENERS Attempts to end a game for the Room associated with the given socket. | hostAttemptEndGame(socket, data) {
Logger.logInfo('Socket ' + socket.id + ' attempting to end game');
var roomCode = this._getRoomCodeFromSocket(socket);
if (this.roomExists(roomCode)) {
var room = this.getRoom(roomCode);
if (room.attemptEndGame(socket)) {
Logger.logInfo('Game at room '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static onSocketDisconnect(socket) {\n Object.keys(socket.rooms).forEach(room => {\n try {\n if (rooms.isRoomExists(room)) {\n if (rooms.getRoomPlayersCount(room) === 1) {\n rooms.removeRoom(room);\n } else {\n ... | [
"0.67095983",
"0.65666056",
"0.6465502",
"0.63598245",
"0.63392496",
"0.6291714",
"0.6026626",
"0.60133773",
"0.59561044",
"0.5952015",
"0.5904428",
"0.59020364",
"0.58681196",
"0.583592",
"0.5810024",
"0.5774309",
"0.57681537",
"0.57665354",
"0.57302386",
"0.57266414",
"0.57... | 0.66460216 | 1 |
Create randomizer to pull 4 different powers of a pokemon and push it into a new array | function getRandomPower(movesArr, data) {
let min = 0;
let max = data.moves.length;
let randomMove = Math.floor(Math.random() * (max - min) + min);
movesArr.push(data.moves[randomMove]); // put the four random moves in a new array
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generatePokemonAry(){\n wildPokemon = []\n\n for (let i = 1; i < 650; i++) {\n wildPokemon.push(i);\n \n }\n return wildPokemon;\n \n}",
"async function generatePokemonArray(pokemon) {\n randomPokemon = pokemon[Math.floor(Math.random() * 151)]\n getRandomPokemonData(ra... | [
"0.7005367",
"0.67773926",
"0.6680528",
"0.6574842",
"0.65537995",
"0.6510981",
"0.65074015",
"0.6484808",
"0.6430658",
"0.63793385",
"0.6373412",
"0.6362663",
"0.6345218",
"0.62932444",
"0.6280637",
"0.6278372",
"0.6272051",
"0.6262572",
"0.624271",
"0.6241701",
"0.6209146",... | 0.7426572 | 0 |
Create a function called travelFrom that receives a start station and an end station. | function travelFrom() {
var startStationInput = document.querySelector("#startStation");
var startStation = startStationInput.value;
var endStationInput = document.querySelector("#endStation");
var endStation = endStationInput.value;
var start = capitaliseFirstLetter(startStation.toLowerCase());
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_journey(station1, station2) {\n const toDate = new Moment().format(\"YYYY-MM-DD\");\n const fromDate = new Moment().businessSubtract(20).format(\"YYYY-MM-DD\");\n\n return {\n \"from_loc\":station1,\n \"to_loc\":station2,\n \"from_time\":\"0000\",\n ... | [
"0.62054175",
"0.5913088",
"0.5890718",
"0.57346815",
"0.5714327",
"0.56850135",
"0.56673986",
"0.5622518",
"0.557216",
"0.5567229",
"0.5535041",
"0.55243945",
"0.5486196",
"0.5436927",
"0.5353946",
"0.53172594",
"0.53129697",
"0.527652",
"0.52694666",
"0.52590513",
"0.521350... | 0.64472765 | 0 |
Initializes the turn and turn timer, returns timerId | function startTurnTimer(timerId, turnDuration) {
console.log('\nInitializing turn timer!');
// Initialize or reset time remaining
gameState.nextTurnTimestamp = Date.now() + turnDuration;
console.log( 'Next turn at: ' + new Date(gameState.nextTurnTimestamp).toString().substring(16,25) );
// Every time the timer ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function startTurnTimer(timerId, turnDuration, socketId) {\n\t// If turn timer isn't already running\n\tif (!timerId) {\n\t\tconsole.log('Initializing turn timer!');\n\n\t\t// Initialize time of next turn change (will use this to sync the clients)\n\t\tnextTurnChangeTimestamp = Date.now() + turnDuration;\n\n\t\tco... | [
"0.69657207",
"0.6415698",
"0.6256748",
"0.62334555",
"0.61666274",
"0.6148235",
"0.6038309",
"0.6023115",
"0.60155964",
"0.60087466",
"0.5994431",
"0.5968748",
"0.5964544",
"0.5924045",
"0.5791115",
"0.57769287",
"0.5763371",
"0.5730712",
"0.5725152",
"0.5721867",
"0.5715033... | 0.6997706 | 0 |
Start of ajax call for removing a post | function RemoveAPost(btn) {
var postId = $(btn).attr('data-postid');
$.ajax({
type: 'POST',
url: `/Admin/RemoveAPost/${postId}`,
success: function (response) {
window.location.href = response.redirectToUrl;
alert('Post removed!');
},
error: functi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteThisPost() {\n $.ajax({\n //Send ID of swiped list item to PHP\n type: 'GET',\n //Value stored in each post used to identif... | [
"0.74011403",
"0.6939452",
"0.6862429",
"0.6830156",
"0.67660993",
"0.67588466",
"0.6688149",
"0.667774",
"0.6639187",
"0.6617146",
"0.65562356",
"0.6553251",
"0.6538168",
"0.6498257",
"0.6489831",
"0.64780706",
"0.64377844",
"0.64377695",
"0.64071834",
"0.63691413",
"0.63641... | 0.70103455 | 1 |
return true, if can cut into k piece by length | function count(lengthArray, woodLength, k) {
var count = 0;
var curLength;
var i;
for (i = 0; i < lengthArray.length; i++) {
curLength = lengthArray[i];
while (curLength >= woodLength) {
count++;
curLength -= woodLength;
}
}
return count >= k;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function testK(k) {\n let commonDivisor = (num) => {\n return mul.some((item) => (num % item[0] === 0));\n };\n return Array.prototype.every.call(s, (item, index) => (commonDivisor(k + index) === (item === '0')));\n }",
"function maxLength1(a, k) {\n const isSatisfied = (a, stInd, l, k) => {\n ... | [
"0.6280222",
"0.6198108",
"0.5851191",
"0.5755905",
"0.5754568",
"0.5742839",
"0.5736298",
"0.5722663",
"0.57152003",
"0.57106644",
"0.56659245",
"0.56531304",
"0.562795",
"0.56271684",
"0.5596762",
"0.55515015",
"0.55319893",
"0.5477165",
"0.54232216",
"0.54221916",
"0.54202... | 0.6333416 | 0 |
Send a heartbeat to all opened sockets | function sendHeartbeat() {
_.forOwn(_this.socks, function (sock) {
sock.write('hb');
});
setTimeout(sendHeartbeat, _this.heartbeatFreq);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function heartbeat() {\n io.sockets.emit('heartbeatUsers', users);\n io.sockets.emit('heartbeatMarks', marks);\n}",
"function heartbeat() {\n\n board.updateEnemy();\n var data = {\n player_dico: board.player_dic,\n enemy_list: board.enemy,\n waveNum: board.wave_num\n };\n io.so... | [
"0.7641542",
"0.74248743",
"0.722528",
"0.7070184",
"0.7062787",
"0.6954447",
"0.69473207",
"0.678155",
"0.67734224",
"0.6717606",
"0.6688937",
"0.667452",
"0.6626364",
"0.6515311",
"0.64502543",
"0.6448521",
"0.6386508",
"0.6329419",
"0.63277787",
"0.6290269",
"0.62535113",
... | 0.8098782 | 0 |
Check that all clients respond to the heartbeat in time | function checkClientsHeartbeat() {
var now = Date.now();
_.forOwn(_this.socks, function (sock) {
if (sock.hb + _this.clientTimeout < now) {
logout(sock);
}
});
setTimeout(checkClientsHeartbeat, 1000)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkHeartBeat() {\n for (var username in users) {\n sendHeartBeatToAnUser(username);\n }\n}",
"function funCheckHB() {\n try {\n for (let i = 0; i < global.aryClients.length; i++) {\n // If current time > (last HB received + timeout e.g. 30 seconds)\n if (Date.now() > global.... | [
"0.7300449",
"0.70118845",
"0.6828728",
"0.6795977",
"0.67125016",
"0.668401",
"0.6624302",
"0.66224736",
"0.65680563",
"0.6559366",
"0.6551395",
"0.6535189",
"0.6523065",
"0.6519578",
"0.6452377",
"0.6451966",
"0.6442796",
"0.6367847",
"0.6357087",
"0.63551205",
"0.63424665"... | 0.78225017 | 0 |
listar los materiales x tipo de caja y cantidad | function listarMaterialesCaja(id_tipo_caja) {
var cantidad = $("#cantidad").val();
cantidad = (cantidad=='')? 0: cantidad;
$.ajax({
url: $.PATH + "almacen?function=listMaterialesCaja",
data: {id_tipo_caja: id_tipo_caja},
dataType: "json",
cache: false,
type: "get",
succes... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function genera_parametros(){\r\n\tx_0=103;\r\n\tm=1001;\r\n\tprimos.forEach(a=>{\r\n\t\tprimos.forEach(c=>{\r\n\t\t\tnum_ale = generador_mixto(a,c,x_0,m)\r\n\t\t\tif(num_ale.length == m){ //tambien deberia revisar si hay numeros repetidos\r\n\t\t\t\timprimir_configuracion_parametros_a_pantalla\r\n\t\t\t}\r\n\t\t}... | [
"0.5611846",
"0.5522354",
"0.5487825",
"0.54733056",
"0.54161376",
"0.5362004",
"0.53283936",
"0.5312302",
"0.5306814",
"0.5301719",
"0.5290203",
"0.5288451",
"0.5285376",
"0.5266509",
"0.5254296",
"0.5251927",
"0.52505857",
"0.524609",
"0.52444655",
"0.52305555",
"0.52245694... | 0.56832665 | 0 |
Facts Fetches facts from the servers and adds them to the DOM. | function getFacts() {
fetch('/data').then(response => response.json()).then((fact) => {
// fact is an object, not a string, so we have to
// reference its fields to create HTML content
const factsListElement = document.getElementById('server-facts-container');
factsListElement.innerHTML = '';
fac... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fetchFacts() {\n // call fetch on the cat facts api getting one random fact\n fetch(`https://cat-fact.herokuapp.com/facts/random?animal_type=cat&amount=1`)\n // when you get a response, save the text\n .then(response => response.text())\n // get the data from response.text\n .then(data =... | [
"0.6238689",
"0.5538138",
"0.5525729",
"0.5382872",
"0.5271777",
"0.51738405",
"0.5134809",
"0.5119229",
"0.50667167",
"0.50391287",
"0.50315523",
"0.5027485",
"0.5012915",
"0.4953205",
"0.4859165",
"0.4812556",
"0.48059362",
"0.47641572",
"0.47627264",
"0.473448",
"0.4721609... | 0.7512953 | 0 |
TODO: 1. drawTiles instead of animateFight 2. do not move but start figting | function animateFight(res){
loadTilemap({
'animation' : res.animation,
'direction': res.direction,
});
console.log(res);
loopFight(res)
/*
// var targetTile = { 'x' : cursorX + res.animation.x, 'y' : cursorY + res.animation.y;
$.post(gameurl, {
'class': 'map',
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function animate() {\n \t// call again next time we can draw\n \trequestAnimationFrame(animate);\n \t// clear canvas\n \tctx.clearRect(0, 0, cvWidth, cvHeight);\n \t// draw gameObjects\n \tfor (var obj of gameObjects) {\n \t\tif (obj.hasOwnProperty('tileID')) {\n\t \t\tctx.drawImage(SVGTiles[obj.tileID], o... | [
"0.7226908",
"0.70082825",
"0.6970953",
"0.6858111",
"0.6821993",
"0.6760133",
"0.6760034",
"0.66750056",
"0.6672165",
"0.66682374",
"0.66538596",
"0.6637454",
"0.6632285",
"0.6614243",
"0.6607741",
"0.6602935",
"0.6602935",
"0.64913267",
"0.6472996",
"0.64635205",
"0.6459503... | 0.716197 | 1 |
Select the current staff member. | function selectStaffMember(member, index) {
vm.isSelected = false;
vm.selectedMemberIndex = index;
vm.selectedMember = angular.isDefined(member) ? member : vm.staffMembers[0];
if (!$mdSidenav('left').isLockedOpen()) {
$mdSidenav('left').close();
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fnselectMember(){\r\n\tastrMemberName=fngetElementsByClass('btn_assign_unassign',document,'div'); \r\n\tfnteamStatus();\r\n}",
"function select ( menuId ) {\r\n // self.selected = angular.isNumber(menuId) ? $scope.users[user] : user;\r\n self.toggleList();\r\n }",
"function activate() {... | [
"0.6085138",
"0.60093236",
"0.5921727",
"0.5857276",
"0.5638627",
"0.5568501",
"0.551495",
"0.5491164",
"0.54646754",
"0.5442988",
"0.5425162",
"0.54168624",
"0.5379206",
"0.53753644",
"0.5370801",
"0.53613",
"0.5348411",
"0.5306193",
"0.52819854",
"0.523915",
"0.5230852",
... | 0.71720594 | 0 |
Checks for validity of common search params (non resource specific). | function validateCommonParams(params, onSuccess, onError) {
var countRegExp = /^\d+$/;
var errors = [];
// validate _count
if (params._count) {
// _count should be an integer
if (!countRegExp.test(params._count)) {
errors.push(validationErrors.INVALID_COUNT);
}
}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"checkSearchParam(search) {\n check(search, String);\n }",
"function check_params(params){\n for(var i=0; i < params.length; i ++){\n if(!params_search[params[i]]){\n return false\n }\n }\n return true;\n }",
"function ... | [
"0.7056248",
"0.67399013",
"0.6473527",
"0.63690734",
"0.63413846",
"0.62511694",
"0.62457293",
"0.62457293",
"0.62457293",
"0.62457293",
"0.62457293",
"0.62457293",
"0.62457293",
"0.62457293",
"0.62457293",
"0.62457293",
"0.62457293",
"0.62457293",
"0.62457293",
"0.62457293",
... | 0.7054256 | 1 |
Returns a date range query that includes the missing date specificity (if any). A date that specifies year, month, date but not time will search for a range within that day (from 00:00 to 23:59), a date that specifies year, month, but not date, will search for a range within that month (from 1st day to the last), and s... | function buildImplicitDateRangeQuery(dateStr, jdsProperty, isNegated, ignoreTime, includeSeconds) {
var query = '';
if (YYYY_MM_DD_HH_MM_SS_Regex.test(dateStr)) {
// this is an exact match search
query = getExactDateQuery(new Date(dateStr), jdsProperty, isNegated, ignoreTime, true);
} else ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setupDateQuery( params ) {\n if( 'all' !== params.dateFrom ) {\n // we will not always provide a time range\n if( !params.duration && !params.dateTo ) {\n params.duration = 'day';\n }\n\n if( 'now' === params.dateFro... | [
"0.60283846",
"0.5931526",
"0.5931526",
"0.5898166",
"0.5627309",
"0.56107116",
"0.5594415",
"0.5552875",
"0.5550687",
"0.5550687",
"0.5547632",
"0.549748",
"0.54855233",
"0.53691137",
"0.5366445",
"0.53458875",
"0.5334486",
"0.53310484",
"0.5328851",
"0.5316035",
"0.53124607... | 0.68885946 | 0 |
Returns true if there's a sort parameter specified and its criteria has a mapped property. | function isSortCriteriaValid(params, fhirToJDSSortMap) {
if (nullchecker.isNotNullish(params._sort)) {
return nullchecker.isNotNullish(fhirToJDSSortMap[params._sort]);
} else if (nullchecker.isNotNullish(params['_sort:asc'])) {
return nullchecker.isNotNullish(fhirToJDSSortMap[params['_sort:asc']... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isSortingRequired() {\n const entriesType = this.getEntriesType();\n const { isSortingRequired = false } = this.props.state.entries[entriesType];\n\n return isSortingRequired;\n }",
"_isSorted() {\n return this._sort.active == this.id &&\n (this._sort.direction === 'asc'... | [
"0.6573961",
"0.6372966",
"0.6372966",
"0.59564346",
"0.5885027",
"0.569908",
"0.5341275",
"0.53161395",
"0.52838004",
"0.5260939",
"0.51858646",
"0.5172329",
"0.51653075",
"0.51653075",
"0.51466787",
"0.51355976",
"0.51302564",
"0.51179063",
"0.510106",
"0.5091016",
"0.50770... | 0.6775237 | 0 |
Delete All Items with Sweet Alert Library | function del_all_item(){
Swal.fire({
title: 'Are you sure?',
text: "You Want to Delete Whole TODO List!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function postDelete() {\n console.log('item deleted');\n swal({\n title: \"Dare Approved!\",\n icon: \"success\",\n button: \"Done\"\n })\n .then( () => {\n location.reload();\n })\n }",
"handleDeleteButtonClick() {\n Alert.alert(\"Hold on!\", \"Are you sure you want to cle... | [
"0.6923511",
"0.6760819",
"0.6533076",
"0.65206444",
"0.6511105",
"0.6489903",
"0.6449423",
"0.6402988",
"0.6351242",
"0.6327346",
"0.63090575",
"0.62964463",
"0.62917703",
"0.6267454",
"0.6261281",
"0.6260393",
"0.6259438",
"0.6249951",
"0.62380636",
"0.62273246",
"0.6222594... | 0.8119842 | 0 |
This function is to remove a data source | static async removeDataSource(email, dataSourceID) {
return new Promise((resolve, reject) => {
Database.sendQuery('DELETE FROM datasource WHERE ( email = $1) AND ( ID = $2);', [email, dataSourceID])
.then((result) => resolve(result.rows))
.catch((result) => reject(result));
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"removeSource(source) {\n const sourceIdx = this._sources.findIndex((s) => s === source);\n if (sourceIdx > -1) {\n arrayRemoveAt(this._sources, sourceIdx);\n source.dispose();\n }\n }",
"function deleteSource(oid)\n{\n $.parse.delete('sources/' + oid, function(jso... | [
"0.6923161",
"0.63919204",
"0.62256336",
"0.62021405",
"0.6170509",
"0.6117001",
"0.607311",
"0.60380137",
"0.6021545",
"0.6016487",
"0.5956192",
"0.5955829",
"0.5945504",
"0.59348667",
"0.5897498",
"0.5897498",
"0.5660677",
"0.5658116",
"0.5651361",
"0.5644043",
"0.5628527",... | 0.647706 | 1 |
This function removes a dashboard. | static async removeDashboard(email, dashboardID) {
return new Promise((resolve, reject) => {
Database.sendQuery('DELETE FROM Dashboard WHERE ( email = $1 ) AND ( ID = $2);', [email, dashboardID])
.then((result) => resolve(result.rows))
.catch((result) => reject(result));
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearDashboard() {\n \n while (dashboard.firstChild) {\n dashboard.removeChild(dashboard.firstChild);\n }\n}",
"function deleteCreation(id){\n $(\"#currentCreation\").remove();\n $(\"#making\").slideUp(\"slow\");\n var widget=GetWidget(id);\n var idPanel= widget.panel;\n var panel=G... | [
"0.7051651",
"0.6123528",
"0.6077937",
"0.5962638",
"0.5910711",
"0.5885954",
"0.5751077",
"0.57187843",
"0.56767976",
"0.5627682",
"0.56218934",
"0.5583366",
"0.5539705",
"0.5539109",
"0.5530348",
"0.5530348",
"0.5527614",
"0.55030346",
"0.5488734",
"0.5474143",
"0.5470423",... | 0.74165434 | 0 |
This function is used to add a graph to a dashboard. | static async addGraph(email, dashboardID, title, options, metadata) {
let query =
'INSERT INTO GRAPH as g (dashboardid, title, metadata, options) (SELECT $1,$2,$3,$4 WHERE EXISTS (SELECT $5 FROM dashboard AS d WHERE (d.email = $5) AND (d.ID = $1)) ) RETURNING g.*';
return new Promise((resolve, reject) => {
Da... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addToGraphs() {\n if (data.getNumberOfRows() >= 5) {\n\t\tdata.removeRow(0);\n\t\tdataViaAjax();\n\t\tdrawChart();\n\t }\n\t }",
"function updateDashboard() {\n setGraph1();\n setGraph2();\n setGraph3();\n}",
"function createGraph()\n\t{\n\t\tgraph = that.add('graph', {\n\t\t\tw: that.... | [
"0.6496089",
"0.6370459",
"0.6365461",
"0.6352829",
"0.6338957",
"0.63205457",
"0.6247306",
"0.6183056",
"0.6176735",
"0.6126419",
"0.606333",
"0.604698",
"0.6016476",
"0.59790146",
"0.59727335",
"0.5968875",
"0.59336907",
"0.59187734",
"0.58724236",
"0.58718795",
"0.5847641"... | 0.63741547 | 1 |
A submap node should be positioned in the place of average visibility and average evolution (!). The evolution is averaged from all the components included in submap, regardless of whether they are or are not visible. The visibility is calculated from components visible on a given map and is map specific. We do not wan... | function getSubmapPositions(mongooseObjects, nodeIds, impact) {
let Node = mongooseObjects.Node;
let positions = {
evolutionSum: 0,
evolutionCount: 0,
maps: {}
/* mapId : {
nodeVisiblityCount : number,
visibilitySum : number
}
*/
};
// ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"applyLayoutVisibility() {\n const { visible } = this;\n const { mbMap } = this.mapboxLayer;\n\n if (!mbMap) {\n return;\n }\n\n const style = mbMap.getStyle();\n\n if (!style) {\n return;\n }\n\n if (this.styleLayersFilter) {\n const visibilityValue = visible ? 'visible' : 'n... | [
"0.5155607",
"0.5108502",
"0.5017218",
"0.4999723",
"0.49637577",
"0.49426314",
"0.49350336",
"0.4899641",
"0.48742247",
"0.48171225",
"0.480886",
"0.480886",
"0.4788675",
"0.47885686",
"0.47782236",
"0.47715354",
"0.47700462",
"0.47681093",
"0.4760436",
"0.4745325",
"0.47267... | 0.5816436 | 0 |
every node that depends on a node injected into the submap, has to switch dependency to a node representing that submap. Which should be as simple as: remove all deps (constistent across all submaps) Further required work: [ ] ensure consistency across all the maps | function replaceIncomingDependencies(mongooseObjects, targetNodeId, nodesThatDependOnFutureSubmap, nodesInSubmap) {
let results = [];
for (let i = 0; i < nodesThatDependOnFutureSubmap.length; i++) {
let analysedNode = nodesThatDependOnFutureSubmap[i];
console.log('what about here', analysedNode);
let a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createASubmap(mongooseObjects, workspace, mapId, name, responsiblePerson, nodes, impact) {\n let Node = mongooseObjects.Node;\n let WardleyMap = mongooseObjects.WardleyMap;\n return workspace.createAMap({\n name: name,\n responsiblePerson: responsiblePerson\n }, workspace.nowId, /*mark as ... | [
"0.6814995",
"0.6181101",
"0.6181101",
"0.6181101",
"0.6181101",
"0.60917664",
"0.60319054",
"0.59357166",
"0.59333426",
"0.58866113",
"0.586727",
"0.5751134",
"0.5572706",
"0.55113435",
"0.5486648",
"0.5405267",
"0.5387291",
"0.538418",
"0.53830135",
"0.5381048",
"0.537357",... | 0.7088818 | 0 |
Forms a submap and returns a list of modified maps | function formASubmap(mongooseObjects, workspace, mapId, name, responsiblePerson, nodesInSubmap, impact) {
let Node = mongooseObjects.Node;
let Workspace = mongooseObjects.Workspace;
let positionsAntipaternVariable = null;
return getSubmapPositions(mongooseObjects, nodesInSubmap, impact).then(function(positi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function demo008(){\n var obj = {\n subObject: {\n subKey: 'subvalue',\n subSubObject: {\n subSubKey: 'subSubValue'\n }\n }\n } ;\n const originalMap = Immutable.fromJS(obj) ;\n const newMap = originalMap.setIn(['subObject','subKey'],'ha ha!') ;\n console.info(newMap.toJ... | [
"0.5581962",
"0.5565545",
"0.5322298",
"0.53130573",
"0.5299694",
"0.520975",
"0.51403564",
"0.50976515",
"0.50889266",
"0.5065186",
"0.5063049",
"0.5063049",
"0.5063049",
"0.5063049",
"0.5063049",
"0.5055614",
"0.50455725",
"0.5003599",
"0.50008327",
"0.49989545",
"0.4985788... | 0.5777071 | 0 |
II. handle the gateway proxy response (called in http.request and https.request for proxy_clientReq request in I. above) define the gateway proxy_clientReq's responsehandler callback method Note: proxy_Res parameter is an instance of type http.IncomingMessage | function processRes(proxy_Res) {
logger.trace(req.transactionId+'-Handling proxy response received, for proxy request sent with options: ', options);
var proxyResponseStatusCode = proxy_Res.statusCode;
logger.trace(req.transactionId+'-Proxy client r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function proxy_reply(res, code, headers, ret) {\n\t\tif (headers) {\n\t\t\tres.set(t.deployer.copy_headers(headers));\t\t\t\t\t// copy headers for our response\n\t\t}\n\t\tif (!ret) {\n\t\t\treturn res.status(code).send();\n\t\t} else {\n\t\t\treturn res.status(code).send(ret);\n\t\t}\n\t}",
"function Proxy () {... | [
"0.6411474",
"0.63302225",
"0.6319571",
"0.6254568",
"0.6204309",
"0.60719407",
"0.6065553",
"0.6017493",
"0.5974821",
"0.5893247",
"0.5864908",
"0.5829232",
"0.5816578",
"0.58152676",
"0.5791078",
"0.57828575",
"0.57771933",
"0.5762546",
"0.575762",
"0.575564",
"0.56961447",... | 0.7489599 | 0 |
'fix' security options in configOptions parameter | function configureOptions(configOptions) {
logger.trace("Fixing server SSL options");//, configOptions);
var options = {};
options.https = {};
logger.trace("Fixing SSL key: ", JSON.stringify(configOptions.https.key));
if (!_.isUndefined(configOptions.https.key) && _.isString(configOptions.htt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initConfig(ctx) {\n return __awaiter(this, void 0, void 0, function* () {\n const isTrusted = stateUtils_1.getFromWorkspaceState(WORKSPACE_IS_TRUSTED_KEY, false);\n if (isTrusted !== defaultConfig.workspaceIsTrusted()) {\n defaultConfig.toggleWorkspaceIsTrusted();\n }\n ... | [
"0.58123785",
"0.5586632",
"0.5586632",
"0.5542212",
"0.554184",
"0.55275524",
"0.5465999",
"0.54581815",
"0.5453196",
"0.5453196",
"0.5453196",
"0.5453196",
"0.5453196",
"0.5434075",
"0.54136807",
"0.54118866",
"0.5411763",
"0.5382656",
"0.5382656",
"0.53799045",
"0.53791094... | 0.59409773 | 0 |
creates the summary object for the months changes | function aggregateMonthChanges(changes) {
const updatedChanges = {
add: 0,
death: 0,
theft: 0,
sale: 0
};
// accumulate the different changes for the month
changes.forEach(change => {
if (!updatedChanges[change.reasonForChange]) {
updatedChanges[change.reasonForChange] = change.animal... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CalculateTotalsMonthToDate() {\n //use temp variables to prevent multiple dom updates\n var wt = 0; //written total\n var dt = 0; //delivered total\n var gt = 0; //goals total\n for (var i = 0; i < vm.territorySalesNumbers.length; i++) {\n wt += vm.territoryWritten[i];\n ... | [
"0.63781214",
"0.6243058",
"0.6224361",
"0.61561763",
"0.6020074",
"0.60071856",
"0.59950596",
"0.5955951",
"0.5841789",
"0.57974535",
"0.57925195",
"0.57576716",
"0.57401246",
"0.5680722",
"0.5643301",
"0.56413084",
"0.55726916",
"0.55608064",
"0.5555992",
"0.55387586",
"0.5... | 0.6885843 | 0 |
calculates the closing total | function getClosingTotal(monthsChanges, openingTotal) {
let closingTotal = openingTotal;
for (let i = 0; i < monthsChanges.length; i++) {
closingTotal += monthsChanges[i].animalsMoved;
}
return closingTotal;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function finalTotalAmountOfThisOrder()\n {\n return (nanCheck(parseFloat(subTotalWithoutShippingCost())) + nanCheck(parseFloat(shippingCostOfThisMainOrder()))).toFixed(2);\n }",
"close(monowave) {\n\t\tthis.dateEnd\t= monowave.timeEnd;\n\t\tthis.valueEnd\t= monowave.valueEnd;\n\t\tvar de... | [
"0.6102411",
"0.56489104",
"0.5648566",
"0.55740833",
"0.5551331",
"0.5542211",
"0.5503885",
"0.54976916",
"0.54424524",
"0.5420663",
"0.5413911",
"0.5407438",
"0.5402365",
"0.54008365",
"0.53891134",
"0.5364391",
"0.53439355",
"0.5342617",
"0.5325134",
"0.53202355",
"0.53146... | 0.66610575 | 0 |
updateUserType(): update type and company | async function updateUserHire(user, type, company) {
user.type = type;
user.company = company;
return getParticipantRegistry('org.pow.app.User').then(function(registry) {
return registry.update(user)
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateUserType(userType) {\n \n }",
"async function handleUserTypeValueSave() {\n updateIsSaving(true);\n\n await updateInstance({\n variables: {\n actionId: UPDATE_USER_TYPE_FOR_APP_SPEC_ACTION_ID,\n executionParameters: JSON.stringify({\n value: userTypeValue,\n ... | [
"0.8273181",
"0.6726988",
"0.66048133",
"0.65727586",
"0.6209959",
"0.6169125",
"0.60411185",
"0.5779423",
"0.57591254",
"0.56994724",
"0.5686445",
"0.5627551",
"0.5609914",
"0.5605066",
"0.55989826",
"0.55763876",
"0.5547815",
"0.5544743",
"0.55432266",
"0.551386",
"0.549086... | 0.6883742 | 1 |
modify the text and flip the cards as necessary to enter the new mode | transitionToNewMode() {
console.log('transition');
if (this.card != null) {
switch (this.currMode) {
case _entity_data_structures_card_modes__WEBPACK_IMPORTED_MODULE_1__["cardMode"].voting: {
this.cardText.nativeElement.textContent = "";
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function flipCard(card) {\n //Change the question (for now)\n if (card.className !== \"card flipped\") {\n card.children[1].textContent = BTQuestions[counter++];\n if (counter === BTQuestions.length) {\n BTQuestions = shuffle(BTQuestions);\n counter = 0\n }\n }\n card.classList.toggle(\"flip... | [
"0.6693379",
"0.6615352",
"0.6580999",
"0.65573806",
"0.6531578",
"0.644659",
"0.6374866",
"0.63484454",
"0.6326378",
"0.6326366",
"0.62626284",
"0.62561923",
"0.6254042",
"0.6251482",
"0.6244136",
"0.6243179",
"0.6217477",
"0.621517",
"0.62074244",
"0.6166291",
"0.61537254",... | 0.664673 | 1 |
disable the choice button to select a card when it is not a player's turn | disableCardChooseButton() {
let choiceButtonIsDisabled = this.choiceButton.nativeElement.classList.contains('disabled');
if ((this.currMode == _entity_data_structures_card_modes__WEBPACK_IMPORTED_MODULE_1__["cardMode"].voting && !choiceButtonIsDisabled) ||
(this.currMode == _entity_data_stru... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function selectCard (card) {\n humanPlayer.hand.tradeIns[card] = !humanPlayer.hand.tradeIns[card];\n \n if (humanPlayer.hand.tradeIns[card]) {\n dullCard(HUMAN_PLAYER, card);\n } else {\n fillCard(HUMAN_PLAYER, card);\n }\n}",
"function disableCorrectCards(){\n $(selectedCards[0]).f... | [
"0.68734705",
"0.680857",
"0.6636066",
"0.6599548",
"0.6596022",
"0.6585438",
"0.6512607",
"0.650694",
"0.64482456",
"0.6443079",
"0.6438787",
"0.6417244",
"0.63575923",
"0.63459194",
"0.6343458",
"0.63352144",
"0.6319061",
"0.6315705",
"0.6285187",
"0.62676185",
"0.6257512",... | 0.7814878 | 0 |
get list of all players excluding this current one | getAllOtherPlayersList(allPlayers) {
console.log("all players: " + allPlayers);
var output = [];
allPlayers.forEach((player) => {
if (player.Id != this.socket.id) {
output.push(player);
}
});
console.log("all other players: " + output);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getBluePlayers() {\r\n\treturn room.getPlayerList().filter(p => p.team == 2);\r\n}",
"function getRedPlayers() {\r\n\treturn room.getPlayerList().filter(p => p.team == 1);\r\n}",
"getAllPlayers() {\n return Player.find({}).exec();\n }",
"function removeAllPlayers() {\n listPlayers.splic... | [
"0.660605",
"0.6592557",
"0.6487351",
"0.64639515",
"0.64142793",
"0.636623",
"0.6298725",
"0.627018",
"0.6214694",
"0.61836666",
"0.61701465",
"0.61569387",
"0.6130434",
"0.61053574",
"0.6086726",
"0.6076323",
"0.60375464",
"0.59678966",
"0.5960814",
"0.59538",
"0.5928698",
... | 0.70125395 | 0 |
signal to the server that a card was picked | pickCard(card) {
this.socket.emit('clientPickedCard', this.connectedRoom, card);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"moveCardFromHandToDiscard(card) {\n this.socket.emit(\"moveCardFromHandToDiscard\", card.uniqueName);\n }",
"function playercardturn(player){\n //show cards\n //ask to select cards to play\n //push them into action slot\n }",
"function selectCard(evt) {\n console.log(\"select card\", evt);\n ... | [
"0.6337688",
"0.623733",
"0.62235826",
"0.6184626",
"0.6156489",
"0.5931886",
"0.592926",
"0.5880617",
"0.5833592",
"0.57898045",
"0.5785704",
"0.57522863",
"0.5659242",
"0.5627489",
"0.5591926",
"0.55628574",
"0.5544106",
"0.5543729",
"0.5534355",
"0.5523758",
"0.5520991",
... | 0.80335593 | 0 |
Adds a DataPoint to |this| with the specified time and value. DataPoints are assumed to be received in chronological order. | addPoint(timeTicks, value) {
const time = new Date(timeTicks);
this.dataPoints_.push(new DataPoint(time, value));
if (this.dataPoints_.length > MAX_STATS_DATA_POINT_BUFFER_SIZE) {
this.dataPoints_.shift();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DataPoint(ts, value) {\n // Timestamp of the DataPoint [Date]\n this.t = ts;\n // Value [Number]\n this.v = value;\n}",
"function addDataPoint() {\n // add a new data point to the dataset\n // var now = vis.moment();\n // dataset.add({\n // x: now,\n // y: y(now / 1000)\n /... | [
"0.63708514",
"0.61181086",
"0.58761024",
"0.584897",
"0.578221",
"0.5456121",
"0.53846174",
"0.5295532",
"0.5280697",
"0.52230346",
"0.5213346",
"0.5185427",
"0.51432675",
"0.51043075",
"0.5094851",
"0.5094851",
"0.50717664",
"0.50651485",
"0.50619066",
"0.50361395",
"0.4977... | 0.74504495 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.