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 |
|---|---|---|---|---|---|---|
When we receive and update. Get hold of the canvas, clear it and then redraw the gauge. | componentDidUpdate(_prevProps, _prevState, _snapshot) {
this.context2d = this.gaugeCanvas.getContext('2d');
this.context2d.clearRect(0, 0, this.gaugeCanvas.width, this.gaugeCanvas.height);
this.drawGauge();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateCanvas() {\n clearGraph();\n\n updatePoints();\n}",
"function updateCanvas() {\n ctx.clearRect(0, 0, 430, 430);\n fillCanvas();\n }",
"function draw() {\n var val = currentValue;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n var angle = Math.PI;\n if (v... | [
"0.70713526",
"0.67872316",
"0.6540642",
"0.6525051",
"0.6474738",
"0.6363883",
"0.6347614",
"0.6269377",
"0.6236952",
"0.6223225",
"0.6214813",
"0.6214813",
"0.61761117",
"0.6153049",
"0.6109994",
"0.6082619",
"0.60644513",
"0.6048558",
"0.6014497",
"0.60134333",
"0.5969684"... | 0.72750676 | 0 |
Create the gauge out of its constituent components Markers, pips and the needle. | drawGauge() {
this.drawMarker(this.startMark);
this.drawMarker(this.quarterMark);
this.drawMarker(this.halfMark);
this.drawMarker(this.threeQuarterMark);
this.drawMarker(this.finishMark);
this.drawNeedle(this.props.value);
for (let i in this.pipLocations) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buildGauge(wfreq) {\n\n // Enter the washing frequency between 0 and 180\n var level = parseFloat(wfreq) * 20;\n\n // Trig to calc meter point\n var degrees = 180 - level, radius = 0.75;\n var radians = (degrees * Math.PI) / 180;\n var x = radius * Math.cos(radians);\n var y = radius * Math.sin(r... | [
"0.65616065",
"0.64270115",
"0.63579094",
"0.6285369",
"0.6257026",
"0.6110477",
"0.6062627",
"0.59081745",
"0.58838665",
"0.5850391",
"0.5826069",
"0.5751626",
"0.5736776",
"0.57263136",
"0.5721336",
"0.5680686",
"0.5621922",
"0.5606725",
"0.5603595",
"0.55795133",
"0.553448... | 0.67290133 | 0 |
Draw a single pip at the supplied location | drawPip(pipLoc) {
this.context2d.beginPath();
this.context2d.linewidth = this.pipWidth;
this.context2d.strokeStyle = this.pipColour;
this.context2d.moveTo(pipLoc, 100);
this.context2d.lineTo(pipLoc, 130);
this.context2d.stroke();
this.context2d.closePath();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"drawVertex2D(pixp1) {\n // your draw behavior here. translation has been set so draw at (0,0)\n if (this.selected) stroke(this.selectcolor); else stroke(this.color2D);\n strokeWeight(10);\n\n // draw functionality - local coordinates point is now 0,0\n\n point(pixp1.x, pixp1.y);\... | [
"0.5107003",
"0.5024863",
"0.48570535",
"0.48131505",
"0.47991922",
"0.47785687",
"0.4777762",
"0.47741702",
"0.47629923",
"0.47456184",
"0.4735678",
"0.4699046",
"0.467206",
"0.4657175",
"0.46550462",
"0.46523112",
"0.46351603",
"0.46208575",
"0.46068588",
"0.46016434",
"0.4... | 0.718266 | 0 |
Draw the marker at the supplied location, call annotate when done. | drawMarker(markerLoc) {
this.context2d.beginPath();
this.context2d.lineWidth = this.markerWidth;
this.context2d.strokeStyle = this.markerColour;
this.context2d.moveTo(markerLoc, 50);
this.context2d.lineTo(markerLoc, 130);
this.context2d.stroke();
this.context2d.cl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"annotateMarker(annoLoc) {\n this.context2d.fillText('' + (this.calculateAnnoConversion(annoLoc)), annoLoc, 140);\n }",
"function drawLocation(location, opts) {\n if (typeof opts !== 'object') {\n opts = {};\n }\n opts.position = new google.maps.LatLng(location[0], location[1]);\n opts.... | [
"0.6748925",
"0.6568942",
"0.5953911",
"0.5930683",
"0.58830607",
"0.5828699",
"0.58128136",
"0.5783311",
"0.57803434",
"0.57328445",
"0.57010394",
"0.568629",
"0.5657724",
"0.56341314",
"0.5611724",
"0.56055015",
"0.5592178",
"0.5590589",
"0.55665004",
"0.55492663",
"0.55133... | 0.7740814 | 0 |
Annotate the marker with the appropriate numeric value. | annotateMarker(annoLoc) {
this.context2d.fillText('' + (this.calculateAnnoConversion(annoLoc)), annoLoc, 140);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function update_marker(name, color, number) {\n\tvar circle = document.getElementById(name + '_markerc');\n \tcircle.setAttribute('fill', color);\n\tvar text = document.getElementById(name + '_markert');\n\ttext.innerHTML = number;\n}",
"get yAxisAnnotationInterpolatedValuePrecision() {\r\n return this... | [
"0.616314",
"0.610954",
"0.56833416",
"0.5662361",
"0.56362927",
"0.562273",
"0.5562743",
"0.5561635",
"0.55416656",
"0.55169624",
"0.54896724",
"0.5430588",
"0.54255265",
"0.5410548",
"0.5395682",
"0.53752553",
"0.5338806",
"0.53168637",
"0.53168637",
"0.52934027",
"0.522036... | 0.678699 | 0 |
Draw the needle using the supplied EPICSValue | drawNeedle(epicsVal) {
this.context2d.beginPath();
this.context2d.lineWidth = this.needleWidth;
this.context2d.strokeStyle = this.needleColour;
this.context2d.moveTo(this.calculateNeedleLocation(epicsVal), 130);
this.context2d.lineTo(this.calculateNeedleLocation(epicsVal), 10);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function needlePath(value) {\n var degrees = (9-value)/9*180;\n var x = 0.5 * Math.cos(degrees * Math.PI / 180);\n var y = 0.5 * Math.sin(degrees * Math.PI / 180);\n var path1 = (degrees < 45 || degrees > 135) ? 'M -0.0 -0.025 L 0.0 0.025 L ' : 'M -0.025 -0.0 L 0.025 0.0 L ';\n var mainPath=path1;\n... | [
"0.63827574",
"0.63495654",
"0.5891989",
"0.5740375",
"0.56817454",
"0.553782",
"0.553754",
"0.54287434",
"0.53599757",
"0.52978843",
"0.52155113",
"0.5192946",
"0.518809",
"0.5110567",
"0.50905323",
"0.50777376",
"0.5066731",
"0.5041069",
"0.5010466",
"0.4972342",
"0.4970822... | 0.79268324 | 0 |
Calculate the needle location. Converts the epics data into a position in the gauge, based on the minimum and maximum possihle values and the size of the gauge. | calculateNeedleLocation(eValue) {
return((((eValue - this.minVal) / (this.maxVal - this.minVal)) * (this.internalXAxis)) + this.xAxisBuffer);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function needlePath(value) {\n var degrees = (9-value)/9*180;\n var x = 0.5 * Math.cos(degrees * Math.PI / 180);\n var y = 0.5 * Math.sin(degrees * Math.PI / 180);\n var path1 = (degrees < 45 || degrees > 135) ? 'M -0.0 -0.025 L 0.0 0.025 L ' : 'M -0.025 -0.0 L 0.025 0.0 L ';\n var mainPath=path1;\n... | [
"0.5700372",
"0.5696381",
"0.55683845",
"0.5384623",
"0.5327644",
"0.53133035",
"0.5291299",
"0.5286438",
"0.525202",
"0.5244141",
"0.5205727",
"0.5200103",
"0.51969504",
"0.51692724",
"0.51547605",
"0.51498955",
"0.51395863",
"0.5113934",
"0.50750154",
"0.5074339",
"0.506882... | 0.67096424 | 0 |
Calculate and define numerous constants that are used in drawing the gauge | defineClassConstants() {
//Obtaining a reference for the canvas
this.context2d = this.gaugeCanvas.getContext('2d');
//Internal Dimension definition
this.internalXAxis = this.gaugeCanvas.width * 0.8;
this.xAxisBuffer = this.gaugeCanvas.width * 0.1;
this.rightSideEnd = th... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fillConstants(){\n g.a = (27/64)*((g.R**2)*(g.Tc**2))/g.Pc\n g.b = (g.R*g.Tc)/(8*g.Pc);\n g.Vc = 0.359*(g.R*g.Tc)/g.Pc;\n}",
"function setupGaugeEstimation() {\n var gaugeColor = [];\n var i = -100;\n while (i <= 100) {\n if ((i < -25) || (i > 25)) gaugeColor.push(\"#ff4b4b\");\... | [
"0.66428816",
"0.659204",
"0.6551129",
"0.65409285",
"0.6353416",
"0.6183737",
"0.616069",
"0.6083584",
"0.6053198",
"0.60131794",
"0.6006074",
"0.6003215",
"0.60031646",
"0.60004056",
"0.59913075",
"0.59812623",
"0.59620726",
"0.5948264",
"0.5930222",
"0.5895888",
"0.5874603... | 0.7106895 | 0 |
install index for user to acces it on collection.by | function installIndex(collection, property, index) {
defineProperty(collection.by, property, {
value: createIndexWrap(index), enumerable: true, configurable: false, writable: false});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static async initialize() {\n // Create id index\n await this.createIndex('id', {\n id : -1,\n });\n\n // Create type index\n await this.createIndex('type', {\n type : -1,\n });\n\n // Create id+type index\n await this.createIndex('id+type', {\n id : -1,\n type : -1,\n... | [
"0.67199874",
"0.6602591",
"0.6526502",
"0.6499612",
"0.63925105",
"0.63622135",
"0.625857",
"0.625857",
"0.625857",
"0.61287385",
"0.59887904",
"0.59591836",
"0.5827826",
"0.5723162",
"0.56912684",
"0.56590104",
"0.56327546",
"0.56322306",
"0.56123865",
"0.56017286",
"0.5547... | 0.7219006 | 0 |
Determine whether the given properties match those of a `CfnHttpNamespaceProps` | function CfnHttpNamespacePropsValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CfnPublicDnsNamespacePropsValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but rec... | [
"0.6237145",
"0.61091745",
"0.6069037",
"0.6037893",
"0.6037893",
"0.6037893",
"0.6037893",
"0.6037893",
"0.6037893",
"0.6037893",
"0.6037893",
"0.6037893",
"0.6037893",
"0.6037893",
"0.6037893",
"0.6037893",
"0.6037893",
"0.6037893",
"0.6037893",
"0.6037893",
"0.6037893",
... | 0.70307183 | 0 |
Renders the AWS CloudFormation properties of an `AWS::ServiceDiscovery::HttpNamespace` resource | function cfnHttpNamespacePropsToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnHttpNamespacePropsValidator(properties).assertSuccess();
return {
Name: cdk.stringToCloudFormation(properties.name),
Description: cdk.stringToCloudFormation(pro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cfnPublicDnsNamespacePropsToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnPublicDnsNamespacePropsValidator(properties).assertSuccess();\n return {\n Name: cdk.stringToCloudFormation(properties.name),\n Description: cdk.stri... | [
"0.54261994",
"0.5370061",
"0.5215549",
"0.5173569",
"0.5128117",
"0.505438",
"0.50349313",
"0.49465153",
"0.4919494",
"0.48867035",
"0.48285145",
"0.48098212",
"0.4805909",
"0.47578174",
"0.4745201",
"0.4736473",
"0.47283027",
"0.47039875",
"0.46848184",
"0.46202084",
"0.461... | 0.6000428 | 0 |
Determine whether the given properties match those of a `CfnInstanceProps` | function CfnInstancePropsValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.strin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"matches(properties) {\n for (const type in properties) {\n const component = this.component(type);\n if (!component.exists())\n return false;\n for (const key in properties[type]) {\n const value = properties[type][key];\n if (component.property(ke... | [
"0.7080717",
"0.6983423",
"0.67830586",
"0.67241347",
"0.6388757",
"0.6382971",
"0.636184",
"0.62694335",
"0.6251973",
"0.6251973",
"0.6195289",
"0.6155507",
"0.6108377",
"0.6104665",
"0.60810095",
"0.6079663",
"0.60365254",
"0.6009456",
"0.5993485",
"0.59867746",
"0.59788513... | 0.700102 | 1 |
Renders the AWS CloudFormation properties of an `AWS::ServiceDiscovery::Instance` resource | function cfnInstancePropsToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnInstancePropsValidator(properties).assertSuccess();
return {
InstanceAttributes: cdk.objectToCloudFormation(properties.instanceAttributes),
ServiceId: cdk.stringToCl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cfnInstancePropsToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnInstancePropsValidator(properties).assertSuccess();\n return {\n AdditionalInfo: cdk.stringToCloudFormation(properties.additionalInfo),\n Affinity: cdk.stringT... | [
"0.61283255",
"0.56816304",
"0.54828817",
"0.5462381",
"0.54507256",
"0.5449853",
"0.5427009",
"0.5427009",
"0.5420323",
"0.5403749",
"0.5403298",
"0.5392158",
"0.5392158",
"0.5387482",
"0.53409",
"0.5323842",
"0.53157574",
"0.5314434",
"0.5308416",
"0.5306023",
"0.53058016",... | 0.5932727 | 1 |
A factory method that creates a new instance of this class from an object containing the CloudFormation properties of this resource. | static _fromCloudFormation(scope, id, resourceAttributes, options) {
resourceAttributes = resourceAttributes || {};
const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);
const propsResult = CfnInstancePropsFromCloudFormation(resourceProperties);
const ret =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnMemberPropsFromCloudFormation(resourceProperties);\n cons... | [
"0.7124624",
"0.70953816",
"0.7089964",
"0.7089702",
"0.70874363",
"0.70586115",
"0.7025964",
"0.70232254",
"0.6975184",
"0.6947232",
"0.6920953",
"0.68899214",
"0.68884355",
"0.685057",
"0.68280727",
"0.681982",
"0.6814946",
"0.67965317",
"0.6780622",
"0.67723554",
"0.677058... | 0.748558 | 1 |
Determine whether the given properties match those of a `CfnPrivateDnsNamespaceProps` | function CfnPrivateDnsNamespacePropsValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but received: ' +... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CfnPublicDnsNamespacePropsValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but rec... | [
"0.6605535",
"0.6200378",
"0.61891633",
"0.61465317",
"0.6144776",
"0.6144776",
"0.6144776",
"0.6144776",
"0.6144776",
"0.6144776",
"0.6144776",
"0.6144776",
"0.6144776",
"0.6144776",
"0.6144776",
"0.6144776",
"0.6144776",
"0.6144776",
"0.6144776",
"0.6144776",
"0.6144776",
... | 0.7182745 | 0 |
Renders the AWS CloudFormation properties of an `AWS::ServiceDiscovery::PrivateDnsNamespace` resource | function cfnPrivateDnsNamespacePropsToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnPrivateDnsNamespacePropsValidator(properties).assertSuccess();
return {
Name: cdk.stringToCloudFormation(properties.name),
Vpc: cdk.stringToCloudFormation... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cfnPrivateDnsNamespacePropertiesPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnPrivateDnsNamespace_PropertiesPropertyValidator(properties).assertSuccess();\n return {\n DnsProperties: cfnPrivateDnsNamespacePrivateDnsPrope... | [
"0.6795867",
"0.61275053",
"0.6021895",
"0.5989002",
"0.5958024",
"0.5817576",
"0.56735516",
"0.5497913",
"0.54073757",
"0.5337977",
"0.5209337",
"0.5147502",
"0.5035898",
"0.503423",
"0.5015901",
"0.50007325",
"0.4973012",
"0.49639198",
"0.49446273",
"0.4934318",
"0.49057132... | 0.6793102 | 1 |
Renders the AWS CloudFormation properties of an `AWS::ServiceDiscovery::PrivateDnsNamespace.PrivateDnsPropertiesMutable` resource | function cfnPrivateDnsNamespacePrivateDnsPropertiesMutablePropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnPrivateDnsNamespace_PrivateDnsPropertiesMutablePropertyValidator(properties).assertSuccess();
return {
SOA: cfnPrivateDnsNamespaceSO... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cfnPrivateDnsNamespacePropertiesPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnPrivateDnsNamespace_PropertiesPropertyValidator(properties).assertSuccess();\n return {\n DnsProperties: cfnPrivateDnsNamespacePrivateDnsPrope... | [
"0.66600764",
"0.62087506",
"0.5890787",
"0.58577967",
"0.5754841",
"0.5709642",
"0.5706666",
"0.5439989",
"0.5413256",
"0.5408913",
"0.53574616",
"0.53397155",
"0.5336494",
"0.5242474",
"0.52155036",
"0.51169735",
"0.49672946",
"0.4952315",
"0.4943011",
"0.4921773",
"0.49010... | 0.68678576 | 0 |
Renders the AWS CloudFormation properties of an `AWS::ServiceDiscovery::PrivateDnsNamespace.Properties` resource | function cfnPrivateDnsNamespacePropertiesPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnPrivateDnsNamespace_PropertiesPropertyValidator(properties).assertSuccess();
return {
DnsProperties: cfnPrivateDnsNamespacePrivateDnsPropertiesMutabl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cfnPrivateDnsNamespacePropsToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnPrivateDnsNamespacePropsValidator(properties).assertSuccess();\n return {\n Name: cdk.stringToCloudFormation(properties.name),\n Vpc: cdk.stringToCl... | [
"0.6981224",
"0.6513482",
"0.6445633",
"0.6331758",
"0.63116014",
"0.5961655",
"0.59001297",
"0.5890852",
"0.58597827",
"0.5853864",
"0.55712867",
"0.5506156",
"0.54949546",
"0.54921764",
"0.5491105",
"0.5441993",
"0.54383624",
"0.54069424",
"0.54052895",
"0.5377087",
"0.5371... | 0.7142314 | 0 |
Renders the AWS CloudFormation properties of an `AWS::ServiceDiscovery::PrivateDnsNamespace.SOA` resource | function cfnPrivateDnsNamespaceSOAPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnPrivateDnsNamespace_SOAPropertyValidator(properties).assertSuccess();
return {
TTL: cdk.numberToCloudFormation(properties.ttl),
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cfnPublicDnsNamespaceSOAPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnPublicDnsNamespace_SOAPropertyValidator(properties).assertSuccess();\n return {\n TTL: cdk.numberToCloudFormation(properties.ttl),\n };\n}",
"fun... | [
"0.64038247",
"0.5846089",
"0.54872185",
"0.5471185",
"0.53606296",
"0.5327466",
"0.50964767",
"0.5093596",
"0.5059941",
"0.5045452",
"0.500448",
"0.4888697",
"0.4775232",
"0.46609718",
"0.4640398",
"0.4624471",
"0.46052608",
"0.4575542",
"0.45737165",
"0.45712388",
"0.456356... | 0.67057747 | 0 |
Determine whether the given properties match those of a `CfnPublicDnsNamespaceProps` | function CfnPublicDnsNamespacePropsValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CfnPrivateDnsNamespacePropsValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but re... | [
"0.6442074",
"0.62381047",
"0.6232423",
"0.62102276",
"0.6201507",
"0.61838967",
"0.61838967",
"0.61838967",
"0.61838967",
"0.61838967",
"0.61838967",
"0.61838967",
"0.61838967",
"0.61838967",
"0.61838967",
"0.61838967",
"0.61838967",
"0.61838967",
"0.61838967",
"0.61838967",
... | 0.723884 | 0 |
Renders the AWS CloudFormation properties of an `AWS::ServiceDiscovery::PublicDnsNamespace` resource | function cfnPublicDnsNamespacePropsToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnPublicDnsNamespacePropsValidator(properties).assertSuccess();
return {
Name: cdk.stringToCloudFormation(properties.name),
Description: cdk.stringToCloudFor... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cfnPublicDnsNamespacePropertiesPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnPublicDnsNamespace_PropertiesPropertyValidator(properties).assertSuccess();\n return {\n DnsProperties: cfnPublicDnsNamespacePublicDnsPropertie... | [
"0.6772611",
"0.61600286",
"0.61235887",
"0.5945682",
"0.58084077",
"0.579487",
"0.563906",
"0.55790067",
"0.5546915",
"0.54382306",
"0.53940356",
"0.5362065",
"0.52873135",
"0.5141588",
"0.49771294",
"0.49696612",
"0.4952186",
"0.49322516",
"0.49257728",
"0.49224105",
"0.491... | 0.69192255 | 0 |
Create a new `AWS::ServiceDiscovery::PublicDnsNamespace`. | constructor(scope, id, props) {
super(scope, id, { type: CfnPublicDnsNamespace.CFN_RESOURCE_TYPE_NAME, properties: props });
try {
jsiiDeprecationWarnings.aws_cdk_lib_aws_servicediscovery_CfnPublicDnsNamespaceProps(props);
}
catch (error) {
if (process.env.JSII_DE... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnPublicDnsNamespacePropsFromCloudFormation(resourceProperties);\n... | [
"0.608551",
"0.58832973",
"0.56164235",
"0.55506384",
"0.519687",
"0.51863503",
"0.51479995",
"0.5133647",
"0.49344328",
"0.4888983",
"0.4888983",
"0.48216146",
"0.47483748",
"0.4737315",
"0.47327673",
"0.47144958",
"0.4686566",
"0.46808726",
"0.46543562",
"0.4648177",
"0.458... | 0.6047517 | 1 |
Renders the AWS CloudFormation properties of an `AWS::ServiceDiscovery::PublicDnsNamespace.Properties` resource | function cfnPublicDnsNamespacePropertiesPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnPublicDnsNamespace_PropertiesPropertyValidator(properties).assertSuccess();
return {
DnsProperties: cfnPublicDnsNamespacePublicDnsPropertiesMutablePro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cfnPublicDnsNamespacePropsToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnPublicDnsNamespacePropsValidator(properties).assertSuccess();\n return {\n Name: cdk.stringToCloudFormation(properties.name),\n Description: cdk.stri... | [
"0.7055677",
"0.64378816",
"0.6436693",
"0.6419834",
"0.6172559",
"0.6148304",
"0.6118371",
"0.60307616",
"0.5939478",
"0.584927",
"0.5840374",
"0.58261067",
"0.5671293",
"0.5626125",
"0.55361336",
"0.5527611",
"0.5525005",
"0.55105466",
"0.5510471",
"0.5504564",
"0.55043393"... | 0.71067446 | 0 |
Determine whether the given properties match those of a `PublicDnsPropertiesMutableProperty` | function CfnPublicDnsNamespace_PublicDnsPropertiesMutablePropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"matches(properties) {\n for (const type in properties) {\n const component = this.component(type);\n if (!component.exists())\n return false;\n for (const key in properties[type]) {\n const value = properties[type][key];\n if (component.property(ke... | [
"0.7220142",
"0.6576986",
"0.6574763",
"0.6486125",
"0.64222777",
"0.6333256",
"0.6206119",
"0.6173574",
"0.60899323",
"0.60647464",
"0.60057235",
"0.6000996",
"0.5999931",
"0.59783554",
"0.59266794",
"0.58867145",
"0.588168",
"0.5878236",
"0.5846689",
"0.57946557",
"0.579465... | 0.6913265 | 1 |
Renders the AWS CloudFormation properties of an `AWS::ServiceDiscovery::PublicDnsNamespace.PublicDnsPropertiesMutable` resource | function cfnPublicDnsNamespacePublicDnsPropertiesMutablePropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnPublicDnsNamespace_PublicDnsPropertiesMutablePropertyValidator(properties).assertSuccess();
return {
SOA: cfnPublicDnsNamespaceSOAProp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cfnPublicDnsNamespacePropertiesPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnPublicDnsNamespace_PropertiesPropertyValidator(properties).assertSuccess();\n return {\n DnsProperties: cfnPublicDnsNamespacePublicDnsPropertie... | [
"0.65565497",
"0.61786",
"0.6041014",
"0.5891573",
"0.5785327",
"0.55961555",
"0.55930465",
"0.5580385",
"0.54588234",
"0.5368595",
"0.53478384",
"0.5214154",
"0.5201928",
"0.51857126",
"0.5103327",
"0.50939476",
"0.50939125",
"0.50854033",
"0.50559366",
"0.5041725",
"0.50327... | 0.6854516 | 0 |
Renders the AWS CloudFormation properties of an `AWS::ServiceDiscovery::PublicDnsNamespace.SOA` resource | function cfnPublicDnsNamespaceSOAPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnPublicDnsNamespace_SOAPropertyValidator(properties).assertSuccess();
return {
TTL: cdk.numberToCloudFormation(properties.ttl),
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cfnPrivateDnsNamespaceSOAPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnPrivateDnsNamespace_SOAPropertyValidator(properties).assertSuccess();\n return {\n TTL: cdk.numberToCloudFormation(properties.ttl),\n };\n}",
"f... | [
"0.61517113",
"0.5804515",
"0.55951196",
"0.5431936",
"0.5353846",
"0.5254651",
"0.5243413",
"0.4927997",
"0.48636585",
"0.4841406",
"0.47596434",
"0.47078636",
"0.46813583",
"0.46496293",
"0.46345952",
"0.462098",
"0.46095762",
"0.45934248",
"0.45461258",
"0.45429403",
"0.45... | 0.6632102 | 0 |
Determine whether the given properties match those of a `CfnServiceProps` | function CfnServicePropsValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.string... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"matches(properties) {\n for (const type in properties) {\n const component = this.component(type);\n if (!component.exists())\n return false;\n for (const key in properties[type]) {\n const value = properties[type][key];\n if (component.property(ke... | [
"0.69884205",
"0.6629135",
"0.65892816",
"0.6580833",
"0.6580833",
"0.6580833",
"0.6580833",
"0.6580833",
"0.6580833",
"0.6580833",
"0.6580833",
"0.6580833",
"0.6580833",
"0.6580833",
"0.6580833",
"0.6580833",
"0.6580833",
"0.6580833",
"0.6580833",
"0.6580833",
"0.6580833",
... | 0.6994509 | 0 |
Renders the AWS CloudFormation properties of an `AWS::ServiceDiscovery::Service` resource | function cfnServicePropsToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnServicePropsValidator(properties).assertSuccess();
return {
Description: cdk.stringToCloudFormation(properties.description),
DnsConfig: cfnServiceDnsConfigPropertyToC... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderServiceDetails(service) {\n let results = service;\n let output = \"\";\n output += getServiceDetails(results);\n renderCarouselImages(service);\n}",
"constructor(scope, id, props = {}) {\n super(scope, id, { type: CfnService.CFN_RESOURCE_TYPE_NAME, properties: props });\n ... | [
"0.5500467",
"0.53113014",
"0.53064865",
"0.52467304",
"0.5194562",
"0.5188489",
"0.510459",
"0.5092578",
"0.5073559",
"0.50720024",
"0.50330937",
"0.5028613",
"0.5017421",
"0.5015968",
"0.50058824",
"0.49876654",
"0.49813923",
"0.49680063",
"0.49449518",
"0.49370307",
"0.488... | 0.58023393 | 0 |
Determine whether the given properties match those of a `DnsConfigProperty` | function CfnService_DnsConfigPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but received: ' ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"matches(properties) {\n for (const type in properties) {\n const component = this.component(type);\n if (!component.exists())\n return false;\n for (const key in properties[type]) {\n const value = properties[type][key];\n if (component.property(ke... | [
"0.6750218",
"0.61863816",
"0.61285603",
"0.6117253",
"0.6078545",
"0.59907943",
"0.59658563",
"0.59022075",
"0.5894121",
"0.587221",
"0.5854623",
"0.58471286",
"0.58368695",
"0.58346033",
"0.57903814",
"0.5787159",
"0.5781066",
"0.5763546",
"0.5758671",
"0.57563436",
"0.5748... | 0.67750704 | 0 |
Renders the AWS CloudFormation properties of an `AWS::ServiceDiscovery::Service.DnsConfig` resource | function cfnServiceDnsConfigPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnService_DnsConfigPropertyValidator(properties).assertSuccess();
return {
DnsRecords: cdk.listMapper(cfnServiceDnsRecordPropertyToCloudFormation)(properties.dnsRec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cfnServiceDnsRecordPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnService_DnsRecordPropertyValidator(properties).assertSuccess();\n return {\n TTL: cdk.numberToCloudFormation(properties.ttl),\n Type: cdk.stringToCl... | [
"0.58235836",
"0.5525514",
"0.5524554",
"0.5400622",
"0.5380146",
"0.5336934",
"0.5291089",
"0.52620167",
"0.52471066",
"0.5223017",
"0.5205768",
"0.5125043",
"0.5115423",
"0.50932556",
"0.50481486",
"0.50403416",
"0.5036362",
"0.5034643",
"0.49985626",
"0.49885663",
"0.49663... | 0.65763676 | 0 |
Determine whether the given properties match those of a `DnsRecordProperty` | function CfnService_DnsRecordPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but received: ' ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"matches(properties) {\n for (const type in properties) {\n const component = this.component(type);\n if (!component.exists())\n return false;\n for (const key in properties[type]) {\n const value = properties[type][key];\n if (component.property(ke... | [
"0.67601883",
"0.64266634",
"0.6412324",
"0.63433033",
"0.6281199",
"0.6249025",
"0.6216896",
"0.6202763",
"0.6085936",
"0.605701",
"0.60231155",
"0.6017646",
"0.6010096",
"0.59602064",
"0.59382325",
"0.59231013",
"0.5921779",
"0.591386",
"0.5882646",
"0.588164",
"0.58663297"... | 0.68565595 | 0 |
Renders the AWS CloudFormation properties of an `AWS::ServiceDiscovery::Service.DnsRecord` resource | function cfnServiceDnsRecordPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnService_DnsRecordPropertyValidator(properties).assertSuccess();
return {
TTL: cdk.numberToCloudFormation(properties.ttl),
Type: cdk.stringToCloudFormation... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cfnServiceDnsConfigPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnService_DnsConfigPropertyValidator(properties).assertSuccess();\n return {\n DnsRecords: cdk.listMapper(cfnServiceDnsRecordPropertyToCloudFormation)(proper... | [
"0.6395758",
"0.52350867",
"0.51561093",
"0.50969803",
"0.508915",
"0.50691026",
"0.50532544",
"0.50309724",
"0.50309724",
"0.5016307",
"0.5016307",
"0.5012878",
"0.5012878",
"0.501266",
"0.50029165",
"0.49936432",
"0.4981252",
"0.49801463",
"0.495831",
"0.49285638",
"0.49067... | 0.66164106 | 0 |
Determine whether the given properties match those of a `HealthCheckConfigProperty` | function CfnService_HealthCheckConfigPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but rece... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"matches(properties) {\n for (const type in properties) {\n const component = this.component(type);\n if (!component.exists())\n return false;\n for (const key in properties[type]) {\n const value = properties[type][key];\n if (component.property(ke... | [
"0.680056",
"0.6407807",
"0.63277125",
"0.630717",
"0.623661",
"0.6132792",
"0.61299294",
"0.61161137",
"0.61110103",
"0.60702866",
"0.6007854",
"0.59906614",
"0.5971232",
"0.59693754",
"0.5921453",
"0.58874834",
"0.5885289",
"0.58662945",
"0.58549494",
"0.58245665",
"0.57809... | 0.6760477 | 1 |
Renders the AWS CloudFormation properties of an `AWS::ServiceDiscovery::Service.HealthCheckConfig` resource | function cfnServiceHealthCheckConfigPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnService_HealthCheckConfigPropertyValidator(properties).assertSuccess();
return {
FailureThreshold: cdk.numberToCloudFormation(properties.failureThreshold)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cfnServiceHealthCheckCustomConfigPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnService_HealthCheckCustomConfigPropertyValidator(properties).assertSuccess();\n return {\n FailureThreshold: cdk.numberToCloudFormation(prope... | [
"0.59018373",
"0.5280777",
"0.5194546",
"0.5172843",
"0.5150255",
"0.5091168",
"0.49949625",
"0.49739334",
"0.49721646",
"0.49675354",
"0.49565846",
"0.49413005",
"0.48785356",
"0.4877813",
"0.48746037",
"0.48513415",
"0.4846897",
"0.48305064",
"0.47916132",
"0.47837356",
"0.... | 0.61229265 | 0 |
Determine whether the given properties match those of a `HealthCheckCustomConfigProperty` | function CfnService_HealthCheckCustomConfigPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, bu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"matches(properties) {\n for (const type in properties) {\n const component = this.component(type);\n if (!component.exists())\n return false;\n for (const key in properties[type]) {\n const value = properties[type][key];\n if (component.property(ke... | [
"0.67569214",
"0.6457202",
"0.6325006",
"0.6182507",
"0.60643005",
"0.60515785",
"0.60443044",
"0.5973649",
"0.5931078",
"0.5902283",
"0.5824245",
"0.58241403",
"0.5811055",
"0.580359",
"0.5782588",
"0.5779707",
"0.57595617",
"0.5754994",
"0.5747583",
"0.56838006",
"0.5674454... | 0.70069575 | 0 |
Renders the AWS CloudFormation properties of an `AWS::ServiceDiscovery::Service.HealthCheckCustomConfig` resource | function cfnServiceHealthCheckCustomConfigPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnService_HealthCheckCustomConfigPropertyValidator(properties).assertSuccess();
return {
FailureThreshold: cdk.numberToCloudFormation(properties.failu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cfnServiceHealthCheckConfigPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnService_HealthCheckConfigPropertyValidator(properties).assertSuccess();\n return {\n FailureThreshold: cdk.numberToCloudFormation(properties.failur... | [
"0.57588243",
"0.5535639",
"0.53720206",
"0.5142317",
"0.50852937",
"0.50092554",
"0.49995598",
"0.49230447",
"0.4913452",
"0.4911519",
"0.49089044",
"0.4898525",
"0.48744404",
"0.4850418",
"0.4828578",
"0.47951347",
"0.4776325",
"0.47670907",
"0.47584876",
"0.474684",
"0.474... | 0.64735997 | 0 |
Adds/removes line spaces between bars | function addBarLines(event){
if (event.target && event.keyCode == 84){
areLines = !areLines;
if (areLines){
for (let i = 0; i < arr.length; i++){
data.children[i].style.setProperty('transition-duration', '0s');
data.children[i].style.boxSizing = 'border-box';
data.children[i].sty... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"checkIfNeedsLastBar() {\n\t\tif (this.cell !== 15)\n\t\t\treturn;\n\t\tif (!this.closebar)\n\t\t\treturn;\n\t\tlet curCell = this.cells[this.cell];\n\t\tvar bar = document.createElement(\"irr-rbar\");\n\t\tbar.classList.add(\"Single-Barline\");\n\t\tcurCell.insertBefore(bar, curCell.firstChild);\t// must insert, n... | [
"0.6209113",
"0.61892897",
"0.60256994",
"0.5761286",
"0.57197815",
"0.5715509",
"0.56983453",
"0.5687926",
"0.56805795",
"0.5659217",
"0.56577593",
"0.5640953",
"0.56300247",
"0.56287664",
"0.5593394",
"0.55809784",
"0.5560817",
"0.55483127",
"0.554607",
"0.554415",
"0.55387... | 0.6576321 | 0 |
Function to display Show Page of Product | function renderProductShow(id) {
Products.show(id).then(product => {
// console.log(`${product.id} - ${product.title}`)
const showPage = document.querySelector('.page#product-show')
const showPageHTML = `
<h2>${product.title}</h2>
<p>${product.description}</p>
<a data... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderProductPage (productId) {\n if (!productId) {\n return false;\n }\n\n return client.entries({\n content_type: ContentTypes.Product,\n 'sys.id': productId\n }).then(function (products) {\n var product = products[0];\n if (!product) {\n return false;\n ... | [
"0.7085534",
"0.6984886",
"0.68023056",
"0.6780661",
"0.6651184",
"0.66267705",
"0.65399116",
"0.65276754",
"0.6514831",
"0.64863425",
"0.6483617",
"0.64831597",
"0.6442058",
"0.6436099",
"0.64287674",
"0.63833934",
"0.6366301",
"0.63107175",
"0.63048214",
"0.6288465",
"0.626... | 0.7398213 | 0 |
addVar() Adds a variable to the variable stack. | function addVar(v){
varStack.push(v);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addVariable(v) {\n\t\tv.setIndex(this._vars.length);\n\t\tthis._vars.push(v);\n\t}",
"function addVar(type) {\n\t\tif (isIntoFunction) {\n\t\t\tlocalVarTable.push(type);\n\t\t\tlocalVarTable.push(thisToken);\n\t\t} else {\n\t\t\tvarTable.push({\n\t\t\t\tname: thisToken,\n\t\t\t\ttype: type,\n\t\t\t\tlength: 1\n\... | [
"0.6952442",
"0.6671294",
"0.66692543",
"0.6297391",
"0.61888766",
"0.6077719",
"0.5836298",
"0.57634383",
"0.5405982",
"0.5395863",
"0.53598106",
"0.53297067",
"0.53109515",
"0.52966774",
"0.52951705",
"0.521546",
"0.5214466",
"0.5203534",
"0.51977473",
"0.5123735",
"0.51133... | 0.79905415 | 0 |
Scrolls the text of the case to approximately the beginning of a given page. page: number | scrollToPage(page) {
// TODO: ease animation, account for body offset.
const target = $(`.page_number_margin[data-page="${page}"]`)[0];
// Default to 0 for pages that aren't found (like 0 and 1).
const scrollTo = target ? target.offsetTop : 0;
$('.case-page-case').animate({
'scrollTop': scrol... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function scrollToPage() {\n pageJump = true;\n\n // Calculate how far to scroll\n var startLocation = viewStart;\n var endLocation = pageStart;\n var distance = endLocation - startLocation;\n\n var runAnimation;\n\n // Set the animation variables to 0/undefined.\n var timeLa... | [
"0.6097939",
"0.6055739",
"0.5968051",
"0.5959417",
"0.5942346",
"0.59374595",
"0.58582985",
"0.5857961",
"0.5785705",
"0.57835823",
"0.57581615",
"0.5717805",
"0.5716905",
"0.5708209",
"0.56413513",
"0.5630646",
"0.56170887",
"0.55962706",
"0.55647165",
"0.5549784",
"0.55447... | 0.6486861 | 0 |
set markers on restaurants' addresses | function setMarkers(map, location){
for (var i = 0; i < restaurants.length; i++){
var restaurant = restaurants[i];
var myLatLng = new google.maps.LatLng(restaurant[1], restaurant[2]);
var marker = new google.maps.Marker({
map: map,
animation: google.maps.Animation.DR... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function populateMap (restaurants) {\n\tvar bounds = new google.maps.LatLngBounds();\n\n\t// If the are any markers already, remove them from the map\n\tif (markers) { removeMarkers(); }\n\n\t// No markers are highlighted when they are created\n\tisHighlighted = false;\n\n\tfor (var i = 0; i < restaurants.length; ... | [
"0.7118606",
"0.6791532",
"0.66864085",
"0.66818964",
"0.66210854",
"0.65829027",
"0.6546454",
"0.6515726",
"0.65127176",
"0.650216",
"0.6498099",
"0.6492255",
"0.6470062",
"0.6460113",
"0.6457575",
"0.6442693",
"0.643693",
"0.64260286",
"0.64226735",
"0.642052",
"0.6419081",... | 0.68596554 | 1 |
Returns a promise resolving to whether the threadlistavatars feature is enabled. | isEnabled() {
return this.optionsWatcher.isEnabled('threadlistavatars');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"injectIfEnabled(node) {\n this.isEnabled().then(isEnabled => {\n if (isEnabled) {\n document.body.classList.add('TWPT-threadlistavatars-enabled');\n this.inject(node);\n } else {\n document.body.classList.remove('TWPT-threadlistavatars-enabled');\n }\n });\n }",
"async ... | [
"0.5894463",
"0.547416",
"0.5291901",
"0.5249238",
"0.5230155",
"0.51661086",
"0.51447874",
"0.51443684",
"0.51008564",
"0.5043832",
"0.5020914",
"0.4939241",
"0.49027106",
"0.4863684",
"0.48500502",
"0.4820971",
"0.48204404",
"0.47954866",
"0.47423846",
"0.4697639",
"0.46876... | 0.73402506 | 0 |
Gets a list of private forums. If it is already cached, the cached list is returned; otherwise it is also computed and cached. | getPrivateForums() {
return new Promise((resolve, reject) => {
if (this.isFilterSetUp) return resolve(this.privateForums);
if (!document.documentElement.hasAttribute('data-startup'))
return reject('[threadListAvatars] Couldn\'t get startup data.');
var startupData =
JSON.parse(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getForums() {\n return forumArray; // Returns a $firebaseArray collection of all forums\n }",
"function fetchForums() {\r\n \r\n var deferred = $q.defer();\r\n\r\n $http.get(BASE_URL + '/forum/list').then(\r\n function(response) {\r\n ... | [
"0.64726824",
"0.61951274",
"0.57016134",
"0.56743395",
"0.5509974",
"0.5467808",
"0.5415838",
"0.52546096",
"0.5248544",
"0.52217644",
"0.5175256",
"0.5107723",
"0.5087045",
"0.5077811",
"0.50143474",
"0.50135684",
"0.5009193",
"0.49948108",
"0.49675077",
"0.49260327",
"0.49... | 0.747836 | 0 |
Some threads belong to private forums, and this feature will not be able to get its avatars since it makes an anonymomus call to get the contents of the thread. This function returns whether the thread belongs to a known private forum. | isPrivateThread(thread) {
return this.getPrivateForums().then(privateForums => {
if (privateForums.includes(thread.forum)) return true;
return this.db.isForumUnauthorized(thread.forum);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isForum() {\n var url = window.location.pathname.split('/')\n\n return url[2] === \"forum\"\n}",
"function isDiscussionAuthor(author) {\n return divvy.currentUser == author;\n }",
"function isReadingBSCThread() {\r\n return !!document.location.href.match(/forum\\/10\\-programmering\... | [
"0.65050733",
"0.61112076",
"0.59030205",
"0.5696224",
"0.5659274",
"0.562972",
"0.55176175",
"0.543957",
"0.54388607",
"0.5327925",
"0.5327925",
"0.52904695",
"0.5251363",
"0.52071494",
"0.51544374",
"0.51520383",
"0.51407504",
"0.5138976",
"0.51381314",
"0.5110016",
"0.5100... | 0.78383726 | 0 |
Get an object with the author of the thread, an array of the first |num| replies from the thread |thread|, and additional information about the thread. It also returns |state| which can be 'ok', 'private' or 'notVisible'. If it is 'private' or 'notVisible', the previous properties will be missing. | getFirstMessages(thread, num = 15) {
return CCApi(
'ViewThread', {
1: thread.forum,
2: thread.thread,
// options
3: {
// pagination
1: {
2: num, // maxNum
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getThreadInfo(thread) {\n let info = [];\n let tooltips = [];\n\n const endPendingStateTimestampMicros = thread?.['2']?.['39'];\n const [pendingStateInfo, pendingTooltip] =\n this.getPendingStateInfo(endPendingStateTimestampMicros);\n if (pendingStateInfo) info.push(pendingStateInfo);\n if... | [
"0.6048588",
"0.583075",
"0.52826726",
"0.522652",
"0.49262798",
"0.48554486",
"0.48445424",
"0.48024005",
"0.473509",
"0.47314975",
"0.4726049",
"0.47134176",
"0.47133628",
"0.46878254",
"0.4655496",
"0.46520883",
"0.45701915",
"0.45642927",
"0.4550602",
"0.4531433",
"0.4527... | 0.6634621 | 0 |
Returns an object with a cache entry that matches the request if found (via the |entry| property). The property |found| indicates whether the cache entry was found. The |checkRecent| parameter is used to indicate whether lastUsedTimestamp must be within the last 30 seconds (which means that the thread has been checked ... | getVisibleAvatarsFromCache(thread, num, checkRecent) {
return this.db.getCacheEntry(thread.thread).then(entry => {
if (entry === undefined || entry.num < num)
return {
found: false,
};
if (checkRecent) {
var now = Math.floor(Date.now() / 1000);
var diff = now -... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getFromCache(request){\n if(cacheObj.hasOwnProperty([request])){\n cacheObj[request][1] = new Date(); //update date\n cacheObj[request][2] += 1; //update times used\n return cacheObj[request][0]; //obj result\n }else\n return null;\n}",
"function fromCache(request) {\n ... | [
"0.5626865",
"0.54136235",
"0.53470284",
"0.50707126",
"0.505326",
"0.4972762",
"0.4972121",
"0.4949968",
"0.49232498",
"0.48909503",
"0.4884528",
"0.48581624",
"0.48537013",
"0.4848211",
"0.48156717",
"0.47265843",
"0.4672707",
"0.46406913",
"0.46364167",
"0.46262842",
"0.46... | 0.6337861 | 0 |
Waits for the XHR interceptor to invalidate any outdated threads and returns what getVisibleAvatarsFromCache returns. If this times out, it returns the current cache entry anyways if it exists. | getVisibleAvatarsFromCacheAfterInvalidations(thread, num) {
return waitFor(
() => this.getVisibleAvatarsFromCache(
thread, num, /* checkRecent = */ true),
{
interval: 450,
timeout: 2 * 1000,
})
.catch(err => {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getVisibleAvatarsFromCache(thread, num, checkRecent) {\n return this.db.getCacheEntry(thread.thread).then(entry => {\n if (entry === undefined || entry.num < num)\n return {\n found: false,\n };\n\n if (checkRecent) {\n var now = Math.floor(Date.now() / 1000);\n va... | [
"0.6942816",
"0.6860482",
"0.58365554",
"0.5420764",
"0.53527766",
"0.5240667",
"0.5018569",
"0.5011483",
"0.5011156",
"0.49959013",
"0.49183428",
"0.49173394",
"0.491466",
"0.49029607",
"0.48933956",
"0.4883251",
"0.48788965",
"0.48768082",
"0.47927946",
"0.47897837",
"0.474... | 0.7547506 | 0 |
Get an object with the following data: |state|: 'ok' (the avatars list could be retrieved), 'private' (the thread is in a private forum, so the avatars list could not be retrieved), or 'notVisible' (the thread has the visible field set to false). |avatars|: list of at most |num| avatars for thread |thread| | getVisibleAvatars(thread, num = 3) {
return this.isPrivateThread(thread).then(isPrivate => {
if (isPrivate)
return {
state: 'private',
avatars: [],
};
return this.getVisibleAvatarsFromCacheAfterInvalidations(thread, num)
.then(res => {
if (!res.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getVisibleAvatarsFromServer(thread, num) {\n return this.getFirstMessages(thread).then(result => {\n if (result.state != 'ok')\n return {\n state: result.state,\n };\n\n var messages = result.messages;\n var author = result.author;\n var lastMessageId = result.lastMess... | [
"0.6752978",
"0.64361584",
"0.6256771",
"0.5558839",
"0.55181956",
"0.54460394",
"0.5408364",
"0.53061056",
"0.52989715",
"0.52454513",
"0.520444",
"0.51999503",
"0.51597184",
"0.5157147",
"0.5068729",
"0.50512713",
"0.5042836",
"0.503128",
"0.50055045",
"0.49852672",
"0.4980... | 0.7542643 | 0 |
Inject avatars for thread summary (thread item) |node| in a thread list. | inject(node) {
var header =
node.querySelector('ec-thread-summary .main-header .action .header');
var headerContent = header.querySelector(':scope > .header-content');
var expandBtn = header.querySelector(':scope > .expand-button');
if (headerContent === null) {
console.error(
'[... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getThreadInfo(thread) {\n let info = [];\n let tooltips = [];\n\n const endPendingStateTimestampMicros = thread?.['2']?.['39'];\n const [pendingStateInfo, pendingTooltip] =\n this.getPendingStateInfo(endPendingStateTimestampMicros);\n if (pendingStateInfo) info.push(pendingStateInfo);\n if... | [
"0.550419",
"0.54000396",
"0.53078747",
"0.5243807",
"0.5157855",
"0.51044875",
"0.5008006",
"0.49282914",
"0.4915336",
"0.49128494",
"0.49032664",
"0.47596487",
"0.4745371",
"0.47406098",
"0.4736814",
"0.4736814",
"0.4736814",
"0.46804753",
"0.4661352",
"0.46500903",
"0.4647... | 0.7589548 | 0 |
Inject avatars for thread summary (thread item) |node| in a thread list if the threadlistavatars option is enabled. | injectIfEnabled(node) {
this.isEnabled().then(isEnabled => {
if (isEnabled) {
document.body.classList.add('TWPT-threadlistavatars-enabled');
this.inject(node);
} else {
document.body.classList.remove('TWPT-threadlistavatars-enabled');
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"inject(node) {\n var header =\n node.querySelector('ec-thread-summary .main-header .action .header');\n var headerContent = header.querySelector(':scope > .header-content');\n var expandBtn = header.querySelector(':scope > .expand-button');\n if (headerContent === null) {\n console.error(\n... | [
"0.74295485",
"0.5244734",
"0.5164472",
"0.5137998",
"0.51368606",
"0.5130389",
"0.5087855",
"0.50647026",
"0.5047517",
"0.50118655",
"0.50118655",
"0.50118655",
"0.5001689",
"0.49319085",
"0.48863596",
"0.48709264",
"0.48584414",
"0.47907087",
"0.47164005",
"0.46779308",
"0.... | 0.5992742 | 1 |
Checks whether the given character code corresponds to an English character. | function isEnglishLetter(charCode) {
return (65 <= charCode && charCode <= 90) || (97 <= charCode && charCode <= 122);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isUnicodeLetter(code) {\n for (var _i = 0; _i < unicodeLetterTable.length;) {\n if (code < unicodeLetterTable[_i++]) {\n return false;\n }\n\n if (code <= unicodeLetterTable[_i++]) {\n return true;\n }\n }\n\n return false;\n ... | [
"0.7096411",
"0.6990412",
"0.6942223",
"0.6906265",
"0.6847743",
"0.6778198",
"0.66984123",
"0.6684958",
"0.6607809",
"0.66039413",
"0.66039413",
"0.65662867",
"0.6558849",
"0.65443546",
"0.6522749",
"0.6519013",
"0.6498895",
"0.64621973",
"0.64621973",
"0.64621973",
"0.64402... | 0.7671922 | 0 |
Retrieves an array of indices that are to be skipped given the number of characters to remove. | function getSkippedIndices(remove) {
var indices = [];
var count = 0;
for (var i = 0; i < english[idx].length; i++) {
if (isEnglishLetter(english[idx].charCodeAt(i))) {
count++;
}
}
var j = 0;
if (count <= remove) {
// will be removing all the English characters
for (i = 0; i < english[idx].length... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function uniqueSkipHelper(index, length) {\n return Math.floor(index / length) + 1;\n }",
"function removeNElements(startIndex, numRemove) {\n let newArr = [];\n let removedElements = [];\n if (startIndex < 0 || startIndex >= arr.length || numRemove < 1) {\n return []; // return empty array becau... | [
"0.5927823",
"0.57845426",
"0.5752481",
"0.575023",
"0.57306165",
"0.5659792",
"0.54985344",
"0.54938847",
"0.5482821",
"0.535282",
"0.5325498",
"0.5285541",
"0.5254065",
"0.5225961",
"0.51865864",
"0.51390487",
"0.5131692",
"0.51207143",
"0.5096487",
"0.50944036",
"0.5079974... | 0.70886993 | 0 |
Displays a text to the user indicating that there is a mistake in the answer. | function showError() {
document.getElementById("mistake").innerHTML = "<font color=\"red\">間違った!</font>";
playErrorAudio();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getBadAnswer(fact) { return \"I'm sorry. \" + fact + \" is not something I know very much about in this skill. \" + HELP_MESSAGE; }",
"function error() {\n self.addThreepio(\"I think we've broken \" + friend.name + \" with your question.\");\n setTimeout(function () {\n ... | [
"0.70692956",
"0.6817927",
"0.6796055",
"0.67265457",
"0.6705149",
"0.6692128",
"0.6657426",
"0.6621748",
"0.66185075",
"0.6608423",
"0.65388435",
"0.645503",
"0.6444389",
"0.6443351",
"0.6416173",
"0.64141434",
"0.6384495",
"0.6365231",
"0.6352343",
"0.6346311",
"0.63329375"... | 0.6876584 | 1 |
Returns true and moves on to the next flashcard if the given answer is correct. | function next(answer) {
// check if the answer matches, or if we're just doing a read through
if (check(answer)) {
remaining--;
if (type !== TYPE_READING) {
// no point in playing the sound if we're just reading the cards
playBeepAudio();
}
english[idx] = english[remaining];
japanese[idx] = japanes... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkAnswer(answer){\n if( answer == questions[runningQuestion].correct){\n isCorrect();\n nextQuestion();\n } else {\n isWrong();\n nextQuestion();\n }\n}",
"function nextCard()\r\n\t\t{\r\n\t\t\tvar length = questions.length;\r\n\r\n\t\t\tif(questionNumber<length-1... | [
"0.6976351",
"0.6810705",
"0.6718929",
"0.6625162",
"0.66142607",
"0.6600597",
"0.65568596",
"0.6545579",
"0.6538944",
"0.6524686",
"0.6514498",
"0.6509023",
"0.6492504",
"0.6471522",
"0.64632183",
"0.64484847",
"0.64288515",
"0.64263916",
"0.63921297",
"0.6343751",
"0.633501... | 0.7655113 | 0 |
using regex to retreive email | function extractEmails ( text ){
var myRegexp = /([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi;
email = text.match(myRegexp);
if(email!==null){
for (var i = 0; i < email.length; i++) {
var newString = email[i].replace('@','');
if(i==0){
emailtransform = '"'+newString+... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function extractEmails(text) {\n return text.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.[a-zA-Z0-9._-]+)/gi);\n}",
"function getNameinEmail(email)\n{\n var t = email.split('@');\n return t[0]; \n}",
"function getNameinEmail(email)\n{\n var t = email.split('@');\n return t[0]; \n}",
"function getEmail(url) {\... | [
"0.7227344",
"0.7026387",
"0.7026387",
"0.6810925",
"0.66881484",
"0.66833925",
"0.66709775",
"0.66641045",
"0.66177356",
"0.6577458",
"0.6564039",
"0.6498352",
"0.64860654",
"0.6479263",
"0.64749736",
"0.64484334",
"0.64473987",
"0.64295876",
"0.64074135",
"0.6406653",
"0.64... | 0.70330125 | 1 |
input: 2 words (a block) and a list of round keys | _encrypt(words, rKeys) {
// console.log('input words to encrypt', words);
let [x, y] = words;
for (let i=0; i<this.numRounds; i++) {
[x, y] = this._round(x, y, rKeys[i]);
}
return [x, y];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"splitArmoredBlocks(keyBlockStr) {\n let myRe = /-----BEGIN PGP (PUBLIC|PRIVATE) KEY BLOCK-----/g;\n let myArray;\n let retArr = [];\n let startIndex = -1;\n while ((myArray = myRe.exec(keyBlockStr)) !== null) {\n if (startIndex >= 0) {\n let s = keyBlockStr.substring(startIndex, myArray.... | [
"0.5606505",
"0.55874854",
"0.5557053",
"0.5557053",
"0.5557053",
"0.5557053",
"0.5557053",
"0.55567044",
"0.55567044",
"0.5487556",
"0.5264916",
"0.52305806",
"0.50878817",
"0.5001825",
"0.4921866",
"0.49124974",
"0.49049732",
"0.49022365",
"0.489838",
"0.48867303",
"0.48811... | 0.6030858 | 0 |
Base class for all compilers. Must have the following methods: | function Compiler() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Compiler(){\n this.reset = function() { this.descriptorsByFile = {}; }.bind(this);\n\n this.reset();\n}",
"function VersionCompiler() {\n}",
"function Compiler () {\n this.importPath = []\n this.entryFile = null\n this.typeSystem = new TypeSystem()\n this.parser = new Parser()\n // Setup t... | [
"0.6531334",
"0.64351225",
"0.6430731",
"0.6311742",
"0.6141508",
"0.6111245",
"0.60561115",
"0.6024434",
"0.6024434",
"0.6024434",
"0.6024434",
"0.5961015",
"0.5958785",
"0.5956697",
"0.5956697",
"0.58894366",
"0.5847001",
"0.57777464",
"0.5759759",
"0.57173544",
"0.56875336... | 0.699269 | 0 |
Language: Represents a programming language in the IdeOne Service. | function Language(key, value) {
this.langKey = key;
this.langName = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GenLanguageDef(){}",
"get language() {\n\t\treturn this.__language;\n\t}",
"get language() {\n\t\treturn this.__language;\n\t}",
"get language () {\n\t\treturn this._language;\n\t}",
"get language() {\n\t\t\treturn this._language;\n\t\t}",
"function getLanguage() {\n return 'en-us';\n}",
"g... | [
"0.7127126",
"0.70477575",
"0.70477575",
"0.70197546",
"0.68624425",
"0.67887175",
"0.6775219",
"0.67647064",
"0.6735242",
"0.6734221",
"0.67217314",
"0.6678531",
"0.66547966",
"0.6622223",
"0.66040367",
"0.659851",
"0.6529703",
"0.6523267",
"0.6486965",
"0.64428604",
"0.6424... | 0.737881 | 0 |
POST Insert a new Film in the DB | async addFilm(film){
return movie.create(film)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async addFilm(film){\n return Movie.create(film)\n }",
"function addFilm() {\n\tvar resultRegion = \"add-film-result\";\n\tvar info = $(\"#add-film-form\").serialize();\n\n\t$.ajax({\n\t\turl : \"./AddServlet\",\n\t\tdata : \"format=text&\" + info,\n\t\tdatatype : \"text\",\n\t\tsuccess : function(rawDa... | [
"0.76630217",
"0.6868192",
"0.6826678",
"0.6645429",
"0.6641726",
"0.6604079",
"0.62497735",
"0.61846244",
"0.61596334",
"0.6103377",
"0.6087688",
"0.6085607",
"0.6051839",
"0.6048074",
"0.60274893",
"0.602058",
"0.5995309",
"0.5976092",
"0.59389395",
"0.59348494",
"0.5923875... | 0.76891345 | 0 |
PUT Update a Film already exists | async updateFilm(id, title){
const idFound = movie.findOne({id: id})
return idFound.update(title)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async updateFilm(id,film){\n return Movie.findByIdAndUpdate(id,film,{new: true})\n }",
"async addFilm(film){\n return movie.create(film)\n }",
"async addFilm(film){\n return Movie.create(film)\n }",
"function updOrCreateMovie(movie, method, id, resolveMovie, rejectMovie) {\n let ... | [
"0.74097896",
"0.6338595",
"0.6230785",
"0.61223847",
"0.60621125",
"0.60142744",
"0.5841392",
"0.57972276",
"0.5660601",
"0.56275207",
"0.559201",
"0.55909",
"0.55553275",
"0.55384064",
"0.5475815",
"0.5455105",
"0.54332054",
"0.5421988",
"0.5412019",
"0.5390555",
"0.5329633... | 0.70101446 | 1 |
DELETE Delete a Film with specified ID | async deleteFilm({id: id}) {
const idFound = movie.findOne({id: id})
return idFound.remove()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async deleteFilm({ id: id }) {\n const idFound = Film.findOneAndDelete({ id: id })\n return idFound.remove()\n }",
"async deleteFilm(id) {\n return Movie.findByIdAndRemove(id)\n }",
"function deleteMovie(id) {\n AJAXRequest(`${serverURL}/${id}`, 'DELETE').then(getAllMovies)\n ... | [
"0.8875443",
"0.8616646",
"0.7883259",
"0.7510037",
"0.7475211",
"0.74216986",
"0.70074",
"0.69351393",
"0.69038457",
"0.686154",
"0.68299943",
"0.66651577",
"0.66584355",
"0.66208404",
"0.6579743",
"0.6572056",
"0.6557874",
"0.6535412",
"0.65155625",
"0.64928424",
"0.6447820... | 0.8680085 | 1 |
Load state from the browser's plugin storage with a fallback to localStorage for any plugins in a transitional state. Returns a promise. | function loadState() {
return loadStateFromExtensionStorage()
.then(value => {
return value || loadStateFromLocalStorage()
})
.catch(error => {
console.error("Could not load state", error)
return undefined
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadState () {\n var state = localStorage.getItem(STORAGE_KEY);\n if (!state) {\n state = DEFAULT_STATE;\n saveState(state);\n } else {\n state = JSON.parse(state);\n }\n return state;\n}",
"function loadFromLocalStorage() {\n try {\n const serializedState = localStorage.getItem(\"sta... | [
"0.66746134",
"0.6609265",
"0.6607661",
"0.65006703",
"0.6498264",
"0.6354551",
"0.6255632",
"0.62126005",
"0.6106042",
"0.59708834",
"0.5939046",
"0.59126794",
"0.5888131",
"0.58661544",
"0.5853899",
"0.5847778",
"0.5830834",
"0.57994175",
"0.57590586",
"0.57283664",
"0.5717... | 0.7181339 | 0 |
Get the value of the field. This will remove a currency symbol and round to two decimal places. | getValue() {
let value = super.getValue()
if (value) {
value = parseFloat(value)
value = value.toFixed(2)
}
return parseFloat(value)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moneyValue(moneyField) {\n var functionName = \"moneyValue\";\n var money = null;\n try {\n if (isValid(moneyField) && isValid(moneyField.Value)) {\n //money = kendo.format(\"{0:c2}\", parseFloat(moneyField.Value));\n money = moneyField.Value;\n } else {\n ... | [
"0.6878111",
"0.64799345",
"0.63372946",
"0.6218426",
"0.6179058",
"0.61602163",
"0.6109555",
"0.60943186",
"0.60714513",
"0.6057053",
"0.60485876",
"0.6045143",
"0.60382813",
"0.6027541",
"0.5971266",
"0.59642893",
"0.595181",
"0.5947855",
"0.591803",
"0.59030634",
"0.586973... | 0.7549308 | 0 |
convert stored time to object | function intTimeToObject(time) {
time = {
time: time,
hour24: Math.floor(time / 100)
};
time.hour = (time.hour24 > 12) ? (time.hour24 - 12) : time.hour24;
time.minute = time.time - (time.hour24 * 100);
time.ampm = (time.hour24 < 12) ? 'am' : 'pm';
time.formatted = time.hour + ':' + pad(time.minute)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"toModel(time) {\n return (time && isInteger(time.hour) && isInteger(time.minute)) ?\n { hour: time.hour, minute: time.minute, second: isInteger(time.second) ? time.second : null } :\n null;\n }",
"fromModel(time) {\n return (time && isInteger(time.hour) && isInteger(time.mi... | [
"0.73337716",
"0.7241695",
"0.70274466",
"0.7012749",
"0.6922464",
"0.6918595",
"0.68392533",
"0.65137863",
"0.64632016",
"0.6429135",
"0.63664466",
"0.6340821",
"0.63159156",
"0.6300532",
"0.6269707",
"0.62567025",
"0.6241993",
"0.61782354",
"0.6147184",
"0.61305285",
"0.613... | 0.7484352 | 0 |
logs the user in stores token in local storage,token holds user data, will need to be decoded with jwt_decode. sets axios authtoken | handleLogin(data) {
axios
.post("/api/users/login", data)
.then(function (res) {
const { token } = res.data;
localStorage.setItem("jwtToken", token);
setAuthToken(token);
})
.catch(function (err) {
console.log(err);
});
//set the loggin status.
i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static authenticateUser(token) {\n localStorage.setItem('token', token);\n }",
"static authenticateUser(token) {\n localStorage.setItem('token', token);\n }",
"setAuth(state, data) {\n window.localStorage.setItem('jwt_token', data.access_token)\n if (data.user) window.localStorage.setItem... | [
"0.75482345",
"0.75482345",
"0.74991137",
"0.7483249",
"0.7442531",
"0.7345232",
"0.7306605",
"0.7305938",
"0.72777504",
"0.7249501",
"0.7197558",
"0.70290035",
"0.7025552",
"0.69681275",
"0.6944996",
"0.69264567",
"0.69225305",
"0.690165",
"0.6882486",
"0.68519443",
"0.68449... | 0.75872713 | 0 |
called on window resize. handles rotation and sprite quality change | function handleWindowSize() {
if ( window.innerWidth > window.innerHeight ) {
app.stage.pivot.set(app.stage.width / 2, app.stage.height / 2);
app.stage.x = app.stage.width / 2;
app.stage.y = app.stage.height / 2;
app.stage.rotation = 0;
app.stage.width = 900;
app.stage.height = 600;
}
else... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resizeF()\n\t\t{\n\t\tvar scaleX = window.innerWidth / 782;\n\t\tvar scaleY = window.innerHeight / 440;\n\t\tvar scale = Math.min(scaleX, scaleY);\n\t\tgame.scale.scaleMode = Phaser.ScaleManager.USER_SCALE;\n\t\tgame.scale.setUserScale(scale, scale);\n\t\tgame.scale.pageAlignHorizontally = true;\n\t\tgame... | [
"0.7038061",
"0.68741727",
"0.68351674",
"0.6756036",
"0.6747454",
"0.67245257",
"0.67227864",
"0.6696208",
"0.6653635",
"0.6645475",
"0.66346496",
"0.66326994",
"0.6617218",
"0.65928185",
"0.6581088",
"0.6564739",
"0.6550948",
"0.65483415",
"0.6544212",
"0.65383226",
"0.6529... | 0.7012301 | 1 |
updates juice in the dom | function UpdateJuice() {
document.getElementById("juice-display").innerHTML = juice;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function writeJuicehouseToDom() {\r\n refreshValues();\r\n document.getElementById(\"juicehouse-owned\").innerHTML = juicehouseOwned + \" clicker upgrades owned\";\r\n document.getElementById(\"juicehouse-upgrades-owned\").innerHTML = juicehouseUpgradeOwnded + \" upgrades owned\";\r\n}",
"function write... | [
"0.69606906",
"0.68967634",
"0.68219465",
"0.67426044",
"0.6549908",
"0.6389923",
"0.6389923",
"0.63731265",
"0.6275684",
"0.62634444",
"0.62465215",
"0.6239019",
"0.6178901",
"0.6172361",
"0.6125782",
"0.6019185",
"0.58956003",
"0.5893807",
"0.5883933",
"0.58541876",
"0.5844... | 0.71833336 | 0 |
updates juice, totalRate juicerOwned and juicerUpgradeOwned to the dom | function writeJuicerToDom() {
refreshValues();
document.getElementById("juicer-owned").innerHTML = juicerOwned + " clicker upgrades owned";
document.getElementById("juicer-upgrades-owned").innerHTML = juicerUpgradeOwnded + " upgrades owned";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function writeJuicehouseToDom() {\r\n refreshValues();\r\n document.getElementById(\"juicehouse-owned\").innerHTML = juicehouseOwned + \" clicker upgrades owned\";\r\n document.getElementById(\"juicehouse-upgrades-owned\").innerHTML = juicehouseUpgradeOwnded + \" upgrades owned\";\r\n}",
"function updat... | [
"0.6100014",
"0.6099697",
"0.5845141",
"0.5830336",
"0.57176673",
"0.57084614",
"0.56934863",
"0.5642204",
"0.5590777",
"0.55851704",
"0.55824786",
"0.55799747",
"0.5579559",
"0.5560727",
"0.55562866",
"0.5522091",
"0.5513274",
"0.54619294",
"0.54446656",
"0.53517634",
"0.534... | 0.67997926 | 0 |
updates juice, totalRate mumOwned and mumUpgradeOwned to the dom | function writeMumToDom() {
refreshValues();
document.getElementById("mum-owned").innerHTML = mumOwnded + " clicker upgrades owned";
document.getElementById("mum-upgrades-owned").innerHTML = mumUpgradeOwnded + " upgrades owned";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function writeJuicerToDom() {\r\n refreshValues();\r\n document.getElementById(\"juicer-owned\").innerHTML = juicerOwned + \" clicker upgrades owned\";\r\n document.getElementById(\"juicer-upgrades-owned\").innerHTML = juicerUpgradeOwnded + \" upgrades owned\";\r\n}",
"function updateCalories(){\n ... | [
"0.6387025",
"0.6350139",
"0.6204204",
"0.5978225",
"0.5964688",
"0.5950496",
"0.59131384",
"0.5911876",
"0.59110135",
"0.5896332",
"0.58910775",
"0.58504575",
"0.58275884",
"0.57583797",
"0.56944597",
"0.569309",
"0.56326485",
"0.56029475",
"0.5583685",
"0.556424",
"0.555811... | 0.648811 | 0 |
updates juice, totalRate juicefarmOwned and juicefarmUpgradeOwned to the dom | function writeJuicefarmToDom() {
refreshValues();
document.getElementById("juicefarm-owned").innerHTML = juicefarmOwned + " clicker upgrades owned";
document.getElementById("juicefarm-upgrades-owned").innerHTML = juicefarmUpgradeOwnded + " upgrades owned";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function writeJuicerToDom() {\r\n refreshValues();\r\n document.getElementById(\"juicer-owned\").innerHTML = juicerOwned + \" clicker upgrades owned\";\r\n document.getElementById(\"juicer-upgrades-owned\").innerHTML = juicerUpgradeOwnded + \" upgrades owned\";\r\n}",
"function writeJuicehouseToDom() {\... | [
"0.6518769",
"0.6298946",
"0.6049265",
"0.59571874",
"0.595365",
"0.5886308",
"0.5853681",
"0.5817412",
"0.57743365",
"0.5758998",
"0.5740473",
"0.5718664",
"0.571828",
"0.5715567",
"0.5682075",
"0.56673265",
"0.5647352",
"0.56399035",
"0.5639773",
"0.56239396",
"0.5616007",
... | 0.6405577 | 1 |
updates juice, totalRate juicehouseOwned and juicehouseUpgradeOwned to the dom | function writeJuicehouseToDom() {
refreshValues();
document.getElementById("juicehouse-owned").innerHTML = juicehouseOwned + " clicker upgrades owned";
document.getElementById("juicehouse-upgrades-owned").innerHTML = juicehouseUpgradeOwnded + " upgrades owned";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function writeJuicerToDom() {\r\n refreshValues();\r\n document.getElementById(\"juicer-owned\").innerHTML = juicerOwned + \" clicker upgrades owned\";\r\n document.getElementById(\"juicer-upgrades-owned\").innerHTML = juicerUpgradeOwnded + \" upgrades owned\";\r\n}",
"function updateCalories(){\n ... | [
"0.65039736",
"0.6272542",
"0.6060606",
"0.5991361",
"0.5986387",
"0.59509325",
"0.5909807",
"0.58824503",
"0.58765787",
"0.581584",
"0.58105344",
"0.5766848",
"0.5747693",
"0.57419187",
"0.571881",
"0.5677255",
"0.5671374",
"0.5643629",
"0.5635113",
"0.55981976",
"0.5597683"... | 0.682794 | 0 |
updates juice, totalRate juicemachineOwned and juicemachineUpgradeOwned to the dom | function writeJuicemachineToDom() {
refreshValues();
document.getElementById("juicemachine-owned").innerHTML = juicemachineOwned + " clicker upgrades owned";
document.getElementById("juicemachine-upgrades-owned").innerHTML = juicemachineUpgradeOwnded + " upgrades owned";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function writeJuicerToDom() {\r\n refreshValues();\r\n document.getElementById(\"juicer-owned\").innerHTML = juicerOwned + \" clicker upgrades owned\";\r\n document.getElementById(\"juicer-upgrades-owned\").innerHTML = juicerUpgradeOwnded + \" upgrades owned\";\r\n}",
"function writeJuicehouseToDom() {\... | [
"0.6431608",
"0.6265942",
"0.6091742",
"0.6028369",
"0.6022565",
"0.5966968",
"0.58271444",
"0.5787777",
"0.578598",
"0.5747009",
"0.56636035",
"0.5655738",
"0.5620404",
"0.5553701",
"0.5533355",
"0.5507172",
"0.54528254",
"0.54494596",
"0.5446338",
"0.5441633",
"0.54162496",... | 0.6720127 | 0 |
Unbind a range of shortcuts | function unbind(key, scope, data) {
var multipleKeys = getKeys(key);
var keys = void 0;
var mods = [];
var obj = void 0;
console.log('unbind', key, JSON.stringify(getKeys(key)), data.key);
for (var i = 0; i < multipleKeys.length; i++) {
// Split the combined... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"unregisterShortcuts() {\n const shortcutManager = this.hot.getShortcutManager();\n const editorContext = shortcutManager.getContext('editor');\n\n editorContext.removeShortcutsByGroup(SHORTCUTS_GROUP);\n }",
"function unsetHotKeys() {\n hotkeys.del('esc');\n hotkeys.del('right');\n ... | [
"0.7107225",
"0.6406714",
"0.62891096",
"0.6123453",
"0.6118823",
"0.61037403",
"0.60812044",
"0.60700554",
"0.60700554",
"0.60700554",
"0.6048641",
"0.60004526",
"0.60004526",
"0.5984175",
"0.59818923",
"0.5971934",
"0.5939458",
"0.59232473",
"0.59232473",
"0.59232473",
"0.5... | 0.67939985 | 1 |
check if all input tage name is select and error id attribut is 'DOB' | function CheckIfInputSelectandErrorIdDOB(ctrlObj) {
var allSelectandErrorIdDOB = true;
for (var i = 0; i < ctrlObj.length; i++) {
//check if tag name is Select
if (ctrlObj[i].tagName == "SELECT") {
if (!(ctrlObj[i].attributes["errorid"] != undefined && ctrlObj[i].attributes["errorid"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validarSelect(input){\n\tvar bool=true;\n\tif($(\"select\").val()== 0){\n\t\t var span_nombre = $(\"<span class='error2'>\" + \"Selecciona un tipo de Bici\" + \"</span>\");\n\t\t$('select').parent().append(span_nombre);\n\t\tbool = false\n\t}\n\treturn bool\n}",
"function required(object){/*///El valor ... | [
"0.65697455",
"0.6464944",
"0.6449472",
"0.6358973",
"0.6323875",
"0.6245079",
"0.62304604",
"0.6226248",
"0.6216377",
"0.62114406",
"0.6179489",
"0.6132382",
"0.6100425",
"0.6094597",
"0.60400975",
"0.59858084",
"0.598493",
"0.5976816",
"0.5968133",
"0.5961031",
"0.5954075",... | 0.80557275 | 0 |
rotate bridge until the bridge meets another Rotation Node | function rotateBridge() {
if(inMotion === true) {
activeNode.rotation.y += rotationInc;
rotationCount += rotationInc;
if(rotationCount >= (Math.PI / 2)) {
activeNode.rotation.y = originalRotY + (Math.PI / 2);
originalRotY = activeNode.rotation.y;
rotation... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"rebalance () {\n var leftNode = this.left;\n var rightNode = this.right;\n\n if((this.numLeftChildren > 1 && this.numRightChildren == 0) ||\n (this.numLeftChildren > 0 && this.numRightChildren > 0 && leftNode.height > rightNode.height + 1)\n ) {\n if((leftNode.numLeftChildren > 0 && leftNode.... | [
"0.67636734",
"0.6495148",
"0.6366708",
"0.63141507",
"0.6290079",
"0.6263088",
"0.62509066",
"0.620034",
"0.620034",
"0.6160663",
"0.61532897",
"0.6105546",
"0.60786295",
"0.6051025",
"0.60075384",
"0.596968",
"0.591813",
"0.5900881",
"0.58888876",
"0.58746105",
"0.58739704"... | 0.7701429 | 0 |
Basic class(interface) for platform independent shader program. | function ShaderProgram() {
A_CLASS;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Shader()\n {\n var program_;\n var uniforms_;\n var attributes_;\n var samplerSlots_;\n }",
"function initShaders() { \n \n Shader = (function() {\n \n var UNIFORM_SETTER = {};\n\n // Return the number of elements fo... | [
"0.73994064",
"0.7041516",
"0.7012745",
"0.69648093",
"0.6802775",
"0.67709816",
"0.6768034",
"0.6699467",
"0.6637071",
"0.658792",
"0.6568932",
"0.65258557",
"0.6522043",
"0.651292",
"0.65122813",
"0.649513",
"0.64884675",
"0.6485439",
"0.64681464",
"0.64584494",
"0.6427644"... | 0.7143213 | 1 |
Models Movie model that stores movie details and the locations id list. | function Movie(data) {
'use strict';
var self = this;
self.title = data.title;
self.locations = data.locations;
self.director = data.director;
self.release_year = data.release_year;
self.posterUrl = data.posterUrl;
self.backDropUrl = data.backDropUrl;
self.overview = data.overview;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function MovieDetail(movie, $vivContext) {\n // Get Featured People.\n var api = new _api.API();\n var featuredPeople = api.getCredits(movie['id']);\n for (var i=0; i < featuredPeople['crew'].length; i++) {\n if (featuredPeople['crew'][i]['job'] == 'Director') {\n this.director = featuredPeople['crew']... | [
"0.60353094",
"0.5883079",
"0.575517",
"0.57538",
"0.5691137",
"0.56879836",
"0.5687661",
"0.56760347",
"0.56649214",
"0.55688643",
"0.5552506",
"0.5552214",
"0.5545701",
"0.5545701",
"0.54918873",
"0.5476081",
"0.54628295",
"0.5441176",
"0.5403733",
"0.5403093",
"0.53602195"... | 0.63191557 | 0 |
Add movie to viewModel. | function addMovie(data) {
var val = data.val();
viewModel.movies.push(new Movie(val));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"add(movie) {\n\t\tthis.push(movie);\n\t}",
"async addFilm(newMovie) {\n return Film.create(newMovie);\n }",
"function addMovie(addedMovie) {\n AJAXRequest(serverURL, 'POST', addedMovie).then(getAllMovies)\n }",
"function MovieController() {\n let vm = this;\n vm.newMovie = {}\n... | [
"0.74675167",
"0.6490439",
"0.62742937",
"0.62027216",
"0.61458296",
"0.6139824",
"0.6069419",
"0.60636055",
"0.6034133",
"0.6034075",
"0.59819317",
"0.597214",
"0.59689987",
"0.588547",
"0.5750586",
"0.5723408",
"0.57233167",
"0.5708966",
"0.56414235",
"0.5618107",
"0.560380... | 0.786693 | 0 |
function to start and stop the map animation | function playStopAnimationMap(state) {
// set up initial min and max years and ensure they are integers
var minYear = parseInt(d3.min(dataset, function(d) { return d.year; }));
var maxYear = parseInt(d3.max(dataset, function(d) { return d.year; }));
var yearCount = minYear;
playMap(yearCount, maxYear, state);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"stop(){this.__stopped=!1;this.toggleAnimation()}",
"function hideMap(){\n\n $('#map').css('display','none');\n clearInterval(window.timer);\n\n }",
"function stopAnimation() {\n for (var i = 0; i < self.markerArray().length; i++) {\n self.markerArray()[i][1].setAnimation(null);\n ... | [
"0.67649233",
"0.66637886",
"0.6505442",
"0.64980376",
"0.6456097",
"0.64446324",
"0.6428505",
"0.64138126",
"0.63626075",
"0.63365614",
"0.63292164",
"0.6285621",
"0.62375885",
"0.6222715",
"0.619967",
"0.61987007",
"0.619439",
"0.6183309",
"0.6178961",
"0.6170277",
"0.61637... | 0.7349542 | 0 |
Load the authentication service, which sends an asynch request to determine whether the user is currently connected or not. | load_() {
const url = `${this.baseUrl_}/${RouteSuffix.IS_LOGGED_IN}`;
this.$http_.get(url, {withCredentials: true}).then(
this.handleLogin_.bind(this, true)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function requireAuth() {\n\t\t\tlet result = $q.defer();\n\t\t\tlet promise = result.promise;\n\t\t\trequireOnline()\n\t\t\t\t.then(function () {\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\turl: \"/api/authenticated\",\n\t\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t\tcache: false,\n\t\t\t\t\t\tsuccess: function (data) {\n\t\t\t... | [
"0.64865816",
"0.62821406",
"0.61331964",
"0.6058259",
"0.60420597",
"0.60222787",
"0.5998661",
"0.5995173",
"0.59932655",
"0.5982496",
"0.59776264",
"0.5974235",
"0.5924758",
"0.59160036",
"0.5888624",
"0.5875237",
"0.58535427",
"0.5833759",
"0.58222586",
"0.5819952",
"0.579... | 0.6685976 | 0 |
evaluates ast to take action | function evaluate(ast, environment){
return ast;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function walk_tree(ast) {\n var walker = {\n \"assign\" : function() {\n var assign_expr = new assign_expression();\n assign_expr.type = \"assign_expr\";\n assign_expr.left_expr = walk_tree(ast[2]);\n assign_expr.right_expr = walk_tree(ast[3]);\n ass... | [
"0.6654414",
"0.6637091",
"0.66108745",
"0.6430436",
"0.6292748",
"0.6292748",
"0.6086919",
"0.60828686",
"0.60630155",
"0.59995687",
"0.5955674",
"0.5938249",
"0.5900546",
"0.5878684",
"0.5876196",
"0.5857872",
"0.57926553",
"0.5779459",
"0.5779459",
"0.5778918",
"0.5751714"... | 0.721167 | 1 |
Remember to relax :) ======================================================================= / Q1 ======================================================================= / Depending on data modeling concept that you have learned: Create a factory function called makeComputer that represents computers, What different at... | function makeComputer(type, color, weight, RAM , Storage) {
// TODO: Your code here
return{
type: type,
color: color,
weight: weight,
RAM: RAM,
Storage: Storage
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeComputer(maker, Processor, Ram, HardDisc) {\n return {\n\t\tmaker : maker,\n\t\tProcessor : Processor,\n\t\tRam : Ram,\n\t\tHardDisc : HardDisc\n\t};\n}",
"function makeComputer(computers) {\r return {\r \tcpu: '64mb',\r \tscreenSize:'17 inch'\r }\r}",
"function setupComputer() {\n ... | [
"0.73930943",
"0.7153178",
"0.56735575",
"0.56082153",
"0.5605395",
"0.5600019",
"0.5578039",
"0.5567047",
"0.5522086",
"0.5498507",
"0.5465755",
"0.542515",
"0.54130304",
"0.5405668",
"0.5401749",
"0.53715026",
"0.5344362",
"0.53323054",
"0.5318528",
"0.53077894",
"0.5302486... | 0.7454966 | 0 |
Write a function displayComputer that can be used to display one computer. | function displayComputer(computer) {
// TODO: Your code here
return computer;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayComputer(computer) {\r return computer.cpu+ \" \" + computer.screenSize;\r}",
"function displayComputer(computer) {\n console.log(computer);\n}",
"function displayComputerChoice() {\n computerChoice.textContent = computerPlay();\n}",
"showComputerHand(computer) {\n\t\t// Blank Card I... | [
"0.7683783",
"0.75507444",
"0.63415617",
"0.6339444",
"0.59773755",
"0.5924605",
"0.58454484",
"0.5822862",
"0.574316",
"0.56678927",
"0.5647971",
"0.5635512",
"0.56038463",
"0.5602703",
"0.5573959",
"0.5560354",
"0.5522706",
"0.55118215",
"0.5478206",
"0.54729503",
"0.546880... | 0.7802504 | 0 |
ms to delay the call to setActiveTraceLabel() Cancel the call to update the active label from the debouncedmouseleave function and call the debouncedmouseenter function | function handleOnMouseEnter() {
debouncedHandleMouseLeave.cancel()
debouncedHandleMouseEnter()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_handleMouseOut() {\n\t\tthis._resumeTimeout();\n\t}",
"if (this.onMouseLeaveTimer) {\n clearTimeout(this.onMouseLeaveTimer);\n }",
"function onMouseoverHdlr() {\t// on 'mouseover' handler\n\tsetTimeout(function(){ $(document).tooltip('disable');}, 10000);\n}",
"_handleMouseOver() {\n\t\tthis._pauseT... | [
"0.62585294",
"0.6088032",
"0.6065089",
"0.60576934",
"0.60519105",
"0.604563",
"0.60364556",
"0.6026362",
"0.5955837",
"0.5867046",
"0.5832961",
"0.57408035",
"0.5723891",
"0.5702447",
"0.5669453",
"0.56589144",
"0.56188995",
"0.56171215",
"0.55765176",
"0.5573843",
"0.55701... | 0.6293188 | 0 |
Cancel the call to update the active label from the debouncedmouseenter function and call the debouncedmouseleave function | function handleOnMouseLeave() {
debouncedHandleMouseEnter.cancel()
debouncedHandleMouseLeave()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleOnMouseEnter() {\n debouncedHandleMouseLeave.cancel()\n debouncedHandleMouseEnter()\n }",
"_onMouseMove()\n {\n this.deactivate();\n }",
"mouseleave() {\n this.hoverActive = false;\n }",
"handleMouseOut() {\n this.IsHover = false;\n }",
"onMouseOut_() {\n t... | [
"0.7435862",
"0.6628296",
"0.65131795",
"0.6435806",
"0.62841964",
"0.6257935",
"0.62335265",
"0.6230214",
"0.6211506",
"0.6134744",
"0.61236423",
"0.61073977",
"0.61042655",
"0.6086759",
"0.60699296",
"0.6025102",
"0.60043526",
"0.5985127",
"0.59744155",
"0.59267104",
"0.587... | 0.72866833 | 1 |
updates the user picked color for the given label. does not save change to the server | function updateEditedCustomColors(label, color) {
editedCustomColors[label] = color
setEditedCustomColors({ ...editedCustomColors })
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleColorPicked() {\n updateEditedCustomColors(label, pickedColor)\n setShowColorPicker(false)\n }",
"function updateColor(){\r\n color = colorSelector.value;\r\n}",
"function annotationStyle(label) {\n if( debug ) console.log(\"> changing annotation style\");\n\n annotationColorLabe... | [
"0.7116419",
"0.68518627",
"0.63155204",
"0.6219855",
"0.614704",
"0.6143011",
"0.61317396",
"0.6129712",
"0.6118241",
"0.6080992",
"0.60761386",
"0.60516554",
"0.60102254",
"0.6005482",
"0.5999155",
"0.5996635",
"0.59309375",
"0.5928177",
"0.592775",
"0.5925613",
"0.5909501"... | 0.77052504 | 0 |
resets any unsaved changes to user colors and clears custom colors | async function resetColors() {
setEditedCustomColors({})
await saveCustomColors({})
setShowColorControls(false)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cancelColors() {\n setEditedCustomColors({})\n setShowColorControls(false)\n }",
"function resetColors(){\r\n\t\r\n\tcolors = createSquares(mode);\r\n\r\n\t\r\n\tassignColors();\r\n\r\n\t// update message\r\n\tmessage.textContent = \"\";\r\n\r\n\t// change h1Header\r\n\th1Header.style.backgroundC... | [
"0.7415291",
"0.7268943",
"0.69904774",
"0.6955814",
"0.68337196",
"0.6778495",
"0.6776079",
"0.67742395",
"0.6721905",
"0.6714733",
"0.668209",
"0.6678239",
"0.66488516",
"0.6581187",
"0.65801257",
"0.6574258",
"0.655506",
"0.6548688",
"0.65337354",
"0.6508614",
"0.65075576"... | 0.8503851 | 0 |
save the colors to the server | async function saveColors() {
// merge the user picked colors with existing custom colors so previously saved values are preserved
const colorsToSave = Object.assign(customColors, editedCustomColors)
await saveCustomColors(colorsToSave)
setShowColorControls(false)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function saveColorsToLocalStorage() {\n const colorsAsJson = JSON.stringify(colors);\n localStorage.setItem(\"colors\", colorsAsJson);\n}",
"onSave(hsva, instance) {\n var hex = hsva.toHEX().toString();\n State.Colors.image = hex;\n manipulateImage();\n }",
"function saveAndPostRGBs() {\n ... | [
"0.7353112",
"0.71067685",
"0.70093584",
"0.68129855",
"0.6787785",
"0.67758876",
"0.6680207",
"0.66708404",
"0.6536379",
"0.64627814",
"0.6459859",
"0.64591396",
"0.64206064",
"0.6285477",
"0.625459",
"0.6223454",
"0.6087694",
"0.60690683",
"0.60300106",
"0.5962797",
"0.5949... | 0.71956265 | 1 |
collect general information when a user's mouse enters the legend | function logMouseEnter() {
log('hover:scatterlegend', { numLabels })
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mouseoverHandler(e) {\n var layer = e.target;\n if (!plugin.selectionLegend.isSelected(layer)) {\n plugin.highlightFeature(layer);\n }\n }",
"function interactiveLegend(bar, points) {\n bar.on(\"mousemove\", function(d) {\n draw(d, 0.05, points)\n ... | [
"0.68678373",
"0.6793871",
"0.656224",
"0.6477119",
"0.64562917",
"0.6427914",
"0.6368619",
"0.63473",
"0.6290555",
"0.62485224",
"0.6248155",
"0.6133615",
"0.61310905",
"0.6065848",
"0.60588855",
"0.60426897",
"0.60338473",
"0.5994228",
"0.59526664",
"0.5937246",
"0.59351915... | 0.7414813 | 0 |
retrieve the color for the label specified (used for filtered legends) | function getColorForLabelIcon(specifiedLabel) {
const labelAndColor = fullLabelsMappedToColor.find(legendItem => legendItem.label === specifiedLabel)
return labelAndColor.iconColor
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get labelColor() {\n if (!(this.fields.labelColor instanceof pass_color_1.PassColor))\n return undefined;\n return this.fields.labelColor;\n }",
"function colorLabel(el, color) {\n d3.select(el)\n\t.style(\"fill\", color);\n}",
"function getColor(me) {\n\t\tlet label = getLabel(m... | [
"0.767697",
"0.6996482",
"0.6809766",
"0.6592582",
"0.64557123",
"0.6415246",
"0.64082247",
"0.6319797",
"0.62351894",
"0.6142051",
"0.61151636",
"0.60987556",
"0.60932595",
"0.6089062",
"0.60884875",
"0.60772896",
"0.6058113",
"0.60335493",
"0.5976123",
"0.5964611",
"0.59528... | 0.7115439 | 1 |
This must be called before reading a double or i64 vararg. It will bump the pointer properly. It also does an assert on i32 values, so it's nice to call it before all varargs calls. | function prepVararg(ptr, type) {
if (type === 'double' || type === 'i64') {
// move so the load is aligned
if (ptr & 7) {
assert((ptr & 7) === 4);
ptr += 4;
}
} else {
assert((ptr & 3) === 0);
}
return ptr;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[((ptr)>>0)]=value; break;\n case 'i8': HEAP8[((ptr)>>0)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; ... | [
"0.5169492",
"0.5163459",
"0.5122674",
"0.5111169",
"0.5111169",
"0.5111169",
"0.51067364",
"0.51067364",
"0.51067364",
"0.51067364",
"0.51067364",
"0.51067364",
"0.51067364",
"0.51067364",
"0.51067364",
"0.51067364",
"0.51067364",
"0.51067364",
"0.5106574",
"0.5097625",
"0.5... | 0.68204755 | 1 |
3. a) Write a function that checks if a given array has odd number of elements. Input: [1, 2, 9, 2, 1] Output: true | function hasOddNumberOfElements (arr) {
if (arr.length%2!=0) {
return true;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hasOdd(array) {\n var length = array.length;\n if (length % 2 == 1) {\n return true;\n } else return false;\n}",
"function checkOdd (arr) {\n return arr.length%2 !== 0;\n}",
"function chekOddElements(array) {\n\n if (array.length % 2 == 1) {\n return true;\n }\n return false;\... | [
"0.86984843",
"0.8569187",
"0.84997046",
"0.8345022",
"0.78849214",
"0.77562875",
"0.7728987",
"0.7637361",
"0.7551638",
"0.74897766",
"0.7415554",
"0.73797226",
"0.73506606",
"0.73296016",
"0.7236677",
"0.7215661",
"0.7153399",
"0.71393615",
"0.7118027",
"0.71094316",
"0.710... | 0.8646307 | 1 |
b) Write a function that counts the number of elements less than the middle element. If the given array has an even number of elements, print out an error message. Input: [1, 8.1, 3, 6, 2.3, 44, 2.11] Output: 4 | function countNumbersLessThanMiddle (arr) {
var counter = 0;
if(arr.length%2===0) {
return "Error!";
} else {
for(i=0; i<arr.length; i++) {
if(arr[i]< arr[parseInt(arr.length/2)]) {
counter ++;
}
}
}
return counter;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function countLessThanMiddle (arr) {\n var count = 0;\n if (arr.length%2 === 0) {\n return \"ERROR\";\n }\n else {\n arr.map(function(element) {\n if (element < (arr[Math.floor(arr.length/2)])) {\n count++;\n }\n }) \n }\n r... | [
"0.82269335",
"0.77325165",
"0.69974416",
"0.66080767",
"0.66024876",
"0.6586767",
"0.64500684",
"0.6371884",
"0.6367551",
"0.6365821",
"0.6358032",
"0.6268996",
"0.6192807",
"0.6189477",
"0.6168559",
"0.61499596",
"0.6149046",
"0.6129675",
"0.6125617",
"0.6125227",
"0.610862... | 0.8188813 | 1 |
5. a) Write a function that finds all the elements in a given array less than a given element. Input: [2, 3, 8, 2, 11, 4], 6 Output: [2, 3, 2, 4] | function findSmallerElements(arr, element) {
return arr.filter(num => num< element);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lessElements (arr,el) {\n return arr.filter(function(element) {\n return element < el;\n })\n}",
"function filter(array, number){\n let result = []\n for (let i=0; i<array.length; i++){\n if(array[i]>=number){\n result.push(array[i])\n }\n }\n return result;\n}",
"function ... | [
"0.7505913",
"0.68647546",
"0.68034655",
"0.67323416",
"0.67272687",
"0.66929036",
"0.66048807",
"0.65521044",
"0.655092",
"0.65343535",
"0.6527949",
"0.65045947",
"0.65011966",
"0.65011966",
"0.65011966",
"0.647829",
"0.6421996",
"0.63867164",
"0.6376056",
"0.6372391",
"0.63... | 0.7425382 | 1 |
Implement the selectLastEvenNumber function that takes an array and callback, it should call the callback immediately with the last even number on the array | function selectLastEvenNumber(myArr, call) {
let lasteven = -1;
for (let i = 0; i < myArr.length; i++) {
if (myArr[i] % 2 === 0) {
lasteven = myArr[i]
}
}
if (lasteven != -1) {
call(lasteven)
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function secondLast(arr) {\n console.log(arr[arr.length - 2]); // printing out the second last value\n\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] % 2 == 1) {\n var firstOdd = arr[i];\n return firstOdd; // get out of the function\n }\n }\n}",
"function last(array, cb) {\n cb(array[a... | [
"0.6464573",
"0.6401143",
"0.63991374",
"0.6329816",
"0.630516",
"0.6121965",
"0.6117406",
"0.6083418",
"0.58365464",
"0.58356094",
"0.58296674",
"0.582639",
"0.5792793",
"0.57718265",
"0.57517093",
"0.5693551",
"0.56905663",
"0.5684013",
"0.56727916",
"0.5672274",
"0.562775"... | 0.8032365 | 0 |
perform rowwise softmax on matrix | function softmax(m) {
var c = m.shape[1], max = m.reduce(Math.max), sum;
return m.map(function(x) {
return Math.exp(x - max);
}).map(function(x, i, j) {
if (j === 0) {
sum = 0;
for (var k = 0; k < c; k++)
sum += this.get(i, k);
}
return x / sum;
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function soft_max(z) {\n return tf.softmax(z.transpose()); //[100x6]\n}",
"function argmax2d(m) {\n if (m.shape[0] !== m.shape[1]) { throw 'argmax2d() only supports square matrices!'; }\n let N = m.shape[0];\n let idx = tf.argMax(m.reshape([-1])).dataSync()[0];\n let row = Math.floor(idx / N);\n let col = ... | [
"0.7494652",
"0.5413835",
"0.5298209",
"0.5248305",
"0.51785004",
"0.50740767",
"0.5059524",
"0.50388616",
"0.50243104",
"0.49939921",
"0.49450964",
"0.49296764",
"0.49296764",
"0.49296764",
"0.49296764",
"0.49167654",
"0.48529607",
"0.47964355",
"0.47911778",
"0.47652954",
"... | 0.74992144 | 0 |
get colwise mean of matrix as vector | function mean(m) {
var c = m.shape[1], v = Vector.zeros(c), sum;
return v.map(function(x, i) {
sum = 0;
for (var j = 0; j < c; j++)
sum += m.get(i, j);
return sum / c;
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"mean() {\n return ExtMath.mean(this._matrix);\n }",
"function findAvg(mat) {\n var sumMat = 0;\n for (var i = 0; i < mat.length; i++) {\n // var sumRow = 0;\n var row = mat[i];\n for (var j = 0; j < row.length; j++) {\n sumMat += row[j] \n }\n // sumMat += ... | [
"0.70418614",
"0.62188536",
"0.5874557",
"0.58692557",
"0.5803742",
"0.57967097",
"0.57967097",
"0.57967097",
"0.5706812",
"0.5688172",
"0.5688172",
"0.56706285",
"0.5650738",
"0.56277966",
"0.5572012",
"0.55698305",
"0.55550724",
"0.551908",
"0.5471461",
"0.5471461",
"0.5448... | 0.7164526 | 0 |
rowwise add vector to matrix | function addMatVec(m, v) {
return m.map(function(x, i, j) {
return x + v.get(j);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addRows(matrix, row1, row2, scalar){\n for (let i=0; i < matrix[row1].length; i++){\n //matrix[row1][i] += (scalar*matrix[row2][i]);\n matrix[row1][i] = matrix[row1][i].add(matrix[row2][i].mul(scalar));\n }\n return matrix;\n}",
"addRows(scalar, r1, r2)\r\n {\r\n for (var c = ... | [
"0.7020062",
"0.7017271",
"0.6728933",
"0.64136434",
"0.64093375",
"0.64019406",
"0.63920283",
"0.6375479",
"0.6282765",
"0.6231204",
"0.6182134",
"0.61364734",
"0.61364734",
"0.6130252",
"0.6129492",
"0.6125264",
"0.6098119",
"0.60719436",
"0.6071024",
"0.60495454",
"0.60473... | 0.72720903 | 0 |
helper method, returns true if a given case node is supported, false otherwise | function isSupported(caseNode) {
var ns = caseNode.attributes["required-namespace"];
if(!ns) {
// the namespace was not specified, that should
// never happen, we don't support it then
console.log("Encountered a case statement with no required-namespace");
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isSwitchCaseEnder(stmt) {\n\t return n.BreakStatement.check(stmt)\n\t || n.ContinueStatement.check(stmt)\n\t || n.ReturnStatement.check(stmt)\n\t || n.ThrowStatement.check(stmt);\n\t}",
"function isSwitchCaseEnder(stmt) {\n\t return n.BreakStatement.check(stmt)\n\t || n.ContinueSta... | [
"0.5767195",
"0.5767195",
"0.57251805",
"0.5634336",
"0.560156",
"0.558113",
"0.5480967",
"0.5345328",
"0.53438604",
"0.5322987",
"0.5314975",
"0.53045803",
"0.52922505",
"0.52901417",
"0.52881896",
"0.52881896",
"0.528782",
"0.527056",
"0.5264581",
"0.52527285",
"0.52490306"... | 0.73559105 | 1 |
INTERNAL FUNCTIONS Description: perform a function with an initialized zip filesystem, making sure that such filesystem is initialized. Note that due to a race condition, more than one zip filesystem may be instantiated. However, the last one to be set on the model object will prevail and others would be garbage collec... | function withZipFsPerform(callback, onerror) {
if (_zipFs) {
callback(_zipFs, onerror);
} else {
// The Web Worker requires standalone z-worker/inflate/deflate.js files in libDir (i.e. cannot be aggregated/minified/optimised in the final generated single-file ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function withZipFsPerform(callback, onerror) {\n\n if (_zipFs) {\n\n callback(_zipFs, onerror);\n\n } else {\n\n zip.workerScriptsPath = libDir;\n _zipFs = new zip.fs.FS();\n _zipFs.importHttpContent(baseUrl, true, function () {\n\n ... | [
"0.62686265",
"0.52504146",
"0.5244711",
"0.5225997",
"0.5203069",
"0.5189398",
"0.51530963",
"0.50317526",
"0.5024196",
"0.49690902",
"0.4965689",
"0.49317285",
"0.49129042",
"0.48856568",
"0.48748264",
"0.48733714",
"0.48719",
"0.48513207",
"0.48131832",
"0.48063308",
"0.47... | 0.62280333 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.