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 |
|---|---|---|---|---|---|---|
recursive add all sites | function AddSiteRec(arr, i){
if(i >= arr.length) return AddSiteDataRec(dataArray,0); //add site data after all site added
var site = arr[i];
WeatherStation.findOneAndUpdate({ '_id': site._id}, {'$setOnInsert': site}, {upsert: true}, function(){
AddSiteRec(arr, i+1);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addAll() {}",
"function AddSiteRec(arr, i){\n\t\tif(i >= arr.length) return AddSiteDataRec(dataArray,0);\t//add site data after all site added\n\t\tvar site = arr[i];\n\t\tSensorSite.findOneAndUpdate({ '_id': site._id}, {'$set': { 'lat': site.lat, 'lng': site.lng }, '$setOnInsert': site}, {upsert: true}... | [
"0.598581",
"0.58276397",
"0.5475636",
"0.54092544",
"0.52430755",
"0.52112955",
"0.5178721",
"0.51646996",
"0.51457155",
"0.5097964",
"0.50721014",
"0.5067919",
"0.5063044",
"0.50130963",
"0.4997893",
"0.4979793",
"0.49714512",
"0.4933651",
"0.49198806",
"0.48909092",
"0.487... | 0.59028655 | 1 |
recursive add all roads | function AddRoadRec(arr, i){
if(i >= arr.length) return;
var road = arr[i];
RoadSegment.findOneAndUpdate({ '_id': road._id}, {'$setOnInsert': road}, {upsert: true}, function(){
AddRoadRec(arr, i+1);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addAll() {}",
"function drawRoads(svg) {\n var absLoc, field, pointA, pointB, relLoc, road, rotAngle, settings;\n\n for(var i = 0; i < board.roads.length; i++) {\n // For each road, find out which field it belongs to\n road = board.roads[i];\n field = getFieldById(board.fields... | [
"0.5875547",
"0.56392026",
"0.5616612",
"0.561551",
"0.5578332",
"0.5518525",
"0.5359157",
"0.5325193",
"0.52758986",
"0.5250128",
"0.518103",
"0.5179121",
"0.5172217",
"0.5136162",
"0.5131591",
"0.5123548",
"0.5090899",
"0.5088562",
"0.50873643",
"0.5084651",
"0.5079851",
... | 0.5765526 | 1 |
Determine the number of cards to be displayed in the list view on a single page | function countCardsPerPage() {
// spr dlaczego tutaj musiałem dawać document.get zamiast
// np. this.pseudoFooter.offsetHeight - wyrzucało mi undefined
// nie czaje czemu ????
var cardsWrapperHeight = window.innerHeight - (document.getElementById("header").offsetHeight + document.getElementById("cardsFilte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showCardAmount(){\n $(\"#total-cards\").html(model.getCardObjArr().length);\n }",
"numberOfCards()\n {\n return this.cards.length;\n }",
"count()\n\t{\n\t\treturn this.numCards;\n\t}",
"function countProductsOnPage() {\n $('.displayed__localCount').html(document.querySelect... | [
"0.68587184",
"0.6747867",
"0.66923416",
"0.6524864",
"0.64673465",
"0.64236706",
"0.6365921",
"0.6360424",
"0.63435686",
"0.6252392",
"0.62442",
"0.6230244",
"0.6229579",
"0.622242",
"0.6207617",
"0.62056404",
"0.62056404",
"0.6173308",
"0.612505",
"0.6124171",
"0.61176807",... | 0.76270974 | 0 |
passes all saveSearches into global array | function passToArray(savedSearch) {
savedSearchArray.push(savedSearch);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSearches() {\n storedSearches = JSON.parse(localStorage.getItem(\"Search Term\"));\n if (!storedSearches) {\n savedST = [];\n } else {\n savedST = storedSearches;\n STSavedSearches();\n }\n}",
"function getGuardSearches() {\n storedGuardSearches = JSON.parse(localS... | [
"0.6810535",
"0.66924226",
"0.66504735",
"0.65755606",
"0.6198491",
"0.615159",
"0.6095202",
"0.60159624",
"0.5990283",
"0.5911986",
"0.5909506",
"0.58311355",
"0.57917213",
"0.5790481",
"0.5746242",
"0.5739089",
"0.56776243",
"0.567636",
"0.5667369",
"0.56669706",
"0.562336"... | 0.7024024 | 0 |
html_id html id for specific node js file type selector. Datayour data | function NodesaveFile(html_id,data, encoding) {
var chooser = document.querySelector(html_id);
chooser.addEventListener("change", function(evt) {
var fs = require('fs');// save it now
if(encoding === true){
var base64Data = data.replace(/^data:application\/pdf;filename=generated.pdf... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"htmlId(name, type = '', ext = '') {\n return Util.htmlId(name, type, ext);\n }",
"function createFilesHtml(id) {\n currentID = id;\n \n var fileChilds = getChildById(id);\n var filesHtml = '';\n if (fileChilds.length) {\n $('.pty').css('display','')\n ... | [
"0.5849474",
"0.5576776",
"0.5555286",
"0.5535879",
"0.5518905",
"0.551677",
"0.5457033",
"0.5450399",
"0.5448303",
"0.54211956",
"0.5419827",
"0.5362333",
"0.53090143",
"0.5301071",
"0.52916247",
"0.5288338",
"0.528735",
"0.528354",
"0.52435786",
"0.5202916",
"0.5170497",
... | 0.57418394 | 1 |
Hide download section if run on desktop Platform | function hide_download_icons_node(){
if(node_enable() === true){
CSSLoad("style_hide_download_section.css?v01");
//CSSLoad("style_hide_window_control_section.css?v03");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hide_download_icons_android(){\n if(IsAndroid() === true){\n CSSLoad(\"style_hide_download_section.css?v0221\");\n CSSLoad(\"style_hide_window_control_section.css?v023\");\n }\n}",
"function fnDownloadLinkVisibility(state) {\n var link = document.getElementById(\"downloadlink\");\... | [
"0.7264511",
"0.6477899",
"0.61239976",
"0.608734",
"0.59986323",
"0.59703803",
"0.5931743",
"0.5842519",
"0.5750838",
"0.5736619",
"0.5701093",
"0.5657955",
"0.5656968",
"0.5655311",
"0.5654694",
"0.56479305",
"0.5645589",
"0.5642865",
"0.5638401",
"0.5635891",
"0.56346923",... | 0.67815036 | 1 |
Hide download section if run on Android Platform | function hide_download_icons_android(){
if(IsAndroid() === true){
CSSLoad("style_hide_download_section.css?v0221");
CSSLoad("style_hide_window_control_section.css?v023");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hide_download_icons_node(){\n if(node_enable() === true){\n CSSLoad(\"style_hide_download_section.css?v01\");\n //CSSLoad(\"style_hide_window_control_section.css?v03\");\n }\n}",
"function fnDownloadLinkVisibility(state) {\n var link = document.getElementById(\"downloadlink\");\n ... | [
"0.6076402",
"0.60398734",
"0.57945114",
"0.5634682",
"0.55981684",
"0.55851346",
"0.55547816",
"0.5548395",
"0.5493798",
"0.54687196",
"0.5441318",
"0.5381035",
"0.5332235",
"0.5304901",
"0.5263014",
"0.5232996",
"0.52257204",
"0.5223136",
"0.5199141",
"0.51976585",
"0.51889... | 0.7885312 | 0 |
This function is called to clear the back buffer with a specific color | clear() {
// Clearing with black color by default
// 在给定的矩形内清除指定的像素
this.workingContext.clearRect(0, 0, this.workingWidth, this.workingHeight);
// once cleared with black pixels, we're getting back the associated image data to
// clear out back buffer
// getImageData 返回 ImageData 对象,该对象为画布上指定的矩... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function prepareClearColor() {\n let color = scene.clearColor;\n gl.clearColor(color.r, color.g, color.b, color.a);\n}",
"function clear_screen(){\r\n if (tracing) return;\r\n ctx.clearRect(0, 0, cnvs.width, cnvs.height);\r\n}",
"function clear_screen() {\n\tctx.fillStyle = \"#FFFFFF\"; // white\n... | [
"0.7190565",
"0.69971734",
"0.69922453",
"0.6934051",
"0.6900322",
"0.68748295",
"0.6859505",
"0.68217665",
"0.68103874",
"0.6775442",
"0.6756533",
"0.67537194",
"0.67287767",
"0.6718605",
"0.66918135",
"0.66833687",
"0.66814184",
"0.66738605",
"0.6668278",
"0.6659704",
"0.66... | 0.72229016 | 0 |
Project takes some 3D coordinates and transform them in 2D coordinates using the transformation matrix | project(coord, transMat) {
var point = BABYLON.Vector3.TransformCoordinates(coord, transMat);
// The transformed coordinates will be based on coordinate system
// starting on the center of the screen. But drawing on screen normally starts
// from top left. We then need to transform them again to have x:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"project(ax, ay, az, angles){\r\n var x = ax - this.camera_p.x;\r\n var y = ay - this.camera_p.y;\r\n var z = az - this.camera_p.z;\r\n \r\n var dx = angles.cy*(angles.sz*y + angles.cz*x) - angles.sy*z;\r\n var dy = angles.sx*(angles.cy*z + angles.sy*(angles.sz*y + angles.cz*x)) + angles.cx*(angle... | [
"0.721251",
"0.6657503",
"0.66289544",
"0.6562682",
"0.65245664",
"0.64900035",
"0.64790267",
"0.6459427",
"0.64332557",
"0.6425021",
"0.6391278",
"0.6387416",
"0.6355549",
"0.63535154",
"0.63382554",
"0.6313749",
"0.63008547",
"0.628988",
"0.6277564",
"0.626933",
"0.6261112"... | 0.7079614 | 1 |
drawPoint calls putPixel but does the clipping operation before | drawPoint(point) {
// Clipping what's visible on screen
if (point.x >= 0 && point.y >= 0 && point.x < this.workingWidth
&& point.y < this.workingHeight) {
// Drawing a yellow point
this.putPixel(point.x, point.y, new BABYLON.Color4(1, 1, 0, 1));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawPoint(ctx, y, x, r, image) {\n ctx.beginPath()\n ctx.drawImage(image, x, y, 150, 150)\n }",
"function updatePoint(event) {\r\n\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n //redraw\r\n drawMap();\r\n drawCoord(coord[0], coord[1], \"red\");\r\n\r\n var rect = canvas... | [
"0.666671",
"0.663069",
"0.64092857",
"0.63475615",
"0.6315788",
"0.6314992",
"0.6302977",
"0.63007367",
"0.6285346",
"0.6252598",
"0.61995846",
"0.6147914",
"0.6146695",
"0.61405784",
"0.61340106",
"0.6125398",
"0.6114464",
"0.60929966",
"0.60787725",
"0.6066612",
"0.6047814... | 0.77709526 | 0 |
source: given a user Meteor object, return an object to pass into the oauth2client as credentials will refresh tokens if the saved one is expired needs to be called before every gCalendarApi call | function getAccessToken(user) {
// get data saved in DB about google auth
const googleService = user.services.google;
// if token won't expire in the next minute, use it
if (googleService.expiresAt > Date.now() + 60 * 1000) {
// then just return the currently stored token
return {
access_token: g... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"refresh(rT) {\n console.log('Line 64 in Client.js rT saved');\n this.oAuth2Client.setCredentials({\n refresh_token: rT\n });\n }",
"updateAuthenticatedUser() {\n if (__WEBPACK_IMPORTED_MODULE_1__Client__[\"a\" /* client */].enableOauth)\n this.resetToken();\n else\n ... | [
"0.5851371",
"0.5713127",
"0.5612677",
"0.56078976",
"0.56059766",
"0.55840635",
"0.5480983",
"0.5469538",
"0.54532975",
"0.5451167",
"0.54404265",
"0.5427708",
"0.54260415",
"0.5421693",
"0.540893",
"0.538239",
"0.536856",
"0.5347901",
"0.5346",
"0.5317003",
"0.52814597",
... | 0.668405 | 0 |
Selects and deselects dice | function diceClick(img) {
if (rolled) {
var i = img.getAttribute('data-number');
if (!diceArr[i].set) {
img.classList.toggle('selected');
if (!diceArr[i].clicked) {
diceArr[i].clicked = true;
} else {
diceArr[i].clicked = false;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rollSelectedDice(die) {\n // set last Roll ID\n currentRollId = \"roll_\" + Date.now();\n let thisRollId = currentRollId;\n //play sound\n playRollSound();\n //reset total\n total = 0;\n $(\"#total-value\").text(\"?\").animateRotate(720, 1000, \"swing\");\n //reset all dice to t... | [
"0.6443329",
"0.6414807",
"0.63498604",
"0.62193716",
"0.6205317",
"0.6199384",
"0.61676955",
"0.6161636",
"0.6082238",
"0.6016921",
"0.60136247",
"0.59594566",
"0.5953671",
"0.5921438",
"0.59144396",
"0.5907053",
"0.5900603",
"0.58702296",
"0.585865",
"0.5849307",
"0.5839863... | 0.65072423 | 0 |
Checks for any clicked dice that aren't already kept | function checkForClicked() {
if (!rolled) {
return 'success';
}
for (i = 0; i < 6; i++) {
if (diceArr[i].clicked) {
return 'success';
}
}
return "You haven't clicked any new dice!";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function noCheat(){\n console.log(\"already clicked!\");\n }",
"function resetClicked(hardReset = false) {\n for (i = 0; i < 6; i++) {\n if ((!diceArr[i].set || hardReset) && diceArr[i].clicked) {\n document.getElementById(`die${i + 1}`).classList.toggle('selected');\n d... | [
"0.66604185",
"0.65380806",
"0.6475249",
"0.6467352",
"0.64614624",
"0.6442292",
"0.6419372",
"0.6411226",
"0.6393504",
"0.6386347",
"0.6354877",
"0.6311614",
"0.627049",
"0.6244265",
"0.62209654",
"0.61484015",
"0.60247743",
"0.60189974",
"0.60077596",
"0.60012794",
"0.59690... | 0.7202416 | 0 |
year should be the full 4digit year. day is the 0based index of the day. so dateFromYearAndDay(2020, 0) is January 1, 2020 | function dateFromYearAndDay(year, day) {
return new Date(year, 0, day + 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getYearDay (date) {\n const arr = date.split('-')\n const month = Number(arr[1]) * 30.5\n const day = Number(arr[2])\n return ~~(month + day)\n}",
"function dayofyear(date) {\n\n var jd1 = julianday(new Date(date.getFullYear(), 0, 1), { includeTime: false });\n var jd2 = julianday(date, { includeT... | [
"0.67945844",
"0.67623997",
"0.6742806",
"0.6733113",
"0.66755104",
"0.6627585",
"0.66142726",
"0.6594423",
"0.64724517",
"0.6442403",
"0.64109904",
"0.639947",
"0.63565475",
"0.6348467",
"0.63366634",
"0.63132197",
"0.62855667",
"0.62741905",
"0.6237739",
"0.6199721",
"0.617... | 0.8040112 | 0 |
Used to recommend exercises to the currently logged in user For now it just recommends random exercises | async function recommendExercise() {
const profile = await getProfile();
if (!profile.data.exercises) {
return null;
}
else {
return profile.data.exercises[Math.floor(Math.random() * profile.data.exercises.length)];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getRecommended() {\n\n\t// ajax used so we can disbale cache\n\t$.ajax({\n\t\turl: \"/getRecommended\",\n\t\tmethod: \"GET\",\n\t\tcache: false,\n\t\tsuccess: function(data) {\n\t\t\t// would error if not logged in\n\t\t\tif (data != \"error\") {\n\t\t\t\tpopulate(\"#topRecommendations\", data);\n\t\t\t}\... | [
"0.62077564",
"0.5982188",
"0.58200777",
"0.5786772",
"0.56923133",
"0.5676084",
"0.56742615",
"0.5651637",
"0.5650731",
"0.56445444",
"0.5626855",
"0.5571247",
"0.55450964",
"0.5525885",
"0.550244",
"0.5487857",
"0.5479547",
"0.5447164",
"0.5443887",
"0.54291147",
"0.5414448... | 0.7853655 | 0 |
Save squad to URL | function saveSquadToURL() {
var shipElementClassName = "dialManeuversWrapperClass";
// Get all ships
var shipElements = document.getElementsByClassName(shipElementClassName);
// Format the ships as JSON
var squadJSON = {
"pilots": []
};
for (var i = 0; i < shipElements.length; i++) {... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function articleToolsSave(title, url, clip, referrer, partner) {\n saveArticle(buildURL(title, url, clip, referrer, partner, \"articleToolsSave\"));\n return false;\n \n}",
"function savetokens(surl){\n chrome.runtime.sendMessage(chrome.runtime.id,{operation:\"savetokens\",url:surl},function(response){... | [
"0.61703074",
"0.6003383",
"0.5924655",
"0.5862989",
"0.5807947",
"0.5720204",
"0.5707141",
"0.5698471",
"0.5677748",
"0.56530017",
"0.56382823",
"0.56190753",
"0.55984133",
"0.5590457",
"0.55894625",
"0.5567626",
"0.5565383",
"0.55534506",
"0.55364805",
"0.5517808",
"0.54808... | 0.7259373 | 0 |
Now that the squad XWS has been obtained, extract the dials and add them | function loadDialsFromXWS(cleansedJSONFromURL) {
// Get all of the select options
var shipTypeOptionElements = document.getElementsByClassName("shipTypeOptionElement");
// Convert the options into a dictionary
var shipTypeDictionary = {};
for (var i = 0; i < shipTypeOptionElements.length; i++) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadDialsFromURL() {\n // Check if there is a squad in the URL!\n var preexistingSquadJSON = window.location.search;\n if (preexistingSquadJSON.length > 1) {\n console.log(\"Loading pre-existing squad JSON!\");\n var cleansedJSONFromURL = preexistingSquadJSON.substring(1);\n ... | [
"0.5899467",
"0.52459687",
"0.51149684",
"0.50571597",
"0.5018123",
"0.5016602",
"0.49959573",
"0.4980806",
"0.4899675",
"0.48803845",
"0.48621428",
"0.4777856",
"0.47776613",
"0.4690381",
"0.4671072",
"0.46510372",
"0.4642626",
"0.464183",
"0.4640842",
"0.46330747",
"0.46160... | 0.6221457 | 0 |
Calculate the HMACMD5, of a key and some data (raw strings) | function rstrHMACMD5 (key, data) {
var i;
var bkey = rstr2binl(key);
var ipad = [];
var opad = [];
var hash;
ipad[15] = opad[15] = undefined;
if (bkey.length > 16) {
bkey = binlMD5(bkey, key.length * 8);
}
for (i = 0; i < 16; i += 1) {
ipa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rstrHMACMD5(key, data) {\n var i;\n var bkey = rstr2binl(key);\n var ipad = [];\n var opad = [];\n var hash;\n ipad[15] = opad[15] = undefined;\n if (bkey.length > 16) {\n bkey = binlMD5(bkey, key.length * 8);\n }\n for (i = 0; i < 16; i += 1) {\n ... | [
"0.824576",
"0.824195",
"0.824195",
"0.8230205",
"0.8230205",
"0.8204619",
"0.8173807",
"0.69516104",
"0.6945435",
"0.6945435",
"0.6945435",
"0.6945435",
"0.69103175",
"0.6898418",
"0.6886531",
"0.6886088",
"0.68821627",
"0.68650424",
"0.68464273",
"0.6815503",
"0.6815503",
... | 0.825735 | 0 |
This function takes in a list of dog objects, and an object representing the search criteria It returns a filtered list of dogs matching the search criteria | function filter(dogs, inputs) {
if (inputs.name) {
dogs = filterByName(dogs, inputs.name);
}
if (inputs.breed) {
dogs = filterByBreed(dogs, inputs.breed);
}
if (inputs.sizes && inputs.sizes.length > 0) {
dogs = filterBySize(dogs, inputs.sizes);
}
return dogs;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function filterByBreed(dogs, breed) {\n return dogs.filter(function(dog) {\n return dog.breed === breed;\n })\n}",
"applyFilters(listToFilter, searchTerm, filterArray) {\n\n let filteredItems = listToFilter\n filterArray = filterArray.map(filter => filter.toLowerCase())\n\n //Apply search\n sear... | [
"0.682065",
"0.6382925",
"0.6354202",
"0.6182558",
"0.6129652",
"0.6083199",
"0.60796016",
"0.5986101",
"0.59027666",
"0.58933926",
"0.58185405",
"0.58050025",
"0.579612",
"0.5779178",
"0.5740249",
"0.57397515",
"0.5720845",
"0.56859547",
"0.5683457",
"0.568194",
"0.56786615"... | 0.701182 | 0 |
Returns only dogs that start with the search string | function filterByName(dogs, name) {
return dogs.filter(function(dog) {
return dog.name.toLowerCase().startsWith(name.toLowerCase());
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findWords(dogString,dogNames)\n{\n let dogName = dogString.split(\",\")[1].toLowerCase().split(\" \").splice(-1);\n for(let i=0; i <= dogNames.length; i++)\n {\n if(dogNames[i].toLowerCase() == dogName)\n {\n return \"Matched dog_name\";\n }\n continue;\n ... | [
"0.65473694",
"0.6161114",
"0.6121134",
"0.60136485",
"0.59895986",
"0.5869747",
"0.5784009",
"0.57766646",
"0.5769014",
"0.5716776",
"0.5659882",
"0.5650109",
"0.56455165",
"0.5618156",
"0.56046224",
"0.5590966",
"0.55878466",
"0.5573191",
"0.55503625",
"0.55425304",
"0.5534... | 0.6567688 | 0 |
Returns only dogs that match the breed exactly | function filterByBreed(dogs, breed) {
return dogs.filter(function(dog) {
return dog.breed === breed;
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function gooseFilter(birds){\n const geese = ['African', 'Roman Tufted', 'Toulouse', 'Pilgrim', 'Steinbacher'];\n return birds.filter(bird => !geese.includes(bird));\n}",
"function fDogs(selected_species) {\n return selected_species.species == \"dog\"\n}",
"function onlyDrama(movies){\n return movies.f... | [
"0.6019023",
"0.5976843",
"0.59504163",
"0.5857991",
"0.5854265",
"0.5829342",
"0.58144844",
"0.5748318",
"0.56847286",
"0.5640317",
"0.5613768",
"0.5601369",
"0.5573348",
"0.5565394",
"0.5549305",
"0.5539864",
"0.5471456",
"0.54704934",
"0.54672444",
"0.54671884",
"0.5464394... | 0.74894947 | 0 |
Returns only dogs that are included in the selected dog sizes | function filterBySize(dogs, sizes) {
return dogs.filter(function(dog) {
return sizes.includes(dog.size);
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function filter(dogs, inputs) {\n if (inputs.name) {\n dogs = filterByName(dogs, inputs.name);\n }\n if (inputs.breed) {\n dogs = filterByBreed(dogs, inputs.breed);\n }\n if (inputs.sizes && inputs.sizes.length > 0) {\n dogs = filterBySize(dogs, inputs.sizes);\n }\n return dogs;\n}",
"function fD... | [
"0.6484849",
"0.55410784",
"0.5519137",
"0.55004203",
"0.5353505",
"0.53114176",
"0.5301908",
"0.5297326",
"0.52909994",
"0.52301896",
"0.523016",
"0.5223799",
"0.51765054",
"0.50672436",
"0.49874812",
"0.4961645",
"0.4942444",
"0.48781925",
"0.4832489",
"0.48246303",
"0.4807... | 0.8293143 | 0 |
Show calctulated car price | function showCarPrice(price) {
$(modelPrice).empty().text(price + '$');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayPrice(){\r\n\tdocument.getElementById(\"cost\").innerText = \"$\" + (cost + size_cost + glazing_cost).toFixed(2);\r\n}",
"function calcPrice(){\n var price = doorPrice + handlePrice;\n document.getElementById('price').innerHTML = \"\";\n document.getElementById('price').innerHTML = \"Prezzo: \... | [
"0.7187774",
"0.6948575",
"0.6907733",
"0.68868595",
"0.68632525",
"0.6844997",
"0.6727364",
"0.6718678",
"0.66953075",
"0.66783535",
"0.6627213",
"0.6595778",
"0.6594391",
"0.6583834",
"0.65674424",
"0.6555324",
"0.6554547",
"0.6553843",
"0.6550379",
"0.65397143",
"0.6528668... | 0.7564609 | 0 |
This plugin takes lake data from the special TopoJSON we're loading and draws them on the map. | function lakes(options) {
options = options || {};
var lakes = null;
return function(planet) {
planet.onInit(function() {
// We can access the data loaded from the TopoJSON plugin
// on its namespace on `planet.plugins`. We're loading a custom
// TopoJSON file wi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lakes(options) {\n\t options = options || {};\n\t var lakes = null;\n\t\n\t return function(planet) {\n\t planet.onInit(function() {\n\t // We can access the data loaded from the TopoJSON plugin\n\t // on its namespace on `planet.plugins`. We're loading a custom\n\t // T... | [
"0.64040565",
"0.6390578",
"0.6311872",
"0.6278037",
"0.6254612",
"0.6191077",
"0.6155553",
"0.61390954",
"0.6113944",
"0.6065498",
"0.6058482",
"0.6048828",
"0.6002596",
"0.59925497",
"0.59917957",
"0.598388",
"0.59825766",
"0.5957769",
"0.5957241",
"0.5940285",
"0.59372556"... | 0.64078116 | 0 |
This resizes the blanket to fit the height of the page because there is not height=100% attribute. This also centers the popUp vertically. | function blanket_size(popUpDivVar){
if(typeof window.innerWidth!='undefined'){
viewportheight=window.innerHeight;
}
else{
viewportheight=document.documentElement.clientHeight;
}
if((viewportheight>document.body.parentNode.scrollHeight)&&(viewportheight>document.body.parentNode.clientHeight)){
blanket_height=... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function autoResize() {\n var h = $(window).height() - 120;\n if (hasFooter) h -= 90;\n if (h < 400) h = 400;\n popup.height(h);\n popup.trigger('aweresize');\n }",
"function setPopupMaxHeight() {\n $(modalPopupContent).css('max-height', ($(body).h... | [
"0.66757894",
"0.65208757",
"0.63072705",
"0.6275321",
"0.6264929",
"0.6264929",
"0.62403154",
"0.62109715",
"0.6169411",
"0.61307764",
"0.61140543",
"0.60465795",
"0.6003051",
"0.59819645",
"0.5977626",
"0.5962041",
"0.5881093",
"0.5871994",
"0.5851368",
"0.58437186",
"0.583... | 0.69576627 | 0 |
Console log any uncaught errors and return a 500 error | function errorHandler(error, req, res, next) {
console.log("\n" + JSON.stringify(error, null, 2) + "\n");
res.status(500).end();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"exceptionHandler() {\n this.server.use(async (err, req, res, _next) => {\n if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') {\n const errors = await new Youch(err, req).toJSON();\n return res.status(500).json(errors);\n }\n\n return res.status(500).json... | [
"0.66826737",
"0.6674529",
"0.6674529",
"0.66566586",
"0.66491514",
"0.6634539",
"0.6609027",
"0.66086215",
"0.6593812",
"0.65918833",
"0.65782785",
"0.6575421",
"0.65572834",
"0.6555865",
"0.6552396",
"0.65217906",
"0.64840674",
"0.6483882",
"0.6478902",
"0.6451221",
"0.6450... | 0.66880614 | 0 |
Convert a day shorthand to the full name | function getDayName(day) {
switch (day) {
case "mon":
return "Monday";
case "tue":
return "Tuesday";
case "wed":
return "Wednesday";
case "thu":
return "Thursday";
case "fri":
return "Friday";
case "sat":
return "Saturday";
case "sun":
return "Sund... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_day_name(day) {\n switch (day) {\n case 0:\n return \"ѕн\";\n case 1:\n return \"¬т\";\n case 2:\n return \"—р\";\n case 3:\n return \"„т\";\n case 4:\n return \"ѕт\";\n case 5:\n return \"—б\";\n case 6:\n return \"¬с\";\n\n ... | [
"0.73955697",
"0.7046606",
"0.702821",
"0.6944925",
"0.6942296",
"0.6846222",
"0.67730534",
"0.6684676",
"0.66161096",
"0.6579167",
"0.6551712",
"0.6547645",
"0.64998364",
"0.64977765",
"0.6379533",
"0.63597834",
"0.6348753",
"0.63403744",
"0.631655",
"0.62867796",
"0.6242216... | 0.738814 | 1 |
Insert imageUrl to markdown file | function insertImageUrl(uri, imageUrl) {
const sourceUri = vscode.Uri.parse(uri);
vscode.window.visibleTextEditors
.filter((editor) => preview_content_provider_1.isMarkdownFile(editor.document) &&
editor.document.uri.fsPath === sourceUri.fsPath)
.forEach((editor) => {... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function markdownReplaceImageURL (md, prefix) {\n let mdMod = md.replace(/\\!\\[[a-zA-Z0-9 ]*\\]\\(\\s*(\\S*)\\s*\\)/gm, function(correspondance, p1){\n if (p1.startsWith('http')) {\n return correspondance\n } else {\n return correspondance.replace(p1, pathJoin([prefix, p1]))\n }\n });\n retu... | [
"0.68855274",
"0.63933325",
"0.6258238",
"0.6179141",
"0.6099886",
"0.6023173",
"0.6010743",
"0.5999033",
"0.59867644",
"0.596878",
"0.5950638",
"0.59488547",
"0.5932189",
"0.5922752",
"0.59114945",
"0.5863421",
"0.57739586",
"0.57591665",
"0.57256883",
"0.57233",
"0.57179755... | 0.7792185 | 0 |
Get the topmost visible range of `editor`. Returns a fractional line number based the visible character within the line. Floor to get real line number | function getTopVisibleLine(editor) {
if (!editor["visibleRanges"].length) {
return undefined;
}
const firstVisiblePosition = editor["visibleRanges"][0].start;
const lineNumber = firstVisiblePosition.line;
const line = editor.document.lineAt(lineNumber);
const progress = firstVisiblePosit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getVisibleLine(editor) {\n if (!editor.visibleRanges.length) {\n return undefined;\n }\n const firstVisiblePosition = editor.visibleRanges[0].start;\n const lineNumber = firstVisiblePosition.line;\n const line = editor.document.lineAt(lineNumber);\n const progress = firstVisiblePo... | [
"0.8047043",
"0.7824864",
"0.6870879",
"0.6537144",
"0.65344673",
"0.63819563",
"0.6225287",
"0.6216907",
"0.6168492",
"0.61107486",
"0.60311925",
"0.58719045",
"0.58719045",
"0.58719045",
"0.58719045",
"0.58719045",
"0.58719045",
"0.58719045",
"0.58719045",
"0.58719045",
"0.... | 0.8464181 | 0 |
Get the bottommost visible range of `editor`. Returns a fractional line number based the visible character within the line. Floor to get real line number | function getBottomVisibleLine(editor) {
if (!editor["visibleRanges"].length) {
return undefined;
}
const firstVisiblePosition = editor["visibleRanges"][0].end;
const lineNumber = firstVisiblePosition.line;
let text = "";
if (lineNumber < editor.document.lineCount) {
text = editor... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTopVisibleLine(editor) {\n if (!editor[\"visibleRanges\"].length) {\n return undefined;\n }\n const firstVisiblePosition = editor[\"visibleRanges\"][0].start;\n const lineNumber = firstVisiblePosition.line;\n const line = editor.document.lineAt(lineNumber);\n const progress = f... | [
"0.77540386",
"0.7541392",
"0.6650702",
"0.6616165",
"0.65909344",
"0.6335403",
"0.6110543",
"0.60798913",
"0.592969",
"0.5913406",
"0.5821295",
"0.5821295",
"0.5821295",
"0.5821295",
"0.5821295",
"0.5821295",
"0.5821295",
"0.5821295",
"0.5821295",
"0.5821295",
"0.5821295",
... | 0.8385597 | 0 |
server.listen(pipe) creates a new pipe wrap, so server.close() doesn't actually unlink this existing pipe. It needs to be unlinked separately via handle.close() | function closePipeServer(handle) {
return common.mustCall(function() {
this.close();
handle.close();
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"closeServer() {\n if (!!this.server) {\n this.server.close();\n }\n }",
"function endConnection() {\n\t\tsocket.unpipe();\n\t\tserverSocket.unpipe();\n\t\tsocket.end();\n\t\tserverSocket.end();\n\t}",
"_killServer(callback) {\n // Destroy all open sockets\n for (var socketId in this._sockets)... | [
"0.5974828",
"0.5912525",
"0.58015645",
"0.5787746",
"0.57842267",
"0.57499593",
"0.5748326",
"0.5730429",
"0.57298464",
"0.5723317",
"0.5723317",
"0.5723317",
"0.5721548",
"0.5721548",
"0.5721548",
"0.5721548",
"0.5721548",
"0.5721548",
"0.5721548",
"0.5721548",
"0.5721548",... | 0.71555525 | 0 |
Set the width of the side navigation to 250px and the left margin of the page content to 250px and add a black background color to body | function openNav() {
document.getElementById("mySideBar").style.width = "250px";
document.getElementById("main").style.marginLeft = "250px";
document.getElementById("main").style.width = "83%";
document.body.style.backgroundColor = "rgba(0,0,0,0.4)";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n }",
"function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"250... | [
"0.6467901",
"0.64344347",
"0.64197123",
"0.6400105",
"0.6400105",
"0.6362734",
"0.6362734",
"0.6362734",
"0.6340359",
"0.6322647",
"0.6274176",
"0.6102225",
"0.6093096",
"0.60584486",
"0.60584486",
"0.60437936",
"0.60437936",
"0.60370016",
"0.5982772",
"0.5978939",
"0.597201... | 0.6563949 | 0 |
positive modulo for outofbounds array access | function modulo(arr, index) {
return (arr.length + (index % arr.length)) % arr.length;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_mod(val) {\r\n if (this.pillar === false) return val\r\n return (val + this.largezero) % this.grid.length\r\n }",
"_mod(val) {\n if (this.pillar === false) return val\n return (val + this.largezero) % this.width\n }",
"function evansMod(i, mod) {\n while (i < 0) {\n i += mod;\n }\n ... | [
"0.67774326",
"0.65961987",
"0.6526993",
"0.64628106",
"0.6273249",
"0.6273249",
"0.6273249",
"0.6273249",
"0.6273249",
"0.6273249",
"0.6273249",
"0.6273249",
"0.6273249",
"0.62558407",
"0.6192013",
"0.61744505",
"0.5914202",
"0.5910607",
"0.58757424",
"0.58575726",
"0.584661... | 0.7100841 | 0 |
Function gets the movie information | function getMovieInfo(args){
console.log("Getting info for movie "+movie_id);
var req = new XMLHttpRequest();
req.open("GET", request_path+"/movies/"+movie_id, true);
req.onload = function() {
var response = JSON.parse(req.response);
args[0].setText(response["title"]);
args[2].setImage(args[3]+response["img"]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getmovieTitleInfo() {\n var movie = indicator[3];\n if (!movie) {\n console.log(\"You didn't enter a movie. So here is Mr. Nobody, better than nothing right?\");\n movie = \"mr nobody\";\n }\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=40e9c... | [
"0.76905596",
"0.74595827",
"0.7442448",
"0.74126834",
"0.7398734",
"0.73495376",
"0.7347973",
"0.7321103",
"0.730877",
"0.7308059",
"0.729426",
"0.7276822",
"0.7269765",
"0.7222126",
"0.71885026",
"0.7155367",
"0.71488017",
"0.71385187",
"0.7136701",
"0.70962274",
"0.7061909... | 0.7605141 | 1 |
compoundInterest p is the principal (how much you are borrowing) r is the interest rate n is how many times per year you are adding interest t is how many years you are paying it off in Example: compoundInterest(30000, 0.08, 12, 4) Loan of 30k, 8% interest, 12 times a year, over 4 years | function compoundInterest (p, r, n, t) {
return p * Math.pow(1 + (r/n) , n*t);
// Math.pow(2, 8);
// 2 ** 8
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function compoundInterest(principle, interest_rate, time) {\n interest = principle * ((1 + interest_rate/100) * time);\n return interest\n}",
"function computeCompoundInterest( principal, interestRate, frequency, timeInYears ) {\n return principal * (Math.pow( 1 + interestRate / frequency, frequency * tim... | [
"0.786775",
"0.7559858",
"0.7206405",
"0.6932793",
"0.692635",
"0.685467",
"0.6839577",
"0.67644835",
"0.6745944",
"0.65658104",
"0.6334478",
"0.62171453",
"0.6196766",
"0.61839205",
"0.59828156",
"0.5972659",
"0.59681845",
"0.59538174",
"0.59259236",
"0.59230155",
"0.5902051... | 0.8124679 | 0 |
This function shows the form for adding a new lead | function addNewLead() {
$('#LeadDetails').hide();
$('#AddLead').fadeIn(500, null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showAddCommitmentForm() {\n vm.form.data = {\n category: null,\n question: null,\n name: null,\n description: null,\n status: null,\n dueDate: null\n };\n vm.form.title = \"Add Commit... | [
"0.6375686",
"0.6279301",
"0.6181734",
"0.61438817",
"0.6109383",
"0.6089658",
"0.60577124",
"0.60405135",
"0.60298336",
"0.5978685",
"0.5934301",
"0.59329695",
"0.5858318",
"0.58579856",
"0.5845238",
"0.5805184",
"0.5765164",
"0.57591796",
"0.57426214",
"0.5735533",
"0.57210... | 0.6595563 | 0 |
This function cancels the creation of a lead | function cancelNewLead() {
clearNewLeadForm();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cancelEditLead() {\n clearEditLeadForm();\n}",
"function Cancellation() { }",
"function cancelout() {\n setAddResponse(null);\n setchosenmed(null);\n setExistingPrescription(null);\n }",
"function onLeavingChallengesAdvertising() {\n $timeout.cancel(updaterHndl);\n }",
"func... | [
"0.6329806",
"0.62861603",
"0.6128394",
"0.60012776",
"0.5954276",
"0.59452295",
"0.5927591",
"0.5927563",
"0.5926853",
"0.5917221",
"0.58609056",
"0.58424795",
"0.5825814",
"0.5819498",
"0.58065873",
"0.57984406",
"0.57947487",
"0.5792172",
"0.5782675",
"0.576391",
"0.576343... | 0.70813686 | 0 |
This function cancels the editing of an existing lead's details | function cancelEditLead() {
clearEditLeadForm();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cancelNewLead() {\n clearNewLeadForm();\n}",
"function editCancelFunc(){\n setEdit(null);\n }",
"function cancelEditCard() {\n // 8-1 Set isEditing flag to update the view.\n this.isEditing = false\n\n // 8-2 Reset the id we want to edit.\n this.idToEdit = false\n\n // 8-3 ... | [
"0.7663377",
"0.7083451",
"0.7054394",
"0.70182973",
"0.6912614",
"0.68968034",
"0.6835991",
"0.6817441",
"0.6726299",
"0.67232335",
"0.6703917",
"0.6696722",
"0.6666923",
"0.65891993",
"0.65277267",
"0.65143514",
"0.6509518",
"0.6507401",
"0.6486365",
"0.64838725",
"0.648320... | 0.8118909 | 0 |
This function clears the inputs on the edit form for a lead | function clearEditLeadForm() {
var errArea = document.getElementById("errAllLeads");
// Remove all nodes from the error <DIV> so we have a clean space to write to in future operations
while (errArea.hasChildNodes()) {
errArea.removeChild(errArea.lastChild);
}
$('#LeadDetails').fadeOut(500, f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"clearForm() {\n // clear any previous highlighted row\n this.clearPrevHighlight();\n // clear the inputs\n $(\"#item_id\").val(0);\n $(\"#item_title\").val(\"\");\n $(\"#item_author_first_name\").val(\"\");\n $(\"#item_author_surname\").val(\"\");\n $(\"#item... | [
"0.74399716",
"0.7424539",
"0.74009085",
"0.7383851",
"0.7381192",
"0.73458815",
"0.73298216",
"0.7329398",
"0.732509",
"0.7303051",
"0.73019385",
"0.7297206",
"0.72956127",
"0.72940284",
"0.7262547",
"0.7261831",
"0.72553796",
"0.7248012",
"0.7248012",
"0.72376484",
"0.72343... | 0.743387 | 1 |
This function converts a lead into opportunity and shows opportunity | function convertToOpp(itemID) {
hideAllPanels();
clearEditLeadForm();
currentItem.set_item("_Status", "Opportunity");
currentItem.update();
context.load(currentItem);
context.executeQueryAsync(function () {
clearNewLeadForm();
showOpps();
}, function (sender, args) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Opportunity(obj) {\n\tthis.extractedInfo = obj;\n}",
"function handleLeadCompanyIntent(intent, session, response) {\n var sqsParam;\n var names = session.attributes.name.split(' ');\n var query = \"Select Name, Id from Account where Name like '\" + intent.slots.Company.value + \"'\";\n\n console.log... | [
"0.58595735",
"0.50108016",
"0.48255992",
"0.4747155",
"0.47273692",
"0.47123143",
"0.471151",
"0.46539143",
"0.46386236",
"0.46251595",
"0.45892575",
"0.45809624",
"0.45274416",
"0.45132077",
"0.4502267",
"0.44973874",
"0.44965854",
"0.44862333",
"0.4479352",
"0.4475481",
"0... | 0.50619364 | 1 |
This function converts an opportunity into sale and shows sales | function convertToSale(itemID) {
$('#AllOpps').hide();
$('#OppDetails').hide();
clearEditOppForm();
currentItem.set_item("_Status", "Sale");
currentItem.update();
context.load(currentItem);
context.executeQueryAsync(function () {
clearEditOppForm();
showSales();
}
,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"populateSale(sale) {\n $.each(sale, (key, sala) => {\n $(\".saleTbody\").append('<tr class= \"saleTr\"><td class=\"nomeSala\">' + sala.Nome + '</td><td class=\"nomeEdificio\">' + sala.NomeEdificio + '</td><td class=\"stato\">' + sala.Stato + '</td></tr>');\n $(\".saleTbody\... | [
"0.54950756",
"0.5442647",
"0.5410122",
"0.5312123",
"0.53018874",
"0.5220079",
"0.5210371",
"0.5195265",
"0.5180969",
"0.5145649",
"0.5078532",
"0.50449085",
"0.50380903",
"0.5019473",
"0.49916834",
"0.49908888",
"0.49891898",
"0.49330318",
"0.49132553",
"0.49101803",
"0.486... | 0.5755146 | 0 |
This function cancels the editing of an existing opportunity's details | function cancelEditOpp() {
clearEditOppForm();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cancelEditLead() {\n clearEditLeadForm();\n}",
"cancelEdit () {\n this.editCache = null\n this.editingTrip = null\n this.editType = null\n }",
"function cancelEdit(e){\n e.preventDefault();\n \n Session.set('editingPost', null);\n}",
"function editCancelFunc(){\n setEdit(null)... | [
"0.75310826",
"0.7472145",
"0.72921914",
"0.72144395",
"0.71878",
"0.7137927",
"0.7091826",
"0.703644",
"0.70224464",
"0.70043117",
"0.6931523",
"0.6899447",
"0.6882118",
"0.6872421",
"0.6871263",
"0.6869518",
"0.6857791",
"0.68068117",
"0.67740315",
"0.676982",
"0.6731836",
... | 0.7528529 | 1 |
This function deletes an attachment from a Prospects list opportunity item and then refreshed the Prospects form | function deleteOppAttachment(url, itemID) {
var attachment = web.getFileByServerRelativeUrl(url);
attachment.deleteObject();
showOppDetails(itemID);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showOppDetails(itemID) {\n var errArea = document.getElementById(\"errAllOpps\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n\n $('#AddOpp').hide();\n $('#OppDet... | [
"0.6036632",
"0.5950442",
"0.59453875",
"0.58625627",
"0.5824961",
"0.5787567",
"0.5787567",
"0.57353246",
"0.56986034",
"0.56957966",
"0.56613743",
"0.5640394",
"0.56151897",
"0.55989826",
"0.5576555",
"0.55622935",
"0.55592227",
"0.55398905",
"0.5533175",
"0.5530458",
"0.55... | 0.6974799 | 0 |
This function runs when a file is successfully loaded and read by the PO file input. It references SP.RequestExecutor.js which will upload the file as an attachment by using the REST API. NOTE: This is safer and more capabale (in terms of file size) than using JSOM file creation for uploading files as attachments. | function oppFileOnload(event) {
contents = event.target.result;
// The storePOAsAttachment function is called to do the actual work after we have a reference to SP.RequestExecutor.js
$.getScript(web.get_url() + "/_layouts/15/SP.RequestExecutor.js", storeOppAsAttachment);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function uploadAttachment()\n {\n if (Office.context.mailbox.item.attachments == undefined)\n {\n app.showNotification(\"Sorry attachments are not supported by your Exchange server.\");\n }\n else if (Office.context.mailbox.item.attachments.length == 0)\n {\n ... | [
"0.6802467",
"0.64451814",
"0.6315319",
"0.62748504",
"0.6202645",
"0.6177801",
"0.61405754",
"0.6117803",
"0.6061337",
"0.60337394",
"0.6030239",
"0.6023879",
"0.59792835",
"0.5921451",
"0.5910848",
"0.58695996",
"0.585191",
"0.585032",
"0.5832177",
"0.58171964",
"0.5787905"... | 0.7078655 | 0 |
This function runs after we are sure we have a reference to SP.RequestExecutor.js. It uses the REST API to upload the file as an attachment | function storeOppAsAttachment() {
var fileContents = fixBuffer(contents);
var createitem = new SP.RequestExecutor(web.get_url());
createitem.executeAsync({
url: web.get_url() + "/_api/web/lists/GetByTitle('Prospects')/items(" + currentItem.get_id() + ")/AttachmentFiles/add(FileName='" + file.name + ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function uploadAttachment()\n {\n if (Office.context.mailbox.item.attachments == undefined)\n {\n app.showNotification(\"Sorry attachments are not supported by your Exchange server.\");\n }\n else if (Office.context.mailbox.item.attachments.length == 0)\n {\n ... | [
"0.72109455",
"0.68065494",
"0.6431627",
"0.64285105",
"0.6408927",
"0.6329918",
"0.6251092",
"0.6233021",
"0.62218744",
"0.62139416",
"0.61401397",
"0.6127133",
"0.6110041",
"0.6096919",
"0.60918397",
"0.60884875",
"0.6083382",
"0.6028441",
"0.6026446",
"0.60027665",
"0.6002... | 0.6841957 | 1 |
This function shows customer count and total deal amount in pipeline on mouseover | function showSaleAmount(saleAmount) {
var saleAmtLabel = document.createElement("DIV");
saleAmtLabel.className = "chartBarLabel";
saleAmtLabel.appendChild(document.createTextNode("$" + saleAmount.toLocaleString()));
var getdiv = document.getElementById("hoverSale");
getdiv.innerText = "";
$('#ho... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showSaleCount(saleCount) {\n //$('#pipeSale').mouseenter(function () {\n var getDiv = document.getElementById(\"hoverSale\");\n getDiv.innerText = saleCount;\n\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonCountLabel = document.createElemen... | [
"0.65691406",
"0.5912847",
"0.5752698",
"0.57207483",
"0.5499622",
"0.5450888",
"0.5372179",
"0.5365616",
"0.5365435",
"0.53644097",
"0.53138584",
"0.53135705",
"0.53110814",
"0.5297435",
"0.5279137",
"0.5278823",
"0.5276103",
"0.5268961",
"0.52617824",
"0.5257476",
"0.523853... | 0.59686136 | 1 |
This function shows lead count and total deal amount in pipeline on mouseover | function showLeadCount(leadCount) {
var getDiv = document.getElementById("hoverLead");
getDiv.innerText = leadCount;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showSaleCount(saleCount) {\n //$('#pipeSale').mouseenter(function () {\n var getDiv = document.getElementById(\"hoverSale\");\n getDiv.innerText = saleCount;\n\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonCountLabel = document.createElemen... | [
"0.67282546",
"0.6231987",
"0.58398664",
"0.5573118",
"0.5561016",
"0.5490889",
"0.5467163",
"0.537842",
"0.5371907",
"0.53241843",
"0.5315588",
"0.5302775",
"0.52802175",
"0.52729136",
"0.5270246",
"0.5262978",
"0.5258699",
"0.5251025",
"0.5248389",
"0.52119786",
"0.51939577... | 0.67143846 | 1 |
This function shows customer count and total deal amount in pipeline on mouseover | function showSaleCount(saleCount) {
//$('#pipeSale').mouseenter(function () {
var getDiv = document.getElementById("hoverSale");
getDiv.innerText = saleCount;
var getwondiv = document.getElementById("wonOpp");
getwondiv.innerText = "";
var wonCountLabel = document.createElement("DIV");
wonC... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showSaleAmount(saleAmount) {\n var saleAmtLabel = document.createElement(\"DIV\");\n saleAmtLabel.className = \"chartBarLabel\";\n saleAmtLabel.appendChild(document.createTextNode(\"$\" + saleAmount.toLocaleString()));\n var getdiv = document.getElementById(\"hoverSale\");\n getdiv.innerTex... | [
"0.59686136",
"0.5912847",
"0.5752698",
"0.57207483",
"0.5499622",
"0.5450888",
"0.5372179",
"0.5365616",
"0.5365435",
"0.53644097",
"0.53138584",
"0.53135705",
"0.53110814",
"0.5297435",
"0.5279137",
"0.5278823",
"0.5276103",
"0.5268961",
"0.52617824",
"0.5257476",
"0.523853... | 0.65691406 | 0 |
This function gets count for leads, opportunities, sales and lost opportunities | function getCount() {
$("#wonLostDrillDown").hide();
$("#pipeDrillDown").hide();
$("#drillTable").hide();
var leadCount = 0;
var oppCount = 0;
var saleCount = 0;
var lostSaleCount = 0;
var allCount = 0;
list = web.get_lists().getByTitle('Prospects');
var camlQuery = SP.CamlQuery... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getBookedCountHelper(dbBookings){\n var count = 0;\n for(booking in dbBookings){\n count = count + dbBookings[booking].target_count;\n }\n console.log(\" Total Seats Booked in the Current Flight are - \" + count);\n return count;\n}",
"bookingCount() {\n ... | [
"0.6353665",
"0.6037318",
"0.5961234",
"0.5839468",
"0.58316606",
"0.58018774",
"0.57679766",
"0.57649976",
"0.57395744",
"0.5724641",
"0.5723641",
"0.5709042",
"0.57036096",
"0.5703531",
"0.570331",
"0.5692324",
"0.5681472",
"0.5676365",
"0.5651066",
"0.56458837",
"0.564185"... | 0.6273857 | 1 |
Provides a convenient interface for setting various properties of the response. var res = new Response(body, headers, status); res.addHeader("ContentLength", "123"); res.setCookie("cookieName", "cookieValue"); res.send(callback); | function Response(body, headers, status) {
if (!(this instanceof Response)) {
return new Response(body, headers, status);
}
this.body = body || "";
this.headers = headers || {};
this.status = status || 200;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function WrappedResponse(msg, hdr, err, res) {\n this._msg = msg;\n this.headers = hdr;\n this.error = err;\n this.response = res;\n}",
"function Response(data, status, message, headers) {\n this.data = data;\n this.status = status;\n this.message = message;\n this.headers = heade... | [
"0.6615167",
"0.6127869",
"0.60756445",
"0.5953511",
"0.59493005",
"0.59493005",
"0.59493005",
"0.59493005",
"0.59493005",
"0.59493005",
"0.59493005",
"0.59493005",
"0.59493005",
"0.59493005",
"0.59493005",
"0.592608",
"0.5924264",
"0.5869885",
"0.5849092",
"0.5849092",
"0.58... | 0.6342254 | 1 |
Converts the name of a state to dot notation, of the form `grandfather.father.state`. | function fixStateName(state){
if(state.parent){
state.name = state.parent.name + '.' + state.name;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fixStateName(state){\n if(state.parent){\n state.name = (angular.isObject(state.parent) ? state.parent.name : state.parent) + '.' + state.name;\n }\n }",
"function getFullStateName(state) {\n return stateList[state];\n}",
"updateName(state, name) {\r\n ... | [
"0.70765984",
"0.6855546",
"0.5746515",
"0.56585073",
"0.5525749",
"0.5481702",
"0.5444082",
"0.54076886",
"0.5375729",
"0.5345656",
"0.53373456",
"0.532961",
"0.53277326",
"0.5324446",
"0.5323014",
"0.5311441",
"0.5307792",
"0.5288286",
"0.528703",
"0.528703",
"0.528703",
... | 0.7088336 | 0 |
immediately downloads the log for desktop browser use | downloadLog () {
let logFile = this.getLog();
let blob = new Blob([logFile], { type: 'data:text/plain;charset=utf-8' });
let a = document.createElement('a');
a.href = window.URL.createObjectURL(blob);
a.target = '_blank';
a.download = this.logFilename;
document.body.appendChild(a);
a.click();
document... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function adbpAppDownload() {\n\ttry { \n\t\ttrackMetrics({ \n\t\t\ttype: \"app-download\", \n\t\t\tdata: {}\n\t\t}); \n\t} catch(e){}\n}",
"function trace_download(){\n var tmp_date = new Date();\n trace_data[row_event] = {\"event\": \"Downloadfile\", \"time\" : tmp_date , 'status' : 0, \"row\" :row_event... | [
"0.6257486",
"0.604706",
"0.59352016",
"0.5913081",
"0.5906313",
"0.5832505",
"0.5745984",
"0.5723918",
"0.5710887",
"0.5694815",
"0.5693706",
"0.56931716",
"0.56757545",
"0.5644202",
"0.5625792",
"0.5624406",
"0.56177807",
"0.5617651",
"0.5604897",
"0.5597823",
"0.5560689",
... | 0.688398 | 0 |
format type accordingly, recursively if necessary | formatType (type, obj) {
if (this.maxDepth && this.depth >= this.maxDepth) {
return '... (max-depth reached)';
}
switch (type) {
case 'Object':
this.currentResult += '{\n';
this.depth++;
this.parentSizes.push(this.objectSize(obj));
let i = 0;
for (let prop in obj) {
this.currentRes... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function TypeRecursion() {}",
"function formatAST(node)\n\t\t{\n\t\t\tif(!Array.isArray(node))\n\t\t\t{\n\t\t\t\t// Flatten enum values (object singletons with capital first letter key)\n\t\t\t\tif(node && typeof node === 'object')\n\t\t\t\t{\n\t\t\t\t\tlet keys = Object.keys(node);\n\t\t\t\t\tfor(let key of key... | [
"0.6658474",
"0.61896676",
"0.61093944",
"0.6031969",
"0.58314586",
"0.58290327",
"0.57272047",
"0.5693663",
"0.5693663",
"0.568391",
"0.56613797",
"0.56515086",
"0.5578369",
"0.5564591",
"0.5551576",
"0.55390054",
"0.5527136",
"0.55130357",
"0.54699343",
"0.53992844",
"0.536... | 0.7071818 | 0 |
Setter function for when we would like to set the value of a specific config property | setConfigProperty(property, value) {
if (property !== undefined && value !== undefined) {
config[property] = value;
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set property(){}",
"setConfig(name, value) {\n return this.call('config.set', name, JSON.stringify(value));\n }",
"setValue(k, v) {\n this._config[k] = v;\n }",
"set propertyPath(value) {}",
"static set property(){}",
"function setConfigProperty(appId, k, v, cb) { \n fhreq.POST(fhreq.getFeedHen... | [
"0.71205205",
"0.6764993",
"0.6707643",
"0.67037374",
"0.66782933",
"0.6672942",
"0.66272545",
"0.6554702",
"0.6492997",
"0.6492997",
"0.6492997",
"0.6486302",
"0.6472467",
"0.6449136",
"0.6274807",
"0.62181973",
"0.6196954",
"0.61845964",
"0.618257",
"0.61564445",
"0.6138137... | 0.7280463 | 0 |
Parse url to get the commit info | function parseURL(url) {
/** URL pattern in GitHub
* new: <SERVER>/<user>/<repo>/new/<branch>/<fpath>
* edit: <SERVER>/<user>/<repo>/edit/<branch>/<fpath>
* delete: <SERVER>/<user>/<repo>/delete/<branch>/<fpath>
* upload: <SERVER>/<user>/<repo>/upload/<branch>/<fpath>
* merge: <SERVER>/<us... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseRepoUrl(url) {\n if (typeof url !== \"string\" || url.length === 0)\n throw new Error(\"type error\");\n var parsedUrl = new URL(url, \"https://github.com\");\n var pathParts = parsedUrl.pathname.split(\"/\");\n if (pathParts.length < 2) {\n throw new Error(\"invalid url for... | [
"0.64453197",
"0.62801296",
"0.62801296",
"0.62520015",
"0.62301695",
"0.614121",
"0.6030471",
"0.587388",
"0.57519704",
"0.57380277",
"0.56607854",
"0.56296074",
"0.56183076",
"0.5568466",
"0.5568053",
"0.5559336",
"0.5557547",
"0.5552939",
"0.55429757",
"0.55378956",
"0.553... | 0.700642 | 0 |
Compare old/new parent dirs | function compareParentDirs(commitType, oldParentDir, newParentDir) {
var newdirs = [];
var moved= false;
let strcomp = findFirstDiffPos(oldParentDir, newParentDir);
if (strcomp > -1) {
// 1) Find new dirs
newdirs = findNewDirs({
commitType,
newParentDir,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findNewDirs({\n commitType,\n newParentDir,\n oldParentDir\n}) {\n // No newdir is created through delete/upload operation\n if ((commitType == REQ_DELETE) || (commitType == REQ_UPLOAD))\n return [];\n\n // newdirs are differences between old and new parent dirs\n let diff = tr... | [
"0.6994195",
"0.5847482",
"0.5769421",
"0.5769421",
"0.56387126",
"0.55443853",
"0.55443853",
"0.544481",
"0.5370552",
"0.5370552",
"0.5370552",
"0.53078747",
"0.528978",
"0.5285065",
"0.5248552",
"0.52026755",
"0.51826566",
"0.50803614",
"0.5061674",
"0.5061674",
"0.50591147... | 0.7508493 | 0 |
Check for new dirs | function findNewDirs({
commitType,
newParentDir,
oldParentDir
}) {
// No newdir is created through delete/upload operation
if ((commitType == REQ_DELETE) || (commitType == REQ_UPLOAD))
return [];
// newdirs are differences between old and new parent dirs
let diff = trimSlash(newPare... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DirExists() {\r\n}",
"function checkFolders() {\n const courseDataPath = './courseData';\n const htmlFilesPath = './htmlFiles';\n\n if (!fs.existsSync(courseDataPath))\n fs.mkdirSync(courseDataPath);\n\n if (!fs.existsSync(htmlFilesPath))\n fs.mkdirSync(htmlFilesPath);\n}",
"... | [
"0.6638074",
"0.6446226",
"0.634031",
"0.6287058",
"0.6284702",
"0.61129266",
"0.60786414",
"0.6048487",
"0.60336006",
"0.59690225",
"0.59520257",
"0.5942961",
"0.593846",
"0.5936863",
"0.5901121",
"0.587664",
"0.5827537",
"0.58186716",
"0.57468176",
"0.57468176",
"0.57468176... | 0.6508572 | 1 |
FUNCTIONS ////////////////////////////////// Clears existing stream elements from the stream container element. | function ClearStream(ignoreList = []){
let safeElements = 0;
let currentStream = StreamContainer.childNodes[0];
while (currentStream){
if (ignoreList.find(x => {return x == currentStream.id;})){
safeElements++;
} else {
ActiveStreamIds.splice(ActiveStreamIds.indexOf(currentStream.id),1);
StreamContainer... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearIt() {\n var node = document.getElementById(\"stream-search-container\")\n while (node.hasChildNodes()) {\n node.removeChild(node.lastChild);\n}\n}",
"clear() {\n\t\twhile (this.getElement().firstChild) {\n\t\t\tthis.getElement().removeChild(this.getElement().firstChild)\n\t\t}\n\t}",
"clear... | [
"0.7065309",
"0.66154206",
"0.6377074",
"0.63348114",
"0.6326498",
"0.62691",
"0.6255951",
"0.6235731",
"0.6151689",
"0.61502403",
"0.61462283",
"0.6144613",
"0.6144613",
"0.614211",
"0.6140091",
"0.6137852",
"0.61274064",
"0.6124047",
"0.6112751",
"0.608857",
"0.6081578",
... | 0.69378096 | 1 |
Finds the ids in the list that do not match the existing stream info on display. Useful for refresh where only one or two elements on a page might change. | function IdendifyNewStreams(idList){
let result = [];
for (let id of idList){
if (!ActiveStreamIds.find(x => {return x == id;})){
result.push(id);
}
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function IdendifyExistingStreams(idList){\n\tlet result = [];\n\tfor (let id of idList){\n\t\tif (ActiveStreamIds.find(x => {return x == id;})){\n\t\t\tresult.push(id);\n\t\t} \n\t}\n\treturn result;\n}",
"async visibleListingIds(root, args) {\n // Load all the action tags by listing ids.\n // A listin... | [
"0.6963669",
"0.6013948",
"0.5416812",
"0.5414892",
"0.5351551",
"0.5323136",
"0.5312701",
"0.5293633",
"0.52676874",
"0.52622294",
"0.5177941",
"0.5177828",
"0.51615673",
"0.51540774",
"0.5127412",
"0.51161474",
"0.5107851",
"0.5081128",
"0.50799143",
"0.5053775",
"0.5047566... | 0.69087523 | 1 |
Finds the ids in the list that match the existing stream info on display. Useful for refresh where only one or two elements on a page might change. | function IdendifyExistingStreams(idList){
let result = [];
for (let id of idList){
if (ActiveStreamIds.find(x => {return x == id;})){
result.push(id);
}
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function IdendifyNewStreams(idList){\n\tlet result = [];\n\tfor (let id of idList){\n\t\tif (!ActiveStreamIds.find(x => {return x == id;})){\n\t\t\tresult.push(id);\n\t\t}\n\t}\n\treturn result;\n}",
"async getFileStreams () {\n\t\tconst fileStreamIds = this.markers.reduce((streamIds, marker) => {\n\t\t\tif (mar... | [
"0.69908404",
"0.58725196",
"0.5681251",
"0.567016",
"0.56504774",
"0.5545049",
"0.5400865",
"0.5358774",
"0.53583074",
"0.5334763",
"0.5319349",
"0.53045785",
"0.52090186",
"0.51754457",
"0.5139477",
"0.51363707",
"0.5125255",
"0.5111685",
"0.51019835",
"0.5093042",
"0.50782... | 0.7339553 | 0 |
Takes in the array of stream objects and builds out the UI, altering the document. | function BuildStreamUI(streamArray){
/**
* Builds a stream element based on the given stream element and adds it to the container.
*
* @param streamInfo The twitch api representation of a user stream
* @param id The identifier for the document element
*/
function AddStreamElement(streamInfo, id){
Activ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showStreams(streamsArr) {\n console.log(streamsArr);\n \n $streamArea\n .empty();\n\n for (var i = 0; i < streamsArr.length; i++) {\n // build a row with columns of iframes inside\n\n var $stream = $(\"<div>\")\n .addClass(\"col\");\n\n var $title = $(\"<... | [
"0.641517",
"0.5967672",
"0.5833425",
"0.57478637",
"0.55464536",
"0.55242515",
"0.55198145",
"0.54871464",
"0.5466205",
"0.5425338",
"0.54210365",
"0.5396105",
"0.53218806",
"0.52911425",
"0.52859855",
"0.5240859",
"0.52260315",
"0.5225036",
"0.519313",
"0.51902854",
"0.5179... | 0.744683 | 0 |
ctrlFactory is a function that has two arguments. one is named "route" and will be passed the child route the other can be named anything, and will be passed the first match of the path component regex | function itemRoute(ctrlFactory) {
return function(setCurrent, section, itemId) {
var route = this;
if (!itemId) {
throw new Error("No itemId - did you forget to create a regex group for it? " + section);
}
var routeChild = route.child(section);
// curry up the route argument by name
//... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor($route, $routeParams, $location, codenvyAPI, cheNotification) {\n 'ngInject';\n\n let factoryId = $route.current.params.id;\n\n this.factory = codenvyAPI.getFactory().getFactoryById(factoryId);\n\n let promise = codenvyAPI.getFactory().fetchFactory(factoryId);\n\n promise.then((factory) ... | [
"0.55588454",
"0.551359",
"0.55075616",
"0.5432776",
"0.51672363",
"0.51647323",
"0.51647323",
"0.5161971",
"0.51438063",
"0.5127902",
"0.5115674",
"0.50965196",
"0.50965196",
"0.50965196",
"0.50965196",
"0.50965196",
"0.50965196",
"0.5090916",
"0.50398344",
"0.4969988",
"0.4... | 0.715299 | 0 |
On window initial Get schedule by vehicle | function getSchedule() {
$.ajax({
type : "POST",
async : false,
dataType : 'json',
data : {
'vo.vehID' : select_vehicle.getSelectedValue()
},
url : basePath + "monitor/display!getSchedule",
success : function(d) {
if("empty" != d.result) {
$("#sel_schedule option").remov... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"activate(params) {\n return this.getSchedule(params.id);\n }",
"getSchedule() {\n this.setRelativeTime();\n return this.schedule;\n }",
"get schedule() {\n\t\treturn this.__schedule;\n\t}",
"static select(direction, schedule) {\n if (schedule === \"Modified\") {\n return direction === \"No... | [
"0.64787364",
"0.6260717",
"0.6260608",
"0.6189257",
"0.6084678",
"0.60342926",
"0.60287493",
"0.59941506",
"0.59046125",
"0.58724123",
"0.58375823",
"0.5835237",
"0.580924",
"0.57994556",
"0.5751321",
"0.5695915",
"0.5683218",
"0.56717336",
"0.56697214",
"0.56631637",
"0.566... | 0.6538697 | 0 |
Initial the route time slider | function initSlider() {
$( "#slider" ).slider({ //ui slider
min: 0, //min value
max: nop, //max value
value:nop, //init value
step: 1,
range: "min",
animate:true,
slide: function(event, ui) { //slide event
doStop(); //stop the timer
$('#play').button('option', { //change the buttom to pause
la... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function startAutoSwitchView(dspTime,i){\n if(getState(pfad0 + 'Auto_Switch_View').val === true){\n if(dspTime !== ''){\n setState(pfad0 + 'Timer_View_Switch',parseInt(dspTime, 10));\n }\n else{\n setState(pfad0 + 'Timer_View_Switch',15);\n }\n autoSwitch... | [
"0.63333815",
"0.62027454",
"0.6153874",
"0.6126762",
"0.6107432",
"0.60427654",
"0.6042353",
"0.6041803",
"0.6019451",
"0.60017794",
"0.5888636",
"0.5887877",
"0.5879176",
"0.5855965",
"0.5843383",
"0.5830825",
"0.5829191",
"0.5818997",
"0.5811173",
"0.57950276",
"0.57943386... | 0.64647955 | 0 |
Move the slider and draw the route | function moveSlider() {
var newValue = $("#slider").slider("option", "value") + 1;
if(newValue > nop + 1) {
window.clearInterval(timer);
return;
}
$("#slider").slider("option", "value", newValue);
clearRoute(); //delete the route
addRoute(newValue); //redraw the route
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawSlider() {\n fill(270, 10, 100);\n\n rect(sliderX, sliderY, 30, height);\n //move one slider vertically\n moveSliderX();\n\n rect(sliderX2, sliderY2, width, 30);\n //move one slider horizontally\n moveSliderY();\n}",
"function Navigate() {\n source_vector_draw_rdc.clear();\n ... | [
"0.6958709",
"0.6480695",
"0.6475359",
"0.633633",
"0.62785655",
"0.61035067",
"0.60452896",
"0.598944",
"0.5963123",
"0.5945575",
"0.5936033",
"0.59287965",
"0.5922912",
"0.59081143",
"0.590696",
"0.59037393",
"0.58168656",
"0.57599014",
"0.5749802",
"0.5717727",
"0.57065856... | 0.67325264 | 1 |
Get POI data, and draw the markers | function getPOI() {
$.ajax({
type : "POST",
async : false,
dataType : 'json',
url : basePath + "monitor/display!getPOI",
success : function(d) {
if("empty" != d.result) {
for ( var int = 0; int < d.length; int++) {
addPoiMarkers(d[int].longitude, d[int].latitude, d[int].icon, d[int... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawPoi(zoom)\n{\n\tvar canvas = $(\"#map-canvas\")[0];\n\tvar c = canvas.getContext(\"2d\");\n\tvar pos = $(\"#map-content\").position();\n\n\tc.clearRect(0, 0, canvas.clientWidth, canvas.clientHeight);\n\tc.lineWidth = 1.5;\n\n\tfor(var poi of pointsOfInterest)\n\t{\n\t\tif(!$(\"#display-\" + poi.type).... | [
"0.6208215",
"0.6206298",
"0.6181899",
"0.61798495",
"0.61643785",
"0.6062256",
"0.60360014",
"0.58622116",
"0.5859758",
"0.5807414",
"0.5806679",
"0.58036345",
"0.57966304",
"0.5785282",
"0.57462186",
"0.57185924",
"0.57006264",
"0.5671354",
"0.56471103",
"0.5638283",
"0.562... | 0.659934 | 0 |
Add POI markers to map | function addPoiMarkers(x, y, ico, content) {
var point=new OpenLayers.LonLat(x,y).transform(fromProjection, OSM_toProjection);
var size = new OpenLayers.Size(30, 30);
var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
var icon;
var markerPOI = null;
icon = new OpenLayers.Icon(basePath + 'images/'+ico+'_.gif... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addMapMarkers(poisToAdd) {\n _.each(poisToAdd, function(poi) {\n // We use a base64 encoded id as the marker id, since Angular Leaflet does not accept '-' in marker's id.\n bigMap.config.markers[btoa(poi.properties.id)] = {\n layer: 'markers',\n lat : poi.geometry.coo... | [
"0.69528043",
"0.66595936",
"0.65220714",
"0.6357894",
"0.62011564",
"0.6189033",
"0.6189033",
"0.6185431",
"0.6183239",
"0.61791325",
"0.6158879",
"0.6133869",
"0.6124853",
"0.6121335",
"0.61107",
"0.6103673",
"0.60829943",
"0.60799736",
"0.60651416",
"0.60630554",
"0.605367... | 0.70631695 | 0 |
Close the select time window | function closeTimeWin() {
$("#divBackGround").remove();
$("#openTimeDiv").remove();
$("#closeTimeDiv").remove();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function releaseTimeWindow() {\n selStart = timefilter.attr(\"x\");\n timefilter.on(\"mouseup\", null);\n timefilter.on(\"mousemove\", null);\n timefilter.on(\"mouseout\", null);\n context.on(\"mousedown\", startTimeSelect);\n context.on(\"mouseup\", stopTimeSelect);\n //console.log(CURRENT);\n}",
"functi... | [
"0.67044115",
"0.6627594",
"0.66074646",
"0.64680433",
"0.6449232",
"0.63759255",
"0.6322384",
"0.627558",
"0.6266693",
"0.6227876",
"0.61983055",
"0.6160587",
"0.6158528",
"0.6141839",
"0.6141839",
"0.6141839",
"0.6082155",
"0.6082155",
"0.60701025",
"0.60378283",
"0.6028991... | 0.67288244 | 0 |
Create the TypeScript Watch host | function makeWatchHost(scriptRegex, log, loader, instance, appendTsSuffixTo, appendTsxSuffixTo) {
const { compiler, compilerOptions, files, otherFiles } = instance;
const newLine = compilerOptions.newLine === constants.CarriageReturnLineFeedCode
? constants.CarriageReturnLineFeed
: compilerOptio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createWebWatchServer() {\n\tconst server = createServer({\n\t\tmode,\n\t\tcustomLogger: createLogger(\"info\", { prefix: `[web]` }),\n\t\tconfigFile: \"src/renderer/vite.config.js\",\n\t});\n\n\treturn server;\n}",
"set_watcher()\n {\n this.watcher = new Watcher( {\n port : ... | [
"0.611315",
"0.56539637",
"0.5362381",
"0.53332156",
"0.52582526",
"0.5238887",
"0.5194953",
"0.51865613",
"0.51791906",
"0.5152957",
"0.5122921",
"0.5064624",
"0.5058542",
"0.50522006",
"0.5043726",
"0.5012016",
"0.49764222",
"0.49298167",
"0.4925355",
"0.48953176",
"0.48916... | 0.65393704 | 0 |
Takes new prop and pass into state by converting to minutes | componentWillReceiveProps(nextProps, props) {
var [hourTime, minuteTime] = nextProps.selectedTime.split(':')
this.setState({ selectedTime: (hourTime * 3600) + Number(minuteTime * 60), selectedTimeCP: (hourTime * 3600) + Number(minuteTime * 60) })
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleNewMinutesChange (event) {\n const goal = { ...this.state.newGoal, minutes: event.target.value };\n this.setState({ newGoal: goal });\n }",
"setMinutes(e) {\n this.setState({ minutes: e.target.value });\n let m = moment(this.props.date._d)\n m.hour(this.state.hours)\n m.m... | [
"0.7293208",
"0.6858946",
"0.6723497",
"0.6697611",
"0.66161674",
"0.6555452",
"0.65361345",
"0.6504286",
"0.63604414",
"0.6316108",
"0.6302747",
"0.6291003",
"0.62495685",
"0.62327975",
"0.6202027",
"0.61288273",
"0.61167425",
"0.606399",
"0.60500056",
"0.60387284",
"0.60180... | 0.6905593 | 1 |
Create CSV titles for an object, using recursion if it contains child objects | function recursiveTitle(header, obj) {
let s = ''
for(const i in obj) {
if (typeof obj[i] == 'object') {
//console.log('s')
s += recursiveTitle(header + '.' + i, obj[i]) + ','
}
else {
s += header + '.' + i + ','
}
}
return s.substring(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_createTitle(obj) {\n let res = \"\";\n for (let p in obj) {\n res += `${p}=${obj[p]},`;\n }\n return res.substr(0, res.length - 1);\n }",
"readGroupedTitleRow(itemObj) {\n let groupName = sanitizeHtmlToText(itemObj.title);\n const exportQuoteWrapper = this... | [
"0.6428182",
"0.57921475",
"0.5730361",
"0.56393474",
"0.55483544",
"0.5436517",
"0.53751284",
"0.5368893",
"0.53466403",
"0.53369915",
"0.5289455",
"0.5274943",
"0.52728474",
"0.5250559",
"0.5225183",
"0.5160835",
"0.5151258",
"0.51421887",
"0.5137935",
"0.51200455",
"0.5119... | 0.7311583 | 0 |
Create an object that only contains "value" within layers of simple objects defined by a list of "layers" | function empty(layers, value) {
if (layers.length == 0) return value
let topLayer = layers.shift() //Remove the top layer from the list
let temp = {} //simple object to hold our layer
temp[topLayer] = empty(layers, value)
return temp
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLayerByUid(layers, value) {\n return layers.array_.filter(layer => layer.ol_uid === value);\n}",
"function layerSet(layers){\r\n //TODO Take layer of groups and sort into ind. items so that tooltips and colors can be adjusted\r\n //Each object in layer is always the same i.e.... | [
"0.5948935",
"0.5094834",
"0.50378245",
"0.50263834",
"0.50187397",
"0.50113535",
"0.4984556",
"0.4940943",
"0.48935637",
"0.48909795",
"0.48185268",
"0.4790529",
"0.4787063",
"0.47669777",
"0.47631475",
"0.47631475",
"0.475835",
"0.47578746",
"0.47518763",
"0.47323695",
"0.4... | 0.69806576 | 0 |
Normalize itertion counter Arrow Up Check if the focussedIndex reached a negative number If so, assign it to (elements.length 1) Else, decrement the counter | function normalizeNegativeCounter(elements, focussedIndex) {
if (focussedIndex <= 0) {
return elements.length - 1;
} else {
return focussedIndex - 1;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"up() {\r\n this.upAndDown = false;\r\n this.firstRowHighlight = false;\r\n if (this.selectedIndex === null) {\r\n this.selectedIndex = this.results.length - 1;\r\n return;\r\n }\r\n if (this.includeInputInList === false) {\r\n this.selectedIndex =\r\n this.sel... | [
"0.6385986",
"0.6169602",
"0.6133054",
"0.606827",
"0.606827",
"0.60637057",
"0.59533656",
"0.5949069",
"0.5928403",
"0.58831584",
"0.58646786",
"0.5853408",
"0.5843514",
"0.5820273",
"0.5820273",
"0.5820273",
"0.57986075",
"0.57815754",
"0.57494485",
"0.57422185",
"0.5690831... | 0.7362624 | 1 |
Toggle aria atrributes based on the dropdown state | function toggleAriaAtrributes(dropdown, open) {
var trigger = dropdown.querySelectorAll('[x-spread="trigger"]');
if (trigger.length) {
trigger = trigger[0];
if (open) {
trigger.setAttribute("aria-expanded", true);
var dropdownList = dropdown.querySelectorAll('[x-spread="dropdown"]');
if (d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dropdown() {\n glumacNameContainer.classList.toggle(\"show\");\n\n if (arrow.classList.contains('fa-arrow-down')) {\n arrow.classList.remove('fa-arrow-down');\n arrow.classList.add('fa-arrow-up');\n } else {\n arrow.classList.add('fa-arrow-down');\n }\n}",
"function handleAriaExpanded(evt) ... | [
"0.6441378",
"0.6344109",
"0.63240695",
"0.6232912",
"0.6232912",
"0.6157176",
"0.6135148",
"0.61046386",
"0.6099504",
"0.60408044",
"0.6016018",
"0.6016011",
"0.6016011",
"0.5948682",
"0.5896538",
"0.5896538",
"0.5872202",
"0.5841703",
"0.5835541",
"0.58325267",
"0.5830824",... | 0.75209516 | 1 |
Make a request for the user's battles | function getBattles() {
$.ajax({
type : 'GET',
url : '/api/my_battles',
success : displayBattles,
error : myBattlesReqFail,
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function userGrab(weapon, user, weaponName, cb) {\n //console.log('\\n'+weapon+', '+user+'\\n');\n request(`https://stats.quake.com/api/v2/Player/Stats?name=${user}`, function(error, response, body) {\n if (!error && response.statusCode == 200) {\n var json = JSON.parse(body);\n ... | [
"0.6350811",
"0.61352754",
"0.60989827",
"0.6043721",
"0.5954292",
"0.5748397",
"0.57174623",
"0.57174623",
"0.5661356",
"0.56571466",
"0.564985",
"0.564985",
"0.56318617",
"0.5574105",
"0.55069035",
"0.54951966",
"0.5486601",
"0.5481048",
"0.5467274",
"0.545145",
"0.54496187... | 0.67662716 | 0 |
Cause the CreateBattleForm to appear when the user clicks "Begin a new Battle" | function showCreateBattleForm(event) {
var battleForm = document.getElementById('createBattleForm');
battleForm.innerHTML = "<p>Battle with: <input type='text' id='oppName' /><input type='button' value='Start battle' id='startBattle' /></p>";
battleForm.innerHTML += "<p><input type='button' value='Find an online pla... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static showCreateGameForm() {\n const newGameFormDiv = document.getElementById('new-game-form-div');\n newGameFormDiv.style.display = \"\";\n }",
"function initPage() {\n\tvar mainContent = document.getElementById('mainContent');\n\tmainContent.innerHTML = \"<h1>My Battles</h1>\";\n\tvar createB... | [
"0.6364899",
"0.6277623",
"0.6252796",
"0.62082624",
"0.6098251",
"0.6071484",
"0.59839493",
"0.5928263",
"0.5926532",
"0.5871503",
"0.58516216",
"0.5800969",
"0.5794415",
"0.57679",
"0.57360524",
"0.57223433",
"0.57184047",
"0.56964046",
"0.5684791",
"0.56723124",
"0.5659157... | 0.72978806 | 0 |
Poll for any new battles the player is invited to | function waitForOpponent() {
$.ajax({
type : 'GET',
url : '/api/update_matches',
success: checkForBattles
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkForBattles(response) {\n\tresponse = eval('(' + response + ')');\n\tvar battleTable = document.getElementById('battleTable');\n\tif (response.length > 0) {\n\t\tfor (var i = 0; i < response.length; i++) {\n\t\t\tif (response[i].invite == 't') {\n\t\t\t\twindow.newAlert('You have been invited to a bat... | [
"0.62723327",
"0.6110835",
"0.59837806",
"0.58235866",
"0.5819292",
"0.57812864",
"0.57321167",
"0.57268876",
"0.5666997",
"0.564082",
"0.5630841",
"0.56000274",
"0.5598127",
"0.55744314",
"0.5544616",
"0.55313843",
"0.55313355",
"0.55278075",
"0.55199224",
"0.5484856",
"0.54... | 0.6347161 | 0 |
Creates a new battle with the player id input by the user | function createBattle(event) {
var opponentName = document.getElementById('oppName').value;
$.ajax({
type : 'POST',
url : '/api/create_battle',
data : opponentName,
success : showBattle,
error : myBattlesReqFail,
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createPlayer(playerData){\n Player.create(playerData, function(err, newlyCreated){\n if(err){\n console.log(err);\n } else {\n console.log(\"Player \" +playerData.bnetID+ \" was added to the DB\");\n }\n });\n}",
"function addNewPlayer(id, name) {\n va... | [
"0.6197144",
"0.6144651",
"0.6125729",
"0.5962516",
"0.5959314",
"0.5922987",
"0.59007454",
"0.5883927",
"0.58124053",
"0.580855",
"0.5767464",
"0.57479644",
"0.57276595",
"0.5726807",
"0.5722246",
"0.5707294",
"0.5701605",
"0.56740093",
"0.5670324",
"0.5663672",
"0.5652644",... | 0.6325234 | 0 |
Moves to the battle page when the user clicks on a battle | function onClickBattleRow(event) {
sessionStorage['battleid'] = event.currentTarget.getAttribute('battleid');
sessionStorage['opponentName'] = event.currentTarget.children[0].innerHTML;
window.location.href = '/battle.html';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function goToGame() {\n $state.transitionTo('game');\n }",
"function goToGame() {\n window.location = 'game.html';\n}",
"function startBattle() {\n sortByInitiative();\n $(\"#unsortedTable\").slideUp(500);\n $(\".newChar\").slideUp(500);\n // todo: Implement stuff here\n // St... | [
"0.6511244",
"0.6487151",
"0.63011163",
"0.62836456",
"0.6238747",
"0.61862713",
"0.615496",
"0.6130768",
"0.61274385",
"0.6111317",
"0.6064976",
"0.6047179",
"0.6034992",
"0.6022648",
"0.6013229",
"0.5959621",
"0.59593546",
"0.5949164",
"0.5942826",
"0.5936587",
"0.5931666",... | 0.6748982 | 0 |
NewBoxForm: Form component for adding a new Box to BoxList. | function NewBoxForm({ addBox }) {
const INITIAL_STATE = {
width: "",
height: "",
backgroundColor: ""
}
const [ formData, setFormData ] = useState(INITIAL_STATE);
/** handleSubmit: sends form data to prop function addBox to update state */
function handleSubmit(evt) {
evt.preventDefault();
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addNewForm() {\n var prototype = $collectionHolder.data('prototype')\n var index = $collectionHolder.data('index')\n var newForm = prototype\n newForm = newForm.replace(/__name__/g, index)\n $collectionHolder.data('index', index+1)\n // création panel\n var $panel = $(\n '<div class=\"panel pane... | [
"0.6481493",
"0.6449419",
"0.62189573",
"0.6214706",
"0.61440986",
"0.60787576",
"0.6043959",
"0.6037509",
"0.5973538",
"0.59109217",
"0.5892633",
"0.58872247",
"0.5885682",
"0.58738965",
"0.5872927",
"0.5862231",
"0.5853045",
"0.5779034",
"0.5777778",
"0.5764361",
"0.5733170... | 0.6671051 | 0 |
handleSubmit: sends form data to prop function addBox to update state | function handleSubmit(evt) {
evt.preventDefault();
addBox(formData);
setFormData(INITIAL_STATE);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function NewBoxForm({ addBox }) {\n const INITIAL_STATE = {\n width: \"\",\n height: \"\",\n backgroundColor: \"\"\n }\n\n const [ formData, setFormData ] = useState(INITIAL_STATE);\n \n /** handleSubmit: sends form data to prop function addBox to update state */\n function handleSubmit(evt) {\n ... | [
"0.7305805",
"0.7015835",
"0.70149696",
"0.6910103",
"0.6884676",
"0.6865001",
"0.6851146",
"0.68129325",
"0.6792269",
"0.67521465",
"0.6745897",
"0.672538",
"0.67162794",
"0.67054176",
"0.6692881",
"0.6679992",
"0.66597694",
"0.66549426",
"0.66532093",
"0.6649373",
"0.664346... | 0.77485704 | 0 |
Write a function which gets a day and returns: If the day is Sunday/Monday return 'Have a good week' If the day is Tuesday/Wednesday return 'Ohhh...' If the day is Thursday return 'Yalla habayta' If the day is Friday/Saturday return 'Yammi Jachnun' Print the result | function whatDay(day) {
var result = "";
day = day.toLowerCase()
if (day === 'sunday' || day === 'monday') {
result = 'Have a good week';
} else if (day === 'tuesday' || day === 'wednesday') {
result = 'Ohhh ... ';
} else if (day === 'thursday') {
result = 'Yalla habaita';
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function whatDayToday(day) {\n var result;\n day = day.toLowerCase();\n switch (day) {\n case \"sunday\":\n case \"monday\":\n result = \"Have a good week\"\n break\n case \"tuesday\":\n case \"wednesday\":\n result = \"Ohhh....\"\n break\n case \"thrus... | [
"0.81754977",
"0.8115367",
"0.7769851",
"0.7606776",
"0.7477312",
"0.7456574",
"0.74541956",
"0.7359399",
"0.7316418",
"0.72834754",
"0.725454",
"0.7213271",
"0.720595",
"0.7065167",
"0.7047023",
"0.704682",
"0.7044477",
"0.70431197",
"0.70387775",
"0.7027099",
"0.7026773",
... | 0.86565953 | 0 |
CODILITY PROBLEMS ============================================================================================== Lesson 4 Counting Elements ============================================================================================== L4 Perm Checker / A nonempty zeroindexed array A consisting of N integers is given. A... | function permCheck(A) {
var distinctNumberObject = {}, len = A.length, largest = Math.max.apply(Math,A), distinctNumbersCounted = 0;
// largest number must equal size of array for it to be a permutation.
if (largest === len) {
for (i = 0; i < len; i++) {
var distinctNumberIndex = A[i] - 1;
if (... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n const N = A.length;\n let count = new Array(N+1).fill(0);\n \n for(let i in A){\n if(A[i] > N){\n return 0;\n }\n if(count[A[i]] > 0){\n return 0;\n }\n count[A[i]]++;... | [
"0.68444836",
"0.66633946",
"0.6649471",
"0.6557802",
"0.64224577",
"0.63520896",
"0.62780696",
"0.62755716",
"0.62748027",
"0.62715364",
"0.6223827",
"0.61813194",
"0.61736655",
"0.6140965",
"0.61363196",
"0.610516",
"0.6084023",
"0.6071268",
"0.6035077",
"0.59985274",
"0.59... | 0.77779937 | 0 |
Limit amount of threads used for each image sharp.concurrency(1); Create preview for image path Image file path. resizeConfig width height max_width max_height jpeg_quality gif_animation skip_size imageType gif, jpeg, png, etc | async function createPreview(image, resizeConfig, imageType) {
// To scale image, we calculate new width and height,
// resize image by height, and crop by width
let saveAsIs = false;
let u = resize_outline(image.width, image.height, resizeConfig);
let scaledWidth = u.crop_width;
let scaledHeight = u.crop_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function previewImages(input, imgId, parentId, cssClass, maxImages) {\n // Ensure at least one image is selected and there's no more than maxImagess\n if (input.files[0] && (input.files.length <= maxImages)) {\n // counter to keep track of the element ID to be modified\n var i = 0; \n //... | [
"0.6110448",
"0.56923664",
"0.5627865",
"0.5626599",
"0.56240946",
"0.5608498",
"0.5601916",
"0.5593498",
"0.558684",
"0.55845207",
"0.55675715",
"0.55589616",
"0.5557858",
"0.5547128",
"0.55332875",
"0.5467738",
"0.54672444",
"0.5462436",
"0.54510015",
"0.54483396",
"0.54419... | 0.6013363 | 1 |
Function to find numbers with repeated digits | function findRepeatedDigit(number) {
let tempNumber = number;
if (number > 10) {
let lastDigit = number % 10;
number = parseInt(number / 10);
let firstDigit = number % 10;
if (lastDigit == firstDigit)
return tempNumber;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sameDigits(a,b) {\n //solution here\n}",
"function findDigits(n) {\n let digitArray = n.toString();\n let count = 0;\n for (let i = 0; i <= digitArray.length; i += 1) {\n if (n % digitArray[i] === 0) {\n count++;\n }\n }\n return count;\n}",
"function findDigits(n) {\r\n var k=n.... | [
"0.70402455",
"0.7035918",
"0.68731666",
"0.67960244",
"0.6695744",
"0.6534807",
"0.653358",
"0.6532217",
"0.6479978",
"0.64749825",
"0.6473566",
"0.64413553",
"0.6434672",
"0.64343786",
"0.64313453",
"0.64313453",
"0.64313453",
"0.64313453",
"0.64313453",
"0.64313453",
"0.64... | 0.7518012 | 0 |
Verifica Campo da Cidade/Pais | function verificaCampoPreenchido(cidade) {
var preenchido;
if(cidade != ""){
preenchido = true;
}
return preenchido;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function esCampo(campo)\n{\n\tif (campo==null) return false;\n\tif (campo.name==null) return false;\n\treturn true;\n}",
"function check_ciudad() {\n\n\t\tif($(\"#Ciudad option:selected\").val() == 0) {\n \t\t$(\"#errorciudad\").html(\"Seleccione una ciudad\");\n\t\t\t$(\"#rrorciudad\").show();\n\t\t\terror_v... | [
"0.6524344",
"0.5869477",
"0.578313",
"0.57750964",
"0.5773307",
"0.5652721",
"0.5649926",
"0.56426054",
"0.55872846",
"0.556624",
"0.55623364",
"0.55515414",
"0.55429775",
"0.5536049",
"0.55336326",
"0.55009115",
"0.549372",
"0.5457524",
"0.54054654",
"0.53910077",
"0.536918... | 0.5916437 | 1 |
VoterGroup Constructor for a VoterGroup object. VoterGroup has a ownerId. | constructor(ownerId, name) {
this.ownerId = ownerId;
this.membersId = new Array();
this.membersId.push(this.ownerId);
this.name = name;
this.groupId = 'group' + Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
this.type = 'group'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(groupid, ownerusername, createdAt) {\n\n this.groupid = groupid;\n this.ownerusername = ownerusername;\n this.createdAt = createdAt\n\n }",
"constructor(scope, id, props) {\n super(scope, id, { type: CfnUserHierarchyGroup.CFN_RESOURCE_TYPE_NAME, properties: props });\n ... | [
"0.5636722",
"0.56194675",
"0.5404564",
"0.5368507",
"0.52721876",
"0.5157866",
"0.50252116",
"0.50024897",
"0.49790817",
"0.49592012",
"0.49435183",
"0.48780602",
"0.4846979",
"0.48254502",
"0.47996077",
"0.46718708",
"0.46257457",
"0.45946336",
"0.4593044",
"0.45650542",
"0... | 0.700676 | 0 |
Populate's info panel with $this_element's information | function populate_info_panel(this_element){
$('#pregunta_info_name').html(this_element.name);
$('#pregunta_info_type').html(convert_type(this_element.type));
if(this_element.type == 'MULTI' || this_element.type == 'CONDITIONAL'){
var answers_content = '';
$.each(connections_array, function(i){
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function build_protein_info_panel(data, div) {\n div.empty();\n var protein = data.controller.get_current_protein();\n div.append(protein['description']);\n div.append(\"<br>----<br>\");\n div.append(dict_html(protein['attr']));\n}",
"renderInformationAdditional() {\n document.getElementsByClassName(... | [
"0.68516606",
"0.6616169",
"0.6546088",
"0.653402",
"0.64927727",
"0.64778954",
"0.64655906",
"0.6436454",
"0.6373621",
"0.6226559",
"0.6214764",
"0.6151009",
"0.6143463",
"0.6140021",
"0.61026335",
"0.60969007",
"0.6077895",
"0.60622436",
"0.6056217",
"0.6040273",
"0.6028269... | 0.68623334 | 0 |
check if labels for an element's connections have the same name | function check_equal_labels(element, the_label){
for(var j = 0; j< connections_array.length; j++){
if(element.connect_id == connections_array[j].source){
if(the_label == connections_array[j].label){
return false;
}
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkSameLabel(label){ \n // if already have label return false.\n return $(data.selectedDiv).has(label).length == 0;\n}",
"function isLabeledBy(node, labelName) {\n for (var owner = node.parent; owner.kind === 214 /* LabeledStatement */; owner = owner.parent) {\n if (owner.label... | [
"0.6721919",
"0.6202323",
"0.60005915",
"0.5977667",
"0.596287",
"0.5962072",
"0.59042984",
"0.5884175",
"0.5784174",
"0.5713267",
"0.5676578",
"0.5655946",
"0.5605312",
"0.5587715",
"0.5550891",
"0.5538444",
"0.55327916",
"0.5512373",
"0.5485291",
"0.5386358",
"0.53746575",
... | 0.7951297 | 0 |
Check item type == 'START' is a source in only one connection all items where type != 'END' || 'START' are a source in at least one connection and item type == 'END' is a target in at least one connection not used when user just saves a flowchart under construction | function check_item_connections(){
var start_count = 0;
var end_count = 0;
var valid_item_count = 0;
var multi_count = 0;
var this_element;
var element_num; //substring(5)
for(var i = 0; i < elements_array.length; i++){
this_element = elements_array[i];
multi_count = 0;
for(var j =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function check_for_endpoints(){\n \t\tvar first_item = -1\n \t\t\t, end_item = -1;\n \t\tfor(var i=0; i<elements_array.length; i++){\n \t\t\tif(elements_array[i].type == 'START'){\n \t\t\t\tfor(var x=0; x<connections_array.length; x++){\n \t\t\t\t\tif(elements_array[i].connect_id == connections_array[x].source){\n... | [
"0.5933772",
"0.5715553",
"0.56843007",
"0.5162468",
"0.5143154",
"0.5106443",
"0.5103366",
"0.5038628",
"0.4990879",
"0.4868909",
"0.48651686",
"0.48592144",
"0.4838532",
"0.48267353",
"0.48130965",
"0.48036492",
"0.4798051",
"0.4791079",
"0.47841564",
"0.47574243",
"0.47364... | 0.66712964 | 0 |
NOTE: we are using structure of active panel as template for new one, currently we are replicating the structure of metadata fields | getTemplateFromCurrentPanel() {
const currentIndex = this.getCurrentPanelIndex();
const firstPanel = this.getPanels()[currentIndex];
return {
metadata: firstPanel
.resolve('metadata')
.map(metadataField => ({ type: MetadataField.type, name: metadataField.name, value: '' })),
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fmdf_initComponentMeta() {\n\t\n\t//all containers wrapper\n\tfmdmeta_prop = {};\n\n\t//icon path\n\tfmdmeta_prop.iconpath = \"/images/designer/prop/\";\n\n\t//properties grid configuration\n\tfmdmeta_prop.gridconf = {};\n\tfmdmeta_prop.gridconf.isTreeGrid = true;\n\t//fmdmeta_prop.gridconf.treeIconPath =... | [
"0.6136295",
"0.61114705",
"0.5857351",
"0.5809938",
"0.577988",
"0.57367694",
"0.5733026",
"0.5688529",
"0.56878614",
"0.56536007",
"0.5622596",
"0.5618403",
"0.5572465",
"0.5551668",
"0.55448836",
"0.55206007",
"0.55187744",
"0.5518138",
"0.5501968",
"0.54950213",
"0.547837... | 0.708944 | 0 |
Replaces color and lives states with their corresponding next states Reset next states for colors and lives | goToNextState() {
this.colors = this.nextStateColors
this.lives = this.nextStateLives
this.nextStateColors = new Array(COLS * ROWS).fill(COLOR.BLANK)
this.nextStateLives = new Array(COLS * ROWS).fill(false)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function color_fsm() {\n if (color_stage == 0) {\n if (lorenz_red >= 255) {\n color_stage = 1;\n } else {\n lorenz_red++;\n }\n } else if (color_stage == 1) {\n if (lorenz_green >= 255) {\n color_stage = 2;\n } else {\n lorenz_gre... | [
"0.6521679",
"0.6233091",
"0.61860305",
"0.6176525",
"0.6149748",
"0.6134702",
"0.6133651",
"0.61126596",
"0.6107905",
"0.609987",
"0.6096422",
"0.6093109",
"0.6082121",
"0.60687214",
"0.60281116",
"0.6026596",
"0.6013014",
"0.599194",
"0.5981862",
"0.5972272",
"0.59706837",
... | 0.68152267 | 0 |
Runs Game of Life algorithm every X milliseconds Uses setTimeout to allow for dynamic interval logic e.g. pending timeout is reset and longer interval is applied when a player clicks on the game | function gameTick() {
for (let y = 0; y < ROWS; y++) {
for (let x = 0; x < COLS; x++) {
const { count, colors } = countNeighbors(x, y)
// Any live cell with fewer than two live neighbours dies,
// as if caused by under-population.
if (... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"startGame() {\n this.interval = this.$interval(() => {\n this.loopCellMatrix();\n this.updateCellsFuture();\n this.iteration++;\n }, 300);\n }",
"function runLifeGame() {\n gameLifeRunning = setInterval(nextGeneration, parseInt($(\"#input-board-time-between-generations\").val()));\n $... | [
"0.71145606",
"0.6455918",
"0.6368944",
"0.6345281",
"0.6343472",
"0.63268125",
"0.63065046",
"0.62905174",
"0.6288947",
"0.6288491",
"0.6271798",
"0.6271258",
"0.6206848",
"0.6195654",
"0.61904025",
"0.61895394",
"0.6187302",
"0.61579275",
"0.6148401",
"0.6147209",
"0.613571... | 0.6970416 | 1 |
timerId directly id of your HTML timer deadline time point in future wich will be the end of some stoke/offer | constructor(timerId, deadline) {
this.timerId = timerId;
this.deadline = deadline;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateTimer() {\n const time = getTimeDiff(endTime);\n\n days.textContent = `${addZero(time.days)}`;\n hours.textContent = `${addZero(time.hours)}`;\n minutes.textContent = `${addZero(time.minutes)}`;\n seconds.textContent = `${addZero(time.seconds)}`... | [
"0.70178294",
"0.6563851",
"0.6534657",
"0.64944714",
"0.646196",
"0.63344854",
"0.62769777",
"0.6259683",
"0.6190972",
"0.61873555",
"0.61490804",
"0.6144597",
"0.61356187",
"0.6126994",
"0.6050897",
"0.6045961",
"0.6030836",
"0.5978928",
"0.59745365",
"0.59099877",
"0.58996... | 0.7397024 | 0 |
AJAX call to the include directory to delete an item from a package | function deletePackageItem() {
$.ajax({
type: "GET",
url: '../include/getPackageItems.php?action=deletePackageItem&packageID='+globalPackageID+'&categoryID='+globalCategoryID,
success: function (data) {
getPackageItems(globalPackageID);
},
failure: function(d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteItemData() {\n var options = {\n url: \"http://localhost:3000/projects\" + \"/\" + Itemid,\n method: \"DELETE\",\n data: \"\",\n success: function() {\n deleteItem();\n },\n error: function(error) {\n console.log(\"error\",error);\n }\n }\n ajax(options);\n}",
"fu... | [
"0.7104768",
"0.6778447",
"0.67659724",
"0.66179925",
"0.66160184",
"0.65829587",
"0.65274787",
"0.6504329",
"0.6479114",
"0.6477967",
"0.6452176",
"0.64471936",
"0.64339083",
"0.6427579",
"0.64122874",
"0.6392828",
"0.637997",
"0.63762397",
"0.6365855",
"0.6365851",
"0.63485... | 0.77091926 | 0 |
Allow biometric usage on iOS if it isn't already accepted | allowIosBiometricUsage() {
// See the wdio.shared.conf.js file in the `before` hook for what this property does
if (!driver.isBioMetricAllowed) {
// Wait for the alert
try {
this.iosAllowBiometry.waitForDisplayed({timeout: 3000});
this.allowBiometr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkiOS() {\n\t\treturn /iPad|iPhone|iPod/.test(navigator.userAgent) && ! window.MSStream;\n\t}",
"function checkiOS() {\n return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\n }",
"iOS():boolean {\n\n\t\treturn this.agent.match(/iPhone|iPad|iPod/i) ? true : false;\n\t}... | [
"0.5587254",
"0.5523544",
"0.54189044",
"0.5293914",
"0.52858055",
"0.51660085",
"0.51615787",
"0.5161381",
"0.5151987",
"0.51505095",
"0.5066032",
"0.50423324",
"0.5026151",
"0.501396",
"0.501396",
"0.501396",
"0.501396",
"0.501396",
"0.50037426",
"0.5000443",
"0.4967216",
... | 0.73278826 | 0 |
Updates the display to show the specified year. | function displayYear(year) {
dot.data(interpolateData(Math.round(year)), key).call(position).sort(order);
label.text(Math.round(year));
dotNames.data(interpolateData(Math.round(year)), key).call(showLabel);
// Updates texts in sidebar.
titles.data(interpolateTeleData(year), key)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateYear() {\n O('year-label').innerHTML = this.year;\n }",
"function updateYear(year) {\n yearSelected = year;\n updateShotChart();\n updateSeasonRank();\n}",
"function displayYear(year) {\n d3.selectAll(\".dot\").data(interpolateData(year), key)\n .call(position)\n .sort(order);... | [
"0.77693564",
"0.75446963",
"0.72150356",
"0.71750224",
"0.7142512",
"0.70484203",
"0.70484203",
"0.7007036",
"0.7007036",
"0.7007036",
"0.6965553",
"0.69503665",
"0.69503665",
"0.69503665",
"0.6885591",
"0.6857341",
"0.67369026",
"0.67194164",
"0.66810894",
"0.6652801",
"0.6... | 0.77194196 | 1 |
Interpolates the dataset for the given (fractional) year. | function interpolateData(year) {
return testData.map(function(d) {
return {
xPos: d.xPos,
yPos: d.yPos,
name: d.name,
size: d.size,
region: d.region,
number: interpolateValues(d.number, year),
textLabel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function interpolateData(year) {\n return data.map(function(d) {\n return {\n country: d.country,\n region: d.region,\n code: d.code,\n xVal: interpolateValues(d.x, year),\n yVal: interpolateValues(d.y, year),\n zVal: interpolateValues(d.z, year)\n };\n });... | [
"0.75805336",
"0.7532873",
"0.74065244",
"0.731408",
"0.7296949",
"0.72798663",
"0.72255176",
"0.71993214",
"0.71993214",
"0.71993214",
"0.7172246",
"0.7163488",
"0.7104056",
"0.7104056",
"0.7104056",
"0.70994294",
"0.7004463",
"0.69604856",
"0.691536",
"0.6687981",
"0.668798... | 0.7617787 | 0 |
Group salary years of the same people together. | function processSalaryData() {
for (let [year, yearlyData] of Object.entries(salaryData)) {
for (let entry of yearlyData) {
// get the person's first and last name
let name = getNormalizedName(entry[FIRST_NAME], entry[MIDDLE_INITIAL], entry[LAST_NAME]);
// if the name ha... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function employee_grouping_by_age() {\n var emp=\n [\n {\n name:\"Amarjeet malik\",\n age:22,\n salary:8000,\n DOB:\"04/08/1996\"\n },\n {\n name:\"Dolly\",\n age:21,\n ... | [
"0.61218965",
"0.6102793",
"0.6092263",
"0.603932",
"0.57204527",
"0.5619973",
"0.56011134",
"0.559948",
"0.5540842",
"0.5533275",
"0.5529206",
"0.5501415",
"0.55013776",
"0.54887897",
"0.54887897",
"0.54887897",
"0.54887897",
"0.5476106",
"0.54710215",
"0.5446877",
"0.538045... | 0.6252792 | 0 |
Show the Salary Explore page. | function showExplorePage() {
// show the pagination
document.getElementById("page").style.display = "";
// show "Explore Salary Data" text
let resultsDisplay = document.getElementById("results");
resultsDisplay.innerHTML = "<h4 class='mt-3'>Explore Salary Data (From High to Low)</h4>";
// sort... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showSalary() {\n hourlyEntry.style.display = \"none\";\n salaryEntry.style.display = \"grid\";\n commissionEntry.style.display = \"none\";\n }",
"function viewEmployees() {\n connection.query(\"SELECT * FROM employee\", function(error, results) {\n if (error) throw error;\n\n... | [
"0.6180199",
"0.58031374",
"0.5794141",
"0.5714532",
"0.56359076",
"0.56145453",
"0.55778146",
"0.55285794",
"0.5525259",
"0.5517379",
"0.54681194",
"0.54566485",
"0.5444847",
"0.5389511",
"0.5360305",
"0.53571486",
"0.53136885",
"0.5298541",
"0.5282933",
"0.52591884",
"0.524... | 0.58868617 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.