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 |
|---|---|---|---|---|---|---|
Given a number, write a function to output its reverse digits. (e.g. given 123 the answer is 321) Numbers should preserve their sign; i.e. a negative number should still be negative when reversed. Examples 123 > 321 456 > 654 1000 > 1 My Answer | function reverseNumber(n) {
let num = n.toString().split('').reverse();
if(num[num.length-1] === '-') return +`-${num.slice(0, -1).join('')}`
return +num.join('');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function reverseNumber (n) {\n\n}",
"function reverse(n){\n let rev = 0;\n while (n) {\n rev = rev * 10 + n % 10;\n n = Math.floor(n/10);\n }\n return rev;\n}",
"function reverseNumber(n) {\n let number = n.toString()\n let result = \"\"\n let negative = \"\"\n\n if (number[0] ===... | [
"0.7916574",
"0.791645",
"0.7908909",
"0.78913623",
"0.78537804",
"0.7802481",
"0.7784979",
"0.77387637",
"0.77384275",
"0.7734385",
"0.77101624",
"0.77058756",
"0.7687466",
"0.7677917",
"0.76749206",
"0.7664473",
"0.76312757",
"0.7607273",
"0.7601349",
"0.75861746",
"0.75776... | 0.79659283 | 0 |
Changes the information in the project information div Input is the relevant project object from the projects array | function changeProjectInfo(project) {
// Update title
$("#title").text(project.title);
// Hide all project slideshow divs first
$(".project-slideshow-div").each(function() {
$(this).hide();
});
// Show relevant project slideshow
var projectId = "#show" + project.id;
$(projectId).css('display', '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"renderProjects (projects) {\n this.element.innerHTML = projects;\n }",
"function displayProject(index) {\n const project = `\n \n <div class=\"projectPhoto\">\n <img src=\"images/${projects[index].imageSmall}.pn... | [
"0.7149276",
"0.7122354",
"0.7097677",
"0.70886207",
"0.70124304",
"0.6997668",
"0.6981403",
"0.6981126",
"0.69629127",
"0.6929779",
"0.6888909",
"0.6864304",
"0.6829961",
"0.6829867",
"0.682507",
"0.6823933",
"0.6807992",
"0.68026304",
"0.6801803",
"0.6788203",
"0.67881954",... | 0.8123002 | 0 |
FUNCTIONS /////////////////////////////////////////////////////////////////////////////// Function to prep arguments into standardized object regardless of format parameters are provided in args are the default arguments keyword for the function defaultArgs is an object containing each key and default value needed for ... | function prepArgumentsObject(args,defaultArgs){
var argList = [].slice.call(args);
var outArgs = {};
// print('Default args:',defaultArgs);
//See if first argument is an ee object instead of a vanilla js object
var firstArgumentIsEEObj = false;
var argsAreObject = false;
try{
var t=argList[0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function defaults(dest) {\n\t var args = [];\n\t for (var _i = 1; _i < arguments.length; _i++) {\n\t args[_i - 1] = arguments[_i];\n\t }\n\t for (var i = arguments.length - 1; i >= 1; i--) {\n\t var source = arguments[i] || {};\n\t for (var key in source) {\n\t if (sourc... | [
"0.5950508",
"0.5935633",
"0.58381826",
"0.5805632",
"0.5777858",
"0.57257855",
"0.5711768",
"0.5671911",
"0.5596944",
"0.5588633",
"0.55793566",
"0.555281",
"0.55503094",
"0.5517211",
"0.5503083",
"0.5491704",
"0.5491402",
"0.5460399",
"0.54495317",
"0.54495317",
"0.5428371"... | 0.82402587 | 0 |
Function to create a multiband image from a collection Has been replaced by imageCollection.toBands() | function collectionToImage(collection){
var stack = ee.Image(collection.iterate(function(img, prev) {
return ee.Image(prev).addBands(img);
}, ee.Image(1)));
stack = stack.select(ee.List.sequence(1, stack.bandNames().size().subtract(1)));
return stack;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renameBands(image){\n var int = ee.String(image.get(interval)); \n var new_bands = [ (int.cat('B1')), // 1\n (int.cat('B2')), // 2\n (int.cat('B3')), // 3\n (int.cat('B4')), // 4\n (i... | [
"0.6675546",
"0.65494597",
"0.6340245",
"0.62898016",
"0.6257494",
"0.6133049",
"0.60705084",
"0.60190356",
"0.59054667",
"0.58596784",
"0.5848728",
"0.5822873",
"0.57342625",
"0.5725637",
"0.56990623",
"0.56804293",
"0.5516385",
"0.5456575",
"0.53949463",
"0.5384104",
"0.535... | 0.71206975 | 0 |
///////////////////////////////////////////////////////////////////////// Function to find the date for a given composite computed from a given set of images Will work on composites computed with methods that include different dates across different bands such as the median. For something like a medoid, only a single b... | function compositeDates(images,composite,bandNames){
if(bandNames === null || bandNames === undefined){
bandNames = ee.Image(images.first()).bandNames();
}else{images = images.select(bandNames);composite = composite.select(bandNames)}
var bns = ee.Image(images.first()).bandNames().map(function(bn){re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function nDayComposites(images,startYear,endYear,startJulian,endJulian,compositePeriod){\r\n \r\n //create dummy image for with no values\r\n var dummyImage = ee.Image(images.first());\r\n\r\n //convert to composites as defined above\r\n function getYrImages(yr){\r\n //take the year of the image\r\n var... | [
"0.6944221",
"0.6455057",
"0.62349075",
"0.6190912",
"0.60920274",
"0.58657",
"0.56054354",
"0.55864716",
"0.5475566",
"0.5467743",
"0.5420573",
"0.53788835",
"0.5186484",
"0.5105438",
"0.50999266",
"0.5084863",
"0.4994563",
"0.49319875",
"0.4926578",
"0.491287",
"0.49101397"... | 0.7698245 | 0 |
Function to get the abs diff from a given composite 1 | function getDiff(img,composite){
var out = img.subtract(composite).abs().multiply(-1).rename(bns);
return img.addBands(out);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function absDiff(n) {\n if(n>=0) {\n return n;\n } else {\n return n*-1;\n }\n}",
"function ml_z_abs(z1) {\n return ml_z_normalize(bigInt(z1).abs());\n}",
"function opaqueAbsForDCE(argument) {\n Math.abs(argument);\n}",
"function absDiff(n) {\r\n if (n <= 19) {\r\n return (19 - n);\r\n }\... | [
"0.6336196",
"0.60028905",
"0.59441525",
"0.58622897",
"0.58307755",
"0.5709898",
"0.56446946",
"0.56256896",
"0.56082195",
"0.5598534",
"0.55531794",
"0.55459887",
"0.5541673",
"0.55410504",
"0.5519805",
"0.5476418",
"0.5475504",
"0.54659706",
"0.5460922",
"0.54583615",
"0.5... | 0.6442475 | 0 |
///////////////////////////////////////////////////////////////////////// Function to handle empty collections that will cause subsequent processes to fail If the collection is empty, will fill it with an empty image | function fillEmptyCollections(inCollection,dummyImage){
var dummyCollection = ee.ImageCollection([dummyImage.mask(ee.Image(0))]);
var imageCount = inCollection.toList(1).length();
return ee.ImageCollection(ee.Algorithms.If(imageCount.gt(0),inCollection,dummyCollection));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Void_CheckCollectionEmpty(_Array_Model_, _Number_Count){\r\n\r\n\r\n\r\n _Array_Model_[_Number_Count].count({}, function(_Object_Error, _Object_Result){\r\n\r\n\r\n\r\n if(_Object_Error){\r\n\r\n console.log(_Object_Error);\r\n throw _Object_Error;\r\n\r\n }\r\n ... | [
"0.64865255",
"0.6169722",
"0.60852176",
"0.6060554",
"0.6060554",
"0.6026343",
"0.59058857",
"0.5895813",
"0.5806625",
"0.58011127",
"0.57698613",
"0.5746438",
"0.5741531",
"0.56413335",
"0.5584971",
"0.5543069",
"0.55342287",
"0.5534131",
"0.54945",
"0.54824334",
"0.5388605... | 0.7553805 | 0 |
Add sensor band function Add band tracking which satellite the pixel came from | function addSensorBand(img, whichProgram, toaOrSR){
var sensorDict = ee.Dictionary({'LANDSAT_4': 4,
'LANDSAT_5': 5,
'LANDSAT_7': 7,
'LANDSAT_8': 8,
'LANDSAT_9': 9,
'Sentinel-2A': 21,
'Sentinel-2B': 22,
'Sentinel-... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addBand (band = new Band ()) {\n //adicionar una banda nueva\n this.bands.push( band );\n }",
"function addAtmosBands(srimg){\n // var ozone = ee.Image(srimg.get('ozone')).select([0], ['OZONE']);\n var tair = ee.Image(ee.List(srimg.get('surface_temp')).get(0))\n .select([0], ['SRT... | [
"0.69587106",
"0.60751784",
"0.57529116",
"0.55859077",
"0.54573894",
"0.54000366",
"0.530827",
"0.5305024",
"0.5295938",
"0.52864057",
"0.526036",
"0.5247806",
"0.52475923",
"0.5213881",
"0.51932013",
"0.5188725",
"0.5175588",
"0.51747376",
"0.51493907",
"0.5141177",
"0.5137... | 0.73991466 | 0 |
Algorithm to defringe Landsat scenes | function defringeLandsat(img){
//Find any pixel without sufficient non null pixels (fringes)
var m = img.mask().reduce(ee.Reducer.min());
//Apply kernel
var sum = m.reduceNeighborhood(ee.Reducer.sum(), k, 'kernel');
// Map.addLayer(img,vizParams,'with fringes')
// Map.addLayer(sum,{'min':20,'max':24... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CalcFromStartToCurrent_gg(){ //2. Step 2 // LeavesActiveInScene = name & LeafAllWeights = weights\n\t\tfor (var a : int = 0; a < LeavesActiveInSceneInt.Length; a++ ){ \n\t\t\tWeighTheLeaves(LeavesActiveInSceneInt[a], FromStartToCurrentWeight_gg[a]);} \n\t}",
"function prestigeChanging2(){\n //find... | [
"0.58908606",
"0.5885551",
"0.5643787",
"0.561964",
"0.5600502",
"0.5595538",
"0.55700123",
"0.5551034",
"0.5548718",
"0.54989505",
"0.5489759",
"0.54888767",
"0.5483169",
"0.5473769",
"0.5471056",
"0.54582614",
"0.54578084",
"0.544684",
"0.54461664",
"0.5420387",
"0.5417716"... | 0.60585755 | 0 |
Function to simplify data into daily mosaics This procedure must be used for proper processing of S2 imagery | function dailyMosaics(imgs){
//Simplify date to exclude time of day
imgs = imgs.map(function(img){
var d = ee.String(img.date().format('YYYY-MM-dd'));
var orbit = ee.Number(img.get('SENSING_ORBIT_NUMBER')).int16().format();
return img.set({'date-orbit':d.cat(ee.String('_')).cat(orbit),'date':d});
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function soilmoistureToNDMI(data) {\n outData = {\n \"values\": []\n }\n let SMAPentries = Object.entries(data.SMAP);\n let NDMIentries = Object.entries(data.NDMI);\n let i = 0;\n for (var iii = 0; iii < SMAPentries.length; iii++) {\n if (SMAPentries[iii][1].category == null){\n ... | [
"0.60496104",
"0.5833143",
"0.5596125",
"0.5539797",
"0.55193925",
"0.54647344",
"0.5343373",
"0.53389037",
"0.53348815",
"0.5287041",
"0.5201341",
"0.51749116",
"0.517184",
"0.5170264",
"0.51360196",
"0.51328063",
"0.50995773",
"0.5095181",
"0.50879157",
"0.5047237",
"0.5047... | 0.71773183 | 0 |
Function for acquiring Landsat image collections See default arguments below Required arguments: studyArea,startDate,endDate,startJulian,endJulian Can be called on with parameters as an object or ordered set of parameters | function getLandsat(){
var defaultArgs = {
'studyArea':null,
'startDate':null,
'endDate':null,
'startJulian':null,
'endJulian':null,
'toaOrSR':'SR',
'includeSLCOffL7':false,
'defringeL5':false,
'addPixelQA':false,
'resampleMethod':'near',
'landsatCollectionV... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLandsatSR(startdate, enddate, poly){\n var bnames = [\"B1\",\"B2\",\"B3\",\"B4\",\"B5\",\"B7\",\"AO\",\"QA\"];\n var bnumbers = [0,1,2,3,4,5,6,7];\n var l5s = filterCollection(ee.ImageCollection('LEDAPS/LT5_L1T_SR'), startdate, enddate, poly)\n .select(bnumbers, bnames);\n return ee.Imag... | [
"0.6329993",
"0.6298882",
"0.62769926",
"0.6129743",
"0.6061464",
"0.59954846",
"0.5923578",
"0.58252656",
"0.57243884",
"0.55927217",
"0.5586018",
"0.5369262",
"0.53355014",
"0.5272085",
"0.52510947",
"0.52337307",
"0.51904494",
"0.5184924",
"0.5167858",
"0.5126204",
"0.5095... | 0.68838084 | 0 |
/////////////////////////////////////////// Implementation of Basic cloud shadow shift Author: Gennadii Donchyts License: Apache 2.0 Cloud heights added by Ian Housman yMult bug fix adapted from code written by Noel Gorelick by Ian Housman | function projectShadows(cloudMask,image,irSumThresh,contractPixels,dilatePixels,cloudHeights,yMult){
if(yMult === undefined || yMult === null){
yMult = ee.Algorithms.If(ee.Algorithms.IsEqual(image.select([3]).projection(), ee.Projection("EPSG:4326")),1,-1);
}
var meanAzimuth = image.get('MEAN_SOLAR_AZIMUT... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function projectShadows(cloudMask,image,cloudHeights){\n var meanAzimuth = image.get('MEAN_SOLAR_AZIMUTH_ANGLE');\n var meanZenith = image.get('MEAN_SOLAR_ZENITH_ANGLE');\n ///////////////////////////////////////////////////////\n \n \n //Find dark pixels\n var darkPixels = image.select(['nir','swir1','swir... | [
"0.6503795",
"0.6095439",
"0.6065211",
"0.6010469",
"0.5994846",
"0.59818953",
"0.59797144",
"0.5946523",
"0.593991",
"0.5930028",
"0.59086025",
"0.5867117",
"0.5824958",
"0.58229584",
"0.5777326",
"0.57726854",
"0.5758829",
"0.5758829",
"0.5758829",
"0.57567334",
"0.57483125... | 0.65681076 | 0 |
Wrapper for applying cloudScore function Required params: collection,cloudScoreFunction | function applyCloudScoreAlgorithm(collection,cloudScoreFunction,cloudScoreThresh,cloudScorePctl,contractPixels,dilatePixels,performCloudScoreOffset,preComputedCloudScoreOffset){
// var defaultArgs = {
// 'collection':null,
// 'cloudScoreFunction':null,
// 'cloudScoreThresh':20,
// 'cloudScorePctl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calculateTotalScore () {\r\n /* METHOD STUB */\r\n}",
"function Score() { }",
"score(args) {\n\n }",
"computeScore() {\n this.score++\n return this.score\n }",
"function getScore(){\n return score\n}",
"function submitScore() {\n db.collection(\"scores\").doc().set({\n sc... | [
"0.54750943",
"0.5345503",
"0.5339856",
"0.5327256",
"0.5319535",
"0.53049517",
"0.5261029",
"0.52592164",
"0.5234021",
"0.5167796",
"0.51634574",
"0.51489353",
"0.5131652",
"0.5123331",
"0.5106198",
"0.50556576",
"0.5053197",
"0.50412655",
"0.50375277",
"0.5017869",
"0.49598... | 0.7913622 | 0 |
LSC updated 4/16/19 to add medium and high confidence cloud masks Supported fmaskClass options: 'cloud', 'shadow', 'snow', 'high_confidence_cloud', 'med_confidence_cloud' | function cFmask(img,fmaskClass,bitMaskBandName){
if(bitMaskBandName === undefined || bitMaskBandName === null){bitMaskBandName = 'QA_PIXEL'}
var qa = img.select('pixel_qa').int16();
if(fmaskClass == 'high_confidence_cloud'){
var m = qa.bitwiseAnd(ee.Image(1 << 6)).neq(0).And(qa.bitwiseAnd(1 << 7).neq(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function maskclouds(img){\n var clouds = Clouds.basicQA(img);\n clouds = Clouds.sentinelCloudScore(clouds);\n var waterMask = Clouds.waterScore(img).select('waterScore').lte(0.5);\n var shadowMask = img.select('B11').gt(900);\n //var darkC = Clouds.darkC(img, ['B4', 'B3', 'B2'])\n //var nd = img.normalizedDi... | [
"0.62149125",
"0.61880326",
"0.59872943",
"0.58045024",
"0.5703521",
"0.5626634",
"0.55482846",
"0.55153555",
"0.5499892",
"0.54914504",
"0.5489741",
"0.5475509",
"0.5358452",
"0.52940404",
"0.5169927",
"0.5138877",
"0.5109091",
"0.5082284",
"0.5077436",
"0.5046923",
"0.50354... | 0.70942575 | 0 |
Method for applying a single bit bit mask | function applyBitMask(img,bit,bitMaskBandName){
if(bitMaskBandName === undefined || bitMaskBandName === null){bitMaskBandName = 'QA_PIXEL'}
var m = img.select([bitMaskBandName]).uint16();
m = m.bitwiseAnd(ee.Image(1<<bit)).neq(0);
return img.updateMask(m.not());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function maskAnd(ip, mask) {\n /* The following line adjusts the ip address to match the first address in the subnet (filtering all non-subnet mask bits in the ip */\n /* Not that this is done for the left 16 bits and the right 16 bits separately since the bitwise operator works on 32 bit signed integers yie... | [
"0.6282037",
"0.61694425",
"0.61676055",
"0.6091241",
"0.60405856",
"0.5816766",
"0.5812331",
"0.5812331",
"0.5812331",
"0.5812331",
"0.5812331",
"0.5812331",
"0.5812331",
"0.5812331",
"0.5812331",
"0.5812331",
"0.5812331",
"0.5812331",
"0.5812331",
"0.5812331",
"0.5812331",
... | 0.6554006 | 0 |
Function to add common (and less common) spectral indices to an image. Includes the Normalized Difference Spectral Vector from (Angiuli and Trianni, 2014) | function addIndices(img){
// Add Normalized Difference Spectral Vector (NDSV)
img = img.addBands(img.normalizedDifference(['blue','green']).rename('ND_blue_green'));
img = img.addBands(img.normalizedDifference(['blue','red']).rename('ND_blue_red'));
img = img.addBands(img.normalizedDifference(['blue','nir']... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function simpleAddIndices(in_image){\r\n in_image = in_image.addBands(in_image.normalizedDifference(['nir', 'red']).select([0],['NDVI']));\r\n in_image = in_image.addBands(in_image.normalizedDifference(['nir', 'swir2']).select([0],['NBR']));\r\n in_image = in_image.addBands(in_image.normalizedDifference([... | [
"0.65954494",
"0.5744531",
"0.56629497",
"0.54339856",
"0.5414787",
"0.54033923",
"0.5185582",
"0.5179831",
"0.51320577",
"0.5104654",
"0.50704837",
"0.500821",
"0.49942592",
"0.49939966",
"0.49585947",
"0.49193117",
"0.48913568",
"0.48354936",
"0.4829403",
"0.48155585",
"0.4... | 0.7297117 | 0 |
Function to add SAVI and EVI | function addSAVIandEVI(img){
// Add Enhanced Vegetation Index (EVI)
var evi = img.expression(
'2.5 * ((NIR - RED) / (NIR + 6 * RED - 7.5 * BLUE + 1))', {
'NIR': img.select('nir'),
'RED': img.select('red'),
'BLUE': img.select('blue')
}).float();
img = img.addBands(evi.rename('EVI'))... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onClickTakeVPS() {\n\n // Add all frame controls to the controller\n clrImgTags();\n vpsController.desiredFrameControllers.clear();\n var sel = document.getElementById(\"lstFrames\");\n for (var j = 0; j < sel.length; j++) {\n addNewImgTag(j);\n logMessage(sel.options[j].text ... | [
"0.5538465",
"0.5393867",
"0.53540456",
"0.52373135",
"0.5231773",
"0.5140124",
"0.50361687",
"0.50147307",
"0.48800507",
"0.48726502",
"0.4870317",
"0.48434862",
"0.48429078",
"0.48328704",
"0.48289973",
"0.48135895",
"0.47928807",
"0.47922403",
"0.4765321",
"0.47587487",
"0... | 0.76132286 | 0 |
///////////////////////////////////////////////////////////////////////////// Function to compute the Tasseled Cap transformation and return an image with the following bands added: ['brightness', 'greenness', 'wetness', 'fourth', 'fifth', 'sixth'] | function getTasseledCap(image) {
var bands = ee.List(['blue','green','red','nir','swir1','swir2']);
// // Kauth-Thomas coefficients for Thematic Mapper data
// var coefficients = ee.Array([
// [0.3037, 0.2793, 0.4743, 0.5585, 0.5082, 0.1863],
// [-0.2848, -0.2435, -0.5436, 0.7243, 0.0840, -0.1800]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addTCAngles(image){\r\n // Select brightness, greenness, and wetness bands\r\n var brightness = image.select(['brightness']);\r\n var greenness = image.select(['greenness']);\r\n var wetness = image.select(['wetness']);\r\n \r\n // Calculate Tasseled Cap angles and distances\r\n var tcAngleBG = bri... | [
"0.6392511",
"0.63342434",
"0.58093685",
"0.5684695",
"0.55419827",
"0.54024243",
"0.53914183",
"0.5351458",
"0.5346476",
"0.5307268",
"0.5303365",
"0.53030026",
"0.5195824",
"0.5194129",
"0.51883346",
"0.5186208",
"0.5176999",
"0.5168848",
"0.51674473",
"0.51446605",
"0.5120... | 0.74899626 | 0 |
Function to add Tasseled Cap angles and distances to an image. Assumes image has bands: 'brightness', 'greenness', and 'wetness'. | function addTCAngles(image){
// Select brightness, greenness, and wetness bands
var brightness = image.select(['brightness']);
var greenness = image.select(['greenness']);
var wetness = image.select(['wetness']);
// Calculate Tasseled Cap angles and distances
var tcAngleBG = brightness.atan2(green... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function simpleAddTCAngles(image){\r\n // Select brightness, greenness, and wetness bands\r\n var brightness = image.select(['brightness']);\r\n var greenness = image.select(['greenness']);\r\n var wetness = image.select(['wetness']);\r\n \r\n // Calculate Tasseled Cap angles and distances\r\n var tcAngleBG... | [
"0.7812575",
"0.7158273",
"0.54337287",
"0.5407084",
"0.5307337",
"0.5265029",
"0.5263492",
"0.5240854",
"0.51645684",
"0.5160091",
"0.51558214",
"0.513058",
"0.50847924",
"0.50460976",
"0.50447834",
"0.5024843",
"0.5016579",
"0.4988743",
"0.4946838",
"0.48860896",
"0.4879777... | 0.8013648 | 0 |
Only adds tc bg angle as in Powell et al 2009 | function simpleAddTCAngles(image){
// Select brightness, greenness, and wetness bands
var brightness = image.select(['brightness']);
var greenness = image.select(['greenness']);
var wetness = image.select(['wetness']);
// Calculate Tasseled Cap angles and distances
var tcAngleBG = brightness.atan2... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bg_color(in_time, in_seed) {\n return ((64 * cos(PI*(in_time + in_seed))) + 64 + 127);\n}",
"function addTCAngles(image){\r\n // Select brightness, greenness, and wetness bands\r\n var brightness = image.select(['brightness']);\r\n var greenness = image.select(['greenness']);\r\n var wetness = imag... | [
"0.62670976",
"0.6216901",
"0.609281",
"0.6064599",
"0.59857476",
"0.59544754",
"0.5898723",
"0.5870063",
"0.5865292",
"0.5821707",
"0.57841563",
"0.57694477",
"0.57464105",
"0.57316583",
"0.57050353",
"0.567958",
"0.56498605",
"0.5623271",
"0.5620968",
"0.56157583",
"0.56142... | 0.6375692 | 0 |
////////////////////////////////////////////////////////////////////////////// Function to add solar zenith and azimuth in radians as bands to image | function addZenithAzimuth(img,toaOrSR,zenithDict,azimuthDict){
if(zenithDict === undefined || zenithDict === null){zenithDict = {
'TOA': 'SUN_ELEVATION',
'SR': 'SOLAR_ZENITH_ANGLE'};
}
if(azimuthDict === undefined || azimuthDict === null){azimuthDict = {
'TOA': 'SUN_AZIMUTH',
'SR': 'SOLAR_A... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addAtmosBands(srimg){\n // var ozone = ee.Image(srimg.get('ozone')).select([0], ['OZONE']);\n var tair = ee.Image(ee.List(srimg.get('surface_temp')).get(0))\n .select([0], ['SRTAIR00'])\n .addBands(ee.Image(ee.List(srimg.get('surface_temp')).get(1))\n .select([0], ['... | [
"0.6425784",
"0.61051345",
"0.5845689",
"0.57698697",
"0.5717848",
"0.5630337",
"0.56277233",
"0.5558387",
"0.5533911",
"0.5527458",
"0.55072975",
"0.54974324",
"0.54774785",
"0.54488087",
"0.54400474",
"0.5438163",
"0.5433629",
"0.54237056",
"0.54237056",
"0.54041684",
"0.53... | 0.75111926 | 0 |
Function for computing the mean squared difference medoid from an image collection | function medoidMosaicMSD(inCollection,medoidIncludeBands) {
if (medoidIncludeBands === undefined || medoidIncludeBands === null) {
medoidIncludeBands = ee.Image(inCollection.first()).bandNames();
}
// Find the median
var median = inCollection.select(medoidIncludeBands).median();
// Find the squa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getMean(image){\n var img = image.rename(['Mean'])\n var mean = img.reduceRegion({\n reducer: meanReducer,\n geometry: box,\n crs: 'EPSG:4326',\n crsTransform: affine,\n maxPixels: 1e9\n });\n return ee.Number(mean.get('Mean'))\n}",
"function getMean(array){\n return getSum... | [
"0.6011751",
"0.56266195",
"0.55891466",
"0.5531956",
"0.5522314",
"0.54510045",
"0.5434769",
"0.5381002",
"0.535547",
"0.5320246",
"0.53006303",
"0.52876955",
"0.5286332",
"0.525457",
"0.52537745",
"0.5235691",
"0.5181407",
"0.5153616",
"0.51266986",
"0.5125328",
"0.51235425... | 0.6200398 | 0 |
Function to export to Drive and properly take care of clipping/no data | function exportToDriveWrapper(imageForExport,outputName,driveFolderName,roi,scale,crs,transform,outputNoData){
if(outputNoData === null || outputNoData === undefined){outputNoData = -32768}
//Make sure image is clipped to roi in case it's a multi-part polygon
imageForExport = imageForExport.clip(roi).unmask(ou... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function save_and_export() {\r\n\r\n}",
"function ProcessExport(dlg){\r \r // get selected layers\r var theLayerSelection = new Array();\r // store layer references of selected layers\r \r for (var p = 0; p < dlg.layerRange.layersList.items.length; p++) {\r if (dlg.layerRange.layersList... | [
"0.6200786",
"0.5579011",
"0.5523792",
"0.5492892",
"0.5370197",
"0.53674614",
"0.5302834",
"0.5242528",
"0.5241546",
"0.52256835",
"0.5211242",
"0.5192753",
"0.5188982",
"0.5152663",
"0.5119231",
"0.5084586",
"0.5067986",
"0.50634015",
"0.50534624",
"0.5051121",
"0.50482255"... | 0.712952 | 0 |
exportToDriveWrapper(ee.Image(1),'jsTest1','jsTest',geometry,30,'EPSG:5070') //////////////////////////////////////////////// Function for wrapping dates when the startJulian < endJulian Checks for year with majority of the days and the wrapOffset | function wrapDates(startJulian,endJulian){
//Set up date wrapping
var wrapOffset = 0;
var yearWithMajority = 0;
if (startJulian > endJulian) {
wrapOffset = 365;
var y1NDays = 365-startJulian;
var y2NDays = endJulian;
if(y2NDays > y1NDays){yearWithMajority = 1;}
}
return... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getJdImages(yr,yrImages,start){\r\n yr = ee.Number(yr).int16();\r\n start = ee.Number(start).int16();\r\n var date = ee.Date.fromYMD(yr,1,1).advance(start.subtract(1),'day');\r\n var index = date.format('yyyy-MM-dd');\r\n var end = start.add(compositePeriod-1).int16();\r\n var jdImages =... | [
"0.60254",
"0.5949002",
"0.5855098",
"0.5630092",
"0.56127864",
"0.54902244",
"0.54777426",
"0.54019296",
"0.53270954",
"0.53011286",
"0.5267305",
"0.5260737",
"0.5248353",
"0.52334917",
"0.5209479",
"0.5205156",
"0.5191884",
"0.5186074",
"0.5169182",
"0.51686597",
"0.5088550... | 0.7051033 | 0 |
Function to calculate illumination condition (IC). Function by Patrick Burns | function illuminationCondition(img){
// Extract solar zenith and azimuth bands
var SZ_rad = img.select('zenith');
var SA_rad = img.select('azimuth');
// Creat terrain layers
// var dem = ee.Image('CGIAR/SRTM90_V4');
var dem = ee.Image('USGS/NED');
var slp = ee.Terrain.slope(dem);
var slp_rad... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function illuminationCorrection(img, scale,studyArea,bandList){\r\n if(bandList === null || bandList === undefined){\r\n bandList = ['blue', 'green', 'red', 'nir', 'swir1', 'swir2', 'temp']; \r\n }\r\n \r\n var props = img.toDictionary();\r\n var st = img.get('system:time_start');\r\n var img_plus_ic = im... | [
"0.5779728",
"0.56598514",
"0.5590235",
"0.5480118",
"0.52962273",
"0.5286688",
"0.52160937",
"0.51504534",
"0.51483256",
"0.5145117",
"0.5063587",
"0.505839",
"0.50367826",
"0.5008841",
"0.5002994",
"0.49974257",
"0.49705985",
"0.4956574",
"0.49448544",
"0.48915526",
"0.4890... | 0.7630923 | 0 |
Function to apply the SunCanopySensor + C (SCSc) correction method to each | function illuminationCorrection(img, scale,studyArea,bandList){
if(bandList === null || bandList === undefined){
bandList = ['blue', 'green', 'red', 'nir', 'swir1', 'swir2', 'temp'];
}
var props = img.toDictionary();
var st = img.get('system:time_start');
var img_plus_ic = img;
var mask2 = i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function crepuscolo(njd,tempo_rif,longitudine,latitudine,altitudine){\n\n // funzione per il calcolo del crepuscolo astronomico.\n // FUNZIONE DA ELIMINARE e sostituire con crepuscolo_UT\n \n var tempo_rifst=0; // tempo di riferimento per il sorgere e il tramonto.\n... | [
"0.5353135",
"0.52492726",
"0.52454996",
"0.519923",
"0.51363814",
"0.5124448",
"0.51191664",
"0.50982636",
"0.5088357",
"0.5082714",
"0.50516",
"0.5049791",
"0.49794304",
"0.49727193",
"0.49725136",
"0.49647608",
"0.49547094",
"0.49488863",
"0.49227303",
"0.4922271",
"0.4907... | 0.58309615 | 0 |
Cloud masking algorithm for Sentinel2 Built on ideas from Landsat cloudScore algorithm Currently in beta and may need tweaking for individual study areas | function sentinel2CloudScore(img) {
// Compute several indicators of cloudyness and take the minimum of them.
var score = ee.Image(1);
var blueCirrusScore = ee.Image(0);
// Clouds are reasonably bright in the blue or cirrus bands.
//Use .max as a pseudo OR conditional
blueCirrusScore = blueC... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function maskclouds(img){\n var clouds = Clouds.basicQA(img);\n clouds = Clouds.sentinelCloudScore(clouds);\n var waterMask = Clouds.waterScore(img).select('waterScore').lte(0.5);\n var shadowMask = img.select('B11').gt(900);\n //var darkC = Clouds.darkC(img, ['B4', 'B3', 'B2'])\n //var nd = img.normalizedDi... | [
"0.697268",
"0.6645085",
"0.661039",
"0.6602192",
"0.6582044",
"0.6573865",
"0.65642095",
"0.65215963",
"0.6437589",
"0.63146615",
"0.6268272",
"0.6253746",
"0.5901854",
"0.5881855",
"0.5835877",
"0.5804443",
"0.5794642",
"0.5770978",
"0.57688266",
"0.5724996",
"0.5712123",
... | 0.66861486 | 1 |
snow masking adapted from: dilate pixels = 3.5 | function sentinel2SnowMask(img, dilatePixels){
// calculate ndsi
var ndsi = img.normalizedDifference(['green', 'swir1']);
// IF NDSI > 0.40 AND ρ(NIR) > 0.11 THEN snow in open land
// IF 0.1 < NDSI < 0.4 THEN snow in forest
var snowOpenLand = ndsi.gt(0.4).and(img.select(['nir']).gt(0.11));
var... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function maskclouds(img){\n var clouds = Clouds.basicQA(img);\n clouds = Clouds.sentinelCloudScore(clouds);\n var waterMask = Clouds.waterScore(img).select('waterScore').lte(0.5);\n var shadowMask = img.select('B11').gt(900);\n //var darkC = Clouds.darkC(img, ['B4', 'B3', 'B2'])\n //var nd = img.normalizedDi... | [
"0.6557137",
"0.6280433",
"0.6085703",
"0.6080757",
"0.60682607",
"0.59800404",
"0.5934773",
"0.5920035",
"0.58729637",
"0.58620495",
"0.58344173",
"0.5823864",
"0.58203506",
"0.58038145",
"0.5788772",
"0.5773715",
"0.5768081",
"0.57578874",
"0.5746869",
"0.5731334",
"0.57233... | 0.76270884 | 0 |
Helper function to join two collections. Adapted from: code.earthengine.google.com | function joinCollections(c1,c2, maskAnyNullValues,property,propertySecondary){
if(maskAnyNullValues === undefined || maskAnyNullValues === null){maskAnyNullValues = true}
if(property === undefined || property === null){property = 'system:time_start'}
if(propertySecondary === undefined || propertySecondary === ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function joinLandsatCollections(coll1, coll2){\n var eqfilter = ee.Filter.equals({'rightField':'system:time_start',\n 'leftField':'system:time_start'});\n var join = ee.Join.inner();\n var joined = ee.ImageCollection(join.apply(coll1, coll2, eqfilter));\n //Inner join returns ... | [
"0.742002",
"0.68930626",
"0.68368804",
"0.67473835",
"0.6510537",
"0.6365417",
"0.62566185",
"0.61731553",
"0.61221135",
"0.60742855",
"0.60728693",
"0.59647083",
"0.59150875",
"0.5904982",
"0.5892553",
"0.5884318",
"0.5860738",
"0.5844479",
"0.5838271",
"0.5821361",
"0.5810... | 0.70596737 | 1 |
Simple inner join function for featureCollections Matches features based on an exact match of the fieldName parameter Retains the geometry of the primary, but copies the properties of the secondary collection | function joinFeatureCollections(primary,secondary,fieldName,fieldNameSecondary){
if(fieldNameSecondary === undefined || fieldNameSecondary === null){fieldNameSecondary=fieldName}
// Use an equals filter to specify how the collections match.
var f = ee.Filter.equals({
leftField: fieldName,
rightField:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function joinLandsatCollections(coll1, coll2){\n var eqfilter = ee.Filter.equals({'rightField':'system:time_start',\n 'leftField':'system:time_start'});\n var join = ee.Join.inner();\n var joined = ee.ImageCollection(join.apply(coll1, coll2, eqfilter));\n //Inner join returns ... | [
"0.6146977",
"0.57834274",
"0.5692215",
"0.5682456",
"0.5387535",
"0.5363008",
"0.5280118",
"0.52204454",
"0.5115275",
"0.5074416",
"0.49672022",
"0.48761845",
"0.47143918",
"0.46270606",
"0.4619295",
"0.45987943",
"0.45987943",
"0.45950004",
"0.45877373",
"0.45825747",
"0.45... | 0.7923166 | 0 |
Function to get MODIS data from various collections Will pull from daily or 8day composite collections based on the boolean variable "daily" | function getModisData(args){
var defaultArgs = {
'startYear': null,
'endYear': null,
'startJulian' : null,
'endJulian' : null,
'daily':true,
'maskWQA':false,
'zenithThresh' :90,
'useTempInCloudMask': true,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDefaulDailyDataForAllMaps() {\n // Dates chosen are the successively previous date starting from the most recent date where data is\n // available\n date2 = new Date(maxDate);\n date2.setDate(date2.getDate() - 1);\n date3 = new Date(date2);\n date3.setDate(date3.getDate() - 1);\n d... | [
"0.58116984",
"0.5721934",
"0.5695553",
"0.5524076",
"0.5513743",
"0.54921436",
"0.5409579",
"0.53739977",
"0.53658116",
"0.5335407",
"0.5334891",
"0.53319365",
"0.52655905",
"0.5220509",
"0.5158142",
"0.5145962",
"0.5145867",
"0.510777",
"0.51018745",
"0.5090653",
"0.5076053... | 0.6970642 | 0 |
Get images for a specified start day | function getJdImages(yr,yrImages,start){
yr = ee.Number(yr).int16();
start = ee.Number(start).int16();
var date = ee.Date.fromYMD(yr,1,1).advance(start.subtract(1),'day');
var index = date.format('yyyy-MM-dd');
var end = start.add(compositePeriod-1).int16();
var jdImages = yrImages.filter(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findImage(_updateDate){\n // find your current date and subtract 20 days from iteration\n var apiUrl = 'https://api.nasa.gov/planetary/earth/imagery?lon=' + lon + '&lat=' + lat + '&date=' + currentDate + '&cloud_score' + cloudScore + '&api_key=' + key;\n\n requestify.get (apiUrl)\n .... | [
"0.6690669",
"0.6125552",
"0.59688616",
"0.5965342",
"0.5895644",
"0.57371384",
"0.56966007",
"0.5674107",
"0.5620742",
"0.55474216",
"0.55306476",
"0.5506585",
"0.5416832",
"0.54094946",
"0.5379275",
"0.53637516",
"0.53338903",
"0.5277955",
"0.5276605",
"0.52672404",
"0.5261... | 0.6736817 | 0 |
Function to export composite collection See below for necessary arguments All parameters must be provided | function exportCompositeCollection(){
var defaultArgs = {
'exportPathRoot':null,
'outputName':null,
'studyArea':null,
'crs':null,
'transform':null,
'scale':null,
'collection':null,
'start... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"export() {\n // create the export ob\n let expOb = { panes: [] }\n let rnames = Object.keys(this.panes[0].dataForPlot)\n let csvData = []\n let csvString = \"regionname\"\n let i = 0\n // iterate over the panes\n for (let pane of this.panes) {\n //... | [
"0.56652087",
"0.55908096",
"0.5551638",
"0.54603463",
"0.5275277",
"0.52489716",
"0.52489716",
"0.52489716",
"0.5233495",
"0.52308327",
"0.52275294",
"0.5192737",
"0.5182349",
"0.5181513",
"0.5166765",
"0.5166765",
"0.5166765",
"0.51584464",
"0.515201",
"0.51434046",
"0.5133... | 0.7967867 | 0 |
/////////////////////////////////////////////////////////////////// Wrapper function for getting Landsat imagery See default arguments below Required arguments: studyArea,startYear,endYear,startJulian,endJulian, crs, scale or transform | function getLandsatWrapper(){
var defaultArgs = {
'studyArea':null,
'startYear':null,
'endYear':null,
'startJulian':null,
'endJulian':null,
'timebuffer':0,
'weights':[1],
'compositingMethod':'medoid',
'toaOrSR':'SR',
'includeSLCOffL7':false,
'defringeL5':fa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLandsat(){\r\n \r\n var defaultArgs = {\r\n 'studyArea':null,\r\n 'startDate':null,\r\n 'endDate':null,\r\n 'startJulian':null,\r\n 'endJulian':null,\r\n 'toaOrSR':'SR',\r\n 'includeSLCOffL7':false,\r\n 'defringeL5':false,\r\n 'addPixelQA':false,\r\n 'resampleMethod':'ne... | [
"0.67952645",
"0.5958985",
"0.57681865",
"0.5618749",
"0.56115466",
"0.56099236",
"0.5560318",
"0.5550871",
"0.5439554",
"0.54147",
"0.5270234",
"0.5211075",
"0.5057532",
"0.5028119",
"0.4976722",
"0.4965732",
"0.4943483",
"0.49395582",
"0.49169144",
"0.49165887",
"0.49027655... | 0.6454641 | 1 |
Hybrid get Landsat and Sentinel 2 processed scenes Handles getting processed scenes with Landsat and Sentinel 2 | function getProcessedLandsatAndSentinel2Scenes(){
var defaultArgs = {
'studyArea':null,
'startYear':null,
'endYear':null,
'startJulian':null,
'endJulian':null,
'toaOrSR':'TOA',
'includeSLCOffL7':false,
'defringeL5':false,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get scenes() {}",
"function loadAssetsAndCreateScenes() {\r\n\r\n function loadLensflaresSceneAssets() {\r\n var get1 = $.get( \"./glsl/simple.vert\", function( vert ) { LensflareVert = vert; });\r\n var get2 = $.get( \"./glsl/swimmingColors.frag\", function( frag ) { LensflareFrag = frag; }... | [
"0.5857412",
"0.5774807",
"0.5756743",
"0.57442755",
"0.55497956",
"0.5502763",
"0.5448888",
"0.53941107",
"0.5307563",
"0.5271633",
"0.52594185",
"0.52417743",
"0.52001834",
"0.5162977",
"0.5154702",
"0.50925934",
"0.5076645",
"0.505746",
"0.50561637",
"0.50507516",
"0.50448... | 0.6377938 | 0 |
Function to register an imageCollection to images within it Always uses the first image as the reference image | function coRegisterCollection(images,referenceBands){
if(referenceBands === undefined || referenceBands === null){referenceBands = ['nir']}
var referenceImageIndex = 0;
var referenceImage = ee.Image(images.toList(referenceImageIndex+1).get(referenceImageIndex)).select(referenceBands);
function registerIma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function collectionToImage(collection){\r\n var stack = ee.Image(collection.iterate(function(img, prev) {\r\n return ee.Image(prev).addBands(img);\r\n }, ee.Image(1)));\r\n\r\n stack = stack.select(ee.List.sequence(1, stack.bandNames().size().subtract(1)));\r\n return stack;\r\n}",
"loadImages(): void {\n... | [
"0.6302767",
"0.62091976",
"0.6157207",
"0.613257",
"0.610635",
"0.61038",
"0.6086788",
"0.60452",
"0.6036898",
"0.6011829",
"0.59809554",
"0.5934255",
"0.59266126",
"0.5875127",
"0.5868808",
"0.58680975",
"0.5864657",
"0.58385646",
"0.58361584",
"0.58090353",
"0.58052486",
... | 0.72272056 | 0 |
////////////////////////////////////////////////////////////////////////////// Hybrid get Landsat and Sentinel 2 wrapper function Handles getting processed scenes and composites with Landsat and Sentinel 2 | function getLandsatAndSentinel2HybridWrapper(){
var defaultArgs = {
'studyArea':null,
'startYear':null,
'endYear':null,
'startJulian':null,
'endJulian':null,
'timebuffer': 0,
'weights': [1],
'compositingMethod':'medoid',
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getProcessedLandsatAndSentinel2Scenes(){\r\n \r\n var defaultArgs = {\r\n 'studyArea':null,\r\n 'startYear':null,\r\n 'endYear':null,\r\n 'startJulian':null,\r\n 'endJulian':null,\r\n 'toaOrSR':'TOA',\r\n 'includeSLCOffL7':false,\r\n ... | [
"0.66039187",
"0.6182631",
"0.575945",
"0.5651499",
"0.5599529",
"0.55133075",
"0.5485327",
"0.5121228",
"0.5031201",
"0.5021787",
"0.5006535",
"0.49902523",
"0.49850357",
"0.49061084",
"0.4896243",
"0.48768815",
"0.48580155",
"0.48577392",
"0.48236814",
"0.48087427",
"0.4795... | 0.688975 | 0 |
//////////////////////////////////////////////////////// Harmonic regression ////////////////////////////////////////////////////////////////// Function to give year.dd image and harmonics list (e.g. [1,2,3,...]) | function getHarmonicList(yearDateImg,transformBandName,harmonicList){
var t= yearDateImg.select([transformBandName]);
var selectBands = ee.List.sequence(0,harmonicList.length-1);
var sinNames = harmonicList.map(function(h){
var ht = h*100;
return ee.String('sin_').cat(ht.toString()).c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getHarmonics2(collection,transformBandName,harmonicList,detrend){\r\n if(detrend === undefined || detrend === null){detrend = false}\r\n \r\n var depBandNames = ee.Image(collection.first()).bandNames().remove(transformBandName);\r\n var depBandNumbers = depBandNames.map(function(dbn){\r\n return de... | [
"0.62437165",
"0.56426394",
"0.53939784",
"0.5367703",
"0.5243799",
"0.52293617",
"0.5223475",
"0.52213866",
"0.5198196",
"0.5192275",
"0.5189842",
"0.5173041",
"0.51534766",
"0.51271117",
"0.5107591",
"0.5093103",
"0.5031015",
"0.50304884",
"0.5029463",
"0.50270504",
"0.5027... | 0.7382714 | 0 |
////////////////////////////////////////////////////////////// Simplifies the use of the robust linear regression reducer Assumes the dependent is the first band and all subsequent bands are independents | function newRobustMultipleLinear2(dependentsIndependents){//,dependentBands,independentBands){
//Set up the band names
var dependentBands = ee.List(dependentsIndependents.get('depBandNumbers'));
var independentBands = ee.List(dependentsIndependents.get('indBandNumbers'));
var bns = ee.Image(dependentsInde... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dir1Regression(img,slopes,intercepts){\r\n var bns = img.bandNames();\r\n var nonCorrectBands = bns.removeAll(chastainBandNames);\r\n var nonCorrectedBands = img.select(nonCorrectBands);\r\n var corrected = img.select(chastainBandNames).subtract(intercepts).divide(slopes);\r\n var out = corrected.add... | [
"0.62408906",
"0.615661",
"0.57841855",
"0.5782991",
"0.56933224",
"0.54781705",
"0.5350693",
"0.5350693",
"0.5293807",
"0.52879494",
"0.52857935",
"0.527495",
"0.5198909",
"0.5190818",
"0.5178835",
"0.50657725",
"0.49975136",
"0.49718618",
"0.49681115",
"0.49494174",
"0.4847... | 0.69535595 | 0 |
Function for getting the date of the peak of veg vigor can handle bands negatively correlated to veg in changeDirDict dictionary above | function getPeakDate(coeffs,peakDirection){
if(peakDirection === null || peakDirection === undefined){peakDirection = 1};
var sin = coeffs.select([0]);
var cos = coeffs.select([1]);
//Find where in cycle slope is zero
var greenDate = ((sin.divide(cos)).atan()).divide(2*Math.PI).rename(['peakDate'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function evaporator(evap_per_day, threshold){ \n threshold = threshold / 100\n evap_per_day = evap_per_day / 100\n return Math.ceil(Math.log(threshold) / Math.log(1-evap_per_day))\n}",
"function thresholdChange(changeCollection,changeThreshLower,changeThreshUpper,changeDir){\n if(changeDir === undefined || ... | [
"0.4924721",
"0.49199256",
"0.48968545",
"0.48550013",
"0.4668043",
"0.4663308",
"0.46002203",
"0.45890513",
"0.4546828",
"0.45243073",
"0.45183963",
"0.45068496",
"0.45031688",
"0.44993788",
"0.4498537",
"0.449526",
"0.4483595",
"0.4475031",
"0.44727212",
"0.4471297",
"0.446... | 0.661264 | 0 |
Function for getting left sum under the curve for a single growing season Takes care of normalization by forcing the min value along the curve 0 by taking the amplitude as the intercept Assumes the sin and cos coeffs are the harmCoeffs t0 is the start time (defaults to 0)(min value should be but doesn't have to be 0) t... | function getAreaUnderCurve(harmCoeffs,t0,t1){
if(t0 === null || t0 === undefined){t0 = 0}
if(t1 === null || t1 === undefined){t1 = 1}
//Pull apart the model
var amplitude = harmCoeffs.select([1]).hypot(harmCoeffs.select([0]));
var intereceptNormalized = amplitude;//When making the min 0, the intercep... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"x1(t) {\n return (\n Math.sin(t / 200) * 125 + Math.sin(t / 20) * 125 + Math.sin(t / 30) * 125\n );\n }",
"function calculateThesholdLinePoints() {\n\tconst xCoords = [];\n\tconst step = (maxX - minX) / NUM_POINTS_ON_CURVE;\n\tfor (let i = 0; i < NUM_POINTS_ON_CURVE; i++) {\n\t\tlet x = minX + i * st... | [
"0.5924709",
"0.556286",
"0.5490293",
"0.529369",
"0.5280162",
"0.52708566",
"0.5248841",
"0.52044415",
"0.5160149",
"0.51463294",
"0.5096701",
"0.5041542",
"0.5014544",
"0.49602494",
"0.49559963",
"0.49542645",
"0.4953776",
"0.49516657",
"0.49476457",
"0.49297783",
"0.491839... | 0.61066103 | 0 |
Function for applying harmonic regression model to set of predictor sets | function newPredict(coeffs,harmonics){
//Parse the model
var bandNames = coeffs.bandNames();
var bandNumber = bandNames.length();
var noDependents = ee.Number(coeffs.get('noDependents'));
var modelLength = ee.Number(coeffs.get('modelLength'));
var interceptBands = ee.List.sequence(0,bandNumber.subtrac... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function predict() {\n regressor.predict(gotResults);\n}",
"function OLS(_Y,_X, intercept=true){\n var x = deepClone(_X);\n var y = deepClone(_Y);\n if(y.length!=x.length) throw new Error(\"Y and X are of different lengths\");\n var lm = {};\n var n = y.length;\n var xbar = ... | [
"0.56298286",
"0.56154746",
"0.52934",
"0.5242027",
"0.52072704",
"0.50993097",
"0.50337225",
"0.50088763",
"0.49931067",
"0.49839246",
"0.4950106",
"0.49413714",
"0.48897162",
"0.4787159",
"0.47297916",
"0.4669577",
"0.46373588",
"0.46307576",
"0.46307576",
"0.46296617",
"0.... | 0.6767206 | 0 |
Function to get a dummy image stack for synthetic time series | function getDateStack(startYear,endYear,startJulian,endJulian,frequency){
var years = ee.List.sequence(startYear,endYear);
var dates = ee.List.sequence(startJulian,endJulian,frequency);
//print(startYear,endYear,startJulian,endJulian)
var dateSets = years.map(function(yr){
var ds = dates.map(function(d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stack(img, imglist) {\n imglist = ee.List(imglist)\n img = ee.Image(img)\n var diff = img.select('nd').subtract(ee.Image(imglist.get(-1)).select('nd'));\n return imglist.add(img.addBands(diff.select([0], ['diff'])))\n}",
"showImageStack() {\n gsap.killTweensOf(this.DOM.imgStack);\n ... | [
"0.56100994",
"0.555251",
"0.5544081",
"0.5251446",
"0.52316064",
"0.51541287",
"0.5144536",
"0.5061234",
"0.50504804",
"0.5038071",
"0.5038071",
"0.5038071",
"0.5038071",
"0.5038071",
"0.50293857",
"0.50288385",
"0.499563",
"0.49935427",
"0.49903965",
"0.4971654",
"0.4935621... | 0.5854859 | 0 |
Simple predict function for harmonic coefficients Expects coeffs from getHarmonicCoefficientsAndFit function Date image is expected to be yyyy.dd where dd is the day of year / 365 (proportion of year) ex. synthImage(coeffs,ee.Image([2019.6]),['blue','green','red','nir','swir1','swir2','NBR','NDVI'],[2,4],true) | function synthImage(coeffs,dateImage,indexNames,harmonics,detrend){
//Set up constant image to multiply coeffs by
var constImage = ee.Image(1);
if(detrend){constImage = constImage.addBands(dateImage);}
harmonics.map(function(harm){
constImage = constImage.addBands(ee.Image([dateImage.multiply(harm*... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function newPredict(coeffs,harmonics){\r\n //Parse the model\r\n var bandNames = coeffs.bandNames();\r\n var bandNumber = bandNames.length();\r\n var noDependents = ee.Number(coeffs.get('noDependents'));\r\n var modelLength = ee.Number(coeffs.get('modelLength'));\r\n var interceptBands = ee.List.sequence(0,b... | [
"0.6294625",
"0.59018713",
"0.5342858",
"0.4910734",
"0.47844297",
"0.47262314",
"0.468128",
"0.46089786",
"0.45630798",
"0.45628452",
"0.45435786",
"0.4537493",
"0.45007077",
"0.44952014",
"0.44714367",
"0.4410055",
"0.4387265",
"0.4331488",
"0.4288202",
"0.42547286",
"0.422... | 0.72978014 | 0 |
////////////////////////////////////////////////// Onthefly basic water masking method This method is used to provide a timesensitive water mask This method tends to work well if there is no wet snow present Wet snow over flat areas can result in false positives Designed to work with TOA data. SR data will result in fa... | function simpleWaterMask(img,contractPixels,slope_thresh,elevationImagePath,elevationFocalMeanRadius){
if(contractPixels === null || contractPixels === undefined){contractPixels = 0};
if(slope_thresh === null || slope_thresh === undefined){slope_thresh = 10};
if(elevationImagePath === null || elevationImagePat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dem_mask(imgIn, th)\n{\n if(use_geometry === true)\n return imgIn.where(dem.clip(dem_geometry).select(\"elevation\").gt(th), 0);\n else\n return imgIn.where(dem.select(\"elevation\").gt(th), 0);\n}",
"function maskclouds(img){\n var clouds = Clouds.basicQA(img);\n clouds = Clouds.sentinelCloud... | [
"0.63815844",
"0.63287336",
"0.6310146",
"0.6257828",
"0.6184768",
"0.6184768",
"0.6000719",
"0.5970642",
"0.5876768",
"0.58344823",
"0.5810488",
"0.57301176",
"0.56899166",
"0.56808704",
"0.56619394",
"0.5569883",
"0.5551292",
"0.55263245",
"0.55237687",
"0.54930705",
"0.542... | 0.7134482 | 0 |
Check if general help has been cached | hasGeneralHelpCache() {
return !!this._generalHelpCache;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkCaches(){\n\n return getKeys(CACHE).length || getKeys(SOLVED).length;\n}",
"function showNeedHelpUrl() {\n\tremoveMessageFromDivId();\n\tremoveSuccessOrFailureStrip();\n\tbookmarks.sethash('#moreinfo',showFooterPopup, messages['gettingStartedUrl']);\n\treturn false;\n}",
"function helpLink() {\n... | [
"0.6047306",
"0.5873999",
"0.5859265",
"0.58242047",
"0.58242047",
"0.58242047",
"0.5689453",
"0.5501464",
"0.54477096",
"0.53787595",
"0.5346751",
"0.5334765",
"0.5316486",
"0.53016317",
"0.5283788",
"0.52576977",
"0.5254581",
"0.5241824",
"0.52161646",
"0.5201914",
"0.51791... | 0.7922827 | 0 |
Complete the climbingLeaderboard function below. | function climbingLeaderboard(scores, alice) {
let results = [];
let ranks = new Array(scores.length);
for (let i = 0, rank = 1; i < scores.length; i++) {
if (i > 0 && scores[i - 1] !== scores[i]) {
rank++;
}
ranks[i] = rank;
}
//Set alice rank it to worst rank+1
let aliceRank = ranks[ranks... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function climbingLeaderboard(scores, alice) {\n // 정답을 담을 변수 (기본값 빈배열)\n const answer = [];\n // new Set은 배열의 중복을 제거하고 Object로 반환, ...로 다시 배열로 만들어준다.\n let removeDupArr = [...new Set(scores)];\n // 아래도 중복을 제거하는건데 시간 복잡도에서 걸렸었다\n // let removeDupArr = [...scores].filter((item,index) => [...scores].indexOf(ite... | [
"0.6604936",
"0.59591174",
"0.5898965",
"0.5893401",
"0.58688444",
"0.5846737",
"0.5842285",
"0.58087575",
"0.5766429",
"0.57425106",
"0.5728467",
"0.57063955",
"0.5657205",
"0.5613015",
"0.5546135",
"0.55219287",
"0.55074036",
"0.5505782",
"0.54815423",
"0.5481242",
"0.54808... | 0.61159176 | 1 |
Initially, call getPvP(), which has getRaid() as callback, getRaid() has getTower() as callback and finally, getTower() has addTierInfo() as callback Ideally, getPvP(), getRaid() and getTower() should be done in parallel instead of being done serially like this, but that's for later | function getTierInfo () {
function getPvP() {
// fetch the pvp tier page
if (sessionStorage.pvp == null) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_preparePokemonData(actorData) {\n const data = actorData.data;\n\n // Make modifications to data here. For example:\n data.levelUpPoints = 0;\n for (let [key, value] of Object.entries(data.stats)) {\n let sub = value[\"value\"] + value[\"mod\"] + value[\"levelUp\"];\n data.levelUpPoints -= v... | [
"0.55041414",
"0.5442485",
"0.52446085",
"0.5155151",
"0.51022327",
"0.5099505",
"0.5024903",
"0.50183076",
"0.5000769",
"0.4969446",
"0.495835",
"0.49394357",
"0.49383986",
"0.4898721",
"0.48796454",
"0.4829791",
"0.4822077",
"0.48213917",
"0.4806223",
"0.47836465",
"0.47758... | 0.5954308 | 0 |
Add the tier info row to the stat table This has to be called AFTER the tiers info have all been fetched | function addTierInfo () {
var table = (document.getElementsByClassName("article-table"))[0];
var newText = "<tr>" +
"<td style='text-align:center;padding:0em;'><span style='border-bottom: 1px dotted; font-weight: bold; padding: 0em' title='PVP tier'><a>PVP</a></span></td><td>"
+ ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateTier(){\n\tif (points > 84){\n\t\ttier = \"A\";\n\t\t$('td#tier').html(\"A\");\n\t}\n\telse if (points >= 60){\n\t\ttier = \"B\";\n\t\t$('td#tier').html(\"B\");\n\t}\n\telse{\n\t\ttier = \"C\";\n\t\t$('td#tier').html(\"C\");\n\t}\n}",
"get tier() {\n return this._data.tier;\n }",
"func... | [
"0.59547865",
"0.57131606",
"0.571098",
"0.56902647",
"0.5553425",
"0.5424767",
"0.5409657",
"0.5221523",
"0.5218352",
"0.5119578",
"0.51172656",
"0.5097769",
"0.50501186",
"0.5045415",
"0.5043368",
"0.5041526",
"0.4981923",
"0.49588794",
"0.4957553",
"0.49501258",
"0.4949643... | 0.6497887 | 0 |
FILL STARS Update star rating, average rating and rating count | function fillStars() {
$(".listings").each(function() {
var star = $(this).children().children().children();
var ratingSum = $(this).children().eq(5).text();
var ratingCount = $(this).children().eq(6).text();
if (ratingCount == 0) {
var rating = 0;
} else {
var rating ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fillStarsTill(starNo){\n\tclearAllStars();\n\t\n\tif(starNo == 1){\n\t\tdocument.getElementById(\"1\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"1\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"starRating\").value = \"1\";\n\t}\n\t\n\tif(starNo == 2){\n\t\... | [
"0.7043631",
"0.6886214",
"0.6771783",
"0.6655155",
"0.6626217",
"0.6537336",
"0.65188116",
"0.6504995",
"0.64862734",
"0.64651066",
"0.64470917",
"0.644567",
"0.6394416",
"0.63823897",
"0.6379159",
"0.6372596",
"0.636005",
"0.63372356",
"0.6314028",
"0.6288997",
"0.6279413",... | 0.6894625 | 1 |
SUBMIT RATING Adds rating to database and returns average rating | function postRating(obj,id,rating) {
$.post('/codeCollection/books/phpFiles/submitRating.php',
{
id: id,
rating: rating
}, function(data){
var ratingData = $.parseJSON(data);
var newRating = ratingData.Rating;
var newCount = ratingData.RatingCount;
var ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setAverageRating(ev) {\n var $averageRating = $('.rating-form #average');\n\n if (allFieldsRated()) {\n var average = getAverageStarRating(),\n $star = $averageRating.find('.stars .star').eq(Math.round(average) - 1),\n starIndex = $averageRating.find('.stars .star').inde... | [
"0.66764945",
"0.6497725",
"0.64053816",
"0.63796526",
"0.6342851",
"0.6308113",
"0.6290277",
"0.6284115",
"0.62213916",
"0.6148705",
"0.6126816",
"0.6080523",
"0.60628396",
"0.606135",
"0.60516655",
"0.60459673",
"0.60381603",
"0.60344064",
"0.60128367",
"0.6002182",
"0.6000... | 0.6842108 | 0 |
The following functions are modified from the origin C functions created by Louis Whitcomb 19 Jun 2001 Fixed translate_coordinates by TeaWithLucas 2019 / translate_coordinates routine to translate between geographic and cartesian coordinates user must supply following data on the cartesian coordinate system: location o... | function translate_coordinates(trans_option,porg) {
with(Math) {
var xx,yy,r,ct,st,angle;
angle = DEG_TO_RADIANS(porg.rotation_angle_degs);
if( trans_option == XY_TO_LL) {
/* X,Y to Lat/Lon Coordinate Translation */
pxpos_mtrs = porg.x;
pypos_mtrs = porg.y;
xx = pxpos_mtrs - ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function transform(c, euler) {\n var x, y, z, β, γ, λ, φ, dψ, ψ, θ,\n ε = 1.0e-5;\n\n if (!euler) return c; \n\n λ = c[0]; // celestial longitude 0..2pi\n if (λ < 0) λ += τ; \n φ = c[1]; // celestial latitude -pi/2..pi/2\n \n λ -= euler[0]; // celestial longitude - celestial coordinates of the nati... | [
"0.6435183",
"0.60892403",
"0.60726845",
"0.6031333",
"0.593562",
"0.5890396",
"0.5860237",
"0.5806285",
"0.57298625",
"0.5707738",
"0.56937295",
"0.5689108",
"0.5683103",
"0.5673771",
"0.5643809",
"0.56332374",
"0.56246364",
"0.5617616",
"0.560749",
"0.5605197",
"0.5600982",... | 0.7458975 | 0 |
xy2utm (call xy2ll then geo_utm for ll2utm) | function xy2utm(Form)
{
with(Math)
{
/* get the origin lat and lon */
var oll=getoll(Form);
olat=oll.olat;
olon=oll.olon;
/* get the source x and y (to be converted) */
if( Form.Xcord.value == "" | Form.Ycord.value == "")
{
alert('Enter X/Y values');
r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function LLtoUTM(EQUATORIAL_RADIUS, ECC_SQUARED) {\n return function (lat, lon, utmcoords, zone) {\n var squared = ECC_SQUARED,\n radius = EQUATORIAL_RADIUS,\n primeSquared = squared / (1 - squared),\n // utmcoords is a 2-D array declared by the calling routine\n // note: input of l... | [
"0.66169894",
"0.6373316",
"0.6253807",
"0.6207656",
"0.5745563",
"0.57040536",
"0.5669025",
"0.5669025",
"0.5628828",
"0.5521008",
"0.5509382",
"0.5493173",
"0.54821956",
"0.5436079",
"0.5410191",
"0.5389727",
"0.5371636",
"0.53689724",
"0.53609246",
"0.534005",
"0.5305792",... | 0.7201504 | 0 |
mark this objtype as done; if none left to do then end the response | function markTestAndEnd(res, objtype) {
res.objtypes[objtype] = false;
var done = true;
//debugOut("markTestAndEnd: "+objtype);
//debugOut(res.objtypes);
for (o in res.objtypes) {
if (res.objtypes[o]) {
done = false;
}
}
if (done) {
res.end();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"end() {\n this.status = 'finished';\n }",
"finish() {\n this.done = true;\n }",
"finishProcessing() {\n this.busy = false;\n this.successful = true;\n }",
"onend() {\n if (this.done)\n return;\n this.done = true;\n this.parser = null;\n this.han... | [
"0.6641575",
"0.6604405",
"0.62197673",
"0.62095565",
"0.6181674",
"0.61444694",
"0.6114045",
"0.6083475",
"0.6083475",
"0.6062522",
"0.60554487",
"0.60483056",
"0.59735495",
"0.595805",
"0.5932862",
"0.59241074",
"0.59123033",
"0.59081113",
"0.5905365",
"0.58675545",
"0.5846... | 0.68991256 | 0 |
Load the game stack and datas | async function load() {
await Datas.Settings.read();
await Datas.Systems.read();
//RPM.gameStack.pushTitleScreen();
//RPM.datasGame.loaded = true;
Manager.GL.initialize();
Manager.GL.resize();
Manager.Stack.requestPaintHUD = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadGameData()\n\t\t\t{\n\t\t\t\tif(gameName == \"fatcat7\")\n\t\t\t\t{\n\t\t\t\t\tgame = new FatCat7Game();\n\t\t\t\t\tisFreeSpinGame = true;\n\t\t\t\t}\n\t\t\t\telse if(gameName == \"bounty\")\n\t\t\t\t{\n\t\t\t\t\tgame = new BountyGame();\n\t\t\t\t\tisFreeSpinGame = true;\n\t\t\t\t}\n\t\t\t\telse if(ga... | [
"0.73351467",
"0.71060175",
"0.69390243",
"0.69287",
"0.6685305",
"0.66722333",
"0.6669412",
"0.6553755",
"0.65286773",
"0.649282",
"0.64497447",
"0.64385194",
"0.64332706",
"0.63894516",
"0.6386065",
"0.63629013",
"0.6340768",
"0.6296872",
"0.62840116",
"0.62707764",
"0.6250... | 0.71258605 | 1 |
Avoid `console` errors in browsers that lack a console. | function avoidConsoleError(){
var method;
var noop = function () {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'tab... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fixConsole(alertFallback) {\r\n if (typeof console === \"undefined\") {\r\n console = {}; // define it if it doesn't exist already\r\n }\r\n if (typeof console.log === \"undefined\") {\r\n if (alertFallback) { console.log = function (msg) { alert(msg); }; }\r\n else { console... | [
"0.7245823",
"0.7197093",
"0.71790063",
"0.7154713",
"0.7119702",
"0.7065466",
"0.70603144",
"0.70603144",
"0.6980409",
"0.6946042",
"0.6612762",
"0.65710545",
"0.6544899",
"0.6542406",
"0.6542406",
"0.6542406",
"0.6542406",
"0.6542406",
"0.6542406",
"0.6542406",
"0.6542406",... | 0.7600821 | 0 |
Called when the mouse button is pressed. Starts the interval to run every 100ms while the mouse button is still held down. Only start the interval if it is not already running. | function mouseDown(event) {
mouseIsDown = true;
// if (drawHandle === -1) {
// drawHandle = setInterval(mousePressed, 100);
// }
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mousedown(event) {\r\n if(mousedownID==-1) //Prevent multimple loops!\r\n mousedownID = setInterval(whilemousedown, 250 /*execute every 300ms*/);\r\n\r\n\r\n}",
"function mousePressed() {\n // Start an interval for the notes\n setInterval(playNote,NOTE_TEMPO);\n // Start an interval for the dru... | [
"0.6698936",
"0.6561119",
"0.64897954",
"0.6434818",
"0.6433856",
"0.64262193",
"0.6336512",
"0.6300315",
"0.62277657",
"0.6218502",
"0.62010634",
"0.61866045",
"0.61512387",
"0.6142589",
"0.6141605",
"0.60941917",
"0.6052445",
"0.60341793",
"0.60341793",
"0.60336137",
"0.602... | 0.66286314 | 1 |
Loop through the array of background objects and draw them all. | function drawBackgroundSquares() {
for (var index = 0; index < self.allBackgroundSquares.length; index++) {
var square = self.allBackgroundSquares[index];
self.draw.fillStyle = square.color;
self.draw.fillRect(square.x, square.y, square.width, square.height);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawBackgrounds() {\n for (i = 0; i < 3; i++) {\n addBackgroundObject('./img/background/03_farBG/Completo.png', bg_elem_3_x + i * 1726, -110, 0.45); //far away background layer\n }\n\n for (j = 0; j < 6; j++) {\n addBackgroundObject('./img/background/02_middleBG/completo.png', bg_e... | [
"0.7888308",
"0.7104508",
"0.7022162",
"0.6864795",
"0.6852456",
"0.68368626",
"0.67776287",
"0.67122775",
"0.6675252",
"0.66591316",
"0.66359615",
"0.6632371",
"0.6607925",
"0.658695",
"0.6577236",
"0.6566365",
"0.655366",
"0.6536595",
"0.6534655",
"0.6499296",
"0.64816487",... | 0.7397609 | 1 |
function to execute when ajax request is unsuccessful | function ajaxFailure(){
alert("Ajax request failed");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function errorOnAjax() {\n console.log(\"error\");\n}",
"function AjaxFailed(result){\n $(\"#error-message\").show();\n}",
"function ajaxFailure(ajax, exception) {\n\tsetBookQuestion(false, \"\", \"\");\n\talert(\"Error making Ajax request:\" + \n\t\t\"\\n\\nServer status:\\n\" + ajax.status + \" \" + ajax... | [
"0.7895841",
"0.7634726",
"0.75811684",
"0.7545908",
"0.7513246",
"0.7502416",
"0.74777615",
"0.74585575",
"0.744824",
"0.7381245",
"0.7364899",
"0.73518413",
"0.7347253",
"0.734484",
"0.7246861",
"0.7214587",
"0.71961373",
"0.7148873",
"0.7147763",
"0.70917237",
"0.7060756",... | 0.79536605 | 0 |
function to execute when ajax request is unsuccessful | function ajaxFailure(){
alert("Ajax request failed");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function errorOnAjax() {\n console.log(\"error\");\n}",
"function AjaxFailed(result){\n $(\"#error-message\").show();\n}",
"function ajaxFailure(ajax, exception) {\n\tsetBookQuestion(false, \"\", \"\");\n\talert(\"Error making Ajax request:\" + \n\t\t\"\\n\\nServer status:\\n\" + ajax.status + \" \" + ajax... | [
"0.7895841",
"0.7634726",
"0.75811684",
"0.7545908",
"0.7513246",
"0.7502416",
"0.74777615",
"0.74585575",
"0.744824",
"0.7381245",
"0.7364899",
"0.73518413",
"0.7347253",
"0.734484",
"0.7246861",
"0.7214587",
"0.71961373",
"0.7148873",
"0.7147763",
"0.70917237",
"0.7060756",... | 0.79536605 | 1 |
Method to validate Resume. Only way I could make resume validation work was to make a method. | function checkResume() {
var x = document.getElementById('resume').value;
var sub = x.substring(x.length-3);
var validate;
if(sub == "doc" || sub == "ocx" || sub == "pdf"){
validate = true
}
if(sub == 0 || sub == "") {
document.getElementById('div_4').className='error'
document.getElementById('errPosition... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Resume() {}",
"get resume() {\n return this.args.student.resumes.objectAt(0);\n }",
"function resume() {\n\n var wasPaused = dom.wrapper.classList.contains('paused');\n dom.wrapper.classList.remove('paused');\n\n cueAutoSlide();\n\n if (wasPaused) {\n d... | [
"0.63501567",
"0.6205841",
"0.58673126",
"0.58353835",
"0.5823672",
"0.5762482",
"0.57017684",
"0.5653819",
"0.5647378",
"0.56367564",
"0.5495082",
"0.5418841",
"0.5414862",
"0.5412191",
"0.5408456",
"0.5393313",
"0.5377647",
"0.5373347",
"0.5370572",
"0.53322834",
"0.530639"... | 0.7176211 | 0 |
try catch for socket.io | function try_socket (success) {
if (socket_connected) {
try {
success()
} catch (e){
socket_connected = false
returnMessage(0)
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleSocketError(err) {\n this._metrics.onConnectionError(err);\n this.clearAndInvokePending(err);\n }",
"function onSocketError(err) {\n let data = _data.get(this);\n\n data.error = err;\n\n _data.set(this, data);\n}",
"onError(err) {\n debug(\"socket error %j\", err);\n Socket.priorWebsocket... | [
"0.662329",
"0.65019524",
"0.6494189",
"0.6494189",
"0.6494189",
"0.6480126",
"0.6470375",
"0.6470375",
"0.6470375",
"0.64612335",
"0.64489144",
"0.64186954",
"0.6401691",
"0.6401691",
"0.6401691",
"0.6384552",
"0.6384552",
"0.6384552",
"0.6384552",
"0.6384552",
"0.6384552",
... | 0.6783153 | 0 |
Method that returns an object with all metadata necessary to use a video resource | function buildVideoResource(video, title, baseDuration = 0, startTime = 0, endTime = 0) {
const duration = (window.references[video.id])
? window.references[video.id].data.metadata.duration : video.duration
return {
videoCore: video,
metadata: {
path: video.currentSrc,
title: title,
r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getVideoInformation() {\n if (config.useRemoteData) {\n return getRemoteVideoInformation();\n }\n return getLocalVideoInformation();\n\n}",
"function buildVideoResourceByPath(path, title, baseDuration = 0) {\n const video = document.createElement('video')\n video.id = getUniqueID()\n ... | [
"0.7106813",
"0.7020708",
"0.69897306",
"0.6905947",
"0.6696477",
"0.66406983",
"0.66003776",
"0.6521443",
"0.647891",
"0.6474681",
"0.63695806",
"0.63083076",
"0.6289562",
"0.62876314",
"0.62581074",
"0.6191499",
"0.6149443",
"0.61260664",
"0.60874504",
"0.60795563",
"0.6063... | 0.71889454 | 0 |
Method that handles the back button event and moves the video 1 second | function backButtonTrigger() {
if (window.currentVideoSelectedForPlayback) {
setCurrentlyPlaying(false)
const currentNode = window.currentVideoSelectedForPlayback
const currentTime = currentNode.data.videoCore.currentTime
const currentVideoStart = currentNode.data.metadata.startTime
if (currentTi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleBackButton(event) {\n var currState = state.get();\n \n switch( state.get() ) {\n case \"info\":\n toggleInfo(false);\n break;\n case \"browse\":\n state.change(\"video\");\n hideNavOverVideo();\n break;\n case \"video\":\n if(video.i... | [
"0.7493804",
"0.6716492",
"0.66935635",
"0.6649976",
"0.6604448",
"0.65879446",
"0.6575467",
"0.6533937",
"0.65317523",
"0.65271604",
"0.6517964",
"0.6504212",
"0.6497311",
"0.64942575",
"0.6445469",
"0.64147365",
"0.640373",
"0.64017874",
"0.6393263",
"0.63905007",
"0.634744... | 0.8148402 | 0 |
Method that handles the forward button event and moves the video ahead 1 second | function forwardButtonTrigger() {
if (window.currentVideoSelectedForPlayback) {
setCurrentlyPlaying(false)
const currentNode = window.currentVideoSelectedForPlayback
const currentTime = currentNode.data.videoCore.currentTime
const currentVideoEnd = currentNode.data.metadata.endTime
if (currentTim... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function forwardVideo(increment) {\n player.currentTime += increment;\n}",
"function fastForwardVideo() {\n var fastForward = player.getCurrentTime();\n var add15Seconds = fastForward + 15;\n player.seekTo(add15Seconds);\n }",
"function fastForward() {\n target = this.clas... | [
"0.80996895",
"0.809159",
"0.8038279",
"0.7679401",
"0.7325313",
"0.72315735",
"0.7134892",
"0.71232533",
"0.7099619",
"0.7001013",
"0.69006014",
"0.68982345",
"0.6854706",
"0.6790396",
"0.6745489",
"0.67240614",
"0.6722",
"0.66651607",
"0.66348696",
"0.6605668",
"0.6591118",... | 0.83719695 | 0 |
Logic for switching between the strech and fit ratio | function changeRatio(ctx) {
if (window.references[ctx.target.id].data.metadata.ratio == 'fit') {
window.currentRatio = 'strech'
document.querySelector('.toogle-strech').click()
window.references[ctx.target.id].data.metadata.ratio = 'strech'
} else if (window.references[ctx.target.id].data.metadata.ratio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Ratio() { // Credit to Sakari Hiltunen for ratio changing\r\n\t\tvar crStam = parseInt(document.getElementById('user_stamina').innerHTML);\r\n\t\tvar crEner = parseInt(document.getElementById('exp_to_next_level').innerHTML);\r\n\t\ttulos = (crEner/crStam);\r\n\t\tNeededRatio = tulos.toFixed(2);\r\n\t}",
... | [
"0.6228201",
"0.6114845",
"0.6114845",
"0.6114845",
"0.6033589",
"0.59021366",
"0.5891762",
"0.5753248",
"0.57468694",
"0.5734403",
"0.5695592",
"0.5688308",
"0.568188",
"0.5641172",
"0.56087404",
"0.56058526",
"0.5602225",
"0.5599789",
"0.5596289",
"0.556133",
"0.55192816",
... | 0.6989028 | 0 |
Sets the global variable currentlyPlaying that decides the current state of the UI | function setCurrentlyPlaying(value) {
window.currentlyPlaying = value
try {
window.currentVideoSelectedForPlayback.data.videoCore.pause()
} catch (error) {
/* No video is currently playing */
}
/* Updating the controls from the preview canvas */
setPlaybackControlState(value)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set playing(value) {\n // Only update the value if it's actually different\n if (this.isPlaying !== value) {\n this.isPlaying = value;\n this.observePlaying();\n }\n }",
"function setIsPlaying(){\n\t\t\tthat.isPlaying = !that.isPlaying;\n\t\t}",
"set isPlaying(value) {}",
"function toggle... | [
"0.7721934",
"0.7688549",
"0.7628257",
"0.72323847",
"0.71483964",
"0.7131529",
"0.7057987",
"0.7011623",
"0.697593",
"0.69758785",
"0.6953611",
"0.69239885",
"0.6910133",
"0.6817857",
"0.68141717",
"0.6781262",
"0.67535657",
"0.6743651",
"0.6738614",
"0.6731552",
"0.6706641"... | 0.80164665 | 0 |
Deletes the selected video and recalculates the flexGrow variable for the remaining items | function deleteVideo(ctx) {
/* Current window.timeline item */
const targetNode = window.references[ctx.target.id]
/* Linking the previous node */
if (targetNode.prev) {
targetNode.prev.next = targetNode.next
}
/* Linking the next node */
if (targetNode.next) {
targetNode.next.prev = targetNode.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function selectedCardDisappears() {\n $(this).parent().empty();\n }",
"function thumb_select_delete() {\n\tvar $elem = $('.thumb_current');\n\t\n\tremove_watermark();\n\t$('#container').find('.selected').removeClass('selected');\n\t$elem.addClass('selected');\n\t$elem.addClass('delete_watermark');\n\t$('#con... | [
"0.6097884",
"0.59253937",
"0.58634496",
"0.5850851",
"0.5805156",
"0.57299536",
"0.57221943",
"0.5714748",
"0.5710193",
"0.56396645",
"0.5613621",
"0.55889595",
"0.5580558",
"0.5579091",
"0.5579091",
"0.55515975",
"0.55375844",
"0.55207384",
"0.55094856",
"0.55017734",
"0.54... | 0.64217675 | 0 |
Splits the selected video with relative sizes | function splitVideo(ctx) {
/* Generating the unique ids for the elements */
const firstHalfId = getUniqueID()
const secondHalfId = getUniqueID()
/* Accessing key members for rendering */
const targetNode = window.references[ctx.target.id]
const targetNodeEnd = targetNode.data.metadata.endTime
const tar... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resizeVideo(){\n\t\tvar width, height, ratio;\n\t\t$(\".video\").each(function(){\n\t\t\tratio = $(this).data(\"ratio\");\n\t\t\tratio = ratio.split(\"/\");\n\t\t\tratio = ratio[0]/ratio[1];\n\t\t\twidth = $(this).width();\n\t\t\theight = width/ratio;\n\t\t\t$(this).height(height);\n\t\t});\n\t}",
"adju... | [
"0.662044",
"0.6582308",
"0.64580536",
"0.6428818",
"0.6408814",
"0.6393835",
"0.6135363",
"0.60837936",
"0.60639054",
"0.60400796",
"0.5991502",
"0.59903723",
"0.5943133",
"0.58505636",
"0.58256924",
"0.5808881",
"0.5804418",
"0.5791045",
"0.5787878",
"0.5737415",
"0.572327"... | 0.65967274 | 1 |
Gets a copy of the current matrix (top of the stack) | getCurrentMatrix() {
const { stack } = this;
return stack[stack.length - 1];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setCurrentMatrix(m) {\n const { stack } = this;\n return (stack[stack.length - 1] = m);\n }",
"function popMatrix() {\r\n return g_matrixStack.pop();\r\n}",
"function mvPush(){\n var copy = mat4.clone(mvMatrix);\n mvMatrixStack.push(copy);\n}",
"function mvPushMatrix() {\r\n var copy = mat4.clon... | [
"0.7446069",
"0.7111959",
"0.7094092",
"0.70123214",
"0.70123214",
"0.70123214",
"0.6934099",
"0.69256604",
"0.69256604",
"0.69256604",
"0.69256604",
"0.6923118",
"0.6895958",
"0.6882963",
"0.6876659",
"0.6835859",
"0.68115455",
"0.67769223",
"0.67737126",
"0.67737126",
"0.67... | 0.79600704 | 0 |
Rotates the current matrix around Z | rotateZ(angleInRadians) {
const m = this.getCurrentMatrix();
this.setCurrentMatrix(m4.rotateZ(m, angleInRadians));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rotateZ() {\n console.log('rotate about z triggered');\n var cosA = Math.cos(0.05);\n var sinA = Math.sin(0.05);\n var m = new THREE.Matrix4();\n m.set( cosA, sinA, 0, 0,\n -sinA, cosA, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1 );\n geome... | [
"0.74363863",
"0.7397829",
"0.7359082",
"0.7054559",
"0.6971907",
"0.6936929",
"0.68096995",
"0.6771814",
"0.67541426",
"0.6753461",
"0.6721401",
"0.66889757",
"0.66552585",
"0.66211754",
"0.66211754",
"0.66154915",
"0.65838283",
"0.65581095",
"0.6541141",
"0.65117604",
"0.65... | 0.7628041 | 0 |
Every font parameter has the following format: Where: face: either a standard web font name, or a postscript font, enumerated in fontTranslation. This could also be an or be missing if the face shouldn't change. utf8: This is optional, and specifies utf8. That's all that is supported so the field is just silently ignor... | function processNumberOnly() {
var size = parseInt(tokens[0].token);
tokens.shift();
if (!currentSetting) {
warn("Can't set just the size of the font since there is no default value.", str, position);
return { face: "\"Times New Roman\"", weight: "normal", style: "normal", decoration: "none", size: siz... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function processNumberOnly() {\n var size = parseInt(tokens[0].token);\n tokens.shift();\n if (!currentSetting) {\n warn(\"Can't set just the size of the font since there is no default value.\", str, position);\n return { face: \"\\\"Times New Roman\\\"\", weight: \"normal\", style: \"normal\", ... | [
"0.6650106",
"0.6351841",
"0.61910266",
"0.6045083",
"0.5987968",
"0.5969707",
"0.5944509",
"0.5944509",
"0.5939145",
"0.58503014",
"0.58346134",
"0.58051604",
"0.5775012",
"0.5760636",
"0.57095015",
"0.56877446",
"0.5657652",
"0.56353235",
"0.5560342",
"0.5559776",
"0.554021... | 0.6444655 | 1 |
This finds the place in the stylesheets that contain the rule that matches the selector. If that selector is not found, then it creates the rule. We are doing this so that we can use a transition for animating the scrolling. | function getCssRule(selector) {
var rule;
for (var i = 0; i < document.styleSheets.length && rule === undefined; i++) {
var css = document.styleSheets[i];
var rules = css.rules;
if (rules) {
for (var j = 0; j < rules.length && rule === undefined; j++) {
if (rules[j].selectorText && rules[j].select... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addStyle(selector, rules){ return addPageStyle(selector, rules);}",
"function createRule(selector) {\n var index = styleSheet.cssRules.length;\n styleSheet.insertRule(selector + ' {}', index);\n return styleSheet.cssRules[index];\n}",
"function getStyleRule (cssRules, selectorText) {\n let l... | [
"0.6347778",
"0.6305439",
"0.6128553",
"0.6008075",
"0.5874348",
"0.5693048",
"0.5638097",
"0.55693144",
"0.5550107",
"0.553807",
"0.55358386",
"0.5519664",
"0.54825467",
"0.53863144",
"0.53375703",
"0.5332094",
"0.5300462",
"0.5270134",
"0.5252024",
"0.524453",
"0.524453",
... | 0.63871413 | 0 |
Gets the line and measure number from the element's classes | function getLineAndMeasure(element) {
var klass = element.elemset[0].getAttribute("class");
var arr = klass.split(' ');
var lineNum;
var measureNum;
for (var i = 0; i < arr.length; i++) {
var match = /m(\d+)/.exec(arr[i]);
if (match) measureNum = match[1];
match = /l(\d+)/.exec(arr[i]);
i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"lineNumber() {\n\t for (let field of _sweetSpec2.default.getDescendant(this.type).getAttributes()) {\n\t if (typeof this[field.attrName] && this[field.attrName].lineNumber === 'function') {\n\t return this[field.attrName].lineNumber();\n\t }\n\t }\n\t }",
"function getLineNumberTag(proper... | [
"0.6299809",
"0.58870447",
"0.5789311",
"0.57267034",
"0.5689783",
"0.5564947",
"0.5493623",
"0.5352056",
"0.53513795",
"0.527898",
"0.5269689",
"0.5248532",
"0.52326334",
"0.5232304",
"0.52273875",
"0.5191549",
"0.5188287",
"0.51717985",
"0.51586884",
"0.512907",
"0.5087568"... | 0.80842876 | 0 |
If the padding is set in the tune, then use that. Otherwise, if the padding is set in the override, use that. Otherwise, use the defaults (there are a different set of defaults for screen and print.) | function setPaddingVariable(self, paddingKey, formattingKey, printDefault, screenDefault) {
if (abctune.formatting[formattingKey] !== undefined) self.padding[paddingKey] = abctune.formatting[formattingKey];else if (self.paddingOverride[paddingKey] !== undefined) self.padding[paddingKey] = self.paddingOverride[padding... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cleanPadding(pad) {\n var padding = {\n top: 0,\n left: 0,\n right: 0,\n bottom: 0\n };\n if (typeof pad === 'number') return {\n top: pad,\n left: pad,\n right: pad,\n bottom: pad\n };\n ['top', 'bottm', 'right', 'left'].forEach(function (d) {\n ... | [
"0.59958214",
"0.5957679",
"0.58988285",
"0.5840202",
"0.5712593",
"0.56886846",
"0.56886846",
"0.55219704",
"0.53889173",
"0.53789514",
"0.5306109",
"0.5231499",
"0.51893866",
"0.5182535",
"0.51558965",
"0.50862664",
"0.50350386",
"0.50271046",
"0.50233334",
"0.5012912",
"0.... | 0.7164007 | 0 |
Clears all local HabiBot state. | clearState() {
this.names = {};
this.history = {};
this.noids = {};
this.avatars = {};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clear() {\n $log.debug(\"kyc-flow-state clear()\");\n clearCurrent();\n states = [];\n }",
"function Clear()\n{\n\tUnspawnAll();\n\tavailable.Clear();\n\tall.Clear();\n}",
"function reset() {\n\n //clear enemies\n allEnemies.length = 0;\n //clear any text message... | [
"0.70080197",
"0.69599736",
"0.67926544",
"0.6738525",
"0.67190534",
"0.6709548",
"0.6705499",
"0.6663813",
"0.66453236",
"0.66344154",
"0.65949845",
"0.6544319",
"0.65436965",
"0.6543501",
"0.65399814",
"0.65328914",
"0.6530774",
"0.6526557",
"0.6526557",
"0.6520393",
"0.651... | 0.7144194 | 0 |
Increases the height of the infoWindow in order to show the rest of the information on mobile devices | function moreInfo() {
var infoWindowElem = $('.info-window');
infoWindowElem.css('top', '0');
infoWindowElem.css('height', '100vh');
infoWindowElem.css('overflow', 'scroll');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setInfoHeight() {\n\tvar height = $('div.map').height() - 36;\n\t$('div.info').height(height);\n}",
"function setInfoPaneHeight() {\n var tabBarHeight = $(\".tabBar\").outerHeight(true);\n var regimenTitleBarHeight = $(\".regimenTitleBar\").outerHeight(true);\n var pageTitleRowHeigh... | [
"0.77982545",
"0.6892672",
"0.6803084",
"0.6753721",
"0.6667193",
"0.6607908",
"0.6484411",
"0.6467656",
"0.6398109",
"0.6366201",
"0.63632935",
"0.6295209",
"0.62488043",
"0.62264925",
"0.6161245",
"0.61360294",
"0.61130375",
"0.61010766",
"0.61000663",
"0.60862225",
"0.6079... | 0.7552756 | 1 |
Write a function named combineWords that: return a new string that is the combination of the two parameters Example: combineWords('dog', 'house') => 'doghouse' | function combineWords(word1, word2) {
// TODO: Place your code here
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function combineWords(word1, word2) {\n return (word1 + \" \" + word2);\n}",
"function combine2Words(word1, word2) {\n return word1.concat(word2);\n}",
"function combineStrings(wordList){\n combineString = \"\";\n for(i=0; i<wordList.length; i++){\n combineString += wordList[i];\n }\n re... | [
"0.8235574",
"0.7686696",
"0.76861906",
"0.75884366",
"0.6799521",
"0.64306825",
"0.6420979",
"0.6391438",
"0.6376481",
"0.6252462",
"0.623473",
"0.6201895",
"0.6201895",
"0.61738306",
"0.6152813",
"0.6141213",
"0.61025554",
"0.60508704",
"0.6026382",
"0.6009898",
"0.6005324"... | 0.8121963 | 1 |
Search a table for 1. a given value partial and equality 2. multiple values last value will be tested for partial and equality, other values will be tested for equality (Format of value equality, equality, search a full equality sentence, partial) separated by comma followed by a space "equality," without space will no... | function search(value) {
try {
$('table.searchable > tbody > tr').show();
// split on ", "
var params = value.split(", ");
for (var param = 0; param < params.length; param++) {
if (params[param] != "") {
var $rows = $('table.searchable > tbody > tr').filte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function data_SearchEquality()\n{\n var srchfld = Node(\"data_numfld\").value;\n if (!srchfld) { // (IE6 hack)\n \tvar sel = Node(\"data_numfld\").getElementsByTagName(\"option\");\n\tfor (var n = 0; n < sel.length; n++) {\n\t if (sel[n].selected) srchfld = sel[n].text;\n\t}\n }\n\n var srchval =... | [
"0.5986826",
"0.56421995",
"0.56295073",
"0.5627719",
"0.5624569",
"0.54711866",
"0.5420452",
"0.53619844",
"0.5329578",
"0.53280056",
"0.5318233",
"0.5278406",
"0.5253918",
"0.5184877",
"0.51843125",
"0.5143948",
"0.5121787",
"0.5121635",
"0.5070601",
"0.5058934",
"0.5050326... | 0.6389228 | 0 |
hide star function ends with a break so if function called hide one ".stars li" css class | function hideStar() {
const starList = document.querySelectorAll('.stars li');
for (star of starList) {
if (star.style.display !== 'none')
{
star.style.display = 'none';
break;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hideStar() {\n const starLi = document.querySelectorAll('.stars li');\n for (star of starLi) {\n if (star.style.display !== 'none') {\n star.style.display = 'none';\n break;\n }\n\n }\n}",
"function hideStar() {\n const stars = document.querySelectorAll(\".stars li\");\n for (st... | [
"0.82990265",
"0.8249913",
"0.8244034",
"0.79902613",
"0.79726094",
"0.7900102",
"0.7846277",
"0.7837521",
"0.74026203",
"0.73239523",
"0.7194212",
"0.71772844",
"0.717526",
"0.7091766",
"0.70910597",
"0.70883745",
"0.7051224",
"0.70280707",
"0.6933609",
"0.6897273",
"0.68685... | 0.8400446 | 0 |
startClock starts an interval which is increamentet by time++ for each call | function startClock () {
clockId = setInterval(() => {
time++;
displayTime();
}, 1000);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function startClock(){\n\tt = getTime();\n\tsetNum(\"sec2\" ,t[\"s2\"]);\n\tsetNum(\"sec1\" ,t[\"s1\"]);\n\tsetNum(\"min2\" ,t[\"m2\"]);\n\tsetNum(\"min1\" ,t[\"m1\"]);\n\tsetNum(\"hours2\" ,t[\"h2\"]);\n\tsetNum(\"hours1\" ,t[\"h1\"]);\n\tupdateTimer = setTimeout(\"updateClock()\",5000)\n\t //console.debug(\"call... | [
"0.8249316",
"0.82141644",
"0.8027621",
"0.7969686",
"0.7753601",
"0.7508696",
"0.7505842",
"0.74099225",
"0.7377057",
"0.7368965",
"0.7286269",
"0.7275411",
"0.72147477",
"0.7167495",
"0.7123761",
"0.7067663",
"0.7046882",
"0.70226824",
"0.7002778",
"0.6986536",
"0.6980277",... | 0.8234313 | 1 |
function resetCards selects css class .deck li and for each it resets the className to 'card' | function resetCards() {
const cards = document.querySelectorAll('.deck li');
for (let card of cards) {
card.className = 'card';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resetCards() {\n\tlet cardsInDeck = $('.deck li')\n\tfor(card of cardsInDeck) {\n\t\tcard.className = 'card';\n\t}\n}",
"function resetCards() {\n const cards = document.querySelectorAll('.deck li');\n for (let card of cards) {\n card.className = 'card';\n }\n}",
"function resetCards()... | [
"0.9174877",
"0.9017484",
"0.87919784",
"0.8341715",
"0.827403",
"0.78683525",
"0.7747708",
"0.77248096",
"0.77172995",
"0.7617146",
"0.7431138",
"0.7351789",
"0.7325213",
"0.7319959",
"0.7292844",
"0.7292132",
"0.7281146",
"0.72717583",
"0.7249981",
"0.72479504",
"0.72471017... | 0.91366893 | 1 |
ToggleModal function toggle css class of modal__background | function toggleModal() {
const modal = document.querySelector('.modal__background');
modal.classList.toggle('hide');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function openAndCloseModal() {\r\n modal.classList.toggle(\"modal-bg-active\");\r\n}",
"function toggleModal() {\n\tconst modal = document.querySelector('.modal_background');\n\tmodal.classList.toggle('hide');\n}",
"function toggleModalOn() {\n const modal = document.querySelector('.modal-background');\n ... | [
"0.8070247",
"0.80296546",
"0.8014388",
"0.7906989",
"0.749211",
"0.7393365",
"0.73316157",
"0.7247424",
"0.72232836",
"0.72232836",
"0.7183072",
"0.71703106",
"0.6921968",
"0.6831786",
"0.68103164",
"0.6765655",
"0.6759902",
"0.67197824",
"0.66994935",
"0.66463405",
"0.65576... | 0.8092237 | 0 |
getStars function counts and returns css class of .stars li with the style display:none | function getStars() {
stars = document.querySelectorAll('.stars li');
starCount = 0;
for (star of stars) {
if (star.style.display !== 'none') {
starCount++;
}
}
return starCount;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getStars() {\r\n stars = document.querySelectorAll('.stars li');\r\n starCount = 3;\r\n for (star of stars) {\r\n if (star.style.display == 'none') {\r\n --starCount;\r\n }\r\n }\r\n return starCount;\r\n }",
"function getStars() {\n starNumber = docu... | [
"0.87711686",
"0.8517874",
"0.82187074",
"0.7984055",
"0.7675686",
"0.7556089",
"0.75199646",
"0.748004",
"0.74772966",
"0.7434757",
"0.73954695",
"0.73871994",
"0.7384956",
"0.73465216",
"0.73349345",
"0.73229164",
"0.73026013",
"0.72908854",
"0.72405165",
"0.7228407",
"0.72... | 0.86429524 | 1 |
reset the game with different functions resetClockAndTime() resetMoves() resetStars() shuffleDeck() resetCards() matched = 0; | function resetGame() {
resetClockAndTime();
resetMoves();
resetStars();
shuffleDeck();
resetCards();
matched = 0;
toggledCards = [];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resetGame() {\n matched = 0;\n resetTimer();\n resetMoves();\n resetStars();\n resetCards();\n shuffleDeck();\n}",
"function resetGame() {\n resetTimer();\n resetMoves();\n resetStars();\n shuffleDeck();\n resetCards();\n}",
"function resetGame() {\n clearGameCards(... | [
"0.909619",
"0.8641779",
"0.85629326",
"0.85616",
"0.8428358",
"0.8357261",
"0.8337628",
"0.8307817",
"0.8299125",
"0.8227517",
"0.81474155",
"0.8106045",
"0.80958784",
"0.80950695",
"0.80899566",
"0.80841666",
"0.80797374",
"0.80638075",
"0.80631405",
"0.8036938",
"0.8012896... | 0.89596367 | 1 |
reset the variables time, change bolean value vor clockOff call stopClock and displayTime | function resetClockAndTime() {
stopClock();
clockOff = true;
time = 0;
displayTime();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resetClockAndTime() {\n stopTimer();\n clockOff = true;\n hour = 0;\n minutes = 0;\n seconds = 0;\n displayTime();\n}",
"function resetTime () {\nstopClock();\ntimerOff = true;\ntime = 0;\ncountTime();\n}",
"function reset() {\n time = 30;\n // DONE: Change the \"display\" div ... | [
"0.83655256",
"0.7854401",
"0.7626919",
"0.7610034",
"0.7356612",
"0.7349848",
"0.73146886",
"0.719445",
"0.71779686",
"0.7165692",
"0.7139543",
"0.7122976",
"0.7120468",
"0.7064717",
"0.7059185",
"0.7007808",
"0.6995456",
"0.6971029",
"0.6957747",
"0.6956901",
"0.6943159",
... | 0.8447898 | 0 |
reset the moves and write it to the innerHTML of class .moves | function resetMoves() {
moves = 0;
document.querySelector('.moves').innerHTML = moves;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resetMoves() {\n moves = 0;\n document.querySelector('.moves').innerHTML = moves;\n}",
"function resetMoves() {\n moves = 0;\n document.querySelector(\"#moves\").innerHTML = moves;\n}",
"function resetMoves() {\n debug(\"resetMoves\");\n count = document.querySelector('.moves... | [
"0.8353549",
"0.8121232",
"0.7955716",
"0.75068927",
"0.7470592",
"0.7452997",
"0.73034453",
"0.7244531",
"0.7190803",
"0.7137757",
"0.6953309",
"0.6897954",
"0.6860009",
"0.6793835",
"0.6785008",
"0.6782905",
"0.6775979",
"0.67539793",
"0.6726352",
"0.6718511",
"0.6687746",
... | 0.848836 | 0 |
Takes a link id and finds which direction[10] it is connected in. | function getDir(id) {
var index = -1;
adjacent.forEach(function(newid, newindex) {
if (newid.id === id) {
index = newindex;
}
});
return index;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"findLink(device, portnr) {\n for (let i = 0; i < this._topology.length; i++) {\n const link = this._topology[i];\n if (link[0].device === device && link[0].lag.ports.indexOf(portnr) !== -1) {\n // Return the link with the device:port first\n return link;\n }\n if (link[1].devic... | [
"0.5893643",
"0.58129305",
"0.5811217",
"0.576151",
"0.5669061",
"0.5662656",
"0.555457",
"0.55149686",
"0.55135345",
"0.55103564",
"0.5450174",
"0.54200786",
"0.5419955",
"0.5352028",
"0.53460884",
"0.5303671",
"0.52437246",
"0.5240553",
"0.5220179",
"0.5219686",
"0.519347",... | 0.62598306 | 0 |
Shortcut to get a user by uid. | function get_user(uid, cb) {
User.findOne({
id: uid
}, function(err, u) {
if (!err && u) {
cb(u);
}
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findUserByUid(uid) {\n return db(\"users\").where({ uid }).first();\n}",
"async getUser(uid) {\n console.log('GET /user/%s', uid)\n return this.server.getUser(uid)\n }",
"async getUser(uid) {\n return this.user[uid]\n }",
"async get_user(user_id){\r\n\t\t\r\n\t\t//get user entry\r\n\t\ti... | [
"0.7755692",
"0.76002854",
"0.75788003",
"0.69950235",
"0.6817577",
"0.67088926",
"0.6706827",
"0.6686456",
"0.6613537",
"0.6600689",
"0.6589411",
"0.65726775",
"0.65668124",
"0.6511051",
"0.65066427",
"0.65050447",
"0.6454755",
"0.6439043",
"0.6418978",
"0.639813",
"0.639589... | 0.7977145 | 0 |
Writes curations to disk. | function updateCurs(cur) {
sem.take(function() {
var curstring = JSON.stringify(curations);
fs.writeFile(DEMPATH + "curations_" + name + ".json", curstring, function(
err) {
if (err) {
console.log("Error updating curations");
}
curation... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"save(fname) {\n let memento = {\n results: this._results,\n params: this._params,\n combinations: this._combinations\n };\n fs.writeFileSync(fname, JSON.stringify(memento), { encoding: \"utf8\" });\n }",
"write() {\n const json = this.toJson()\n for ... | [
"0.54625726",
"0.54334056",
"0.5404054",
"0.5384757",
"0.53560036",
"0.53449047",
"0.53317153",
"0.52773154",
"0.5265806",
"0.5264197",
"0.52543116",
"0.52465403",
"0.5230681",
"0.5214942",
"0.5197229",
"0.5188391",
"0.518549",
"0.51600224",
"0.5142612",
"0.5118049",
"0.50975... | 0.60077727 | 0 |
Checks a post against a given set of curation rules to see whether it is allowed in. | function checkRules(post, rules) {
var ok = true;
if (rules) {
Object.keys(rules).forEach(function(key) {
var rule = rules[key];
switch (rule.type) {
case "not_u":
if (post.uid == rule.value) {
ok = false;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function filterPosts(post) {\n let valid = true;\n\n // Exclude posts with no message\n if (!post.message) {\n valid = false;\n }\n\n // Exclude posts updating cover photos\n if (post.story && post.story.includes('cover photo')) {\n valid = false;\n }\n\n return valid;\n }",
"f... | [
"0.6455961",
"0.5949073",
"0.5819696",
"0.57197094",
"0.57197094",
"0.5573844",
"0.5483637",
"0.54752433",
"0.53764683",
"0.5335105",
"0.52655894",
"0.5250038",
"0.5198871",
"0.51713455",
"0.5084905",
"0.5004494",
"0.5003705",
"0.499983",
"0.49849954",
"0.49781093",
"0.497579... | 0.7151023 | 0 |
Checks if a given link id is a neighbor. | function isNeighbor(id) {
var neighbor = false;
adjacent.forEach(function(adj) {
if (adj.id === id) {
neighbor = true;
}
})
return neighbor;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"hasNeighbor(tile) {\n // tslint:disable-next-line:no-unsafe-any\n return tiled_1.BaseTile.prototype.hasNeighbor.call(this, tile);\n }",
"hasNeighbor(tile) {\n return Boolean(this.getAdjacentDirection(tile));\n }",
"function isValidNeighbor(currentTile){\n if(currentTile !== un... | [
"0.6414061",
"0.6198082",
"0.59638953",
"0.58880776",
"0.58352655",
"0.58176696",
"0.5729441",
"0.56947243",
"0.5662383",
"0.5628096",
"0.54755914",
"0.54129857",
"0.538134",
"0.5379084",
"0.53777903",
"0.53777903",
"0.5310743",
"0.5284128",
"0.52830744",
"0.52745086",
"0.525... | 0.76937705 | 0 |
Easy way to delete a post given a token and pid. | function easyDel(pid, token, cb) {
deletePost({
from: selfId,
original: selfId,
pid: pid,
token: token,
deleted: 0
}, function(res) {
console.log("DELETED POST");
cb(res);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deletePost(postId) {\n // TODO : Implement this\n}",
"function deletePost(req, cb) {\n Post.findOne({\n id: req.pid\n }, function(err, p) {\n if (!err) {\n jwt.verify(req.token, secret, function(err, decode) {\n if (!err) {\n if (decode... | [
"0.76417786",
"0.74767625",
"0.74538547",
"0.7377363",
"0.73731315",
"0.72153556",
"0.7158998",
"0.7077492",
"0.7048567",
"0.70189136",
"0.70189136",
"0.69221234",
"0.6894989",
"0.68835306",
"0.68550503",
"0.6800207",
"0.6784271",
"0.67772716",
"0.6745813",
"0.67269236",
"0.6... | 0.86186236 | 0 |
Iterates through posts, adding favorited to them where they match favs. | function checkFavs(favs, rposts) {
var fposts = rposts;
if (rposts.posts) {
fposts = rposts.posts;
}
Object.keys(favs).forEach(function(fav) {
if (favs[fav] === true) {
if (fposts[fav]) {
fposts[fav].favorited = true;
} else {
cons... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkFavsArr(favs, rposts) {\n rposts.forEach(function(post, index) {\n if (favs[post.id] === true) {\n rposts[index].favorited = true;\n }\n });\n return rposts\n}",
"function putFavoritesListOnPage() {\n let favorites = currentUser.favorites;\n for (let favorite of ... | [
"0.7058763",
"0.65413505",
"0.64100504",
"0.6157583",
"0.5989483",
"0.59785086",
"0.5967181",
"0.5917457",
"0.5882192",
"0.58228195",
"0.58175737",
"0.57966655",
"0.5793053",
"0.57869077",
"0.57563025",
"0.57389015",
"0.57023555",
"0.56985974",
"0.5696279",
"0.5668185",
"0.56... | 0.7019428 | 1 |
Same as checkFavs, but for when posts are in an array. | function checkFavsArr(favs, rposts) {
rposts.forEach(function(post, index) {
if (favs[post.id] === true) {
rposts[index].favorited = true;
}
});
return rposts
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkFavs(favs, rposts) {\n var fposts = rposts;\n if (rposts.posts) {\n fposts = rposts.posts;\n }\n Object.keys(favs).forEach(function(fav) {\n if (favs[fav] === true) {\n if (fposts[fav]) {\n fposts[fav].favorited = true;\n } else {\n\n ... | [
"0.64797187",
"0.6202856",
"0.60660917",
"0.604721",
"0.6013721",
"0.5969694",
"0.5892686",
"0.57944685",
"0.5720474",
"0.5676069",
"0.5644681",
"0.55648863",
"0.55167615",
"0.5472599",
"0.54673123",
"0.5422726",
"0.54083276",
"0.5403303",
"0.53666925",
"0.5366516",
"0.532170... | 0.6953173 | 0 |
returns copy of coordinate | copyCoordinates() {
return new Vector(this.x, this.y);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"copy()\r\n {\r\n return new Vector2D(this.x, this.y);\r\n }",
"copy()\n\t{\n\t\treturn new NodeGraph.Position(this.x, this.y, this.worldSpace);\n\t}",
"copyXYZ() {\nreturn E3Vec.copyOfV3(this.xyz);\n}",
"clone() { return new Vector2(this.x, this.y); }",
"copy(point) {\n this.setXYZ(poin... | [
"0.710858",
"0.6790808",
"0.67668307",
"0.67415947",
"0.6728279",
"0.6664698",
"0.6641525",
"0.6610068",
"0.65843004",
"0.6491161",
"0.64788896",
"0.6391713",
"0.62553984",
"0.62248605",
"0.61784285",
"0.6168633",
"0.6128953",
"0.6104074",
"0.6065748",
"0.6064108",
"0.6063525... | 0.80029917 | 0 |
rotate to the next position for the shape | function rotate(){
undraw();
currentRotation++;
if (currentRotation === currentShape.length)
{
currentRotation = 0;
}
currentShape = theShapes[randomShape][currentRotation];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rotateShape()\n {\n undrawShape();\n\n currentRotation++;\n\n if(currentRotation === currentShape.length)\n {\n currentRotation = 0;\n }\n \n currentShape = tetris_shapes[random_shape][currentRotation];\n \n drawShape();\n }",... | [
"0.7870178",
"0.7399139",
"0.70818514",
"0.7002798",
"0.69779235",
"0.69451404",
"0.6814397",
"0.6774517",
"0.6764524",
"0.67084605",
"0.66951185",
"0.6689446",
"0.6656312",
"0.66553307",
"0.66519773",
"0.6634419",
"0.6628494",
"0.6621255",
"0.65955824",
"0.6577332",
"0.65143... | 0.7869247 | 1 |
function to ask the user to input a number in [0 10] | function askForNumber() {
return prompt("Please Enter Number between 0 and 10", 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function callnumber(number) {\r\n do {\r\n var number = +prompt('enter number');\r\n }\r\n while (number !== 9);\r\n}",
"function userNumber(sceltaNum){\n\n sceltaNum = parseInt(prompt(\"Dimmi un numero da 1 a 20!\"));\n\n return sceltaNum\n\n}",
"function yourNumber() {\n read.questio... | [
"0.7640004",
"0.7087356",
"0.7024761",
"0.69801426",
"0.6937431",
"0.6773968",
"0.6713789",
"0.6708135",
"0.6611342",
"0.6609243",
"0.6564323",
"0.6564257",
"0.6536666",
"0.64992845",
"0.6486323",
"0.64825106",
"0.6458371",
"0.64504397",
"0.6448128",
"0.6439398",
"0.643073",
... | 0.8160675 | 0 |
function to ask the user if they want to continue the game | function continueGame() {
return confirm("Continue to play game?");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function askToContinue() {\n\t\tinquirer\n\t\t\t.prompt([\n\t\t\t\t{\n\t\t\t\t\ttype: 'confirm',\n\t\t\t\t\tmessage: 'Do you want to play again?',\n\t\t\t\t\tname: 'confirm',\n\t\t\t\t\tdefault: true\n\t\t\t\t}\n\t\t\t])\n\t\t\t.then(function(response) {\n\t\t\t\tif (response.confirm === true) {\n\t\t\t\t\tstartGa... | [
"0.8132912",
"0.76543355",
"0.7547466",
"0.75181895",
"0.74092185",
"0.73848045",
"0.7363003",
"0.7358547",
"0.7343373",
"0.73068476",
"0.7302439",
"0.72746795",
"0.7261674",
"0.7253525",
"0.72291183",
"0.7215672",
"0.72079575",
"0.719627",
"0.7179756",
"0.7109813",
"0.709960... | 0.7939427 | 1 |
this funciton return an integer that is the number of questions in a game | function numberOfQuestions () {
return quiz.questions.length
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function numberOfAnswers () {\n return quiz.questions[quiz.currentQuestion].choices.length\n}",
"function numberOfAnswers () {\n return quiz.questions[quiz.currentQuestion].choices.length\n}",
"function numberOfAnswers () {\n return quiz.questions[quiz.currentQuestion].options.length\n}",
"function getNum... | [
"0.7845609",
"0.7845609",
"0.7662869",
"0.75750333",
"0.74460304",
"0.740792",
"0.73952246",
"0.73240983",
"0.72925645",
"0.71796054",
"0.70748174",
"0.6997312",
"0.6971405",
"0.69464946",
"0.6870642",
"0.6853534",
"0.67952037",
"0.6792663",
"0.67799586",
"0.67692536",
"0.676... | 0.79176426 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.