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 |
|---|---|---|---|---|---|---|
This function is used to sort comments based on commentSortingField | function sortByConfiguredField(a, b) {
var sortingField;
sortingField = this.config.commentSortingField;
// Sort comments in ascending order
if (this.config.commentSortingOrder && this.config.commentSortingOrder === "ASC") {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sortComments() {\n if (_this.config.commentSortingField &&\n _this.config.commentSortingField !== null &&\n _this.config.commentSortingField !== \"\" &&\n _this._isValidCommentSortingFieldType(commentsTable)) {\n ... | [
"0.83639103",
"0.6833408",
"0.64577025",
"0.6427273",
"0.6260117",
"0.6260117",
"0.61576706",
"0.6063581",
"0.604869",
"0.5994992",
"0.59693265",
"0.59606224",
"0.5931296",
"0.58939666",
"0.58807904",
"0.5879121",
"0.5871107",
"0.58360136",
"0.5815031",
"0.5806118",
"0.578504... | 0.75488967 | 1 |
Description: prints the results of an http api request Arguments: json array to print out | function printResults(json) {
for (let i = 0; i < json.length; i += 1) {
console.log(json[i]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function print(body) {\n\tif (body['results']) {\n\t\tfor (var item in body['results']) {\n\t\t\tvar i = body['results'][item];\n\t\t\tsys.puts(JSON.stringify(i));\n\t\t}\n\t}\n}",
"function printResult(res) {\n console.log(res);\n}",
"function getInfo(url, args)\n{\n var info = AnyBalance.requestPost(url,... | [
"0.64958745",
"0.6137374",
"0.59843254",
"0.59821475",
"0.59821475",
"0.59821475",
"0.5956414",
"0.58959746",
"0.58804375",
"0.5818667",
"0.57822806",
"0.5778919",
"0.5736319",
"0.5725294",
"0.5724961",
"0.5704875",
"0.569566",
"0.5690583",
"0.566608",
"0.5649408",
"0.5644877... | 0.632969 | 1 |
Description: calculates the average of data in array Arguments: data array of numbers to average Return Value: average value | function average(data) {
let sum = 0;
for(let i = 0; i < data.length; i += 1) {
sum += data[i];
}
return sum / data.length;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function average (array) {\n\n}",
"average(array) {\n array = $u.numbers(array, arguments);\n\n return array.length && this.sum(array) / array.length;\n }",
"function average() {\n return averageOfArray(arguments);\n}",
"function average(data){\n var sum = data.reduce(function(sum, value){ r... | [
"0.8352491",
"0.80514115",
"0.7993326",
"0.79236805",
"0.78203326",
"0.7806192",
"0.7796297",
"0.77609396",
"0.775998",
"0.7750622",
"0.7747902",
"0.77459544",
"0.7723062",
"0.7709374",
"0.7708357",
"0.770142",
"0.7698702",
"0.76802784",
"0.76736164",
"0.76736164",
"0.7672937... | 0.8058756 | 1 |
Description: calculates the average of data from http response Arguments: err possible error data res http result data body http result body Return Value: average value | function calculateAverage(err, res, body) {
if (err) {
console.log(err);
process.exit(1);
}
else {
return average(body);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function handleGetAverageConsumption(request, h) {\n const response = await request.server.methods.mapReduce(DB_NAME, TYPE_GENERAL, consumption)\n .then(results => {\n const totals = {litresConsumed: 0, kilometersTravelled: 0};\n results.forEach(result => {\n totals.litresConsumed += res... | [
"0.6513263",
"0.638773",
"0.6339627",
"0.6256476",
"0.62214375",
"0.6192204",
"0.616876",
"0.61646336",
"0.5994163",
"0.5988368",
"0.5982537",
"0.59612256",
"0.5950792",
"0.59143305",
"0.59098643",
"0.59043163",
"0.5903893",
"0.58941317",
"0.5885734",
"0.5853194",
"0.58432066... | 0.7529877 | 0 |
Description: determines which taxi is the cheapest between pickup and dropoff Arguments: pickup pickup zone dropoff dropoff zone | function calculateBestTaxi(pickup, dropoff) {
let greenCost = 0;
let yellowCost = 0;
lib.getCostsForTaxi('green', pickup, dropoff, function(err, res, body) {
greenCost = calculateAverage(err, res, body);
lib.getCostsForTaxi('yellow', pickup, dropoff, function(err, res, body) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calculateFederalIncomeTax(income) {\n console.log('income is $' + income);\n let taxRate;\n let overThreshold;\n let taxedAmount;\n let takeHome;\n\n if (income > 500000) {\n taxRate = 0.37;\n overThreshold = (income - 500000);\n taxedAmount = 150689.50 + (overThreshold * taxRate);\n tak... | [
"0.57778203",
"0.5764839",
"0.5536554",
"0.54416263",
"0.5434456",
"0.5405154",
"0.53842825",
"0.53321004",
"0.5320538",
"0.52741855",
"0.52706516",
"0.5195239",
"0.51667285",
"0.516115",
"0.51592994",
"0.51053035",
"0.50979096",
"0.5078004",
"0.50750124",
"0.506281",
"0.5055... | 0.6707745 | 0 |
Registers redirect rules assuming that currently no rules are registered by this extension, yet. | function registerRules() {
var redirectRule = {
priority: 100,
conditions: [
// If any of these conditions is fulfilled, the actions are executed.
new RequestMatcher({
// Both, the url and the resourceType must match.
url: {pathSuffix:'swf'}
})
],
actions: [
// n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addRedirects(group) {\n if (this.redirects) {\n for (let { source, has, statusCode, destination } of this.redirects) {\n if (source !== '/:path+/') {\n // We remove the redirect that next.js automatically adds to remove trailing slashes because we already\n ... | [
"0.5966069",
"0.5683778",
"0.5469945",
"0.53884697",
"0.53884697",
"0.53552175",
"0.5341052",
"0.53201854",
"0.53201854",
"0.53201854",
"0.53201854",
"0.5313306",
"0.5313306",
"0.5313306",
"0.5313306",
"0.5313306",
"0.5313306",
"0.5313306",
"0.5313306",
"0.5313306",
"0.531310... | 0.73839843 | 0 |
function that deals with all the outcomes of snake | function moveOutcomes(){
// deals with Snake hitting border and self
if (
(currentSnake[0] + width >= (width * width) && direction === width) || // if snake hits bottom
(currentSnake[0] % width === width -1 && direction === 1) || // if snake hits right wall
(currentSnake[0] % width === 0 && direction === -1) || ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moveOutcomes(){\n //deals with snake hitting border and itself\n if(\n (currentSnake[0] + width >= (width*width) && direction == width) ||\n (currentSnake[0] % width === width - 1 && direction === 1) ||\n (currentSnake)[0] % width === 0 && direction == -1 ||... | [
"0.73084617",
"0.7087469",
"0.7017854",
"0.69817716",
"0.69341165",
"0.69200456",
"0.69182837",
"0.68955714",
"0.6889159",
"0.687573",
"0.6869188",
"0.68531024",
"0.68123835",
"0.678238",
"0.676183",
"0.6755116",
"0.6729956",
"0.6728115",
"0.67153215",
"0.67130613",
"0.670847... | 0.7106224 | 1 |
Returns a list of products name and short name | async getNames() {
const data = await this.getData();
return data.map(product => {
return { title: product.title, shortname: product.shortname };
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getListShort() {\n const data = await this.getData();\n return data.map(product => {\n return {\n shortname: product.shortname,\n title: product.title,\n image: product.image,\n };\n });\n }",
"async productNamesStringArray() {\n\t\treturn await utilities.innerTextA... | [
"0.71376866",
"0.66787195",
"0.66754067",
"0.66380644",
"0.6564102",
"0.6560826",
"0.6488788",
"0.6475498",
"0.6413871",
"0.63986295",
"0.63966036",
"0.63488925",
"0.6331323",
"0.6323862",
"0.63136655",
"0.6296927",
"0.62478805",
"0.6246728",
"0.6191863",
"0.61863625",
"0.618... | 0.7531677 | 0 |
Get user provided predefinedProperties, preselectedFeatures, go through all the questions, Output a cleaned up features. _debug is used to pass in answers for prompts. | async function run(questions, {
unattended = false,
preselectedFeatures = [],
predefinedProperties = {},
_debug = []
}) {
const pickedFeatures = [];
const properties = {};
// a subset of pickedFeatures, only for "after" task
// For example "after" task can print out a summary including how to use
// s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function preFunction() {\n var e = document.getElementById(\"pickTool\");\n var thisTool=e.options[e.selectedIndex].value;\n // document.getElementById(\"testParagraph\").innerHTML=thisTool; // for testing purposes only\n // setTheInnerHTML(\"theAnswer\",\"\");\n var toolInputs=inputListsByTool[thisToo... | [
"0.5333715",
"0.5254522",
"0.52405816",
"0.5083597",
"0.50709945",
"0.50412524",
"0.5001877",
"0.49882886",
"0.49573827",
"0.49483055",
"0.49031833",
"0.48658398",
"0.48587334",
"0.4846951",
"0.48303375",
"0.48288485",
"0.481215",
"0.47998434",
"0.47877926",
"0.4783893",
"0.4... | 0.63702536 | 0 |
Simulate newMeta and fire the newMeta event. Does NOT actually change meta; meta can only be changed by the WWSU socket. | set meta(data = {}) {
this.emitEvent("newMeta", [data, this._meta]);
this.emitEvent("metaTick", [this._meta]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_onAllMeta ({ sender }, msg) {\n this.logger.debug(\n `Received META message from ${sender.host}:${sender.port} of type: ${msg.type}`\n )\n this._notifyAllMetaToNode(sender)\n }",
"_onMeta ({ sender: { host, port } }, msg) {\n this.logger.debug(\n `Received META message from ${host}:${port... | [
"0.5995248",
"0.5987191",
"0.57211405",
"0.56743324",
"0.56614286",
"0.54733515",
"0.5410991",
"0.5410991",
"0.5410991",
"0.53233147",
"0.5306406",
"0.5300635",
"0.52732635",
"0.5175597",
"0.5061126",
"0.5053988",
"0.50427616",
"0.4954896",
"0.49281743",
"0.49163035",
"0.4914... | 0.7412522 | 0 |
Reset the ticker that updates meta.time and fires metaTick every second. Instead of adding a second each call (setInterval is not exact), determine time difference between system time and station time, as well as system time difference between now and previous timer fire. | resetTick() {
const ticker = () => {
let diff = moment().diff(this.prevTime);
this._meta.time = moment
.parseZone(this._meta.time)
.add(diff, "milliseconds")
.toISOString(true);
this.prevTime = moment();
this.emitEvent("metaTick", [this._meta]);
};
clearTimeou... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function secondTimerInterval() {\n\t//var date = new Date();\n\t//var thisSecond = date.getSeconds();\n\t//var thisMinute = date.getMinutes();\n\t//if (thisSecond != lastActualSecond) {\n\t\t//console.log(\"Actual time MINUTE: \" + thisMinute + \" SECOND: \" + thisSecond);\n\t\t//lastActualSecond = thisSecond;\n\t... | [
"0.5921293",
"0.59012073",
"0.5802211",
"0.5748634",
"0.57473236",
"0.5704799",
"0.56798637",
"0.5652592",
"0.5628786",
"0.5618757",
"0.5618757",
"0.56186825",
"0.5604655",
"0.5601272",
"0.5590093",
"0.558547",
"0.55576885",
"0.5546233",
"0.55370545",
"0.55349284",
"0.5533609... | 0.7563023 | 0 |
Bus stop marker function | function busStop(lat ,long, info){
var stop = new google.maps.Marker({
position:{lat:lat, lng:long},
map:map,
icon:image
});
var infoWindow = new google.maps.InfoWindow({
content:info
});
stop.addListener('click', function(){
infoWindow.open(map,stop);
routeToStop();
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function busToStopDist(){\r\n busDistance = Math.sqrt(Math.pow((selectMarkerLong - closestBusLong),2) + Math.pow((selectMarkerLat - closestBusLat), 2));\r\n busTime = busDistance * 79 /40; \r\n }",
"stop() {\n\t\tconsole.log(`Bus ${this.name} stopped`)\n\n\t}",
"emergencyStop(){\n ... | [
"0.6515219",
"0.6424526",
"0.63450044",
"0.62983745",
"0.6276103",
"0.6236219",
"0.6233313",
"0.6185539",
"0.61416155",
"0.60581404",
"0.603716",
"0.603716",
"0.59763175",
"0.59681976",
"0.5931919",
"0.59073085",
"0.5859665",
"0.58160615",
"0.57939935",
"0.57939935",
"0.57939... | 0.73069006 | 0 |
Draws the snapped polyline (after processing snaptoroad response). | function drawSnappedPolyline(caseNo) {
var colorValue;
var title;
if (caseNo == 1) {
title = 'BUS tr4';
colorValue = '#000000';
}
else if(caseNo == 2){
title = 'BUS 303';
colorValue = '#0D47A1';
}
else{
title = 'BUS 306';
colorValue = '#C51162';
}
var lineSy... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawSnappedPolyline(snappedCoordinates) {\r\n var snappedPolyline = new google.maps.Polyline({\r\n path: snappedCoordinates,\r\n strokeColor: '#687980',\r\n strokeWeight: 3,\r\n strokeOpacity: 0.9,\r\n });\r\n snappedPolyline.setMap(map);\r\n animateCircle(snappedPolyline);... | [
"0.7499622",
"0.70960945",
"0.6635361",
"0.65042233",
"0.64837945",
"0.6406445",
"0.63680965",
"0.63647556",
"0.6320206",
"0.6318321",
"0.6299346",
"0.62969023",
"0.624666",
"0.623854",
"0.62250006",
"0.6206838",
"0.6204984",
"0.61879236",
"0.61494917",
"0.6147649",
"0.611307... | 0.7525382 | 0 |
Imports a buffer as an ingredient, tagged with the ingredient URL. | importJSBuffer(ingredientUrl, ingredientContent) {
throw new BurritoError('MethodNotOverriddenBySubclass');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"importBundleIngredient(ingredientUrl, ingredientPath) {\n throw new BurritoError('MethodNotOverriddenBySubclass');\n }",
"importFilePath(ingredientUrl, ingredientPath) {\n throw new BurritoError('MethodNotOverriddenBySubclass');\n }",
"import (target) {\n return this.editor.import(this.getPkgUrl... | [
"0.64590055",
"0.5692406",
"0.51309776",
"0.50403196",
"0.48980042",
"0.48397666",
"0.4823863",
"0.4751824",
"0.47429374",
"0.4741627",
"0.47343448",
"0.4712327",
"0.46477962",
"0.45910698",
"0.45784974",
"0.45679986",
"0.45550236",
"0.45505673",
"0.4540011",
"0.4529473",
"0.... | 0.6318284 | 1 |
Imports a file as an ingredient, tagged with the ingredient URL. | importFilePath(ingredientUrl, ingredientPath) {
throw new BurritoError('MethodNotOverriddenBySubclass');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"importBundleIngredient(ingredientUrl, ingredientPath) {\n throw new BurritoError('MethodNotOverriddenBySubclass');\n }",
"import (target) {\n return this.editor.import(this.getPkgUrl(target))\n }",
"function importFromFile() {\n var file = dialog.showOpenDialog({\n \"title\": i18n.__(\"Import... | [
"0.686066",
"0.5979045",
"0.59228647",
"0.58271396",
"0.57537144",
"0.57389295",
"0.569683",
"0.54550576",
"0.5448323",
"0.5395286",
"0.5329965",
"0.52934647",
"0.52894914",
"0.52856094",
"0.5276145",
"0.52628696",
"0.52561575",
"0.52540547",
"0.5247323",
"0.52208865",
"0.515... | 0.6891041 | 0 |
Imports an ingredient from a bundle, given a subclassdependent bundle path and the ingredient URL. | importBundleIngredient(ingredientUrl, ingredientPath) {
throw new BurritoError('MethodNotOverriddenBySubclass');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"importFilePath(ingredientUrl, ingredientPath) {\n throw new BurritoError('MethodNotOverriddenBySubclass');\n }",
"ingredientLocation(idServerId, entryId, revisionId, variantId, ingredientName) {\n throw new BurritoError(\"MethodNotYetImplemented\");\n }",
"importJSBuffer(ingredientUrl, ingredient... | [
"0.70553476",
"0.56538534",
"0.554235",
"0.5071836",
"0.50635797",
"0.50239354",
"0.49257624",
"0.49198762",
"0.49198762",
"0.4810469",
"0.4793546",
"0.46698448",
"0.46309048",
"0.45917374",
"0.45727557",
"0.45659402",
"0.45372584",
"0.45325795",
"0.45298067",
"0.45238155",
"... | 0.82670516 | 0 |
Returns the lineheight of the given node in pixels. | function getLineHeightPx(node) {
var computedStyle = window.getComputedStyle(node
// If the char code starts with a digit, it is either a value in pixels,
// or unitless, as per:
// https://drafts.csswg.org/css2/visudet.html#propdef-line-height
// https://drafts.csswg.org/css2/cascade.html#computed-value
)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLineHeight(elem) {\n var lh = computeStyle(elem, 'line-height');\n if (lh == 'normal') {\n // Normal line heights vary from browser to browser. The spec recommends\n // a value between 1.0 and 1.2 of the font size. Using 1.1 to split the diff.\n lh = parseInt(computeStyle... | [
"0.7236187",
"0.7236187",
"0.7209053",
"0.71992856",
"0.71950585",
"0.7125255",
"0.6901802",
"0.6878639",
"0.68241274",
"0.68068534",
"0.67889154",
"0.67889154",
"0.6779956",
"0.6779956",
"0.6779956",
"0.6779956",
"0.6779956",
"0.6779956",
"0.6779956",
"0.6779956",
"0.6779956... | 0.833335 | 0 |
RotateAroundOrigin x, y : The coordinates of point to be rotatedPoint angle : Angle in degrees of rotation | function RotateAroundOrigin(x, y, angle) {
return Rotate(0, 0, x, y, angle);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rotate_around_origin(points, angle) {\n // Calculates rotation of point around origin using angle.\n // angle in degrees\n var s = Math.sin(deg_to_rad(angle));\n var c = Math.cos(deg_to_rad(angle));\n \n for (var i=0; i < points.length; i++) {\n\tvar newX = (points[i].x * c - points[i].... | [
"0.79582024",
"0.7645275",
"0.76297385",
"0.7219961",
"0.7217851",
"0.72133505",
"0.7142891",
"0.71035165",
"0.7038507",
"0.6991886",
"0.69543284",
"0.692758",
"0.6851723",
"0.67300135",
"0.67027855",
"0.665996",
"0.6537285",
"0.65274537",
"0.6513182",
"0.6394917",
"0.6335866... | 0.80311954 | 1 |
RenderSanta Renders all santa points after adjusting them for the rotation and position in space | function RenderSanta(context) {
drawEllipse(SANTA.x, SANTA.y, 100, 60, "red", context);
drawEllipse(SANTA.x, SANTA.y - 30, 50, 30, "#FFDAB9", context);
drawEllipse(SANTA.x-5, SANTA.y - 35, 5, 2, "black", context);
drawEllipse(SANTA.x+5, SANTA.y - 35, 5, 2, "black", context);
drawEllipse(SANTA.x, SANTA.y - 25, 10, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function render(gl, a_Position, a_PointSize, u_FragColor) {\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n\n for(let i = 0; i < sizePoints.length; ++i) {\n \tlet x = posPoints[i].x;\n \tlet y = posPoints[i].y;\n\n \tlet r = colorPoints[i].r;\n \tlet g = colorPoints[i].g;\n \tlet b ... | [
"0.6135999",
"0.5932625",
"0.5896256",
"0.5882536",
"0.58520633",
"0.5843316",
"0.5797316",
"0.5725594",
"0.57255405",
"0.5725456",
"0.5723316",
"0.5722189",
"0.5717126",
"0.5673289",
"0.5574587",
"0.55667156",
"0.555298",
"0.5546115",
"0.55309546",
"0.5529675",
"0.5528995",
... | 0.77290875 | 0 |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// Function: Choose fanart of selected movie and activate div ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | function func_ShowDetails(selectedmovie) {
var i, Control1, Control2;
for (i = 1;i <= iCount; i++) // deactivate div before open up new one!
{
Control1 = document.getElementById("movie" + i);
Control1.style.display = 'none';
}
Control2 = document.getElementById("backgrounddiv" + selectedmovie);
//display default backgr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showOnDisplay(){\r\n \r\n const identifier = this.classList[1];\r\n \r\n list.forEach(movie => {\r\n // Uses unique film ID to find which div has been clicked on\r\n const imageURL = 'https://image.tmdb.org/t/p/' + configData + movi... | [
"0.6680756",
"0.6545645",
"0.6390608",
"0.6381707",
"0.63580304",
"0.6322124",
"0.63022244",
"0.6113229",
"0.6102648",
"0.6093801",
"0.6084775",
"0.60533184",
"0.6043063",
"0.6025425",
"0.6010842",
"0.60068935",
"0.60023296",
"0.598331",
"0.59642434",
"0.5961336",
"0.59605414... | 0.7100863 | 0 |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// Function for displaying last modified date on template header Erweiterung von User cimex Vielen Dank!! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | function func_DisplayLastModified()
{
var T;
T = document.getElementById("div_displaylastmodified");
T.innerHTML = '<p><span style="font-family:Verdana;font-size:1.2em;">Update: </span> <span style="font-family:Verdana; color: white;font-size:1.5em;">' + DataNow + '</span></p>';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ModifiedDate() {\n\tupdated = new Date(document.lastModified);\n\tMonth = month[updated.getMonth()];\n\tDay = updated.getDate();\n\tYear = updated.getYear();\n\tHour = updated.getHours();\n\tMin = updated.getMinutes();\n if( Year < 1000 ) {\n Year += 1900;\n if( Year < 199... | [
"0.7004926",
"0.6998951",
"0.6807756",
"0.6645968",
"0.6585718",
"0.6314039",
"0.6174687",
"0.6087887",
"0.6078491",
"0.60259944",
"0.5967156",
"0.5967156",
"0.5967156",
"0.59405273",
"0.59366626",
"0.5877062",
"0.5871692",
"0.5861642",
"0.57967776",
"0.57368594",
"0.5698681"... | 0.70379144 | 0 |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// Function: Custom Search [Date] Displays latest added movies result also considers watched/unwatched state of checkboxes! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | function func_SearchDate() {
var todaydate = new Date(); //Date Object
var tt = todaydate.getDate(); //today: day
var mm = todaydate.getMonth() + 1; //today: month
var jjjj = todaydate.getFullYear(); //today: year
var timestamp_now = Date.UTC(jjjj, mm, tt); // today: timestamp
var timestamp_movie = new Array(iCoun... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function searchMovies (event){\n const searchText = event.target.value;\n setSearchQuery(searchText); \n const searchResultMovies = props.moviesArray.filter(function(movie){if(movie.title.toLowerCase().includes(searchText) || (movie.overview.toLowerCase().includes(searchText))){return ... | [
"0.62865347",
"0.62851846",
"0.6201031",
"0.6127705",
"0.60972035",
"0.6059268",
"0.60481054",
"0.60074127",
"0.6000464",
"0.58947116",
"0.58504415",
"0.5839987",
"0.5833094",
"0.5824697",
"0.5783124",
"0.57684386",
"0.57563615",
"0.5754099",
"0.5751908",
"0.5700309",
"0.5697... | 0.68280363 | 0 |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// Function: Custom Search [Year] Displays all movies sorted, beginning with newest result also considers watched/unwatched state of checkboxes! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | function func_SearchYear() {
var doOnce = 0;
var Control1 = document.getElementById("navigation");
var Control2 = document.getElementById("div_moviewall");
var i;
var year_movie = new Array(iCount);
year_movie[0] = new Array(2);
navilinks_full = ""; // deletes all entries of left sidebar
moviewall_full = ""; // delet... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function filter() {\n\n containerToPopulate = document.getElementById('searchBtn_movies_container');\n const genreEndpoint = document.getElementById('filter-nav__genre').value;\n const sortByEndpoint = document.getElementById('filter-nav__sort').value;\n const releaseDate = document.getElementById('fil... | [
"0.63677853",
"0.6321458",
"0.6319992",
"0.6318755",
"0.63169426",
"0.6278215",
"0.6255598",
"0.6209077",
"0.61977726",
"0.6123289",
"0.6081748",
"0.6071933",
"0.6040822",
"0.60362494",
"0.60315585",
"0.6028221",
"0.60091156",
"0.5991475",
"0.5977682",
"0.5955622",
"0.5952308... | 0.7235323 | 0 |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// Function: Custom Search [Genre] Displays all movies containing the selected genre result also considers watched/unwatched state of checkboxes! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | function func_SearchGenre(selectedgenre) {
var myregexp = new RegExp(selectedgenre); // NEW RegeExp Object
var doOnce = 0;
var Control1 = document.getElementById("navigation");
var Control2 = document.getElementById("div_moviewall");
var i;
navilinks_full = ""; // deletes all entries of left sidebar
moviewall_full =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moviesSearch(){\n \n var newMoviesList=[]; \n \n var searchText=document.getElementById('search').value;\n\n for(let i=0; i<allMovies.length;i++)\n {\n var entireText1=allMovies[i].title;\n var entireText2=allMovies[i].genres;\n if((entire... | [
"0.6881087",
"0.6861571",
"0.6677919",
"0.66445524",
"0.6544612",
"0.6526734",
"0.65212786",
"0.6487414",
"0.6409409",
"0.64001715",
"0.6365895",
"0.6346325",
"0.63191175",
"0.62898684",
"0.6269455",
"0.6264012",
"0.62340814",
"0.62186193",
"0.620936",
"0.61762834",
"0.61704"... | 0.6941059 | 0 |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// Function: Custom Search [Titel] Displays all movies beginning with selected letter result also considers watched/unwatched state of checkboxes! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | function func_SearchTitel(selectedLetter) {
var myregexp = new RegExp(selectedLetter); // NEW RegeExp Object
var doOnce = 0;
var Control1 = document.getElementById("navigation");
var Control2 = document.getElementById("div_moviewall");
var i;
navilinks_full = ""; // deletes all entries of left sidebar
moviewall_full... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moviesSearch(){\n \n var newMoviesList=[]; \n \n var searchText=document.getElementById('search').value;\n\n for(let i=0; i<allMovies.length;i++)\n {\n var entireText1=allMovies[i].title;\n var entireText2=allMovies[i].genres;\n if((entire... | [
"0.7182104",
"0.67866707",
"0.6754678",
"0.6567822",
"0.6533639",
"0.6455469",
"0.64525765",
"0.6428624",
"0.63737464",
"0.636859",
"0.63343954",
"0.6300762",
"0.62819135",
"0.62700313",
"0.6239177",
"0.6227909",
"0.62070537",
"0.6197853",
"0.6178769",
"0.6137463",
"0.6101145... | 0.7108418 | 1 |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// Function: Custom Search [Wertung] Erweiterung von User furryhamster Control2ielen Dank!! Sorting of movies, beginning with highest rated movies result also considers watched/unwatched state of checkboxes! ++++++++++++++++++++++++++++++++++++++++++++++++... | function func_SearchWertung() {
var doOnce = 0;
var Control1 = document.getElementById("navigation");
var Control2 = document.getElementById("div_moviewall");
var i;
var rating_movie = new Array(iCount);
rating_movie[0] = new Array(2);
navilinks_full = ""; // deletes all entries of left sidebar
moviewall_full = ""; /... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function processSearch() {\r\n\tanimeFilter['complete'] = document.getElementById('search.complete').checked;\r\n\tanimeFilter['incomplete'] = document.getElementById('search.incomplete').checked;\r\n\tanimeFilter['watched'] = document.getElementById('search.watched').checked;\r\n\tanimeFilter['notwatched'] = docu... | [
"0.673112",
"0.66922116",
"0.66339165",
"0.6545894",
"0.65159243",
"0.6300586",
"0.6275477",
"0.6226395",
"0.6217046",
"0.6171489",
"0.61637926",
"0.61599946",
"0.6152847",
"0.6129763",
"0.612975",
"0.6121563",
"0.611056",
"0.60948235",
"0.60491526",
"0.60398495",
"0.6005761"... | 0.7105155 | 0 |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// Function: [VideoBITRATEListe] Sorting of movies, beginning with highest Videobitrate movies result also considers watched/unwatched state of checkboxes! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | function func_SearchQualiVideo() {
var doOnce = 0;
var Control1 = document.getElementById("navigation");
var Control2 = document.getElementById("div_moviewall");
var i;
var vidbitrate_movie = new Array(iCount);
vidbitrate_movie[0] = new Array(2);
navilinks_full = ""; // deletes all entries of left sidebar
moviewall_f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"listVideos() {\n this.setState({\n videos: this.state.videos.sort((a, b) => {\n switch (this.state.sortBy) {\n case 'releaseYearAsc':\n return a.releaseYear > b.releaseYear ? 1 : -1;\n break;\n case 'releaseYearDesc':\n return a.releaseYear < b.rele... | [
"0.6345402",
"0.6090704",
"0.60430706",
"0.5950805",
"0.58888686",
"0.5848187",
"0.5796673",
"0.575333",
"0.57455677",
"0.5717535",
"0.5695907",
"0.56940794",
"0.56800735",
"0.5671667",
"0.5667099",
"0.5656464",
"0.56221175",
"0.55960727",
"0.558087",
"0.5530991",
"0.5530509"... | 0.626409 | 1 |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// Function: [AudioBITRATEListe] Sorting of movies, beginning with highest Audiobitrate movies result also considers watched/unwatched state of checkboxes! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | function func_SearchQualiAudio() {
var doOnce = 0;
var Control1 = document.getElementById("navigation");
var Control2 = document.getElementById("div_moviewall");
var i;
var audiobitrate_movie = new Array(iCount);
audiobitrate_movie[0] = new Array(2);
navilinks_full = ""; // deletes all entries of left sidebar
moviewa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function func_SearchQualiVideo() {\nvar doOnce = 0;\nvar Control1 = document.getElementById(\"navigation\");\nvar Control2 = document.getElementById(\"div_moviewall\");\nvar i;\nvar vidbitrate_movie = new Array(iCount); \nvidbitrate_movie[0] = new Array(2);\nnavilinks_full = \"\"; // deletes all entries of left s... | [
"0.5975727",
"0.5629976",
"0.56127095",
"0.55641395",
"0.55098814",
"0.54799706",
"0.54788816",
"0.5439279",
"0.54287905",
"0.53704333",
"0.53587127",
"0.5330864",
"0.5319342",
"0.53182495",
"0.531006",
"0.5298952",
"0.52973765",
"0.52881014",
"0.526914",
"0.5229262",
"0.5199... | 0.61597264 | 0 |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// Function: Un/Watched Movies Depending on checked/unchecked Checkboxes show only filtered selection of movies ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | function func_WatchedMovies() {
var Control1 = document.getElementById("navigation");
var Control2 = document.getElementById("div_moviewall");
var i;
navilinks_full = ""; // deletes all entries of left sidebar
moviewall_full = ""; // deletes all entries of right sidebar
// Loop through all entries and check ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function applyFilter() {\n const filteredMovies = originalReleasedMovies.filter((movie) => {\n const genresMatched = filterMovieForm.selectedGenres.some( ai => movie.genres.includes(ai) ) || filterMovieForm.selectedGenres.length == 0;\n let artistsMatched = filterMovieForm.selectedArti... | [
"0.621402",
"0.6190274",
"0.6119525",
"0.6103085",
"0.5969459",
"0.59242636",
"0.5900211",
"0.5884498",
"0.58808094",
"0.5817125",
"0.571405",
"0.5708958",
"0.5705699",
"0.5704031",
"0.5697569",
"0.56294805",
"0.5610663",
"0.56063426",
"0.55864894",
"0.5580598",
"0.55718946",... | 0.6381985 | 0 |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// Function: Build Moviesetnavigation ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | function func_BuildMoviesets() {
var Control1 = document.getElementById("navigation");
var i;
var arrmoviesets=DataMoviesets.split("|");
navilinks_full = ""; // deletes all entries of left sidebar
moviewall_full = ""; // deletes all entries of right sidebar
// Loop through all entries and check if movie contains "m... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function func_BuildTvShows() {\nvar Control1 = document.getElementById(\"navigation\");\nvar i;\nvar arrtvshowpackage=DataTVShows.split(\"|\"); \nnavilinks_full = \"\"; // deletes all entries of left sidebar\nmoviewall_full = \"\"; // deletes all entries of right sidebar\n\n\n// Loop through all entries and check... | [
"0.7175973",
"0.7008253",
"0.6958268",
"0.6629149",
"0.5993665",
"0.5919013",
"0.5856791",
"0.58425534",
"0.5837411",
"0.57692856",
"0.5755067",
"0.5753699",
"0.5751305",
"0.5611793",
"0.55971146",
"0.5588467",
"0.55884117",
"0.5584017",
"0.55618566",
"0.5544251",
"0.55407065... | 0.7330586 | 0 |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// Function: Build TVSHOWnavigation ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | function func_BuildTvShows() {
var Control1 = document.getElementById("navigation");
var i;
var arrtvshowpackage=DataTVShows.split("|");
navilinks_full = ""; // deletes all entries of left sidebar
moviewall_full = ""; // deletes all entries of right sidebar
// Loop through all entries and check if movie contains "m... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function func_BuildNavigationTVSeason(seasonposter)\n{\n//Navigation builder to build whole page dynamically\n//navilinks_full = navilinks_full + navilinks; \nmoviewall = string_tvshowwalllink_1 + \"0\" + string_tvshowwalllink_2 + \"0\" + string_tvshowwalllink_3 + string_tvshowwallpic_1 + \"export/\" + seasonpost... | [
"0.7370216",
"0.6425642",
"0.6279398",
"0.61843795",
"0.61790156",
"0.61333",
"0.6121453",
"0.6119481",
"0.6092825",
"0.60252154",
"0.5973239",
"0.5960833",
"0.5925475",
"0.5916045",
"0.5915825",
"0.5915825",
"0.58680254",
"0.58529186",
"0.58156705",
"0.5800551",
"0.57829463"... | 0.738803 | 0 |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// Function: Show TVShowInfo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | function func_ShowDetailsTvSeason(tvshowID) {
//---- TODO - NOT USED at moment, maybe later show TV Season Details...-----
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showInfo() {\n\tif (DEFDESCR) {\n\t\tcontr=$(\".queue_active\").attr(\"title\");\n\t\tif (typeof contr===\"undefined\") {\n\t\t\ttext='Nothing Playing';\n\t\t} else {\n\t\t\tduration=$(\".queue_active .qe_time\").html();\n\t\t\ttext=contr+' ['+duration+']';\n\t\t}\n\t\tmediainfo.html(text);\t\n\t} else {\... | [
"0.6319823",
"0.6256823",
"0.6190741",
"0.6134108",
"0.60738546",
"0.60240275",
"0.5979062",
"0.596842",
"0.5965566",
"0.59508276",
"0.5920323",
"0.59158874",
"0.5900342",
"0.5897671",
"0.58881694",
"0.587556",
"0.587387",
"0.58216774",
"0.58115834",
"0.58068454",
"0.5787352"... | 0.7672439 | 0 |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// Function: Custom Search [3D MOVIE] Displays all movies which have MULTIVIEW Scanned zero result also considers watched/unwatched state of checkboxes! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | function func_SearchThreeD() {
var doOnce = 0;
var Control1 = document.getElementById("navigation");
var Control2 = document.getElementById("div_moviewall");
var i;
navilinks_full = ""; // deletes all entries of left sidebar
moviewall_full = ""; // deletes all entries of right sidebar
// Loop through all entries and... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function searchMovies (event){\n const searchText = event.target.value;\n setSearchQuery(searchText); \n const searchResultMovies = props.moviesArray.filter(function(movie){if(movie.title.toLowerCase().includes(searchText) || (movie.overview.toLowerCase().includes(searchText))){return ... | [
"0.6497106",
"0.6295409",
"0.6278091",
"0.62047386",
"0.61413115",
"0.6133589",
"0.607455",
"0.6061796",
"0.5950591",
"0.59199136",
"0.5916859",
"0.58935356",
"0.5883514",
"0.5878232",
"0.5876337",
"0.5855433",
"0.5850036",
"0.5834537",
"0.58184093",
"0.578081",
"0.5774024",
... | 0.67180777 | 0 |
fetching and showing top photos for nonusers | function fetchShowTopPhotos(){
topRatedPhotoPromise.then(function(response){
normaliseToPhotoModel(response, 'topRated');
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPopularByUsers(req, res) {\n var query = `\n SELECT artwork_id, image_source\n FROM user_collections\n JOIN ARTWORK\n ON user_collections.artwork_id = ARTWORK.id\n GROUP BY artwork_id\n ORDER BY COUNT(*) DESC\n LIMIT 10;\n `;\n connection.query(query, function(err, rows, fields)... | [
"0.7032844",
"0.6779201",
"0.6492759",
"0.6327341",
"0.62792534",
"0.62610745",
"0.62469697",
"0.6201829",
"0.6179849",
"0.61548114",
"0.61444587",
"0.61324805",
"0.61243427",
"0.6120053",
"0.6115123",
"0.6080151",
"0.60709816",
"0.607003",
"0.60656905",
"0.6049082",
"0.60316... | 0.8125326 | 0 |
send photos to view for rendering | function sendPhotosToView(photoArray, direction){
//direction: append, prepend
var payload = {};
payload.photos = photoArray;
payload.direction = direction;
pubsub.emit('renderImgsToPage', payload);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderPhotos(photos){\n // töm #photos\n $('#photos').html('');\n // iterera ut bilderna\n let html = photos.map( photo => `\n <article>\n <img src=\"${photo.thumbnailUrl}\">\n <h2>${photo.title}</h2>\n </article>\n `);\n\n html.forEach( article => $('#photos').append(article) );\n\n... | [
"0.6500534",
"0.64401144",
"0.6406183",
"0.6301518",
"0.6222596",
"0.6177589",
"0.6097358",
"0.6092583",
"0.6070929",
"0.6066922",
"0.6062692",
"0.6049525",
"0.6046868",
"0.6037577",
"0.60278046",
"0.6000633",
"0.59814686",
"0.59732586",
"0.59600586",
"0.59593904",
"0.5954576... | 0.73004 | 0 |
determine how far along a song is in terms of how many bytes have been played in relation to the total bytes | function _determineByteProgress( sound ) {
// get current position of currently playing song
var pos = sound.position;
var duration = 0;
var loadedRatio = sound.bytesLoaded / sound.bytesTotal;
if ( sound.loaded === false) {
duration = sound.durationEstimate;
}
else {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"AudioLoadPercent() {\n let p = 0;\n if (this.pelletAudio.readyState === 4) {\n p += 1/this.nAudioClips;\n }\n if (this.accelAudio.readyState === 4) {\n p += 1/this.nAudioClips;\n }\n return p;\n }",
"function computeSongCompletionPercentage() {\n... | [
"0.6755749",
"0.65707135",
"0.6312352",
"0.6312352",
"0.6312352",
"0.6312352",
"0.6312352",
"0.6210634",
"0.61976856",
"0.6144711",
"0.6144711",
"0.6144711",
"0.61132866",
"0.5977257",
"0.58745867",
"0.5830879",
"0.5810512",
"0.58020145",
"0.58014333",
"0.57946867",
"0.578866... | 0.69948363 | 0 |
play a song at the given index | function _play( index ) {
// if an index is supplied play a specific song
// otherwise just play the current song
if ( index ) {
_data.currentTrack = index;
} else {
index = _data.currentTrack;
}
var sound = _data.songs[ index ];
// check if we're in a paused ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function playSong(index) {\n var thesong = songs[index];\n\n $(\"#nowplaying\").html(\"<h3>\" + thesong.track + \" by \" + thesong.artist + \"</h3>\");\n\n var myAudio = document.querySelector(\"#myAudio\");\n myAudio.src = thesong.source;\n myAudio.addEventLi... | [
"0.80436045",
"0.79389656",
"0.7677045",
"0.74446845",
"0.7383684",
"0.73291254",
"0.7315848",
"0.7259921",
"0.7238663",
"0.7230257",
"0.71295",
"0.70874083",
"0.70847976",
"0.7030431",
"0.6986728",
"0.6963963",
"0.6952885",
"0.6946372",
"0.69270957",
"0.69162637",
"0.6890819... | 0.8358299 | 0 |
Function to be called when the mouse leaves the floated Panel Slide out when the mouse leaves the region bounded by the slid Component and its placeholder. | function onMouseLeaveFloated(e) {
if (!me.isDestroyed) {
var slideRegion = me.el.getRegion().union(placeholder.el.getRegion()).adjust(1, -1, -1, 1);
// If mouse is not within slide Region, slide it out
if (!slideRegion.contains(e.getPoint())) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_afterMouseLeaveHook() { }",
"function onMouseLeave() {\n LxNotificationService.success('Mouse leave callback');\n }",
"function hostOnMouseLeave() {\r\n if (_scrollbarsAutoHideLeave && !_bodyElement.hasClass(_classNameDragging))\r\n refreshScrollbarsAutoHide... | [
"0.7137082",
"0.6865616",
"0.67739344",
"0.67584896",
"0.67584896",
"0.67584896",
"0.67584896",
"0.67584896",
"0.669588",
"0.6667005",
"0.66530085",
"0.66139185",
"0.65729266",
"0.6491959",
"0.64878374",
"0.6456441",
"0.64506024",
"0.6444219",
"0.6425174",
"0.6356223",
"0.633... | 0.81909704 | 0 |
get data for the GCA scatter plot | getGcaScatterData() {
console.log("getting gca scatter data");
const gcaScatterFacs = [
{
name: "Honesty-Humility",
points: [
{ score: 4, gca: 110 },
{ score: 0, gca: 90 },
{ score: -3, gca: 100 },
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formatDataToScatterplot (data) {\n data = data.map(function (point) {\n return Object.assign({}, point, {\n 'position': [point['longitude'], point['latitude']],\n 'radius': 3,\n 'color': ('address' in point) ? constants.COLORS[1] : constants.COLORS[0],\n 'opacity': 0.5\n })\n }... | [
"0.5860622",
"0.58136296",
"0.5546271",
"0.55226463",
"0.54681367",
"0.5429701",
"0.5371251",
"0.5354679",
"0.53456163",
"0.53258127",
"0.5314843",
"0.5305932",
"0.5302409",
"0.5301767",
"0.5287746",
"0.5278046",
"0.5276339",
"0.52745426",
"0.5271457",
"0.5253852",
"0.5237352... | 0.7313582 | 0 |
helper function for checking any possible outcome | checkForAnyOutcome(board) {
return this.checkVertical(board) || this.checkDiagonalRight(board) || this.checkDiagonalLeft(board) || this.checkHorizontal(board) || this.checkDraw(board);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function allCorrectCheck(argument) {\n return argument == 1;\n }",
"isOutcomePossible() {\n\t\tfor (var i = 0; i < this.outcome.length; i++) {\n\t\t\tif (this.props.specificOutcome[i] === \"none\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (this.props.specificOutcome[i] !== this.outcome[i]) {\n\t\t\t\t... | [
"0.6915983",
"0.6825047",
"0.64151335",
"0.63814867",
"0.6362393",
"0.6310722",
"0.6289088",
"0.6263842",
"0.62553006",
"0.62460315",
"0.61799574",
"0.6175786",
"0.6147137",
"0.613496",
"0.6131367",
"0.6126992",
"0.61138624",
"0.61108375",
"0.61106694",
"0.6110583",
"0.610128... | 0.72882885 | 0 |
renders the func tree | function renderFuncTree()
{
var index = 0;
for (func in funcTree)
{
var funcIndx = funcTree[func];
console.log(func);
var newFuncBlock = createNewFuncBlock(funcIndx.id);
document.body.appendChild(newFuncBlock);
document.getElementById("codeText"+funcIndx.id).inne... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ebx_displayYUITreeFromMarkup(callerFn, arg, obj) {\n\tvar treeEl = document.getElementById(obj.treeDivId);\n\tif (treeEl) {\n\t\tvar tree = new YAHOO.widget.TreeView(treeEl.id);\n\t\ttree.subscribe(\"clickEvent\", EBX_Utils.returnFalse);\n\t\ttree.render();\n\t}\n\tif (obj.fn !== undefined) {\n\t\tobj.fn.... | [
"0.6847192",
"0.66795075",
"0.6354048",
"0.6251253",
"0.6251253",
"0.6085896",
"0.6085896",
"0.6085896",
"0.6085896",
"0.6085896",
"0.6085896",
"0.6085896",
"0.6085896",
"0.6084046",
"0.60707355",
"0.6059631",
"0.6045345",
"0.600631",
"0.600631",
"0.600631",
"0.5925436",
"0... | 0.75231713 | 0 |
This function, paired with swimDownFromNode, does all the highlighting in between the aNode and fNode. The gist is it starts at the aNode, then tests all of its siblings to see if they are both after the aNode and before the fNode If they're in the middle, it calls the swimDown function which pretty much gets to the ve... | function swimUpFromNode(selection, aNode, fNode, swimNode){
/** TENTATIVE: changing selection.getRangeAt(0).commonAncestorContainer to container */
if (swimNode.isSameNode(commonAncestorContainer)){
;
}
else {
$(swimNode.parentNode.childNodes).each(function(index... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function highlightIndividualNode(startOffset, endOffset, node, isAnchorNodeAndFocusNodeSameNode){\n /** Use this to highlight the beginning/end of highlight. This does the same thing but wraps the whole thing in another span to preserve DOM structure */\n if (node.nodeType === Node.TEXT_NODE){\n\n ... | [
"0.55904496",
"0.51178527",
"0.5053424",
"0.50203377",
"0.50038266",
"0.49802876",
"0.49209023",
"0.48944145",
"0.48944145",
"0.48944145",
"0.48944145",
"0.48944145",
"0.48944145",
"0.48944145",
"0.48944145",
"0.48815522",
"0.486844",
"0.48460197",
"0.48123342",
"0.48075333",
... | 0.7243464 | 0 |
Clears the user's selection after all the highlighting is done. | function clearSelection(){
if (window.getSelection()){
window.getSelection().removeAllRanges();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearSelection() {\n if (window.getSelection) {\n window.getSelection().removeAllRanges();\n } else if (document.selection) {\n document.selection.empty();\n }\n }",
"deselectAll() {\n window.getSelection().empty();\n }",
"function clearSelection() {\n... | [
"0.83895636",
"0.8308953",
"0.81412125",
"0.80393857",
"0.8017239",
"0.7903199",
"0.78193694",
"0.7818206",
"0.7779025",
"0.77481216",
"0.77472025",
"0.75695413",
"0.75350994",
"0.73743695",
"0.73309934",
"0.727346",
"0.7200096",
"0.71660274",
"0.7112859",
"0.7090007",
"0.707... | 0.8345972 | 1 |
Ais payload is represented in a 6bits encoded string !( This method is a direct transcription in nodejs of C++ aisdecoder code Danish Maritime Authority AisLib encoding/decoding java library | function AisEncode (msg) {
this.payload = new Buffer(425); // make a buffer force it 6bit/zero
this.payload.fill (0x0); // init to 6bits encoded zero value
this.payloadSize =0; // Payload size depend on messages
this.nmea =[];
this.PutInt (msg.aistype ,0,6);
this.PutIn... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AisDecode (input, session) {\r\n this.bitarray = [];\r\n this.valid = false; // will move to 'true' if parsing succeed\r\n this.error = \"\"; // for returning error message if not valid\r\n\r\n if (Object.prototype.toString.call(input) !== \"[object String]\") {\r\n this.error = \"Ai... | [
"0.65606904",
"0.6443667",
"0.6228424",
"0.5885147",
"0.5825599",
"0.5799531",
"0.5778304",
"0.5660041",
"0.56496286",
"0.558632",
"0.5568308",
"0.5567309",
"0.556713",
"0.55331296",
"0.55301255",
"0.5526739",
"0.55169433",
"0.5504199",
"0.5503887",
"0.54964453",
"0.54949635"... | 0.64611405 | 1 |
getLastLiteracyQuestionCode in the last 60 days | function getLastLiteracyQuestionCode(){
lastLiteracyDate = getLastLiteracyDate();
var lastDate = contact.vars.date_last_literacy_answered;
if (typeof lastDate === 'undefined') return false;
var datediff = moment().diff(moment(lastDate), 'days');
if (datediff > last_day_interacted_with_threshold) return false;... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"howOld(birthday){\n return -1;\n }",
"getFilteredAllChallengeDays(challengePart) {\n var latestFeedbacksOverAllDays = {}\n challengePart.dailyFeedback.forEach((feedback) => {\n var feedbackForCurrentDay = latestFeedbacksOverAllDays[feedback.day]\n if (!feedbackForCurrentDay) {\n ... | [
"0.5356288",
"0.5302044",
"0.5189057",
"0.5189057",
"0.5187357",
"0.51035005",
"0.5069552",
"0.5032874",
"0.5025263",
"0.49998504",
"0.49987888",
"0.49922293",
"0.4977478",
"0.4969497",
"0.4967624",
"0.4947088",
"0.4922993",
"0.49096674",
"0.49081558",
"0.49063838",
"0.489661... | 0.72720265 | 0 |
Deletes a target word from json file | function deleteWord(word, file, elem) {
// Grab keywords from proper file
let keywords = JSON.parse(fs.readFileSync(`${rootDir}assets/files/${file}.json`, 'utf8'))
// Remove word from file
delete keywords[file][word]
// Write the json file
writeJSON(`${rootDir}assets/files/${file}.json`, keywords)
// ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function remove(){\n var jsonString = loadDataFromFile();\n dictionaryObject = JSON.parse(jsonString);\n delete(dictionaryObject[process.argv[3]]);\n writeDictToFile();\n}",
"function deleteJSON(obj) {\n // Function to read in XML file, convert it to JSON, delete the required object and write ba... | [
"0.70262223",
"0.64593524",
"0.62713224",
"0.62326974",
"0.6215715",
"0.5975821",
"0.59539205",
"0.58763164",
"0.57784474",
"0.5771478",
"0.57626194",
"0.5744618",
"0.56640047",
"0.55472773",
"0.55396384",
"0.55204356",
"0.5511176",
"0.5504397",
"0.55002624",
"0.54952204",
"0... | 0.81605273 | 0 |
Determines whether in developer mode or not based on file structure | function isDev() {
// Assets will be in a non-root folder in production
return fs.existsSync('assets')
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isDevMode() {\n const ary = ['dds', 'rbg', 'goofy', 'test', 'zcy', 'iphonework1', 'iphonework2', 'spirit']\n return ary.includes(this.user.name) || __DEV__ || this.user.name.startsWith('test')\n }",
"function isWebDevFile(filePath) {\n return (hasFileExtension(filePath, WEB_DEV_EXT) || isTsFile(filePat... | [
"0.65574485",
"0.6543314",
"0.64414316",
"0.63918126",
"0.6390175",
"0.6344308",
"0.6225323",
"0.6198786",
"0.6198786",
"0.6198786",
"0.6198786",
"0.6198786",
"0.6198786",
"0.6198786",
"0.6198786",
"0.6198786",
"0.6198786",
"0.6198786",
"0.6198786",
"0.6198786",
"0.6198786",
... | 0.68684804 | 0 |
Returns the root directory of the application | function findRoot() {
if (dev) {
// Developer mode means all files are based in root
return ''
} else {
// Production files in Resources
return process.resourcesPath + '/app/'
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getRoot () {\n var root = '';\n if(!argv._[0]){\n var dirs = ['public', 'app'];\n dirs.map(function(dir) {\n if(fs.existsSync(dir)) {\n root = dir;\n return;\n }\n });\n }else{\n root = argv._[0];\n }\n return path.resolve(root);\n}",
"function getRoot() {\n\tvar... | [
"0.8178679",
"0.76960725",
"0.7643051",
"0.7492039",
"0.7338498",
"0.73346865",
"0.7331544",
"0.7150566",
"0.7101969",
"0.7064235",
"0.7027269",
"0.7016681",
"0.69983906",
"0.692651",
"0.68692976",
"0.673086",
"0.6726798",
"0.6679859",
"0.66687477",
"0.66344583",
"0.65418",
... | 0.7954006 | 1 |
custom landing slider page wise animation landing screen | function anim_landing(){
TweenMax.set('.page_landing .landing_bar_1', {scale: 0});
TweenMax.set('.page_landing .lImg_icon_wrapper img', {opacity: 0});
TweenMax.set('.page_landing .mask_a', {right: '0%'})
TweenMax.set('.page_landing .masking > img', {opacity: 0, scale: 3})
TweenMax.s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initiate_homepage_slider(){\n\t\tif(mode == '1'){\n\t\t\tinch50h = 667;\n\t\t\t$('.main-frame') .animate({ width: inch50h + 00, \t height: inch50w,\t});\n\t\t\t$('.second-frame').animate({ width: inch50h + 00,\t });\n\t\t\t$('.third-frame') .animate({ width: inch50h + 140,\t });\n\t\t}else{\n\t\t\t$('.ma... | [
"0.6775238",
"0.6766186",
"0.66017646",
"0.65675336",
"0.6421062",
"0.63912934",
"0.63844746",
"0.6349394",
"0.6324161",
"0.62739235",
"0.6264014",
"0.62585944",
"0.6232224",
"0.6227188",
"0.6197041",
"0.6187148",
"0.61869985",
"0.6177489",
"0.61748695",
"0.61537355",
"0.6135... | 0.7314216 | 0 |
Create and/or clean the "out" directory, setting it up for conversion. | function setupOutDir(outDir, clean = false) {
return __awaiter(this, void 0, void 0, function* () {
if (clean) {
yield util_1.rimraf(outDir);
}
try {
yield util_1.mkdirp(outDir);
}
catch (e) {
if (e.errno === -17) {
// direc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function prepDirectory() {\n console.log(`new working directory ${workDir}`);\n await fs.emptyDir(workDir);\n console.log(`check output directory ${outDir}`);\n await fs.ensureDir(outDir);\n}",
"function createDestinationFolder() {\n examplesSource = path.join(TODOMVC_DIR, EXAMPLES_DIR);\n exampl... | [
"0.66652983",
"0.6604675",
"0.6361211",
"0.6252422",
"0.61744916",
"0.6162431",
"0.60950696",
"0.60851586",
"0.5970739",
"0.58351564",
"0.5731463",
"0.5675973",
"0.5667727",
"0.56578696",
"0.5586592",
"0.5571317",
"0.55592793",
"0.55260813",
"0.54770195",
"0.5470923",
"0.5453... | 0.6664991 | 1 |
Configure a basic analyzer instance for the package under conversion. | function configureAnalyzer(options) {
const urlResolver = new polymer_analyzer_1.PackageUrlResolver();
const urlLoader = new polymer_analyzer_1.InMemoryOverlayUrlLoader(new polymer_analyzer_1.FsUrlLoader(options.inDir));
for (const [url, contents] of special_casing_1.polymerFileOverrides) {
urlLoade... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initAnalyser() {\r\n\tanalyser = audioContext.createAnalyser();\r\n\tanalyser.smoothingTimeConstant = SMOOTHING;\r\n\tanalyser.fftSize = FFT_SIZE;\r\n\r\n}",
"constructor() { \n \n OrgApacheJackrabbitOakPluginsIndexSolrOsgiOakSolrConfigurationInfo.initialize(this);\n }",
"configure() ... | [
"0.55935913",
"0.5419663",
"0.5093438",
"0.5092198",
"0.50650346",
"0.5058074",
"0.5054447",
"0.50299084",
"0.5011135",
"0.49961758",
"0.49948937",
"0.4970147",
"0.49595463",
"0.49420094",
"0.48947966",
"0.4893102",
"0.48847866",
"0.48381603",
"0.48361385",
"0.47793376",
"0.4... | 0.5842684 | 0 |
Convert a packagelayout project to JavaScript modules & npm. | function convert(options) {
return __awaiter(this, void 0, void 0, function* () {
const outDir = options.outDir;
const npmPackageName = options.packageName;
yield setupOutDir(outDir, options.cleanOutDir);
// Configure the analyzer and run an analysis of the package.
const bow... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"js (file, layout) {\n let links = matchAll(layout, 'js')\n\n links.forEach(link => {\n link = match(link, 'js')\n let regexp = new RegExp(`@js\\\\(${link}\\\\)`)\n\n layout = layout.replace(regexp, file.split('.')[0] === 'index' ? `js/${link}.js` : `../js/${link}.js`)... | [
"0.57962763",
"0.564258",
"0.56417114",
"0.5641556",
"0.5610097",
"0.55797845",
"0.55496895",
"0.5538374",
"0.55282557",
"0.5513896",
"0.55010617",
"0.54766566",
"0.54419607",
"0.54311246",
"0.5416853",
"0.53328335",
"0.5318181",
"0.53036547",
"0.52973276",
"0.5289684",
"0.52... | 0.5853277 | 0 |
save current action (saveto, copyto) Compilation pass data to template | function compileSaveTo (data) {
gCurrentAction = {
action: 'save-to',
data: $.extend({ selectedTargets: [] }, data)
};
return TEMPLATES.actionTo($.extend({
title: 'Save to',
canCreateFolder: true,
form: {
method: "PATCH",
action: "copy"
}
}, data));
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function saveTemplate() {\n\t\tvar activeLayout = getActiveLayout();\n\t\tactiveLayout.designTime = false;\n\t\tvar templateStr = JSON.stringify(getTemplate(), null, \" \");\n\t\tactiveLayout.designTime = true;\n\t\tvar uriContent = \"data:application/octet-stream,\" + encodeURIComponent(templateStr);\n\t\twindow.... | [
"0.6911262",
"0.61478466",
"0.60379475",
"0.5683199",
"0.56574523",
"0.5622112",
"0.5616047",
"0.55734074",
"0.5518905",
"0.55072606",
"0.5459965",
"0.54194707",
"0.53840446",
"0.5372858",
"0.53647035",
"0.5349136",
"0.53437537",
"0.53341246",
"0.53264254",
"0.53070676",
"0.5... | 0.7663538 | 0 |
//Example // //For n = 2, the output should be //largestNumber(n) = 99. // solution 1: | function largestNumber(n) {
return Math.pow(10, n) - 1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function largestNumber(n) {\n let str = '';\n for (let i = 0; i < n; i++) {\n str += '9';\n }\n return parseInt(str);\n}",
"function maxNum() {\n return Math.max(1, 2, 3, 5, 100, 23232, 123, 53443);\n}",
"function number(num1,num2,num3,num4,num5,largest)\n{\n\n\tif(num1 > num2 && num1 > num... | [
"0.7729329",
"0.77065396",
"0.7624282",
"0.7614312",
"0.75802493",
"0.75096494",
"0.74355876",
"0.74310285",
"0.7427426",
"0.7419165",
"0.74095887",
"0.7365581",
"0.7326987",
"0.72755545",
"0.7268134",
"0.7233147",
"0.71977353",
"0.719421",
"0.71615773",
"0.71552074",
"0.7152... | 0.8097945 | 1 |
when bullet hits shield | hitShield(bullet, shield){
bullet.disableBody(true, true);
console.log('hit shine');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"hitPlayer(bullet, player){\n console.log('hit');\n bullet.disableBody(true, true);\n // Play hurt Sound\n //this.screamSound.setRate(1);\n //this.screamSound.play();\n //this.healthHurt();\n }",
"attackFunc(){\r\n if(this.attack){\r\n if(this.weapon == 0){\r\n fill... | [
"0.74643755",
"0.7327289",
"0.71675617",
"0.6990422",
"0.69451714",
"0.6938325",
"0.68999755",
"0.6856432",
"0.6849771",
"0.6825669",
"0.68102056",
"0.68049735",
"0.6786985",
"0.6781922",
"0.67552674",
"0.67285657",
"0.66976416",
"0.6637808",
"0.6603159",
"0.6601308",
"0.6586... | 0.82344794 | 0 |
Fetch labels snapshot from firebase to update ui, uses movingId from session storage. | function fetchMovingDetails() {
moving.getMovingSnapshotById(movingId, () => {
//moving title
const movingTitle = document.getElementById('movingTitle');
const movingTitleMobile = document.getElementById('movingTitleMobile');
movingTitle.innerHTML = moving.movingTitle;
movingTitleMobile.innerHTML ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"fetchJourneyData() {\n const _this = this;\n let id = this.id;\n let ref = firebase.database().ref(`journeys/${this.state.user.uid}/${id}`)\n\n this.setState({\n fetching: true\n })\n\n ref.once('value', (snap) => {\n _this.setState({\n ... | [
"0.52287626",
"0.5175311",
"0.5175069",
"0.5143856",
"0.51290846",
"0.51290846",
"0.51290846",
"0.51290846",
"0.51290846",
"0.51290846",
"0.51290846",
"0.51290846",
"0.51290846",
"0.51290846",
"0.51290846",
"0.51290846",
"0.51290846",
"0.51290846",
"0.51290846",
"0.51290846",
... | 0.52052754 | 1 |
This generic function sends a post request to make a table. | function sendPost(event) {
event.preventDefault();
var req = new XMLHttpRequest();
req.open('POST', '/', true);
req.setRequestHeader('Content-Type', 'application/json');
var dbtype = document.querySelector('input[name = "db"]:checked').value;
tableResponse(req, dbtype, true);
var toSend = {m... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"postTableName(){\n let requestUrl = this.get_add_url();\n this.props.reportRepository.postTableList(requestUrl, null).then((answer) => {\n this.getTableList()\n });;\n }",
"function postTableToServer(){\n var form = {};\n /*Post via ajax*/\n form.method = 'post';\n form.act... | [
"0.6917307",
"0.6884874",
"0.63537264",
"0.6237858",
"0.61556673",
"0.6148376",
"0.6119815",
"0.60368055",
"0.5991599",
"0.5946776",
"0.5854302",
"0.5813958",
"0.5793933",
"0.5767114",
"0.57278436",
"0.57100254",
"0.5703343",
"0.5700868",
"0.56851506",
"0.56736845",
"0.567245... | 0.75472856 | 0 |
This function makes the table for a table of tableName type. | function makeTable(tableName, response) {
//make the table
var table = document.createElement("table");
table.id = "table";
table.style.border = "1px solid";
//make the header row.
var headerRow = table.appendChild(document.createElement("tr"));
var currentHeadings = headings[tableName];
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createTable(tableName, fields) {\n\t\treturn this.allTables[tableName] = new Table(tableName, fields, this.client);\n\t}",
"function createTable() {\n let container = document.querySelector(`.${this.parent}`);\n let table = document.createElement('table');\n table.id = this.id;\n table... | [
"0.7090987",
"0.6554169",
"0.65477115",
"0.65421987",
"0.65164477",
"0.6463495",
"0.64561826",
"0.64442146",
"0.6435849",
"0.6352134",
"0.6336854",
"0.63214713",
"0.62921745",
"0.62867445",
"0.627624",
"0.6275667",
"0.6271026",
"0.626986",
"0.62546486",
"0.6243628",
"0.623212... | 0.65928555 | 1 |
This function is used to make the form containing the edit and delete buttons. It makes the buttons, then appends the id as hidden input to the form. | function makeForm(parent, id, dbname) {
var form = document.createElement("FORM");
makeButton("Edit", editRow, form, id, dbname);
makeButton("Delete", deleteRow, form, id, dbname);
parent.appendChild(form);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createid() {\n // Add an incremented unique id to every edit button\n // This is so we know which form to display in edit()\n let editBtn = document.querySelectorAll(\".edit-btn\");\n let btnNum = 0;\n for (btn of editBtn) {\n btn.id = btnNum;\n btnNum++;\n }\n}",
"functi... | [
"0.7047276",
"0.66754675",
"0.6579291",
"0.6556296",
"0.6528407",
"0.64951354",
"0.648287",
"0.63539207",
"0.6350673",
"0.6346739",
"0.63313013",
"0.63229257",
"0.6318939",
"0.6314224",
"0.6300054",
"0.6284957",
"0.62845856",
"0.6255878",
"0.62505174",
"0.6225453",
"0.6208035... | 0.7057834 | 0 |
The function is called when the delete button is hit. It sends a post request to the home page, indicating that a delete button has been hit, along with the id of the row and the database name. | function deleteRow(event) {
event.preventDefault();
var req = new XMLHttpRequest();
req.open('POST', "/", true);
req.setRequestHeader('Content-Type', 'application/json');
var name = event.target.name;
var payload = {id: event.target.hiddenId, delete: "true", dbtype: name};
req.addEventListen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function handleDeleteButtonClick() {\n getURL();\n console.log(\"Delete-Button wurde gedrückt.\");\n let id = queryDelete._id;\n console.log(\"id: \" + id.toString());\n url += \"/delete\" + \"?_id=\" + id.toString();\n ... | [
"0.72304064",
"0.7173314",
"0.70184565",
"0.701378",
"0.69654167",
"0.68791354",
"0.6875339",
"0.68406427",
"0.6839955",
"0.6826164",
"0.6794827",
"0.678875",
"0.6746138",
"0.67367345",
"0.6714052",
"0.67019093",
"0.66578865",
"0.66451687",
"0.66392887",
"0.6629138",
"0.66259... | 0.7217453 | 1 |
genrates array for sphere with triangle_strip | function sphere(radius, n) {
var thetaCount = 0;
var phiCount;
var thetaStep = (2*Math.PI)/(n+1);
var phiStep = Math.PI/(n+1);
var colorIndex = 0;
var thetaAdd;
for (var i = 0; i <= n; i++) {
if (i == n) {
thetaAdd = 0;
} else {
thetaAdd = thetaCount+... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeSphere() {\r\n//==============================================================================\r\n// Make a sphere from one OpenGL TRIANGLE_STRIP primitive. Make ring-like \r\n// equal-lattitude 'slices' of the sphere (bounded by planes of constant z), \r\n// and connect them as a 'stepped spiral' d... | [
"0.66951877",
"0.66740805",
"0.6627601",
"0.6595113",
"0.656403",
"0.63885653",
"0.633601",
"0.6329517",
"0.6220975",
"0.6147295",
"0.6054357",
"0.60207593",
"0.59752405",
"0.5968553",
"0.59464157",
"0.59295505",
"0.59254473",
"0.58812857",
"0.5852074",
"0.58177996",
"0.58055... | 0.6888354 | 0 |
Gets an observable that emits when the overlay's backdrop has been clicked. | backdropClick() {
return this._ref.backdropClick;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"backdropClick() {\n return this._overlayRef.backdropClick();\n }",
"backdropClick() {\n return this._backdropClick;\n }",
"backdropClick() {\n return this._backdropClick;\n }",
"backdropClick() {\n return this._backdropClick;\n }",
"backdropClick() {\n return ... | [
"0.6887191",
"0.6562834",
"0.6562834",
"0.6562834",
"0.6562834",
"0.61046094",
"0.61046094",
"0.61046094",
"0.61046094",
"0.5826675",
"0.5826675",
"0.57740754",
"0.5665524",
"0.56478786",
"0.56478786",
"0.56478786",
"0.56478786",
"0.5622059",
"0.5622059",
"0.5602017",
"0.5514... | 0.6570592 | 1 |
Reference to the currently opened bottom sheet. | get _openedBottomSheetRef() {
const parent = this._parentBottomSheet;
return parent ? parent._openedBottomSheetRef : this._bottomSheetRefAtThisLevel;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get _openedBottomSheetRef() {\n const parent = this._parentBottomSheet;\n return parent ? parent._openedBottomSheetRef : this._bottomSheetRefAtThisLevel;\n }",
"function nxs_js_popup_getcurrentsheet()\n{\n\tvar result = nxs_js_popup_getsessioncontext(\"sheet\");\n\treturn result;\n}",
"getBott... | [
"0.8053053",
"0.64046144",
"0.5692256",
"0.5672867",
"0.54755867",
"0.54379565",
"0.54300636",
"0.53916246",
"0.5365275",
"0.5353281",
"0.5334374",
"0.53217065",
"0.53074455",
"0.5290289",
"0.5290289",
"0.5290289",
"0.5290289",
"0.5290289",
"0.5290289",
"0.5290289",
"0.529028... | 0.8041421 | 1 |
Dismisses the currentlyvisible bottom sheet. | dismiss(result) {
if (this._openedBottomSheetRef) {
this._openedBottomSheetRef.dismiss(result);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"dismiss() {\n const cur_page = this._get_current_page()\n let _bottom_sheet_state = cur_page.data._bottom_sheet_state || {}\n if (_bottom_sheet_state.is_showed != 1) {\n return\n }\n\n this._behavior_animation.translateY(_bottom_sheet_state.translation_y * this._ratio)... | [
"0.77148515",
"0.6207836",
"0.6175841",
"0.6055674",
"0.6029855",
"0.60270387",
"0.60027474",
"0.5994889",
"0.59885514",
"0.5975584",
"0.59549373",
"0.5948386",
"0.5920066",
"0.5918156",
"0.58997387",
"0.5875144",
"0.58530915",
"0.5835604",
"0.5786987",
"0.57679117",
"0.57479... | 0.6359529 | 1 |
ajax call managing a call to a given p_view_name and reload taking faceted into account | function callViewAndReload(baseUrl, view_name, params, force_faceted=false, onsuccess=null) {
redirect = '0';
if (!force_faceted && !has_faceted()) {
redirect = '1';
}
$.ajax({
url: baseUrl + "/" + view_name,
data: params,
dataType: 'html',
cache: false,
async: true,
success: functio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getfachview(id) {\n\n var loadUrl = \"http://localhost:52142/htwservice.ashx?function=\" + \"getfachview\" + \"&fach=\" + id;\n\n\n $(\"#viewfachcontent\")\n .load(loadUrl, null, function (responseText) {\n $(\"#viewfachcontent\").html(responseText);\n });\n}",
"function ... | [
"0.6566617",
"0.6409481",
"0.6232276",
"0.6200169",
"0.59943616",
"0.59871453",
"0.5877472",
"0.57862276",
"0.57470685",
"0.5730827",
"0.57197535",
"0.5702392",
"0.5697187",
"0.5687252",
"0.5687252",
"0.56820285",
"0.56787527",
"0.5663146",
"0.5644479",
"0.5617769",
"0.559234... | 0.72328365 | 0 |
return the canonical url in JS, so the URL of the main object, useful when on a view | function canonical_url() {
return $("link[rel='canonical']").attr('href');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"canonical() {\n return document.location.href;\n }",
"function getCanonicalUrl() {\n var link;\n\n if (window.self !== window.top) {\n try {\n link = window.top.document.head.querySelector('link[rel=\"canonical\"][href]');\n } catch (e) {}\n } else {\n link = document.head.querySelector(... | [
"0.76753986",
"0.7097425",
"0.70691615",
"0.6525981",
"0.6485347",
"0.6485347",
"0.6371021",
"0.63553923",
"0.6291369",
"0.60092133",
"0.59687775",
"0.59687775",
"0.58099836",
"0.57147235",
"0.5689017",
"0.56783015",
"0.5645044",
"0.5643359",
"0.5611349",
"0.55861723",
"0.558... | 0.7412916 | 1 |
this fuction returns the client details each trainer has a list of client id's, these are members that have selected the trainer to be their trainer members can select and change trainers, trainers can only remove them from thier list | getTrainerClients(trainerIn,membersIn){
const clientDetails = [];
if ((trainerIn === null || trainerIn === undefined)) {
// do nothingclients
} else if(trainerIn.clients.length === 0) {
// do nothing
} else {
logger.info('trainerIn ', trainerIn.clients);
// loop through the array o... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setTrainerClients(trainerId,all_members){\n let clients = [];\n const trainr = trainers.getTrainerById(trainerId);\n\n for (let i = 0; i < all_members.length; i++) {\n \n let clientid = all_members[i].trainerid;\n let membrid = all_members[i].id;\n ... | [
"0.7846999",
"0.65712655",
"0.6547267",
"0.6547267",
"0.6523228",
"0.6503578",
"0.6297526",
"0.6255173",
"0.6212675",
"0.6101016",
"0.6060805",
"0.6033377",
"0.5957697",
"0.59302646",
"0.5863055",
"0.58384335",
"0.58142906",
"0.5813103",
"0.57798207",
"0.5738459",
"0.56774324... | 0.7821028 | 1 |
this is designed to populate each trainers list of client id. it iterates each member object and locates that members selected trainer and if that trainer id matches the current trainer, that called this function then that members id is added to clients[] and retured to trainer. | setTrainerClients(trainerId,all_members){
let clients = [];
const trainr = trainers.getTrainerById(trainerId);
for (let i = 0; i < all_members.length; i++) {
let clientid = all_members[i].trainerid;
let membrid = all_members[i].id;
if(clientid... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getTrainerClients(trainerIn,membersIn){\n const clientDetails = [];\n \n if ((trainerIn === null || trainerIn === undefined)) {\n // do nothingclients\n } else if(trainerIn.clients.length === 0) {\n // do nothing\n } else {\n logger.info('trainerIn ', trainerIn.clients);\n // loop throu... | [
"0.74417174",
"0.6041724",
"0.5678219",
"0.560372",
"0.5529045",
"0.5445791",
"0.54411435",
"0.5406946",
"0.53888094",
"0.53265214",
"0.53223675",
"0.5246374",
"0.5233543",
"0.5178371",
"0.5170812",
"0.5166343",
"0.5162519",
"0.51407665",
"0.50858575",
"0.50282484",
"0.502239... | 0.79811895 | 0 |
Return the global Require.js function. | function getRequireJs() {
return window.requirejs;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeRequireFunction() {\n const Module = this.constructor;\n const self = this;\n\n function require(path) {\n return self.require(path);\n }\n\n /*\n function resolve(request) {\n return Module._resolveFilename(request, self);\n }\n\n require.resolve = resolve;\n\n require.main = process.m... | [
"0.673424",
"0.6723302",
"0.6664436",
"0.64179754",
"0.6177118",
"0.6125034",
"0.6033521",
"0.59822905",
"0.5912156",
"0.5821989",
"0.5793222",
"0.5772112",
"0.5749896",
"0.5749896",
"0.5719412",
"0.5719412",
"0.5719412",
"0.5719412",
"0.5719412",
"0.57140917",
"0.5686235",
... | 0.71498144 | 0 |
Parse a plugin URL into an object containing its parts. Old plugins normally used the require.js optimizer for bundling, and exposed multiple require.js modules. New plugins tend to be built using Webpack and expose a single anonymous module, which can be `require`d by its URL alone. Because old plugins exposed multipl... | function parseLegacyPluginUrl(name) {
/* eslint-disable prefer-destructuring */
const parts = name.split(';');
const o = {};
o.url = parts[0];
if (parts[1]) {
o.name = parts[1];
}
// force https
o.url = o.url.replace(/^http:/, 'https:');
return o;
/* eslint-enable prefer-destructuring */
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseUrl (url) {\r\n var rx = new RegExp(PLUGIN_DOMAIN + '\\/(.*)?\\/(.*)?\\/(.*)$');\r\n var parts = rx.exec(url);\r\n return {\r\n 'callback': parts[1],\r\n 'request_id': parts[2],\r\n 'url': parts[3]\r\n };\r\n ... | [
"0.6968252",
"0.612164",
"0.58231837",
"0.58005613",
"0.58005613",
"0.58005613",
"0.57486504",
"0.57486504",
"0.57486504",
"0.57123095",
"0.56986845",
"0.56883466",
"0.5657183",
"0.56391525",
"0.56391525",
"0.56391525",
"0.56391525",
"0.56245685",
"0.56245685",
"0.56057215",
... | 0.63827497 | 1 |
Add a module name alias to the plugin URL. This way, when we require([ module name ]), the plugin URL will be loaded instead. Then, the plugin URL will define() the module name anyway, and requirejs will figure everything out. | injectModuleAlias(o) {
this.require({
paths: {
// Chopping off the .js extension because require.js adds it
// since we're actually requiring a module name and not a path.
[o.name]: o.url.replace(/\.js$/, ''),
},
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resolveModule(def) {\n\t\tdef.url = cfg.bundles && Dragon.config.bundles[def.source] ? Dragon.config.bundles[def.source] : resolvePath(def.source) + '.js';\n\t}",
"applyPluginToUrl(url, pluginName) {\n return `${pluginName}!${url}`;\n }",
"applyPluginToUrl(url, pluginName) {\n return ... | [
"0.62501293",
"0.6221103",
"0.6221103",
"0.6221103",
"0.6112194",
"0.59665996",
"0.59532756",
"0.5643804",
"0.5614029",
"0.55996776",
"0.55708104",
"0.55708104",
"0.54582083",
"0.5448862",
"0.543227",
"0.54241717",
"0.5397289",
"0.52994776",
"0.5291562",
"0.5258351",
"0.52535... | 0.73874897 | 0 |
name String fields [String] | constructor(name, fields) {
super();
this.name = name;
this.fields = fields;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fieldNames(fields, as) {\n if (!fields) return null;\n return fields.map(function(f, i) {\n return as[i] || Object(vega_util__WEBPACK_IMPORTED_MODULE_0__[\"accessorName\"])(f);\n });\n}",
"field (name, type) {\n this._fields.push({\n name: name, type: type\n... | [
"0.6456071",
"0.63514495",
"0.63187474",
"0.6282303",
"0.62616163",
"0.61014503",
"0.6063623",
"0.60006285",
"0.59793186",
"0.5970347",
"0.5933963",
"0.5883169",
"0.5863191",
"0.58614284",
"0.5827354",
"0.58191353",
"0.58008635",
"0.57605827",
"0.57605827",
"0.5742467",
"0.57... | 0.68230957 | 1 |
getAllByKeyValue :: String > Value > [Object] | getAllByKeyValue(key, value) {
let savedData = (this.localStorageGet() !== null) ? this.localStorageGet() : [];
let result = [];
for (let i = 0; i < savedData.length; i++) {
if (savedData[i][key] === value) {
result.push(savedData[i]);
}
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSpecificValues(objects, key) {\n var valueArray = []\n\n objects.forEach(function(object){\n valueArray.push(object[key])\n })\n\n return valueArray\n}",
"function getValues(obj, key) {\n var objects = [];\n for (var i in obj) {\n if (!obj.hasOwnProperty(i)) continue;\n if ... | [
"0.6965669",
"0.695969",
"0.695969",
"0.6220322",
"0.620908",
"0.6124541",
"0.6123332",
"0.61040914",
"0.6091803",
"0.6072927",
"0.6023762",
"0.6012142",
"0.5975414",
"0.59640545",
"0.59640545",
"0.59640545",
"0.59640545",
"0.59640545",
"0.59640545",
"0.59640545",
"0.59640545... | 0.7343614 | 0 |
getById :: Value > Object | getById(id) {
return this.getByKeyValue('id', id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get(id) {}",
"get(id) {\n\n }",
"function byId() {\n return byKey('id');\n}",
"function getId (value) {\n return isObject(value) ? getIn(value, 'id') : value\n}",
"byId(id) {}",
"value (id) {\n return this.local ? this.local[id] : undefined\n }",
"getById(id) {\n return new this.Parse.Q... | [
"0.7711247",
"0.7190901",
"0.71835315",
"0.714656",
"0.7110378",
"0.6861089",
"0.6826802",
"0.6820199",
"0.6811296",
"0.6734528",
"0.67135006",
"0.67030066",
"0.6698973",
"0.66654015",
"0.6653515",
"0.6649748",
"0.66421187",
"0.66165596",
"0.6582003",
"0.6536789",
"0.65268975... | 0.8103457 | 0 |
updateById :: ID > Object > Boolean | updateById(id, data) {
let savedData = this.getAll();
if (savedData === null || savedData.length === 0) {
return false;
}
for (let i = 0; i < savedData.length; i++) {
if (savedData[i].id === id) {
for (let j = 0; j < this.fields.length; j++) {
let field = this.fields[j];
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"update(id) {}",
"async update(id, data, params) {}",
"update(id, objectWithNewValue) {\n return new Promise((resolve, reject) => {\n try {\n const result = this.collection.updateOne({_id: require('mongodb').ObjectID(id)}, {\n $set: objectWithNewValue\n ... | [
"0.75805557",
"0.7044397",
"0.6887395",
"0.67684525",
"0.67422867",
"0.66639966",
"0.6652435",
"0.662777",
"0.6518476",
"0.64986634",
"0.64770406",
"0.6431835",
"0.64074516",
"0.6379587",
"0.63755465",
"0.63416505",
"0.63367933",
"0.6314546",
"0.6271071",
"0.6271071",
"0.6271... | 0.72489566 | 1 |
Set functions for greeting, exit and invoice for BAMazon! | function greeting() {
console.log('\n==================== You\'ve entered BAM-azon! ====================\n');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Greeting() {}",
"function callToFunctions() {\n changeTitle(); // chnage the title\n changeBackGroundImage(); // change images\n }",
"function main() {\n setHomePage();\n eventModal();\n}",
"function printGreeting() {\r\n\r\n}",
"function sayThanks() {\n console.log('Thank you for your... | [
"0.5572522",
"0.5491745",
"0.5458438",
"0.543823",
"0.5403578",
"0.53815526",
"0.5366381",
"0.53072375",
"0.52963823",
"0.5286487",
"0.5276084",
"0.5262474",
"0.52506506",
"0.52503127",
"0.5238916",
"0.52374655",
"0.5213202",
"0.519715",
"0.5196261",
"0.51893145",
"0.5167704"... | 0.59334946 | 0 |
Handle all `zone:XXXX` attribute filters that we can handle. | filterCanHandle(filterType, filterArguments) {
const zones = this.zones;
return (
filterType === DSLFilterTypes.ATTRIB &&
filterArguments.label === LABEL &&
zones.includes(filterArguments.text.toLowerCase())
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"filterApply(resultSet, filterType, filterArguments) {\n let zone = \"\";\n const filterArgumentsValue = filterArguments.text.toLowerCase();\n\n if (this.zones.includes(filterArgumentsValue)) {\n zone = filterArgumentsValue;\n }\n\n return resultSet.filterItems(instance => {\n const node = ... | [
"0.5379097",
"0.51257026",
"0.48415187",
"0.47603947",
"0.47502476",
"0.47290906",
"0.47145498",
"0.46631572",
"0.46469468",
"0.463552",
"0.46328267",
"0.46289667",
"0.4620698",
"0.4620698",
"0.4620698",
"0.4620698",
"0.4620698",
"0.4620698",
"0.4620698",
"0.4620698",
"0.4620... | 0.53130263 | 1 |
Converts a string variable into an integer. | function convertToInt(stringVariable)
{
return parseInt(stringVariable);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stringInt(str){\n return(parseInt(str))\n}",
"function toInt(str){return parseInt(str,10)}",
"function convertToInt(str) {\n var str;\n return parseInt(str);\n}",
"function stringInt(str) {\n return parseInt(str);\n}",
"function toInt(string) {\n return parseInt(string, 10);\n }",
... | [
"0.7368531",
"0.73475105",
"0.7300036",
"0.72780055",
"0.727069",
"0.727069",
"0.727069",
"0.727069",
"0.727069",
"0.727069",
"0.727069",
"0.727069",
"0.7253083",
"0.7202872",
"0.7181313",
"0.70964175",
"0.70316017",
"0.70096105",
"0.6996218",
"0.699516",
"0.699516",
"0.699... | 0.82496315 | 0 |
Converts a string variable into a float. | function convertToFloat(stringVariable)
{
return parseFloat(stringVariable);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function convertToFloat(string) {\n return parseFloat(string);\n}",
"function convertToFloat(str) {\n return parseFloat(str);\n}",
"function convertToFloat(stringParam2){\n return parseFloat(stringParam2);\n}",
"function convertToFloat (floatString) {\n return parseFloat(floatString);\n}",
"function pf... | [
"0.77448225",
"0.7624064",
"0.7202061",
"0.71836686",
"0.7173172",
"0.7135874",
"0.7068418",
"0.6856375",
"0.6852983",
"0.67668295",
"0.67281014",
"0.6509782",
"0.64728695",
"0.63689166",
"0.6320835",
"0.6316395",
"0.6310669",
"0.6223501",
"0.6195734",
"0.6191002",
"0.6154686... | 0.83798087 | 0 |
Sends an event to orderGridTable to add all of the order's products to the product quantity column | addAllOrderQuantities(){
const detail = {
orderId: this.columnHeader.orderId
};
const addOrderQuantitiesEvent = new CustomEvent('addorderquantitiesevent', {
detail: detail,
bubbles: false,
composed: false
});
this.dispatchEvent(add... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addIntoTable(product) {\n window.products[product.id] = product;\n addRowIntoTable(product);\n }",
"function addToCart(event) {\n \n if (added.includes(event.target.parentElement.id)) {\n duplicateId = '#' + event.target.parentElement.id;\n \n cartTableBody.qu... | [
"0.629572",
"0.621005",
"0.6208358",
"0.62056994",
"0.6196986",
"0.6137211",
"0.6124661",
"0.60003453",
"0.5970594",
"0.5951199",
"0.59210217",
"0.5910576",
"0.5890351",
"0.58682156",
"0.58463585",
"0.58455884",
"0.58422154",
"0.58270204",
"0.5793043",
"0.57911265",
"0.578610... | 0.70549786 | 0 |
the way of declaring a default value in your objective is writing it to constructor, for example | function Default(value,name,id,key,phone){
this.value = value;
this.name = name
this.id = id
this.key = key;
this.phone = phone;
this.gender = "Male"
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"default() {\n }",
"function setDefault( value, defaultValue ) {\n\tif( value==''){\n\t\treturn defaultValue;\n\t} else {\n\t\treturn value;\n\t}\n}",
"_declareDefaults() { this._defaults = {}; }",
"function Person(name) {\n this.name = name || 'John';\n}",
"static set zero(value) {}",
"function Pizza... | [
"0.685185",
"0.6640418",
"0.65824735",
"0.6566896",
"0.64883745",
"0.6449681",
"0.6428315",
"0.63889027",
"0.6374811",
"0.6360736",
"0.63300675",
"0.63270766",
"0.6319377",
"0.631421",
"0.63079923",
"0.62858874",
"0.6285769",
"0.62622905",
"0.6259674",
"0.62403595",
"0.623905... | 0.6900142 | 0 |
Sort the rows based off of the selected column header's sort order | function sortRows() {
var col = vm.pages.sorting;
if (col && col.order) {
vm.sortedRows = vm.ngRows.slice().sort(function (a, b) {
// Date sorting
if (a[col.key] instanceof Date && b[col.key] instanceof Date)
return col.order * (a[col.key].get... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sortByColumn() {\n var sortHeader = $(this),\n sortIndex = sortHeader.index(), // Which column's header was clicked?\n tableRows = bizTbody.find('tr').get() // .get() converts to a real array of native DOM elements\n ;\n\n // Update ... | [
"0.7647411",
"0.7389403",
"0.73509234",
"0.73094904",
"0.7262581",
"0.7236867",
"0.7207283",
"0.7202321",
"0.71960384",
"0.70143",
"0.7008321",
"0.6952479",
"0.6948556",
"0.6935384",
"0.69283074",
"0.6921318",
"0.6901553",
"0.68712306",
"0.68671644",
"0.68664783",
"0.6841921"... | 0.7552418 | 1 |
Inserts an item before an element | function insertBefore(_this, element) {
if (!element) return $();
angular.forEach(_this, function (el) {
element.parent()[0].insertBefore(el, element[0]); // Use native method
});
return _this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function before(element, html) {\n element.insertAdjacentHTML('beforebegin', html);\n}",
"function insertBefore(el, referenceNode) {\n referenceNode.parentNode.insertBefore(el, referenceNode);\n}",
"prepend(content) {\n this.each(ele=> {\n ele.insertBefore(content[0], ele.children[0]);\n });\n... | [
"0.7534095",
"0.7512179",
"0.7122514",
"0.7064191",
"0.70565814",
"0.6940645",
"0.68804455",
"0.684507",
"0.6832904",
"0.6832226",
"0.6827521",
"0.68132067",
"0.68132067",
"0.6801002",
"0.67991835",
"0.6752927",
"0.67510146",
"0.6747111",
"0.67394114",
"0.6719956",
"0.6686962... | 0.75889516 | 0 |
Creates a new StreamWatcher that watches the given child_process | function StreamWatcher(child_process) {
if (child_process == null || child_process == undefined || child_process == '')
throw new Error("Invalid child process");
this._process = child_process;
this._patterns = [];
this._callbacks = [];
this._process.stdout.on('data', onData.bind(this));
this._process.stderr.on... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ProcessWatcher(pid, parent) {\n var self = this;\n\n this.dead = false;\n\n // check first if process is alive\n if (exports.alive(pid) === false) {\n process.nextTick(function () {\n self.dead = true;\n self.emit('dead');\n });\n return self;\n }\n\n // use ... | [
"0.6142492",
"0.5726936",
"0.55564857",
"0.5518913",
"0.5440539",
"0.5439265",
"0.5430836",
"0.53498757",
"0.53271186",
"0.5251331",
"0.5228368",
"0.52217627",
"0.5214898",
"0.52066594",
"0.52066594",
"0.52051336",
"0.5196785",
"0.50649524",
"0.50484216",
"0.49675602",
"0.494... | 0.81199664 | 0 |
Filter properties from the whole properties, maybe we want some of properties for our form | function filter_fields(properties, fields, data) {
var true_prop = {};
Object.keys(properties).forEach(function (prop) {
if(fields.length === 0 || fields.indexOf(prop) >= 0) {
if (typeof data === 'object' && data[prop]) {
properties[prop]['value'] = data[prop];
} else if(typeof properties[prop]['default']... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"filterProperties(properties) {\n\t\tconst filterBath = (property) => filterNumeric(this.state.bathFilter.min, this.state.bathFilter.max, property.baths);\n\t\tconst filterBeds = (property) => filterNumeric(this.state.bedFilter.min, this.state.bedFilter.max, property.beds);\n\t\tconst filterBuilding = (property) =>... | [
"0.747435",
"0.71442413",
"0.67260414",
"0.6464869",
"0.6399904",
"0.63931346",
"0.6344608",
"0.6302541",
"0.6299506",
"0.6267249",
"0.6251696",
"0.6229656",
"0.6221503",
"0.6205733",
"0.61866057",
"0.6159193",
"0.6121438",
"0.60939074",
"0.6034797",
"0.602669",
"0.6022896",
... | 0.7319046 | 1 |
Serially apply multipliers to nested compounds in reverse order. | function applyMultipliers(chemCompound)
{
let multipliedCompound = '';
let currentMultiplier = 1, lastCoefficient = 1;
let multiplyingFactor = [1];
let hitNumberLast = false;
for (let x = chemCompound.length - 1; x >= 0; x--) {
currentMultiplier = multiplyingFactor.reduce((a,b) => {return a * b;});
if (!isNaN(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function recursiveMultiply() {\n \n}",
"implicitMul() {\n const factors = [];\n\n factors.push(this.division());\n\n while (true) {\n let token = this.currentToken();\n\n if (matches(token, '(')) {\n factors.push(this.division());\n } else if ... | [
"0.5555779",
"0.5194178",
"0.51654917",
"0.5056976",
"0.50270873",
"0.50251377",
"0.50148135",
"0.49335632",
"0.49202523",
"0.48967808",
"0.4888365",
"0.48585775",
"0.4846032",
"0.48411068",
"0.4828067",
"0.48137575",
"0.48137575",
"0.4794807",
"0.47710887",
"0.47581273",
"0.... | 0.57154095 | 0 |
Returns a function that can adjust a path from source path to out path, based on an existing mapping from source to out path. TODO(tbosch): talk to the TypeScript team to expose their logic for calculating the `rootDir` if none was specified. Note: This function works on normalized paths from typescript. | function createSrcToOutPathMapper(outDir, sampleSrcFileName, sampleOutFileName, host) {
if (host === void 0) { host = path; }
var srcToOutPath;
if (outDir) {
var path_1 = {}; // Ensure we error if we use `path` instead of `host`.
if (sampleSrcFileName == null || sampleOutFileName == null) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getComputedSourceRoot(sourceRoot, generatedPath, pathMapping = {}) {\n let absSourceRoot;\n if (sourceRoot) {\n if (sourceRoot.startsWith('file:///')) {\n // sourceRoot points to a local path like \"file:///c:/project/src\", make it an absolute path\n absSourceRoot = uti... | [
"0.6282203",
"0.6134486",
"0.57145566",
"0.565331",
"0.56358165",
"0.560514",
"0.5542286",
"0.55382645",
"0.54971725",
"0.54511803",
"0.53778356",
"0.5348757",
"0.5295354",
"0.5287319",
"0.5285438",
"0.52740496",
"0.52740496",
"0.52723086",
"0.52674234",
"0.5249204",
"0.52458... | 0.7109466 | 0 |
Utility function used to set multiple headers on a response object. | function setHeaders(res, headers) {
Object.keys(headers).forEach(header => res.setHeader(header, headers[header]));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set headers(value) {\n if (!this.#writable) {\n throw new Error(\"The response is not writable.\");\n }\n this.#headers = value;\n }",
"function setDefaultHeaders(responseObj) {\n\tfor (var count=0; count < serverConfi... | [
"0.70558727",
"0.6759414",
"0.66557544",
"0.6646413",
"0.658191",
"0.65629935",
"0.6464509",
"0.64519376",
"0.6360034",
"0.6264801",
"0.6243323",
"0.6236082",
"0.6183948",
"0.61343414",
"0.6117309",
"0.60807765",
"0.60719013",
"0.60624975",
"0.6053441",
"0.60530585",
"0.60116... | 0.76034445 | 0 |
Bind the event handler for advanceOn | function bindAdvance() {
// An empty selector matches the step element
var _parseShorthand = (0, _utils.parseShorthand)(this.options.advanceOn, ['selector', 'event']),
event = _parseShorthand.event,
selector = _parseShorthand.selector;
var handler = _setupAdvanceOnHandler.call(this, selector);
// ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"moveToNextQuestion() {\n // Invoke our callback.\n this.onContinue({});\n }",
"function nextQuestion(event) {\n\n}",
"bindNextQuestionButton(handler) {\n\n this.next = this.getElement(\"#volgende\");\n this.next.addEventListener('click', event => {\n handler();\n ... | [
"0.6526337",
"0.6456109",
"0.6445673",
"0.6154677",
"0.6020501",
"0.6020085",
"0.6005644",
"0.5977284",
"0.59308517",
"0.5859042",
"0.585469",
"0.58458596",
"0.584067",
"0.5818466",
"0.5774075",
"0.57639617",
"0.576052",
"0.57495004",
"0.56998676",
"0.5675528",
"0.564463",
... | 0.7442928 | 0 |
takes in base price and calculates the sales tax in MI Future feature will need to ask the user to enter their sales tax | calcSalesTax() {
this.price = this.price * .06 + this.price;
console.log("$" + this.price + ` Your ${this.model} will cost this after sales tax in Michigan \n`)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calculateTax() {\n //var subTotal = document.orderform.subtotal.value; OR for dryer code:\n var subtotal = subTotal();\n var product = document.orderform.product.value;\n // var stax = 0.1;\n let stax;\n let tax;\n if (product == \"book\" || product == \"medicine\" || product == \"food\") {\n ... | [
"0.81880116",
"0.7596849",
"0.75277114",
"0.7520019",
"0.7473893",
"0.7456114",
"0.74129105",
"0.7349945",
"0.72899735",
"0.7258782",
"0.72409934",
"0.7219422",
"0.72102636",
"0.7210074",
"0.7208408",
"0.71827793",
"0.71180445",
"0.7089439",
"0.7075098",
"0.70626605",
"0.7042... | 0.7729684 | 1 |
show last move of the game | function lastMove() {
moveStack.count = moveStack.moves.length - 1;
updateBoard();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function HighlightLastMove ()\n {\n var theShowMoveTextObject = document.getElementById (\"ShowLastMove\" );\n\n /*\n * Remove the highlighting from the old anchor if any.\n */\n if (oldAnchor >= 0)\n {\n theAnchor = document.getElementById('Mv' + oldAnchor);\n the... | [
"0.6701905",
"0.6680341",
"0.63890517",
"0.6366861",
"0.6336093",
"0.63162863",
"0.6284884",
"0.6178981",
"0.6164301",
"0.61516213",
"0.61248004",
"0.6123657",
"0.6099943",
"0.6014011",
"0.5977262",
"0.5941767",
"0.5937146",
"0.5935862",
"0.5924577",
"0.5903305",
"0.58687645"... | 0.70200986 | 0 |
Function to clear the treecontainer div of the previous d3 visualisation and to clear the text in the input field. | function clearQueryData() {
// clear the tree-container of the previous D3
while (treeContainer.firstChild) {
treeContainer.removeChild(treeContainer.firstChild);
if (treeContainer.firstChild) {
treeContainer.removeChild(treeContainer.firstChild);
}
}
// clear input box, remove error
userInp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearTree() {\n for (let j = 0; j < dps.length; j++) {\n dps[j][2] = blackColor;\n }\n refreshSvg();\n numMessage = 0;\n treeSVG.selectAll(\".explaintext\").data([]).exit().remove();\n treeSVG.selectAll(\"text\").style(\"fill\", whiteColor);\n treeSVG.selectAll(\"circle\").style(\"fill\", whiteC... | [
"0.75127053",
"0.74530387",
"0.74245363",
"0.7314983",
"0.7276127",
"0.72621405",
"0.72574764",
"0.7034701",
"0.70046276",
"0.6940629",
"0.6919295",
"0.6892824",
"0.688928",
"0.68718594",
"0.6864378",
"0.6817927",
"0.6776799",
"0.6774165",
"0.67509085",
"0.6742578",
"0.671612... | 0.7800834 | 0 |
Function to create a element that contains an error message to inform the user That the pokemon name they input was not found. takes a parent element as an argument, creates an element, adds a color attribute and id to it, appends it to parent element then clears the text box for the next input. | function createErrorMsg(parent) {
// const parent = userInput.parentElement;
const errMsg = document.createElement('p');
errMsg.innerHTML = 'Pokemon not Found!!!';
errMsg.style.color = 'red';
errMsg.id = 'error-message';
parent.appendChild(errMsg);
// clear input box and remove error mesg
userInput.valu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function appendErrorElement(inputName, parentElement) {\n const err = doc.createElement(\"p\");\n const txt = doc.createTextNode(\n `You should not leave ${inputName} empty and please enter valid value.`\n );\n err.appendChild(txt);\n err.classList.add(\"warning-text\");\n var hasAlreadyError = parentElem... | [
"0.7111023",
"0.64379084",
"0.6234581",
"0.6071204",
"0.6068108",
"0.5931718",
"0.591643",
"0.5892866",
"0.58676535",
"0.5834193",
"0.5741272",
"0.5731918",
"0.57230604",
"0.5717648",
"0.57049716",
"0.57034934",
"0.5695108",
"0.56898254",
"0.5682806",
"0.56725746",
"0.5667522... | 0.8087305 | 0 |
Function to remove the error message element from the DOM. Takes a parent element as an argument. | function clearError(parent) {
var errorElemt = document.getElementById('error-message');
if (errorElemt) {
parent.removeChild(errorElemt);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeMessage() {\n let error = document.getElementById(\"parentdiv\");\n error.remove();\n}",
"function clear_error(e) {\n\n\tvar parent = e.target.parentNode;\n\n\tif (parent.classList.contains('error')) {\n\t\tparent.classList.remove('error');\n\t\t$(parent).find('.error-msg').remove();\n\t}\n\n}",... | [
"0.812956",
"0.7220384",
"0.70758224",
"0.7048862",
"0.6915305",
"0.6835912",
"0.67973524",
"0.67678046",
"0.6764786",
"0.674365",
"0.6736386",
"0.6681095",
"0.664827",
"0.66252303",
"0.66026986",
"0.65621364",
"0.65574265",
"0.65490866",
"0.6541207",
"0.647562",
"0.6449298",... | 0.81992596 | 0 |
Function to create the main parent DataContainer to store all the nodes of the D3. It takes the JSON object response from the fetch query, creates a new DataContainer, then adds the following objects to the children array of the dataContainer using the getPokemonAttribute(), getPokemonStats, and getPokemonProp function... | function createPokeJson(pokemonObj) {
// create the initial object container
var newPokemonObj = new DataContainer(pokemonObj.name, []);
// add abilities
newPokemonObj.children.push(
getPokemonAttribute(pokemonObj.abilities, 'abilities'));
// add base_experience
newPokemonObj.children.push(
getPoke... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createHierarchyData(){\n\t\tlet crimedata = commonfunctionsNamespace.getCrimesAndDataByYearAndState(this.year, this.state, this.data),\n\t\t\ttreeData=firstNode(this.year),\n\t\t\ttreeDataState=secondNode(treeData,this.state),\n\t\t\ttreeDataCrimes=lastNode(treeDataState);\n\n\t\tfunction firstNode(year){\n\t\t\tl... | [
"0.61044395",
"0.5984574",
"0.59209466",
"0.56510264",
"0.5648902",
"0.56040096",
"0.5590986",
"0.5544716",
"0.5484161",
"0.54553896",
"0.54476565",
"0.5434865",
"0.53778267",
"0.535111",
"0.5314749",
"0.52771795",
"0.5256336",
"0.5237454",
"0.5230685",
"0.52194804",
"0.52167... | 0.62194186 | 0 |
Function to take a pokemon object property that contains a raw datatype, usually an integer, and place it in a DataContainer object and return it. The name param will be the name of the DataContainer | function getPokemonProperty(pokemonObjProp, name) {
var dataContainer = new DataContainer(name, []);
dataContainer.children.push({
name: pokemonObjProp.toString()
});
return dataContainer;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPokemonAttribute(attributeObjArray, name) {\n //Parent data container\n var dataContainer = new DataContainer(name, []);\n\n for (let i = 0; i < attributeObjArray.length; i++) {\n var innerArray = Object.values(attributeObjArray[i]);\n for (var j = 0; j < innerArray.length; j++) {\n if (t... | [
"0.6105484",
"0.6088865",
"0.5670679",
"0.56366366",
"0.5210909",
"0.5160813",
"0.51193905",
"0.5073795",
"0.5070847",
"0.50176996",
"0.5005497",
"0.49715072",
"0.49527478",
"0.4935186",
"0.49333405",
"0.49192452",
"0.49169308",
"0.4901165",
"0.48895574",
"0.48846698",
"0.486... | 0.760335 | 0 |
Function takes an array of objects labed attributeObjArray that is taken from the JSON repsonse pokemon object. It then loops through each object to check firstly if it has a futher nested object. If so it then checks if it has a property called name and if it contains a string. If so the value is extracted and placed ... | function getPokemonAttribute(attributeObjArray, name) {
//Parent data container
var dataContainer = new DataContainer(name, []);
for (let i = 0; i < attributeObjArray.length; i++) {
var innerArray = Object.values(attributeObjArray[i]);
for (var j = 0; j < innerArray.length; j++) {
if (typeof innerA... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPokemonStats(attributeObjArray, name) {\n // parent data container\n var dataContainer = getPokemonAttribute(attributeObjArray, name);\n // loop through the dataContainer's children array \n for (let i = 0; i < dataContainer.children.length; i++) {\n // get ref to the base_stat and effort proper... | [
"0.70892584",
"0.5662647",
"0.5613554",
"0.55472064",
"0.5447256",
"0.5412128",
"0.52453613",
"0.5115927",
"0.51018316",
"0.5098559",
"0.5081736",
"0.50649464",
"0.5016092",
"0.4997666",
"0.49713904",
"0.49565366",
"0.49342626",
"0.4902515",
"0.48674393",
"0.48629475",
"0.483... | 0.82883406 | 0 |
Function that is a specialist for creating a container for the pokemon object's stats. MUST be passed the stats array from the pokemon JSON object. The function calls the getPokemonAttribute() and uses the returned DataContainer to add the additional values to. It then loops through the attributeObjArray again (because... | function getPokemonStats(attributeObjArray, name) {
// parent data container
var dataContainer = getPokemonAttribute(attributeObjArray, name);
// loop through the dataContainer's children array
for (let i = 0; i < dataContainer.children.length; i++) {
// get ref to the base_stat and effort property from th... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPokemonAttribute(attributeObjArray, name) {\n //Parent data container\n var dataContainer = new DataContainer(name, []);\n\n for (let i = 0; i < attributeObjArray.length; i++) {\n var innerArray = Object.values(attributeObjArray[i]);\n for (var j = 0; j < innerArray.length; j++) {\n if (t... | [
"0.7394639",
"0.65662473",
"0.56891155",
"0.5581923",
"0.5481177",
"0.54618907",
"0.51655823",
"0.50947005",
"0.50877005",
"0.5038524",
"0.501475",
"0.49903238",
"0.49644274",
"0.48946825",
"0.48844245",
"0.48649514",
"0.48051012",
"0.4774424",
"0.4752612",
"0.4748192",
"0.47... | 0.79479676 | 0 |
Function to take a DataContainer object and split it into 4 DataContainer objects, then place them inside a new DataContainer object and return it. MUST be passed a DataContainer that has >= 4 child objects. | function nodeShrinker(dataContainer) {
var newDataContainer = new DataContainer(dataContainer.name, []);
let total = dataContainer.children.length;
let subGroup = 0;
if (total % 4 === 0) {
subGroup = total / 4;
} else {
subGroup = (total - (total % 4)) / 4;
}
// function to create an object and fi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fillMoveObject(start, end, name) {\n var moveObject = new DataContainer(name, []);\n for (var i = start; i < end; i++) {\n moveObject.children.push(dataContainer.children[i]);\n }\n return moveObject;\n }",
"divideForPagination(arrayOfObjects){\n let newArray = [];\n //we... | [
"0.5728263",
"0.57007295",
"0.55580974",
"0.5557574",
"0.5509308",
"0.5509308",
"0.54890096",
"0.5399082",
"0.53543156",
"0.52786976",
"0.5272133",
"0.5260275",
"0.5260275",
"0.5247799",
"0.5247799",
"0.519208",
"0.5151346",
"0.51039404",
"0.50860536",
"0.50109154",
"0.500284... | 0.6560161 | 0 |
function to create an object and fill it with the subset of the moves, takes a name for the object | function fillMoveObject(start, end, name) {
var moveObject = new DataContainer(name, []);
for (var i = start; i < end; i++) {
moveObject.children.push(dataContainer.children[i]);
}
return moveObject;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"pickMove(moveName) {\n this._move = new Move(moveName); // new Move(\"scissors\");\n }",
"function cloneMove(move) {\n var newMove = {};\n for (i in move) {\n newMove[i] = move[i]\n }\n return newMove;\n }",
"function createRover(name) {\n let rover = {\n rovername: name,\... | [
"0.6788601",
"0.5837074",
"0.5752051",
"0.56612855",
"0.55740577",
"0.55686545",
"0.5551491",
"0.5520897",
"0.55196166",
"0.5497673",
"0.5447255",
"0.53692913",
"0.5365753",
"0.5338886",
"0.53127486",
"0.53061485",
"0.52985007",
"0.52511376",
"0.52480227",
"0.5242005",
"0.522... | 0.68331575 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.