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 |
|---|---|---|---|---|---|---|
Lets the user add activities to the date plan | function addActivityToDatePlan(){
var numActivities = $('.activityDatePlan').length;
datePlanActivity.ActivityID = $('.activityDatePlan')[numActivities-1].value;
$.ajax({
type: 'POST',
url: 'api/index.php/addActivity',
content: 'application/json',
data: JSON.stringify(datePlanActivity),
success: function(d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addActivity(dat, activ, dura){\r\n let activity={\r\n date: dat,\r\n activity: activ,\r\n duration: dura\r\n };\r\n\r\nactivities.push(activity);\r\n}",
"function addActivity(date, activity, durationInMinutes) {\n //limited usage alert\n if (totalMinutes >= phoneUsageLim... | [
"0.6725578",
"0.65263665",
"0.6499674",
"0.63098174",
"0.62058806",
"0.6194351",
"0.6053746",
"0.6050553",
"0.5981566",
"0.59770733",
"0.5931761",
"0.5913625",
"0.5804634",
"0.5794239",
"0.5787274",
"0.5776932",
"0.57576615",
"0.5746794",
"0.5738287",
"0.57259",
"0.5722858",
... | 0.7257835 | 0 |
Searches date plans by their tags | function searchDatePlanTags(){
var searchQuery = new Object();
searchQuery.tagName = $("#searchbar").val();
var star = 'unstarred';
$.ajax({
type: 'POST',
url: 'api/index.php/getTaggedDatePlans',
content: 'application/json',
data: JSON.stringify(searchQuery),
success: function(data){
var datePlansD... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async searchActivity(searchObj) {\n let queryParams = ''\n const { startDate, endDate, tags, city, name } = searchObj //if a data is not given it will send undifined\n if(startDate) {\n queryParams += `startDate=${startDate}&`\n }\n if(endDate) {\n queryPara... | [
"0.53818816",
"0.5355146",
"0.52049625",
"0.5198379",
"0.51893187",
"0.5148055",
"0.51049936",
"0.506104",
"0.505875",
"0.5054207",
"0.5020746",
"0.5003766",
"0.49986374",
"0.49850082",
"0.497505",
"0.49527267",
"0.4944313",
"0.49233168",
"0.49219877",
"0.49219877",
"0.492119... | 0.6710401 | 0 |
Gets the user date plans and displays it on our clipboard | function getUserDatePlans(){
updateName()
$('#descriptionBut').hide();
$('#myPlansBut').hide();
$('#datePlanName').hide();
$('#backToCreateBut').show();
$('#publishLabel').hide();
$('.activityDatePlan').remove();
$.ajax({
type: 'POST',
url: 'api/index.php/viewUserDatePlans',
content: 'application/json',
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getReportExpiryDate(plan){\n if(plan){\n // nothing to do here\n }\n else{\n let user = Meteor.user();\n //set default to Free\n plan = user.profile.businessPlan || AppConfig.availablePlans[0];\n }\n\n if(plan && applyLimits[plan]){\n ... | [
"0.57059747",
"0.5542685",
"0.55318916",
"0.5524248",
"0.5412598",
"0.5393764",
"0.5392391",
"0.53533924",
"0.53531265",
"0.53513175",
"0.53440726",
"0.5311826",
"0.5310579",
"0.5287399",
"0.52774507",
"0.52455795",
"0.52341586",
"0.5219088",
"0.51947755",
"0.51929617",
"0.51... | 0.599704 | 0 |
Deletes a user dateplan | function deleteUserPlan(){
var datePlanUser = new Object();
datePlanUser.DatePlanID = exitBut.value;
datePlanUser.UserID = user.UserID;
$.ajax({
type: 'DELETE',
url: 'api/index.php/deleteDatePlan',
content: 'application/json',
data: JSON.stringify(datePlanUser),
success: function(dat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteUser(user) {\n console.log(user, 'deleted');\n}",
"function deleteUser(user) {\n console.log(user, 'deleted');\n}",
"static delete(req, res) {\n\n const getIdUser = parseInt(req.params.user)\n\n GEN_DATA_AGUNAN.destroy({ where: { UserId: getIdUser } })\n .then((dat... | [
"0.6069569",
"0.6069569",
"0.5802405",
"0.5794143",
"0.5793888",
"0.57385254",
"0.5728242",
"0.56831455",
"0.5665235",
"0.5616996",
"0.56079245",
"0.55889696",
"0.5580831",
"0.5568391",
"0.55603606",
"0.5545612",
"0.5513146",
"0.5492562",
"0.5485061",
"0.5482284",
"0.54785526... | 0.6718571 | 0 |
Publishes a user date plan for everyone to search for | function publishDatePlan(check){
var datePlanUser = new Object();
datePlanUser.datePlanID = datePlanActivity.DatePlanID;
datePlanUser.userID = user.UserID;
$.ajax({
type: 'POST',
url: 'api/index.php/shareDatePlan',
content: 'application/json',
data: JSON.stringify(datePlanUser),
success: function(data){... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"doPublish(program, targetDate) {\n }",
"getReportExpiryDate(plan){\n if(plan){\n // nothing to do here\n }\n else{\n let user = Meteor.user();\n //set default to Free\n plan = user.profile.businessPlan || AppConfig.availablePlans[0];\n }\n... | [
"0.6219032",
"0.59440994",
"0.56636065",
"0.5570279",
"0.5566292",
"0.5380926",
"0.5320742",
"0.52710015",
"0.52403635",
"0.5213778",
"0.52103645",
"0.5204007",
"0.51990944",
"0.5161285",
"0.51552266",
"0.51153016",
"0.5100866",
"0.5091674",
"0.50906676",
"0.5087084",
"0.5052... | 0.7062856 | 0 |
Updates the name of a date plan | function updateName(){
var datePlanName = new Object();
datePlanName.DatePlanID = datePlanActivity.DatePlanID;
datePlanName.Name = $("#datePlanName").val();
datePlanActivity.Name = datePlanName.Name;
datePlanName.UserID = user.UserID;
if (user.UserID != null)
{
$.ajax({
type: 'POST',
url: 'api/index.php... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updatePlanName(e) {\n setWarning(\"\");\n props.onChangePlanName(e.target.value);\n }",
"function updateNameDate() {\n setGreeting();\n setSadAnimalDateTime();\n}",
"function setAssignName()\n\t{\n\t\tvar name = 'Student and Overall Grade Report';\n\n\t\tvw.drawList.setParam('aName', 'text', ... | [
"0.7099154",
"0.6102216",
"0.5865723",
"0.56076443",
"0.5566747",
"0.55553544",
"0.5538426",
"0.5528194",
"0.5512222",
"0.5500807",
"0.5496251",
"0.54468256",
"0.5445028",
"0.54192203",
"0.5417872",
"0.53601515",
"0.5358064",
"0.5338433",
"0.5313596",
"0.53096926",
"0.5292558... | 0.6858826 | 1 |
gets a users favorite activities from the database | function getFavoriteActivities(){
var favoriteActivities = new Object();
if(user.UserID != undefined){
$.ajax({
type: 'POST',
url: 'api/index.php/viewFavorites',
async: false,
content: 'application/json',
data: JSON.stringify(user),
success: function(data){
console.log(data);
favoriteActiv... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAllFavorites(){\n return db('yfusers as y')\n .join('favorites as f', 'f.user_id', 'y.id')\n .join('livereviews as m', 'f.review_id', 'm.id')\n .select('y.id as loggedInUser', 'y.username', 'm.id as favoriteID', 'm.business_name', 'm.address', 'm.city', 'm.state', 'm.yelp_store_... | [
"0.68447065",
"0.65256304",
"0.6514553",
"0.6512784",
"0.6499839",
"0.6492448",
"0.6471903",
"0.63615817",
"0.6333251",
"0.6326928",
"0.631053",
"0.62962294",
"0.6284466",
"0.62677664",
"0.6158063",
"0.6143288",
"0.612646",
"0.6120902",
"0.6036135",
"0.60353065",
"0.602886",
... | 0.69634086 | 0 |
Function Name: pushCode Function Description:first thing thats called when push back button is pressed. Handles pseudo code for push back and calls the animation for push back | function pushCode()
{
if(stack_num<5 && once && flag2)
{
once = 0;
flag = 0;
document.getElementById("function1").innerHTML = "Pushback";
document.getElementById("function2").innerHTML = "PROCEDURE pushback(i : integer)";
document.getElementById("function3").innerHTML = "VAR newN... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fpPOSH_go_back(){\n\t\t$('#fpPOSH_back').click(function(){\n\t\t\t$(this).animate({'left':'-20px'},'fast');\n\n\t\t\t$('h3.notifications').removeClass('back');\n\n\t\t\t$('.fpPOSH_inner').animate({'margin-left':'0px'}).find('.step2_in').fadeOut();\n\n\n\t\t\t// hide step 2\n\t\t\t$(this).closest('#fpPOSH_... | [
"0.68628",
"0.64529383",
"0.6213432",
"0.61331576",
"0.61050415",
"0.6086845",
"0.6086845",
"0.6086845",
"0.6086845",
"0.6086845",
"0.6086845",
"0.6083784",
"0.6082025",
"0.60607785",
"0.6044116",
"0.6032989",
"0.60277486",
"0.60155123",
"0.60050064",
"0.5990177",
"0.5987302"... | 0.6815454 | 1 |
Function Name: popCode() Function Description:first thing thats called when pop back button is pressed. Handles pseudo code for pop back and calls the animation for pop back | function popCode()
{
if(stack_num >1 && flag && onceBack)
{
flag2 = 0;
onceBack = 0;
document.getElementById("function1").innerHTML = "PopBack";
document.getElementById("function2").innerHTML = "PROCEDURE popback";
document.getElementById("function3").innerHTML = "BEGIN";
document.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fpPOSH_go_back(){\n\t\t$('#fpPOSH_back').click(function(){\n\t\t\t$(this).animate({'left':'-20px'},'fast');\n\n\t\t\t$('h3.notifications').removeClass('back');\n\n\t\t\t$('.fpPOSH_inner').animate({'margin-left':'0px'}).find('.step2_in').fadeOut();\n\n\n\t\t\t// hide step 2\n\t\t\t$(this).closest('#fpPOSH_... | [
"0.7360503",
"0.6735",
"0.66311306",
"0.65630716",
"0.65355223",
"0.65355223",
"0.65355223",
"0.65355223",
"0.65355223",
"0.65355223",
"0.6500997",
"0.64088285",
"0.63912654",
"0.63855714",
"0.6384539",
"0.6376245",
"0.6356547",
"0.6323038",
"0.6302671",
"0.6274158",
"0.62494... | 0.6792751 | 1 |
Function Name: appear() Function Description:animation for the pushback part of the algorithm | function appear ()
{
popping_back = 0;
selectText();
if (stack_num <= 5)
{
var anim = manager.createAnimObject("Stack" + stack_num);
var anim2 = manager.createAnimObject("bottom" + stack_num);
var anim3 = manager.createAnimObject("text" + stack_num);
anim.add({property: Prop.backgr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function button_insert(){\n animateFrames2(\"bug\",25,\"infinite\",\"reverse\");\n}",
"function appear(element, num, step, speed){\n var t_o;\n t_o = setInterval(function(){\n var opacity = num / 100;\n num = num + step; \n ... | [
"0.6493795",
"0.6489311",
"0.63806975",
"0.6291793",
"0.6244983",
"0.62244356",
"0.6221239",
"0.6209483",
"0.6168093",
"0.6137735",
"0.6136179",
"0.6127909",
"0.60682493",
"0.6051495",
"0.6037271",
"0.603613",
"0.6020015",
"0.60035866",
"0.5996712",
"0.59959",
"0.5991034",
... | 0.74856704 | 0 |
Function Name: fade() Function Description:animation for the popback algorithm | function fade ()
{
popping_back = 1;
selectText();
if (stack_num <= 6)
{
stack_behind_one = stack_num - 1;
stack_behind_2 = stack_behind_one -1;
if(stack_behind_one == 0)
{
stack_behind_one = 1;
}
var anim = manager.createAnimObject("Stack" + stack_behind_one... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function slide_fadeFromForeToBack() {\n var delay = 100;\n var i = 0;\n var bgop=0;\n var fgop=1;\n\n document.getElementById(backImage).style.visibility = 'visible';\n\n if (fade_cursor < 1.01) {\n bgop = fade_cursor;\n fgop = 1-fade_cursor;\n setOpacity(foreImage,fgop);\n ... | [
"0.77765113",
"0.76363695",
"0.74529123",
"0.74092424",
"0.7386219",
"0.7290568",
"0.7277255",
"0.72161627",
"0.71592766",
"0.71301526",
"0.70721465",
"0.7057688",
"0.6995147",
"0.6940717",
"0.6936724",
"0.69358397",
"0.68727905",
"0.68658775",
"0.68103826",
"0.68087",
"0.680... | 0.77654916 | 1 |
Function Name: stretch() Function Description:animates the black lines that connects the stack | function stretch ()
{
st_stack_behind = stack_num - 2;
if (st_stack_behind <= 4)
{
var anim3 = manager.createAnimObject("spacer" + st_stack_behind);
anim3.add({property: Prop.backgroundColor, from: new Col(255,255,255), to: new Col(0,0,0),
duration:1000});
var anim = mana... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stretch(){\n\tif(position<465){\n\t\tposition=position+1;\n\t\ttracker=tracker+1;\n\t}\t\n\tb.setAttribute(\"x1\", position);\n\tt.setAttribute(\"x2\", position);\n a.transform.baseVal.getItem(0).setTranslate(tracker, 0);\n ball.setAttribute(\"cx\", position);\n update();\n\t}",
"function stack... | [
"0.6625629",
"0.6047409",
"0.60462606",
"0.60275424",
"0.5967668",
"0.58740395",
"0.5840057",
"0.5818949",
"0.5772835",
"0.57630277",
"0.5757735",
"0.57293427",
"0.5630232",
"0.56171423",
"0.5611068",
"0.558387",
"0.557955",
"0.5525351",
"0.5497991",
"0.5469818",
"0.54570276"... | 0.8466041 | 0 |
Detects then returns window resolution | function getWindowResolution()
{
var windowWidth, windowHeight; // store window resolution and height
if (document.body)
{
if (document.body.offsetHeight && document.body.offsetWidth)
{
windowWidth = document.body.offsetWidth;
windowHeight = document.body.offsetHeight;
}
}
if (document.co... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getResolution(){\n var width = $(window).width() - 100;\n var height = $(window).height() - 100;\n return [width, height];\n}",
"function findWH() {\r\n\twinW = (is.ns)? window.innerWidth : document.body.offsetWidth-20\r\n\twinH = (is.ns)? window.innerHeight : document.body.offsetHeight-4\r\n}"... | [
"0.7683252",
"0.73263127",
"0.72927237",
"0.72381777",
"0.7215375",
"0.71140367",
"0.70196927",
"0.69840574",
"0.69526136",
"0.6948867",
"0.6945131",
"0.6928642",
"0.6905454",
"0.6887028",
"0.688085",
"0.6845855",
"0.6827816",
"0.68151987",
"0.6814162",
"0.6811862",
"0.681176... | 0.7878314 | 0 |
Reads the window URL and returns an object of GET vars | function getUrlVars() {
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
vars[key] = value;
});
return vars;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getVars(){\n var loc = document.location.href;\n var getString = loc.split('?');\n if(getString[1]){\n var GET = getString[1].split('&');\n var get = {};//This object will be filled with the key-value pairs and returned.\n\n for(var i = 0, l = GET.length; i < l; i++){\n ... | [
"0.73197824",
"0.7216367",
"0.7168162",
"0.7161171",
"0.7160765",
"0.7156171",
"0.7156171",
"0.71410334",
"0.71410334",
"0.7132254",
"0.7131467",
"0.71285546",
"0.71252996",
"0.71239966",
"0.7118",
"0.7102589",
"0.70984316",
"0.70984316",
"0.70984316",
"0.70984316",
"0.709651... | 0.7223714 | 1 |
pick and return a random element from the given list | function pickRandomFrom(list) {
return list[Math.floor(Math.random()*list.length)];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rand_element(list){ return list[Math.floor(Math.random() * list.length)]; }",
"function randomElement(list) {\n return list[Math.floor(Math.random() * list.length)];\n}",
"function randomEl(list) {\r\n var i = Math.floor(Math.random() * list.length);\r\n return list[i];\r\n}",
"function choice(... | [
"0.85138494",
"0.83816594",
"0.81107825",
"0.7904687",
"0.7844706",
"0.7730463",
"0.7669413",
"0.7592464",
"0.7565884",
"0.75090986",
"0.74537194",
"0.7451484",
"0.7368249",
"0.72952515",
"0.7288952",
"0.72805554",
"0.72647285",
"0.7243033",
"0.7174223",
"0.71692604",
"0.7165... | 0.8511258 | 1 |
give the client a random post | function getRandomPost(request, response) {
let randomPost = pickRandomFrom(posts);
let list = [randomPost]; //we put it inside a list, just because it makes our existing feed code work
response.send(list);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getRandomPost() {\n\tvar post = cleanedPosts[ Math.floor( Math.random() * cleanedPosts.length ) ];\n\treturn post;\n}",
"function regenratePosts(){\n generate();\n }",
"function pickRandom(posts) {\n let index = Math.floor(Math.random() * posts.length);\n let randomSLPT = posts[index];\n return... | [
"0.7428193",
"0.65096986",
"0.640774",
"0.63427263",
"0.63097364",
"0.62593216",
"0.6188595",
"0.60970485",
"0.6046765",
"0.6043813",
"0.6019321",
"0.60039145",
"0.5995885",
"0.59787774",
"0.5954011",
"0.5932542",
"0.5895575",
"0.5892389",
"0.588964",
"0.586918",
"0.58576006"... | 0.76345783 | 0 |
Return column type according to type | function getColumnType(type) {
switch (type) {
case 'integer': return 'number';
case 'datetime': return 'date';
default: return type;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"type(o) {\n if (o === true) return type;\n if (isString(o)) {\n if (columnTypes[o]) {\n type = columnTypes[o](sample);\n return column;\n } else {\n throw new Error('unknown column type: ' + o);\n ... | [
"0.7533275",
"0.7167171",
"0.7039531",
"0.7020606",
"0.66284364",
"0.64015734",
"0.6343255",
"0.6303606",
"0.6234729",
"0.6226644",
"0.6196277",
"0.6190161",
"0.609943",
"0.60561204",
"0.6014549",
"0.60112",
"0.6009536",
"0.595375",
"0.5951578",
"0.5946388",
"0.5926898",
"0... | 0.8030988 | 0 |
Return state name (last part of the URL) | function getStateName() {
return window.location.href.split('/').pop(-1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getFullStateName(state) {\n return stateList[state];\n}",
"getStateName() {\n return this.currentStateName;\n }",
"function get_name(url){\n\t\tvar str = url.substring((url.lastIndexOf('/') +1),url.length);\n\t\treturn str;\n\t}",
"function spellOutFullStateName(s) {\n var firstIndex... | [
"0.79336894",
"0.64208317",
"0.63386154",
"0.61930114",
"0.6175599",
"0.61680204",
"0.6097062",
"0.60169655",
"0.60026896",
"0.5985556",
"0.59663254",
"0.5955557",
"0.5897234",
"0.58935034",
"0.58057624",
"0.5783965",
"0.57822037",
"0.5780115",
"0.57786083",
"0.57596606",
"0.... | 0.8780973 | 0 |
Move the ship up. | moveUp() {
dataMap.get(this).moveY = -5;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moveUp(){\n\t\t\tplayerPosition.x += 1\n\t\t\tplayer.attr({\n\t\t\t\t'cx': playerPosition.x\n\t\t\t})\n\t\t}",
"up () {\n let first = this.props.game.getTileList();\n this.props.game.board.moveTileUp();\n let second = this.props.game.getTileList();\n if (this.moveWasLegal(first, second) === ... | [
"0.7657353",
"0.7632087",
"0.75765866",
"0.7406355",
"0.7406355",
"0.73688686",
"0.7249161",
"0.7239278",
"0.7194835",
"0.7176811",
"0.7166871",
"0.70168215",
"0.7005562",
"0.69752085",
"0.6956843",
"0.6865948",
"0.68597263",
"0.68315536",
"0.68241316",
"0.6760128",
"0.666858... | 0.77845204 | 0 |
Move the ship down. | moveDown() {
dataMap.get(this).moveY = 5;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"moveDown() {\n this.y<332?this.y+=83:false;\n }",
"down() {\n this.y += this.speed;\n this.comprobarLimitesBarra();\n }",
"function moveDown(){\n undraw()\n currentPosition += width\n // gameOver()\n draw()\n freeze()\n }",
"function moveDown()... | [
"0.69235283",
"0.6839558",
"0.674748",
"0.6661813",
"0.6646226",
"0.6619887",
"0.6613964",
"0.6598164",
"0.65829945",
"0.6555981",
"0.64945805",
"0.6455389",
"0.6439971",
"0.6427415",
"0.64182264",
"0.6413464",
"0.640138",
"0.6357352",
"0.6319258",
"0.6295611",
"0.62908876",
... | 0.71153843 | 0 |
When a missile hit an alien spaceship, we remove the ship and trigger an explosion. | impact() {
let area = this.hitArea;
new Explosion(area.x + area.width/2, area.y + area.height/2);
this.stop();
this.x = 30;
this.y = Math.round(300 - dataMap.get(this).ship.height/2);
stage.remove(this);
gameOver();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateMissileXY(game) {\n let missile = {}, missileLength = this.shots.length - 1;\n\n for (let i = missileLength; i >= 0; i--) {\n missile = this.shots[i];\n\n if (game.shipMissileContact(this.id, missile)) {\n this.score -= 50; // You got shot\n }\n... | [
"0.7173471",
"0.69490653",
"0.6928317",
"0.67794305",
"0.67756957",
"0.6744367",
"0.66483665",
"0.65988696",
"0.6593975",
"0.65621775",
"0.65471643",
"0.6529633",
"0.6484984",
"0.64400864",
"0.6411485",
"0.64111286",
"0.6402251",
"0.6383952",
"0.63649535",
"0.63190025",
"0.63... | 0.7795098 | 0 |
Stopwatch function (logic to determine when to increment next value, etc.) | function stopWatch(){
seconds++;
//Logic to determine when to increment next value
if(seconds / 60 === 1){
seconds = 0;
minutes++;
if(minutes / 60 === 1){
minutes = 0;
hours++;
}
}
//If seconds/minutes/hours are only one digit, add a leadi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Stopwatch() {}",
"function timeTrack() {\r\n tracker++;\r\n time = tracker / 50;\r\n}",
"function stopwatchUpdate() {\r\n rawTime += intervalRate;\r\n stopwatchTime.innerHTML = formatTime(rawTime);\r\n}",
"function stopwatchUpdate(){\n rawTime += intervalRate\n stopwatchTime.innerHTML ... | [
"0.7003516",
"0.67177683",
"0.66322446",
"0.6589082",
"0.6574916",
"0.65657383",
"0.65657383",
"0.65226734",
"0.6518647",
"0.6509107",
"0.64488316",
"0.643236",
"0.64304554",
"0.64254",
"0.642373",
"0.641511",
"0.6393798",
"0.6372119",
"0.6358035",
"0.6349959",
"0.6312893",
... | 0.67353296 | 1 |
draws the grapes on the grapevine | function drawGrapes(x,y,rank,id){
let grapes = vine.append("g").attr("class","grapeCluster").attr("width",18).attr("height",18).attr("transform","translate("+ x + "," + y + ")").attr("rank",rank).attr("id",id);
grapes.append("circle").attr("cx",0).attr("cy",0).attr("r", 6).attr("fill","purple").attr("class"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawGallows() {\r\n\t\tctx.beginPath();\r\n\t\tctx.strokeStyle = \"#666D69\";\r\n\t\tctx.lineWidth = 10;\r\n\t\tctx.moveTo(250, 400);\r\n\t\tctx.lineTo(450, 400);\r\n\t\tctx.stroke();\r\n\r\n\t\t// pole\r\n\t\tctx.moveTo(425, 400);\r\n\t\tctx.lineTo(425, 50);\r\n\t\tctx.stroke();\r\n\r\n\t\t// overhang\r\... | [
"0.70720094",
"0.6791544",
"0.6764628",
"0.6747588",
"0.6715227",
"0.65523326",
"0.6542784",
"0.6538768",
"0.65352166",
"0.6534434",
"0.6483116",
"0.646069",
"0.64300925",
"0.638295",
"0.63745725",
"0.6369789",
"0.63658774",
"0.6363863",
"0.63479817",
"0.6336732",
"0.6333974"... | 0.71263874 | 0 |
draws the cluster of grapes in center of screen that show top 10 wine varietals | function drawVarietalCluster()
{
const grapesPlot = d3.select("svg#grapes").append("g")
.attr('id', 'grapesPlot')
.attr("transform", "translate(" + 80 + "," + 80 + ")");
grapesPlot.append("text")
.attr("id", "starter-text")
.attr("x", 0)
.attr("y", 100)
.style("font-family","Avenir, sans-serif")
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawGrapes(x,y,rank,id){\n let grapes = vine.append(\"g\").attr(\"class\",\"grapeCluster\").attr(\"width\",18).attr(\"height\",18).attr(\"transform\",\"translate(\"+ x + \",\" + y + \")\").attr(\"rank\",rank).attr(\"id\",id);\n grapes.append(\"circle\").attr(\"cx\",0).attr(\"cy\",0).attr(\"r\", ... | [
"0.7048284",
"0.64419603",
"0.6188607",
"0.61632216",
"0.61579156",
"0.61176336",
"0.6115705",
"0.61104304",
"0.61024797",
"0.6098017",
"0.6082928",
"0.60635406",
"0.6060658",
"0.60566884",
"0.6036548",
"0.6008764",
"0.5982902",
"0.59620124",
"0.5919106",
"0.59106076",
"0.591... | 0.6467758 | 1 |
Set the velocity for the sprite, in world units | setVelocity(vxWorld, vyWorld) {
this.vx = vxWorld
this.vy = vyWorld
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set targetVelocity(value) {}",
"function setPlayerVelocity(xspeed, yspeed, hMove, vMove) {\n if (hMove)\n player.body.velocity.x = xspeed;\n else if (vMove)\n player.body.velocity.y = yspeed;\n else {\n player.body.velocity.x = xspeed;\n player.body.velocity.y = yspeed;\n ... | [
"0.73574144",
"0.72072905",
"0.69946337",
"0.69349194",
"0.6886016",
"0.68774873",
"0.68385774",
"0.66845304",
"0.6670758",
"0.6617767",
"0.65744114",
"0.6570444",
"0.65527457",
"0.6532447",
"0.6501923",
"0.64720607",
"0.64396834",
"0.64345014",
"0.6426841",
"0.6404615",
"0.6... | 0.7906412 | 0 |
Make the sprite explode! | explode() {
//. default behavior will scatter the linesegments that make up
// the sprite, add flames, etc.
const s = new Sprite()
s.init(this.world)
s.setPos(this.x, this.y)
s.setVelocity(this.vx, this.vy - 15.0)
s.shapeModel.addPoint(0, -25) // 0
s.shapeModel.addPoint(10, 10) // ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function explode(){\r\n\t\tif (blowingup){\r\n\t\t\t\tvar thisExplosion = $('.explode');\r\n\t\t\t\tthisExplosion.attr('src', 'x'+ explodeFrame + '.png');\r\n\t\t\t\texplodeFrame++;\r\n\t\t\t\tif (explodeFrame == 6){\r\n\t\t\t\t\tblowingup = false;\r\n\t\t\t\t\texplodeFrame = 0;\r\n\t\t\t\t\texplodeLocation = \"0p... | [
"0.7592709",
"0.6960801",
"0.68496555",
"0.67855394",
"0.6777803",
"0.67548853",
"0.6739371",
"0.67038643",
"0.6651367",
"0.6650009",
"0.6569742",
"0.64173555",
"0.638961",
"0.63216627",
"0.6316664",
"0.6309626",
"0.6280052",
"0.6258038",
"0.62246543",
"0.6220881",
"0.6214966... | 0.75109774 | 1 |
Draw the sprite on the screen using the given view transformation | draw(graphics, view) {
// We have the model coordinates, need to convert to world coordinates
// using the sprite transformation, then convert to view coordinates
// using the view transformation.
// Can combine these into one transform for speed.
this.shapeDraw.copyFrom(this.shapeModel)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"render() {\n const x = this.x - spriteWidth / 2;\n const y = this.y - spriteHeight / 2;\n ctx.drawImage(Resources.get(this.sprite), x, y);\n }",
"render() {\n const x = this.x - spriteWidth / 2;\n const y = this.y - spriteHeight / 2;\n ctx.drawImage(Resources.get(this... | [
"0.6698646",
"0.6698646",
"0.6662607",
"0.66336423",
"0.66296893",
"0.66296893",
"0.66143817",
"0.66086024",
"0.66086024",
"0.64902997",
"0.64695346",
"0.64695346",
"0.64695346",
"0.6461269",
"0.6461269",
"0.6461269",
"0.6461269",
"0.64492065",
"0.64489454",
"0.64489454",
"0.... | 0.71081626 | 0 |
Add a line segment to the given point. Pass 1 to start a new line segment. | addLineTo(nPoint) {
this.nLine[this.nLines] = nPoint
this.nLines++
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addLine(colour, fromX, fromY, x, y) {\n var segment = {\n type: 'line',\n from_x: fromX,\n from_y: fromY,\n x: x,\n y: y,\n colour: colour,\n time: (new Date()).getTime()\n };\n ... | [
"0.7141408",
"0.68742007",
"0.6812269",
"0.6771289",
"0.6642728",
"0.66216236",
"0.66075945",
"0.6579505",
"0.65139455",
"0.6463168",
"0.6421294",
"0.6407595",
"0.6393177",
"0.6376799",
"0.63470733",
"0.6341669",
"0.63207614",
"0.629471",
"0.62337464",
"0.6207792",
"0.6194632... | 0.7100734 | 1 |
Transform this shape by the given 2d transform. Includes scale, rotate, and translate. Just need to transform the points and the bounding box. | transform(transform) {
for (let i = 0; i < this.nPoints; i++) {
const x = this.xPoints[i]
const y = this.yPoints[i]
this.xPoints[i] = (transform.a * x + transform.b * y + transform.c)
this.yPoints[i] = (transform.d * x + transform.e * y + transform.f)
}
// Transform the bounding rect... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"transformed(transform){\n let result = new AffineTransform();\n\n result.position = this.position.copy();\n result.position.mult(transform.scale);\n\n let rotated = new p5.Vector(result.position.x, result.position.y).rotate(transform.rotation);\n\n result.position.x = rotated.x;\n result.position... | [
"0.69434655",
"0.6625721",
"0.6429694",
"0.64057875",
"0.6306131",
"0.63051",
"0.6279978",
"0.6218586",
"0.6167974",
"0.60198534",
"0.6017826",
"0.59915483",
"0.5991218",
"0.5901093",
"0.5886633",
"0.58853334",
"0.58631146",
"0.5858091",
"0.5842395",
"0.58015144",
"0.57913196... | 0.7856774 | 0 |
See if this shape intersects anywhere with the given shape returns Point2D with intersection or null. | intersectsShape(shape2, graphics) {
// Walk through shape2's line segments and see if they intersect with
// our line segments.
// This is O(n^2) so won't scale.
//. first should check if the point is within the bounding box of this sprite -
// (x - bounds, y - bounds) to (x + bounds, y + bounds).... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function shapeIsSelected(shape)\n{\n if (GC.shape && shape && shape.type == \"rect\")\n {\n if (GC.shape.startX <= shape.startX &&\n GC.shape.startY <= shape.startY &&\n (GC.shape.startX + GC.shape.w) >= (shape.startX + shape.w) &&\n (GC.shape.startY + GC.s... | [
"0.5747776",
"0.56814677",
"0.5612978",
"0.5563387",
"0.54341775",
"0.54294604",
"0.5419943",
"0.54116845",
"0.5381093",
"0.53579396",
"0.53553027",
"0.5322815",
"0.5279806",
"0.5273247",
"0.5239785",
"0.52245706",
"0.52219784",
"0.5218621",
"0.52168995",
"0.52102566",
"0.517... | 0.6291874 | 0 |
Get the specified Segment object with the endpoints of the specified line segment, as stored in this shape's arrays. If the specified line segment is not a segment (ie it's a terminator), then return null. | getLineSegment(iLine) {
const nPoint = this.nLine[iLine]
const nPoint2 = this.nLine[iLine+1]
// First make sure we have a segment
if ((nPoint !== -1) && (nPoint2 !== -1)) {
const segment = new Segment()
segment.x1 = this.xPoints[nPoint]
segment.y1 = this.yPoints[nPoint]
segment.x... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getIntersectingSegment(polyline) {\n\n return null;\n}",
"function LineSegment(x1, y1, x2, y2) {\n this.x1 = x1;\n this.y1 = y1;\n this.x2 = x2;\n this.y2 = y2;\n}",
"function segment(line, intersect1, intersect2) {\n this.line = line;\n this.intersect1 = intersect1;\n this.intersect2 = ... | [
"0.6015265",
"0.5794449",
"0.56564814",
"0.56279933",
"0.5599059",
"0.5576398",
"0.5443771",
"0.5373606",
"0.53677636",
"0.5303693",
"0.5254785",
"0.52454513",
"0.52430516",
"0.52389246",
"0.51861584",
"0.5179382",
"0.5116732",
"0.5107453",
"0.5098564",
"0.50966793",
"0.50931... | 0.74014616 | 0 |
Set the translation (x and y shift) for this transform | setTranslation(x, y) {
this.c = x
this.f = y
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function set_translation(elem, x, y)\n{\n elem.style.OTransform =\n elem.style.MozTransform =\n \"translate({0}px, {1}px)\".fmt(x, y);\n elem.style.WebkitTransform = \"translate3d({0}px, {1}px, 0)\".fmt(x, y);\n}",
"translate(x, y) {\n\n this.tr.x += x;\n this.tr.y += y;\n }",
"function ... | [
"0.71797174",
"0.69720656",
"0.697041",
"0.69680417",
"0.68729",
"0.6790881",
"0.6783783",
"0.67807984",
"0.6737244",
"0.65662473",
"0.64979774",
"0.64968926",
"0.64611286",
"0.6433465",
"0.63972795",
"0.63839525",
"0.63839525",
"0.6376787",
"0.6316431",
"0.630539",
"0.623789... | 0.7332194 | 0 |
Get parameters for the line on which this line segment lies (ax + by = c). bug: didn't convert integers to floats before doing math!! bug: nasty reversed equations for slope resulted in sporadic errors. hard to find. | getLineParameters() {
if (this.x1 !== this.x2) {
this.a = ((this.y2 - this.y1)) / ((this.x1 - this.x2))
this.b = 1.0
this.c = this.a * this.x1 + this.b * this.y1
}
else {
this.a = 1.0
this.b = ((this.x1 - this.x2)) / ((this.y2 - this.y1))
this.c = this.a * this.x1 + this.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function d3_svg_lineSlope(p0, p1) {\n return (p1[1] - p0[1]) / (p1[0] - p0[0]);\n}",
"function d3_svg_lineSlope(p0, p1) {\n return (p1[1] - p0[1]) / (p1[0] - p0[0]);\n}",
"function d3_svg_lineSlope(p0, p1) {\n return (p1[1] - p0[1]) / (p1[0] - p0[0]);\n}",
"function d3_v3_svg_lineSlope(p0, p1) {\n return... | [
"0.6489644",
"0.6489644",
"0.6489644",
"0.64676255",
"0.6376238",
"0.61722517",
"0.61112726",
"0.6050368",
"0.59773993",
"0.59282976",
"0.5894365",
"0.5856916",
"0.585305",
"0.58405477",
"0.5804733",
"0.5795659",
"0.57800806",
"0.5746009",
"0.5714888",
"0.5711075",
"0.5653064... | 0.7327836 | 0 |
Draw this linesegment with the given optional color | drawSegment(graphics, color) {
if (color) graphics.setForeground(color)
graphics.drawLine(this.x1, this.y1, this.x2, this.y2)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawLine(ctx, startX, startY, endX, endY, color) {\n\tctx.save();\n\tctx.strokeStyle = color;\n\tctx.beginPath();\n\tctx.moveTo(startX, startY);\n\tctx.lineTo(endX, endY);\n\tctx.stroke();\n\tctx.restore();\n}",
"function drawLine(color, size, x1, y1, x2, y2){\r\n\t context.beginPath();\r\n\t cont... | [
"0.6774477",
"0.67167175",
"0.66347754",
"0.66326565",
"0.6567896",
"0.64344585",
"0.6410266",
"0.6356613",
"0.63524497",
"0.6332457",
"0.6325558",
"0.62821555",
"0.625854",
"0.62445253",
"0.619858",
"0.6178307",
"0.6164065",
"0.6157719",
"0.6147493",
"0.6135352",
"0.61296844... | 0.766714 | 0 |
Weaver weaves the selected patterns into the current pm. It contains set of basic weaving strategies which consist of mashup operations, called in sequence for each pattern types. weave parameter value pattern; input cp is the selected parameter value pattern | function weavePvalue(ComponentType,cp)
{
cp = JSON.parse(cp);
var lastPM = session.pm.pop();
var modules = lastPM.modules;
var isPresent = false;
for(var i in modules){
if(modules[i].type == ComponentType){
modules[i].conf = cp.conf;
isPresent = true;
var isInLayout = f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeSetPatterns(en,zee)\n{\n\n//This function will provide the max and min value for the next item\n//in the pattern\nfunction maxAndMinNextValue(minSoFar,total,level)\n{\nvar quotient = Math.floor(total/level)\nvar dividend = total%level\n//th\n//because the level is greater than one we can spread the to... | [
"0.45769978",
"0.45296738",
"0.4462019",
"0.44514078",
"0.43404448",
"0.42137605",
"0.41948298",
"0.41811916",
"0.4092463",
"0.40298823",
"0.39875132",
"0.3952672",
"0.3947555",
"0.3912934",
"0.3898997",
"0.3895441",
"0.3884513",
"0.38698488",
"0.38505724",
"0.3838462",
"0.38... | 0.5005478 | 0 |
Process in two steps. i check the 2 modules calling PV. If they are not present will be added by the call. Then i will add the wire that link the 2 components, removing old ones exiting from the source cmp | function weaveCompCoo(ComponentType,cp)
{
cp = JSON.parse(cp);
//Add modules if needed
for(var i in cp.modules){
weavePvalue(cp.modules[i].type,JSON.stringify(cp.modules[i]), true);
}
var wire = cp.wires[0];
var lastPM = session.pm.pop();
var modules = lastPM.modules;
//Set the wire
for(var i i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function weaveMultico(ComponentType,cp)\n{\n cp = JSON.parse(cp);\n /*try{\n \n var srcComponentID;\n \n if(session.pm[session.pm.length-1].layout.length < 2)\n {\n //set id for the newly added component, other than the default output component \n ... | [
"0.57160664",
"0.569046",
"0.5461919",
"0.53494006",
"0.5305206",
"0.52994967",
"0.5287011",
"0.5260312",
"0.5236465",
"0.5161192",
"0.5161172",
"0.5083368",
"0.50295055",
"0.49921283",
"0.4971469",
"0.49691075",
"0.49609432",
"0.49129176",
"0.48986214",
"0.4888481",
"0.48650... | 0.6319945 | 0 |
function to set newly added component ID | function setComponentID()
{
var randomnumber=Math.floor(Math.random()*300+1);
var cid="sw-"+randomnumber;
return cid;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_genCompIdIfNeeded() {\n if (!this._componentId) {\n this._componentName = this.component;\n this.component = '';\n }\n }",
"createId () {\n\t\tthis.attributes.id = this.useId || this.collection.createId();\n\t}",
"function addIdentifier() {\n $scope.dataAttr... | [
"0.7091953",
"0.6654105",
"0.6650432",
"0.6577607",
"0.6555204",
"0.65220004",
"0.6511421",
"0.6495877",
"0.64834785",
"0.6469977",
"0.64472395",
"0.6408331",
"0.6373564",
"0.6343223",
"0.631784",
"0.62926763",
"0.62677914",
"0.625963",
"0.6257422",
"0.6253137",
"0.62181866",... | 0.72885823 | 0 |
Create nav bar with links to each section | function makeNav () {
for (let i = 0; i < names.length; i++) {
let sectionName = names[i];
let link = document.createElement('a');
let listItem = document.createElement('li');
link.href = `#${sectionId[i]}`;
link.textContent = sectionName;
link.classList.add('menu__link');
listItem.appendC... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generateNav() {\n sections.forEach(section => {\n let listItem = document.createElement('li')\n let anchorItem = document.createElement('a')\n anchorItem.classList.add('menu__link', `${section.id}`) //add class attribute to anchorItem\n anchorItem.setAttribute('href', `#${se... | [
"0.7628883",
"0.7600438",
"0.7591685",
"0.75363237",
"0.75029385",
"0.73967123",
"0.7331852",
"0.73251504",
"0.72837734",
"0.72696465",
"0.7262941",
"0.7186951",
"0.7176986",
"0.7174363",
"0.7163929",
"0.71530205",
"0.71503985",
"0.71453553",
"0.71423167",
"0.7131698",
"0.710... | 0.76795536 | 0 |
A material for a texture that has premultiplied alpha. Output is premultiplied. | function createPreMultAlphaMaterial() {
return new THREE.ShaderMaterial({
transparent: true,
uniforms: {
opacity: { value: 1.0 },
texture: { },
color_add: { type: 'c', value: new THREE.Color( 0x0000000 ) },
},
verte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createAlphaMaterial() {\n\n return new THREE.ShaderMaterial({\n transparent: true,\n uniforms: {\n opacity: { value: 1.0 },\n texture: { },\n color_add: { type: 'c', value: new THREE.Color( 0x0000000 ) },\n },\n ... | [
"0.7174761",
"0.6471912",
"0.62805706",
"0.62518674",
"0.6212606",
"0.61491764",
"0.6119513",
"0.6098205",
"0.6097779",
"0.6072764",
"0.6023583",
"0.60219467",
"0.60219467",
"0.60185915",
"0.6011743",
"0.60094905",
"0.599048",
"0.5952425",
"0.5927345",
"0.5926735",
"0.5893144... | 0.77195054 | 0 |
A material for a texture with alpha (not premultiplied). Output is premultiplied. | function createAlphaMaterial() {
return new THREE.ShaderMaterial({
transparent: true,
uniforms: {
opacity: { value: 1.0 },
texture: { },
color_add: { type: 'c', value: new THREE.Color( 0x0000000 ) },
},
vertexShader... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createPreMultAlphaMaterial() {\n\n return new THREE.ShaderMaterial({\n transparent: true,\n uniforms: {\n opacity: { value: 1.0 },\n texture: { },\n color_add: { type: 'c', value: new THREE.Color( 0x0000000 ) },\n },\n ... | [
"0.75576115",
"0.6869558",
"0.6675775",
"0.6657973",
"0.6641178",
"0.6587851",
"0.65796703",
"0.65693516",
"0.6524403",
"0.6509119",
"0.64797395",
"0.6447423",
"0.635128",
"0.6348534",
"0.6344923",
"0.6338991",
"0.6338991",
"0.6285299",
"0.62798256",
"0.6231822",
"0.62034947"... | 0.741498 | 1 |
Write a function named decrement that accepts a number and returns the number minus 1 | function decrement(numero) {
return numero-1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function subtractOneFromNumber(x){\n return --x;\n}",
"decrement(){\n this.increment(null, true);\n }",
"function decreaseCount(number){\n return number - 1;\n }",
"function decreaseQuantity(quantity){\n return quantity - 1;\n}",
"function subtractOne(num) {\n return num - 1;\n}",
... | [
"0.78357774",
"0.76275116",
"0.7586656",
"0.7235869",
"0.71000046",
"0.7089377",
"0.7054979",
"0.7049362",
"0.70415604",
"0.6966661",
"0.6920301",
"0.68882227",
"0.6877173",
"0.6789176",
"0.6640221",
"0.66208196",
"0.6602415",
"0.650666",
"0.6472272",
"0.6465448",
"0.64084816... | 0.8294727 | 0 |
A triangle with sides a, b, and c is a right triangle iff a squared plus b squared is equal to c squared. Write a function named isRightTriangle with parameters a, b, and c that will be numbers, and that tells if the passed sides can make a right triangle (returns a boolean). | function rightTriangle(sideA,sideB,sideC) {
var combination1=((square(sideA)+square(sideB))==square(sideC));
var combination2=((square(sideB)+square(sideC))==square(sideA));
var combination3=((square(sideA)+square(sideC))==square(sideB));
return (combination1||combination2||combinatio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isTriangle(a,b,c) {\n longSide = Math.max(a,b,c);\n shortSide = Math.min(a+b, a+c, b+c);\n if (shortSide > longSide) {\n return true;\n }\n return false;\n}",
"function isTriangle(a,b,c){\n let numbers = [a,b,c];\n for (let i = 0; i <= 2; i++) {\n if ((Number.isInteger(numbers[i])) ... | [
"0.77190566",
"0.7401631",
"0.74009436",
"0.7346538",
"0.7261277",
"0.72500765",
"0.7245265",
"0.72041494",
"0.7142178",
"0.71070874",
"0.70914984",
"0.6742681",
"0.6488582",
"0.642885",
"0.6372638",
"0.6292575",
"0.6284455",
"0.6217388",
"0.6210017",
"0.62090653",
"0.6199109... | 0.7544849 | 1 |
Event callbacks on live nature changes on the Concept form This function retrieves the values for all the nature select elements, and send the ajax request | function request_concept_specifics(natures_selector)
{
var natures = []
natures_selector.each(function(index, element)
{
if (element.value)
{
natures.push(element.value)
}
})
$.ajax("/" + window.colle... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_natures_selector()\n { \n var natures_selector = $(\"#additional_nature_set-group\").find(\"select\").add(\"#id_primary_nature\") \n natures_selector.off(\"change\") // removes the existing change callbacks, as they would otherwise accumulate\n natures_selector.change({\"nature... | [
"0.6657403",
"0.6176932",
"0.6126747",
"0.60276663",
"0.5914171",
"0.5847089",
"0.5810293",
"0.5803266",
"0.5790103",
"0.5781003",
"0.57716084",
"0.5746626",
"0.57394093",
"0.57331634",
"0.5653074",
"0.5653",
"0.56298685",
"0.5626936",
"0.5623928",
"0.5622224",
"0.5617821",
... | 0.6753232 | 0 |
This function retrieves all the nature select elements in the current page state, and assign them a change callback | function get_natures_selector()
{
var natures_selector = $("#additional_nature_set-group").find("select").add("#id_primary_nature")
natures_selector.off("change") // removes the existing change callbacks, as they would otherwise accumulate
natures_selector.change({"natures_selector": natur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initOptions() {\n $('select#variant-select').change();\n}",
"function man_select_refresh(man_select_index){\n\tvar man_select = document.querySelectorAll(\".man_select\");\n\tif(man_select){\n\t\tif(man_select_index==false){\n\t\t\t// this method pass data from select tag to custom man_select start\n... | [
"0.6212483",
"0.60429233",
"0.6014794",
"0.6011259",
"0.5935866",
"0.59139365",
"0.5891363",
"0.58862317",
"0.587535",
"0.5870696",
"0.5793205",
"0.57931525",
"0.57923573",
"0.5783071",
"0.5781973",
"0.5766447",
"0.57661444",
"0.57572097",
"0.5750404",
"0.5706236",
"0.5699202... | 0.6450345 | 0 |
prune samples that have been merged | function pruneAggregated() {
return Sample.destroy({
where: { aggregated: false },
}).then(count => {
console.log('Pruned %d pre-aggregation samples', count);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"pruneBranches() {\n let node = this._top();\n let branches = node.branches;\n node.branches = [];\n for (let n = 0, l = branches.length; n < l; ++n) {\n this._mergeSets(node, branches[n]);\n }\n }",
"initiateSampleRemoval() {\n for ( let i = 0; i < this.dataSam... | [
"0.6258753",
"0.5927019",
"0.588363",
"0.570084",
"0.5527729",
"0.54536253",
"0.54509324",
"0.54429466",
"0.5414217",
"0.5401056",
"0.5379958",
"0.53742886",
"0.5373355",
"0.530908",
"0.53087693",
"0.5279522",
"0.52515256",
"0.5247359",
"0.522846",
"0.52206343",
"0.52188665",... | 0.6070107 | 1 |
Reads all the .pug post in the src_dir/post directory. Then generates a catalog.json that contains info of the post, and realizes other actions on the files. | async function processPost(){
const src_post = `${src_dir}/post`;
let file_list = getAllPugFiles(src_post);
// check if there are even files to be read in first place.
let no_more_files_to_add = file_list.length == 0;
let files_remaining_to_parse = file_list.length;
let aFileLessToParse = ()=>{files_remai... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function main () {\n const files = await fse.readdir(path.resolve(__dirname, 'source/_posts'))\n\n let posts = files.filter((file) =>\n fse.lstatSync(path.resolve(__dirname, 'source/_posts', file)).isFile() &&\n path.extname(file) === '.md'\n )\n\n posts = await Promise.all(\n posts.map((post)... | [
"0.66922575",
"0.6692068",
"0.6432416",
"0.63123477",
"0.59159464",
"0.58912444",
"0.5888182",
"0.5887013",
"0.5625334",
"0.5584094",
"0.5554377",
"0.5509373",
"0.54730844",
"0.53809464",
"0.53786516",
"0.5365319",
"0.53424656",
"0.53348184",
"0.53290826",
"0.5307301",
"0.529... | 0.7746662 | 0 |
submitForm Submit form to api and redirect to recipes page | submitForm(values) {
this.props.addNewRecipe(values);
this.props.history.push(`/recipes`);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function submitRecipe(recipe) {\n $.post(\"/api/recipes\", recipe, function() {\n window.location.href = \"/all-recipes\";\n });\n }",
"static makeNewRecipe(e) { \n e.preventDefault();\n\n fetch(BASE_URL, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n ... | [
"0.78043413",
"0.6808876",
"0.66739",
"0.66454387",
"0.663747",
"0.6622136",
"0.6606699",
"0.65599996",
"0.65501547",
"0.6543649",
"0.65425956",
"0.6510386",
"0.650936",
"0.64906055",
"0.6472512",
"0.6438307",
"0.6424231",
"0.63748926",
"0.63746864",
"0.63644505",
"0.6306751"... | 0.71018463 | 1 |
Determine if the resource supports tags This function combined with isTagProperty determines if the `cdk.TagManager` and `cdk.TaggableResource` can process these tags. If not, standard code generation of properties will be used. | function isTaggableResource(spec) {
if (spec.Properties === undefined) {
return false;
}
for (const key of Object.keys(spec.Properties)) {
if (property_1.isTagPropertyName(key) && property_1.isTagProperty(spec.Properties[key])) {
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async tagIsAvailable() {\n // get tag from state\n let tag = await this.state.tag\n tag = tag.toLowerCase()\n\n // is tag proper length\n if (tag.length<3 || tag.length>18)\n return false\n\n // is tag proper format\n if (tag.match(/^[a-z0-9]+$/i) === null)\n return false\n\n // i... | [
"0.5459515",
"0.5183016",
"0.5101307",
"0.5038446",
"0.4934403",
"0.49110132",
"0.48933616",
"0.48928654",
"0.48792675",
"0.48792675",
"0.48792675",
"0.48792675",
"0.48792675",
"0.48792675",
"0.48792675",
"0.48593038",
"0.48593038",
"0.48593038",
"0.48593038",
"0.48593038",
"... | 0.75628763 | 0 |
Drawing single branch from point to pint with given lineWidth | function drawBranch(startPoint, endPoint, lineWidth) {
ctx.save();
ctx.shadowColor = defaultShadowColor;
ctx.strokeStyle = treeTheme.branchColor;
ctx.shadowBlur = treeTheme.isDrawingShadows ? treeTheme.branchShadowBlur : 0;
ctx.lineWidth = lineWidth;
ctx.beginPath();
ctx.moveTo(startPoint.x, startPoint.y... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function branch(point, angle, length, currentDeepth, lineWidth) {\n if (isBranchFinished(currentDeepth)) {\n if (treeTheme.isDrawingLeaves) {\n drawSingleLeave(point);\n }\n return;\n };\n\n const variancedLentgh = calculateVariancedLength(length, treeStructureParams.branchLengthVariance);\n cons... | [
"0.66664517",
"0.65833205",
"0.64770067",
"0.6396286",
"0.6362151",
"0.635219",
"0.63505393",
"0.62926877",
"0.62925947",
"0.62626445",
"0.6255848",
"0.6254612",
"0.6240973",
"0.6225415",
"0.6208264",
"0.6178388",
"0.61776876",
"0.6177535",
"0.61360496",
"0.6107054",
"0.60775... | 0.761664 | 0 |
Complete the below challenges using the Ninja Class from the previous assignment. You may skip the functionality related to private variables. .punch() Add a new method to your Ninja class called .punch(). This method will take another Ninja instance and subtract 5 Health from the Ninja we passed in. Your .punch() shou... | function Ninja(name) {
this.name = name;
this.health = 100;
const speed = 3;
const strength = 3;
// Add methods to the Ninja prototype
// Log the Ninja's name to the console
Ninja.prototype.sayName = function() {
console.log("My ninja name is " + this.name + "!");
return... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Ninja(name){\n\n\tlet speed = 3;\n\tlet strength = 3;\n\tthis.name = name;\n\tthis.health = 100;\n\n\tthis.sayName = function(){\n\t\tconsole.log(this.name);\n\t}\n\n\tthis.showStats = function(){\n\t\tconsole.log(`Name: ${this.name}, Health: ${this.health}, Strength: ${strength}, Speed: ${speed}`);\n\t}\... | [
"0.79436487",
"0.7520884",
"0.71422005",
"0.7087528",
"0.6989569",
"0.6924803",
"0.6894741",
"0.6828153",
"0.68168104",
"0.65678984",
"0.6566503",
"0.6357814",
"0.6334355",
"0.6330213",
"0.6302415",
"0.6291347",
"0.62143934",
"0.6208932",
"0.61860806",
"0.6170651",
"0.616677"... | 0.8563815 | 0 |
Calculates the message database location. | _calculateMessageDbLocation() {
const result = path.format({dir: path.format({dir: this.config["database-url"], base: "messages"}), base: this.config["topic"]})
logger.debug(`MessageSender.constructor(): Initializing message database on: ${result}`)
return result
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _getLocateDirectory() {\n\t\treturn OS.Path.join(Zotero.DataDirectory.dir, LOCATE_DIR_NAME);\n\t}",
"get position()\n\t{\n\t\texchWebService.commonAbFunctions.logInfo(\"exchangeAbFolderDirectory: get position\\n\");\n\t\treturn 2;\n\t}",
"printDatabaseLocation() {\n console.log(FileSystem.docum... | [
"0.5490289",
"0.52497804",
"0.51815903",
"0.49421552",
"0.48682305",
"0.48295638",
"0.48137796",
"0.48024628",
"0.47953182",
"0.46619466",
"0.46573877",
"0.46315002",
"0.46238235",
"0.4621406",
"0.4620982",
"0.46051002",
"0.46030295",
"0.45795795",
"0.45712277",
"0.45679942",
... | 0.7744352 | 0 |
Initializes the bookkeeping of the sequence number. | async _initBookkeeping() {
logger.debug("MessageSender._initBookkeeping()")
this.bookkeepingDb = new PouchDB(this.config["bookkeeping-url"])
try {
// Check, if the bookkeeping information is already available
this.sequenceNoData = await this.bookkeepingDb.get("sequence-n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"init() {\n this.intOrderNumber = 0;\n }",
"init() {\n this.intOrderNumber = 0;\n }",
"async _incrementSequenceNo() {\n const that = this\n this.sequenceNoData[\"sequence-no\"]++\n return await that.bookkeepingDb.put(that.sequenceNoData).then((result) => {\n t... | [
"0.66270316",
"0.66270316",
"0.60842",
"0.6051813",
"0.599561",
"0.599398",
"0.5914017",
"0.5914017",
"0.5845496",
"0.58340484",
"0.58193237",
"0.57931775",
"0.57248807",
"0.5674876",
"0.56748086",
"0.5668248",
"0.5640497",
"0.5632043",
"0.5632043",
"0.5610838",
"0.56045026",... | 0.720728 | 0 |
Increments the sequence number not only in the receiver, but also in the database. | async _incrementSequenceNo() {
const that = this
this.sequenceNoData["sequence-no"]++
return await that.bookkeepingDb.put(that.sequenceNoData).then((result) => {
that.sequenceNoData._rev = result.rev
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"bumpSeqNum (stream) {\n\t\tthis.streamSeqNums[stream.id] = this.streamSeqNums[stream.id] || 0;\n\t\treturn ++this.streamSeqNums[stream.id];\n\t}",
"async getSeqNum () {\n\t\tif (this.assumeSeqNum) {\n\t\t\tthis.attributes.seqNum = this.assumeSeqNum;\n\t\t\treturn;\n\t\t}\n\t\tlet seqNum = null;\n\t\tlet numRetri... | [
"0.6447291",
"0.63583905",
"0.635168",
"0.63232243",
"0.63232243",
"0.62872076",
"0.62802273",
"0.5987526",
"0.59482336",
"0.59417474",
"0.59352314",
"0.5831025",
"0.5781871",
"0.57728297",
"0.57713044",
"0.5759183",
"0.5753677",
"0.5718835",
"0.5660861",
"0.56538546",
"0.564... | 0.7832711 | 0 |
The sequence number of a message must be continuously growing without gaps. This method returns only, using the resolve and the reject functions. In the case of success the resolved function will return the wrappedMessage, with the sequenceno and a new _id set. | async _setSequenceNo(wrappedMessage) {
logger.debug(`MessageSender._setSequenceNo(): ${this.sequenceNoData["sequence-no"]}`)
wrappedMessage["_id"] = `${this.config["originator"]}-${this.sequenceNoData["sequence-no"]}`
wrappedMessage["sequence-no"] = this.sequenceNoData["sequence-no"]
log... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getSeqNum () {\n\t\tif (this.assumeSeqNum) {\n\t\t\tthis.attributes.seqNum = this.assumeSeqNum;\n\t\t\treturn;\n\t\t}\n\t\tlet seqNum = null;\n\t\tlet numRetries = 0;\n\t\tlet gotError = null;\n\t\t// this is a mutex-type operation ... we never want to assign the same\n\t\t// sequence number to two posts ...... | [
"0.5884901",
"0.55511135",
"0.55505866",
"0.5463029",
"0.5196507",
"0.50992846",
"0.49494076",
"0.49179587",
"0.48422688",
"0.48082548",
"0.4772209",
"0.47637197",
"0.47627667",
"0.47579047",
"0.47459438",
"0.46887743",
"0.46850812",
"0.46771824",
"0.46754175",
"0.4665179",
"... | 0.6144395 | 0 |
Saves the message document in the queue database. | _saveMessage(messageDocument) {
logger.debug(`MessageSender._saveMessage(): document=${messageDocument}`)
return this.messageDb.put(messageDocument)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function saveMessage(data) {\n db.collection(\"messages\")\n .add(data)\n .then((docRef) => {\n console.log(\"Document written with ID: \", docRef.id);\n })\n .catch((error) => {\n console.error(\"Error adding document: \", error);\n });\n}",
"function saveMessage(message) {\n db\n ... | [
"0.68719417",
"0.66783506",
"0.66614103",
"0.6588832",
"0.6583437",
"0.65407795",
"0.65394944",
"0.6446536",
"0.64339983",
"0.6390258",
"0.6381058",
"0.6381058",
"0.6379458",
"0.6372544",
"0.63538444",
"0.6327642",
"0.63223517",
"0.63067186",
"0.6301362",
"0.6298576",
"0.6288... | 0.77564347 | 0 |
get creating boolean in the state | getCreatingFromState(state) {
return this._getSubState(state).creating || false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get boolValue() {}",
"getValue() {\n return this.state.isChecked;\n }",
"isOn() {\n\t\treturn !!this.at;\n\t}",
"getValueFromHashAsBoolean() {\n\n }",
"get biffState() {\n\t\treturn true;\n\t}",
"checkState() {\n const termTag = this.api.selection.findParentTag(this.tag, Marker.CSS);\n\n ... | [
"0.714157",
"0.6617718",
"0.6588249",
"0.65642697",
"0.6556404",
"0.64931494",
"0.6482987",
"0.6463557",
"0.6454971",
"0.6454971",
"0.6454971",
"0.63980734",
"0.63980734",
"0.63970345",
"0.6387171",
"0.6374696",
"0.6364061",
"0.635607",
"0.63409275",
"0.6323902",
"0.62558806"... | 0.77032423 | 0 |
Chart Version History Component | function Version(props) {
const { details, release, doHelmChartRollBack } = props;
const {
app_version, chart, description, revision, status, updated,
} = details;
return (
<Table.Row className="installed-chart-detail" data-testid="VersionRow">
<Table.Cell data-testid="tableCell" colSpan="2" clas... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createHistoryChartData() {\n let _graphData = this.getDefaultGraphData()\n\n _graphData.config.options.fill = false\n _graphData.config.mode = \"history\"\n\n const entities = this.entity_items.getEntityIds()\n entities.forEach((id) => {\n /**\n * current s... | [
"0.65009516",
"0.6328292",
"0.6148561",
"0.6147959",
"0.5845151",
"0.57601714",
"0.57426554",
"0.56640077",
"0.56622195",
"0.56611854",
"0.565996",
"0.56472766",
"0.5588547",
"0.5573507",
"0.55461043",
"0.55410266",
"0.55349624",
"0.55145186",
"0.548489",
"0.5469425",
"0.5461... | 0.67839354 | 0 |
Main hub for opening different pages based on their name. Handles coloring of the buttons etc | function otherTitlesOpenPageByName(pageName) {
// Remove highlighting
$('.sym-pageSelections > div').removeClass('selected-selector')
$('.otherTitles-main-content').html("<div class='sym-loading'>Loading...</div>")
// Select right page according to pageName, highlight its
// button and open the page
if (pag... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function index() {\n createMainWin().open();\n }",
"function openAHOFbar(){\n servePage('AHOF', 'pages/LargeBlocksTemplate', 'A History of Forests');\n}",
"function openPage(pageName, elmnt, color) {\n\t// Hide all elements with class=\"tabcontent\" by default */\n\tvar i, tabcontent, tablinks;\n\tt... | [
"0.639901",
"0.6388665",
"0.6322322",
"0.6235931",
"0.62347704",
"0.6162553",
"0.6118245",
"0.6060116",
"0.6055405",
"0.60383826",
"0.6027945",
"0.60208744",
"0.5996527",
"0.59740824",
"0.5961719",
"0.59332174",
"0.58966416",
"0.58445257",
"0.5843141",
"0.5835841",
"0.5820208... | 0.6877101 | 0 |
Callback which stores results of the API tests. params: currentResult: results of the API tests collectedResult: object containing the preparation test result | function storeResult(currentResult, collectedResult) {
// count the API
collectedApi++;
// get the API's id from the result
apiId = currentResult.api;
delete currentResult.api;
// store result
collectedResult.tests = currentResult;
results[apiId] = collectedResult;
if (collectedApi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async onTestResult(test, testResult, aggregatedResult) {\n const { testResults } = testResult;\n\n const caseResults = this.getCaseResults(testResults);\n\n // Only runs if case results are populated\n if (Object.keys(caseResults).length > 0) {\n console.log('Test Results');\n\n await Promise... | [
"0.62596416",
"0.61893207",
"0.61003935",
"0.60876626",
"0.6070788",
"0.59737194",
"0.58918923",
"0.5854717",
"0.58347315",
"0.5815029",
"0.5788586",
"0.5767009",
"0.57012326",
"0.5645629",
"0.5616362",
"0.5612654",
"0.5588956",
"0.5526924",
"0.55242187",
"0.5519564",
"0.5504... | 0.8104154 | 0 |
Format begin or end date range | formatDateSelection(dateRange, beginEnd) {
if (!/\d{2}-\d{2}-\d{4}/.test(dateRange[beginEnd])) {
return moment(dateRange[beginEnd]).format('MM-DD-YYYY');
}
return dateRange[beginEnd];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formatRange(range) {\n\t\t\tvar dateFormat = options.altFormat,\n\t\t\t formattedRange = {};\n\t\t\tformattedRange.start = $.datepicker.formatDate(dateFormat, range.start);\n\t\t\tformattedRange.end = $.datepicker.formatDate(dateFormat, range.end);\n\t\t\treturn JSON.stringify(formattedRange);\n\t\t}",... | [
"0.736855",
"0.73245454",
"0.71407783",
"0.7059002",
"0.6894728",
"0.6894728",
"0.6851597",
"0.6845826",
"0.67672235",
"0.66832876",
"0.66832876",
"0.66832876",
"0.66832876",
"0.6670862",
"0.6670862",
"0.6670862",
"0.6670862",
"0.6670862",
"0.65932864",
"0.65932864",
"0.65761... | 0.81149477 | 0 |
Sort denials and payment based on date of action | sortDenialsAndPayments(inventories, desc = true) {
return inventories.sort((curr, next) => {
const currDate = curr.dateRejected;
const nextDate = next.dateRejected;
if (currDate === nextDate) {
return 0;
}
// Sort desc or asc
if (desc) {
return currDate < nextDate... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sortByDonationDateUp() {\n arrayLivros.sort((a, b) => Date.parse(a._releaseDate) - Date.parse(b._releaseDate));\n}",
"function sortByDonationDateDown() {\n arrayLivros.sort((a, b) => Date.parse(b._releaseDate) - Date.parse(a._releaseDate));\n}",
"function sortByDueDate(list) {\n return list.s... | [
"0.63533586",
"0.63458425",
"0.63288176",
"0.61744386",
"0.6069475",
"0.60138875",
"0.59616226",
"0.5839536",
"0.58152395",
"0.57888466",
"0.5780798",
"0.57773876",
"0.5775132",
"0.574577",
"0.57456326",
"0.5723908",
"0.5712206",
"0.5703728",
"0.5697918",
"0.5687669",
"0.5671... | 0.76727414 | 0 |
Retrieve all supplier company activity or denials | getAll(query, isDenials = true, customer = null) {
const dateRange = this.getDateParams();
return Resource.get(this).resource(`SupplierCompany:getAllActivityRevised`, {
dateRange,
query,
companyId: auth.get(this).user.company._id,
isDenials,
customer
})
.then(res => {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getAll() {\n return Resource.get(this).resource('SupplierCompany:getAll')\n .then((res) => {\n this.companies = res;\n });\n }",
"function getCommercials() {\n const options = {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: \"... | [
"0.65788513",
"0.61828953",
"0.61386204",
"0.6128913",
"0.6105203",
"0.6019128",
"0.5975425",
"0.5890122",
"0.5844879",
"0.563833",
"0.56241375",
"0.55954385",
"0.5595233",
"0.55909324",
"0.55070347",
"0.5453147",
"0.5450952",
"0.5439269",
"0.543563",
"0.5417613",
"0.54013836... | 0.6503117 | 1 |
Retrieve params in range for dropdowns | getParamsInRange() {
const dateRange = this.getDateParams(true);
const companyId = auth.get(this).user.company._id;
return Resource.get(this).resource('SupplierCompany:getParamsInRange', {
dateRange, companyId
})
.then(params => {
this.displayData.params.batches = params.batches;
t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getParameterRange(sheet){\n return sheet.getRange(1,5,3,1);\n}",
"GetRange() {\n\n }",
"function getRangeValue(values, fieldName) {\n var result = [];\n if (!_.isNil(values[0])) {\n result.push([fieldName + 'From', values[0]].join('='));\n }\n\n if (!_.isNil(values[1])) ... | [
"0.624685",
"0.6021396",
"0.59911716",
"0.59440976",
"0.59425324",
"0.5870704",
"0.58208835",
"0.5808103",
"0.5790143",
"0.5773393",
"0.5773393",
"0.5773393",
"0.5773393",
"0.5728185",
"0.56793225",
"0.56638765",
"0.5661652",
"0.5661053",
"0.5658304",
"0.56532234",
"0.565007"... | 0.63378465 | 0 |
new Loader( parent [, options ] ) Module loader constructor The Loader constructor creates a new loader. The first argument is the parent loader. The second is an options object options.global The loader's global object options.baseURL The loader's base URL options.linkedTo The source of the loader's intrinsics (not im... | function Loader(parent, options) {
// Initialization of loader state from options
this._global = options.global || Object.create(null);
this._baseURL = options.baseURL || this.global && this.global.baseURL;
if (options.linkedTo === null || options.linkedTo) {
throw new Error("Setting 'linkedTo' n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function LocalLoader() { }",
"function LoadModule(loader, name, options) {\n var loaderData = GetLoaderInternalData(loader);\n\n //> 1. Let name be ToString(name).\n //> 1. ReturnIfAbrupt(name).\n name = ToString(name);\n\n //> 1. Let address be GetOption(options, `\"address\"`).\n //> 1. R... | [
"0.65216255",
"0.6092165",
"0.59512347",
"0.59286696",
"0.59286696",
"0.59286696",
"0.5914643",
"0.59035695",
"0.5696786",
"0.5682871",
"0.56822103",
"0.5643976",
"0.56030846",
"0.56030846",
"0.56030846",
"0.56030846",
"0.56030846",
"0.55886704",
"0.55790627",
"0.55653536",
"... | 0.8935368 | 0 |
Sets the state of 'archiveSelected' based on whether the user has selected an archive. | enableSelectArchiveBtnFn() {
var select = document.getElementById("archivesListBox");
this.setState( { archiveSelected: (select.selectedIndex != -1) } );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"archiveModalToggle() {\n\t\tthis.setState({\n\t\t\tconfirmArchive: !this.state.confirmArchive\n\t\t});\n\t}",
"toggleArchive() {\n MemberActions.updateArichiveStatus(this.props.archived, this.props.memberID);\n this.props.unselect();\n }",
"archiveStatusToggle() {\n\t\tthis.setState({\n\t\t\tisArchived:... | [
"0.6550436",
"0.63903594",
"0.63791865",
"0.5934368",
"0.5931511",
"0.59045225",
"0.52504265",
"0.5212393",
"0.5146489",
"0.5139275",
"0.5118319",
"0.5070465",
"0.4972941",
"0.4969194",
"0.4863194",
"0.4852922",
"0.47875267",
"0.47657818",
"0.47506425",
"0.47443846",
"0.46877... | 0.6976301 | 0 |
Checks if the model has been built, and if so, sets the 'modelCreated' state | checkIfModelBuiltFn () {
fetch(test_url + '/TM/ldamodel', {
mode: 'cors',
method: 'GET'
})
.then((resp) => resp.json())
.then((data) => {
var modelBuilt = data['modelBuilt'];
if (modelBuilt) {
clearInterval(this.timerId);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function modelReady() {\n // model is ready\n console.log('Model Loaded!');\n modelIsReady = true;\n}",
"_initializeNewModel() {\n this._registerAllStates();\n this.initializeNewModel();\n }",
"function modelReady() {\n console.log(\"model ready\");\n}",
"init() {\n this.createModel();\n }",
... | [
"0.6276292",
"0.6141705",
"0.59810036",
"0.59702486",
"0.5884887",
"0.586849",
"0.5861625",
"0.5810978",
"0.5792216",
"0.5725809",
"0.5687234",
"0.5663884",
"0.56561154",
"0.563733",
"0.5628537",
"0.5581617",
"0.5565663",
"0.5550229",
"0.55401",
"0.5535523",
"0.55183053",
"... | 0.65734375 | 0 |
Requests a word cloud for a particular topic and sets the word cloud control with the data for this image. | getWordCloudFn () {
var chosenTopicIDText = document.getElementById('chosenTopicIDText');
// From the perspective of the user, topics range from 1 to #topics
var chosenTopicNumber = parseInt(chosenTopicIDText.value, 10);
chosenTopicNumber -= 1;
fetch(test_url + '/TM/topics/' + ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_createCloudFromData() {\n //generate word DOM Elements\n this._data['topics'].map((value, index) => {\n value.el = this._createWord(value);\n return value;\n });\n this._layoutWords();\n }",
"function updateWordCloud() {\r\n var wordCloud = [];\r\n var wordFreq = getFrequencyDict(g_word... | [
"0.69133675",
"0.6396102",
"0.6102723",
"0.60932714",
"0.5908574",
"0.58926624",
"0.58780336",
"0.58629686",
"0.57434535",
"0.57235366",
"0.57111144",
"0.566509",
"0.5544213",
"0.55260587",
"0.5479361",
"0.54637533",
"0.54420465",
"0.54417926",
"0.53769904",
"0.5334733",
"0.5... | 0.710588 | 0 |
Requests the topic distribution and sets the appropriate control with the data for this image. | getTopicDistributionFn () {
fetch(test_url + '/TM/topicdistribution', {
mode: 'cors',
method: 'GET'
})
.then((resp) => resp.text())
.then(function (data) {
var wcImage = document.getElementById('topicDistributionImg');
wcImage.src = "data:i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateTopics(topics) {\n topics.forEach(function(d) {\n d.r = r(d.count);\n d.cr = Math.max(minRadius, d.r);\n d.k = fraction(d.parties[0].count, d.parties[1].count);\n if (isNaN(d.k)) d.k = .5;\n if (isNaN(d.x)) d.x = (1 - d.k) * width + Math.random();\n d.bias = .5 - Math.max(.1, Math... | [
"0.5534985",
"0.5534985",
"0.5534985",
"0.5534985",
"0.5534985",
"0.5534985",
"0.5534985",
"0.5534985",
"0.5534985",
"0.5534985",
"0.5534985",
"0.5534985",
"0.5534985",
"0.5534985",
"0.5534985",
"0.5534985",
"0.5534985",
"0.5534985",
"0.5534985",
"0.5534985",
"0.5534985",
"... | 0.57814306 | 0 |
Store the stop words in the state per the React architecture | handleStopWordChange(e) {
this.setState( {stopWords: e.target.value});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"componentDidMount() {\n let wordList = [];\n\n // This will break down all the words selected by the user..\n if(this.props.wordBlock && this.props.wordBlock.textBlocks && this.props.wordBlock.textBlocks.length > 0) {\n for(let idx=0; idx < this.props.wordBlock.textBlocks.length; idx++) {\n\n ... | [
"0.65555954",
"0.6176844",
"0.6132541",
"0.6128103",
"0.6087585",
"0.6079778",
"0.6075501",
"0.6058488",
"0.6000817",
"0.59509027",
"0.5947353",
"0.5920572",
"0.5874716",
"0.5698022",
"0.5691452",
"0.56883776",
"0.5682862",
"0.5663492",
"0.5661529",
"0.5659397",
"0.56346107",... | 0.7580796 | 0 |
selecionar produto do pedido | selecionarProduto() {
cy.get('#\\31 37012_order_products').select('7')
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function obtenerDatosProducto(producto) {\n console.log(producto)\n const productoAgregado = menu.find((item) => producto === `sku_${item.id}`)\n}",
"function accionConsultarProducto(){\n listado1.actualizaDat();\n var numSelec = listado1.numSelecc();\n if ( numSelec < 1 ) {\n GestionarMensaje(... | [
"0.6475787",
"0.62880987",
"0.62653434",
"0.6249003",
"0.60170966",
"0.5991508",
"0.5965758",
"0.5864949",
"0.584467",
"0.581804",
"0.5778012",
"0.5771745",
"0.5767176",
"0.5752383",
"0.5751973",
"0.5737025",
"0.5735629",
"0.5731194",
"0.57171226",
"0.5711983",
"0.56921285",
... | 0.63023937 | 1 |
Alternative Text as the API server doesn't provide it. | static getAlternativeText(id) {
const altTexts = {
1: "Interior of Mission Chinese Food",
2: "Pizza Quattro Formaggi",
3: "Interior of Kang Ho Dong Baekjeong",
4: "Outside view of Katz's Delicatessen at night",
5: "Open kitchen of Roberta's Pizza",
6: "People queueing at Hometown... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static getAlternativeText(id) {\r\n const altTexts = {\r\n 1: \"Inside view of Mission Chinese Food in Manhattan\",\r\n 2: \"Image of pizza at Emily in Brooklyn\",\r\n 3: \"Interior view of Kang Ho Dong Baekjeon in Manhattan\",\r\n 4: \"Exterior view of entrance to Kat's Delicatessen in Manh... | [
"0.691888",
"0.6064115",
"0.60302943",
"0.60302943",
"0.6026491",
"0.5984088",
"0.59722394",
"0.5968696",
"0.5968696",
"0.5792845",
"0.5792779",
"0.5789919",
"0.5788804",
"0.57882124",
"0.57768494",
"0.57635385",
"0.5762822",
"0.5760131",
"0.5757457",
"0.5705288",
"0.56755",
... | 0.7015349 | 0 |
logResult is available for debugging puprposes, it does some logging of the JSON data. | static logResult(result) {
console.log(result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function logResults(data) {\n console.log(data);\n}",
"function log(file, resource, version, contentType, result) {\n console.log(\"OK \" + file + \" -> \" + resource + \":\" + version + \" (\" + contentType + \") \" + result.join(\" \"));\n }",
"function Logger(number, result) {\n console.log(`#${... | [
"0.7095937",
"0.6455002",
"0.6452474",
"0.64300567",
"0.6231528",
"0.6229923",
"0.6179907",
"0.6168406",
"0.5934077",
"0.5905515",
"0.5898984",
"0.5898984",
"0.58849967",
"0.58803034",
"0.581198",
"0.5736194",
"0.56662375",
"0.5601752",
"0.55582005",
"0.55556804",
"0.55525637... | 0.78843385 | 0 |
validateResponse checks if the response is valid (is it a 200299?). | static validateResponse(response) {
if (!response.ok) {
throw Error(response.statusText);
}
return response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"validateResponse (data) {\n\t\tthis.validateDisposition(data);\n\t\tthis.validateVersionInfo(data);\n\t\tthis.validateAgentInfo(data);\n\t\tthis.validateAssetUrl(data);\n\t}",
"validateResponse (data) {\n\t\tAssert(data.codeError.modifiedAt >= this.modifiedAfter, 'modifiedAt is not greater than before the code e... | [
"0.70546347",
"0.69111073",
"0.6718513",
"0.6628638",
"0.65839183",
"0.6540418",
"0.6537855",
"0.6516042",
"0.6502888",
"0.64629924",
"0.64596903",
"0.63778824",
"0.6338962",
"0.63133854",
"0.6307669",
"0.6297714",
"0.62408966",
"0.62348735",
"0.62023544",
"0.6177933",
"0.617... | 0.75457776 | 0 |
readResponseAsJSON reads the body of the response using the Response.json() method. | static readResponseAsJSON(response) {
return response.json();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseResponseJson(response) {\n return response.json();\n }",
"function getResponseJson(response) {\n // create error here to preserve caller stack trace\n const jsonError = new Error();\n\n return response.text().then(text => {\n try {\n return JSON.parse(text);\n ... | [
"0.6953859",
"0.68210876",
"0.65538776",
"0.6518471",
"0.6420013",
"0.6379603",
"0.6374072",
"0.63605636",
"0.62281454",
"0.62281454",
"0.6166683",
"0.6166683",
"0.6166683",
"0.6166683",
"0.6166683",
"0.6166683",
"0.6166683",
"0.6166683",
"0.6166683",
"0.6166683",
"0.6166683"... | 0.80981636 | 0 |
readResponseAsText reads the body of the response using the Response.text() method. | static readResponseAsText(response) {
return response.text();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function readData(response) {\n if (\n response.headers.get(\"Content-Type\") &&\n response.headers\n .get(\"Content-Type\")\n .toLowerCase()\n .indexOf(\"application/json\") >= 0\n ) {\n return response\n .json(... | [
"0.6186297",
"0.55849636",
"0.5566688",
"0.5550989",
"0.5523919",
"0.5521039",
"0.5521039",
"0.5521039",
"0.5521039",
"0.5521039",
"0.5521039",
"0.5521039",
"0.5521039",
"0.5521039",
"0.5521039",
"0.5521039",
"0.5521039",
"0.5521039",
"0.5521039",
"0.5521039",
"0.5521039",
... | 0.8020511 | 0 |
Returns the relative url for a restaurant. | static getRestaurantURL(restaurant) {
return `restaurant.html?id=${restaurant.id}`
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static urlForRestaurant(restaurant) {\n return (`./restaurant.html?id=${restaurant.id}`);\n }",
"static urlForRestaurant(restaurant) {\r\n return (`./restaurant.html?id=${restaurant.id}`);\r\n }",
"static imageUrlForRestaurant(restaurant) {\n let url = `/img/${(restaurant.photograph||restaurant.id)}... | [
"0.7649745",
"0.7628896",
"0.61277384",
"0.6118134",
"0.59868926",
"0.5962579",
"0.5878922",
"0.58754414",
"0.5850543",
"0.58316296",
"0.582769",
"0.5759839",
"0.5754271",
"0.57488567",
"0.5739362",
"0.57309014",
"0.573036",
"0.57131505",
"0.56665295",
"0.5641332",
"0.562999"... | 0.8093903 | 0 |
Add a Google Maps marker for a restaurant. | static addMarkerForRestaurant(restaurant, map) {
const marker = new google.maps.Marker({
position: restaurant.latlng,
title: restaurant.name,
url: DBHelper.getRestaurantURL(restaurant),
map: map,
animation: google.maps.Animation.DROP}
);
return marker;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static mapMarkerForRestaurant(restaurant, map) {\n // https://leafletjs.com/reference-1.3.0.html#marker\n const marker = new L.marker([\n restaurant.latlng.lat, restaurant.latlng.lng\n ], {\n title: restaurant.name,\n alt: restaurant.name,\n url: DBHelper.urlForRestaurant(restaurant)\n... | [
"0.7641561",
"0.76258725",
"0.7624223",
"0.76235723",
"0.76187855",
"0.7617982",
"0.761741",
"0.7615791",
"0.76135254",
"0.7609268",
"0.76075965",
"0.76052153",
"0.76052153",
"0.76052153",
"0.76052153",
"0.76052153",
"0.76052153",
"0.76052153",
"0.76049995",
"0.7604168",
"0.7... | 0.8262316 | 0 |
Prevent user from selecting activities same day and time. This function is call in the activity event listerner | function activiySelection(event){
const activityDayTime = event.dataset.dayAndTime;
for (let i = 0; i < activityBoxInput.length; i++) {
const element = activityBoxInput[i].dataset.dayAndTime;
//check the attribute day and time of selected activity then disable the other with the same attribute.
if (activityDayT... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkSchedule(event) {\n let eventName = event.name\n // iterate through the activities\n for (let i = 0; i < activities.length; i++) {\n // skip clicked item\n if (activities[i].name != eventName) {\n //check dataset dayAndTime for conflict\n if (activities[i].dataset.dayAndTime === ev... | [
"0.7169495",
"0.63363385",
"0.6303357",
"0.6013062",
"0.5810477",
"0.5771598",
"0.5766212",
"0.57640356",
"0.57343304",
"0.57096654",
"0.56831115",
"0.5565379",
"0.5559448",
"0.55381304",
"0.5537861",
"0.5536378",
"0.55350214",
"0.55199087",
"0.55034924",
"0.5491522",
"0.5469... | 0.6876009 | 1 |
Helper function to set op to contain a noop. | function setNoOp(op) {
delete op.op;
delete op.create;
delete op.del;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"NOP(op){}",
"function noop() {\n // No operation performed.\n }",
"function noop() {\n // No operation performed.\n }",
"function noop() {\n // No operation performed.\n }",
"function noop() {\n // No operation performed.\n }",
"function noop() {\n // No operation performed.\... | [
"0.7568594",
"0.75330305",
"0.75330305",
"0.75330305",
"0.75111663",
"0.75111663",
"0.7507872",
"0.75034076",
"0.75034076",
"0.75034076",
"0.75034076",
"0.75034076",
"0.75034076",
"0.75034076",
"0.75034076",
"0.75034076",
"0.75034076",
"0.75034076",
"0.75034076",
"0.75034076",
... | 0.8116839 | 0 |
Transform server op data by a client op, and vice versa. Ops are edited in place. | function transformX(client, server) {
// Order of statements in this function matters. Be especially careful if
// refactoring this function
// A client delete op should dominate if both the server and the client
// delete the document. Thus, any ops following the client delete (such as a
// subsequent creat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function OperationsImpl(client) {\n this.client = client;\n }",
"handle(operation, key, data, src, dst) {}",
"function apply(data, op) {\n return (data instanceof Node) ?\n deserializedApply(data, op) :\n serializedApply(data, op);\n}",
"applyOp(op) {\n // When an op is received, transfor... | [
"0.55297625",
"0.51680255",
"0.5090732",
"0.50471884",
"0.5015809",
"0.49269935",
"0.48751605",
"0.4853207",
"0.48478723",
"0.48276103",
"0.479406",
"0.47875795",
"0.4766547",
"0.47571126",
"0.47551626",
"0.47551626",
"0.47286588",
"0.47253245",
"0.47241908",
"0.46613443",
"0... | 0.66534364 | 0 |
BLOCK GET DATA WILAYAH KEPOLISIAN BY ID | function getData(id) {
var def = $q.defer();
return $http.get(urlWilayah + '/' + id)
.success(getDataWilayah)
.error(errorDataWilayah);
function getDataWilayah(response) {
def.resolve(response);
}
function errorDataWilayah() {
def.reject('Tidak dapat meng... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getData(id) {\n // the operations\n}",
"async function requestKeggData(id, i) {\n await new Promise(_ => setTimeout(_, i * 200));\n return fetch(keggGetCompoundURI(id))\n .then(r => r.text())\n .then(t => groupKeggResponse(t).map(reduceKeggEntry));\n}",
"function getDataById(id, data) {\n ... | [
"0.7346924",
"0.6436917",
"0.6335346",
"0.63348764",
"0.6196933",
"0.61469114",
"0.61104476",
"0.59219825",
"0.5913418",
"0.5867967",
"0.5866918",
"0.58351386",
"0.58300316",
"0.58246243",
"0.5823235",
"0.58072186",
"0.5794097",
"0.57859504",
"0.57722807",
"0.5758257",
"0.572... | 0.649739 | 1 |
Gets the user id if the username and password are correct | function getUserID(res, req, context, username, password, complete) {
mysql.pool.query("SELECT id FROM users WHERE username = ? AND password = ?", [username, password], function(error, results, fields) {
if (error) {
res.write(JSON.stringify(error));
res.end();
console.lo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getUserID() {\n if (!authUserID) {\n return false;\n }\n return authUserID;\n }",
"function getUserByID(id) {\n return db('username_password')\n .where('id', id)\n .first();\n}",
"function auth_getUserID() {\n var handler = \"authhandler\";\n var authMgr... | [
"0.7326958",
"0.6913429",
"0.68968153",
"0.6864041",
"0.6746446",
"0.66584325",
"0.6627462",
"0.6626266",
"0.66117954",
"0.65943277",
"0.6494767",
"0.64817137",
"0.64625823",
"0.6411129",
"0.6411024",
"0.639392",
"0.63788253",
"0.63717496",
"0.6371267",
"0.63632494",
"0.63595... | 0.69457275 | 1 |
function to show the flare | function showFlare(lon, lat) {
lonLatP4 = new OpenLayers.LonLat( lon, lat );
map.addLayer(markers);
icon = new OpenLayers.Icon('img/blue.png', size, offset);
changeableMarkerP4 = new OpenLayers.Marker(lonLatP4,icon);
markers.addMarker(changeableMarkerP4);
if(flareCounter < 0) {
flareCounter = 3; // sto... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showSprechblase_BlumeFlur(){\n document.getElementById('Sprechblase_BlumeFlur').style.display=\"block\"\n}",
"function surfSaferBlur() {\n surfSaferCollapse();\n\n // Show Surf safer content section \n $(\"#divImgSurfSafelyContent\").stop(true, true).fadeTo(100, 0);\n\n $(... | [
"0.61715543",
"0.60961574",
"0.60364056",
"0.58728254",
"0.5871846",
"0.5843865",
"0.583353",
"0.5787699",
"0.5782251",
"0.5765309",
"0.5745193",
"0.57289624",
"0.5721557",
"0.5701235",
"0.56921923",
"0.56827354",
"0.5652386",
"0.56461364",
"0.5635266",
"0.5634847",
"0.563484... | 0.6799851 | 0 |
Add an objects keys into the index | function addToIndex(obj, indexKeys) {
var key, indexItem, i;
for (i in indexKeys) {
key = indexKeys[i];
indexItem = index[key];
if (indexItem === void 0) {
indexItem = index[key] = {};
}
indexItem[obj.bob.index.call(obj).uid] = obj;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _index(objects) {\n var index = {};\n for (var i=0; i < objects.length; i++) {\n var n = objects[i];\n n.uuid = \"a\" + uuid();\n index[n.id] = n;\n }\n return index;\n }",
"function IndexSet() {\n this._indexes_lookup = {}; // To keep ... | [
"0.69758105",
"0.63262486",
"0.6198258",
"0.6196671",
"0.6153423",
"0.6047073",
"0.6017495",
"0.59320915",
"0.583641",
"0.58079714",
"0.5785103",
"0.57431936",
"0.57160074",
"0.56384295",
"0.5612783",
"0.55702084",
"0.55594414",
"0.5548752",
"0.5543855",
"0.5522313",
"0.55130... | 0.75449246 | 0 |
Remove one object from the index | function removeFromIndex(obj) {
var objKey, item, keys, j, key, indexItem;
// Find the item to delete
objKey = obj.bob.index.call(obj).uid;
item = items[objKey];
keys = item.keys;
// Iterate through all the keys and remove the item from each of them
for (j = 0; j < keys.length; j = j + 1) {
key... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"remove(idx) { \n\n }",
"removeAt(idx) {\n\n }",
"removeItem(index) {\n\t\tthis.model.splice(index, 1);\n\t}",
"deleteAt(index) {}",
"removeOnIndex(index) {\n if (index < 0) {\n console.error(`Index must be greater than 0!`);\n return false;\n }\n\n index = index = Math.floor(index);\n\... | [
"0.7870147",
"0.74968326",
"0.74198276",
"0.7394123",
"0.73353857",
"0.7332275",
"0.73272526",
"0.73134303",
"0.72945666",
"0.72941476",
"0.7203501",
"0.71967417",
"0.7156455",
"0.7152152",
"0.7139923",
"0.709394",
"0.70810753",
"0.7023391",
"0.7022268",
"0.6970923",
"0.69689... | 0.7734786 | 1 |
============================================================================================== Methods of class Interface end list of command implementations / hasTypecheck this nodes type against a list to check for membership _node:node to examine _types:list of types to check against | function hasType (_node, _types) {
var thisType = _node.type;
for (var i = 0, l = _types.length; i < l; i++) {
if (_types[i] === thisType || _types[i] === 'all') {
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isList(opts, node) {\n return opts.types.includes(node.type);\n}",
"function List(ary, type) {\n\n if (ary !== undefined) {\n var array = ary;\n }\n else {\n array = [];\n }\n\n this.ListContentType = type;\n\n this.TypeCheck = function (item) {\n\n if (this.ListC... | [
"0.5909807",
"0.56741893",
"0.56169766",
"0.54817015",
"0.5431302",
"0.5431302",
"0.5429483",
"0.53382754",
"0.52016366",
"0.5197892",
"0.512147",
"0.512147",
"0.51130056",
"0.50510186",
"0.504463",
"0.50438714",
"0.50438714",
"0.50438714",
"0.49695778",
"0.4967784",
"0.49488... | 0.5886551 | 1 |
receiveCommandthis takes commands from the event listener in the form of command objects. If a command expects a vimstyle range to operate on, it always should be first in the args array. command: incoming command TODO: parameters | function receiveCommand (_command) {
var target = cursor.getCurrent(),
cmd = _command.name,
args = _command.args,
info = commandBank[cmd];
// console.log("Executing: " + cmd + " with", (args.length) ? args : "no arguments");
// Check command metadata exists
if (typeof info === 'undefined') {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleCommand() {}",
"async handleCommand(command) {\n if (!ArgoBot.isBotCommand(command)) {\n return\n }\n const arr = command.split(\" \")\n const action = arr[1]\n\n const prNumber = this.appContext.payload.issue.number\n this.appContext.log(\"rece... | [
"0.6351442",
"0.6327539",
"0.59739035",
"0.59494483",
"0.5852178",
"0.5821451",
"0.57991767",
"0.5728545",
"0.5698516",
"0.56081665",
"0.55975556",
"0.55975556",
"0.5592054",
"0.5555778",
"0.5548777",
"0.55468035",
"0.5494812",
"0.5486869",
"0.5484709",
"0.54627866",
"0.54506... | 0.75250924 | 0 |
Tiene que recibir: la url a revisar indicar si es obligatorio [1|0]. Si es obligatorio, devuelve false si la url esta vacia indicar si validamos que la direccion pueda ser de un servidor ftp [1|0] Devuelve True o False | function isValidUrl(url,obligatory,ftp)
{
// Si no se especifica el paramatro "obligatory", interpretamos
// que no es obligatorio
if(obligatory==undefined)
obligatory=0;
// Si no se especifica el parametro "ftp", interpretamos que la
// direccion no puede ser una direccion a un servidor ftp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isValid(){\n try {\n fs.existsSync(this.websiteFolder) || raise(`Le site à l'adresse ${this.websiteFolder} est introuvable…`)\n this.url || raise(\"Il faut absolument l'URL du site, pour le tester en intégration.\")\n return true\n } catch (e) {\n App.onError(e)\n return false\n }... | [
"0.6750837",
"0.62224853",
"0.6022943",
"0.6006919",
"0.59099406",
"0.59027267",
"0.58757025",
"0.5848408",
"0.5837723",
"0.5782843",
"0.5768356",
"0.5764631",
"0.57391113",
"0.5721313",
"0.56945765",
"0.56792086",
"0.56738335",
"0.56582755",
"0.56533986",
"0.5637433",
"0.563... | 0.718039 | 0 |
Funcion listado alumnos becados | function listarAlumnosBec() {
tablabecAlm = $("#tbListadoBecadosAlm").dataTable({
"aProcessing" : true,
"aServerSide" : true,
dom : 'Bftrip',
buttons: [
],
"ajax" : {
url : "../ajax/doc/tutFunctions.php?oper=listarAlumnosBec",
type : "GET",
dataType : "json",
error : function(e) {
console.l... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lista_alumnos(){\n \tvar texto = \"<table style='border: 1px solid navy; background-color: ligth-gray;'><tr><th>Codigo</th> <th>Nombre</th><th>Nota</th> </tr>\";\n \tfor( num = 0; num < alumnos.length; num ++) {\n \t\t\ttexto += \"<tr> <td>\" + alumnos[num].codigo + \"</td> <td>\" + alumnos[num... | [
"0.68750477",
"0.6333363",
"0.6235123",
"0.61062",
"0.6044251",
"0.60428405",
"0.6038173",
"0.6035987",
"0.60267633",
"0.6024417",
"0.60124135",
"0.59804684",
"0.595042",
"0.59258044",
"0.5921152",
"0.59118587",
"0.5908614",
"0.5906451",
"0.58925384",
"0.58922017",
"0.5887257... | 0.6349607 | 1 |
getKeyboardShortcutHandler Gets the handler/callback function for a particular shortcut key | function getKeyboardShortcutHandler(keyCode) {
var _handler = null;
for (var shortcutKey in KEYBOARD_SHORTCUT_HANDLERS) {
var handler = KEYBOARD_SHORTCUT_HANDLERS[shortcutKey];
if (shortcutKey.length === 1 && typeof(shortcutKey) === 'string') {
// shortcutKey is a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleShortcutKeyPressed(e) {\n var keyCode = e.keyCode;\n var handler = getKeyboardShortcutHandler(keyCode);\n\n if (OLARK_EXPANDED) {\n // do nothing while olark expanded\n } else if (Y.WebConsole.isExpanded()) {\n // do nothing while console is expanded... | [
"0.6282229",
"0.5843757",
"0.5465772",
"0.54643863",
"0.54490036",
"0.5393602",
"0.5380009",
"0.5341349",
"0.52724636",
"0.52647305",
"0.52647305",
"0.5238256",
"0.5181393",
"0.5171631",
"0.51497364",
"0.5149535",
"0.5131119",
"0.5122244",
"0.51076394",
"0.5101767",
"0.509335... | 0.71864855 | 0 |
handleShortcutKeyPressed Retrieve the shortcut key handler and invoke it | function handleShortcutKeyPressed(e) {
var keyCode = e.keyCode;
var handler = getKeyboardShortcutHandler(keyCode);
if (OLARK_EXPANDED) {
// do nothing while olark expanded
} else if (Y.WebConsole.isExpanded()) {
// do nothing while console is expanded, except...
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onPressShortcut(e) {\n if (e.ctrlKey) {\n const keyPressed = String.fromCharCode(e.keyCode).toLowerCase();\n const $tool = document.querySelector(`a[data-shortcut=\"${keyPressed}\"]`);\n\n if ($tool) {\n $tool.click();\n }\n }\n}",
"function shortcut() {\n track('Options', 'Shortcu... | [
"0.62386036",
"0.6120102",
"0.6025511",
"0.5875754",
"0.5844059",
"0.5838568",
"0.58060217",
"0.5730612",
"0.571128",
"0.5644819",
"0.5578516",
"0.5473475",
"0.5449161",
"0.539908",
"0.5390189",
"0.5376753",
"0.5362795",
"0.5352651",
"0.53485507",
"0.5339036",
"0.533245",
"... | 0.71219766 | 0 |
computer first move when computer plays first | function CalculateComputerFirstMove() {
if ($(".modeactive").text() === game.modelegend) {
game.comfirst = false;
Makefirtsmove();
} else if ($(".modeactive").text() === game.modenormal) {
//on normal mode first two computer moves are random
RandomMove();
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function computerMove() {\n\tvar cpuPosition = current.selectTile(board);\n\tboard.placeTile(current, cpuPosition);\n\tvar box = document.querySelector(`.box[data-position=\"${cpuPosition}\"]`);\n\tbox.getElementsByClassName('tile-image')[0].src = current.img;\n\tif (board.isWinningState(current, cpuPosition)) {\n... | [
"0.7149662",
"0.71453506",
"0.701033",
"0.695972",
"0.68824196",
"0.6868179",
"0.67833984",
"0.6767671",
"0.66881675",
"0.6670425",
"0.6654516",
"0.6620881",
"0.66167516",
"0.6610012",
"0.6608469",
"0.6587627",
"0.65621954",
"0.6555923",
"0.6548387",
"0.654503",
"0.6541275",
... | 0.7348664 | 0 |
Create a marker for every station | function addPoints() {
//for every station in the dataset, create a marker
for(var i=0; i<dataTrento.length; i++) {
var station=dataTrento[i];
createMarker(station);
}
for(var i=0; i<dataPergine.length; i++) {
var station=dataPergine[i];
createMarker(station);
}
for(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createMarker(station) {\n let self = this;\n this.marker = new google.maps.Marker({\n position: station.position,\n map: self.map,\n title: station.name,\n icon: self.icon,\n status: station.status,\n availableBikes: station.available_... | [
"0.736227",
"0.7223042",
"0.7214538",
"0.71497995",
"0.7130025",
"0.70377874",
"0.6987744",
"0.6873121",
"0.6810696",
"0.67632073",
"0.6762567",
"0.67497516",
"0.6746789",
"0.6721112",
"0.6717346",
"0.66685534",
"0.66240495",
"0.6595036",
"0.6543177",
"0.6511113",
"0.6509692"... | 0.75418484 | 0 |
create a single marker from a station | function createMarker(station) {
var color;
//calculate the % of available bike
var percentuale = station.bikes/station.totalSlots;
//select the color based on %
if(percentuale>0.8) {
color = '#347235'; //medium forest green
}
else if(percentuale>0.6) {
color = '#4AA02C'; ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createMarker(station) {\n let self = this;\n this.marker = new google.maps.Marker({\n position: station.position,\n map: self.map,\n title: station.name,\n icon: self.icon,\n status: station.status,\n availableBikes: station.available_... | [
"0.718419",
"0.66017425",
"0.649706",
"0.64518285",
"0.64375955",
"0.64102095",
"0.6406933",
"0.6381366",
"0.6379206",
"0.6357795",
"0.6336788",
"0.63126147",
"0.6306851",
"0.62823665",
"0.627971",
"0.6255939",
"0.6227598",
"0.62143135",
"0.62086046",
"0.62048584",
"0.6170971... | 0.6704611 | 1 |
Possible opts: services: Array containing one or multiple of: (empty list means all) ['microsoftazure', 'amazonwebservices', 'googlecloud'] start: Date that indicates the start of the interval that is to be retrieved. end: Date that indicates the end of the interval that is to be retrieved. | function parse_opts(opts) {
query = {}
query['service'] = opts['service']
query['start'] = new Date(opts['start'] || 0).getTime()
if(opts['end']) {
query['end'] = new Date(opts['end']).getTime()
} else {
query['end'] = new Date().getTime()
}
return query
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getAvailabilityService(agendaIds, visitMotiveId, startDate, limit, cb) {\n if (!agendaIds)\n cb('You must pass the agendaIds parameter, array or a string format.');\n let queryString = this.formatParam(\"agenda_ids[]\", agendaIds);\n queryString = queryString.concat(\"&visit_motive_... | [
"0.5505017",
"0.5420057",
"0.53110844",
"0.5225172",
"0.51712686",
"0.51701117",
"0.51688355",
"0.5114982",
"0.5101406",
"0.50537694",
"0.5045517",
"0.49895966",
"0.49422255",
"0.49257505",
"0.49257505",
"0.4841492",
"0.48169222",
"0.48091158",
"0.48034227",
"0.4801775",
"0.4... | 0.6938773 | 0 |
Remove explosao depois de um tempo Remove a explosao | function removeExplosao() {
div.remove();
window.clearInterval(tempoExplosao);
tempoExplosao=null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CeEx (){\t\t// Cerrar explicación\n\tif (explicacionMostrando != ''){\n\t\tvar nodo = document.getElementById(explicacionMostrando + '_ex');\n\t\tnodo.parentNode.removeChild(nodo);\n\t}\n}",
"removerPosicao(posicao){}",
"function eliminarAuto() {\r\n\r\n document.getElementById(\"fila2\").remove();... | [
"0.6803385",
"0.662265",
"0.6465982",
"0.63918513",
"0.63815767",
"0.6350928",
"0.63204145",
"0.62881273",
"0.6263673",
"0.6246397",
"0.6245805",
"0.6237842",
"0.6169702",
"0.6165394",
"0.6150032",
"0.61419547",
"0.61215097",
"0.6117675",
"0.6111758",
"0.6082513",
"0.6075713"... | 0.8274161 | 0 |
Asserts that two product representations are the same. The products can be either (1) actual product model objects, (2) plain JavaScript objects with product properties, or (3) JSON representations returned from the API. Because products from mongo can have extra properties like _id and _v, we only compare the basic pr... | function productsShouldBeSame(product, other) {
product.name.should.equal(other.name);
product.description.should.equal(other.description);
product.url.should.equal(other.url);
product.categoryId.should.eql(other.categoryId);
product.shopzillaId.should.eql(other.shopzillaId);
if (product.images) {
['fou... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static isEquivalent(a, b) \n {\n // Create arrays of property names\n var aProps = Object.getOwnPropertyNames(a);\n var bProps = Object.getOwnPropertyNames(b);\n \n // If number of properties is different,\n // objects are not equivalent\n if (aProps.length != bProps.length) {\n return f... | [
"0.6037104",
"0.6014168",
"0.59928966",
"0.5928012",
"0.5902981",
"0.5883272",
"0.5862451",
"0.58398616",
"0.5793146",
"0.5792852",
"0.5776072",
"0.5763588",
"0.5753393",
"0.5736575",
"0.5725387",
"0.57184255",
"0.5715244",
"0.57118",
"0.57081",
"0.56842375",
"0.56842375",
... | 0.7984327 | 0 |
functions for invoicedetails.jsp For Listing Cart Items | function list_cart_items() {
var location_id = document.getElementById("txt_location_id").value;
var status = document.getElementById("txt_status").value;
var cart_session_id = document.getElementById("txt_session_id").value;
var vouchertype_id = document.getElementById("txt_vouchertype_id").value;
var vouche... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function list_cart_items() {\r\n\tvar location_id = document.getElementById(\"txt_location_id\").value;\r\n\tvar status = document.getElementById(\"txt_status\").value;\r\n\tvar cart_session_id = document.getElementById(\"txt_session_id\").value;\r\n\tvar vouchertype_id = document.getElementById(\"txt_vouchertype_... | [
"0.7257928",
"0.65852076",
"0.64904636",
"0.64879304",
"0.6451719",
"0.64492255",
"0.64375615",
"0.643297",
"0.6415026",
"0.6398449",
"0.6358447",
"0.63542026",
"0.6353997",
"0.63433903",
"0.63433903",
"0.6333231",
"0.6293765",
"0.62450147",
"0.6241192",
"0.62173676",
"0.6206... | 0.7176378 | 1 |
Function to launch the fireworks and show a message | function launchFireworks() {
particlesJS('particles-js', {
"particles": {
"number": {
"value": 300
},
"color": {
"value": ["#ff0000", "#00ff00", "#0000ff", "#ffff00", "#ff00ff", "#00ffff"]
},
"shape": {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function launchApp() {\r\n console.log(\"Hypersubs: Launching.\");\r\n $('#hypersubs-main-dialog').dialog('open');\r\n $('#hypersubs-splash').css('display', 'none');\r\n loadFlange(0, userPreferences.smartFill);\r\n }",
"function start() {\n const logoText = figlet.textSync(\"... | [
"0.6358017",
"0.61582667",
"0.61215234",
"0.6105228",
"0.5963108",
"0.58459336",
"0.57603127",
"0.5759167",
"0.5644921",
"0.5637158",
"0.5630055",
"0.5613056",
"0.5572077",
"0.5555592",
"0.5551215",
"0.5546907",
"0.5521669",
"0.5521669",
"0.5521669",
"0.5521669",
"0.5521669",... | 0.6805243 | 0 |
Removes extra form HTML when exploratory mode is selected. | function exploratoryMode() {
$("#start-to-end-fields").empty();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeForm() {\n const form = document.querySelector('#dino-compare');\n form.style.display = \"none\";\n }",
"function turnOffOtherForms() {\n\tif (document.getElementById('stringInput'))\n\t\tdocument.getElementById('stringInput').style.display = 'none'\n\tif (document.getElementById('branchWid... | [
"0.64754015",
"0.64233965",
"0.64110893",
"0.6050351",
"0.59790206",
"0.5936227",
"0.58718526",
"0.5832665",
"0.5823829",
"0.57990074",
"0.5660243",
"0.5635102",
"0.5632334",
"0.56313705",
"0.5626245",
"0.5611982",
"0.55962586",
"0.5557617",
"0.55574536",
"0.55520266",
"0.554... | 0.64653504 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.