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 |
|---|---|---|---|---|---|---|
Draw the hovered node element on the ctx_hover | function drawHoveredNode(node) {
drawNodes(ctx_hover, node_by_id[node.id], node.r, 1)
//Also highlight the hovered node label (if it exists)
renderNodeLabels(ctx_hover, [node_by_id[node.id]], 1)
}//function drawHoveredNode | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"hover(e) {\n const b = this.chart.element.getBoundingClientRect();\n this.state.nodes = this.chart.shapesAt({\n x: e.clientX - b.left,\n y: e.clientY - b.top,\n });\n this.renderer.render(this.buildNodes());\n }",
"function draw() {\n if (state.hover) {\n tooltip\n ... | [
"0.7216837",
"0.7005607",
"0.6823368",
"0.6681407",
"0.6681261",
"0.6658115",
"0.66493654",
"0.6613637",
"0.65083843",
"0.6478759",
"0.64711493",
"0.645793",
"0.639738",
"0.6375622",
"0.63615996",
"0.6350367",
"0.63454515",
"0.6338168",
"0.63291025",
"0.63045967",
"0.63023514... | 0.81380874 | 0 |
Draw the dotted circle around the hovered node | function drawDottedHoverCircle(node) {
//Draw rotating circle around the node
node_hover
.attr("cx", node.x)
.attr("cy", node.y)
.attr("r", node.r + Math.min(10, Math.max(5, node.r * 0.1)))
.style("stroke", node.fill)
.style("display", n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawDot(node) {\n\tcontext.fillStyle = \"#000000\";\n\tcontext.beginPath();\n\tcontext.arc(node.x, node.y, 3, 0, Math.PI * 2, true);\n\tcontext.closePath();\n\tcontext.fill();\n}",
"function drawHoveredNode(node) {\r\n drawNodes(ctx_hover, node_by_id[node.id], node.r, 1)\r\n //Also highlig... | [
"0.7111156",
"0.7050114",
"0.6699651",
"0.6518317",
"0.6497131",
"0.64710057",
"0.6419907",
"0.6403306",
"0.6393806",
"0.6349809",
"0.6344136",
"0.6334597",
"0.63231206",
"0.6298362",
"0.627601",
"0.62699175",
"0.6264004",
"0.6256749",
"0.6251614",
"0.6240354",
"0.6201398",
... | 0.8183489 | 0 |
Draw a diamond shape | function drawDiamond(ctx, x, y, w, h) {
x -= w/2
y -= h/2
ctx.moveTo(x + w*0.5, y)
ctx.lineTo(x, y + h*0.5)
ctx.lineTo(x + w*0.5, y + h)
ctx.lineTo(x + w, y +h*0.5)
ctx.lineTo(x + w*0.5, y)
}//function drawDiamond | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawDiamond(t_diamond) {\n \n if(t_diamond.isFound == false) {\n y= t_diamond.y_pos;\n x= t_diamond.x_pos;\n noStroke();\n fill(0,200,255);\n quad(x,y,x-30,y-40,x-20,y-35,x-15,y-40);\n \n fill(0,150,255);\n quad(x,y,x+15,y-40,x,y-35,x-15,y-40);... | [
"0.8295136",
"0.8020991",
"0.78084594",
"0.73694193",
"0.7289978",
"0.6942678",
"0.69254565",
"0.6882261",
"0.6882261",
"0.6882261",
"0.68784493",
"0.6836777",
"0.66563195",
"0.6622709",
"0.6593588",
"0.6457005",
"0.6399876",
"0.63811046",
"0.63531226",
"0.6303354",
"0.627569... | 0.842784 | 0 |
Draw a ninja star shape | function drawNinjaStar(ctx, x, y, r) {
x -= r/2
y -= r/2
ctx.moveTo(x + r*0.5, y)
ctx.lineTo(x + r*0.35, y + r*0.35)
ctx.lineTo(x, y + r*0.5)
ctx.lineTo(x + r*0.35, y + r*0.65)
ctx.lineTo(x + r*0.5, y + r)
ctx.lineTo(x + r*0.65, y + r*0.65)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawStar(x,y,r,n) {\n noStroke();\n fill(this.starColor);\n beginShape();\n let t = 360 / n;\n for (let i = 0; i < n; i++) {\n vertexAtAngle(x, y, r, i * t);\n vertexAtAngle(x, y, r / 2.75, i * t + t / 2);\n }\n endShape(CLOSE);\n}",
"function drawStars(star_transp){\n... | [
"0.7403566",
"0.72358227",
"0.7188158",
"0.7090444",
"0.7018181",
"0.6996519",
"0.69932115",
"0.69273937",
"0.6890545",
"0.68660724",
"0.68395764",
"0.68351513",
"0.6794402",
"0.67550874",
"0.66925484",
"0.66888684",
"0.6679928",
"0.6672321",
"0.66502357",
"0.65906274",
"0.65... | 0.7773893 | 0 |
Calculate the center for each edge arc | function calculateEdgeCenters(edges) {
edges.forEach(d => {
//Find a good radius
d.r = Math.sqrt(sq(d.target.x - d.source.x) + sq(d.target.y - d.source.y)) * 2
//Find center of the arc function
let centers = findCenters(d.r, d.source, d.target)
d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_arc_center(x1, y1, x2, y2, fa, fs, rx, ry, sin_phi, cos_phi) {\n // Step 1.\n //\n // Moving an ellipse so origin will be the middlepoint between our two\n // points. After that, rotate it to line up ellipse axes with coordinate\n // axes.\n //\n var x1p = cos_phi*(x1-x2)/2 + sin_phi*(y1-y2)/2... | [
"0.6693212",
"0.6693212",
"0.6693212",
"0.6510738",
"0.6482719",
"0.6406296",
"0.63768446",
"0.630647",
"0.62482053",
"0.61990315",
"0.61175495",
"0.60769045",
"0.6073156",
"0.6060529",
"0.6050567",
"0.60290694",
"0.59934515",
"0.599073",
"0.59900975",
"0.597847",
"0.5973696"... | 0.7929405 | 0 |
Create gradients for the edges | function calculateEdgeGradient(edges) {
edges.forEach(d => {
let alpha
//Gradient for the hover state
//Needed in such a roundabout way for a gradient+transparency bug in Safari, sigh...
alpha = d.opacity === edge_primary_opacity ? 0.6 : 0.3
cr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"generateGradientColors(colorA, colorB, rows){\n let gradient = []\n gradient.push(colorA)\n for (let i = 1; i < rows-1; i++){\n gradient.push(lerpColor(colorA, colorB, i/(this.rows-1)))\n }\n gradient.push(colorB)\n return gradient\n }",
"function gradFilters(){\n defs= document.getEle... | [
"0.63132477",
"0.61013836",
"0.60354877",
"0.6029222",
"0.59829736",
"0.59784377",
"0.59756327",
"0.5960222",
"0.5948027",
"0.5914923",
"0.58562297",
"0.5851895",
"0.57996106",
"0.5783439",
"0.57690775",
"0.57649523",
"0.57257843",
"0.5700425",
"0.56856483",
"0.56526166",
"0.... | 0.78643215 | 0 |
////////////////// Text + Icon functions /////////////////// //////////////////////////////////////////////////////////// /////////////// Place labels inside nodes | function renderNodeLabels(ctx, nodes_to_label, opacity) {
ctx.fillStyle = "black"
ctx.textBaseline = "middle"
ctx.textAlign = "center"
// ctx.globalAlpha = 1
nodes_to_label
// .filter(d => d.type === "photograph" && (d.font_size > 7 || do_print_run))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addLabel(parent, x, y, class_, text) {\n return parent.append(\"text\")\n .attr(\"class\", class_)\n .attr(\"x\", x)\n .attr(\"y\", y)\n .text(text);\n}",
"function makeLabels() {\n svgContainer.append('text')\n .attr('x', 100)\n .attr('y', 40)\n .style('... | [
"0.69832253",
"0.69670856",
"0.6960854",
"0.69187486",
"0.69043773",
"0.6787099",
"0.67680705",
"0.67272484",
"0.67087203",
"0.6665976",
"0.6653634",
"0.66476476",
"0.66461635",
"0.66461635",
"0.66461635",
"0.66068834",
"0.66039634",
"0.65994275",
"0.65973693",
"0.6573464",
"... | 0.7262915 | 0 |
Place modal open icon next to clicked node | function renderClickIcon(node) {
//If this node's type is not in the modal list, don't draw it
if(modal_types.indexOf(node.type) === -1) {
node_modal_group.style("display", "none")
return
}//if
//Display the modal opening circle to the top right
l... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function openModal(){\n let add = document.querySelectorAll(\".icon-plus\")\n let modal = document.querySelector(\".modal\")\n for (let i = 0; i < add.length; i++) {\n add[i].addEventListener('click', function (e) {\n curNode = e;\n localStorage.setItem('myInput', '')\n ... | [
"0.65184885",
"0.6282344",
"0.61432433",
"0.6067308",
"0.6024248",
"0.59361285",
"0.5895498",
"0.5863404",
"0.5832557",
"0.57979506",
"0.57854956",
"0.57315254",
"0.5713952",
"0.57130647",
"0.57091916",
"0.57040983",
"0.56992406",
"0.56779504",
"0.5675195",
"0.56719375",
"0.5... | 0.7299745 | 0 |
///////////////// Canvas drawing functions ///////////////// //////////////////////////////////////////////////////////// /////////////// Find the device pixel ratio | function getPixelRatio(ctx) {
//From https://www.html5rocks.com/en/tutorials/canvas/hidpi/
let devicePixelRatio = window.devicePixelRatio || 1
let backingStoreRatio = ctx.webkitBackingStorePixelRatio ||
ctx.mozBackingStorePixelRatio ||
ctx.msBackingStorePixelRatio ||... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ratioScreen() {\n screenWidth = screen.width;\n screenHeight = screen.height;\n\n ratioWidth = $(\".canvascontainer\").innerWidth();\n //canvasScale = screenWidth / ratioWidth;\n canvasScale = ratioWidth / screenWidth;\n ratioHeight = canvasScale * screenHeight;\n\n //console.log(rati... | [
"0.74183786",
"0.69664633",
"0.6852012",
"0.6789213",
"0.6766159",
"0.67654073",
"0.66907406",
"0.65868247",
"0.6565464",
"0.65432394",
"0.6510376",
"0.646367",
"0.6445433",
"0.64347994",
"0.6409361",
"0.6392526",
"0.6371949",
"0.6371412",
"0.6354382",
"0.6354382",
"0.6354382... | 0.7368156 | 1 |
Helper method to handle condition methods that takes a branchId and a comment | static with_condition_method(inputArguments, context, callback, inner_func) {
const conditionNode = context.object;
// xx console.log(inputArguments.map(function(a){return a.toString()}));
if (!(conditionNode instanceof UAConditionBase)) {
callback(null, {
status... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function WorkFlowCondition(blogic, fieldName, operator, condValue, condId)\r\n{\r\n var cond = new Object();\r\n\tcond.id = condId;\r\n\tcond.blogic = blogic;\r\n\tcond.fieldName = fieldName;\r\n\tcond.operator = operator;\r\n\tcond.condValue = condValue;\r\n \r\n return cond;\r\n}",
"consumeComment(tok... | [
"0.58690816",
"0.572779",
"0.5689969",
"0.56412965",
"0.5562896",
"0.54408145",
"0.5428617",
"0.5362471",
"0.5334679",
"0.5300273",
"0.5159064",
"0.5127957",
"0.510049",
"0.5075111",
"0.5069953",
"0.506505",
"0.50586355",
"0.50501317",
"0.5046388",
"0.5012406",
"0.50122046",
... | 0.67102176 | 0 |
useful for debugging d3.csv('../data/ProNET/MGH_metadata.csv').then(data=> ethnCount(data)) | function ethnCount(data) {
// this variable should be made global so it could be used for d3 visualizations
let ethn_count= new Array(5).fill(0).map(() => new Array(10).fill(0))
data.forEach(d=> {
// r=race, e=ethnicity, s=sex
r= d["Race"]
e= d["Ethnicity"]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function countIcuBeds() {\n d3.json(stateData).then((data) => {\n\n data.forEach((state) => {\n if (!(state.NAME in icuBedsLookup)) {\n icuBedsLookup[state.NAME] = state.beds;\n \n }\n }); \n\n // console.log(icuBedsLookup); \n }); \n}",
"function getData() {\n d3.csv(\"base... | [
"0.62756556",
"0.61",
"0.60610956",
"0.58420014",
"0.5749813",
"0.57363975",
"0.57178265",
"0.57001495",
"0.56193846",
"0.55970275",
"0.5564413",
"0.5509982",
"0.55096984",
"0.5475718",
"0.5452249",
"0.54309595",
"0.5428066",
"0.54091996",
"0.5403218",
"0.53378886",
"0.533566... | 0.6569884 | 0 |
preventEventDefault prevents an event's default, but handles the condition that the event is null or doesn't have a preventDefault function. | function preventEventDefault(event) {
if (typeof event !== 'undefined' &&
event !== null &&
typeof event.preventDefault === 'function') {
event.preventDefault();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function __onPreventDefault(event) {\n event.preventDefault();\n event.returnValue = false;\n }",
"static eventPreventDefault(event) {\n event.preventDefault();\n }",
"function pdefault(e,event){\n event.preventDefault();\n}",
"function preventDefaultEven... | [
"0.7728845",
"0.7548197",
"0.7421083",
"0.7336655",
"0.7336655",
"0.7336655",
"0.7336655",
"0.7336655",
"0.73125696",
"0.728033",
"0.72341514",
"0.7200418",
"0.71819913",
"0.710668",
"0.7104916",
"0.7094754",
"0.70920885",
"0.706447",
"0.7042944",
"0.7033167",
"0.7030817",
... | 0.8442641 | 0 |
Translate the delta supplied by dragTracker into a delta that takes account of the invertedX and invertedY callbacks if defined. | function translate(delta) {
var directionX = 1,
directionY = -1;
if (typeof options.invertedX === 'function' && options.invertedX()) {
directionX = -1;
}
if (typeof options.invertedY === 'function' && options.invertedY()) {
directionY = 1;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDeltaPos(d){\n var target = machine.states[d.to],\n source = machine.states[d.from],\n vec = {\n x: target.x - source.x,\n y: target.y - source.y\n },\n perpVec = {\n x: vec.y * -1,\n y: vec.x\n },\n output = { // ... | [
"0.5483882",
"0.52551895",
"0.52551895",
"0.52551895",
"0.5236598",
"0.49357572",
"0.49098876",
"0.4872446",
"0.48713434",
"0.48476487",
"0.48476487",
"0.4830058",
"0.4830011",
"0.4804251",
"0.48011592",
"0.48009998",
"0.47971252",
"0.4795761",
"0.47877288",
"0.47274116",
"0.... | 0.63947475 | 0 |
generate animation parameters from animation declaration | function generateAnimationParams(animation) {
var timeReg = /^(\d+)?(\.)?\d+m?s$/i;
var loopReg = /^(\d|infinite|forwards|steps\(\d+\))$/i;
var timeConvert = function timeConvert(n) {
return parseFloat(n) * (/ms$/.test(n) ? 1 : 1e3);
};
if (!animation) {
return [];
}
return animation.replace(/to... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AnimationParser() {}",
"function AnimationParser() { }",
"function AnimationParser() { }",
"function AnimationMetadata() {}",
"function AnimationMetadata() {}",
"function AnimationSequenceMetadata() {}",
"function AnimationSequenceMetadata() {}",
"function AnimationAnimateMetadata() {}",
"... | [
"0.6972249",
"0.6942556",
"0.6942556",
"0.6658624",
"0.6658624",
"0.6584651",
"0.6584651",
"0.64995193",
"0.64995193",
"0.64837337",
"0.64737713",
"0.647144",
"0.647144",
"0.64122903",
"0.64122903",
"0.6327409",
"0.6327409",
"0.6304067",
"0.6304067",
"0.6279936",
"0.6279936",... | 0.780061 | 0 |
Check if the group has a setting data attr in the DOM. Extract those setting if it's valid JSON. | function getSettings (groupName) {
const settingsElement = document.querySelector(
`[data-tab-group-${groupName}]`
)
if (!settingsElement) return {}
const settings =
settingsElement.dataset[`tabGroup${upperFirst(groupName)}`]
try {
JSON.parse(settings)
} ca... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function processingPropertiesToTheDom(group) {\r\n\r\n let state = $('#inputs > div > select').val()\r\n let backgroundInput = $('#background-input').val()\r\n let borderRadiusInput = $('#border-radius-input').val();\r\n let boxShadowInput = $('#box-shadow-input').val();\r\n let borderInput = $('#bo... | [
"0.5191353",
"0.5184988",
"0.5023181",
"0.5023181",
"0.49913937",
"0.4985132",
"0.48872614",
"0.4839915",
"0.47511524",
"0.47383776",
"0.4737319",
"0.47293678",
"0.47282326",
"0.4712776",
"0.47100833",
"0.4708187",
"0.46900323",
"0.46900323",
"0.4669319",
"0.4666439",
"0.4661... | 0.6379438 | 0 |
when remote removes a stream, remove it from the local video element | function onRemoteStreamRemoved(event) {
console.log("Remove remote stream");
remote.attr("src", "");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onRemoteStreamRemoved(event) {\r\n console.log(\"Remove remote stream\");\r\n detachVideo(this.id);\r\n //remoteVideo.pause();\r\n //remoteVideo.src = \"\";\r\n }",
"function removeRemoteStream(user_id) {\n\n // remove the audio track from the page\n //if (myRemoteStreams[user_i... | [
"0.87148774",
"0.7910837",
"0.7784686",
"0.7756602",
"0.76909786",
"0.74110097",
"0.7290609",
"0.7073293",
"0.70053905",
"0.694361",
"0.6878861",
"0.6837384",
"0.6783736",
"0.67761934",
"0.6771427",
"0.6747698",
"0.6724441",
"0.66494954",
"0.6628476",
"0.6548582",
"0.6500299"... | 0.84003556 | 1 |
This function just initialize the samplers and in production code probably it will look different. | initialize() {
const CommandsServiceResponseParser = require("./models/sampler/parsers/CommandsService");
const Staging360ServiceResponseParser = require("./models/sampler/parsers/Staging360Service");
const BIM360ServiceResponseParser = require("./models/sampler/parsers/BIM360Service");
this.addSampler("https:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initAnalyser() {\r\n\tanalyser = audioContext.createAnalyser();\r\n\tanalyser.smoothingTimeConstant = SMOOTHING;\r\n\tanalyser.fftSize = FFT_SIZE;\r\n\r\n}",
"function init() {\r\n\ttry {\r\n\t\t// Check if the default naming is enabled, if not use the WebKit naming.\r\n\t if (!window.AudioContext) {... | [
"0.60265386",
"0.5903516",
"0.5900373",
"0.5869227",
"0.58637035",
"0.5759175",
"0.57439476",
"0.5736082",
"0.57182497",
"0.5697065",
"0.56425",
"0.56359524",
"0.56267995",
"0.5586196",
"0.55785215",
"0.5568049",
"0.55600977",
"0.5556729",
"0.55544966",
"0.5551234",
"0.555033... | 0.6675568 | 0 |
makes a single object to serve as a key between codes and country names | function makeKey(){
var countryObjects = new Object();
for(var i = 0; i<keys.length; i++){
var parsedCount = keys[i].split(":");
if(direction == 1) //direction of 1 meaning country:key
{
countryObjects[parsedCount[0]] = parsedCount[1];
}else{
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createCountries() {\r\n var\r\n map,\r\n countries,\r\n randomTable;\r\n\r\n // http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\r\n map = {};\r\n countries = fakeData.countries;\r\n countries.forEach(function createCountry(countryData) {\r\n var\r\n co... | [
"0.6432926",
"0.60390645",
"0.59208333",
"0.5902408",
"0.58701414",
"0.5816684",
"0.5794909",
"0.57551175",
"0.5751836",
"0.5689173",
"0.5563333",
"0.5559128",
"0.55591166",
"0.55499226",
"0.5549391",
"0.5539766",
"0.5482038",
"0.54802436",
"0.5423788",
"0.542069",
"0.5409961... | 0.7018533 | 0 |
A rule that joins adjacent lists of the same type | function joinAdjacentLists(opts: Options, node: Node, next): void | Normalizer {
if (node.object !== 'document' && node.object !== 'block') {
return next();
}
const invalids = node.nodes
.map((child, i) => {
if (!isList(opts, child)) return null;
const nextNode = nod... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function joinAdjacentLists(opts, node) {\n if (node.object !== \"document\" && node.object !== \"block\") {\n return undefined;\n }\n\n var invalids = node.nodes.map(function (child, i) {\n if (!(0, _utils.isList)(opts, child)) return null;\n var next = node.nodes.get(i + 1);\n if (!next || !(0, _ut... | [
"0.6441437",
"0.5898852",
"0.58807397",
"0.587702",
"0.56055087",
"0.5581185",
"0.5564393",
"0.55622894",
"0.54936373",
"0.5402619",
"0.5399611",
"0.53928226",
"0.5365521",
"0.53627616",
"0.5355519",
"0.5240687",
"0.5233029",
"0.52197313",
"0.5213287",
"0.52110857",
"0.520895... | 0.6889293 | 0 |
destroy count down timer | _destroyTimer(timer) {
if(timer) {
clearInterval(timer);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function timerCountDown() {\n\n }",
"function countDown(){\n time--;\n $(\"#timer\").html(time);\n if (time === 0){\n clearInterval(thetimer);\n }\n }",
"destroy() {\n this._clearInterval();\n }",
"function stopCountDown(){\r\n clearInterval(counter);\r... | [
"0.76251364",
"0.7148623",
"0.70527977",
"0.7040946",
"0.7033701",
"0.69883054",
"0.6984698",
"0.6982939",
"0.6976349",
"0.6961319",
"0.69540846",
"0.692928",
"0.69160706",
"0.68830335",
"0.68739384",
"0.6873228",
"0.6860829",
"0.6811286",
"0.6798896",
"0.67819184",
"0.677088... | 0.7381837 | 1 |
Rent a drone, show timer and remove the rented drone from its station | rentDrone(droneDetails, stationId) {
let {maxFlightTime : flightTime, charge: batteryCharge} = droneDetails;
let uniqueId = this._currentUser.emailId;
let {stations : allStations, notification} = {...this.state};
this._activeDrone = droneDetails;
flightTime = flightTime.split('min')[0];
batter... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"returnDrone(isDroneCrashed) {\n let rentedDrone = {...this._activeDrone};\n\n if(!!rentedDrone) {\n let {stations:newStations, notification} = this.state;\n\n // if drone is crashed, set battery charge to 0%\n if(!!isDroneCrashed) {\n rentedDrone.charge = \"0%\";\n }\n\n this.... | [
"0.6164518",
"0.58737046",
"0.57985973",
"0.5631338",
"0.55624694",
"0.54201216",
"0.5401022",
"0.5386713",
"0.536646",
"0.5344024",
"0.53424793",
"0.53386104",
"0.53373915",
"0.5324924",
"0.53001225",
"0.5286866",
"0.5286845",
"0.52836174",
"0.527791",
"0.5275103",
"0.527483... | 0.6849281 | 0 |
Build DroneStations with drones | buildDroneStations () {
let droneStations = [];
let {stations} = this.state;
let uniqueId = this._currentUser && this._currentUser.emailId;
let isUserForbidden = AuthenticationService.isUserBanned(uniqueId)
|| this.isDroneActive ;
for(let i=0 ; i< Object.keys(stations).len... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Drone(){}",
"async function initDoodleData() {\n fs.createReadStream(\"./drawings/ant.ndjson\")\n .pipe(ndjson.parse())\n .on(\"data\", ant => {\n doodleArray[0].push(ant.drawing);\n })\n .on(\"end\", () => {\n trainingBounds.push(Math.floor(doodleArray[1].length * trainingFractio... | [
"0.60003334",
"0.55969507",
"0.55301297",
"0.5462396",
"0.54250985",
"0.53977764",
"0.53795874",
"0.53567094",
"0.5325378",
"0.5282939",
"0.52664644",
"0.5263971",
"0.5259905",
"0.52165794",
"0.517756",
"0.51767516",
"0.51728487",
"0.5109433",
"0.50526047",
"0.50469196",
"0.5... | 0.6473411 | 0 |
Display ads catalog logic | async function listAds(ctx) {
ctx.loggedIn = sessionStorage.getItem('authToken') !== null;
ctx.username = sessionStorage.getItem('username');
try {
let response = await requestor.get('appdata', 'ads', 'Kinvey');
let ads = response.reverse();
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderCatalogItems () {\n let cards = doc.querySelector('#catalog-cards');\n for (let i = 0; i < items.length; i++) {\n if (items[i].category === 'catalog') {\n renderCard(items[i], cards);\n }\n }\n}",
"function CarsAdDisplay(CarsAdDetails){\n var path;\n // Vertical Car Ads... | [
"0.64384747",
"0.6192728",
"0.5914723",
"0.5912922",
"0.57310104",
"0.5719705",
"0.57034653",
"0.5680595",
"0.5664613",
"0.5598312",
"0.55602115",
"0.5543195",
"0.5531403",
"0.55221546",
"0.5512619",
"0.5497991",
"0.548384",
"0.54782987",
"0.54700714",
"0.5436165",
"0.5433096... | 0.6348452 | 1 |
Check if some UI information has changed and should be displayed. | checkUI() {
const playerScore = this.player.getScore();
const playerLife = this.player.getLife();
if (this.lastLife != playerLife || this.lastScore != playerScore) {
this.displayUI(playerScore, playerLife);
this.lastScore = playerScore;
this.lastLife = playerLife;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _check_if_exist_change(){\n try{\n return _is_make_changed;\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _check_if_exist_change');\n return... | [
"0.6361457",
"0.63430583",
"0.6291313",
"0.62021166",
"0.607773",
"0.5995142",
"0.5972668",
"0.59597164",
"0.59484196",
"0.5923911",
"0.5894206",
"0.58934826",
"0.58587575",
"0.58502096",
"0.58482635",
"0.58128303",
"0.5776726",
"0.57474124",
"0.5736096",
"0.5734185",
"0.5713... | 0.7005033 | 0 |
Send REST API request with given HTTP request info, with connected session information and SFDX headers. This method returns a raw http response which includes a response body and statusCode. | async requestRaw(request) {
const headers = this.accessToken ? { Authorization: `Bearer ${this.accessToken}` } : {};
kit_1.merge(headers, exports.SFDX_HTTP_HEADERS, request.headers);
return this.transport.httpRequest({
method: request.method,
url: request.url,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getRequestDetails(request_id, hashed_vname) {\n \n\n //you can only check the status of requests made by your API key\n //the request_id and hashed_vname can be passed to the client side and used as secret session access token (ensure you are using https for transmission and verify the status as ... | [
"0.56644964",
"0.5349845",
"0.5346081",
"0.52562606",
"0.5232815",
"0.5157059",
"0.51560724",
"0.51363736",
"0.5127035",
"0.5019231",
"0.5007503",
"0.5007503",
"0.49874926",
"0.49804097",
"0.49804097",
"0.49804097",
"0.49804097",
"0.49804097",
"0.49804097",
"0.49804097",
"0.4... | 0.56541187 | 1 |
The Force API base url for the instance. | baseUrl() {
// essentially the same as pathJoin(super.instanceUrl, 'services', 'data', `v${super.version}`);
return super._baseUrl();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getRequestBaseURL() {\n\n var url;\n\n if (useProxy) {\n url = proxyURL;\n } else if (oauth.instance_url) {\n url = oauth.instance_url;\n } else {\n url = serverURL;\n }\n\n // dev friendly API: Remove trailing '/' if any so url + path concat always works... | [
"0.70797265",
"0.69697875",
"0.6941851",
"0.6914056",
"0.67757183",
"0.67485195",
"0.6657723",
"0.66330093",
"0.6588588",
"0.6588244",
"0.6574742",
"0.6557159",
"0.6543643",
"0.6495814",
"0.6484996",
"0.6440376",
"0.6439954",
"0.6439954",
"0.641928",
"0.63991636",
"0.6396482"... | 0.7686131 | 0 |
Retrieves the highest api version that is supported by the target server instance. | async retrieveMaxApiVersion() {
const versions = (await this.request(`${this.instanceUrl}/services/data`));
this.logger.debug(`response for org versions: ${versions}`);
const max = ts_types_1.ensure(kit_1.maxBy(versions, (version) => version.version));
return max.version;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async retrieveMaxApiVersion() {\n return await this.getConnection().retrieveMaxApiVersion();\n }",
"async useLatestApiVersion() {\n try {\n this.setApiVersion(await this.retrieveMaxApiVersion());\n }\n catch (err) {\n // Don't fail if we can't use the latest, ... | [
"0.8013954",
"0.67617786",
"0.6469084",
"0.6406766",
"0.6221521",
"0.6169287",
"0.59708625",
"0.59179986",
"0.587659",
"0.5802033",
"0.5796151",
"0.5760675",
"0.57379824",
"0.56886387",
"0.5618352",
"0.5564128",
"0.55225617",
"0.54922193",
"0.5480063",
"0.5478524",
"0.5471913... | 0.8042213 | 0 |
Use the latest API version available on `this.instanceUrl`. | async useLatestApiVersion() {
try {
this.setApiVersion(await this.retrieveMaxApiVersion());
}
catch (err) {
// Don't fail if we can't use the latest, just use the default
this.logger.warn('Failed to set the latest API version:', err);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getApiVersion() {\n return this.version;\n }",
"static version() {\n // NOTE: Object merge instead of Object.assign because deep copy\n return _.merge({}, this.health(), {\n data: {\n version: config.application.release_version,\n },\n });\n }",
"get version() {}",
"async... | [
"0.6058968",
"0.59760416",
"0.5752226",
"0.5744501",
"0.5684704",
"0.566635",
"0.5657261",
"0.56360656",
"0.562816",
"0.56215996",
"0.55866206",
"0.5555518",
"0.5543686",
"0.55222124",
"0.55159765",
"0.5506735",
"0.55008304",
"0.54613674",
"0.5452807",
"0.5452807",
"0.5452807... | 0.7065793 | 0 |
Getter for the AuthInfo. | getAuthInfoFields() {
return this.options.authInfo.getFields();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"authInfo() {\n return {\n username: this.username,\n password: this.password\n }\n }",
"function getAuth() {\n return auth.$getAuth();\n }",
"function getAuthToken() { return auth; }",
"function getAuth() {\n // Auth Route\n fetch(`https://app-5fyldqen... | [
"0.75970393",
"0.6952498",
"0.67939305",
"0.65413564",
"0.636086",
"0.6250051",
"0.61922073",
"0.6154248",
"0.5952348",
"0.5950851",
"0.5786755",
"0.578135",
"0.57535547",
"0.57517207",
"0.5751586",
"0.56659544",
"0.5659178",
"0.56457335",
"0.56243354",
"0.55980325",
"0.55978... | 0.71261317 | 1 |
Getter for the username of the Salesforce Org. | getUsername() {
return this.getAuthInfoFields().username;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getUsername() {\n return super.getAsNullableString(\"username\") || super.getAsNullableString(\"user\");\n }",
"GetName() { return this._username; }",
"get userName() {\n return this._data.user_login;\n }",
"get userName() {\n return this._data.user_login;\n }",
"function getU... | [
"0.6972748",
"0.6798922",
"0.6721513",
"0.6721513",
"0.6559096",
"0.6554966",
"0.65153414",
"0.6492158",
"0.6436166",
"0.6420378",
"0.64117765",
"0.64117765",
"0.6408275",
"0.63701636",
"0.6344111",
"0.63044",
"0.6289765",
"0.628494",
"0.628494",
"0.62847763",
"0.6282882",
... | 0.722541 | 0 |
Returns true if this connection is using access token auth. | isUsingAccessToken() {
return this.options.authInfo.isUsingAccessToken();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isAuthenticated() {\n return !!getAccessTokenFromUrl();\n }",
"isAuthenticated() {\n\t\treturn !!this.getAccessToken();\n\t}",
"function isAuthenticated() {\n return !!getAccessTokenFromUrl();\n}",
"_hasValidAccessToken () {\n const isTokenExpired = !this.clientAccessTokenExpiryTime\n |... | [
"0.73478174",
"0.73269904",
"0.71681124",
"0.69428694",
"0.692034",
"0.67922044",
"0.67613727",
"0.66919976",
"0.6663666",
"0.6642575",
"0.6539031",
"0.6425593",
"0.6396656",
"0.63621986",
"0.6341025",
"0.63372606",
"0.6213001",
"0.6209498",
"0.61921614",
"0.61896145",
"0.615... | 0.81641906 | 0 |
Normalize a Salesforce url to include a instance information. | normalizeUrl(url) {
return this._normalizeUrl(url);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function normalizeUrl(url){\n //Remove parts of the url such as \"http//:\", \"www.\"... and make it lowercase\n //This ensures local stored info can be retrieved even if the url is slightly different than when data was saved.\n\n result = url.toLowerCase();\n \n result = deleteSubstringAtStart(result... | [
"0.56303996",
"0.54975057",
"0.5463544",
"0.54331404",
"0.5423754",
"0.5408896",
"0.53724474",
"0.52134943",
"0.514498",
"0.5138212",
"0.51318824",
"0.5070349",
"0.5027256",
"0.5027256",
"0.5027256",
"0.5027256",
"0.5027256",
"0.5027256",
"0.5027256",
"0.5027256",
"0.5027256"... | 0.5641889 | 0 |
Executes a query and autofetches (i.e., "queryMore") all results. This is especially useful with large query result sizes, such as over 2000 records. The default maximum fetch size is 10,000 records. Modify this via the options argument. | async autoFetchQuery(soql, executeOptions = {}) {
const config = await configAggregator_1.ConfigAggregator.create();
// take the limit from the calling function, then the config, then default 10,000
const maxFetch = config.getInfo('maxQueryLimit').value || executeOptions.maxFetch || 10000;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"executeNext() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.queryExecutionContext.fetchMore();\n });\n }",
"async fetch(options) {\n const stack = this.options.debug ? new Error().stack : undefined;\n const sql = await this.prepareFetch(options);\n c... | [
"0.6264011",
"0.58230495",
"0.5674401",
"0.5662787",
"0.55423087",
"0.5502595",
"0.5436995",
"0.5396976",
"0.53734803",
"0.5367404",
"0.5319283",
"0.52729326",
"0.5254981",
"0.52449805",
"0.52449805",
"0.5241795",
"0.5221001",
"0.51857245",
"0.5175441",
"0.51732016",
"0.51393... | 0.67081976 | 0 |
Optimizing bubble sort The current problem with bubble sort is that, if the array is already close to sorted, the bubble sort will still run the total length of the array and redo the sort for the length. This will take forever for really long arrays as bubble sort will do this everytime if we do not short circuit it. ... | function optimizedBubbleSort(arr) {
for (let i = arr.length; i > 0; i--) {
let swaps = 0;
for (let j = 0; j < i - 1; j++) {
if (arr[j] > arr[j + 1]) {
[arr[j], arr[j + 1]] = [arr[j + 1], arr[j]];
swaps++;
}
}
if (swaps === 0) break;
}
return arr;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bubbleSortAlt(arr){\n let swaps;\n\n for(let i = arr.length; i > 0; i--){\n swaps = 0;\n for(let j = 0; j < i-1; j++){\n\n if(arr[j] > arr[j+1]){\n swap(arr, j, j+1);\n swaps++;\n }\n \n }\n //console.log(\"one pa... | [
"0.8333894",
"0.82283914",
"0.80816674",
"0.7977636",
"0.78837",
"0.7879079",
"0.7847746",
"0.7823018",
"0.7813239",
"0.7773811",
"0.77601844",
"0.77600014",
"0.7752094",
"0.77422386",
"0.77412724",
"0.772643",
"0.77260476",
"0.77217764",
"0.7697538",
"0.7694153",
"0.76691365... | 0.82501656 | 1 |
Initializes an embed with the given options. Handles overriding or merging of an existing embed in the cache. Returns an object to the caller with the embed as well as whether or not it was modified. | function initEmbed(id, opts, Constructor) {
var ret = { embed: embeddables[id], modified: false };
if (!ret.embed) {
embeddables[id] = ret.embed = new Constructor(opts);
} else if (Constructor !== Embeddable && ret.embed.constructor === Embeddable) {
ret.embed = new Constructor(opts);
mer... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Embed(data) {\n /**\n * @field\n * @description the JSON object exactly as is returned in the \"data\" field of the JSON responses (see API documentation: https://developers.prismic.io/documentation/UjBe8bGIJ3EKtgBZ/api-documentation#json-responses)\n */\n return {\n '_type': 'Embed',\n '_da... | [
"0.53765535",
"0.5273999",
"0.5202316",
"0.5195336",
"0.51821476",
"0.5164239",
"0.514938",
"0.51051694",
"0.50967",
"0.4983952",
"0.49559698",
"0.4841611",
"0.48008937",
"0.47848973",
"0.47743672",
"0.4761838",
"0.47595313",
"0.47575808",
"0.47417602",
"0.47336963",
"0.47034... | 0.67521656 | 0 |
Split a string in the format k=v,k2=v2,k3=v3 and create a map of the values. | function mapSplit(s) {
var arr = s.split(','), ret = {}, key, part, parts, i;
for (i = 0; i < arr.length; i++) {
// Trim
part = arr[i].replace(/\s/g, '');
if (part.length) {
parts = part.split('=');
// Trim
key = parts[0].replace(/\s/g, '');
if (key.length &... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function splitKeyValuePair(str){var index=str.indexOf('=');var key;var val;if(index===-1){key=str;}else{key=str.substr(0,index);val=str.substr(index+1);}return[key,val];}",
"function splitKeyValuePair(str) {\n var index = str.indexOf('=');\n var key;\n var val;\n\n if (index === -1) {\n key = str;\n } el... | [
"0.74296415",
"0.7414201",
"0.7414201",
"0.7414201",
"0.7414201",
"0.7414201",
"0.7414201",
"0.7414201",
"0.7414201",
"0.7414201",
"0.7414201",
"0.7414201",
"0.7414201",
"0.7414201",
"0.7414201",
"0.7414201",
"0.7414201",
"0.7414201",
"0.7414201",
"0.7414201",
"0.7339275",
... | 0.74277604 | 1 |
Check if a timer for the given ID and field is running | function timerRunning(id, field) {
var timeObj = getTimeObject(id, field);
if (!timeObj || !timeObj.isRunning) {
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isThereATimer() {\n return getRemainingSeconds();\n}",
"function timerStart(id, field) {\n var timeObj;\n\n // Nothing in the timer registry means the embed was not specified to have timing\n if (!internalTime[id]) {\n if (IS_DBG) {\n fs.timing(id); //Calling fs.timing() with no ca... | [
"0.6427478",
"0.6235745",
"0.61768806",
"0.6130837",
"0.61204827",
"0.6073697",
"0.60326767",
"0.58541846",
"0.5781987",
"0.5775853",
"0.5731878",
"0.56946445",
"0.561997",
"0.55785686",
"0.55366576",
"0.55063033",
"0.54776365",
"0.54688203",
"0.54263866",
"0.5413537",
"0.540... | 0.8715713 | 0 |
Start timing for a given ID and timing field | function timerStart(id, field) {
var timeObj;
// Nothing in the timer registry means the embed was not specified to have timing
if (!internalTime[id]) {
if (IS_DBG) {
fs.timing(id); //Calling fs.timing() with no callback will essentially begin recording timings on the embed
} else {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"startTimer(id) {\n this._timers[id] = this._timerFactory(id);\n this._timers[id].start();\n }",
"function startTask(tid){\n\tTimer[tid]={\n\t\tstart_stamp: Date.now(),\n\t\ttrials: 0\n\t};\n\tLog.push({\n\t\tevent:\"START_TASK\", \n\t\ttid: tid,\n\t\tdetail: { },\n\t\ttimestamp:Date.now()\n\t})... | [
"0.63078016",
"0.6257789",
"0.6251543",
"0.60670376",
"0.60519254",
"0.6035303",
"0.6031346",
"0.59916854",
"0.5957251",
"0.5933479",
"0.5917423",
"0.5917423",
"0.5889854",
"0.5857797",
"0.58485293",
"0.5841568",
"0.58259225",
"0.58215576",
"0.5819461",
"0.57977784",
"0.57883... | 0.80257463 | 0 |
End timing for a given ID and timing field | function timerEnd(id, field) {
var timeObj = getTimeObject(id, field), internalTimeObj, embed;
if (!timeObj) {
return;
}
// Check if timer has started, if not, we can't correctly calculate the delta
if (timeObj.isRunning) {
// Increment to the total
timeObj.total += (+new Date())... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function endTimeout() {\n\t\t_$clearTimeout_332( id );\n\t}",
"function end() {\n setTime(0);\n stopTimer();\n }",
"function end() {\n\t\t\tif ( timer ) {\n\t\t\t\tclearTimeout( timer );\n\t\t\t\ttimer = timeout = undefined;\n\t\t\t}\n\t\t}",
"function endTimer() {\n clearTimeout(timer);\... | [
"0.6595681",
"0.6428859",
"0.6222821",
"0.61652064",
"0.604957",
"0.59206176",
"0.5788201",
"0.57119346",
"0.56494343",
"0.5601089",
"0.55962306",
"0.55844444",
"0.55827564",
"0.5582298",
"0.55464935",
"0.5530365",
"0.5524209",
"0.5523538",
"0.5511409",
"0.550198",
"0.5474764... | 0.7358004 | 0 |
Abort timing for a given ID and timing field | function timerAbort(id, field) {
var timeObj = getTimeObject(id, field);
if (!timeObj) {
return;
}
timeObj.total = 0;
timeObj.isRunning = false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function abortTimer() { \n clearInterval(tid);\n}",
"abort() {\n this._timer.remove(false);\n }",
"function wrappedClearTimeout(id) {\n clearTimeout(TIMERS[id]);\n delete TIMERS[id];\n}",
"function clearTimeout(tid) {\n // we just interrupt the timer thread\n tid.interrupt();\n}",
"async funct... | [
"0.6711991",
"0.66096026",
"0.61254394",
"0.6066289",
"0.60605663",
"0.605707",
"0.6029208",
"0.60203254",
"0.59609973",
"0.595538",
"0.595538",
"0.595538",
"0.5954669",
"0.5954669",
"0.5954669",
"0.5954669",
"0.5954669",
"0.59442997",
"0.5931301",
"0.59289175",
"0.59172344",... | 0.8243203 | 0 |
Convenience method for getting the contents of a script tag. | function getScriptContents(script) {
return script.text || script.textContent || script.innerHTML || '';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getScriptElementContents(el) {\n if (!isElement(el)) {\n throw new TypeError('Expected a DOM Node, got ' + common.unexpectedObjToString(el));\n }\n if (el.type !== 'text/ohm-js') {\n throw new Error('Expected a script tag with type=\"text/ohm-js\", got ' + el);\n }\n ... | [
"0.71638674",
"0.70970374",
"0.70816565",
"0.6555217",
"0.6518677",
"0.59638774",
"0.5914054",
"0.5895174",
"0.5851977",
"0.58239204",
"0.58040637",
"0.574264",
"0.5672321",
"0.5672321",
"0.56400067",
"0.56400067",
"0.56213534",
"0.56152415",
"0.558914",
"0.5582873",
"0.55806... | 0.7329747 | 0 |
Take an array of scripts and construct a script loading and/or execution queue. | function queueScripts(scripts, id) {
/*jshint loopfunc:true */
var script, scriptText, embed;
embed = embeddables[id];
// Check if this ID is to be timed
if (internalTime[id]) {
// Queue additional call to start timing for this field in case there are external fetches
lab.queueWait(fun... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadScripts()\n\t{\n\t\tif (scriptList.length > 0)\n\t\t{\n\t\t\tvar file = scriptList.shift();\n\n\t\t\t// Inject the script elements\n\t\t\tajaxHandles.push(fw.injectScript(that.path + file, loadScripts, loadFailed));\n\t\t}\n\t\telse\n\t\t\tdoneLoading();\n\t}",
"function runScripts() {\n var sour... | [
"0.65920013",
"0.6506424",
"0.64922154",
"0.6207044",
"0.6189602",
"0.61683863",
"0.61661065",
"0.60781485",
"0.5950504",
"0.5941257",
"0.5912828",
"0.5901783",
"0.5900389",
"0.5897999",
"0.5897999",
"0.58795726",
"0.58250123",
"0.58250123",
"0.58250123",
"0.58250123",
"0.578... | 0.6604092 | 0 |
Convenience for parsing a JSON string and logging if an issue occurs | function parseJSON(id, s) {
var ret;
// Append to the parseProcessing event
timerStart(id, TIME_FIELDS.PARSE_PROCESS);
// Check if the throw clause is in the JSON
if (s.indexOf('throw /*LI:DBE*/ 1;') === 0) {
// Strip it
s = s.substring(19);
}
timerEnd(id, TIME_FIELDS.PARSE_PR... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseJSON(string) {\n try {\n return JSON.parse(string);\n } catch (_) {\n throw new Error(`Failed to parse JSON from data starting with \"${Object(_binary_utils_get_first_characters__WEBPACK_IMPORTED_MODULE_0__[\"getFirstCharacters\"])(string)}\"`);\n }\n}",
"function parseJSON(string) {\n tr... | [
"0.73339975",
"0.73339975",
"0.73339975",
"0.7303931",
"0.7274137",
"0.7259742",
"0.7237432",
"0.7237432",
"0.7237432",
"0.7237432",
"0.7237432",
"0.7237432",
"0.7237432",
"0.7237432",
"0.7237432",
"0.7237432",
"0.7237432",
"0.7237432",
"0.7237432",
"0.7237432",
"0.7237432",
... | 0.7471122 | 0 |
Check if the given string is wrapped in the format of the given comment object | function isWrappedByComment(comment, str) {
// Check the front and back of the string to see if they are consistently formatted
return str.substring(0, comment.start.length) === comment.start &&
str.substring(str.length - comment.end.length) === comment.end;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function detect(comment) {\n if (comment.startsWith('Can someone explain')) {\n return true\n } else {\n return false\n }\n}",
"function test(str) {\n if (removeComments(str+\"// coment\") !== str || removeComments('/* start\\n \" */' +str+\"/* end ' \\n */\") !== str) {\n console.log... | [
"0.59068626",
"0.585168",
"0.5752116",
"0.5607996",
"0.5588068",
"0.55401087",
"0.5523011",
"0.5448487",
"0.5448487",
"0.5448487",
"0.5433018",
"0.53808135",
"0.5369412",
"0.5368191",
"0.53470904",
"0.53128505",
"0.53109664",
"0.5310731",
"0.52910644",
"0.5264131",
"0.5249489... | 0.8355517 | 0 |
Check if the current page is debug enabled based on query parameters. | function isDebug(query) {
var parts = query.split(AMP), i = 0, pair, key;
// Clear up the question mark
parts[0] = parts[0].replace(Q, '');
while ((pair = parts[i++])) {
if (pair.indexOf(EQ) === -1) {
key = pair;
} else {
key = pair.split(EQ)[0];
}
if (key === ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isDebugModeEnabled() {\n return getenv_1.default.boolish('EXPO_WEB_DEBUG', false);\n}",
"function isDev() {\n // Legacy behavior.\n if (window.location.port === \"8000\") {\n return true;\n }\n if (!!window.location.search) {\n return !!window.location.search.substr(1).split... | [
"0.67610526",
"0.66460353",
"0.6645762",
"0.64301825",
"0.62545866",
"0.61648303",
"0.61558324",
"0.61553466",
"0.6077288",
"0.59480983",
"0.5915484",
"0.5915484",
"0.5915484",
"0.5915484",
"0.5915484",
"0.5915484",
"0.5915484",
"0.5915484",
"0.5915484",
"0.5915484",
"0.59154... | 0.68868035 | 0 |
Register a callback to listen for a particular event fired by an embed. | function listen(eventName, id, callback, bubbleError) {
// Create a placeholder Embeddable if there is an attempt to listen before the template or
// HTML is even rendered into the DOM
var embeddable = embeddables[id] || new Embeddable({ id: id }),
event = embeddable.events[eventName],
maxCo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function on(eventName, callback) {\n switch(eventName) {\n case \"connect\":\n document.addEventListener(\"__feedrConnect\", function(e) {\n callback(e.data);\n }, false);\n break;\n case \"\":\n break;\n ... | [
"0.6136903",
"0.59029853",
"0.57941276",
"0.571191",
"0.56484365",
"0.5618675",
"0.55778086",
"0.55725914",
"0.55725914",
"0.5565824",
"0.5554503",
"0.5554118",
"0.55030406",
"0.54961497",
"0.54933447",
"0.5492722",
"0.5491335",
"0.54882604",
"0.5482136",
"0.5456051",
"0.5435... | 0.65223765 | 0 |
Merge an Embeddable instance into an instance that derives from it (JsonEmbed, HtmlEmbed) | function mergeEmbeddable(embeddable, derivedEmbeddable) {
// Check if the embeddable is a sub-class of Embeddable or something else
if (embeddable.constructor !== Embeddable) {
// Can't operate on this
return;
}
for (var p in embeddable) {
if (embeddable.hasOwnProperty(p)) {
d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initEmbed(id, opts, Constructor) {\n var ret = { embed: embeddables[id], modified: false };\n\n if (!ret.embed) {\n embeddables[id] = ret.embed = new Constructor(opts);\n } else if (Constructor !== Embeddable && ret.embed.constructor === Embeddable) {\n ret.embed = new Constructor(opts)... | [
"0.6689348",
"0.6332391",
"0.6038717",
"0.5562345",
"0.5544582",
"0.5531806",
"0.54994",
"0.5455443",
"0.5433861",
"0.5402243",
"0.5353974",
"0.52390033",
"0.5232072",
"0.52308184",
"0.5199586",
"0.5139503",
"0.50012463",
"0.49969622",
"0.49584508",
"0.49458733",
"0.4943016",... | 0.714553 | 0 |
Base object for embeddable instances | function Embeddable(o) {
if (!o) return;
var self = this;
self.id = o.id;
self.events = {
before: {name: 'before', fired: false, listeners: [], called: []},
after: {name: 'after', fired: false, listeners: [], called: []},
custom: {name: 'custom', fired: false, listeners: [], called: ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initEmbed(id, opts, Constructor) {\n var ret = { embed: embeddables[id], modified: false };\n\n if (!ret.embed) {\n embeddables[id] = ret.embed = new Constructor(opts);\n } else if (Constructor !== Embeddable && ret.embed.constructor === Embeddable) {\n ret.embed = new Constructor(opts)... | [
"0.6119201",
"0.5708142",
"0.5690464",
"0.5688963",
"0.5643088",
"0.5634474",
"0.5559526",
"0.5525606",
"0.55093485",
"0.54589766",
"0.5455746",
"0.54542106",
"0.54378664",
"0.5356509",
"0.53545994",
"0.53279763",
"0.53197634",
"0.5308791",
"0.52462184",
"0.524348",
"0.523478... | 0.65787077 | 0 |
JsonEmbed abstraction (dust rendering) | function JsonEmbed(o) {
if (!o) return;
this.super_.call(this, o);
this.templateId = o.templateId;
this.context = o.context;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Embed(data) {\n /**\n * @field\n * @description the JSON object exactly as is returned in the \"data\" field of the JSON responses (see API documentation: https://developers.prismic.io/documentation/UjBe8bGIJ3EKtgBZ/api-documentation#json-responses)\n */\n return {\n '_type': 'Embed',\n '_da... | [
"0.6303668",
"0.5858507",
"0.5845537",
"0.5845537",
"0.5626199",
"0.5606781",
"0.55843306",
"0.5498707",
"0.54972464",
"0.5489332",
"0.54469705",
"0.5440845",
"0.5425923",
"0.53866535",
"0.53461605",
"0.5331637",
"0.53133845",
"0.530301",
"0.5274789",
"0.5269456",
"0.52661157... | 0.73594874 | 0 |
Returns new StackPanel with 1 height and width and aligned to center both vertically and horizontally | createPanel() {
this.panel = new BABYLON.GUI.StackPanel();
this.panel.isVertical = this.verticalPanel;
this.panel.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_CENTER;
this.panel.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_CENTER;
this.panel.width = 1;
this.panel.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"center() {\n this.centerHorizontally();\n this.centerVertically();\n\n return this;\n }",
"center() { \n function alignCenter(alignmentStack) {\n alignmentStack.addSpacer()\n let returnStack = alignmentStack.addStack()\n alignmentStack.addSpacer()\n return returnStack\n }\n ... | [
"0.59849846",
"0.59457767",
"0.5830355",
"0.5811306",
"0.57647187",
"0.56602305",
"0.5599753",
"0.55614007",
"0.5496557",
"0.5384574",
"0.53392756",
"0.53334934",
"0.5251155",
"0.518577",
"0.51829773",
"0.5167307",
"0.5162831",
"0.51580507",
"0.51431024",
"0.5133204",
"0.5111... | 0.7645062 | 0 |
Add control to the panel | addControl(control) {
this.panel.addControl(control);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createPanel (event, element) {\n if (element.querySelector('div.form-group.e40')) {\n return\n }\n\n element.prepend(this.panel.html())\n this.updateLabel()\n }",
"function lgm_addControls() {\n}",
"AddControl(/**@type {GUIControl}*/ control) {\n\n\t\tcontrol.ID = this._controls.l... | [
"0.68321115",
"0.65391856",
"0.6531325",
"0.63882416",
"0.63516605",
"0.62599206",
"0.62325096",
"0.62305903",
"0.62305903",
"0.62286085",
"0.6228061",
"0.61828876",
"0.61688983",
"0.614421",
"0.6131871",
"0.6117464",
"0.610261",
"0.6081513",
"0.60769033",
"0.6050321",
"0.603... | 0.8167344 | 0 |
Creates and returns a named InputText, registers this.inputFocus() as focus/blur listener | inputText(name, params) {
let input = new BABYLON.GUI.InputText(name);
input.widthInPixels = this.inputWidth;
input.heightInPixels = this.heightInPixels;
input.fontSizeInPixels = this.fontSize;
input.color = this.color;
input.background = this.background;
input.focusedBackground = this.back... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createInput()\n {\n this.input = createInput(this.text)\n this.input.position(this.x,this.y)\n }",
"function newInput(text) {\n\tvar frame = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\tvar rect = NSMakeRect(0, 0, 240, 24)\n\n\tvar input = NSTextField.alloc().initWithFrame... | [
"0.6683199",
"0.63979745",
"0.63252676",
"0.6323741",
"0.63105315",
"0.62864274",
"0.62652814",
"0.617478",
"0.6154405",
"0.61320287",
"0.5980267",
"0.5907148",
"0.5898547",
"0.5879903",
"0.58720475",
"0.58287084",
"0.5812239",
"0.57418925",
"0.57363504",
"0.57259756",
"0.569... | 0.6422947 | 1 |
Ceates and returns a named submit imageonly Button. | submitButton(name, callback, params) {
let button = new BABYLON.GUI.Button.CreateImageOnlyButton(name, VRSPACEUI.contentBase+"/content/icons/play.png");
button.widthInPixels = this.heightInPixels+10;
this.setupButton(button, callback, params);
return button;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addSubmitButton() {}",
"function findSubmitBtn(){\n\t\tvar tFormNameIn=null;\n\t\tif(typeof btnSubmit!==\"undefined\" && btnSubmit==null){\n\t\t\ttFormNameIn=getOne(\"elqFormName\");\n\t\t\tif(tFormNameIn!==null){ \n\t\t\t\tbtnSubmit=jQuery(tFormNameIn).closest(\"form\").find(\"input.submit-button\");\n\t\t\t\ti... | [
"0.6314603",
"0.62861353",
"0.62597454",
"0.61347026",
"0.60274553",
"0.59936315",
"0.59452873",
"0.5840416",
"0.57997406",
"0.57811",
"0.5780872",
"0.57742894",
"0.57719743",
"0.5738579",
"0.5717655",
"0.5679629",
"0.5663025",
"0.5646323",
"0.56264514",
"0.5613652",
"0.55749... | 0.71107733 | 0 |
Creates and returns button showing both text and image | textButton(name, callback, params) {
let button = new BABYLON.GUI.Button.CreateImageButton(name.toLowerCase(), name, VRSPACEUI.contentBase+"/content/icons/play.png");
button.widthInPixels = this.heightInPixels/2*name.length+10;
this.setupButton(button, callback, params);
return button;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_createButton() {\n const editor = this.editor;\n\n editor.ui.componentFactory.add('mediaImageTextAlternative', (locale) => {\n const command = editor.commands.get('mediaImageTextAlternative');\n const view = new ButtonView(locale);\n\n view.set({\n label: Drupal.t('Override media image... | [
"0.77044994",
"0.7241108",
"0.7219962",
"0.7175352",
"0.7114952",
"0.70905864",
"0.704027",
"0.7023314",
"0.70170724",
"0.6961036",
"0.6945551",
"0.69454724",
"0.691892",
"0.6852611",
"0.6816909",
"0.68064815",
"0.6800366",
"0.67857176",
"0.6781852",
"0.6780362",
"0.6766769",... | 0.77259123 | 0 |
Creates and returns a VirtualKeyboard, bound to given AdvancedDynamicTexture. A form can only have one keyboard, shared by all InputText elements. Currently selected InputText takes keyboard input. | keyboard(advancedTexture = this.texture) {
var keyboard = BABYLON.GUI.VirtualKeyboard.CreateDefaultLayout('form-keyboard');
keyboard.fontSizeInPixels = 36;
keyboard.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_BOTTOM;
if (this.keyboardRows) {
this.keyboardRows.forEach(row=>keyboard.a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"flipVertical() {\n return new Keyboard(this.characters[3], \n this.characters[2], \n this.characters[1], \n this.characters[0]);\n }",
"function KeyboardVG(input) {\r\n\tinitEvents(this);\r\n\tthis.bind( input );\r\n\tthis... | [
"0.53162044",
"0.51666385",
"0.5022562",
"0.49835566",
"0.48629123",
"0.48227748",
"0.48051465",
"0.47895858",
"0.47775528",
"0.47355944",
"0.47263163",
"0.47086245",
"0.4685951",
"0.4645813",
"0.46325308",
"0.4607774",
"0.4605384",
"0.45471972",
"0.45410538",
"0.4524867",
"0... | 0.7784793 | 0 |
Creates a plane and advanced dynamic texture to hold the panel and all controlls. At this point all UI elements should be created. TODO Form should estimate required texture width/height from elements | createPlane(size, textureWidth, textureHeight) {
this.planeSize = size;
this.plane = BABYLON.MeshBuilder.CreatePlane("FormPlane", {width: size*textureWidth/textureHeight, height: size});
this.texture = BABYLON.GUI.AdvancedDynamicTexture.CreateForMesh(this.plane,textureWidth,textureHeight);
// advancedTe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createPanel( pw, ph, director ){\n\t\tdashBG = new CAAT.Foundation.ActorContainer().\n\t\t\t\t\tsetPreferredSize( pw, ph ).\n\t\t\t\t\tsetBounds( 0, 0, pw, ph ).\n\t\t\t\t\tsetClip(false);\n\t\t\t\t\t\n\t\t__createBannerContainer();\n\t\t//create bottom panel\n\t\tfor(var i=0;i<dashBoardEle.length;i++){\n... | [
"0.64663595",
"0.6453969",
"0.64385927",
"0.6369924",
"0.6070559",
"0.60616606",
"0.6016024",
"0.594495",
"0.58372176",
"0.5795116",
"0.5783128",
"0.57831174",
"0.57460606",
"0.57058996",
"0.56779295",
"0.5666897",
"0.5662976",
"0.5653505",
"0.5641678",
"0.56336683",
"0.56212... | 0.6994539 | 0 |
Input delegate method used for gamepad input, or programatic control of the form. Sets currently active control. | setActiveControl(control) {
if ( this.activeControl && this.activeControl.getClassName() == "VirtualKeyboard") {
return;
}
this.activeControl = control;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"activateCurrent() {\n if ( this.activeControl ) {\n //console.log('activate '+this.activeControl.getClassName());\n if ( this.activeControl.getClassName() == \"Checkbox\") {\n this.activeControl.isChecked = !this.activeControl.isChecked;\n } else if ( this.activeControl.getClassName() == \... | [
"0.64761996",
"0.6073367",
"0.5968387",
"0.5902088",
"0.5845801",
"0.577826",
"0.577826",
"0.5719257",
"0.57024163",
"0.5673366",
"0.5612859",
"0.56119454",
"0.55842906",
"0.5576266",
"0.5551265",
"0.55510044",
"0.55159473",
"0.54970044",
"0.54578066",
"0.54487973",
"0.544539... | 0.69191015 | 0 |
Input delegate method used for gamepad input, or programatic control of the form. Activates currently selected control, equivalent to clicking/tapping it. E.g. (de)select a checkbox, press a button, etc. | activateCurrent() {
if ( this.activeControl ) {
//console.log('activate '+this.activeControl.getClassName());
if ( this.activeControl.getClassName() == "Checkbox") {
this.activeControl.isChecked = !this.activeControl.isChecked;
} else if ( this.activeControl.getClassName() == "Button") {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ACCcommand(value)\n{\n\tif (value) {$('.input').show();$('.input').focus();} else $('.input').hide();\n}",
"focus() {}",
"setActiveControl(control) {\n if ( this.activeControl && this.activeControl.getClassName() == \"VirtualKeyboard\") {\n return;\n }\n this.activeControl = control;\n ... | [
"0.6134315",
"0.60243237",
"0.5974403",
"0.5969708",
"0.5969708",
"0.5959871",
"0.5941865",
"0.5837978",
"0.5767602",
"0.57166284",
"0.5697934",
"0.56529385",
"0.56381744",
"0.5636922",
"0.5627494",
"0.56202453",
"0.56202453",
"0.5599753",
"0.55908567",
"0.5585277",
"0.557570... | 0.62452585 | 0 |
Internal virtual keyboard method, selects current row at given index | selectCurrent(index) {
if (this.activeControl) {
//console.log('select '+index+' '+this.getActiveControl().getClassName());
this.keyboardCol = index;
this.activeBackground = this.getActiveControl().background;
this.getActiveControl().background = this.selected;
if ( this.getActiveContr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onKeypress() {\n var index = this.rl.line.length ? Number(this.rl.line) - 1 : 0;\n\n if (this.opt.choices.getChoice(index)) {\n this.selected = index;\n } else {\n this.selected = undefined;\n }\n\n this.render();\n }",
"onKeypress() {\n var index = this.rl.line.length ? Number(this.... | [
"0.7172535",
"0.7172535",
"0.6988552",
"0.6921715",
"0.6608979",
"0.65000993",
"0.64723474",
"0.6454107",
"0.62896776",
"0.62790275",
"0.6264218",
"0.62446475",
"0.62311995",
"0.617997",
"0.6176095",
"0.61697197",
"0.6147722",
"0.61319745",
"0.6130337",
"0.6128581",
"0.610811... | 0.7179735 | 0 |
Deselects current control, i.e. changes the background color | unselectCurrent() {
if (this.activeControl) {
this.getActiveControl().background = this.activeBackground;
if ( this.getActiveControl().getClassName() == "InputText") {
this.inputFocused(this.activeControl,false);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deselect() {\n console.log(\"Beginning deselect\");\n // remove border or something?\n if (selected != null) {\n // remove CSS\n selected.children().removeAttr(\"stroke\");\n selected.children().removeAttr(\"stroke-width\")\n }\n\n select... | [
"0.7483238",
"0.7483238",
"0.72867155",
"0.7045211",
"0.69876605",
"0.69078434",
"0.6875564",
"0.6698628",
"0.66508996",
"0.6644245",
"0.6605133",
"0.65713745",
"0.6557141",
"0.65521085",
"0.6544299",
"0.6544299",
"0.64983565",
"0.645549",
"0.64275056",
"0.6380046",
"0.633244... | 0.7814826 | 0 |
Internal virtual keyboard method, keeps column index in range | adjustKeyboardColumn() {
if (this.keyboardCol >= this.vKeyboard.children[this.keyboardRow].children.length-1) {
this.keyboardCol = this.vKeyboard.children[this.keyboardRow].children.length-1;
}
this.selectCurrent(this.keyboardCol);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function keyPressed(){\r\n if(keyCode === RIGHT_ARROW){\r\n colNum++\r\n if(colNum > numberColumns -1){\r\n colNum =1;\r\n }\r\n }\r\n if(keyCode === LEFT_ARROW){\r\n colNum--\r\n if(colNum < 1){\r\n colNum = numberColumns -1;\r\... | [
"0.6710606",
"0.6573086",
"0.6269624",
"0.6253031",
"0.62144536",
"0.6175127",
"0.60976964",
"0.6093054",
"0.6035435",
"0.60308623",
"0.60229445",
"0.59834045",
"0.59473604",
"0.5922437",
"0.5915927",
"0.5842777",
"0.5837365",
"0.58341354",
"0.5819384",
"0.58070415",
"0.58038... | 0.7601007 | 0 |
Input delegate method used for gamepad input, or programatic control of the form. Processes up key: activate current element, or move up a row in virtual keyboard | up() {
if ( this.activeControl && this.activeControl.getClassName() == "VirtualKeyboard") {
this.unselectCurrent();
if ( this.keyboardRow > 0 ) {
this.keyboardRow--;
} else {
this.keyboardRow = this.vKeyboard.children.length-1;
}
this.adjustKeyboardColumn();
} else ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"keyInput(e) { /* 轉移至 this._keyInputHander 作為替代方案 */ }",
"function userInputKeyboard(event) {\n\tswitch(event.keyCode) {\n\t\tcase 38:\n\t\t\t// up key pressed\n\t playerMoveUp();\n\t event.preventDefault();\n\t\t\tbreak;\n\t\tcase 40:\n\t\t// down key pressed\n\t playerMoveDown();\n\t event.preventDefault();... | [
"0.7128557",
"0.68991655",
"0.6721252",
"0.67159617",
"0.6669485",
"0.6651547",
"0.6598742",
"0.6598405",
"0.6492687",
"0.64782286",
"0.6456617",
"0.6431081",
"0.64089626",
"0.64049095",
"0.64019316",
"0.6401422",
"0.639488",
"0.639488",
"0.639488",
"0.639488",
"0.639488",
... | 0.6994862 | 1 |
Input delegate method used for gamepad input, or programatic control of the form. Processes down key: move down a row in virtual keyboard | down() {
if ( this.activeControl && this.activeControl.getClassName() == "VirtualKeyboard") {
this.unselectCurrent();
if ( this.keyboardRow + 1 < this.vKeyboard.children.length ) {
this.keyboardRow++;
} else {
this.keyboardRow = 0;
}
this.adjustKeyboardColumn();
r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"keyInput(e) { /* 轉移至 this._keyInputHander 作為替代方案 */ }",
"keyDown(keyCode) {\n\n }",
"keyDown(keyCode) {\n\n }",
"handleInput(keyCode) {\n\t\tif (keyCode === 'left' && this.x >= colWidth) {\n\t\t\tthis.x -= colWidth;\n\t\t}\n\t\telse if (keyCode === 'up' && this.y > 0) {\n\t\t\tthis.y -= rowHeight;\n\t\... | [
"0.69558895",
"0.6821438",
"0.6821438",
"0.6812375",
"0.67563283",
"0.67122984",
"0.668123",
"0.6678614",
"0.66779834",
"0.6546571",
"0.6495756",
"0.64936465",
"0.64761835",
"0.6462171",
"0.64545465",
"0.64389944",
"0.64321214",
"0.6431645",
"0.642641",
"0.6420104",
"0.641736... | 0.69823295 | 0 |
set child nodes checkbox status | function TV2_SetChildNodesCheckStatus(node,isChecked)
{
var childNodes = TV2i_GetChildNodesDiv(node);
if(childNodes == null)
return;
var inputs = WebForm_GetElementsByTagName(childNodes,"INPUT");
if(inputs == null || inputs.length == 0)
return;
for(var i = 0; i < inputs.len... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setCheckAllChildrenAction(checkbox)\n{\n $(checkbox).on('change', function()\n {\n // get status\n var status = this.checked;\n\n // get parent node, it maybe is label element\n var parent = this.parentNode;\n if (parent.nodeName.toLowerCase() === \"label\")\n ... | [
"0.71212184",
"0.6920116",
"0.6702443",
"0.66652685",
"0.65557086",
"0.6535056",
"0.6489519",
"0.6347363",
"0.63164353",
"0.6259156",
"0.6259156",
"0.6259156",
"0.6259156",
"0.6259156",
"0.62388086",
"0.6229377",
"0.61987597",
"0.61854595",
"0.61714387",
"0.6085975",
"0.60130... | 0.7764485 | 0 |
change parent node checkbox status after child node changed | function TV2_NodeOnChildNodeCheckedChanged(tree,node,isChecked)
{
if(node == null)
return;
var childNodes = TV2_GetChildNodes(tree,node);
if(childNodes == null || childNodes.length == 0)
return;
var isAllSame = true;
for(var i = 0; i < childNodes.length; ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateParentCheckbox(list_item) {\n\n\t//Get this list-item's checkbox element\n\tvar checkbox = list_item.children('input[type=\"checkbox\"]:first');\n\n\t//Obtain direct children\n\tvar child_items = list_item.children('ul').children('li')\n\tvar children = child_items.children('label').children('input[... | [
"0.72089237",
"0.7068971",
"0.699554",
"0.67995125",
"0.67754936",
"0.6684031",
"0.6684031",
"0.6684031",
"0.6684031",
"0.6684031",
"0.664386",
"0.659036",
"0.6550667",
"0.654728",
"0.6477287",
"0.6450723",
"0.6413074",
"0.6406396",
"0.6393924",
"0.6385136",
"0.635031",
"0.... | 0.732758 | 0 |
private mothods, with TV2i_ prefix //////////////////////////////////////////////////////////////////////////////////////////// get div contains child nodes | function TV2i_GetChildNodesDiv(node)
{
if(TV2_NodeIsLeaf(node))
return null;
var childNodsDivId = node.id + "Nodes";
return document.getElementById( childNodsDivId );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get childNodes() {\n return Array.from(this._el.childNodes, (node) => {\n return node instanceof Text ? node : $(node);\n });\n }",
"getDivLike(shadowRoot) {\n\n /**********************Pure Function**************************/\n\n const pure = compose(nth(1),\n ... | [
"0.6542223",
"0.6351999",
"0.61417365",
"0.6052227",
"0.5990381",
"0.59638643",
"0.595488",
"0.5942715",
"0.5912703",
"0.58770937",
"0.585374",
"0.5840842",
"0.5830233",
"0.5827674",
"0.58071214",
"0.57813114",
"0.57805234",
"0.5758812",
"0.5749641",
"0.5730676",
"0.57143086"... | 0.6802357 | 0 |
get checkbox of node | function TV2i_NodeGetCheckBox(node)
{
if(IsCheckBox(node))
return node;
var id = node.id + "CheckBox";
return document.getElementById(id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getCheckbox () {\n const el = this.getFormInputField('checkbox')\n return el\n }",
"getNativeElement() {\n return this.checkbox;\n }",
"isChecked(node) {\n let uuid = node.uuid;\n let selected = false;\n this.state.selectedSections.forEach(section => {\n if (section.uuid == uuid)... | [
"0.7278328",
"0.7121588",
"0.6790252",
"0.6343333",
"0.6309931",
"0.6246054",
"0.6236619",
"0.61726844",
"0.6166635",
"0.6120633",
"0.6088217",
"0.60595554",
"0.6052017",
"0.604265",
"0.60097826",
"0.60097826",
"0.60097826",
"0.60097826",
"0.60097826",
"0.60097826",
"0.595678... | 0.8150007 | 0 |
FIN LISTA DE Clientes /CREAR NUEVO | function crearNuevo(){
let inputsValues = collectInputs(obtenerInputsIds());
if(nonEmptyFields([inputsValues[0],inputsValues[1]])){
let entidad = Entidad.fromArray(inputsValues);
entidad.setTipo(Entidad.CLIENTE);
guardarEntidad(entidad);
mostrarListaClientes();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"limpiarDatosCliente()\n {\n this.razon_social = '';\n this.nombre = '';\n this.apellido = '';\n this.telefono = '';\n this.correo_electronico = '';\n }",
"getLista() {\n // retorno la lista de clientes conectados excepto los que no tiene... | [
"0.69822204",
"0.69740313",
"0.69524443",
"0.69243544",
"0.6845212",
"0.67942035",
"0.67845553",
"0.6768211",
"0.675559",
"0.67126393",
"0.6652965",
"0.6646819",
"0.6535067",
"0.6492794",
"0.64643705",
"0.64531076",
"0.64511657",
"0.64467895",
"0.64467895",
"0.6431617",
"0.63... | 0.7035438 | 0 |
Displays the missing ingredient and the possible substitutions iterating over each question | function askTheQuestion () {
//displays the missing ingredient and the question
$('.questionNumber').append('Question ' + (currentQuestion+1) + ' of ' + quizArray.length);
$('.missingIngredient').append('Which of the following would be a good substitute for ' + quizArray[currentQuestion].missingIngredient + '?');... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function display () {\n if (qnNumber < 10) {\n i = Math.floor(Math.random() * allQns.length)\n question.textContent = allQns[i].question\n question.innerHTML = allQns[i].question\n\n for (var j = 0; j < 4; j++) {\n choice0.textContent = allQns[i].choices[0]\n choice1.textConten... | [
"0.65657496",
"0.6251871",
"0.62231517",
"0.61696434",
"0.6149698",
"0.6134189",
"0.61135817",
"0.60987836",
"0.6098326",
"0.60806304",
"0.603212",
"0.5954218",
"0.5951744",
"0.59392464",
"0.59324133",
"0.5915321",
"0.5909518",
"0.5909299",
"0.58932036",
"0.58717084",
"0.5865... | 0.66020656 | 0 |
floor(log(n) / log(b)), n >= 1, base >= 2 | function ilogb(n, base) {
var i = BigInteger.BigInt(0);
while (!BigInteger.lessThan(n, BigInteger.exponentiate(base, BigInteger.exponentiate(BigInteger.BigInt(2), i)))) {
i = BigInteger.add(i, BigInteger.BigInt(1));
}
var e = BigInteger.BigInt(0);
var t = BigInteger.BigInt(1);
while (!BigInteger.lessTha... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bLog(value, base) {\n if(base == null) base = 2;\n return Math.log(value) / Math.log(base);\n }",
"function calcBinLog(number){\n console.log(Math.log2(number)); \n}",
"function ceil_log2(a)\n{\n return floor_log2(a - 1n) + 1n;\n}",
"function floor_log2(a)\n{\n var k_max, a1, k, i... | [
"0.7785167",
"0.77129924",
"0.76965696",
"0.7556227",
"0.7370922",
"0.725906",
"0.7127949",
"0.71068734",
"0.6965354",
"0.6965354",
"0.69345134",
"0.6909432",
"0.69080216",
"0.69080216",
"0.69080216",
"0.69080216",
"0.69080216",
"0.69080216",
"0.69080216",
"0.69080216",
"0.69... | 0.79795814 | 0 |
Polynomial([a0, a1, a2, ...., an]); anx^n+ an1 x ^n1 +... + a0 | function Polynomial(a) {
this.a = a;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function poly(x, a) {\n var l = a.length,\n p = a[l - 1],\n i = l - 2;\n while (i >= 0) {\n p = p * x + a[i];\n --i;\n }\n return p;\n}",
"function poly(a, b, c, x){ return Math.pow(x, 2) * a + x * b + c}",
"function poly(a, b, c, x){ return Math.pow(x, 2) * a + x * b + c}",
"function poly() ... | [
"0.7523283",
"0.7263727",
"0.7263727",
"0.71519077",
"0.7106109",
"0.7000077",
"0.6878229",
"0.66672283",
"0.66303265",
"0.662535",
"0.64499426",
"0.64176184",
"0.639926",
"0.6354435",
"0.63526726",
"0.63286227",
"0.6260774",
"0.6230928",
"0.59927714",
"0.59653383",
"0.592292... | 0.7606215 | 0 |
C is the class to be returned. It delegates to instantiating an instance of `Bare`, so that it will always return a new instance regardless of the calling context. TODO: the Chrome inspector shows all created objects as `C` rather than `Object`. Setting the .name property seems to have no effect. Is there a way to over... | function C() {
var self = new Bare;
if (isFunction(self.init)) self.init.apply(self, arguments);
return self;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function create2(c) {\n return new c();\n}",
"function create(c) {\n return new c();\n}",
"function BareConstructor() {}",
"function createNewBrick(){\n var newEl = new Brick();\n return newEl;\n}",
"function Bare() {}",
"function Bare() {}",
"function SuperclassBare() {}",
"function chea... | [
"0.64562345",
"0.6421902",
"0.639736",
"0.6370398",
"0.6029222",
"0.6029222",
"0.59398615",
"0.59115434",
"0.58214915",
"0.5646196",
"0.5632856",
"0.5600775",
"0.5587977",
"0.5585369",
"0.55842316",
"0.5547689",
"0.55346215",
"0.5458085",
"0.54560184",
"0.5421717",
"0.541987"... | 0.663596 | 1 |
C.Bare is a class with a noop constructor. Its prototype is the same as C, so that instances of C.Bare are also instances of C. New objects can be allocated without initialization by calling `new MyClass.Bare`. | function Bare() {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function BareConstructor() {}",
"function C() {\n var self = new Bare;\n if (isFunction(self.init)) self.init.apply(self, arguments);\n return self;\n }",
"function C() {\n var self = new Bare;\n if (isFunction(self.init)) self.init.apply(self, arguments);\n return self;\n }... | [
"0.7530669",
"0.7435786",
"0.7435786",
"0.66639256",
"0.60950416",
"0.5654836",
"0.5517715",
"0.5449727",
"0.53128666",
"0.5294129",
"0.5115231",
"0.50976473",
"0.5097382",
"0.5042925",
"0.50228393",
"0.50228393",
"0.49929827",
"0.49929827",
"0.49634472",
"0.49557334",
"0.492... | 0.77460545 | 1 |
mask toggle none and block | function mask() {
var mask = $('.mask');
if (ModalBox.loginModalStatus || ModalBox.registerModalStatus || ModalBox.stuInfoStatus || ModalBox.exampleStatus || ModalBox.addmacStatus || ModalBox.saveStatus || ModalBox.projectStatus) {
mask.css({ 'display': 'block' });
} else {
mask.css({ 'display': 'non... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setUIControlfromMask( ctrl, mask ) {\n\t\t\t\tif( mask === 1 )\n\t\t\t\t\tctrl.show();\n\t\t\t\telse\n\t\t\t\t\tctrl.hide();\n\t\t\t}",
"function mask() {\n \tctx.clip();\n }",
"mask(value) {\n this.output.setGrayscale(value & 0x1);\n this.output.setIntensity(value ... | [
"0.6429901",
"0.63390875",
"0.63153225",
"0.6153379",
"0.61478454",
"0.6143154",
"0.58801854",
"0.5879215",
"0.5809812",
"0.5791476",
"0.57630515",
"0.56318665",
"0.5618473",
"0.56157976",
"0.56148374",
"0.5603609",
"0.5603609",
"0.5603609",
"0.5603609",
"0.5596602",
"0.55350... | 0.65032643 | 0 |
username > [read_key, ...] | function userReadKeys(username, cont, contfail) {
// the read keys for each secret key we have.
// then just return those lists.
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function usernameCallback(username) {\n\t\tuserCredentials.username = username;\n\t\t// Get the devicename next\n\t\tstore.getItem(\"devicename\", devicenameCallback);\n\t}",
"function getKey (ctx, username) {\n\t username = normalize(username)\n\n\t // Extract stuff from storage:\n\t var userStorage = new Us... | [
"0.6024559",
"0.5936496",
"0.5909346",
"0.58658177",
"0.57378244",
"0.57168",
"0.571424",
"0.55900466",
"0.555665",
"0.55415726",
"0.5512404",
"0.5510479",
"0.55101854",
"0.5423865",
"0.5423865",
"0.54019475",
"0.5394469",
"0.5385848",
"0.5377121",
"0.532344",
"0.5322849",
... | 0.65895724 | 0 |
returns all the user's fingerprints, less their own. username > [fingerprint, ...] | function userFingerprints(username, cont, contfail) {
// pubkey_alias holds a list of the user's 32bit keyids
// first, we need to fix so that it holds the full 160bit fingerprint:
// 899367D2 A6A5C175 3D724EEC 65280579 59DE2B30
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"knownFingerprints(forAccount) {\n let fps = [];\n for (\n let context = this.userstate.contents.context_root;\n !context.isNull();\n context = context.contents.next\n ) {\n // skip child contexts\n if (!comparePointers(context.contents.m_context, context)) {\n continue;\n ... | [
"0.65945226",
"0.5729988",
"0.55991524",
"0.54461837",
"0.5443853",
"0.5379544",
"0.535427",
"0.53540397",
"0.53436637",
"0.5338769",
"0.53343844",
"0.532028",
"0.5316388",
"0.5294479",
"0.5290166",
"0.52764726",
"0.52755874",
"0.52629495",
"0.5247418",
"0.5201721",
"0.519339... | 0.7464507 | 0 |
for the currently logged in user, we would like to loop through their peers, redownloading all of the hashes of content that person has ever potentially signed. These posts are cached locally as user > [content, ...] FIXME: This could get into trouble if two users fetch content for the same key at once. Make the latter... | function refreshPeerContent(params, username, cont, failed) {
var waiting = 3, aborted = false, cs = null, ks = null, cscs, kscs, dwaiting = 0;
// TODO: at a minimum let the ui-server admin supply a list of 1
// or more data service URLs, fetching from all of them
var sources = [{ proto: 'https:', host:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDataPosts(params, cont) {\n var hash = null;\n var waiting = 0, username;\n\n function problem(err) {\n sendResponse(params, 500, 'There was a problem');\n }\n\n function sendFinal(result) {\n cont(params, hash, result);\n }\n\n // Note: selecting parent=NULL won't ca... | [
"0.62346447",
"0.5777155",
"0.56504667",
"0.5517796",
"0.55103594",
"0.54741806",
"0.54263496",
"0.53924036",
"0.5383221",
"0.53586924",
"0.5253787",
"0.52527094",
"0.5244426",
"0.52219903",
"0.5192618",
"0.51758415",
"0.5095334",
"0.50431013",
"0.49731103",
"0.49694437",
"0.... | 0.7390716 | 0 |
This should attempt the steps of postPost in reverse. Start trying to decrypt message using private key, then using one of the shared secrets, finally try to verify. In case of combined encryption and signature, empty content is taken to mean "decryption failed", and content with >0 status code to mean "verification fa... | function getDecrypt(params, data, cont) {
var gpgDir, ch = '', isPubEnc = false, isSymEnc = null, hasPubKey = null, gotPubDec = null,
keys, key, gpg, gpgStatus, decData, sigRes = '', partial = data, symKeyIdentifier = null, symKeyPkey = null,
symKeyReadToken = null, signkeyId = null, sigfinger = null, usern... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function postPostInner(params, useSign, toSymKey, toPubKey, thePost, cont, fail) {\n var hasSign = false, hasGroup = false, hasPrivate = false;\n var keyid = null, gpgDir = null, writeToken;\n var cipher, shasum, username, enc = '', digest;\n\n function postFinished(params, result) {\n if (!resu... | [
"0.5703611",
"0.5128367",
"0.49152127",
"0.48534676",
"0.47937217",
"0.47937217",
"0.47937217",
"0.47937217",
"0.47937217",
"0.47937217",
"0.47937217",
"0.47937217",
"0.47937217",
"0.47937217",
"0.4767397",
"0.47576624",
"0.47523072",
"0.47275412",
"0.47271392",
"0.4706321",
... | 0.54928964 | 1 |
This returns the list of posts with at least one upvote signed by someone in our network. Currently it uses looks for 'parent' hash on all keys. Would like to allow limiting to a subset of keys, or a single key. (network files serve this purpose) If I'm having a conversation with someone using our public keys, we will ... | function getDataPosts(params, cont) {
var hash = null;
var waiting = 0, username;
function problem(err) {
sendResponse(params, 500, 'There was a problem');
}
function sendFinal(result) {
cont(params, hash, result);
}
// Note: selecting parent=NULL won't catch replies to co... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function selectPosts() {\n // FIXME: check that if it's pubkey we're in the recipients\n // list, and if it's group key we have the group key.\n var query = 'SELECT s.sha256 FROM nodes AS n, sha256 AS s WHERE n.parent=(SELECT pkey FROM sha256 WHERE sha256=$2) AND n.tag=1 AND (((n.signkey IN (S... | [
"0.5918399",
"0.57713234",
"0.5732789",
"0.54070073",
"0.5285392",
"0.52050245",
"0.5129213",
"0.50337",
"0.5015665",
"0.4968647",
"0.49405545",
"0.49080992",
"0.48815128",
"0.48740137",
"0.48608455",
"0.48549777",
"0.48443055",
"0.48104075",
"0.47876537",
"0.4766826",
"0.466... | 0.63779426 | 0 |
Synaps Fav Icon Svg | function SvgSynapsFavicon( { background = "#4CB69F", fill = "white", width = "200px", height = "200px", ...props } ){
return (
<svg
viewBox="0 0 58 46"
fill="#1890ff"
width={ width }
height={ height }
{ ...props }
>
<path
d="M28.521 40.845c9.62 0 17.42-7.776 17.42-1... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function svg() {\n return gulp\n .src([`${source_folder}/iconsrite/*.svg`])\n .pipe(plumber())\n .pipe(\n svgsprite({\n mode: {\n stack: {\n sprite: '../icons/icons.svg', //sprite file name\n },\n },\n })\n )\n .pipe(dest(path.build.img));\n}",
... | [
"0.60743695",
"0.59625673",
"0.5948771",
"0.5917792",
"0.5909367",
"0.5882252",
"0.585585",
"0.58206433",
"0.58206433",
"0.5820364",
"0.58055997",
"0.5782814",
"0.5759714",
"0.57535547",
"0.5719321",
"0.5719321",
"0.5714837",
"0.5714403",
"0.5711213",
"0.56979114",
"0.5689708... | 0.718216 | 0 |
Color. 3 points. Write a function that draws a rectangle on the canvas. By default, the rectangle will have a height and width of 50px and 100px, respectively. It will be positioned at [10, 10] on the canvas. You'll need to prompt the user to enter a color for the rectangle. Support the following colors: black blue gre... | function drawColoredRectangle() {
let op = document.getElementById("canvas3").getContext("2d");
let color = String(prompt("Color:"));
if (color == "black" || color == "blue" || color =="green" || color == "orange" || color == "purple" || color == "red" || color == "yellow"){
op.fillStyle = color;
op.fillR... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawColoredRectangle() {\n let canvas3 = document.getElementById('canvas3');\n let ctx = canvas3.getContext('2d');\n ctx.clearRect(0, 0, canvas3.width, canvas3.height);\n let canvasDrawing = false\n userColor = prompt(\"Enter a color.\");\n\n if (userColor == \"black\" || userColor == \"blue\" || us... | [
"0.8256868",
"0.8036173",
"0.80124235",
"0.80046993",
"0.79422814",
"0.77078813",
"0.769743",
"0.76537883",
"0.7561238",
"0.7550349",
"0.75193125",
"0.7477436",
"0.74725956",
"0.7380053",
"0.73563486",
"0.7356108",
"0.7329387",
"0.7328228",
"0.73120034",
"0.7309412",
"0.72658... | 0.83471334 | 0 |
Smile. 7 points. Write a function that draws a smiley face on the canvas. The head should be a perfect circle with a radius specified by the user. The eyes should also be perfect circles with radii that are 10% of that of the head. The radius of the mouth should be 70% of that of the head. A nose is not required, and t... | function drawSmileyFace() {
let radius;
let canvas = document.getElementById('canvas5');
let ctx = canvas.getContext('2d');
ctx.clearRect(0, 0, canvas.width, canvas.height);
while(true){
radius=Number(prompt("Please enter a good radius please"));
if(radius>=1 && radius<=canvas.width && Number.isInteger(rad... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawSmileyFace() {\n let canvas5= document.getElementById('canvas5').getContext('2d');\n canvas5.clearRect(0, 0, canvas5.width, canvas5.height);\n\n let userRadius = Number(prompt(`Enter a radius`));\n let canvasDrawing = false\n let eyesRadius=userRadius*0.1\n let mouthRadius=userRadius*0.7\n\n if... | [
"0.7883324",
"0.7855821",
"0.7800427",
"0.76450014",
"0.72616035",
"0.71446395",
"0.69489485",
"0.69168293",
"0.6356296",
"0.6323051",
"0.6261076",
"0.61407447",
"0.6080255",
"0.60523254",
"0.6041182",
"0.60245526",
"0.5974939",
"0.5936617",
"0.57558095",
"0.5703047",
"0.5688... | 0.78828186 | 1 |
Stop Sign. 7 points. Write a function that draws a stop sign. The stop sign should be outlined in black, but filled red. At the center of the stop sign, the same height as the length of the sides, should be the word STOP (all capitals, white). Each side length should be 80px. You'll need to use the appropriate Canvas A... | function drawStopSign() {
let stopSign = document.getElementById("canvas7").getContext("2d");
stopSign.clearRect(0, 0, canvas7.height, canvas7.width)
let side = 80;
let c = Number((80/Math.sqrt(2)).toFixed(0));
let stopX = 70;
let stopY = 10;
stopSign.beginPath();
stopSign.moveTo(stopX,stopY);
stopSi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawStopSign() {\n\n let drawStopSign = document.getElementById('canvas7');\n let context = drawStopSign.getContext('2d');\n context.clearRect (0, 0, drawStopSign.width, drawStopSign.height);\n\n //defining variables\n let sideLength = 80;\n let stopLocation = Number((80/Math.sqrt(2)).toFixed(0));\n... | [
"0.8755587",
"0.8705913",
"0.8563993",
"0.83225805",
"0.6893038",
"0.668158",
"0.640946",
"0.6025802",
"0.58146703",
"0.58101606",
"0.57504964",
"0.57267267",
"0.5636702",
"0.55875856",
"0.55804336",
"0.557277",
"0.55462825",
"0.5536574",
"0.5529887",
"0.5513488",
"0.548857",... | 0.8804165 | 0 |
iter over the athena report... | function parse_athena_report() {
for (let region in athena_report) {
console.log('working athena region', region);
for (let siid in athena_report[region]) {
if (!report[region]) { // init region
report[region] = {
siid_comp_errs: {},
siids_missing_in_deployer: [],
siids_missing_in... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function exec() {\n //Create a report\n var report = Banana.Report.newReport('Report title');\n\n //Step 1 - table access\n var accountsTable = Banana.document.table('Accounts');\n\n //Step 2 - loop on each row of the table, instead of specifying a single row\n for (var rowNumber = 0; rowNumber <... | [
"0.6059146",
"0.60568744",
"0.58031374",
"0.5791014",
"0.5730598",
"0.5692361",
"0.56296414",
"0.5627425",
"0.5622632",
"0.5614369",
"0.55347836",
"0.5507679",
"0.54965025",
"0.5492204",
"0.5485019",
"0.54743975",
"0.54600537",
"0.54586715",
"0.54542714",
"0.5454145",
"0.5443... | 0.6631905 | 0 |
find the siid in the deployer report | function find_siid_in_dep_region(region, siid) {
const dep_siid = convert_siid(siid);
if (dep_reports[region] && dep_reports[region][dep_siid]) {
return dep_reports[region][dep_siid];
} else {
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parse_deployer_reports() {\n\tfor (let region in dep_reports) {\n\t\tconsole.log('working deployer region', region);\n\t\tfor (let siid in dep_reports[region]) {\n\t\t\tconst athena_siid = siid.replace(/-/g, '');\t\t\t\t\t\t\t// convert to athena's siid\n\n\t\t\tif (!report[region]) {\t\t\t\t\t\t\t\t\t\t\... | [
"0.6091449",
"0.5887951",
"0.5678776",
"0.5592468",
"0.55321485",
"0.5274347",
"0.5069142",
"0.5020154",
"0.49432722",
"0.49096048",
"0.4889457",
"0.48722035",
"0.48612472",
"0.4856998",
"0.4856998",
"0.48516652",
"0.48451504",
"0.48444435",
"0.482824",
"0.47693214",
"0.47613... | 0.6259348 | 0 |
find the component for this siid in the deployer report | function found_component_in_dep_siid(deployers_siid_section, dep_component_id) {
for (let i in deployers_siid_section) {
const comp = deployers_siid_section[i];
if (comp.status === 'created' && comp.name === dep_component_id) {
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getComponentById(id) {\n return this.componentMapping.get(id);\n }",
"getComponent(klass, baseName) {\n const component = _.find(this.components, (c) => {\n return (c instanceof klass) && c.baseName == baseName;\n })\n return component;\n }",
"function found_component_in_athena... | [
"0.6107078",
"0.59573776",
"0.56686527",
"0.56641376",
"0.56046444",
"0.55857635",
"0.5535555",
"0.55167484",
"0.5496297",
"0.5452766",
"0.53080016",
"0.52942926",
"0.52767134",
"0.5230696",
"0.52053577",
"0.52052706",
"0.51989275",
"0.5184157",
"0.5177316",
"0.51416",
"0.511... | 0.6690566 | 0 |
iter over the deployer reports... | function parse_deployer_reports() {
for (let region in dep_reports) {
console.log('working deployer region', region);
for (let siid in dep_reports[region]) {
const athena_siid = siid.replace(/-/g, ''); // convert to athena's siid
if (!report[region]) { // init region
report[region] = {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function RunReports() {\n endDate = new Date(); //Today midnight\n endDate.setHours(0,0,0,0);\n startDate = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate() - 1); //1 day ago midnight\n //Log(startDate + ' - ' + endDate);\n\n try {\n\t\tLog('Requesting inventory report...');\n\t\treports.... | [
"0.6149547",
"0.5653589",
"0.5483261",
"0.5464686",
"0.54624707",
"0.5398862",
"0.53652245",
"0.53513306",
"0.5350726",
"0.534695",
"0.53214127",
"0.5283954",
"0.5272845",
"0.52224547",
"0.5207517",
"0.52043927",
"0.5178909",
"0.5167366",
"0.51575583",
"0.50980794",
"0.509489... | 0.7386997 | 0 |
find the siid in the athena report | function find_siid_in_athena_region(region, athena_siid) {
if (athena_report[region] && athena_report[region][athena_siid]) {
return athena_report[region][athena_siid];
} else {
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function find_siid_in_dep_region(region, siid) {\n\tconst dep_siid = convert_siid(siid);\n\tif (dep_reports[region] && dep_reports[region][dep_siid]) {\n\t\treturn dep_reports[region][dep_siid];\n\t} else {\n\t\treturn null;\n\t}\n}",
"function parse_athena_report() {\n\tfor (let region in athena_report) {\n\t\t... | [
"0.57372725",
"0.561515",
"0.54368657",
"0.5422588",
"0.54188883",
"0.5337947",
"0.5305547",
"0.5272382",
"0.52498144",
"0.5206157",
"0.5201559",
"0.5183588",
"0.5181579",
"0.51675045",
"0.5126462",
"0.51168287",
"0.51138043",
"0.51135236",
"0.5112841",
"0.51070714",
"0.50848... | 0.6948656 | 0 |
find the component for this siid in the athena report | function found_component_in_athena_siid(athenas_siid_section, dep_component_id) {
for (let i in athenas_siid_section) {
const comp = athenas_siid_section[i];
if (comp.imported !== true && comp.name === dep_component_id) {
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getComponentById(id) {\n return this.componentMapping.get(id);\n }",
"function found_component_in_dep_siid(deployers_siid_section, dep_component_id) {\n\tfor (let i in deployers_siid_section) {\n\t\tconst comp = deployers_siid_section[i];\n\t\tif (comp.status === 'created' && comp.name === dep_... | [
"0.6116299",
"0.58575463",
"0.54626256",
"0.54369706",
"0.54148966",
"0.5342471",
"0.53300285",
"0.53087234",
"0.5277243",
"0.5277076",
"0.5262607",
"0.52211714",
"0.5200692",
"0.5198573",
"0.5197451",
"0.5179437",
"0.51608306",
"0.5122037",
"0.51185983",
"0.51121306",
"0.510... | 0.6127655 | 0 |
edit the report to only have siids with missing components | function only_comp_errors_in_report(the_report) {
for (let region in the_report) {
if (region === 'summary') {
continue;
}
for (let siid in the_report[region].siid_comp_errs) {
if (the_report[region].siid_comp_errs[siid]) {
// if no errors, delete siid's record in report
if (!the_report[region].si... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resetReportElements() {\n\n $.each(speciesElements, function(sp_ind, sp_val) {\n\n var hiddenSightingsElements = $(\"#\" + sp_val.id).find(\"[style*='display: none']\");\n\n // make any hidden species elements visible\n sp_val.style.display = \"\";\n\n // make any hidden sightings elements vi... | [
"0.5608016",
"0.5484194",
"0.54030097",
"0.53695005",
"0.53600013",
"0.53600013",
"0.51698095",
"0.5151965",
"0.5144307",
"0.5101738",
"0.5095056",
"0.50768256",
"0.5049205",
"0.5024546",
"0.5010366",
"0.49903142",
"0.49710217",
"0.4931375",
"0.49266112",
"0.49249145",
"0.491... | 0.5971712 | 0 |
transforma decimal em moeda n = numero a converter c = numero de casas decimais d = separador decimal t = separador milhar | function numeroParaMoeda(n, c, d, t)
{
c = isNaN(c = Math.abs(c)) ? 2 : c, d = d === undefined ? "," : d, t = t === undefined ? "." : t, s = n < 0 ? "-" : "", i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0;
return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function NumeroFormato(numero) {\n\t//propiedades\n\tthis.valor = numero || 0;\n\tthis.dec = -1;\n\t\n\t//metodos\n\tthis.formato = numFormat;\n\tthis.ponValor = ponValor;\n\t\n\tfunction ponValor(cad) {\n\t\tif (cad == \"-\" || cad == \"+\")\n\t\t\treturn\n\t\tif (cad.length == 0)\n\t\t\treturn\n\t\tif (cad.index... | [
"0.7125991",
"0.69639164",
"0.69236386",
"0.6806194",
"0.6743902",
"0.6734207",
"0.6671772",
"0.6669528",
"0.6596786",
"0.6570926",
"0.6570283",
"0.64936054",
"0.6475015",
"0.6469979",
"0.6399024",
"0.6394728",
"0.6382544",
"0.6360049",
"0.63545144",
"0.6321961",
"0.63215184"... | 0.8011265 | 0 |
changeTime Changes time style, whether to 24 hour cycle or 12 hour cycle | function changeTime() {
militaryTime = !militaryTime;
timeNow(militaryTime);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _changeTime() {\n\t\t\tvar _today=new Date();\n\t\t\tvar _todayy=_today.getYear();\n\t\t\tif (_todayy < 1000)\n\t\t\t_todayy+=1900;\n\t\t\tvar _todaym=_today.getMonth();\n\t\t\tvar _todayd=_today.getDate();\n\t\t\tvar _todayh=_today.getHours();\n\t\t\tvar _todaymin=_today.getMinutes();\n\t\t\tvar _todayse... | [
"0.7232043",
"0.71469384",
"0.6910426",
"0.6903344",
"0.6876801",
"0.68171775",
"0.67862403",
"0.66733384",
"0.65909874",
"0.65652966",
"0.6521238",
"0.6497696",
"0.645899",
"0.6436244",
"0.64344454",
"0.6412997",
"0.63939506",
"0.6390126",
"0.63581276",
"0.6349436",
"0.63444... | 0.7440132 | 0 |
\ ||:: >> Validate Telephone Number Inputted By User << :: || || returns boolean validated: true if valid, false (default) || use DOM to get the value inputted by user || strip out all non digits || check against regexp: must be 10 digits || alert the user and abort submission if invalid || \ | function validateTely(){
var validated = false;
var tely = document.getElementById('telephone').value;
tely = tely.replace(/\D/g,'');
var telypattern = /\d{10,}/g;
if (tely.match(telypattern))
{
validated = true;
}
else
{
alert("Phone Number must be valid 10 digit phone number");
}
return validated;... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isValidTelephone(textField){\n var number = trim(textField.value);\n return /^\\d{9}$/.test(number) || /^\\+?\\d{3}\\s?\\d{8}$/.test(number) \n}",
"function validateMobileNumber() {\n\tvar enteredMobileNumber = document.getElementById(\"mobileNumber\").value;\n\tvar regexMobileNumber = /[6-9][0-9]{9}/... | [
"0.7904444",
"0.76573735",
"0.7606463",
"0.75232315",
"0.7518339",
"0.74714494",
"0.7461049",
"0.7428683",
"0.7414556",
"0.7403249",
"0.7402569",
"0.7332856",
"0.73272073",
"0.7307186",
"0.73014957",
"0.7285418",
"0.7254383",
"0.72333205",
"0.7229215",
"0.7229215",
"0.7224402... | 0.7877457 | 1 |
function to get one of the links from the array supplied randomly usage: getRandomLink([" will return the string containing one of the urls that were supplied to it | function getRandomLink(randomArray) {
var item = randomArray[Math.floor(Math.random()*randomArray.length)];
return item; // The function returns the product of p1 and p2
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function gotoRandom() {\n popularityContest.getRandom()\n .done(function (data) {\n goto(data.url);\n })\n .fail(function () {\n notify('Unsuccessful', 'Sorry, there was a problem loading a link.');\n });\n }",
"function generate... | [
"0.65852743",
"0.65295976",
"0.64611965",
"0.64408755",
"0.6289099",
"0.6269718",
"0.6261486",
"0.62329465",
"0.6201738",
"0.6165971",
"0.6147398",
"0.6132743",
"0.609891",
"0.60952365",
"0.60901064",
"0.60728586",
"0.60667294",
"0.6050155",
"0.6049785",
"0.6002346",
"0.59984... | 0.7705562 | 0 |
part=contentDetails,snippet&key=AIzaSyA0rqYpyxLJJxVBQpiMK2AVachABWYo3WE&fields=items(snippet(title),contentDetails(duration)) / callback to get duration of video by providing video id. It calls back with the duration of the video in seconds | function getDuration(videoID,callBack){
console.warn("USING DEPRECATED FUNCTION, USE getDetails instead");
$.ajax({
url: "https://www.googleapis.com/youtube/v3/videos?id="+videoID+"&fields=items(snippet(title),contentDetails(duration))&part=contentDetails,snippet&key="+applicationID,
}).done(function(data) {
/... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDuration(videoId) {\n $.ajax({\n url: \"https://www.googleapis.com/youtube/v3/videos?id=\" + videoId + \"&key=\"+ apikey + \"&part=snippet,contentDetails\", \n dataType: \"jsonp\",\n success: function(data){\n duration_sec = convert_time(data.items[0].contentDetails.dur... | [
"0.7533268",
"0.7421645",
"0.68392116",
"0.67354476",
"0.65384537",
"0.6355432",
"0.63100326",
"0.62832606",
"0.62734073",
"0.6230928",
"0.62191737",
"0.6216866",
"0.61865896",
"0.61798376",
"0.6109613",
"0.60792524",
"0.5976666",
"0.59562546",
"0.5948449",
"0.5877218",
"0.58... | 0.7613833 | 0 |
returns url that appends a random time, based on the length of the video. This link can be opened in a browser | function appendTimeToURL(videoURL,videoDuration){
var randomTime = Math.floor(Math.random() * (videoDuration + 1)) ;
videoURL = videoURL + "?start=" + randomTime + "&autoplay=1";
console.log("video url is " +videoURL);
return videoURL;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createNewUrl(){\n\t// Random base 36 string\n\tvar shortRoute =\tMath.floor((Math.random() * (1000000000-1000)) + 1000).toString(36);\n\n\treturn shorthost + shortRoute;\n}",
"function generateUrl() {\n const delay = Math.floor(Math.random() * 3);\n return `https://httpbin.org/delay/${delay}?delay=${d... | [
"0.6527517",
"0.6511455",
"0.64572215",
"0.63502526",
"0.62703836",
"0.626919",
"0.62438214",
"0.6221092",
"0.60501826",
"0.60206115",
"0.59875274",
"0.5982208",
"0.5937818",
"0.5913001",
"0.5876249",
"0.58760905",
"0.5869669",
"0.5836046",
"0.58306354",
"0.5822643",
"0.58062... | 0.79432195 | 0 |
Populate the select box that list the available instructors | function populateInstructorsSelectBox() {
$
.ajax({
url : 'instructors.json',
datatype : 'json',
success : function(listInstructors) {
for ( var i = 0; i < listInstructors.data.length; i++) {
$('#input_course_teacher').append(
'<option value="' + i + '">'
+ listInstruc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function countiesList() {\n\n html = '<option disabled selected value>--Select--</option>'//make the default option blank\n\n for (var key in liberia_counties) {\n html += \"<option value=\" + key + \">\" + key + \"</option>\"\n }\n\n $(\"#C2 #patient_coun... | [
"0.6471877",
"0.6318578",
"0.6107676",
"0.6035492",
"0.6031403",
"0.59595686",
"0.59142053",
"0.5907391",
"0.5906646",
"0.5893252",
"0.5875162",
"0.5874698",
"0.5862752",
"0.5862334",
"0.5858852",
"0.58475983",
"0.5810692",
"0.57941115",
"0.57779956",
"0.5777748",
"0.577213",... | 0.7076844 | 0 |
e: System Event eventId: The ID of cnzz event o: this object | function cnzzEvent(e, eventId, o) {
var target = o.target,
href = o.href,
nodeId = o.id;
var cnzzEvent = null;
for (var item in _cnzzEventList) {
if (!_cnzzEventList[item] || _cnzzEventList[item].length < 4) continue;
var eId = _cnzzEventList[item][0];
if (eId == e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get eventId() {\n return this._data.id;\n }",
"function eventid(e){\n return parse_id(e.target.get('id'));\n }",
"function EfwServerEvent() {\n}",
"function getE() {\n e = event\n}",
"get event () {\n\t\treturn this._event;\n\t}",
"function getId(e) {\n\t\t\treturn e.id;\n\... | [
"0.7048798",
"0.63351864",
"0.630458",
"0.6251485",
"0.61267143",
"0.60449374",
"0.60393554",
"0.59603804",
"0.5953134",
"0.5947133",
"0.59377676",
"0.5890935",
"0.5835581",
"0.58174044",
"0.58174044",
"0.58146167",
"0.58037466",
"0.5797358",
"0.57938373",
"0.57846516",
"0.57... | 0.71177036 | 0 |
function to fill the dropdown | function fill_dropdown (array) {
$('#chartType').empty();
$.each(array, function(i, p) {
$('#chartType').append($('<option></option>').val(p).html(p));
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function populateCountryDropdown() {\n country.data.forEach(function(entry) {\n player1CountryDropdown.append(new Option(entry.name, entry.code));\n player2CountryDropdown.append(new Option(entry.name, entry.code));\n });\n\n player1CountryDropdown.val(\"AU\");\n p... | [
"0.74214697",
"0.7092999",
"0.70716393",
"0.70552135",
"0.7031268",
"0.7004725",
"0.698168",
"0.69758266",
"0.69382244",
"0.69302744",
"0.68322337",
"0.68028635",
"0.68001974",
"0.6783219",
"0.67746884",
"0.6730687",
"0.6727501",
"0.6726859",
"0.6722286",
"0.66866785",
"0.668... | 0.7476294 | 0 |
filling the linechart with data from the text files | function fill_linechart (text_file, number) {
while (lineChart.series.length > 0) {
lineChart.series[0].remove(true);
}
$.get(text_file, function(data) {
// Split the lines
var lines = data.split('\n');
$.each(lines, function(lineNo, line) {
var items = line.split(',');
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createLineCharts(width, height) {\n\n\txAtt = 'Iteration';\n\tcolors = ['green', 'blue'];\n\n\n\tchart1 = ['Momentum Residual', ' Continuity Residual'];\n\tcreateChart(\"runs/cavtet4/cavtet4.cvgCharts2.csv\", xAtt, chart1, colors, width, height, \"log\");\n\n\n\tchart2 = [' Velocity Linf', ' Pressure Linf... | [
"0.6561688",
"0.6375301",
"0.63594306",
"0.62466747",
"0.6135235",
"0.6116581",
"0.60901916",
"0.6041346",
"0.6012403",
"0.60115325",
"0.6003284",
"0.5991908",
"0.59465116",
"0.5931852",
"0.59292287",
"0.59058934",
"0.59044224",
"0.5901845",
"0.58936197",
"0.5880362",
"0.5869... | 0.7977184 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.