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 |
|---|---|---|---|---|---|---|
Lists files without folders. | async listFilesWithoutFolders(params = {}) {
let { extraQ = '' } = params;
if (extraQ === '') extraQ = 'mimeType != \'application/vnd.google-apps.folder\'';
if (!extraQ.includes('mimeType')) extraQ += ' and mimeType != \'application/vnd.google-apps.folder\'';
return this.listFiles({
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fileList( files ) {\n if (!files) return [];\n return nub(files.split(\"\\n\").filter(function(s) { \n return (s); // && !local.contains(s)); \n }));\n }",
"function untracked() {\n return fs.readdirSync(files.workingCopyPath())\n .filter(function(p) { return index.toc()... | [
"0.6593795",
"0.62769413",
"0.62691444",
"0.61801094",
"0.61508274",
"0.61099654",
"0.60661197",
"0.6033911",
"0.5996531",
"0.59329",
"0.5926679",
"0.5875515",
"0.58725727",
"0.58709663",
"0.58681023",
"0.58608407",
"0.5838842",
"0.5838142",
"0.58150584",
"0.5814213",
"0.5763... | 0.7501617 | 0 |
formatGoogleJSON is used to change the strange keys used for latitude and longitude into easier to use "lat" and "lon" keys. The quotes must be included or else we could replace unexpected pieces of the string such as street name or encoded polyline | function formatGoogleJSON(strangeLat, strangeLon, jsonString) {
// Build the regular expressions, and return the replacement
var strangeLatRegExp = new RegExp("\""+strangeLat+"\"","g");
var strangeLonRegExp = new RegExp("\""+strangeLon+"\"","g");
return jsonString.replace(strangeLatRegExp,"\"lat\"")
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formatJson(json) {\r\n\ttry {\r\n\t\tjson = JSON.stringify( JSON.parse(json), null, 2);\r\n\t} catch (e) {\r\n\t\t// use default if fail to parse\r\n\t}\r\n\treturn json;\r\n}",
"function JSONize(str) {\r\n return str\r\n // Wrap keys without quote with double quotes\r\n .replace(/([\\$\\w]+)\\s*... | [
"0.571719",
"0.56736004",
"0.55766773",
"0.5513113",
"0.5396646",
"0.5288184",
"0.5240787",
"0.52340066",
"0.5226706",
"0.5220932",
"0.5130833",
"0.51067835",
"0.50677776",
"0.5044523",
"0.49939263",
"0.49481893",
"0.49481893",
"0.4940417",
"0.49265772",
"0.49151188",
"0.4881... | 0.81045234 | 0 |
Initializes a path with the primary style and no points. | function initializePath()
{
// Return the a primary polyline
return createPrimaryPolyline(new Array());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ShapePath() {\n\t\t\tthis.subPaths = [];\n\t\t\tthis.currentPath = null;\n\t\t}",
"function ShapePath() {\n\t \tthis.subPaths = [];\n\t \tthis.currentPath = null;\n\t }",
"function ShapePath() {\n\t\tthis.subPaths = [];\n\t\tthis.currentPath = null;\n\t}",
"function beginPath() {\n t... | [
"0.67919433",
"0.67612994",
"0.6759678",
"0.6644205",
"0.65805984",
"0.65805984",
"0.65805984",
"0.63202614",
"0.6313468",
"0.62870383",
"0.62647796",
"0.6217511",
"0.61699986",
"0.61095536",
"0.6104439",
"0.6067836",
"0.6048337",
"0.6031411",
"0.6002511",
"0.5928887",
"0.590... | 0.7072215 | 0 |
Displays an encoded polyline on a map | function displayEncodedPolyline(map, encodedPolyline, isPrimary)
{
// Decode the polyline for the route
var routeCoordinates = google.maps.geometry.encoding.decodePath(encodedPolyline);
if (isPrimary == true) {
var routePath = createPrimaryPolyline(routeCoordinates);
} else {
var route... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderLinearRoute(path, map){\n //Create polyline and render it on map\n var polyLine = new google.maps.Polyline({\n path: path,\n map: map,\n geodesic: true,\n strokeColor: '#000000',\n strokeWeight: 5\n });\n\n //Add poly... | [
"0.7211435",
"0.6940197",
"0.67172015",
"0.66118526",
"0.6598517",
"0.6560559",
"0.64743656",
"0.6451442",
"0.644851",
"0.63928014",
"0.63308436",
"0.6326523",
"0.62831146",
"0.62820286",
"0.6257323",
"0.62496704",
"0.62408483",
"0.62277853",
"0.61712587",
"0.61597526",
"0.61... | 0.7393574 | 0 |
Sets the bounds on a map to fit and focus on a polyline | function setMapBoundsToPolyline(map, polyline)
{
// Set the bounds of the map to center and zoom on the route
var bounds = new google.maps.LatLngBounds();
var routeCoordinates = polyline.getPath();
routeCoordinates.forEach(function(e) {
bounds.extend(e);
});
map.fitBounds(bounds);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setMapBoundsToIncludePolyline(map, polyline)\n{\n // Get the bounds of the map and add the new points to the map bounds\n var bounds = map.getBounds();\n var routeCoordinates = polyline.getPath();\n routeCoordinates.forEach(function(e) {\n bounds.extend(e);\n });\n map.fitBounds... | [
"0.78916115",
"0.674747",
"0.67107594",
"0.65106577",
"0.6509638",
"0.64663297",
"0.6448911",
"0.64267963",
"0.64077723",
"0.61245674",
"0.61137325",
"0.6099575",
"0.6086647",
"0.6074348",
"0.60599375",
"0.6050574",
"0.60381734",
"0.60378253",
"0.6012557",
"0.5986263",
"0.597... | 0.7955443 | 0 |
Increases the bounds of a map, if necessary, to include a polyline | function setMapBoundsToIncludePolyline(map, polyline)
{
// Get the bounds of the map and add the new points to the map bounds
var bounds = map.getBounds();
var routeCoordinates = polyline.getPath();
routeCoordinates.forEach(function(e) {
bounds.extend(e);
});
map.fitBounds(bounds);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setMapBoundsToPolyline(map, polyline)\n{\n // Set the bounds of the map to center and zoom on the route\n var bounds = new google.maps.LatLngBounds();\n var routeCoordinates = polyline.getPath();\n routeCoordinates.forEach(function(e) {\n bounds.extend(e);\n });\n map.fitBounds(... | [
"0.7661899",
"0.6660364",
"0.64017713",
"0.63822246",
"0.63307667",
"0.6316831",
"0.6312358",
"0.63089144",
"0.6293127",
"0.6274817",
"0.6244283",
"0.6236652",
"0.617783",
"0.6154763",
"0.6131058",
"0.61258715",
"0.6116997",
"0.61131024",
"0.6108739",
"0.6066133",
"0.6064942"... | 0.7956064 | 0 |
Creates a polyline with the primary line style | function createPrimaryPolyline(polylineCoordinates)
{
var routePath = new google.maps.Polyline({
path: polylineCoordinates,
strokeColor: PRIMARY_ROUTE_COLOR,
strokeOpacity: PRIMARY_ROUTE_OPACITY,
strokeWeight: PRIMARY_ROUTE_WEIGHT
});
// Return the created polyline
r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function polyline(d) {\n var coords = d.coordinates || [];\n var o = importMultiLineString(coords);\n applyStyleAttributes(o, 'polyline', d);\n return o;\n }",
"static addPolyline(svg, points, color, width) {\n const polyline = document.createElementNS(svgNS, 'polyline');\n polyline.setAttribu... | [
"0.7360829",
"0.73308134",
"0.71993417",
"0.7005626",
"0.69793385",
"0.68313175",
"0.679231",
"0.6760656",
"0.6700179",
"0.66947806",
"0.66561204",
"0.661239",
"0.65448534",
"0.65427166",
"0.6475495",
"0.6449901",
"0.643184",
"0.641718",
"0.6356986",
"0.6351821",
"0.6331066",... | 0.742961 | 0 |
Creates a polyline with the secondary line style | function createNonPrimaryPolyline(polylineCoordinates)
{
var routePath = new google.maps.Polyline({
path: polylineCoordinates,
strokeColor: SECONDARY_ROUTE_COLOR,
strokeOpacity: SECONDARY_ROUTE_OPACITY,
strokeWeight: SECONDARY_ROUTE_WEIGHT
});
// Return the created... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static addPolyline(svg, points, color, width) {\n const polyline = document.createElementNS(svgNS, 'polyline');\n polyline.setAttributeNS(null, 'points', points.join(' '));\n polyline.setAttributeNS(null, 'stroke', color);\n polyline.setAttributeNS(null, 'stroke-width', width);\n polyline.setAttribu... | [
"0.6995864",
"0.6915878",
"0.6855251",
"0.6792549",
"0.66835684",
"0.6634238",
"0.64558035",
"0.6434239",
"0.6348947",
"0.6313195",
"0.6262939",
"0.6246567",
"0.62382996",
"0.62325764",
"0.62199825",
"0.6215821",
"0.6202395",
"0.61721855",
"0.6171813",
"0.61419016",
"0.612081... | 0.6945549 | 1 |
Binds origin and destination textboxes to the map | function bindTextBoxesToMap(originTextBox, destinationTextBox)
{
// Route preview changes whenever the user finished editing the
// seat pickup and dropoff textboxes
$(originTextBox).change(previewRoute);
$(destinationTextBox).change(previewRoute);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateDraggedGeoCodes()\n{\n\tpoint = marker.getPosition()\n\tThisLat = point.lat();\n\tThisLong = point.lng();\n\tdocument.getElementById(\"latitude\").value = ThisLat;\n\tdocument.getElementById(\"longitude\").value = ThisLong;\t\n}",
"function fillCoords(coord){\n\tlet [x, y] = coord.split('|');\n\td... | [
"0.5971033",
"0.59348166",
"0.5872041",
"0.57852226",
"0.5748141",
"0.5735873",
"0.57336056",
"0.5722131",
"0.5708711",
"0.56907076",
"0.5681576",
"0.56698465",
"0.5660893",
"0.564544",
"0.5625982",
"0.56129396",
"0.56010664",
"0.55764425",
"0.5567257",
"0.5544915",
"0.553539... | 0.76910347 | 0 |
Clears the origin decode flag used to block form submission before the map api returns | function clearOriginDecodePendingFlag()
{
// Clear the flag
isOriginDecodePending = false;
// Submit the form if necessary and if the function is defined
if (typeof(MaybeSubmitForm) == typeof(Function))
{
MaybeSubmitForm();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearDestinationDecodePendingFlag()\n{\n // Clear the flag\n isDestinationDecodePending = false;\n // Submit the form if necessary and if the function is defined\n if (typeof(MaybeSubmitForm) == typeof(Function))\n {\n MaybeSubmitForm();\n }\n}",
"function resetAddressForm() {\n... | [
"0.7214232",
"0.61705375",
"0.6118493",
"0.6107173",
"0.6018436",
"0.5950861",
"0.5909591",
"0.5793105",
"0.5736355",
"0.56923175",
"0.5640627",
"0.56190056",
"0.5604248",
"0.56008637",
"0.5597689",
"0.5594856",
"0.5582674",
"0.55783176",
"0.5573766",
"0.5570293",
"0.55630136... | 0.7961197 | 0 |
Clears the destination decode flag used to block form submission before the map api returns | function clearDestinationDecodePendingFlag()
{
// Clear the flag
isDestinationDecodePending = false;
// Submit the form if necessary and if the function is defined
if (typeof(MaybeSubmitForm) == typeof(Function))
{
MaybeSubmitForm();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearOriginDecodePendingFlag()\n{\n // Clear the flag\n isOriginDecodePending = false;\n // Submit the form if necessary and if the function is defined\n if (typeof(MaybeSubmitForm) == typeof(Function))\n {\n MaybeSubmitForm();\n }\n}",
"function clearDirectionsPendingFlag()\n{\... | [
"0.7324264",
"0.6374228",
"0.62827235",
"0.6241478",
"0.61284935",
"0.6089232",
"0.60846156",
"0.6025811",
"0.5959905",
"0.5797253",
"0.5791586",
"0.5746194",
"0.5744877",
"0.57368976",
"0.5696786",
"0.56916726",
"0.5681758",
"0.5672906",
"0.5656114",
"0.56448525",
"0.563725"... | 0.77695745 | 0 |
Clears the directions pending flag used to block form submission before the map api returns | function clearDirectionsPendingFlag()
{
// Clear the flag
isDirectionsPending = false;
// Submit the form if necessary and if the function is defined
if (typeof(MaybeSubmitForm) == typeof(Function))
{
MaybeSubmitForm();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearDirections() {\n // Jeigu rodomas marsrutas, jį panaikina\n if (directionsDisplay != null) {\n directionsDisplay.setMap(null);\n directionsDisplay = null;\n }\n }",
"function clearRoutes() {\n if (directionsDisplay != null) {\n // ... | [
"0.69077843",
"0.6599664",
"0.6583848",
"0.65765166",
"0.65042967",
"0.645803",
"0.64423174",
"0.643673",
"0.6407395",
"0.63241637",
"0.63000405",
"0.6165538",
"0.61604077",
"0.6149941",
"0.61438996",
"0.6133229",
"0.608855",
"0.60663086",
"0.6065352",
"0.60564995",
"0.603191... | 0.79753524 | 0 |
Verifies a form can be submitted and is not blocked | function canSubmitForm()
{
return !isOriginDecodePending && !isDestinationDecodePending && !isDirectionsPending;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function verifyForm(form) {\n\tif (!requestValidation(form)) {\n\t\treturn false;\n\t}\n\treturn true;\n}",
"function verifyForm()\n{\n valid = true;\n validFields.forEach(function(element) { valid &= element });\n changeFormState(valid);\n}",
"function try_submit() {\n log(\"user attempting to sub... | [
"0.72570765",
"0.6835136",
"0.6831679",
"0.68150824",
"0.67664284",
"0.6717425",
"0.6650665",
"0.6604149",
"0.6584176",
"0.63733876",
"0.6354924",
"0.63460326",
"0.6321804",
"0.63121986",
"0.6272875",
"0.626748",
"0.6267259",
"0.6246742",
"0.6229622",
"0.62031955",
"0.6199534... | 0.7072273 | 1 |
Add/remove the class `classname` depending on the value of the property `className` | function setClassByName(className, el, binding, vnode) {
const prop = kebab2Camel(className);
const value = vnode.context._data[prop];
// Check that the corresponding property is defined
if (value === undefined || value === null) {
logError(`property "${prop}" is undefined or null`);
return -1;
}
// Add/re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AddClassName(objElement, strClass, blnMayAlreadyExist){\n // if there is a class\n if ( objElement.className ){\n // the classes are just a space separated list, so first get the list\n var arrList = objElement.className.split(' ');\n // if the new class name may already exist in list\n... | [
"0.7003585",
"0.6945384",
"0.6878793",
"0.6875744",
"0.6875744",
"0.6857913",
"0.67826617",
"0.6775836",
"0.67059",
"0.6693006",
"0.6662013",
"0.6662013",
"0.6650796",
"0.66327894",
"0.66170734",
"0.6586801",
"0.6537774",
"0.6536214",
"0.649575",
"0.64879626",
"0.6486979",
... | 0.70667607 | 0 |
Return `true` if the classes are the same between the two VNodes, `false` otherwise | function checkIfSameClasses(vnode, oldVnode) {
if (!oldVnode || !vnode.data.class || !oldVnode.data.class) {
return false;
}
const classes = vnode.data.class;
const oldClasses = oldVnode.data.class;
if (!['string', 'object'].includes(typeof classes) || typeof classes !== typeof oldClasses) {
return false;... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function instanceOf(left,right) {\n let proto = left.__proto__;\n let prototype = right.prototype\n while(true) {\n if(proto === null) return false\n if(proto === prototype) return true\n proto = proto.__proto__;\n }\n}",
"areNodesEqual(nodeA, nodeB) {\n if (!nodeA && !nodeB) ... | [
"0.5885341",
"0.5827402",
"0.5687702",
"0.5686205",
"0.5686205",
"0.5685896",
"0.5668562",
"0.5664929",
"0.56409866",
"0.5615034",
"0.55606294",
"0.55420035",
"0.55367976",
"0.553404",
"0.5530616",
"0.5495546",
"0.5492337",
"0.54916984",
"0.5485459",
"0.547842",
"0.5476939",
... | 0.7053808 | 0 |
Convert a kebabcased string to camel case and conversely | function kebab2Camel(str) {
return str.replace(/-[\da-z]/g, match => match.toUpperCase()[1]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function kebabToCamel(name){return name.replace(DASH_LOWERCASE_REGEXP,fnCamelCaseReplace);}",
"function kebabToCamel(name) {\n\t return name\n\t .replace(DASH_LOWERCASE_REGEXP, fnCamelCaseReplace);\n\t}",
"function kebabize(str) { \n return str.replace(/[0-9]/g, \"\").split(/(?=[A-Z])/).join(\"-\").toLowe... | [
"0.83157396",
"0.820259",
"0.81056046",
"0.8099267",
"0.8099267",
"0.8099267",
"0.8099267",
"0.8099267",
"0.8099267",
"0.8099267",
"0.8099267",
"0.796684",
"0.78287023",
"0.7653223",
"0.7582698",
"0.7578008",
"0.75334376",
"0.75334376",
"0.752409",
"0.75202125",
"0.75202125",... | 0.86758554 | 0 |
The valueof() method in JavaScript is used to return the primitive value of a number. This method is usually called internally by JavaScript and not explicitly in web code. | function valueof_method() {
var num = 64546;
document.write("Output : " + num.valueOf());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get intValue() {}",
"function value() { }",
"get valueAsNumber() {\n return this.getInput().valueAsNumber;\n }",
"valueOf() {\n return this.value;\n }",
"valueOf() {\n return this.value;\n }",
"valueOf() {\n return this.value;\n }",
"valueOf() {\n return this.value;\n }",
"v... | [
"0.6552026",
"0.641764",
"0.62665284",
"0.6175995",
"0.6175995",
"0.6175995",
"0.6175995",
"0.60931563",
"0.60931563",
"0.60931563",
"0.60931563",
"0.60931563",
"0.60931563",
"0.60931563",
"0.6081654",
"0.59844315",
"0.59844315",
"0.59769416",
"0.59551215",
"0.59207076",
"0.5... | 0.7276459 | 0 |
getAll() > only use case is to return all questions by a survey_id so that's what this does | static async getAll({ survey_id }) {
//If search, type or survey_id are undefined then they will be %%
//helps fix bug if passed in object does not have all 3, or search
//is intentionally empty to get all
let result = await db.query(`
SELECT id, survey_id, title, question_type
FROM questio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAll() {\n surveyStorage.getAll();\n }",
"static async getAll({ question_id }) {\n\n let result = await db.query(`\n SELECT id, question_id, title, content, content_type\n FROM choices \n WHERE question_id=$1\n `,\n [question_id]\n );\n\n return resu... | [
"0.804239",
"0.71276355",
"0.6933545",
"0.65457153",
"0.65188724",
"0.65039825",
"0.642544",
"0.6390901",
"0.63428813",
"0.6322432",
"0.6322052",
"0.62857866",
"0.6285775",
"0.6271726",
"0.62457114",
"0.6236076",
"0.61600906",
"0.61568505",
"0.6103594",
"0.60963726",
"0.60954... | 0.7923794 | 1 |
get(id) > return a question by id | static async get(id) {
if (id === undefined) throw new Error('Missing id parameter');
const result = await db.query(`
SELECT id, survey_id, title, question_type
FROM questions
WHERE id=$1
`, [id]
);
if (result.rows.length === 0) {
const err = Error(`Cannot find question ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getQuestion(id) {\n return fetch(`${DOMAIN}/api/v1/questions/${id}?api_token=${API_TOKEN}`)\n .then(function(res) { return res.json() })\n}",
"getQuestion(id) {\n // go over all elements in 'this.state.question' and find the element\n // that matches 'e.id === Number(id)' where 'e' is one of ... | [
"0.7808726",
"0.7543407",
"0.7431802",
"0.70534366",
"0.7049238",
"0.7043173",
"0.69855165",
"0.69695824",
"0.6870507",
"0.68248767",
"0.6820496",
"0.6807262",
"0.6786015",
"0.67833287",
"0.6783193",
"0.67690307",
"0.6755351",
"0.67514205",
"0.671525",
"0.6663592",
"0.6655454... | 0.82669723 | 0 |
create(survey_id, title, question_type) > creates a new question for the given survey and returns it as a new instance of Question class. | static async create({ survey_id, title, question_type }) {
if (survey_id === undefined || title === undefined ||
question_type === undefined) {
const err = new Error(`Must supply title, question_type and survey_id`);
err.status = 400;
throw err;
}
const result = await db.query(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static async create({ question_id, title, content, content_type }) {\n if (content_type === undefined || question_id === undefined ||\n title === undefined) {\n const err = new Error(`Must supply title, content_type and question_id`);\n err.status = 400;\n throw err;\n }\n const resu... | [
"0.69914806",
"0.6536456",
"0.6489494",
"0.64200115",
"0.611866",
"0.5990995",
"0.59399736",
"0.5924483",
"0.5859311",
"0.58434",
"0.58271116",
"0.58002186",
"0.57988274",
"0.5735526",
"0.5714369",
"0.57103825",
"0.5674194",
"0.5650655",
"0.55957377",
"0.5587057",
"0.5572546"... | 0.88383967 | 0 |
Delete question and return a message | async delete() {
const result = await db.query(
`
DELETE FROM questions
WHERE id=$1
RETURNING id`,
[this.id]
);
// Update to return boolean
return `Question Deleted`;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteQuestion(req, res) {\n try {\n var _a = req.params, qUuid = _a.qUuid, uuid = _a.uuid; // qUuid: question uuid; uuid: survey uuid\n var allSurveys = new surveys_1.Surveys();\n var surveyToUpdate = new surveys_1.Survey(allSurveys.surveys[allSurveys.findSurveyIndex(uuid)]);\n ... | [
"0.77868575",
"0.7387728",
"0.73388743",
"0.7300134",
"0.72553605",
"0.7090927",
"0.70904684",
"0.70828474",
"0.7030917",
"0.69756174",
"0.69744945",
"0.6929069",
"0.69089967",
"0.6835155",
"0.6833618",
"0.6791124",
"0.67521733",
"0.6713206",
"0.6697121",
"0.6669935",
"0.6645... | 0.74602216 | 1 |
given a string, concatenate queries also convert l to list and p to print e.g. |bb unit Dark Tone > |bb unit "Dark Tone" | function cleanInput(input) {
var arr = input.split(' ');
var msg = arr[0] + " " + arr[1]; //take off |bb and <command>
var midCommand = false;
var i = 2;
for (; i < arr.length; ++i) {
//escape any existing parentheses
if (arr[i].indexOf("'") !== -1) {
var aposIndex = arr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getQuery (input) {\n const termQueryParts = input\n .split(/\\s+/)\n .filter(term => term.length)\n .map(term => `(label=q=\"${term.trim()}\",description=q=\"${term.trim()}\")`)\n return termQueryParts.join(';')\n }",
"formatQuery (query) {\n return query.split(',').join(' +... | [
"0.54393554",
"0.52129066",
"0.51219964",
"0.51159775",
"0.5036351",
"0.50252956",
"0.5011134",
"0.50068694",
"0.50068694",
"0.49651316",
"0.49651316",
"0.49651316",
"0.492118",
"0.4910287",
"0.49093634",
"0.49093634",
"0.49093634",
"0.48708698",
"0.4852873",
"0.48474666",
"0... | 0.56608033 | 0 |
Login function using cb to simulate async | login(cb) {
this.authenticated = true;
cb();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async login() {}",
"login (callback) {\n\t\t// make the login request \n\t\tconst data = {\n\t\t\temail: this.currentUser.user.email,\n\t\t\tpassword: this.currentUser.password\n\t\t};\n\t\tthis.doApiRequest(\n\t\t\t{\n\t\t\t\tmethod: 'put',\n\t\t\t\tpath: '/no-auth/login',\n\t\t\t\tdata: data\n\t\t\t},\n\t\t\t(... | [
"0.8663355",
"0.722352",
"0.72233504",
"0.71776575",
"0.71511096",
"0.71072644",
"0.70195097",
"0.7010739",
"0.6900169",
"0.6876011",
"0.687177",
"0.6858954",
"0.6848224",
"0.6831024",
"0.6799381",
"0.6759823",
"0.6750617",
"0.67133826",
"0.67073196",
"0.669974",
"0.666381",
... | 0.77048784 | 1 |
Logout function using cb to simulate async | logout(cb) {
this.authenticated = false;
cb();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function logout(callback) {\n\tsendRequest({ request: 'logout' }, callback);\n}",
"function waitForLogout(self, cb) {\n if(!self.loggingout) return cb();\n setTimeout(function() {\n waitForLogout(self, cb);\n }, 1)\n }",
"function waitForLogout(self, cb) {\n if (!self.loggingout) return cb();... | [
"0.7816287",
"0.77701",
"0.774129",
"0.7561049",
"0.745201",
"0.7394469",
"0.73923695",
"0.7347193",
"0.734466",
"0.7300736",
"0.7292322",
"0.72903293",
"0.7267308",
"0.715655",
"0.7139651",
"0.7135119",
"0.7121034",
"0.71192384",
"0.7109078",
"0.71082985",
"0.7104476",
"0.... | 0.81269705 | 0 |
showing the next doggo | function nextDoggo()
{
// update share link on next doggo
game.shareLinkIsUptodate = false
var doggoNumber = "doggo-number-" + game.currentDoggo;
var nextDoggo = "doggo-number-" + (game.currentDoggo + 1);
var doggoElement = document.getElementById(doggoNumber);
var nextDoggoElement = document.getElementBy... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showNext() {\n\tif (currentImg < maxImgs){\n\t\treturn currentImg++\n\t} else {\n\t\treturn currentImg = 0;\n\t};\n\n}",
"function showNext() {\n\t\tif (this.container.width() > 0) {\n\t\t\tthis.nextImage();\n\t\t\tthis.showCurrent();\n\t\t}\n\t\tthis.run();\n\t}",
"next()\n\t{\n\t\tlet next = (this... | [
"0.6741542",
"0.67180777",
"0.6590359",
"0.65252113",
"0.651352",
"0.64626193",
"0.6460975",
"0.6447781",
"0.64201534",
"0.6416278",
"0.63803136",
"0.63641226",
"0.6343027",
"0.6327665",
"0.6323392",
"0.6323234",
"0.6312491",
"0.63057095",
"0.6273881",
"0.6270871",
"0.6267090... | 0.73343956 | 0 |
animate bones so they fly from the left side of the doggo img to topleft corner of the document | function boneAnimationL(bone) {
// bones originate from the picture not the document sides
var currentDoggo = document.getElementsByClassName("currentDoggo");
currentDoggo = currentDoggo[0];
var cdImg = currentDoggo.children;
cdImg = cdImg[0];
var offsetLeft = cdImg.offsetLeft;
var offsetTop = cdImg.offse... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function boneAnimationR(bone) {\n // bones originate from the picture not the document sides\n var currentDoggo = document.getElementsByClassName(\"currentDoggo\");\n currentDoggo = currentDoggo[0];\n var cdImg = currentDoggo.children;\n cdImg = cdImg[0];\n var offsetLeft = cdImg.offsetLeft;\n var offsetTop... | [
"0.72661996",
"0.7073882",
"0.6888681",
"0.67085755",
"0.6623287",
"0.65739834",
"0.65639025",
"0.6541948",
"0.64468986",
"0.6364336",
"0.63541037",
"0.6296911",
"0.6290902",
"0.62776464",
"0.6271578",
"0.6229444",
"0.62074506",
"0.62002987",
"0.61938375",
"0.6185746",
"0.618... | 0.72586834 | 1 |
animate bones so they fly from the right side of the doggo img to topright corner of the document | function boneAnimationR(bone) {
// bones originate from the picture not the document sides
var currentDoggo = document.getElementsByClassName("currentDoggo");
currentDoggo = currentDoggo[0];
var cdImg = currentDoggo.children;
cdImg = cdImg[0];
var offsetLeft = cdImg.offsetLeft;
var offsetTop = cdImg.offse... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function animateRight(){\n TweenMax.to( $('.rightButt'), .1, {\n transform: 'scale(.75, .75) translateX(5px)',\n transformOrigin:'50% 50%',\n ease:Power2.easeInOut,\n repeat:1,\n yoyo: true\n });\n TweenMax.to( $('#image'), .3, {\n transform: 'scale(.9, .9) translateX(15px)',\n autoAlpha: '... | [
"0.6872682",
"0.67074114",
"0.6595312",
"0.6486191",
"0.647941",
"0.64083856",
"0.63669693",
"0.6361056",
"0.6266303",
"0.6227552",
"0.6213066",
"0.6209053",
"0.6200808",
"0.61652327",
"0.61456287",
"0.61413175",
"0.612124",
"0.60983115",
"0.6085914",
"0.60473543",
"0.6028096... | 0.67823654 | 1 |
Returns a array of parameter names | parameterNames() {
const params = [];
if (this.parameterMetadata) {
for (const param of this.parameterMetadata.paramDefs) {
params.push(param.name);
}
}
return params;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getParameters() {\n\t\treturn this.paramDefs.map((param) => param.name);\n\t}",
"public function keys()\n {\n return array_keys($this->parameters);\n }",
"function getParamNames(func) {\r\n var fnStr = func.toString().replace(STRIP_COMMENTS, '')\r\n var result = fnStr.slice(fnStr.indexOf('('... | [
"0.7987138",
"0.7642949",
"0.74608296",
"0.7446058",
"0.74216026",
"0.73801744",
"0.72288823",
"0.6996395",
"0.69371486",
"0.69172096",
"0.69172096",
"0.6845277",
"0.6828647",
"0.6802455",
"0.6679704",
"0.6609535",
"0.6449553",
"0.6445998",
"0.64374053",
"0.64179796",
"0.6304... | 0.8785226 | 0 |
Destroys the SmoothScroll instance. | _destroy() {
this.$element.off('click.zf.smoothScrollWithLinks', 'a[href*="#"]', this._linkClickListener);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"destroy() {\n\t\tthis._container.removeEventListener('mousewheel',this._mouseWheelListener);\n\t\twindow.removeEventListener('resize',this._resizeListener);\n\t\tthis._mc.destroy();\n\t\tthis._container = null;\n\t}",
"_disposeScrollStrategy() {\n const scrollStrategy = this._scrollStrategy;\n if (... | [
"0.6611881",
"0.65526134",
"0.65026915",
"0.65026915",
"0.65026915",
"0.65026915",
"0.6501469",
"0.6484786",
"0.6442467",
"0.6442467",
"0.6437862",
"0.6436968",
"0.6413089",
"0.6339021",
"0.6331086",
"0.632394",
"0.6319688",
"0.6319688",
"0.6319688",
"0.6319688",
"0.6319688",... | 0.714118 | 0 |
test var mainSheet = book.getSheetByName("testMain"); var logSheet = book.getSheetByName("testLog"); channels.history home this get slack.history and paste it to google sheet | function getSlackHist(){
var slackUrl = "https://slack.com/api/conversations.history?token=***"
var response = UrlFetchApp.fetch(slackUrl)
Logger.log(response.getContentText());
var resJson = JSON.parse(response.getContentText());
for(i=0; i < resJson.messages.length; i++){
mainSheet.getRange(i+1, 1).set... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function recordHistoryforSheet(this_sheet_name) {\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var sheet = ss.getSheetByName(this_sheet_name);\n var source = sheet.getRange(\"A1:I1\");\n var dates = source.getDisplayValues();\n dates[0][0]='';\n sheet.appendRow(dates[0]); //Append the dates to the log... | [
"0.7130424",
"0.70378953",
"0.64464045",
"0.6428176",
"0.6374488",
"0.6281451",
"0.62807035",
"0.61099446",
"0.6089934",
"0.60809654",
"0.6076558",
"0.6059991",
"0.6047654",
"0.60077065",
"0.5963974",
"0.5938517",
"0.58808917",
"0.5878815",
"0.58700806",
"0.5862141",
"0.58566... | 0.7269427 | 0 |
Monkeypatches an object's method. | static monkeyPatch(object, methodName, options, f) {
const patchedFunction = new PatchedFunction(object, methodName);
const patch = new Patch(patchedFunction, options, f);
patchedFunction.addPatch(patch);
return patch;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"patchMethodCall() {\n this.patchNonMethodCall();\n }",
"function around(obj, method, fn) {\n const old = obj[method];\n\n obj[method] = (...args) => {\n const newArgs = new Array(arguments.length);\n for (let i = 0; i < newArgs.length; i += 1) newArgs[i] = args[i];\n return fn.call(this, old, newA... | [
"0.7178299",
"0.71454036",
"0.70409214",
"0.7034974",
"0.69596237",
"0.6951527",
"0.6947225",
"0.68329495",
"0.6829154",
"0.68079203",
"0.6771308",
"0.67281365",
"0.6612896",
"0.65565324",
"0.6537928",
"0.65306115",
"0.65258604",
"0.6525233",
"0.65137744",
"0.64879817",
"0.63... | 0.72980475 | 0 |
Monkeypatches an object's method and returns a promise that will be resolved with the data object when the method is called. You will have to call data.callOriginalMethod() if it wants the original method to be called. | static monkeyPatchOnce(object, methodName) {
return new Promise((resolve, reject) => {
this.monkeyPatch(object, methodName, data => {
data.patch.cancel();
resolve(data);
});
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"patchMethodCall() {\n this.patchNonMethodCall();\n }",
"patchDynamicMethodCall() {\n this.patchNonMethodCall();\n }",
"function addMethod(method) {\n\t\tPromise.prototype[method] = function () {\n\t\t\tvar args = slice.call(arguments);\n\t\t\treturn this.then(function (object) {\n\t\t\t\tvar fn = objec... | [
"0.6738047",
"0.6486781",
"0.6400259",
"0.61525327",
"0.61224854",
"0.5732038",
"0.57292825",
"0.5689327",
"0.5672867",
"0.5486725",
"0.54808116",
"0.5472583",
"0.52893406",
"0.52870333",
"0.5257865",
"0.5206862",
"0.51778066",
"0.5167119",
"0.5137607",
"0.51269156",
"0.51247... | 0.73286307 | 0 |
function newInstruction(): Accepts ID of HTML elementID Accepts new HTML to be applied to target element Locates HTML by ID Changes inner HTML | function newInstruction(elementID, newInstruction) {
document.getElementById(elementID).innerHTML = newInstruction;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setInnerHTMLbyID (destObj,strHTML,additive) {\r\n\tvar mydestObj=document.getElementById(destObj);\r\n\tif (mydestObj!=null) {\r\n\t\tif ((additive) && (mydestObj.innerHTML.length > 0)) {\r\n\t\t \tmydestObj.innerHTML=mydestObj.innerHTML + '<br>' + strHTML;\r\n\t\t} else {\r\n\t\t\tmydestObj.innerHTML=st... | [
"0.61517453",
"0.6121322",
"0.60541874",
"0.60163254",
"0.59991914",
"0.5953237",
"0.5939418",
"0.58944696",
"0.5885092",
"0.58821774",
"0.58820546",
"0.588067",
"0.5866501",
"0.5851264",
"0.5828082",
"0.5812507",
"0.57861584",
"0.57861584",
"0.57846117",
"0.57834005",
"0.577... | 0.81644243 | 0 |
This function handles the response of related products service | handleRelatedProductsResponse(response) {
if (response && response.data) {
this.relatedProductsData = response.data;
if (!this.isRelatedEnabled) {
this.relatedProducts = this.relatedProductsData.references.map(item => item.target);
} else {
this.relatedProductsData.map(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onGetProducts (response) {\n //TODO check for parsing errors\n var responseArray = JSON.parse(response.responseText);\n\n //update products array with additional price properties appended\n var products = appendAdditionalPriceProperties(responseArray);\n\n loadProductsTemplate(products);\n ... | [
"0.6862018",
"0.67186284",
"0.6580613",
"0.657658",
"0.65744585",
"0.6555162",
"0.6553984",
"0.6533218",
"0.6520634",
"0.6497963",
"0.64348096",
"0.6432531",
"0.64166534",
"0.6356744",
"0.6339956",
"0.6330829",
"0.631861",
"0.63162833",
"0.62979907",
"0.6291684",
"0.6277825",... | 0.7196186 | 0 |
This function handles the error of related products service | handleRelatedProductsError(error) {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onProductFetchError(response) {\n $errors = response.errors;\n\n $product = $options = $components = $variations = null;\n $activeIndex = -1;\n\n throw new Error('Failed to fetch product');\n }",
"function error_getProducts(r) {\n // tratamento por status\n console.error('... | [
"0.76211125",
"0.73948675",
"0.65510255",
"0.65193003",
"0.6482887",
"0.6480387",
"0.64154917",
"0.6340955",
"0.6108976",
"0.6103967",
"0.6103967",
"0.60944563",
"0.6045423",
"0.6035116",
"0.59770244",
"0.5949561",
"0.5915651",
"0.5896929",
"0.58953077",
"0.5887181",
"0.58813... | 0.8337072 | 0 |
validates errors on all the fieldsets records if the Form has errors in $('surveyForm').data() | function validateSteps(){
var FormErrors = false;
for(var i = 1; i < fieldsetCount; ++i){
var error = validateStep(i);
if(error == -1)
FormErrors = true;
}
$('#surveyForm').data('errors',FormErrors);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validateSteps(){\n var FormErrors = false;\n for (var i = 1; i <= fieldsetCount; ++i)\n {\n var error = validateStep(i);\n if(error == -1)\n FormErrors = true;\n }\n $('#formElem').data('errors',FormErrors);\t\n }",
"function val... | [
"0.72591305",
"0.7187565",
"0.7136831",
"0.6674159",
"0.65430707",
"0.64774525",
"0.62600666",
"0.62096214",
"0.6164695",
"0.61111075",
"0.610258",
"0.6056864",
"0.6055234",
"0.6048032",
"0.6045436",
"0.6026099",
"0.6010801",
"0.6006106",
"0.5955139",
"0.59429806",
"0.5889748... | 0.77902234 | 0 |
middleware to ensure table ownership | function ensureOwnership(req,res,next){
var id = req.body.table_id;
Tables.findById(id,function(err,table){
if (err) return res.send(500,{error: "database error"});
if (table.members.indexOf(req.user._id) !== -1){
return next();
} else {
return res.send(401, {error:"You don't h... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function tableIsOccupied(req, res, next) {\n const tableId = req.params.tableId;\n const table = await service.read(tableId);\n if (table.reservation_id) {\n return next();\n } else {\n next({\n status: 400,\n message: `Table is not occupied`,\n });\n }\n}",
"async function validate... | [
"0.60092616",
"0.5823303",
"0.58172405",
"0.58156675",
"0.575758",
"0.5745574",
"0.56193244",
"0.5616734",
"0.5524762",
"0.544489",
"0.54384595",
"0.5423149",
"0.5377283",
"0.535848",
"0.535372",
"0.53367954",
"0.53284156",
"0.52894366",
"0.52853477",
"0.52783895",
"0.5258667... | 0.7586387 | 0 |
Set this component's title | setTitle(title) {
this._title = title;
this.emit('titleChanged', title);
this.emit('stateChanged');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set title(title) {\n this.setAttribute(\"title\", title);\n }",
"setTitle(title) {\r\n this.title = title;\r\n if (this.isActive) {\r\n this.router.updateTitle();\r\n }\r\n }",
"setTitle(title) {\n this.get('headData').set('title', title);\n }",
"async setTitle(_) {... | [
"0.83846015",
"0.815153",
"0.80629367",
"0.8012205",
"0.7909728",
"0.77895033",
"0.7669079",
"0.7669079",
"0.7669079",
"0.7669079",
"0.7669079",
"0.7641313",
"0.759877",
"0.7524534",
"0.748536",
"0.7484826",
"0.74014676",
"0.7371314",
"0.736729",
"0.73427415",
"0.73092",
"0... | 0.8170564 | 1 |
deletes old dirty record and returns the new key for the model so as to keep local collection in sync | function _cleanupDirtyModel (collection, model , response, options) {
var newKey, jerryHall, url, dirtyList;
url = collection.url || model.url;
// on updates model.url is function that points to actual url called
if ( typeof model.url !== 'string' ) {
url = model.urlRoot || ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static removeModel(key) {\n delete Model.instanceMap[key];\n }",
"update() {\n this.checkOkToUpdate();\n\n if (true) {\n let key = DB._getDbKey(this.obj.toModel(), this.collection);\n\n if (key != this.key) {\n console.log(\"Old key: \", this.key, \"New key: \", key);\n throw \"... | [
"0.622509",
"0.6132886",
"0.59718066",
"0.5821893",
"0.57965857",
"0.57716405",
"0.5751731",
"0.571013",
"0.56901586",
"0.56901586",
"0.56901586",
"0.56901586",
"0.56901586",
"0.56620544",
"0.5651024",
"0.5639721",
"0.55078745",
"0.54903454",
"0.5484087",
"0.5466328",
"0.5463... | 0.6845941 | 0 |
defining function and assigning it to return the property myName | function myName() {
return myName.juvenal;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getName() {\n return this.myName;\n }",
"function returnMyName() {\n return myName;\n}",
"function returnMyName() {\n return myName;\n}",
"function myName() {\n return myName.eunice;\n }",
"function myName() {\n return myName.darius;\n}",
"function myName() {\n return myName.serena;\n}",
... | [
"0.7788316",
"0.76334625",
"0.76334625",
"0.75767666",
"0.7575638",
"0.75498295",
"0.7433879",
"0.74157304",
"0.74157304",
"0.74157304",
"0.74157304",
"0.74157304",
"0.74157304",
"0.74157304",
"0.74157304",
"0.73788786",
"0.7367252",
"0.7364516",
"0.7306058",
"0.7302603",
"0.... | 0.7745142 | 1 |
Add HD or MP4 Download Links | function showDownloadLinks() {
var h1s = d.getElementsByTagName('h1');
if ( h1s.length > 0 && h1s[0].innerHTML ) {
if ( matches = h1s[0].innerHTML.toLowerCase().match(/([0-9a-z_-]+)/g) ) {
file_name_base = matches.join('_');
} else {
file_nam... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showDownloadLinks() {\r\n var h1s = d.getElementsByTagName('h1');\r\n if ( h1s.length > 0 && h1s[0].innerHTML ) {\r\n if ( matches = h1s[0].innerHTML.toLowerCase().match(/([0-9a-z_-]+)/g) ) {\r\n file_name_base = matches.join('_');\r\n } else {\r\n ... | [
"0.68554395",
"0.65819544",
"0.6570007",
"0.6510694",
"0.642279",
"0.6334554",
"0.610883",
"0.6085219",
"0.6052565",
"0.6039786",
"0.6003739",
"0.5934673",
"0.59319794",
"0.592945",
"0.59245276",
"0.5893324",
"0.5846325",
"0.5830171",
"0.5792503",
"0.5754244",
"0.5745052",
... | 0.6900168 | 0 |
An implementation of an instancebased learner | function InstanceLearner() {
Learner.call(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function NetworkTrainer()\n{\n var that = this || {};\n var base = TrainingProccessor; base.call(that);\n\n /// <summary> Do single training step. Returs result of pre-training run with DATA </summary>\n that.trainBySample = function (NET, DATA, TARG, speed) { throw new Error(\"trainBySample not implemented\")... | [
"0.6199833",
"0.5992263",
"0.59374",
"0.58569556",
"0.5825787",
"0.5791731",
"0.5776491",
"0.57651025",
"0.57477856",
"0.5743493",
"0.5689466",
"0.563818",
"0.56105363",
"0.55900264",
"0.5568106",
"0.5550902",
"0.549892",
"0.54926574",
"0.5426977",
"0.5413046",
"0.5379546",
... | 0.80464756 | 0 |
close peer and channels (if any) | closePeer() {
try {
this._remoteStream = null;
} catch (err) {}
try {
this._pc.close();
} catch (err) {
console.log('close');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"close() {\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = 0;\n }\n if (this.messageTimer) {\n clearTimeout(this.messageTimer);\n this.messageTimer = 0;\n }\n if (this.webrtcIsReady()) {\n this.client.close();\n }\n if (this.peerConnOpen()) {\n this.... | [
"0.76634455",
"0.74460745",
"0.71855813",
"0.7077503",
"0.7044699",
"0.70413864",
"0.6954749",
"0.6943269",
"0.6916533",
"0.6851693",
"0.6755374",
"0.67494476",
"0.6689764",
"0.668888",
"0.66566575",
"0.663888",
"0.6635717",
"0.65821344",
"0.6489582",
"0.6405775",
"0.6384708"... | 0.78810257 | 0 |
init END sorting swager is main Json file x additional Json file if in 'swager' not found some filed from swager.list then search it in 'x' | function orderByList(metaJson,swager){
var xArr = Object.keys(metaJson),
sw = Object.keys(swager),
inList = false,
contEmpty = 0,
x = metaJson;
showInfo({xArr: xArr, sw: sw, metaJson: metaJson});
for(var i=0; i<sw.length; i++) {
//show item in list first
if(!inList){
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function main(){\n\treturn function init(){\n\t var console1 = {};\n\t var mainJson = {\n\t item1:'swager_1',item2:'swager_2',item3:'swager_3',item5:'swager_5',item6:'swager_6'\n\t }; \n\t var metaJson = {\n\t item6:'from x =6', item3:'from x =3 ',\n\t list: ['item2','item3']\n\t };\n \n \torder... | [
"0.7738883",
"0.61108875",
"0.59055203",
"0.5816549",
"0.54268074",
"0.5300984",
"0.52592623",
"0.5258356",
"0.52411956",
"0.5225652",
"0.5166675",
"0.5136697",
"0.5136344",
"0.5128171",
"0.5108437",
"0.5096296",
"0.50890774",
"0.5080719",
"0.50631785",
"0.5062389",
"0.506234... | 0.63172746 | 1 |
show item that not in list | function showItemOutOfList(dataObj, consoleInfoObj){
var x = dataObj.x,
i = dataObj.i,
contEmpty = dataObj.contEmpty,
sw = consoleInfoObj.sw,
swager = consoleInfoObj.swager;
for(var j=0; j<x.list.length; j++) {
if(sw[i] !== x.list[j]) {
contEmpty++;
if(contEmpty === x... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showNotas(){\n showListNotas(true);\n}",
"function showNotas(){\n showListNotas(true);\n}",
"function checkForNoItems() {\n $list.find(\".noitems\").remove();\n\n if (!$list.find(\".feed-element\").length > 0) {\n $(\"<div class='noitems text-center text-mute... | [
"0.6261829",
"0.6261829",
"0.62031513",
"0.60215914",
"0.5958272",
"0.5720086",
"0.5719536",
"0.57019395",
"0.5682031",
"0.5677629",
"0.5655079",
"0.56299466",
"0.56169987",
"0.55871224",
"0.55424446",
"0.5520891",
"0.5520262",
"0.5508327",
"0.5481316",
"0.5481207",
"0.547053... | 0.6440234 | 0 |
do uglify in a separate process for better perf | function doUglify(code, prepend, fileOut) {
if (DEV_MODE) { // skip uglify in "npm run dev" mode
return Promise.resolve();
}
var binPath = require.resolve('uglify-js/bin/uglifyjs');
var args = [binPath, '-c', '-m', 'warnings=false', '-'];
var child = spawn(process.execPath, args, {stdio: 'pipe'});
chil... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function uglify(name) {\n console.log(\"Hello \" + name);\n}",
"async transform() {\n if (this.options.minify) {\n await uglify(this);\n }\n }",
"function uglify() {\n\t\t\tvar settings = config.styles.uglify;\n\n\t\t\treturn gulp.src( settings.src )\n\t\t\t // Deal with errors.\n\t\t\t ... | [
"0.7409654",
"0.7148666",
"0.6905265",
"0.68282783",
"0.67996573",
"0.67814887",
"0.6706164",
"0.6694095",
"0.6669879",
"0.6598695",
"0.6532141",
"0.6466986",
"0.6441106",
"0.64376825",
"0.63780475",
"0.6349089",
"0.63327014",
"0.63198775",
"0.6295994",
"0.6292127",
"0.628140... | 0.72756314 | 1 |
build for Node (index.js) | function buildForNode() {
return doRollup('src/index.js', 'lib/index.js');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"buildFromSource(){\n const makeArgs = isWindows ? ['x64', 'noetw', 'no-cctest'] : [`-j${os.cpus().length}`];\n return this.printDiskUsage()\n .then(() => this.downloadExpandNodeSource())\n .then(() => this.prepareNodeJsBuild())\n .then(() => !isWindows && runCommand(this.configure, [], this.no... | [
"0.67378503",
"0.6409613",
"0.63362825",
"0.6304439",
"0.6246276",
"0.61534715",
"0.6130298",
"0.6113104",
"0.60772675",
"0.60583764",
"0.6001635",
"0.60008585",
"0.5950494",
"0.594295",
"0.5911708",
"0.5880678",
"0.5874558",
"0.58730036",
"0.58358663",
"0.5828214",
"0.576262... | 0.75469875 | 0 |
build for Browserify/Webpack (indexbrowser.js) | function buildForBrowserify() {
return doRollup('src/index.js', 'lib/index-browser.js', true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function browserifyBuild() {\n\tvar entry = 'bundle.js';\n\n\tvar bundler = browserify({\n\t\tentries: config.scriptsEntryPoint,\n\t debug: true,\n\t cache: {},\n\t packageCache: {},\n\t fullPaths: true\n\t}, watchify.args);\n\n\tif ( !global.isProd ) {\n\t bundler = watchify(bundler);\n\t bundle... | [
"0.7405864",
"0.7284884",
"0.6975795",
"0.6882353",
"0.6811874",
"0.67551994",
"0.66853833",
"0.6627834",
"0.65081257",
"0.6501624",
"0.6441567",
"0.64307374",
"0.64251995",
"0.63770914",
"0.63747364",
"0.63372105",
"0.63160694",
"0.6305239",
"0.62851787",
"0.62802595",
"0.62... | 0.83519477 | 0 |
FUNCTION TO CONVERT AADATA AND AOCOLUMNS TO HTML TABLE FORMAT | function tableToHtml(aaData, aoColumns){
var html = '<table>';
var th = '<thead><tr>';
var tb = '<tbody>';
// Header
// Get columns names
for(key in aoColumns){
th += '<th>' + aoColumns[key].sTitle + '</th>'
}
// Body
// Get each row
for (var r = 0; r < ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function convert_device_uplink_headers_database_to_table(device_uplink,view){cov_oh5eqgm35.f[4]++;let headers_database=(cov_oh5eqgm35.s[158]++,Object.keys(device_uplink));let headers_table=(cov_oh5eqgm35.s[159]++,[]);let place_holder=(cov_oh5eqgm35.s[160]++,{});//object which will store the text and value data\nle... | [
"0.6409516",
"0.6325543",
"0.6213061",
"0.6160273",
"0.6108536",
"0.6078347",
"0.60717297",
"0.60528326",
"0.60477346",
"0.6035748",
"0.6033922",
"0.60322315",
"0.60021406",
"0.5998737",
"0.59955657",
"0.5968103",
"0.59620297",
"0.5927795",
"0.59194106",
"0.5916421",
"0.59163... | 0.77942944 | 0 |
FUNCTION TO CONVERT BIBTEX DATA TO JSON | function bib2json(bibData, callback){
// Remove line breaks
var bibjson = bibData.replace(/(\r\n|\n|\r)/gm,"");
// Remove acute notation in bibtex
bibjson = bibjson.replace( new RegExp(/\{\\'([A-Z])\}/gi) , "$1" );
bibjson = bibjson.replace( new RegExp(/\{\\~n\}/gi) , "ñ" );
// Re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function convertir_json(data){\n let data_final = []\n let data_string = JSON.stringify(data)\n data_string = data_string.replace(\"{\",\"\")\n data_string = data_string.replace(\"}\",\"\")\n data_string = data_string.replace(/['\"]+/g, '')\n data_string = data_string.replace(/[',]+/g, ' ')\n ... | [
"0.5961037",
"0.59585124",
"0.5958066",
"0.5955582",
"0.59220093",
"0.58824134",
"0.5879903",
"0.58407074",
"0.582375",
"0.5816982",
"0.57718194",
"0.5728884",
"0.5713551",
"0.56730354",
"0.5659928",
"0.5658476",
"0.5652796",
"0.56403",
"0.5623414",
"0.56151116",
"0.55952746"... | 0.6217032 | 0 |
Submit email to server function Triger: This function fires whenever submit button is pressed Result: It submits users compose mail to the server using POST method | function submit(event) {
// Query the following values from user inputs form
const recipientMessage = document.querySelector('#compose-recipients').value;
const subjectMessage = document.querySelector('#compose-subject').value;
const bodyMessage = document.querySelector('#compose-body').value;
// ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function submitForm() {\r\n var args = {};\r\n args.Email = session.forms.emarsyssignup.emailAddress.value;\r\n args.EmarsysSignupPage = true;\r\n args.SubscriptionType = \"footer\";\r\n args.SubscribeToEmails = true;\r\n args.Map = EmarsysNewsletter.MapFi... | [
"0.7229183",
"0.7066324",
"0.7023809",
"0.7019499",
"0.6996783",
"0.69601184",
"0.69458276",
"0.68711215",
"0.6850728",
"0.6844165",
"0.6840927",
"0.68374556",
"0.6801795",
"0.67900217",
"0.67891556",
"0.67742103",
"0.6749",
"0.67313534",
"0.6728241",
"0.6725592",
"0.66989344... | 0.7471463 | 0 |
Check if attacks misses 0 : miss 1 : hit | willAttackMiss (accuracy) {
return Math.floor(Math.random() * 100) > accuracy;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function MissChance() {\n if (OpPoints >= Points) {\n Miss += 1\n if (MissChance >= 39){\n Miss = 40\n }\n } else {\n Miss -= 1\n if (MissChance <= 35){\n Miss = 35\n }\n }\n}",
"get isVulnerable() {\n return this.timesAttacked > this.timesDefended;\n }",
"shouldAttack() {\... | [
"0.6862451",
"0.64988524",
"0.6324888",
"0.62616444",
"0.62323624",
"0.616407",
"0.6137725",
"0.60956705",
"0.60878474",
"0.6071471",
"0.60675114",
"0.6056455",
"0.59778726",
"0.5976452",
"0.59732175",
"0.593466",
"0.5926784",
"0.5922567",
"0.5890457",
"0.58757997",
"0.587262... | 0.67693245 | 1 |
Return value random damage | damageAtack() {
return Math.floor(Math.random() * 100);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"predictDamage() {\n let dmg = this.getConstantDamage()[0]\n return dmg\n }",
"calculateDamage(isWeaker) {\n let useLevel = this.level;\n if(isWeaker){\n useLevel++;\n }\n let num = Math.floor(Math.random() * useLevel) + 1;\n return num;\n }",
"attackWith() {\r\n const randomWeapo... | [
"0.7736358",
"0.7302796",
"0.7193708",
"0.71660465",
"0.71145076",
"0.71011436",
"0.705037",
"0.6970667",
"0.69057375",
"0.68822795",
"0.6879347",
"0.6873378",
"0.6870745",
"0.682693",
"0.6812886",
"0.6787928",
"0.6727109",
"0.6725796",
"0.6696788",
"0.6694891",
"0.66192067",... | 0.8093691 | 0 |
Check if is Block 0 : no blocked 1 : blocked, and phases blocked decrease | isBlocked() {
if(this.block > 0) {
this.block--;
return 1;
}
else return 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkBlock() {\n\t\n\t// get/update block time and duration in seconds\n\tvar count = JSON.parse(localStorage[\"blockCount\"]);\n\tcount += UPDATE_SECONDS;\n\t\n\tvar blockDur = localStorage[\"blockDuration\"];\n\tblockDur = blockDur * 3600;\n\tconsole.log(count + \" seconds of \" + blockDur + \" second s... | [
"0.6438797",
"0.6348629",
"0.6324838",
"0.6222944",
"0.60466933",
"0.60415053",
"0.6015579",
"0.5808376",
"0.5724541",
"0.56005555",
"0.5532979",
"0.5524002",
"0.5523572",
"0.5511777",
"0.5509107",
"0.54957783",
"0.5494114",
"0.54844403",
"0.54791677",
"0.54685616",
"0.545891... | 0.73983926 | 0 |
player attack function that receives the used attack return false if attack misses otherwise update opponents health and return true | playerAttack(attack, opponent) {
// 0: return false if attack misses
// 1: otherwise update opponents health and return true
let accuracy = 10;
if(attack.type == 'electric' && opponent.type == 'water') {
attack.power += this.damageAtack();
}
if((this.willAttackMiss(100 - a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"attack(player) {\r\n player.applyDamage(this.strength);\r\n }",
"function attack(){\n\tif(canAttack){\n\n\t\t//Weapon Sound\n\t\tvar randWeapon = Math.floor(Math.random()*AUDIO_WEAPON.length);\n\t\tchangeAudio(AUDIO_WEAPON[randWeapon]);\n\n\t\t//Player stats\n\t\t//var playerHP = parseInt($(\"#avatar_HP_0\")... | [
"0.759419",
"0.74068975",
"0.7301893",
"0.7269566",
"0.72603256",
"0.71722007",
"0.7116227",
"0.71103257",
"0.7098575",
"0.7038491",
"0.7032526",
"0.7023858",
"0.7001901",
"0.69727814",
"0.6965235",
"0.6949346",
"0.69350445",
"0.6896681",
"0.68799317",
"0.68389934",
"0.683731... | 0.8511249 | 0 |
Scan the target directory to find all issues waiting to be filed. | function scan(source_dir){
//Scan the directory to find all issues waiting to be filed.
console.log( 'Scanning '+ source_dir + ' for queued issues.');
ls(source_dir, function (err, tree) {
var comics = tree.filter(function(leaf){
var ext = path.extname(leaf);
return !!ext.match(/^.cb*/i)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function findUnmatchedFiles(cwd) {\n let entries = await loadOwners(cwd);\n if (!entries)\n return null;\n let unmatched = await findUnmatchedFilesFromEntries(entries, cwd);\n return unmatched;\n}",
"function pub_checkModFiles() {\n\n\texec('git diff --name-only', function(err, stdout, s... | [
"0.5487927",
"0.5430166",
"0.54109055",
"0.5354338",
"0.52865833",
"0.5208521",
"0.51798195",
"0.516396",
"0.5140624",
"0.5095129",
"0.50914776",
"0.5061982",
"0.50312775",
"0.5023332",
"0.50141215",
"0.50086117",
"0.499948",
"0.49858752",
"0.49843404",
"0.4978248",
"0.497186... | 0.6967452 | 0 |
function to give even space between the colomns | function colomnspace(x){
var result ="";
for(var i = 0; i < x ; i++){
result += " ";
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function spacer() {\r\n\t\tvar space = prompt(\"Desired space between nodes (in pixels):\", \"0\"); \r\n\t\treturn space; \r\n\t }",
"function colomnspace(x){\n var result =\"\";\n for(var i = 0; i < x ; i++){\n result += \" \";\n\n }\n return result;\n }",
"set lineS... | [
"0.6643482",
"0.653457",
"0.6267368",
"0.6237933",
"0.60497093",
"0.60043687",
"0.597879",
"0.5886966",
"0.58405286",
"0.5838692",
"0.5819958",
"0.581103",
"0.5795104",
"0.5789695",
"0.5782954",
"0.5737323",
"0.5697165",
"0.5687397",
"0.5673435",
"0.56241024",
"0.5618951",
... | 0.6637823 | 1 |
EXERCISE 8 Write a function named percentOf that will take two numbers, figure out what percent the first number represents of the second number, and return the result. It should also log a string like "2 is 50% of 4." | function percentof(a,b){
console.log(`${a} is ${a/b*100} % of ${b}.`)
return a/b*100
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function percentOf(num1, num2){\n num3 = num1/num2 * 100\n return num3 + \"%\"\n}",
"function percentOf (num1, num2) {\n\tvar percent = (num1 / num2) * 100;\n\tconsole.log('3) ' + num1 + ' is ' + percent + '% of ' + num2 + '.');\n\treturn percent;\n}",
"function percentOf (num1, num2){\n let percentage = nu... | [
"0.84912926",
"0.84556973",
"0.8305044",
"0.8281826",
"0.82804126",
"0.818866",
"0.81655735",
"0.80982614",
"0.7933729",
"0.7856",
"0.7855224",
"0.7812243",
"0.77665347",
"0.7481497",
"0.74500936",
"0.7440376",
"0.74050236",
"0.74050236",
"0.7356477",
"0.722924",
"0.7161437",... | 0.86216944 | 0 |
Selects randomly a text from the "textes"Attribute and saves it in "selectedText"Attribute | selectRandomText()
{
const textes = this.state.textes;
this.setState({selectedText: textes[Math.floor(Math.random() * textes.length)]});
this.setState({currentAudioUrl: null});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clickedRandomText() {\n originText.innerHTML = texts[Math.floor(Math.random() * texts.length)];\n // It will also call the reset function to reset evrything\n reset();\n}",
"function selectWord() {\n return wordList[Math.floor(Math.random() * wordList.length)];\n }",
"function sel... | [
"0.6735529",
"0.6531249",
"0.6356413",
"0.63381755",
"0.6294799",
"0.6144922",
"0.61283404",
"0.6070425",
"0.60605085",
"0.5977313",
"0.59576243",
"0.5942661",
"0.59318256",
"0.5918259",
"0.5915316",
"0.5911723",
"0.58944565",
"0.5891521",
"0.5882808",
"0.587785",
"0.58597726... | 0.7434054 | 0 |
Extract canonical and categories for the viral tweets list | findCanonicalsAndCategories(viralTweets) {
let headCanonicals = ['-- TOTS --', '-- AMB CANÒNIC --', '-- GENÈRICS --']
let headCategories = ['-- TOTS --', '-- AMB CATEGORIA --', '-- GENÈRICS --']
let foundCanonicals = []
let foundCategories = []
viralTweets.forEach((tweet) => {
if (!isInArray... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fetch_categories(wiki){\n var cats=[]\n var reg=new RegExp(\"\\\\[\\\\[:?(\"+category_words.join(\"|\")+\"):(.{2,60}?)\\]\\](\\w{0,10})\", \"ig\")\n var tmp=wiki.match(reg)//regular links\n if(tmp){\n var reg2=new RegExp(\"^\\\\[\\\\[:?(\"+category_words.join(\"|\")+\"):\", \"... | [
"0.59307253",
"0.58382607",
"0.5744756",
"0.5624603",
"0.54509246",
"0.5435608",
"0.54243046",
"0.54210454",
"0.5410661",
"0.5402972",
"0.5318815",
"0.5299861",
"0.5254748",
"0.52218896",
"0.51989764",
"0.51946497",
"0.5166714",
"0.5147007",
"0.51229787",
"0.50957334",
"0.509... | 0.7332932 | 0 |
Update the viral tweets table This function will pass to the child rows to facilitate reload on edits | updateViralTweetsTable(tweet_id, categ, canonical, lang) {
// this.handleSearchButton()
let updatedViralTweets = this.state.viralTweets.map((tweet) => {
if (tweet.key === tweet_id) {
tweet.category = categ
tweet.canonical_name = canonical
tweet.lang = lang
}
return twee... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateTree(row) {\n // ******* TODO: PART VII *******\n \n }",
"function renderNewUpdate(data){\n// debugger\n // const dogRow = document.querySelectorAll(`td`)\n var rowData = document.querySelector(`[data-id='${data.id}']`).parentElement\n rowData.children[0].innerHTML = data.name\n ... | [
"0.64164764",
"0.6201743",
"0.6068669",
"0.6067626",
"0.595712",
"0.5910192",
"0.59091747",
"0.58933556",
"0.5881562",
"0.5865039",
"0.58555096",
"0.5847106",
"0.583988",
"0.58016914",
"0.5779684",
"0.5773591",
"0.5760562",
"0.57458395",
"0.57245785",
"0.5719641",
"0.5705658"... | 0.63683516 | 1 |
Attempt to intelligently add a token to an input URL. BUG: This code is repeated in bbop_mme_widgets.build_token_link() and barista.js. | function _build_token_link(url, token, token_name){
var new_url = url;
// Default to "barista_token".
if( ! token_name ){ token_name = 'barista_token'; }
if( token ){
if( new_url.indexOf('?') === -1 ){
new_url = new_url + '?' + token_name + '=' + token;
}else{
new_url = new_url + '&' + token_name + ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addURLFromInput() {\n var input = document.getElementById(\"URLForm\").value;\n if(input) {\n var URL = \"http://www.\" + input;\n if(page.contextualIdentitiesEnabled) {\n page.whiteList.addURL(page.getHostname(URL), getActiveTabName());\n } else {\n page.w... | [
"0.6218006",
"0.6024606",
"0.5913514",
"0.5913242",
"0.5819156",
"0.5799832",
"0.5799832",
"0.5790497",
"0.57816947",
"0.5720412",
"0.5717952",
"0.5667023",
"0.5640185",
"0.5597281",
"0.55837476",
"0.54937226",
"0.548678",
"0.5473643",
"0.54586494",
"0.54551077",
"0.5423175",... | 0.7581561 | 0 |
prepares the start values for the input elements | function prepareStartValues() {
// initial state of the start values
my.start_values = my.start_values ? $.toDotNotation( my.start_values ) : {};
// consideration of the default configuration of the target component for start values
let config = $.clone( my.target.config );
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_assignInputElems() {\n // make sure those dom-ifs have run\n Polymer.dom.flush();\n\n this.set('_inputStart', this.$$('#inputStart'));\n this.set('_inputEnd', this.$$('#inputEnd'));\n }",
"_restoreStartInputValue(evt) {\n this._restoreInputValue(this._inputStart, this.formattedStart... | [
"0.62858516",
"0.61006945",
"0.6030413",
"0.5935146",
"0.5861998",
"0.5837164",
"0.58219653",
"0.5762059",
"0.57097644",
"0.57097644",
"0.56436443",
"0.5633719",
"0.5605294",
"0.5605294",
"0.5596288",
"0.55494297",
"0.55103743",
"0.54999083",
"0.54957634",
"0.54012996",
"0.54... | 0.63817793 | 0 |
(re)renders the preview based on the entered values | function updatePreview() {
// no preview desired? => abort
if ( !my.preview ) return;
// (re)render preview
my.target.start( self.getValue(), instance => $.setContent( self.element.querySelector( '#preview' ), instance.root ) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onInputFieldChange(eventObject) {\n let inputField = eventObject.target;\n /* If there is any contents of the input box, display the markdown preview and populate it. */\n if (inputField.value.length > 0) {\n this.previewElement.style.display = \"block\";\n ... | [
"0.6297725",
"0.62493145",
"0.61125666",
"0.61125666",
"0.6076346",
"0.60446477",
"0.60446477",
"0.60282815",
"0.59357053",
"0.58139986",
"0.57689345",
"0.5732805",
"0.57027483",
"0.56996745",
"0.56945235",
"0.5692113",
"0.5687215",
"0.5670391",
"0.56591344",
"0.56584847",
"0... | 0.67925954 | 0 |
Find the majority of characters in this script, and return the direction property of the script | function dominantDirection(text) {
let scripts = countBy(text, char => { //Iterating over the characters of a given piece of text
let script = characterScript(char.codePointAt(0)); //Find the script for this character
return script ? script.direction : "none"; //If a script can be found for this ch... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dominantDirection(string) {\n //debugger;\n // SPLIT STRING INTO ARRAY\n // let charArr = string.split('');\n // loop through array\n // charArr.forEach((char) => {\n // console.log(char); // test to see if it works, test at each change\n // works, consoles each letter\n // console.log(chara... | [
"0.6729378",
"0.64684963",
"0.644591",
"0.62182677",
"0.6168157",
"0.60735196",
"0.59523576",
"0.5731898",
"0.554714",
"0.5519961",
"0.54349136",
"0.5427112",
"0.5380581",
"0.5315987",
"0.5283247",
"0.5281497",
"0.5272204",
"0.5263052",
"0.52471304",
"0.52465665",
"0.5241389"... | 0.7162599 | 0 |
Modal view of each individual dish | function displayModal(modalDish) {
let modal = document.querySelector("#modal");
modal.classList.add("display");
modal.querySelector(".modal-name").textContent = modalDish.name;
modal.querySelector(".modal-image").src = "images/" + modalDish.image + ".jpg";
modal.querySelector(".modal-image").alt =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function openModal() {\n getRecipeDetails();\n handleShow();\n }",
"function showModal() {\n\n $('#myModal').modal(\"show\");\n $(\".modal-title\").text(data.name)\n $(\".modal-li-1\").text(\"Generation: \" + data.generation.name)\n $(\".modal-li-2\").text(\"Eff... | [
"0.622784",
"0.60005605",
"0.5939849",
"0.59256446",
"0.59007883",
"0.5875294",
"0.58651924",
"0.5775884",
"0.5768139",
"0.576484",
"0.57647717",
"0.5739151",
"0.57096356",
"0.570434",
"0.56747216",
"0.566859",
"0.5662533",
"0.563992",
"0.56325907",
"0.56296915",
"0.5620337",... | 0.6177771 | 1 |
This sample demonstrates how to Update the webhook identified by webhook name. | async function updateWebhook() {
const subscriptionId = process.env["AUTOMATION_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["AUTOMATION_RESOURCE_GROUP"] || "rg";
const automationAccountName = "myAutomationAccount33";
const webhookName = "TestWebhook";
const parameters = {
name: "Te... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setWebhook() {\r\n //Taken from \"Current Web App Url\" under Publish... Deploy as Web App...\r\n messagePayload.url =\r\n \"\";\r\n var method = \"setWebhook\";\r\n var response = sendPayload(method, messagePayload);\r\n console.log(JSON.stringify(response.getContentText()));\r\n}",
"function s... | [
"0.6796787",
"0.62536895",
"0.5852248",
"0.566495",
"0.5653116",
"0.5611039",
"0.55955863",
"0.55289096",
"0.54178476",
"0.54131436",
"0.5396117",
"0.53785056",
"0.53754044",
"0.53526556",
"0.5324649",
"0.5293796",
"0.52894145",
"0.5288927",
"0.5272462",
"0.5268519",
"0.52167... | 0.7371363 | 0 |
La siguiente funcion registra el despegue de la avioneta que recibe. | function registrarAvionetaADespegar(avioneta) {
// se valida si la avioneta es valida y se ingresa.
if (esValidaLaAvioneta(avioneta)) {
var despegue = getDespegueDeAvioneta();
despegue.hora = new Date();
despegue.Avioneta = avioneta;
// se agrega el elemento en la ultima posic... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function registrar_esquema_comision(){\n\t\tenviarFormulario(\"#form_esquema_comision_registrar\", 'EsquemaComision/registrar_esquema_comision', '#cuadro2');\n\t}",
"function AgregarNuevoLibro(_titulo, _tema, _autor, _existencia, _ubicacion, _fecha_ingreso) {\n var nuevo_libro = Object.create(libro);\n if ... | [
"0.56307477",
"0.5581867",
"0.55588627",
"0.5521161",
"0.55070436",
"0.55009973",
"0.54965794",
"0.5483151",
"0.5473059",
"0.5454728",
"0.54233235",
"0.53982633",
"0.53683126",
"0.5347904",
"0.5344082",
"0.5317675",
"0.5308164",
"0.5307191",
"0.5298284",
"0.5274989",
"0.52741... | 0.57763344 | 0 |
Esta funcion actualiza las cantidades del dia, se puede hacer de mejores maneras. | function actualizarCantidad() {
var total = 0;
var cantidadFumigacion = 0;
var contador = 0;
// Se recorren todos los despegues
while (contador < elDiaDeHoy.despeguesDeAvionetas.length) {
// Se toma la avioneta y se evalua si es de fumigacion
if (elDiaDeHoy.despeguesDeAvionetas[co... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function actualizarCantidadMovimientos() {\n limiteMovimientos -= 1;\n}",
"function iniciar(){\n for(let i = 1; i <= 31; i ++){\n let dezena = diaSorteService.montaDezena(i);\n vm.dezenas.push(dezena);\n }\n vm.selecaoAtual = -1;\n }",
"nuevaFrutaCantidad() {\n ... | [
"0.61560863",
"0.5560626",
"0.5511924",
"0.5462374",
"0.5425976",
"0.5391512",
"0.5350333",
"0.53132045",
"0.5309151",
"0.5289897",
"0.5241131",
"0.5230488",
"0.5213498",
"0.5213393",
"0.5202464",
"0.5194805",
"0.518287",
"0.515009",
"0.51389116",
"0.5138654",
"0.5136331",
... | 0.6658548 | 0 |
Load transcript for a given student. | function ajaxLoadTrasncriptForStudent(studentId) {
// http://localhost:8080/user/student/student1/transcript
$.ajax({
url : ROOT_PATH + "/user/student/" + studentId + "/transcript"
}).then(function(data) {
populateTranscript(data);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadannotationBlock(utt) {\n /* main orthographic line */\n\tvar utts = $(utt);\n\t/* user and time information */\n // console.log(\"ts: \" + utts.attr(\"start\"));\n // console.log(\"tsx: \" + ts);\n\tvar ts = checknumber(timelineRef(utts.attr(\"start\")));\n\tvar te = checknumber(timelineRef(u... | [
"0.54381865",
"0.53198576",
"0.5139115",
"0.49954236",
"0.49231157",
"0.48979694",
"0.48802716",
"0.48675293",
"0.4804433",
"0.47688055",
"0.4749963",
"0.4744043",
"0.47362667",
"0.47316813",
"0.47192088",
"0.4706425",
"0.46789458",
"0.46749955",
"0.46590915",
"0.46266913",
"... | 0.7491487 | 0 |
Load image. Everything starts here. Method is called from click on the image thumb or from loadPrevImg() and loadNextImg() This method calls show() and picture preloading | function loadImg() {
if (!showedImage.loaded) {
loading.show();
}
const successFunction = function() {
showedImage.loaded = true;
if (!isClosed) {
show(this);
for (let j = 1; multi && j <= preloadedImages; j++) preloadImg(j);
}
};
let img;
if (showedImage.type === Types.IMAGE) {
img =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadImage(){\n console.log(\"Image clicked one\")\n // self.img.path = self.image.src;\n // console.log(\"Image clicked two\");\n }",
"function loadImage() {\n\t\t$('div.thumbnail a img').on('click', function(){\n\t\t\tvar image = this.src;\n\t\t\t$('.image-load').html('<img src=\"' + image + '\... | [
"0.74109983",
"0.740669",
"0.73537534",
"0.73209846",
"0.729414",
"0.6935296",
"0.6934667",
"0.6858772",
"0.68385017",
"0.6783341",
"0.67148656",
"0.6704048",
"0.6682038",
"0.6645838",
"0.66440153",
"0.66434485",
"0.66282725",
"0.6624002",
"0.6594256",
"0.6593833",
"0.6583477... | 0.74807394 | 0 |
Detect Cycle in Graph My solution | function detectCycle(g){
let object = {result: false};
let visited = new Array(g.vertices).fill(false);
let i = 0;
while(i < g.vertices && object.result === false){
if(!visited[i]){
visited[i] = true;
helper(g, i, visited, object);
}
i++;
}
return object.result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function detectCycle(){\n\t\tSCCNodes = d3.range(nodesData.length).map(function(d, i){\n\t\t\treturn {id : nodesData[i].id, index : -1};\n\t\t})\n\t\tmap.clear();\n\t\tfor (var i = 0; i < SCCNodes.length; i++){\n\t\t\tif (SCCNodes[i].index == -1 && SCCNodes[i].id in nodesChildren){\n\t\t\t\tstrongConnect(SCCNodes[... | [
"0.7602684",
"0.7398592",
"0.7033745",
"0.70083725",
"0.674205",
"0.66873443",
"0.6687293",
"0.6676545",
"0.651069",
"0.6399765",
"0.6361589",
"0.6248759",
"0.61996347",
"0.6199423",
"0.6193449",
"0.6128762",
"0.6101644",
"0.60927314",
"0.60902655",
"0.6063087",
"0.60512114",... | 0.77394074 | 0 |
Mother vertex in a Graph My solution | function findMotherVertex (g){
let found = {value: -1};
for(let i = 0; i < g.vertices; i++){
let count = 0;
let visited = new Array(g.vertices).fill(false);
visited[i] = true;
let stack = new Stack();
stack.push(i);
while(!stack.isEmpty()){
let temp = stack.pop();
count++;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findMotherVertex(g){\n let visited = new Array(g.vertices).fill(false);\n let lastV ;\n\n for(let i = 0; i < g.vertices; i++){\n if(!visited[i]){\n dfs(g, i, visited);\n lastV = i;\n }\n }\n for(let i = 0; i < g.vertices; i++){\n visited[i] = false;\n }\n dfs(g, lastV, visited);\... | [
"0.81173176",
"0.58567274",
"0.5482987",
"0.54125285",
"0.54109067",
"0.5404376",
"0.5396123",
"0.53826463",
"0.537826",
"0.5344011",
"0.5312469",
"0.53014785",
"0.52803266",
"0.5276926",
"0.52689976",
"0.5265492",
"0.52581835",
"0.5243923",
"0.5242516",
"0.5224396",
"0.52199... | 0.7893417 | 1 |
Check if an undirected Graph is Tree or not | function isTree(g) {
let visited = new Array(g.vertices).fill(false);
let stack = [];
visited[0] = true;
let node = g.list[0].getHead();
while(node !== null){
stack.push(node.data);
visited[node.data] = true;
node = node.nextElement;
}
while(stack.length){
let temp = stack.pop();
let n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isTree(vertex) {\n // I had this problem to whiteboard at outco, full disclosure\n // to be a tree, you can only be pointed to by one other node\n // so if we have a set of children that have been pointed to, we can check against that\n \n let seenNodes = new Set();\n let queue = [vertex... | [
"0.67931545",
"0.6574087",
"0.61365056",
"0.60838616",
"0.60545063",
"0.59745395",
"0.5966111",
"0.5966111",
"0.5966111",
"0.5966111",
"0.5966111",
"0.5966111",
"0.5966111",
"0.58697677",
"0.58653605",
"0.58521014",
"0.58360845",
"0.5829841",
"0.5803231",
"0.5801567",
"0.5790... | 0.7267976 | 0 |
send req + form data to CreateAccountServlet | function formHandler(form){
console.log("formHandler function called...\n");
// Important: disable the default action of submitting the form
// which will cause the page to refresh
// see jQuery reference for details: https://api.jquery.com/submit/
event.preventDefault();
var email = form.newEmail.value... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleCreateAccountRequest(req, res) {\n if (!auth.assertHasUser(req)) return\n\n FB.api('/' + req.headers.userid + '?fields=name,email,picture', 'get', {\n access_token: fbAppAccessToken\n }, function (response) {\n if (!response.email) {\n console.log(\"User either has no email or no email... | [
"0.6196047",
"0.6115228",
"0.61007553",
"0.5919285",
"0.5893111",
"0.5888672",
"0.5813323",
"0.57752615",
"0.57408535",
"0.57259923",
"0.5719857",
"0.5695979",
"0.56788296",
"0.56751835",
"0.56649345",
"0.56536233",
"0.56448567",
"0.56414235",
"0.5620357",
"0.5618693",
"0.561... | 0.6716598 | 0 |
MapCntrlBase.js Copyright (c) 20142015 General Dynamics Inc. The Government has the right to use, modify, reproduce, release, perform, display ,or disclose this computer software or computer software documentation without restriction. | function MapCntrlBase ()
{
this.OPERATION_ADD = 0,
this.OPERATION_DELETE = 1,
this.OPERATION_UPDATE = 2,
this.addToQueue = function(priorty, itemList, method, context) {
var i = null;
var wrapper = null;
try {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createbaseMap() {\n\n map = new arcgisObj.Map(\"mapDiv\");\n \n var home = new arcgisObj.HomeButton({ // 全图\n map: map\n }, \"HomeButton\");\n home.startup();\n\n new arcgisObj.Scalebar({ // 比例尺\n map: map,\n attachTo: \"bottom-left\",\n scalebarUnit: \"metric... | [
"0.6885646",
"0.67003167",
"0.64790773",
"0.64790773",
"0.64164746",
"0.6402785",
"0.6402614",
"0.640158",
"0.63909656",
"0.6377517",
"0.6346589",
"0.6272208",
"0.627214",
"0.62496805",
"0.6204061",
"0.6178964",
"0.6166352",
"0.6164216",
"0.6149235",
"0.6141222",
"0.61368936"... | 0.71587193 | 0 |
Retrieve data from the Tautulli API. Available API methods: add_newsletter_config add_notifier_config arnold backup_config backup_db delete_all_library_history delete_all_user_history delete_cache delete_hosted_images delete_image_cache delete_library delete_login_log delete_lookup_info delete_media_info_cache delete_m... | function retrieveData()
{
var watched = {'01-last_24h': 'Watched last 24 hours', '02-last_7d': 'Watched last 7 days', '03-last_30d': 'Watched last month', '00-all_time': 'Watched all times'};
adapter.log.info('Retrieving information from Tautulli..');
//
// https://github.com/Tautulli/Tautulli/blob/master/API.md#... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getData() {\n const apiName = 'sbrestapi';\n const path = '/alerts';\n const myInit = {\n // OPTIONAL\n headers: {}, // OPTIONAL\n };\n\n return API.get(apiName, path, myInit).catch(err => {\n console.log('There has been a problem with your fetch operation: ' + err);\n throw err;\n });\n... | [
"0.58901405",
"0.5707755",
"0.5593074",
"0.5417656",
"0.5417656",
"0.5351486",
"0.53446096",
"0.53286713",
"0.5250992",
"0.5224192",
"0.5218556",
"0.5191849",
"0.5151156",
"0.5107401",
"0.5099308",
"0.508403",
"0.50442725",
"0.50342554",
"0.50284326",
"0.49966162",
"0.4967893... | 0.6762287 | 0 |
append to sensor .csv | function saveSensors(writer){
var timeNow = new Date();
var data = [{
time: timeNow.getUTCHours()+":"+timeNow.getUTCMinutes()+":"+timeNow.getUTCSeconds(),
temperature: matrix.humidity.read().temperature,
pressure: matrix.pressure.read().pressure,
altitude: matrix.pressure.read().altitude,
humidi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_publish() {\n\n this._writeFileHeader()\n .then(() => this.deviceManager.readSensors())\n .then((data) => {\n var filename = this._getFilename();\n var dataRaw = [\n _.get(data, 'timestamp', undefined).toISOString(),\n _.get(data, 'BME280.temperature_C', 0),\n ... | [
"0.6147921",
"0.6074026",
"0.6046477",
"0.59889925",
"0.59868574",
"0.59781647",
"0.59487",
"0.5894537",
"0.5875367",
"0.5859617",
"0.5830309",
"0.58272773",
"0.5823096",
"0.5671262",
"0.56374085",
"0.56367195",
"0.56088436",
"0.56058705",
"0.5598948",
"0.5582747",
"0.558151"... | 0.6196956 | 0 |
The proposal is not allowed to include any keys other than these, usually 'Collateral' and 'RUN'. | function assertOnlyKeys(proposal, keys) {
function onlyKeys(clause) {
return Object.getOwnPropertyNames(clause).every(c => keys.includes(c));
}
assert(
onlyKeys(proposal.give),
X`extraneous terms in give: ${proposal.give}`,
);
assert(
onlyKeys(proposal.want),
X`extrane... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isReserved(key) {\n return (key === \"add\" || key === \"delete\");\n}",
"getKeyDefinition(key) { // eslint-disable-line class-methods-use-this\n return {};\n }",
"function standardizePropertyKey(key) {\n var standardProperties = ['Title', 'Author', 'Subject', 'Keywords', 'Creator', 'Produce... | [
"0.51958746",
"0.5089395",
"0.50725573",
"0.50509125",
"0.49992037",
"0.49903518",
"0.49407294",
"0.49126086",
"0.49085018",
"0.49085018",
"0.48895854",
"0.48895854",
"0.48895854",
"0.48783395",
"0.48590058",
"0.48590058",
"0.47960338",
"0.47826493",
"0.47826493",
"0.47826493",... | 0.5675597 | 0 |
Calculate the target level for Collateral for the vaultSeat and clientSeat implied by the proposal. If the proposal wants Collateral, transfer that amount from vault to client. If the proposal gives Collateral, transfer the opposite direction. Otherwise, return the current level. | function TargetCollateralLevels(seat) {
const proposal = seat.getProposal();
const startVaultAmount = getCollateralAllocated(vaultSeat);
const startClientAmount = getCollateralAllocated(seat);
if (proposal.want.Collateral) {
return {
vault: AmountMath.subtract(startVaultAmount, proposal.wa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function targetRunLevels(seat) {\n const clientAllocation = getRunAllocated(seat);\n const proposal = seat.getProposal();\n if (proposal.want.RUN) {\n return {\n vault: AmountMath.makeEmpty(runBrand),\n client: AmountMath.add(clientAllocation, proposal.want.RUN),\n };\n } else i... | [
"0.58128154",
"0.51882094",
"0.50789076",
"0.47715142",
"0.47360227",
"0.46521574",
"0.46076554",
"0.45650223",
"0.45363176",
"0.4518247",
"0.44886172",
"0.44613236",
"0.445353",
"0.4442719",
"0.4441841",
"0.44186792",
"0.4391352",
"0.43841726",
"0.4347933",
"0.43413633",
"0.... | 0.7901255 | 0 |
Calculate the target RUN level for the vaultSeat and clientSeat implied by the proposal. If the proposal wants collateral, transfer that amount from vault to client. If the proposal gives collateral, transfer the opposite direction. Otherwise, return the current level. Since we don't allow the debt to go negative, we w... | function targetRunLevels(seat) {
const clientAllocation = getRunAllocated(seat);
const proposal = seat.getProposal();
if (proposal.want.RUN) {
return {
vault: AmountMath.makeEmpty(runBrand),
client: AmountMath.add(clientAllocation, proposal.want.RUN),
};
} else if (proposal.g... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function TargetCollateralLevels(seat) {\n const proposal = seat.getProposal();\n const startVaultAmount = getCollateralAllocated(vaultSeat);\n const startClientAmount = getCollateralAllocated(seat);\n if (proposal.want.Collateral) {\n return {\n vault: AmountMath.subtract(startVaultAmount, ... | [
"0.65905845",
"0.51894796",
"0.5082965",
"0.49628833",
"0.49377868",
"0.493757",
"0.4932622",
"0.48757848",
"0.4780037",
"0.47523284",
"0.47365472",
"0.4668988",
"0.464845",
"0.46441653",
"0.46423072",
"0.4621798",
"0.46143502",
"0.45985413",
"0.4563212",
"0.45465282",
"0.453... | 0.76144904 | 0 |
Show a list of all Visit Status. GET /visita/status | async index () {
const status = await VisitaStatus.all();
return status;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getActivitiesByStatus(req, res) {\n try {\n const status = req.params.status;\n const activities = await Activity.findAll({ where: { status }, include: [Destination] });\n successMsg(res, 200, 'correcto', activities);\n } catch (error) {\n errorMsg(res, 500, 'Ha ocu... | [
"0.6543182",
"0.6494141",
"0.6440763",
"0.6309503",
"0.6219287",
"0.6185558",
"0.6156515",
"0.6150221",
"0.61383486",
"0.6089134",
"0.60685325",
"0.60685325",
"0.6040256",
"0.5916306",
"0.58984476",
"0.5876957",
"0.586482",
"0.5844331",
"0.5838912",
"0.5821444",
"0.5814882",
... | 0.7129732 | 0 |
Create/save a new Visit Status. POST /visita/status | async store ({ request}) {
const data = request.only( 'visita_status_descricao' );
const status = await VisitaStatus.create(data);
return status;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function userVisitStatus(){\n dataservice.postData(USER_VISIT_API, {}, config).then(function(data, status) {\n if (data) {\n if (data.status) {\n }\n }\n\n }, function() {});\n }",
"async create() {\n let api = t... | [
"0.6231768",
"0.59181243",
"0.5779824",
"0.56115025",
"0.5528951",
"0.5489629",
"0.5469912",
"0.5385605",
"0.52103233",
"0.5199013",
"0.49564797",
"0.4933616",
"0.49263075",
"0.4923822",
"0.48737484",
"0.4860074",
"0.48313448",
"0.4800128",
"0.4774346",
"0.4758784",
"0.471373... | 0.64079845 | 0 |
Display a single Visit Status. GET /visita/status/:id | async show ({ params }) {
const status = await VisitaStatus.findOrFail(params.id);
return status;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getVisitorStatus (req, res, next) {\n\tdashboardController.getVisitorStatus(req.params.idWidget, req.params.vUsername, function (err, status) {\n\t\tif (err) return next(new Error('DB error'));\n\t\treq.vStatus = status;\n\t\tnext();\n\t});\n}",
"async function getActivitiesByStatus(req, res) {\n try... | [
"0.6290756",
"0.62496144",
"0.62089884",
"0.61142415",
"0.59481895",
"0.5873415",
"0.58293134",
"0.5790497",
"0.57252306",
"0.5647919",
"0.55785424",
"0.5560931",
"0.550249",
"0.54572684",
"0.5452654",
"0.5444438",
"0.5441704",
"0.53271943",
"0.53146476",
"0.52919775",
"0.527... | 0.7030114 | 0 |
Update Visit Status details. PUT or PATCH /visita/status/:id | async update ({ params, request }) {
const data = request.only( 'visita_status_descricao' );
const status = await VisitaStatus.findOrFail(params.id);
status.merge(data);
await status.save();
return status;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function updateActivityStatusById(req, res) {\n try {\n const id = req.params.id;\n const activity = await Activity.findOne({ where: { id } })\n\n if (!activity)\n return notFoundMsg(res, id, 'Actividad');\n\n activity.status === 1 ? activity.set({ status: 0 }) : act... | [
"0.66259146",
"0.6252891",
"0.6124476",
"0.6009056",
"0.59811324",
"0.59786063",
"0.5971669",
"0.59048945",
"0.5862905",
"0.57687414",
"0.5757009",
"0.5701072",
"0.56886315",
"0.56643975",
"0.5625935",
"0.559758",
"0.55942976",
"0.5544504",
"0.5511409",
"0.5509872",
"0.550485... | 0.69614065 | 0 |
Delete a Visit Status with id. DELETE /visita/status/:id | async destroy ({ params }) {
const status = await VisitaStatus.findOrFail(params.id);
await status.delete();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteVisit(visit){\n dataService.delete('visit', {KEYID: visit.KEYID}).then(function(msg) {\n console.log(msg);\n dataService.delete('visitType', {KEYID: visitType.KEYID}).then(function(response){\n console.log(response);\n });\n });\n }",
"async function deleteActivityById... | [
"0.6575872",
"0.6352206",
"0.63478726",
"0.634739",
"0.63075924",
"0.60772675",
"0.60411865",
"0.60216755",
"0.597675",
"0.5948836",
"0.5945283",
"0.5935066",
"0.59222084",
"0.59151",
"0.59050006",
"0.5895066",
"0.58886284",
"0.58809215",
"0.58809215",
"0.58807427",
"0.587121... | 0.7239486 | 0 |
Metodo que encarga de buscar todas las alarmas existentes en el dispositivo | function buscarAlarmas(){
var cadenaFechaActual=getFechaActual();
var key=cadenaFechaActual+':'+"1";
var alarmaActualBusqueda= window.localStorage.getItem(key);
if(alarmaActualBusqueda!=null){
var index=2;
while(alarmaActualBusqueda!=null){
var json=jQuer... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"checkAlarm() {\n const dayOfWeek = moment().format('dddd');\n for (let i = 0; i < this.state.alarms.length; i += 1) {\n for (let j = 0; j < this.state.alarms[i].dayOfWeek.length; j += 1) {\n // If the alarm is not ringing, ring the alarm and set the state\n if (this.props.currentTime === t... | [
"0.6262006",
"0.6210124",
"0.5974061",
"0.59046113",
"0.58608454",
"0.584932",
"0.57827634",
"0.5768082",
"0.5760016",
"0.5698527",
"0.56421185",
"0.5608242",
"0.55977905",
"0.5566668",
"0.55285656",
"0.5516643",
"0.5509653",
"0.54913956",
"0.5481456",
"0.5454587",
"0.5418539... | 0.702259 | 0 |
obtiene la fecha del dispositivo | function getFechaActual(){
var fecha= new Date();//obtengo la fecha del dispositivo
var mes=parseInt(fecha.getMonth())+1;
var cadenaFecha= fecha.getDate()+'/'+mes+'/'+ fecha.getFullYear();
return cadenaFecha;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function queDiaEHoje() {\n var currentdate = new Date();\n var datetime =\n \"Hoje é: \" +\n currentdate.getDate() +\n \"/\" +\n (currentdate.getMonth() + 1) +\n \"/\" +\n currentdate.getFullYear() +\n \" | \" +\n currentdate.getHours() +\n \":\" +\n currentdate.getMinutes() +\n ... | [
"0.6856518",
"0.68490136",
"0.67978793",
"0.6770004",
"0.67012435",
"0.6679682",
"0.6557039",
"0.6554611",
"0.654743",
"0.65366393",
"0.65357304",
"0.6466385",
"0.6410653",
"0.6408176",
"0.6333431",
"0.63327634",
"0.63281524",
"0.63215524",
"0.62742364",
"0.624754",
"0.624008... | 0.73627806 | 0 |
If filter changes in redux component should reload the vehichles list | componentDidUpdate(prevProps) {
const { filters } = this.props;
if (prevProps.filters !== filters) {
this.loadVehicles();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"filter() { \n\n const filters = {\n country_id: this.state.filters.country.id,\n client_type: this.state.filters.client_type\n };\n\n this.props.fetchEnterpriseList(filters);\n\n this.props.history.push({\n search: queryString.stringify(filters)\n ... | [
"0.6963503",
"0.6606828",
"0.63641894",
"0.6315328",
"0.6313447",
"0.629017",
"0.62652934",
"0.6253884",
"0.6227871",
"0.61607474",
"0.61186254",
"0.6085914",
"0.6081784",
"0.60660565",
"0.6052373",
"0.6045493",
"0.604434",
"0.604416",
"0.60258704",
"0.6014744",
"0.6007525",
... | 0.693933 | 1 |
Prepare query params in order to filter response | prepareParams() {
const { filters } = this.props;
const params = {};
if (filters !== undefined) {
// Add status filter to param
if (filters.status !== undefined && filters.status.value !== null) {
params.status = filters.status.value;
}
// Add customer filter to params
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"prepareRequestParams(options) {\n let requestParams;\n const searchKeys = _.split(options.searchKey, ','), matchModes = _.split(options.matchMode, ','), formFields = {};\n _.forEach(searchKeys, (colName, index) => {\n formFields[colName] = {\n value: options.query,\n ... | [
"0.69524515",
"0.6780141",
"0.6717184",
"0.6682078",
"0.6671775",
"0.66667354",
"0.65424854",
"0.65213335",
"0.6500427",
"0.6500427",
"0.6500427",
"0.6500427",
"0.6500427",
"0.6466798",
"0.64545",
"0.64545",
"0.6440331",
"0.6432754",
"0.6430843",
"0.6389376",
"0.62334687",
... | 0.7374864 | 0 |
Load vehicles list and set it to vehicles state. | async loadVehicles() {
this.setState({
isLoading: true
});
const params = this.prepareParams();
const result = await this.vehicleObject.getVehicles(params);
if (result.status === 'success' && result.data !== undefined) {
this.setState({
isLoading: false,
vehicles: resul... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadStateList() {\n\tLookup.all({where: {'lookup_type':'STATE_OR_PROVINCE', 'context_code':'US'}}, function(err, lookups){\n\t this.state_or_province_list = lookups;\n\t next(); // process the next tick. If you don't put it here, it will stuck at this point.\n\t}.bind(this));\n}",
"function loadLists()... | [
"0.61313796",
"0.5844409",
"0.5829958",
"0.582012",
"0.56305313",
"0.5591061",
"0.5541127",
"0.55333835",
"0.54908186",
"0.5468457",
"0.54436433",
"0.5436355",
"0.5398013",
"0.5393866",
"0.5379897",
"0.53550535",
"0.53336966",
"0.5299547",
"0.5274408",
"0.5272236",
"0.5270279... | 0.6595375 | 0 |
use fibonacciGenerator (n) where n is the number of items in the sequence fibonacciGenerator (3) when called should equal [0,1,1] output should be an array for loop should use var i= 0 rather than i=0 for testing. Return an array of fibonacci numbers. | function fibonacciGenerator (n) {
var fibNumbers = [];
for (var i = 0; i < n; i++){
if (i <= 1) {
fibNumbers.push(i);
} else{
fibNumbers.push(fibNumbers[i - 2] + fibNumbers[i - 1]);
}
}
return fib... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fibonacciGenerator(n){\r\n var a=[];\r\n\r\n if(n===1){\r\n a.push(0);\r\n }\r\n\r\n else if(n>=2){\r\n a.push(0);\r\n a.push(1);\r\n }\r\n\r\n for(var i=2;i<n;i++){\r\n a[i]=a[i-1]+a[i-2];\r\n }\r\n\r\n return a;\r\n}",
"function fibonacciGenerator(n) {\n ... | [
"0.8607535",
"0.8343796",
"0.8193995",
"0.8023636",
"0.7846044",
"0.78323865",
"0.78137356",
"0.7793313",
"0.77611923",
"0.76999307",
"0.76943153",
"0.76752424",
"0.76694334",
"0.76547414",
"0.76355517",
"0.7617234",
"0.760711",
"0.7604321",
"0.7585704",
"0.7585526",
"0.75813... | 0.84340197 | 1 |
TODO: replace this with a proper protractor/ng2.0 integration and remove this function as well as all method calls. | function waitForAngular() {
browser.driver.sleep(2000);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onSpecComplete(browser, result) {\n\n }",
"function protractor() {\n\tvar configObj = {\n\t\tconfigFile: './protractor.conf.js'\n\t};\n\tif (gutil.env.suite) {\n\t\tconfigObj['args'] = ['--suite', gutil.env.suite];\n\t}\n\n\treturn gulp.src([])\n\t\t.pipe(Protractor(configObj))\n\t\t.on('error', function() {\n\... | [
"0.5607831",
"0.5407613",
"0.5257577",
"0.51673186",
"0.51617616",
"0.5157745",
"0.5109246",
"0.5079546",
"0.5041426",
"0.50128126",
"0.5004837",
"0.49674636",
"0.49277705",
"0.4907338",
"0.49007568",
"0.4898323",
"0.48842096",
"0.4880314",
"0.4877516",
"0.4870613",
"0.482973... | 0.6191123 | 0 |
Update vehicle data on the map. | function updateVehicleMap(vid, mapname){
var data = getVehicleData(vid);
if (eval(mapname).getSource('greentrucks')){
eval(mapname).getSource('greentrucks').setData(data);
}
if (eval(mapname).getSource('yellowtrucks')){
eval(mapname).getSource('yellowtrucks').setData(data);
}
if (eval(mapname).getSo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function vdDemo_modifyMaps(){\n\tGLB.vehicle.modifyMap();\n}",
"function updateData() \n{\n\tObject.keys(raidApp.selectedLocations).forEach((key) => \n\t{\n\t\tconst raid = raidApp.selectedLocations[key];\n\t\tconst card = getRaidCard(raid);\n\t\t// CODELAB: Add code to call getForecastFromCache\n\n\t\t// Get th... | [
"0.6821609",
"0.65693486",
"0.63186425",
"0.620208",
"0.6192647",
"0.6104608",
"0.61011744",
"0.6089988",
"0.6061578",
"0.60572076",
"0.60247964",
"0.5986317",
"0.5923858",
"0.58883417",
"0.58774084",
"0.5862521",
"0.58601755",
"0.58404726",
"0.58206034",
"0.579088",
"0.57575... | 0.7310107 | 0 |
Display Vehicle details popup and route. | function showTruckDetailsSpec(vid, mapname){
getRoute(trucks[vid].orig, trucks[vid].pos, vid, 'driven', '#3887be', "mapspecific").then(() => {
getRoute(trucks[vid].pos, trucks[vid].dest, vid, 'remaining', '#f30', "mapspecific").then(() => {
getWSDist(vid).then(() => {
loadPopup(vid, "mapspecific");
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showVehiclePopup(v) {\n if (v.poi) {\n html = '<h4>' + v.name + '</h4><p>' + v.position.time_of_day + '</p><p>' + v.position.occurred_at.substring(0, 10) + '</p>';\n \n MapPane.popup(v.poi, html);\n }\n }",
"function openVehicle(vid){\n //Open Specific vehicle by clicking More... | [
"0.7327525",
"0.67175364",
"0.6618013",
"0.6338992",
"0.6156337",
"0.6060575",
"0.6048994",
"0.59650356",
"0.5929094",
"0.58627",
"0.5850023",
"0.58493185",
"0.5829772",
"0.5827143",
"0.58214456",
"0.58177954",
"0.58177954",
"0.58177954",
"0.5814541",
"0.5796189",
"0.5792156"... | 0.6962292 | 1 |
Add mapbox features to all the workshops | function addWSfeatures(){
var features = [];
for (var i = 0; i < workshops.length; i++){
var feature = {
// feature for Mapbox DC
'type': 'Feature',
'geometry': {
'type': 'Point',
'coordinates': workshops[i].coordinates
},
'properties': {
'titl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addMarkers() {\n /* For each feature in the GeoJSON object above: */\n stores.features.forEach(function(marker) {\n /* Create a div element for the marker. */\n var el = document.createElement('div');\n /* Assign a unique `id` to the marke... | [
"0.7120694",
"0.6860217",
"0.6819332",
"0.6777375",
"0.6689035",
"0.6422224",
"0.6373473",
"0.6337598",
"0.6334658",
"0.63330954",
"0.61898243",
"0.6187662",
"0.61769104",
"0.6157196",
"0.61283207",
"0.6088899",
"0.6083584",
"0.60806984",
"0.60452664",
"0.60410476",
"0.603743... | 0.72484595 | 0 |
Update list of symptoms on a vehicle | function updateSymptomsList(id){
var tempList = [];
var sympList = [];
var wheelalerts = getWheelAlerts(id);
tempList.push(wheelalerts[0]);
tempList.push(wheelalerts[1]);
tempList.push(getOilPressAlert(id));
tempList.push(getAirPressAlert(id));
tempList.push(getBrakeEngAlert(id));
for (i = 0; i < temp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendUpdateVehicle()\n\t{\n\t\tif($rootScope.user && $rootScope.user.isAgency)\n\t\t{\n\t\t\tvar promises = [];\n\t\t\tvar config = {headers: {'Authorization': 'Bearer ' + $rootScope.user.token,}};\n\n\t\t\t$http.put('api/vehicle/edit/', $scope.vehicle, config)\n\t\t\t.then(function successCallback(respons... | [
"0.5228857",
"0.52191055",
"0.5114188",
"0.50770545",
"0.5058007",
"0.49861813",
"0.4973066",
"0.4952598",
"0.4938033",
"0.49183515",
"0.4804656",
"0.47909832",
"0.47790036",
"0.47709513",
"0.47610405",
"0.47230372",
"0.47213978",
"0.47191983",
"0.47145808",
"0.47011983",
"0.... | 0.6366148 | 0 |
Display general info modal on specific vehicle. Show popup and route immediately. | function dispInfoModal(vid){
document.getElementById('infoModal').style.display='block';
mapspecific.resize();
mapspecific.flyTo({
center: trucks[0].pos
});
getTruckColSpec();
showTruckDetailsSpec(vid, "mapspecific");
showRoute(trucks[vid], "mapspecific");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showVehiclePopup(v) {\n if (v.poi) {\n html = '<h4>' + v.name + '</h4><p>' + v.position.time_of_day + '</p><p>' + v.position.occurred_at.substring(0, 10) + '</p>';\n \n MapPane.popup(v.poi, html);\n }\n }",
"function showTruckDetailsSpec(vid, mapname){\n getRoute(trucks[vid].o... | [
"0.7530423",
"0.6742037",
"0.66555893",
"0.6588745",
"0.6587061",
"0.6587061",
"0.6587061",
"0.6552587",
"0.6548041",
"0.6536472",
"0.6485876",
"0.6471314",
"0.64656985",
"0.64238703",
"0.63798577",
"0.6357076",
"0.6345784",
"0.63241434",
"0.62487507",
"0.62215734",
"0.621949... | 0.7697455 | 0 |
Display all trucks (which is always one) on the map (No filtering) | function getTruckColSpec(){
if (mapspecific != undefined){
if (mapspecific.getLayer("greentrucks") && mapspecific.getLayer("redtrucks") && mapspecific.getLayer("yellowtrucks")) {
for (i=0; i<trucks.length;i++){
if (trucks[i].gsh <= 50 && trucks[i].gsh > 20){
showTruckCol(1, "mapspecific");... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showAll(){\n if(map.hasLayer(recreationLocations)){\n map.removeLayer(recreationLocations);\n };\n // Get CARTO selection as GeoJSON and Add to Map\n $.getJSON(\"https://\"+cartoDBUserName+\".carto.com/api/v2/sql?format=GeoJSON&q=\"+sqlQuery, function(data) {\n recreationLocation... | [
"0.6019366",
"0.5979106",
"0.5962987",
"0.59437597",
"0.59363806",
"0.5931185",
"0.5920447",
"0.5881404",
"0.58579487",
"0.5842424",
"0.58108574",
"0.5804435",
"0.57755136",
"0.5768689",
"0.5766732",
"0.57523984",
"0.57431537",
"0.5732933",
"0.5705602",
"0.5704326",
"0.570064... | 0.5995083 | 1 |
Get alert string if there is heat of vibration in any of the wheels. | function getWheelAlerts(vid){
var heatWheelsDisp = "";
var vibrationWheelsDisp = "";
var firstAddedHeat = false;
var firstAddedVib = false;
for (i = 0; i < trucks[vid].symptoms.wheels.heat.length; i++){
if (trucks[vid].symptoms.wheels.heat[i] == true){
if (firstAddedHeat == false) {
heatWhee... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getOilPressAlert(vid){\n var returnstr = \"\";\n if (trucks[vid].symptoms.oillevel == true){\n returnstr = 'OIL PRESSURE';\n }\n return returnstr\n}",
"function getAirPressAlert(vid){\n var returnstr = \"\";\n if (trucks[vid].symptoms.airpressure == true){\n returnstr = 'AIR PRESSURE';\n }\... | [
"0.63378286",
"0.59546363",
"0.56428015",
"0.5313483",
"0.52069217",
"0.51535755",
"0.5075749",
"0.5025401",
"0.49695075",
"0.4946827",
"0.49350905",
"0.49250707",
"0.49052647",
"0.4899241",
"0.48990804",
"0.48851946",
"0.488014",
"0.48752058",
"0.48733994",
"0.48726892",
"0.... | 0.67116386 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.