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 |
|---|---|---|---|---|---|---|
React Apollo Context Provider configuration Done as a separate component so we could use App Bridge Context App Bridge is configured and made available bellow in App component More on Apollo Context Provider: | function ConfiguredApolloProvider({ children }) {
const app = useAppBridge();
const client = useMemo(
() =>
new ApolloClient({
// configuring custom fetch so we could have reusable App Bridge logic on requests
fetch: fetch(app),
fetchOptions: {
credentials: "include",
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function App() {\n return (\n <ThemeProvider theme={theme}>\n <ApolloProvider client={client}>\n <ENSDomainSearch />\n </ApolloProvider>\n </ThemeProvider>\n );\n}",
"render() {\n return (\n <AppContext.Provider value={{ ...this.state, execute: this.execute }}>\n {th... | [
"0.66326946",
"0.6573421",
"0.64016056",
"0.6250332",
"0.61607337",
"0.6126089",
"0.6123948",
"0.61116654",
"0.6103749",
"0.6098818",
"0.6069078",
"0.5984628",
"0.59774476",
"0.595782",
"0.59020036",
"0.5787688",
"0.5749934",
"0.57353765",
"0.57033736",
"0.5677432",
"0.567682... | 0.70565236 | 0 |
Checks for named imports that refer to the deleted animation constants. | _checkAnimationConstants(namedImports) {
namedImports.elements
.filter((element) => ts.isIdentifier(element.name))
.forEach((element) => {
const importName = element.name.text;
if (importName === 'SHOW_ANIMATION' || importName === 'HIDE_ANIMATION') {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"shouldElideExportedName(name) {\n return (\n this.isTypeScriptTransformEnabled &&\n this.declarationInfo.typeDeclarations.has(name) &&\n !this.declarationInfo.valueDeclarations.has(name)\n );\n }",
"shouldElideExportedName(name) {\n return (\n this.isTypeScriptTransformEnabled &&\n ... | [
"0.59444064",
"0.59444064",
"0.58433837",
"0.58308655",
"0.5571883",
"0.5538801",
"0.5497911",
"0.54646766",
"0.54429847",
"0.5434064",
"0.52415115",
"0.5225178",
"0.52192956",
"0.5207992",
"0.5195054",
"0.519061",
"0.51816446",
"0.508993",
"0.5086077",
"0.5060864",
"0.505208... | 0.78910714 | 0 |
Update an existing model's modelStub properties. The caller is responsible for updating the properties specific to the model itself. | function updateModelStub(model) {
const now = new Date();
return _extends({}, model, {
updatedAt: now
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_mutateModel() {\n let model = this.get('model');\n let layerProperties = this.get('getLayerProperties')();\n\n for (let attr of Object.keys(layerProperties)) {\n model.set(attr, layerProperties[attr]);\n }\n }",
"async update () {\n\t\tif (this.dontSaveIfExists) {\n\t\t\t// or don't bother if ... | [
"0.6090711",
"0.58686364",
"0.57639456",
"0.5638118",
"0.546269",
"0.5415959",
"0.5406496",
"0.5363371",
"0.5348568",
"0.5278964",
"0.52254856",
"0.51947737",
"0.51670533",
"0.5108942",
"0.50985277",
"0.50617373",
"0.49489403",
"0.49207556",
"0.4919915",
"0.48532742",
"0.4846... | 0.6864131 | 0 |
Dec 11: Added Reset Review Form function to clear validations | function resetReviewForm() {
// Retrieve Product ID & Review Message
var reviewProductId = document.getElementById("reviewProductId");
var reviewMsg = document.getElementById("reviewMsg");
reviewProductId.className = "default";
reviewMsg.className = "default";
// Retrieve Message Element IDs
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resetForm() {\n\t\tradioList2 = document.getElementById('subList');\t\n\t\terrorBox.style.display = 'none';\n\t\t//remove class of error\n\t\tradioList2.className = '';\n\n\n\t\t//Remove Error Styling and Clear Error Report\n\t\tvar reqElements = document.getElementsByClassName('gRequired');\n\t\tfor(i = ... | [
"0.76350874",
"0.74170405",
"0.7244301",
"0.72057325",
"0.71821535",
"0.7061853",
"0.70444214",
"0.7032279",
"0.69633794",
"0.69530624",
"0.6919861",
"0.6917452",
"0.68805134",
"0.6876445",
"0.6871127",
"0.6870744",
"0.68535554",
"0.6848466",
"0.68394595",
"0.6828656",
"0.682... | 0.7733904 | 0 |
setting the oTurn to it's opposite, which creates a toggle between players turns | function swapTurns() {
oTurn = !oTurn
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toggleTurn(t){ // returns the opposite of t... Note: Do not update the current t\n\tif (t==\"X\") {\n\t\treturn \"O\";\n\t}\n\telse {\n\t\treturn \"X\";\n\t}\n}",
"switchTurn() {\n if (!this.extraTurn) {\n this.playerOne.isTurn = !this.playerOne.isTurn;\n this.playerTwo.isTurn = !t... | [
"0.78759754",
"0.7770577",
"0.7450854",
"0.7280532",
"0.727429",
"0.7152055",
"0.68364096",
"0.68364096",
"0.681967",
"0.67824167",
"0.6764536",
"0.67446864",
"0.6718453",
"0.66776985",
"0.6656381",
"0.6647621",
"0.65984553",
"0.6585814",
"0.6573803",
"0.6571396",
"0.6552926"... | 0.81393105 | 0 |
function to check if an index in the winning combination array contains all the same class, if so that class is the winner | function checkWin(currentClass) {
return winningCombinations.some(combination => {
return combination.every(index => {
return cellElements[index].classList.contains(currentClass)
})
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkWin(currentClass){\n // check in WINNING_COMBINATION array if any combination has all positions filled with current class\n return WINNING_COMBINATIONS.some( combination => {\n //for current combination, check if each index/position is filled with current class\n return combinatio... | [
"0.7910507",
"0.7224811",
"0.7112173",
"0.70218444",
"0.6977765",
"0.69605595",
"0.6913866",
"0.6912316",
"0.68645614",
"0.6836872",
"0.68116766",
"0.6807955",
"0.6798519",
"0.67572165",
"0.6750135",
"0.669271",
"0.66825527",
"0.66467047",
"0.66106296",
"0.659912",
"0.6590034... | 0.76250213 | 1 |
start game function clearing the board of all classes and removing winning message reassiging the click events to the cells and again only allowing them to be clicked once. Removing the winning message | function startGame() {
cellElements.forEach(cell => {
cell.addEventListener('click', handleClick, { once: true})
cell.classList.remove(xClass)
cell.classList.remove(oClass)
})
winningMessageTextElement.classList.remove('show')
winningMessageTextElement.classList.add('hide')
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function startGame_1() {\n flag = 0\n win_message_text.innerText = ``;\n win_message.classList.remove('show')\n cellElements.forEach(cell => {\n cell.classList.remove(X)\n cell.classList.remove(O)\n cell.addEventListener(\"click\", handleClick, { once: true })\n })\n board = ... | [
"0.79164517",
"0.7813325",
"0.7747034",
"0.7728337",
"0.7603361",
"0.7598848",
"0.7588434",
"0.75722224",
"0.75603205",
"0.7459219",
"0.7429163",
"0.741441",
"0.74058753",
"0.73612094",
"0.7318599",
"0.72779846",
"0.72779846",
"0.72612816",
"0.72054076",
"0.71753997",
"0.7131... | 0.78544325 | 1 |
remove elements otherwise they'll redraw on top of themselves | function removeElements() {
d3.selectAll('.svg-tooltip').remove();
d3.selectAll('.y-axis').remove();
d3.selectAll('.tooltip-container').remove();
d3.selectAll('.title-container').remove();
console.log('removed elements');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"remove() {\n // remove the para, and filterdiv\n this.para.remove()\n this.filterDiv.remove()\n this.labelholder.remove()\n this.maxel.element.remove()\n this.minel.element.remove()\n }",
"remove() {\n\t\tthis.outerElement.style.display = \"none\";\n\t\tthis.removed =... | [
"0.74833715",
"0.71473134",
"0.70970225",
"0.70061874",
"0.6986396",
"0.698284",
"0.6982209",
"0.6929968",
"0.69143665",
"0.6911128",
"0.6908582",
"0.69001245",
"0.6892771",
"0.68912345",
"0.6880919",
"0.68783146",
"0.6841945",
"0.68337893",
"0.6800453",
"0.6781236",
"0.67629... | 0.741839 | 1 |
Create a default material to be used as the parent material for the root component display | createDefaultMaterial() {
this.defaultMaterial = new CGFappearance(this);
this.defaultMaterial.setAmbient(0.2, 0.4, 0.8, 1.0);
this.defaultMaterial.setDiffuse(0.2, 0.4, 0.8, 1.0);
this.defaultMaterial.setAmbient(0.2, 0.4, 0.8, 1.0);
this.defaultMaterial.setShininess(10.0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"material() {\r\n // Materials here are minimal, without any settings.\r\n return {shader: this}\r\n }",
"material() {\r\n // Materials here are minimal, without any settings.\r\n return {shader: this}\r\n }",
"static GetDefaultCanvasMaterial() {}",
"f... | [
"0.67238784",
"0.67238784",
"0.6616515",
"0.6546342",
"0.64304835",
"0.6175151",
"0.6155269",
"0.60660344",
"0.59397835",
"0.5934972",
"0.5884919",
"0.5861045",
"0.58423686",
"0.5830041",
"0.5826614",
"0.57723534",
"0.5752562",
"0.57166135",
"0.5647385",
"0.5629488",
"0.55920... | 0.7365668 | 0 |
Toggle showAxis (used by MyInterface) | changeAxis() {
this.showAxis = !this.showAxis;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toggleAxis(axis){\n\n }",
"function toggleAxis(axis){\n\n }",
"toggleAxes() {\n if(this.options.axes){\n this.yAxisElement.style(\"opacity\", \"0\");\n this.xAxisElement.style(\"opacity\", \"0\");\n } else {\n this.yAxisElement.style(\"opacity\", \"... | [
"0.81278634",
"0.81278634",
"0.75128126",
"0.7447333",
"0.68321556",
"0.66712445",
"0.63132995",
"0.6311318",
"0.62665576",
"0.6257152",
"0.623923",
"0.6171297",
"0.61530954",
"0.6101811",
"0.6095056",
"0.60926354",
"0.60907507",
"0.6029893",
"0.60019857",
"0.5998866",
"0.598... | 0.88535285 | 0 |
Set all lights to visible | showLights() {
for (let light of this.lights) {
light.setVisible(!light.visible);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"activateDeathLights() {\n this.deathLight.visible = true;\n this.ambientLight.intensity = this.ambientHighIntensity;\n this.sunLight.visible = false;\n }",
"function lightsOff() {\n for (var i = 0; i < allLights.length; i++) {\n allLights[i].classList.remove(\"light-visible\");\... | [
"0.67073756",
"0.667591",
"0.6671523",
"0.6544459",
"0.6435611",
"0.6434863",
"0.641615",
"0.63672894",
"0.63643646",
"0.6354641",
"0.63015974",
"0.6295534",
"0.62736064",
"0.62716794",
"0.6268742",
"0.62293845",
"0.62237173",
"0.6214831",
"0.62105554",
"0.6209176",
"0.620716... | 0.827154 | 0 |
Initializes the scene transformations with the values read from the XML file. | initTransformations() {
this.transformations = [];
for (var key in this.graph.transformations) {
if (this.graph.transformations.hasOwnProperty(key)) {
var transformation = this.graph.transformations[key];
//calculate the trnasformation matrix
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_initTransformValues() {\n this.rotation = new Vec3();\n this.rotation.onChange(() => this._applyRotation());\n\n // initial quaternion\n this.quaternion = new Quat();\n\n // translation in viewport coordinates\n this.relativeTranslation = new Vec3();\n this.relativ... | [
"0.65393686",
"0.609311",
"0.59683114",
"0.59256446",
"0.58536935",
"0.58366674",
"0.5814915",
"0.5707891",
"0.56948197",
"0.5679178",
"0.56564987",
"0.5605405",
"0.5605142",
"0.5588361",
"0.55486864",
"0.5479942",
"0.54437625",
"0.5431642",
"0.5419614",
"0.5418188",
"0.54102... | 0.63335246 | 1 |
Pauses all the animations | pauseAnimation() {
for (var key in this.animations) {
if (this.animations.hasOwnProperty(key)) {
this.animations[key].setFinished(true);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Pause(){\n\t\tanimSpeed = 0;\n\t}",
"function pause(){\n\tfor( let i = 0; i < subplanes.length ; i++ ){\n\t\tsubplanes[i].pause();\n\t}\n\tpaused = true;\n}",
"function _pause(){\n logger.logEvent({'msg': 'animation paused'});\n if(!_isPlaying){\n return;\n }\n p... | [
"0.71812165",
"0.69522667",
"0.69518906",
"0.68586355",
"0.68192554",
"0.67651457",
"0.6670291",
"0.6652772",
"0.6648194",
"0.66441125",
"0.66303504",
"0.66232234",
"0.65942687",
"0.65810704",
"0.656154",
"0.65555906",
"0.65162253",
"0.6462567",
"0.64410424",
"0.6423033",
"0.... | 0.74840593 | 0 |
Restarts all the animations | restartAnimation() {
for (var key in this.animations) {
if (this.animations.hasOwnProperty(key)) {
this.animations[key].setFinished(false);
this.animations[key].reset();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function animateRestart() {\n animation1.restart();\n animation2.restart();\n animation3.restart();\n animation4.restart();\n}",
"function reset_animations(){\n if(active != \"idee\"){tl_idee.restart();\n tl_idee.pause();}\n if(active != \"reunion\"){tl_reunion.restart();... | [
"0.8725059",
"0.78874594",
"0.76255506",
"0.741731",
"0.7046521",
"0.69826096",
"0.6969322",
"0.6917464",
"0.69060016",
"0.6884525",
"0.68476844",
"0.6842353",
"0.684046",
"0.6840365",
"0.683226",
"0.6806913",
"0.67954797",
"0.6705066",
"0.6671743",
"0.6636071",
"0.6623705",
... | 0.8637106 | 1 |
After being parsed intializes all the animations and the objects associated with them such as KeyframeAnimation, TransformationInterpolant, TransformationTrack | initAnimations() {
this.animations = [];
let interpolant = new TransformationInterpolant();
for (var key in this.graph.animations) {
if (this.graph.animations.hasOwnProperty(key)) {
let animation = this.graph.animations[key];
let keyframes = animation... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"initAnimations() {\n this.animations = new Map();\n\n for (let [id, animation] of this.graph.animations) {\n let anim = new MyKeyframeAnimation(animation.keyframes);\n this.animations.set(id, anim);\n }\n }",
"function AnimationParser() {}",
"processAnimations(anim... | [
"0.71480745",
"0.70431143",
"0.66741735",
"0.6535199",
"0.6363031",
"0.63624555",
"0.6341409",
"0.6287995",
"0.62673604",
"0.61299914",
"0.61299914",
"0.610723",
"0.610479",
"0.6102184",
"0.61008626",
"0.6083594",
"0.60676426",
"0.60656875",
"0.60656875",
"0.6065621",
"0.6022... | 0.7965437 | 0 |
Converts a file URL to a path string. fromFileUrl("file:///home/foo"); // "\\home\\foo" fromFileUrl("file:///C:/Users/foo"); // "C:\\Users\\foo" fromFileUrl("file://localhost/home/foo"); // "\\\\localhost\\home\\foo" | function fromFileUrl(url) {
url = url instanceof URL ? url : new URL(url);
if (url.protocol != "file:") {
throw new TypeError("Must be a file URL.");
}
var path = decodeURIComponent(url.pathname
.replace(/^\/*([A-Za-z]:)(\/|$)/, "$1/")
.replace(/\//g, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fileURLToPath(path) {\n if (typeof path === \"string\") path = new URL(path);\n else if (!(path instanceof URL)) {\n throw new Deno.errors.InvalidData(\n \"invalid argument path , must be a string or URL\",\n );\n }\n if (path.protocol !== \"file:\") {\n throw new Deno.errors.InvalidData... | [
"0.70880723",
"0.70065784",
"0.6959",
"0.69262075",
"0.68530184",
"0.66966504",
"0.65292656",
"0.65292656",
"0.64963907",
"0.64186394",
"0.6301977",
"0.6274568",
"0.6274568",
"0.6274568",
"0.61405814",
"0.6042709",
"0.5960782",
"0.59514487",
"0.59498525",
"0.5884311",
"0.5874... | 0.8040626 | 0 |
Converts a file URL to a path string. fromFileUrl("file:///home/foo"); // "/home/foo" | function fromFileUrl$1(url) {
url = url instanceof URL ? url : new URL(url);
if (url.protocol != "file:") {
throw new TypeError("Must be a file URL.");
}
return decodeURIComponent(url.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fromFileUrl(url) {\n url = url instanceof URL ? url : new URL(url);\n if (url.protocol != \"file:\") {\n throw new TypeError(\"Must be a file URL.\");\n }\n var path = decodeURIComponent(url.pathname\n .replace(/^\\/*([A-Za-z]:)(\\/|$)/, \"$1/\")\n ... | [
"0.8330879",
"0.72079796",
"0.70303017",
"0.6904833",
"0.67668563",
"0.66290027",
"0.6575798",
"0.65613925",
"0.6436297",
"0.6419175",
"0.62760115",
"0.6265447",
"0.6265447",
"0.6247467",
"0.6247467",
"0.62231815",
"0.62127054",
"0.6204672",
"0.6173287",
"0.6173287",
"0.61732... | 0.7384513 | 1 |
Like normalize(), but doesn't collapse "\/.." when `globstar` is true. | function normalizeGlob(glob, _a) {
var _b = (_a === void 0 ? {} : _a).globstar, globstar = _b === void 0 ? false : _b;
if (glob.match(/\0/g)) {
throw new Error("Glob contains invalid characters: \"" + glob + "\"");
}
if (!globstar) {
return normalize$2(glob);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length) code = path.charCodeAt(i);else if (code === 47 /*/*/) break;else code = 47 /*/*/;\n if (code === 47 /*/*... | [
"0.6102578",
"0.60495245",
"0.6042473",
"0.6013807",
"0.60130054",
"0.60130054",
"0.60130054",
"0.60130054",
"0.60130054",
"0.60130054",
"0.60130054",
"0.60130054",
"0.60130054",
"0.60130054",
"0.60130054",
"0.60130054",
"0.60130054",
"0.60130054",
"0.60130054",
"0.60130054",
... | 0.7180116 | 0 |
Like join(), but doesn't collapse "\/.." when `globstar` is true. | function joinGlobs(globs, _a) {
var e_1, _b;
var _c = _a === void 0 ? {} : _a, _d = _c.extended, extended = _d === void 0 ? false : _d, _e = _c.globstar, globstar = _e === void 0 ? false : _e;
if (!globstar || globs.length == 0) {
return join$2.apply(void 0, __spread(globs));
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function join() {\n var paths = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n paths[_i] = arguments[_i];\n }\n return removeSlash(posix.join.apply(posix, paths));\n }",
"function join(/* path segments */) {\n var parts = [];\n for (var i = 0, l = argument... | [
"0.6895921",
"0.6738571",
"0.6638141",
"0.6610224",
"0.6551356",
"0.6509617",
"0.6484682",
"0.646452",
"0.6336938",
"0.63002",
"0.62174714",
"0.61800027",
"0.61800027",
"0.61367655",
"0.60891676",
"0.593313",
"0.59307456",
"0.5912381",
"0.58919245",
"0.58311427",
"0.58244675"... | 0.73853993 | 0 |
Function: ada$ Given either a string of an element's ID or the element, itself, return the element. Parameters: element either a string of an element's ID or the element, itself Dependencies: None. Returns: Element. Change Log: 2007.02.12JEM Initial version; adapted from Prototype.js library. 2011.MM.DDALP Modified fun... | function ada$(element) {
if (arguments.length > 1) {
for (var i = 0, elements = [], length = arguments.length; i < length; i++)
elements.push(ada$(arguments[i]));
return elements;
}
if (typeof element == 'string')
element = document.getElementById(element);
return element; // simplified to return just elem... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function jqElt(element) {\n\t\tif(_.isString(element)) {\n\t\t\treturn $(element);\n\t\t}\n\t\treturn element;\n\t}",
"function $(elementId) { return document.getElementById(elementId); } // shortcut from \"Prototype Javascript Framework\"",
"function $(elementID){\n return document.getElementById(elementID... | [
"0.7362401",
"0.73544097",
"0.72772866",
"0.726213",
"0.7211339",
"0.7209209",
"0.70057434",
"0.69513595",
"0.69224995",
"0.6910816",
"0.69072807",
"0.69058317",
"0.68867147",
"0.68867147",
"0.68555504",
"0.6853199",
"0.6826609",
"0.682369",
"0.6798231",
"0.6793828",
"0.67847... | 0.76315534 | 0 |
Returns a String representation of this url | function toString(){
return this.url;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"toString() {\n return this.url();\n }",
"toString() {\n return this.url();\n }",
"toString() {\n let result = \"\";\n if (this._scheme) {\n result += `${this._scheme}://`;\n }\n if (this._host) {\n result += this._host;\n }\n if (this._por... | [
"0.80133986",
"0.80133986",
"0.7853602",
"0.7853602",
"0.6796626",
"0.67484546",
"0.6747576",
"0.668486",
"0.6628499",
"0.66063416",
"0.64697933",
"0.63862103",
"0.61659443",
"0.61659443",
"0.61659443",
"0.61659443",
"0.61659443",
"0.61606157",
"0.6155958",
"0.61555135",
"0.6... | 0.8305901 | 0 |
Function: wrapOrStuff Creates a new element and wraps it around or stuffs it inside an existing element. Parameters: type whether to wrap or stuff el the element to wrap or stuff tag the tag of the new el to create property an array of properties to assign to the new tag value an array of values for the properties Depe... | function wrapOrStuff(type,el,tag,property,value) {
this.type = type;
this.el = ada$(el);
this.tag = tag.toUpperCase();
this.property = property || false;
this.value = value || false;
this.newEl = document.createElement(this.tag);
if (this.property) {
var propLength = this.property.length;
for (var i=0; i<pro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"appendWrapped(type, props, content) {\n const wrapped = this.createWrapped(type, props, content);\n this.append(wrapped);\n }",
"wrap(type = this.type, props) {\n if (props) {\n if (typeof props === \"string\") props = { className: props };\n else props = this.normalizeProps(props);\n }\n ... | [
"0.5990496",
"0.59275556",
"0.58964956",
"0.5880699",
"0.57155204",
"0.5611996",
"0.56012416",
"0.55674046",
"0.5507229",
"0.53724843",
"0.53242034",
"0.5316902",
"0.5316902",
"0.5316902",
"0.5306932",
"0.5306932",
"0.5248657",
"0.52302206",
"0.5189209",
"0.51698357",
"0.5148... | 0.8847347 | 0 |
Function: externalLinks Adds functionality to each a tag on the page with a rel="external" to open the link in a new window. Avoids the need to use invalid XHTML of target="_blank". Parameters: None. Dependencies: None. Bugs: None known. To do: None. Change Log: 2007.06.27 ALP initial version | function externalLinks() {
if (document.getElementsByTagName) {
var anchors = document.getElementsByTagName("a");
for (var i=0, j=anchors.length; i<j; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") &&
anchor.getAttribute("rel") == "external") {
anchor.onclick = function () {window.op... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function externalLinks() {\n if (!document.getElementsByTagName) return;\n var anchors = document.getElementsByTagName(\"a\");\n for (var i=0; i<anchors.length; i++) {\n var anchor = anchors[i];\n if (anchor.getAttribute(\"href\") &&\n anchor.getAttribute(\"rel\") == \"external\") {\n anchor.onclick = ... | [
"0.8406432",
"0.8319936",
"0.8318336",
"0.83160937",
"0.83014876",
"0.82842207",
"0.79994833",
"0.79863673",
"0.7610224",
"0.7610224",
"0.74964505",
"0.71705526",
"0.70963615",
"0.7051342",
"0.7047028",
"0.6889528",
"0.68070036",
"0.67991745",
"0.6705037",
"0.6689618",
"0.668... | 0.8577173 | 0 |
This compares two automobiles based on their type. The ordering from "greatest" to "least" is as follows: roadster, pickup, suv, wagon, (types not otherwise listed). It should be case insensitive. If two cars are of equal type then the newest one by model year should be considered "greater". | function typeComparator( auto1, auto2){
/* your code here*/
var types = ['wagon', 'suv', 'pickup', 'roadster'];
type1 = types.indexOf(auto1.type.toLowerCase());
type2 = types.indexOf(auto2.type.toLowerCase());
if (type1 > type2) {
return true;
} else if (type1 == type2) {
return... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function typeComparator( auto1, auto2){\n //let's first assign a value to each known type\n var carTypeValues = {\"roadster\":1, \"pickup\":2, \"suv\":3, \"wagon\":4};\n var carType1 = carTypeValues[auto1.type.toLowerCase()];\n var carType2 = carTypeValues[auto2.type.toLowerCase()];\n\n //catch any ... | [
"0.7558908",
"0.7354226",
"0.7130561",
"0.66194636",
"0.6319505",
"0.63099474",
"0.6300002",
"0.62844294",
"0.62690586",
"0.6077658",
"0.6050364",
"0.5845689",
"0.5764469",
"0.5689229",
"0.5603616",
"0.5583114",
"0.55693585",
"0.556571",
"0.55129707",
"0.54793644",
"0.5474708... | 0.746518 | 1 |
To enable logging for this class. Set `Vex.Flow.NoteHead.DEBUG` to `true`. | function L(...args) { if (NoteHead.DEBUG) Vex.L('Vex.Flow.NoteHead', args); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"log() {\n if (this.debug) {\n console.log(...arguments)\n }\n }",
"enableLogging() {\n this.loggingEnabled = true;\n }",
"function logNote (note) {\n // break on this line and use repl to output note\n // use read command with --title\n // creating a debugger and runnin... | [
"0.6145224",
"0.61436653",
"0.6135283",
"0.6079316",
"0.6051574",
"0.604036",
"0.60262084",
"0.5979188",
"0.59736645",
"0.5951455",
"0.58722",
"0.5836199",
"0.58254194",
"0.5799703",
"0.5798949",
"0.5780588",
"0.57743937",
"0.5754969",
"0.575191",
"0.5746452",
"0.5720153",
... | 0.64691347 | 0 |
Draw slashnote head manually. No glyph exists for this. Parameters: `ctx`: the Canvas context `duration`: the duration of the note. ex: "4" `x`: the x coordinate to draw at `y`: the y coordinate to draw at `stem_direction`: the direction of the stem | function drawSlashNoteHead(ctx, duration, x, y, stem_direction, staveSpace) {
const width = Flow.SLASH_NOTEHEAD_WIDTH;
ctx.save();
ctx.setLineWidth(Flow.STEM_WIDTH);
let fill = false;
if (Flow.durationToNumber(duration) > 2) {
fill = true;
}
if (!fill) x -= (Flow.STEM_WIDTH / 2) * stem_direction;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawSlashNoteHead(ctx, duration, x, y, stem_direction, staveSpace) {\n var width = _tables__WEBPACK_IMPORTED_MODULE_1__[\"Flow\"].SLASH_NOTEHEAD_WIDTH;\n ctx.save();\n ctx.setLineWidth(_tables__WEBPACK_IMPORTED_MODULE_1__[\"Flow\"].STEM_WIDTH);\n var fill = false;\n\n if (_tables__WEBPACK_IMPORTED_MO... | [
"0.827575",
"0.6194572",
"0.53603184",
"0.5269353",
"0.5244703",
"0.5221189",
"0.51239395",
"0.510977",
"0.5108582",
"0.49694133",
"0.48820102",
"0.4868886",
"0.48450178",
"0.48273346",
"0.4798813",
"0.47496065",
"0.47456026",
"0.47443303",
"0.4722455",
"0.47029877",
"0.46881... | 0.8417054 | 0 |
Determine if the notehead is displaced | isDisplaced() { return this.displaced === true; } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_hasExactPosition() {\n return !this._hasFlexibleDimensions || this._isPushed;\n }",
"podeMoverParaEsquerda() {\n return this.getBird().getPosWidth() > 0;\n }",
"podeMoverParaCima() {\n return this.getBird().getPosHeigth() > 0;\n }",
"get isMarkerlessDisplayPreferred() {\r\n ... | [
"0.6136597",
"0.5953115",
"0.5864044",
"0.57863307",
"0.56359863",
"0.5624113",
"0.5621804",
"0.5598637",
"0.5566836",
"0.55651164",
"0.5548594",
"0.55259955",
"0.54834175",
"0.5476081",
"0.5461875",
"0.5392165",
"0.53890985",
"0.53567874",
"0.5354572",
"0.528588",
"0.5265061... | 0.75193405 | 0 |
Get the glyph data | getGlyph() { return this.glyph; } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getAsCharData() {\n return [this.fg, this.getChars(), this.getWidth(), this.getCode()];\n }",
"getAsCharData() {\n return [this.fg, this.getChars(), this.getWidth(), this.getCode()];\n }",
"getGlyphDictionary() {\n return this.glyphDictionary;\n }",
"function mapGlyphs (glyph) {... | [
"0.6902431",
"0.6902431",
"0.6708564",
"0.6036744",
"0.594931",
"0.5922932",
"0.5879247",
"0.5825566",
"0.57465684",
"0.5735168",
"0.5691579",
"0.5676904",
"0.5659825",
"0.5659825",
"0.5585688",
"0.5503515",
"0.55028695",
"0.55028695",
"0.55028695",
"0.54986215",
"0.5487961",... | 0.74997723 | 0 |
Get the `BoundingBox` for the `NoteHead` | getBoundingBox() {
if (!this.preFormatted) {
throw new Vex.RERR('UnformattedNote', "Can't call getBoundingBox on an unformatted note.");
}
const spacing = this.stave.getSpacingBetweenLines();
const half_spacing = spacing / 2;
const min_y = this.y - half_spacing;
return new Flow.BoundingB... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getBoundingBox() {\n if (this.root instanceof SVGGraphicsElement) {\n return this.root.getBBox();\n }\n else {\n return null;\n }\n }",
"async boundingBox() {\n const result = await this._getBoxModel();\n if (!result)\n return null;\n ... | [
"0.6505303",
"0.6461642",
"0.6461642",
"0.6461642",
"0.6398307",
"0.6305529",
"0.6227033",
"0.61536735",
"0.60966647",
"0.6051314",
"0.6042459",
"0.60176694",
"0.5954259",
"0.5950536",
"0.59287924",
"0.5923382",
"0.59120727",
"0.59119993",
"0.5819926",
"0.5814646",
"0.5798964... | 0.78846055 | 0 |
Set notehead to a provided `stave` | setStave(stave) {
const line = this.getLine();
this.stave = stave;
this.setY(stave.getYForNote(line));
this.context = this.stave.context;
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Stave(x,y,length,gap){\n this.x = x;\n this.y = y;\n this.yTrebleFirstHelpLine = this.y - (gap/2)*5;\n this.yTrebleLastHelpLine = this.y + gap* 13;\n this.yBassFirstHelpLine = this.y + gap*15;\n this.yBassLastHelpLine = this.y + (gap/2)*38;\n this.trebleNotes = [\"D\",\"C\",\"H\",\"A\",\"G\",\"F\",... | [
"0.58497643",
"0.50853777",
"0.4989023",
"0.4962573",
"0.4914452",
"0.48249057",
"0.48070997",
"0.4779885",
"0.46989313",
"0.46764112",
"0.46544328",
"0.46523207",
"0.46502307",
"0.46443027",
"0.4640769",
"0.4626252",
"0.46038786",
"0.45920667",
"0.4587947",
"0.45873916",
"0.... | 0.69746125 | 0 |
initalize boxValues / adjust for beginning of program | function initalize() {
// lock reset button
$("#reset_btn").prop("disabled",true);
// set initial values of boxes
for (i=0;i<10;i++){
boxVal[i] = i;
}
updateScreen();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initValues() {\n isRunning = false;\n\n repsInput.min = 5;\n workoutInput.min = 5;\n restInput.min = 5;\n setsInput.min = 1;\n\n repsInput.max = 25;\n workoutInput.max = 60;\n restInput.max = 30;\n setsInput.max = 10;\n\n repsInput.value = 0;\n workoutInput.value = 0;\n restInput.value = 0;\n ... | [
"0.6675033",
"0.65437305",
"0.6521305",
"0.64018285",
"0.62471944",
"0.6230834",
"0.6208831",
"0.62026143",
"0.6169095",
"0.61484015",
"0.6138148",
"0.6106493",
"0.60931104",
"0.60531497",
"0.60330516",
"0.60233974",
"0.5986837",
"0.5980018",
"0.5977287",
"0.59673303",
"0.596... | 0.76249915 | 0 |
option to turn on / off showing box numbers vs. box dots | function toggleShowNum() {
if (showNum) {
// hide numbers, show boxes
// change text, change showNum
$('.value_num').css({'visibility': 'hidden'});
$('.value table').css({'visibility': 'visible'});
$('#showNum').text('Show Box Count');
showNum = false;
} else {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showDottedSelection() {\n\t\tdocument.getElementById(this.id).style.visibility = \"visible\";\n\t}",
"function toggleDots(dotsCheckBox) {\n const dots = document.querySelector(\".carousel-dots\");\n\n dots.style.display = dotsCheckBox.checked ? \"block\" : \"none\";\n\n const toggleNumberIndicator = ... | [
"0.6346685",
"0.62395924",
"0.6226306",
"0.5978962",
"0.597828",
"0.58361775",
"0.5823456",
"0.5812372",
"0.5812372",
"0.5782647",
"0.57177174",
"0.571405",
"0.5655746",
"0.5638422",
"0.563807",
"0.5610138",
"0.560837",
"0.5582085",
"0.55458236",
"0.5524643",
"0.5500692",
"... | 0.701609 | 0 |
function used to update values displayed for boxes | function updateScreen() {
// loops through all 10 boxes
for (var i=0;i<10;i++){
// update the string number value
$('#boxes li:nth-child('+(i+1)+') .value_num').text(boxVal[i]);
// if boxVal is over cap -> automatically display value as string
if (boxVal[i] > 15) {
$... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateDisplay () {\n\n showValue('.held-value',heldValue);\n showValue('.next-Value',nextValue);\n}",
"function updateDisplay() {\n\tshowValue(\".next-value\", nextValue);\n\tshowValue(\".held-value\", heldValue);\n}",
"_updateScoreBox() {\n\t\tthis.scoreBox.changeText('SCORE: ' + this.score + '\\nH... | [
"0.7555349",
"0.7411647",
"0.726529",
"0.72312355",
"0.7202625",
"0.71874094",
"0.70189905",
"0.69105625",
"0.6791971",
"0.6742819",
"0.67118996",
"0.66999346",
"0.6626548",
"0.65946054",
"0.65839726",
"0.656793",
"0.64939934",
"0.64606243",
"0.6449035",
"0.6420267",
"0.63936... | 0.75116205 | 1 |
used for inputting custom scripts into command input scripts originally give from RodRego original depending on script type that is pass, edit the string & edit input box | function customScript(script_type) {
if (script_type == 'simple') {
cmd_string = '### This is a Simple Script ###\n\n# MiXED CaSE\n1 iNc 2 2\n2 end\n\n#The next line is\n#commented out\n#3 inc 2 2';
} else if (script_type == 'add') {
cmd_string = '1 deb 4 1 2\n2 deb 2 3 4\n3 inc 4 2\n4 deb 3... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function processInputCommand()\n {\n var inputText = my.html.input.value\n var goodChars = my.current.correctInputLength\n\n if (inputCommandIs('restart') || inputCommandIs('rst')) {\n location.href = '#restart'\n } else if (inputCommandIs('fix') || inputCommandIs('xxx')){... | [
"0.64066863",
"0.576917",
"0.5756236",
"0.5727606",
"0.5723942",
"0.5660639",
"0.5635871",
"0.55845994",
"0.5571783",
"0.55497295",
"0.5504158",
"0.5503698",
"0.54906416",
"0.5417886",
"0.54111695",
"0.54032934",
"0.53994095",
"0.53790337",
"0.53517085",
"0.533147",
"0.533028... | 0.7787982 | 0 |
function to parse command lines, returning command / arguments as object | function cmdLineParse(str) {
// replaces multiple spaces with just one space
// replaces all comments, denoted with either []s or #s
// trims before / after spaces
// splits string up into array based on spaces
var cmd_array = str.replace(/#.*/g, ' ').replace(/\[.*\]/g, '').trim().toLowerCase().repl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseCmdLine(cmdLine) {\r\n var argsOptions = {\r\n 'alias': {\r\n 'e': 'exchange',\r\n 'f': 'file',\r\n 'h': 'host',\r\n 'k': 'routing-key',\r\n 'p': 'port',\r\n 'v': 'verbose'\r\n },\r\n 'boolean': ['verbose', 'json']\r\n };\r\n\r\n retur... | [
"0.6759748",
"0.6722185",
"0.6702436",
"0.66397834",
"0.6634397",
"0.6618408",
"0.659901",
"0.658132",
"0.6561244",
"0.6524288",
"0.6399685",
"0.6353702",
"0.63217646",
"0.6313515",
"0.6298731",
"0.6230271",
"0.6131073",
"0.6130335",
"0.6120911",
"0.61037564",
"0.6099397",
... | 0.72177374 | 0 |
checks if a command (in objform) fails any particular tests | function cmdFail(cmd) {
// if cmd is 'end' and 1 arg isn't number -> fail
if (cmd['cmd'] == 'end') {
if (isNaN(cmd['cmd_num'])) {
return true;
}
// if cmd is either 'inc' or 'deb'
} else if (cmd['cmd'] == 'inc' || cmd['cmd'] == 'deb') {
// if command attempts to edit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkCommand ( cmd ) {\r\n\tvar somethingUndefined = Object.keys( cmd ).some(function ( key ) {\r\n\t\treturn !cmd[ key ];\r\n\t}),\r\n\t\terror;\r\n\r\n\tif ( somethingUndefined ) {\r\n\t\terror = 'Illegal /learn object';\r\n\t}\r\n\r\n\tif ( !/^[\\w\\-]+$/.test(cmd.name) ) {\r\n\t\terror = 'Invalid comm... | [
"0.74077624",
"0.707789",
"0.6956576",
"0.671553",
"0.66084856",
"0.6457952",
"0.644686",
"0.6390296",
"0.63829064",
"0.6300428",
"0.62972116",
"0.6221319",
"0.61964154",
"0.6178842",
"0.6039634",
"0.59902716",
"0.59871966",
"0.58865196",
"0.5871456",
"0.5871456",
"0.58689535... | 0.72740656 | 1 |
play the various sounds looped beep / bleep array so there is no cutoff of sounds | function playBeep() {
beeps[thisBeep].play();
thisBeep++;
if (thisBeep > 5) thisBeep = 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function beep(soundObj, time) {\r\n var sound = document.getElementById(soundObj);\r\n setTimeout(play, time, sound);//sound.play();\r\n}",
"function playStartingSounds() {\n forest_ambience.play()\n piano.play()\n \n}",
"function playAudio() {\n beep.play();\n }",
"function playDaTunes(sounds... | [
"0.74898726",
"0.74466276",
"0.74276",
"0.73262143",
"0.7280309",
"0.72315353",
"0.7181608",
"0.7179285",
"0.7174489",
"0.7125333",
"0.70911735",
"0.7089775",
"0.70767516",
"0.7010954",
"0.69807196",
"0.6966921",
"0.6961768",
"0.69602245",
"0.6951393",
"0.6942831",
"0.6940593... | 0.79115206 | 0 |
Function called when this component is loaded to check if this company is currently saved in our favorites list | function CheckIfSaved() {
if (props.symbol == state.symbol) {
return;
}
AsyncStorageLibrary.RetrieveCompanies()
.then((data) => {
for (var i = 0; i < data.savedCompanies.length; i++) {
if (data.savedCompanies[i].symbol == props.symbol)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SaveCompany() {\n AsyncStorageLibrary.SaveCompany(props.symbol, props.companyName, props.lastSalePrice, props.lastUpdated, props.tradeData.trades[props.tradeData.trades.length - 1].price);\n setState((prevState) => {\n return ({\n ...prevState,\n favo... | [
"0.63790274",
"0.6240539",
"0.60106194",
"0.5979",
"0.5942785",
"0.58657545",
"0.5837852",
"0.58288723",
"0.581584",
"0.5808301",
"0.58077675",
"0.5773253",
"0.5772403",
"0.5745151",
"0.57412124",
"0.5736514",
"0.5727369",
"0.572082",
"0.5706293",
"0.5611789",
"0.5607979",
... | 0.7456218 | 0 |
Saves this company for quick reference on the home page | function SaveCompany() {
AsyncStorageLibrary.SaveCompany(props.symbol, props.companyName, props.lastSalePrice, props.lastUpdated, props.tradeData.trades[props.tradeData.trades.length - 1].price);
setState((prevState) => {
return ({
...prevState,
favorited: tru... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _saveProfileCompany() {\n if (vm.item.companyId === 0) {\n vm.item.companyId = vm.item.userId;\n vm.item.userId = vm.item.id;\n vm.item.modifiedBy = vm.data.name;\n vm.genericService.postById(\"/api/profile/company/\", vm.item.userId, ... | [
"0.73210156",
"0.6812747",
"0.67977923",
"0.669542",
"0.6487821",
"0.6350839",
"0.6324786",
"0.63158464",
"0.62269664",
"0.61823064",
"0.6138262",
"0.61288166",
"0.6127925",
"0.6127395",
"0.6087503",
"0.60618526",
"0.6042326",
"0.601098",
"0.60021836",
"0.59974253",
"0.597759... | 0.74655074 | 0 |
Removes this company from the list of saved companies | function RemoveCompany() {
AsyncStorageLibrary.RemoveCompany(props.symbol);
setState((prevState) => {
return ({
...prevState,
favorited: false
});
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteCompany() {\n console.log(\"Delete company\");\n // return firestore.remove(`companies/${id}`);\n }",
"function removecompany(id) {\n var i = 0;\n for (; i < companys.length; i++) if (companys[i].id === id) break;\n var company = companys[i];\n companys.splice(i, 1);\n return... | [
"0.6305629",
"0.62563014",
"0.60093015",
"0.5740535",
"0.5630444",
"0.55451274",
"0.55261934",
"0.5508761",
"0.5364644",
"0.52360505",
"0.5233492",
"0.5216589",
"0.52132",
"0.5197219",
"0.5196333",
"0.5191859",
"0.51868343",
"0.5186529",
"0.51682717",
"0.5164769",
"0.5164536"... | 0.66777486 | 0 |
bfsWithAction method is an HOF, meant to be reusable across different actions to implement on each visit in a bfs traversal. It takes 2 required arguments: 1) action, which is a function that represents the action to implement on each visit, and 2) argValue, which is the intial value for the argNode, which is the first... | bfsWithAction(action, argValue) {
if (!this) return;
const actionArg = new ArgNode(argValue);
const queue = new Queue();
queue.enque(this);
while (!queue.isEmpty()) {
const current = queue.dequeue();
if (current) {
let additionalArgs = this.getAdditionalArgs(action, current);... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"bfs(startingNode) {\n // create a visited array \n let visited = new Map();\n for (var i = 0; i < this.noOfVertices; i++)\n visited[i] = false;\n\n // Create an object for queue \n var q = [];\n\n // add the starting node to the queue \n visited[startingN... | [
"0.53984696",
"0.5312615",
"0.5307783",
"0.52377164",
"0.51119304",
"0.50508624",
"0.49863043",
"0.4982006",
"0.49420413",
"0.49374714",
"0.48393223",
"0.47474185",
"0.47471064",
"0.47320232",
"0.47006783",
"0.46911412",
"0.46804094",
"0.46739873",
"0.4665208",
"0.4650404",
"... | 0.8366983 | 0 |
Method for determining the additional args to be passed into the action; to be used inside bfsWithAction. | getAdditionalArgs(action, currentNode) {
switch(action) {
case this.count:
return [];
case this.list:
return [currentNode.value];
default:
console.log(`Error determining additional args for the action ${action}`);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function args() {\n\t\tvar params = slice.call(arguments);\n\t\tparams.isArgs = true;\n\t\treturn params;\n\t}",
"function receiveArguments()\n{\n if (arguments[0] && arguments[0].designTimeObj)\n {\n DS_DESIGN_TIME_ARG = arguments[0].designTimeObj;\n if (arguments[0].insertObj)\n {\n INSERT_OPTI... | [
"0.6282695",
"0.62592393",
"0.5873342",
"0.586336",
"0.5769601",
"0.5719136",
"0.5703216",
"0.5699",
"0.5691734",
"0.5665218",
"0.56570953",
"0.5641315",
"0.5631049",
"0.5581544",
"0.5550648",
"0.5481592",
"0.5477636",
"0.54687697",
"0.5450592",
"0.5430014",
"0.5382428",
"0... | 0.7388597 | 0 |
Compile the buttons mapping to reduce lookup delay. | _compileMapping() {
const { axes, buttons } = this._compiledMapping;
const axesIndexes = MAPS_INDEXES.axes;
const buttonsIndexes = MAPS_INDEXES.buttons;
// Clear existing
axes.length = 0;
buttons.length = 0;
// Add axes
const axesMap = this.map.axes;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_beforeRender () {\n if (webix.ARCHIBUS.buttonsMap) {\n for (var key in webix.ARCHIBUS.buttonsMap) {\n var button = webix.ARCHIBUS.buttonsMap[key];\n this.on_click[button.class] = webix.actions[button.function];\n }\n }\n if (webix.ARCHIBUS.e... | [
"0.64719164",
"0.62854314",
"0.6064906",
"0.606466",
"0.6053801",
"0.5985595",
"0.59520787",
"0.59039956",
"0.5824634",
"0.5808569",
"0.57922304",
"0.57845855",
"0.5773555",
"0.57304054",
"0.57146096",
"0.57133913",
"0.5706615",
"0.568212",
"0.56610435",
"0.5658582",
"0.56542... | 0.7749991 | 0 |
had to wrap the other ajax call in a function to call for uvindex information | function ajaxCallUvIndex() {
//needed to take latitude and longditude of city from previous ajax call
var cityLat = weatherData.coord.lat;
var cityLong = weatherData.coord.lon;
// used a different url to set ajax call for uv index
var query... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function UVIndex(ln,lt){\n //lets build the url for uvindex.\n var uvqURL=\"https://api.openweathermap.org/data/2.5/uvi?appid=\"+ APIKey+\"&lat=\"+lt+\"&lon=\"+ln;\n $.ajax({\n url:uvqURL,\n method:\"GET\"\n }).then(function(response){\n $(currentUvindex).ht... | [
"0.69648284",
"0.69648284",
"0.6949313",
"0.67940557",
"0.6570302",
"0.6537834",
"0.64579237",
"0.6454831",
"0.645182",
"0.63262933",
"0.6306419",
"0.6265558",
"0.6253146",
"0.6235534",
"0.62324923",
"0.6221699",
"0.6194266",
"0.6188564",
"0.6179236",
"0.61662704",
"0.616044"... | 0.70157456 | 0 |
Preload a media source fully. Can optionally override the mimetype. | static preloadSource(sourceUrl, mimetype) {
if (!_preloadedUrls[sourceUrl]) {
_preloadedUrls[sourceUrl] = retryHelper(
() => preloadBlobAsObjectURL(sourceUrl, mimetype),
{ shouldRetry: status => RETRY_STATUSES.includes(status) }
).catch(status => {
throw Error(
`Unable ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setupSourceBuffer_() {\n let media = this.masterPlaylistLoader_.media();\n\n // wait until a media playlist is available and the Media Source is\n // attached\n if (!media || this.mediaSource.readyState !== 'open') {\n return;\n }\n\n this.addMimeType_(this.mainSegmentLoader_, 'avc1.4d400d, ... | [
"0.636219",
"0.6184169",
"0.6159209",
"0.59771633",
"0.5891249",
"0.58319503",
"0.58220273",
"0.58035564",
"0.57947135",
"0.5763459",
"0.5763459",
"0.57118714",
"0.57004017",
"0.5690944",
"0.5685958",
"0.56778127",
"0.5677188",
"0.567316",
"0.5639627",
"0.5632011",
"0.5632011... | 0.6818948 | 0 |
Convenience function for preloading MP4 video sources | static preloadVideoSource(sourceUrl) {
// safari won't load the video if it doesn't have the correct mime type
return NativeMediaControls.preloadSource(sourceUrl, 'video/mp4');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function preload(){\n vid = createVideo(\"videos/2.mp4\");\n}",
"function loadVideos() {\n // if(videosloaded === false) {\n // var req = new XMLHttpRequest();\n // req.open('GET', $vid+'intro.mp4', true);\n // req.responseType = 'blob';\n\n // req.onload = function() {\n // // ... | [
"0.70782",
"0.6672243",
"0.656284",
"0.6520881",
"0.63152397",
"0.6278274",
"0.61555225",
"0.6094901",
"0.6073106",
"0.6029419",
"0.60291165",
"0.6024868",
"0.60126483",
"0.5986269",
"0.59581333",
"0.59309846",
"0.5885713",
"0.588286",
"0.5867743",
"0.5844472",
"0.58162165",
... | 0.72381115 | 0 |
Set add to cart button locator | set addToCartButtonLocator(value) {
this._addToCartButtonLocator = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"clickAddToCart() {\n return this\n .waitForElementVisible('@addToCartBtn')\n // .moveToElement('@addToCartBtn', 10, 10)\n .click('@addToCartBtn');\n }",
"get backpackAddCartBtn() { return $('#add-to-cart-sauce-labs-backpack') }",
"getAddToCartButton() {\n return cy.get(\"#add-to-cart-butt... | [
"0.71542084",
"0.70942223",
"0.7089901",
"0.69143087",
"0.67264444",
"0.67173433",
"0.66382027",
"0.65126973",
"0.6492021",
"0.64908814",
"0.6485056",
"0.6401706",
"0.6392832",
"0.63626915",
"0.6335535",
"0.6308599",
"0.6290119",
"0.6277282",
"0.62716883",
"0.6242799",
"0.622... | 0.7784025 | 0 |
Set enquire button selector | set enquireButtonSelector(value) {
this._enquireButtonSelector = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_configureInteractivityOfNextButton () {\n const self = this\n if (self.acceptCheckboxButtonView.isChecked) {\n self.enable_submitButton()\n } else {\n self.disable_submitButton()\n }\n }",
"function markButton(event){\n// $(\"#qwerty button\").on(\"click\", (event) => {\nevent.target.dis... | [
"0.62662804",
"0.6152651",
"0.6093207",
"0.58070004",
"0.56573564",
"0.5653782",
"0.5568746",
"0.55655366",
"0.555697",
"0.55569",
"0.55494535",
"0.5539948",
"0.5536936",
"0.5480996",
"0.5478562",
"0.54705507",
"0.5448331",
"0.54480743",
"0.5437116",
"0.54212505",
"0.5397492"... | 0.8194209 | 0 |
Set product option locator | set productOptionLocator(value) {
this._productOptionLocator = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set productAdvanceOptionLocator(value) {\n\t\tthis._productAdvanceOptionLocator = value;\n\t}",
"selectProductOption(product, choice) {\n\n switch(product) {\n case 'Bow Ties':\n cy.get(bowTiesOptions)\n .find('option')\n .then($els => $els.g... | [
"0.7490965",
"0.65710855",
"0.6224241",
"0.5948298",
"0.59403205",
"0.59150034",
"0.58913034",
"0.58385926",
"0.57886845",
"0.5767788",
"0.5738038",
"0.5724184",
"0.5720766",
"0.5699953",
"0.56739616",
"0.564192",
"0.56291527",
"0.5580531",
"0.5564285",
"0.55524856",
"0.55270... | 0.8191506 | 0 |
Set product advance option locator. | set productAdvanceOptionLocator(value) {
this._productAdvanceOptionLocator = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set productOptionLocator(value) {\n\t\tthis._productOptionLocator = value;\n\t}",
"set productImageLocator(value) {\n\t\tthis._productImageLocator = value;\n\t}",
"function setOptions() {\n // set text output to match slider\n $(options.selectors.isochroneOutput).text($(options.selectors.isochron... | [
"0.77508193",
"0.5759977",
"0.56226236",
"0.56215215",
"0.5532829",
"0.54477954",
"0.5396329",
"0.5351226",
"0.53413737",
"0.52981615",
"0.5262494",
"0.52424335",
"0.52330345",
"0.5224989",
"0.5163952",
"0.512633",
"0.50969726",
"0.5083128",
"0.5083128",
"0.50777125",
"0.5061... | 0.83915424 | 0 |
Set product image locator | set productImageLocator(value) {
this._productImageLocator = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set productLargeImageLocator(value) {\n\t\tthis._productLargeImageLocator = value;\n\t}",
"set productImageZoomLocator(value) {\n\t\tthis._productImageZoomLocator = value;\n\t}",
"function addPathToImage() {\n $(ctrl.imageTags).each(function (index) {\n if (ctrl.imageTags[inde... | [
"0.72881067",
"0.72148234",
"0.63973135",
"0.6316645",
"0.61183804",
"0.6117618",
"0.6117618",
"0.60632104",
"0.6019345",
"0.593154",
"0.5919801",
"0.59029174",
"0.5896452",
"0.5888429",
"0.5884241",
"0.5875721",
"0.5816579",
"0.5802105",
"0.58010244",
"0.57983613",
"0.579105... | 0.8358285 | 0 |
Set product large image locator | set productLargeImageLocator(value) {
this._productLargeImageLocator = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set productImageLocator(value) {\n\t\tthis._productImageLocator = value;\n\t}",
"set productImageZoomLocator(value) {\n\t\tthis._productImageZoomLocator = value;\n\t}",
"set productLargeImageCloseLocator(value) {\n\t\tthis._productLargeImageCloseLocator = value;\n\t}",
"function updateLargeImage(){\n\t$(\"di... | [
"0.76553494",
"0.6892884",
"0.6494843",
"0.6299406",
"0.6137509",
"0.6034901",
"0.59625703",
"0.5904133",
"0.58845675",
"0.5869647",
"0.5855076",
"0.58280814",
"0.58280814",
"0.5791092",
"0.57705885",
"0.5726166",
"0.5681788",
"0.56298715",
"0.56150335",
"0.56094146",
"0.5601... | 0.812366 | 0 |
Set product image zoom locator | set productImageZoomLocator(value) {
this._productImageZoomLocator = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set productImageLocator(value) {\n\t\tthis._productImageLocator = value;\n\t}",
"function initZoom() {\n var c = sigmaInstance.camera;\n c.goTo({\n ratio: c.settings(\"zoomingRatio\")\n });\n}",
"function setZoom() {\r\n zoom = 2.0;\r\n}",
"function setZoom() {\r\n zoom = 2.0;\r\n}",
"setupZoom... | [
"0.7138032",
"0.69093144",
"0.6860213",
"0.6860213",
"0.67951304",
"0.67575026",
"0.67462784",
"0.6563639",
"0.6559238",
"0.6483647",
"0.6422094",
"0.64000887",
"0.63688064",
"0.63335556",
"0.6329952",
"0.6276445",
"0.6272642",
"0.6255615",
"0.6245427",
"0.6191044",
"0.616924... | 0.8341903 | 0 |
Set product large image close locator | set productLargeImageCloseLocator(value) {
this._productLargeImageCloseLocator = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set productLargeImageLocator(value) {\n\t\tthis._productLargeImageLocator = value;\n\t}",
"set productImageLocator(value) {\n\t\tthis._productImageLocator = value;\n\t}",
"set productImageZoomLocator(value) {\n\t\tthis._productImageZoomLocator = value;\n\t}",
"function updateLargeImage(){\n\t$(\"div.configur... | [
"0.731954",
"0.65352905",
"0.58893347",
"0.57707685",
"0.55512303",
"0.5548023",
"0.54726166",
"0.52920014",
"0.5270677",
"0.52704054",
"0.52657616",
"0.52574325",
"0.5239503",
"0.520427",
"0.51447284",
"0.5115479",
"0.51109445",
"0.51089066",
"0.5108802",
"0.5104036",
"0.510... | 0.80540764 | 0 |
Receives as input an image object and returns its data encoded in a base64 string. This piece of code was based on Matthew Crumley's post at | function getBase64Image(img) {
// Create an empty canvas element
var canvas = document.createElement("canvas");
var newImg = new Image();
newImg.src = img.src;
canvas.width = newImg.width;
canvas.height = newImg.height;
// Copy the image contents to the canvas
var ctx = canvas.getContext("2d");
ctx.drawImage... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getBase64Image(img) {\n var canvas = document.createElement(\"canvas\");\n canvas.width = img.width;\n canvas.height = img.height;\n\n var ctx = canvas.getContext(\"2d\");\n ctx.drawImage(img, 0, 0);\n\n var dataURL = canvas.toDataURL();\n\n return dataURL.replace(/^data:image\\/(png|... | [
"0.7706129",
"0.7544866",
"0.7540407",
"0.745337",
"0.7276508",
"0.7224586",
"0.71471804",
"0.71401185",
"0.71270776",
"0.7116467",
"0.6997386",
"0.69954515",
"0.6990795",
"0.6973237",
"0.6957042",
"0.6956796",
"0.6916527",
"0.6902625",
"0.6871205",
"0.68289226",
"0.6803869",... | 0.76110494 | 1 |
Builds an empty instance of a JSBridge object. | function JSBridgeObj() {
this.objectJson = "";
this.addObject = JSBridgeObj_AddObject;
this.sendBridgeObject = JSBridgeObj_SendObject;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function JClass() {\n // only call 'init' when 'new' is invoked outside the 'extend' method\n if (!initializing && this[opts.ctorName])\n this[opts.ctorName].apply(this, arguments);\n }",
"function jv_EmptyInterface() {}",
"function JSBridgeObj2() {\n this.objectJs... | [
"0.56713",
"0.5636045",
"0.56110346",
"0.5429392",
"0.53411496",
"0.52244526",
"0.51800823",
"0.5121676",
"0.50901014",
"0.5019941",
"0.49954367",
"0.49332592",
"0.49257967",
"0.49192235",
"0.48729563",
"0.48549825",
"0.48394126",
"0.48368865",
"0.48155212",
"0.48063827",
"0.... | 0.6123018 | 0 |
The addObject method implementation for the JSBridge object. | function JSBridgeObj_AddObject(id, obj) {
var result = JSBridgeObj_AddObjectAuxiliar(id, obj);
if (result != "") {
if (this.objectJson != "") {
this.objectJson += ", ";
}
this.objectJson += result;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function JSBridgeObj() {\n this.objectJson = \"\";\n this.addObject = JSBridgeObj_AddObject;\n this.sendBridgeObject = JSBridgeObj_SendObject;\n}",
"function JSBridgeObj2() {\n this.objectJson = \"\";\n this.addObject = JSBridgeObj_AddObject;\n this.sendBridgeObject2 = JSBridgeObj_SendObject2;\n }",
"st... | [
"0.69227284",
"0.66336775",
"0.63625425",
"0.63062626",
"0.6242526",
"0.6238545",
"0.6228324",
"0.61999816",
"0.6147086",
"0.61085063",
"0.6090981",
"0.60485023",
"0.60203475",
"0.5994791",
"0.59801733",
"0.59443927",
"0.5917155",
"0.59057754",
"0.5855241",
"0.5763435",
"0.57... | 0.69596905 | 0 |
This method is invoked by the ObjectiveC code. It retrieves the json string representation of a JSBridge object given its id. | function JSBridge_getJsonStringForObjectWithId(objId) {
var jsonStr = JSBridge_objArray[objId];
JSBridge_objArray[objId] = null;
return "{" + jsonStr + "}";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function JSBridgeObj() {\n this.objectJson = \"\";\n this.addObject = JSBridgeObj_AddObject;\n this.sendBridgeObject = JSBridgeObj_SendObject;\n}",
"function JSBridgeObj2() {\n this.objectJson = \"\";\n this.addObject = JSBridgeObj_AddObject;\n this.sendBridgeObject2 = JSBridgeObj_SendObject2;\n }",
"fu... | [
"0.6490017",
"0.6099588",
"0.57846546",
"0.5588937",
"0.54650795",
"0.5449823",
"0.5388969",
"0.5388969",
"0.5362317",
"0.53610504",
"0.53167635",
"0.53167635",
"0.52925265",
"0.5289395",
"0.5165752",
"0.5159413",
"0.51429725",
"0.5132152",
"0.5131756",
"0.51221085",
"0.51120... | 0.7228934 | 0 |
Checks if an object is an array. This piece of code was based on a code rertrieved from | function isObjAnArray(obj) {
if (typeof (obj) == 'object') {
var criterion = obj.constructor.toString().match(/array/i);
return (criterion != null);
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _isArray(obj) {\n\t\treturn Object.prototype.toString.call(obj) === \"[object Array]\";\n\t}",
"function isArray(obj) { // 64\n\t\treturn nativeIsArray ? nativeIsArray(obj) : toString.call(obj) === '[object Array]'; ... | [
"0.79477465",
"0.78868395",
"0.78733253",
"0.7842006",
"0.77984214",
"0.7764671",
"0.77604306",
"0.77290267",
"0.77241534",
"0.77009946",
"0.77009946",
"0.77009946",
"0.77009946",
"0.7675929",
"0.7650228",
"0.7632636",
"0.7617152",
"0.76061946",
"0.7599898",
"0.7571154",
"0.7... | 0.81378734 | 0 |
generates style key:value pair for use as inline css. Input is a hash/dictionary table. return is a string intended for inline css | function generateStyleElements(styleHash = ""){
if (styleHash == ""){
return ;
}
var inlineStyle = "";
$.each(styleHash, function(key, value){
inlineStyle += key+":"+ value + ";"
})
return '"' + inlineStyle + '"';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getCSSStyle(key, value) {\n if(value && value.value) {\n return key + \": \" + value.value +\";\";\n }\n else\n return \"\";\n }",
"function styleString(styleInfo){var o=[];for(var name in styleInfo){var v=styleInfo[name];if(v||v===0){o.push(\"\".concat(camelToDashCase(name),\": \").... | [
"0.72746843",
"0.70315605",
"0.69943345",
"0.6983238",
"0.6896121",
"0.6850327",
"0.6776286",
"0.6776286",
"0.6519365",
"0.6519365",
"0.6504545",
"0.6445561",
"0.64228356",
"0.6316723",
"0.6269345",
"0.6268821",
"0.62582415",
"0.62396556",
"0.6232833",
"0.6214723",
"0.6179981... | 0.7637283 | 0 |
readjusts the timeline vertical line gfx | function timelineGfxReadjust(){
$('.timeline-vertical-line-gfx').each(function(){
var $topCircle = $('.timeline-circle');
var timelinePositionLeft = parseFloat($topCircle.css("left")) + $topCircle.width()/2 - $(this).width()/2;
$(this).css({left: (timelinePositionLeft + 'px')});
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"moveToNextLine(line) {\n let paragraph = line.paragraph;\n let paraFormat = paragraph.paragraphFormat;\n let isParagraphStart = line.isFirstLine();\n let isParagraphEnd = line.isLastLine();\n let height = 0;\n let maxDescent = 0;\n let afterSpacing = 0;\n let... | [
"0.61695546",
"0.57804096",
"0.57681286",
"0.5733923",
"0.5668825",
"0.5647102",
"0.5645291",
"0.5597705",
"0.55896205",
"0.5575812",
"0.55502677",
"0.5542221",
"0.55301225",
"0.55293274",
"0.5514169",
"0.551294",
"0.55110395",
"0.5508777",
"0.54821354",
"0.5481144",
"0.54783... | 0.70108247 | 0 |
This function takes in article templates and creates article elements in the DOM | function generateArticleElements(articleBlockLeftTemplate, articleBlockRighTemplate){
// input? Need to know the number of articles
var $secondToLast
var
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addToHTML() {\n for(var i = 0; i < blog.post.length; i++) {\n var article = document.querySelector('#blog_posts');\n var title = document.createElement('h1');\n var date = document.createElement('p');\n var image = document.createElement('img');\n var text = document.createElement('p');\n ... | [
"0.67317015",
"0.66051406",
"0.6562393",
"0.6561659",
"0.64517635",
"0.64047897",
"0.6365521",
"0.6317481",
"0.6312478",
"0.62928325",
"0.628577",
"0.6228598",
"0.62112635",
"0.6191379",
"0.6159477",
"0.61472964",
"0.61380476",
"0.6135437",
"0.6134059",
"0.6124515",
"0.612417... | 0.7237834 | 0 |
Join Call functionality. Intended UI usage: 1. Select first call using 'Active Calls' select list. 2. Click 'Select First Call' (step === 'select'). 3. Select second call using 'Active Calls' select list. 4. Click 'Join Second Call' (step === 'join'). | joinCall(step) {
if (step === 'select') {
callOne = firstCallId; //getSelectedCall();
} else if (step === 'join') {
var callTwo = firstCallId; //getSelectedCall();
console.log('Joining callOne (' + callOne + ') to callTwo (' + callTwo + ').');
kandy.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setJoinCallBtn() {\n joinCallBtn.addEventListener(\"click\", async (e) => {\n window.location.href='/join/' + roomId;\n });\n}",
"handleJoin() {\n var joined = this.state.joined;\n if (joined) {\n this.joinProject();\n } else {\n this.leaveProject();\n }\n this.handleClick(... | [
"0.56592864",
"0.55230796",
"0.54676455",
"0.5441346",
"0.5428809",
"0.528397",
"0.52720445",
"0.5251148",
"0.5249446",
"0.5227253",
"0.51776314",
"0.5175443",
"0.5081126",
"0.5059557",
"0.50375587",
"0.5035008",
"0.5027622",
"0.49925885",
"0.49730766",
"0.49485675",
"0.49389... | 0.80844307 | 1 |
Deletes all call logs. | removeCallHistory() {
kandy.removeCallLogs('all');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cleanFileLogs() {\r\n if (jobSettings.loggerType === 'file') {\r\n if (jobSettings.file && jobSettings.file.logFolder) {\r\n // Clean the log files\r\n glob(`${jobSettings.file.logFolder}**/*.log`, function (err, files) {\r\n if (err) {\r\n throw err;\r\n ... | [
"0.6499716",
"0.6372232",
"0.62938714",
"0.61953294",
"0.61766374",
"0.5911022",
"0.5879318",
"0.57887566",
"0.57887566",
"0.57684183",
"0.57530564",
"0.57057804",
"0.56846607",
"0.56755733",
"0.56356895",
"0.5616509",
"0.5501535",
"0.548559",
"0.5480773",
"0.5480773",
"0.548... | 0.6695373 | 0 |
Deregisters for push notifications. | deregisterPushNotifications() {
kandy.deregisterPushNotifications()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deregister() {\n console.debug('[PUSH_NOTIFICATIONS] Unsubscribing from push notifications.');\n UrbanAirship.setNamedUser(null);\n UrbanAirship.removeAllListeners(EventType.PushReceived);\n UrbanAirship.removeAllListeners(EventType.NotificationResponse);\n}",
"function pushdeRegister() {\n ... | [
"0.7715382",
"0.7111173",
"0.68698186",
"0.6695352",
"0.66793126",
"0.66793126",
"0.66793126",
"0.66793126",
"0.66650456",
"0.6662535",
"0.6548561",
"0.63382393",
"0.63352484",
"0.6296541",
"0.6234996",
"0.6151236",
"0.6151236",
"0.6151236",
"0.6151236",
"0.6126804",
"0.60938... | 0.78191847 | 0 |
change date cell color in table to green due to condition of waves height and create an option in "date" select element | function color() {
var tds = document.getElementById("demo").getElementsByTagName("td");
var selectList = document.getElementById("taarih-azmana");
var count=0;
for (i = 0; i < tds.length; i++) {
if (tds[i].innerHTML <= 0.5) {
tds[i - 1].style.backgroundColor = "#90EE90";
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function color() {\n var tds = document.getElementById(\"demo\").getElementsByTagName(\"td\");\n var selectList = document.getElementById(\"taarih-azmana\");\n\n for (i = 0; i < tds.length; i++) {\n if (tds[i].innerHTML > 0.5 && tds[i].innerHTML < 1) {\n tds[i - 1].style.backgroundColor = \"#90EE90\";\n... | [
"0.62320733",
"0.5863374",
"0.5857847",
"0.5811163",
"0.5799105",
"0.568192",
"0.56737155",
"0.56718826",
"0.5649786",
"0.56381387",
"0.5629388",
"0.5620306",
"0.5610215",
"0.5609529",
"0.56057113",
"0.55970126",
"0.5582091",
"0.55752355",
"0.5563651",
"0.55602825",
"0.555521... | 0.61900157 | 1 |
Generate random point p in the rectangle | generateRandomPoint() {
let p = glMatrix.vec3.create();
let x = Math.random() * (this.maxX - this.minX) + this.minX;
let y = Math.random() * (this.maxY - this.minY) + this.minY;
glMatrix.vec3.set(p, x, y, 0);
return p;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function randomPoint(p) {\n\treturn [(Math.random())*p.width, (Math.random())*p.height]\n}",
"function randomPoint(){\n\tx =(Math.random()*200)-100;\n\ty =(Math.random()*200)-100;\n\n\treturn new Point(x,y);\n}",
"function randPoint () {\n\t\treturn allPoints[Math.floor(Math.random() * allPoints.length)];\n\t}... | [
"0.8671752",
"0.8013221",
"0.7648632",
"0.7167607",
"0.71642995",
"0.71054965",
"0.7005382",
"0.6932701",
"0.6926391",
"0.6876388",
"0.68616074",
"0.68431026",
"0.68275607",
"0.6814516",
"0.6813879",
"0.67552525",
"0.6733837",
"0.6724227",
"0.67227656",
"0.67052835",
"0.67021... | 0.80281526 | 1 |
Generate random normal vector for the plane | generateRandomNormalVec() {
let tmp = glMatrix.vec2.create()
tmp = glMatrix.vec2.random(tmp);
return glMatrix.vec3.fromValues(tmp[0], tmp[1], 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function normal() {\n var x = 0, y = 0, rds, c;\n do {\n x = Math.random() * 2 - 1;\n y = Math.random() * 2 - 1;\n rds = x * x + y * y;\n } while (rds == 0 || rds > 1);\n c = Math.sqrt(-2 * Math.log(rds) / rds); // Box-Muller transform\n ... | [
"0.7873742",
"0.78393537",
"0.78331435",
"0.7531532",
"0.7523388",
"0.73847336",
"0.7052806",
"0.7035954",
"0.7031599",
"0.6912774",
"0.68877614",
"0.68018204",
"0.6693587",
"0.6669117",
"0.6651764",
"0.6651172",
"0.6628937",
"0.6560203",
"0.6560203",
"0.6504475",
"0.64822114... | 0.8166405 | 0 |
Calculate the normals for each triangle 1. generate pervertex normals 2. triangle areaweighted average | calculateNormals() {
// MP2: Implement this function!
// initialize an NArray containing M normals
let normals = [];
for(let i = 0; i < this.numVertices; i++) {
normals.push([0, 0, 0]);
}
// iterate all triangles
for(let i = 0; i < this.num... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calculateNormals(vs, ind) {\n const\n x = 0,\n y = 1,\n z = 2,\n ns = [];\n\n // For each vertex, initialize normal x, normal y, normal z\n for (let i = 0; i < vs.length; i += 3) {\n ns[i + x] = 0.0;\n ns[i + y] = 0.0;\n ns[i + z] = 0.0;\n }\n\n // We work on triads of vertices t... | [
"0.7715733",
"0.76786983",
"0.7507997",
"0.74545765",
"0.7343411",
"0.7326943",
"0.7208531",
"0.7159334",
"0.71020293",
"0.7061532",
"0.69203687",
"0.68919325",
"0.68716913",
"0.6761215",
"0.66428787",
"0.6631742",
"0.6549095",
"0.6448056",
"0.64424",
"0.64204377",
"0.6390859... | 0.808145 | 0 |
Get Triangle's Vertex by Index | getTriangleVertexByIndex(idx) {
if(idx < 0 || idx >= this.numFaces) {
throw 'Invalid idx!';
}
let res = [];
for(let i = 0; i < 3; i++) {
res.push(this.faceData[idx * 3 + i]);
}
return res;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getVertex(index, out = null) {\n const { _coords } = this\n if (index >= 0 && index < this.numVertices) {\n out = out || new Point()\n out.setTo(_coords[index * 2], _coords[index * 2 + 1])\n return out\n } else throw new RangeError('[RangeError] Invalid index: ' + index)\n }",
"getVertex... | [
"0.71571517",
"0.6835174",
"0.6550189",
"0.65093017",
"0.6507052",
"0.64493245",
"0.63427234",
"0.6218861",
"0.6209353",
"0.6142599",
"0.6094925",
"0.6073701",
"0.60601413",
"0.60446084",
"0.5992558",
"0.5979786",
"0.5940516",
"0.59013915",
"0.58948225",
"0.5878966",
"0.58689... | 0.74643314 | 0 |
Computer Normal N for the Triangle using N = (v2 v1) cross (v3 v1) | computeNormalForTriangles(v1, v2, v3) {
let sub1 = glMatrix.vec3.create();
let sub2 = glMatrix.vec3.create();
glMatrix.vec3.subtract(sub1, v2, v1);
glMatrix.vec3.subtract(sub2, v3, v1);
let res = glMatrix.vec3.create();
glMatrix.vec3.cross(res, sub1, sub2);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getNormal(v1, v2, v3) {\r\n const s1 = new THREE.Vector3().add(v1).sub(v2);\r\n const s2 = new THREE.Vector3().add(v2).sub(v3);\r\n return new THREE.Vector3().crossVectors(s2, s1);\r\n}",
"static ClacTriNormalByVS(verteies, triangleIndex, resultNormal) {\n let i = triangleIndex * 9;\n Sur... | [
"0.7117973",
"0.70502716",
"0.702358",
"0.67290664",
"0.67122054",
"0.66766757",
"0.66584426",
"0.66078216",
"0.6552235",
"0.6534804",
"0.65129364",
"0.64933324",
"0.64827037",
"0.63755304",
"0.63443875",
"0.63099873",
"0.6276049",
"0.62666935",
"0.6225353",
"0.62092614",
"0.... | 0.7911341 | 0 |
Setup code (run once) Generates line data from the faces in faceData for wireframe rendering. | generateLines() {
for (var f = 0; f < this.faceData.length/3; f++) {
// Calculate index of the face
var fid = f*3;
this.edgeData.push(this.faceData[fid]);
this.edgeData.push(this.faceData[fid+1]);
this.edgeData.push(this.faceData[fid+1]);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"generateLines() {\r\n for (var f = 0; f < this.faceData.length/3; f++) {\r\n // Calculate index of the face\r\n var fid = f*3;\r\n this.edgeData.push(this.faceData[fid]);\r\n this.edgeData.push(this.faceData[fid+1]);\r\n \r\n this.edgeData.pu... | [
"0.71655595",
"0.60113853",
"0.5946732",
"0.57784814",
"0.5710864",
"0.5689254",
"0.5541866",
"0.55392885",
"0.5495787",
"0.54760736",
"0.5469163",
"0.5426942",
"0.5425247",
"0.5417002",
"0.5392521",
"0.53606844",
"0.53594035",
"0.5353052",
"0.5351943",
"0.5351297",
"0.534886... | 0.7170829 | 0 |
Debugging Prints the contents of the buffers to the console for debugging. | printBuffers() {
for (var i = 0; i < this.numVertices; i++) {
console.log("v ", this.positionData[i*3], " ",
this.positionData[i*3 + 1], " ",
this.positionData[i*3 + 2], " ");
}
for (var i = 0; i < this.numVertices; i+... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"printDebugLog() {\n this.printMemoryForDebug(this.memory, this.pointer);\n console.debug(`pointer is at ${this.pointer}`);\n console.debug(`relative base is ${this.base}`);\n console.debug(`flags: J:${this.flags.jumped ? 'X' : '-'}`);\n console.debug(`input queue: ${this.input}`);\n console.debug... | [
"0.69061303",
"0.6532586",
"0.6277641",
"0.6277641",
"0.6221831",
"0.619064",
"0.6141893",
"0.61266726",
"0.612513",
"0.6092779",
"0.6074612",
"0.6071469",
"0.5953053",
"0.59009254",
"0.58849794",
"0.58849794",
"0.58849794",
"0.5867",
"0.58393526",
"0.5837774",
"0.58179927",
... | 0.65690035 | 1 |
Creates an event with a title, description, deadline and time of eating (TOE) for a group. They are all in the request body. For now, the deadline is the same as TOE, since we may want to deprecate the deadline. | function createEvent(req, res, next){
var user = req.session.user;
var title = req.body.title;
var description = req.body.description;
var groupid = req.body.groupId;
var toe = req.body.toe;
var deadline = toe;
Group.findOne({
where: {id: groupid},
include: [{model:U... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addEventToGroup(request, response) {\n\n var data = request.params;\n if (!(data && data.group_id && data.event_id && data.app_id)) {\n console.error('Invalid request received. Missing group or app id');\n response.error('Invalid request received. Missing group or app id');\n return;\n }\n\n\n... | [
"0.6024754",
"0.5971461",
"0.59585667",
"0.58444524",
"0.584335",
"0.56933194",
"0.5692109",
"0.56258667",
"0.56258667",
"0.56218106",
"0.5616749",
"0.5616749",
"0.5616749",
"0.5616749",
"0.5616749",
"0.5616749",
"0.5616749",
"0.5550355",
"0.55125266",
"0.55125266",
"0.545070... | 0.6146704 | 0 |
This class edits the location item. | editLocation() {
let locationsList = this.props.locationsList;
locationsList[this.props.editLocationIndex].name = this.props.locationData.name;
locationsList[this.props.editLocationIndex].address = this.props.locationData.address;
locationsList[this.props.editLocationIndex].coordinates ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"changeLocation(newLocation) {\n this.locationEl.text(newLocation);\n }",
"function updateLocation() {\n var locIx = $(\"#locationSelect\").val() - 1;\n $(\"#latitude\").val(locations[locIx].latitude);\n $(\"#longitude\").val(locations[locIx].longitude);\n $(\"#zoom\").val(locations[locIx].zoom);\n ... | [
"0.66762716",
"0.6573875",
"0.65557927",
"0.6503765",
"0.63957244",
"0.63579035",
"0.62537193",
"0.617313",
"0.61463934",
"0.6135819",
"0.61060643",
"0.6101641",
"0.6094075",
"0.60284925",
"0.59896755",
"0.5939769",
"0.59340376",
"0.5838231",
"0.5808416",
"0.5777334",
"0.5758... | 0.6810953 | 0 |
This function show the embeded google map If it's a "view" mode show the map according to the current coordinates value. If it's "edit" mode show the map according to the edited coordinates value. | showGoogleMap(mode) {
switch ( mode ) {
case this.googleMapMode.edit:
this.props.dispatch({type:LocationActions.ActionTypes.LOCATION.SHOW_GOOGLE_MAP,
googleMapsCoordinates: this.props.locationData.coordinates});
break;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showMap() {\n\n\t\tvar website = getUrlVars()['website'];\n\t\tvar email = getUrlVars()['email'];\n\t\tvar telephone = getUrlVars()['telephone'];\n\t\tvar featureRelId = getUrlVars()['transferId'];\n\t\tvar userSiteId = getUrlVars()['touchId'];\n\t\tvar featureId = getUrlVars()['mId'];\n\t\tvar lat = getU... | [
"0.69605273",
"0.6861896",
"0.6852336",
"0.6799716",
"0.676844",
"0.6685177",
"0.65864617",
"0.65732443",
"0.6544112",
"0.65413445",
"0.65354097",
"0.6524743",
"0.6468738",
"0.64669466",
"0.64654315",
"0.6459112",
"0.64390475",
"0.6433825",
"0.6425024",
"0.6414504",
"0.640497... | 0.72906756 | 0 |
This function shows a modal for editing the item's categories. | showEditCategoriesModal() {
this.props.dispatch({type: LocationActions.ActionTypes.LOCATION.SHOW_LOCATION_EDIT_CATEGORY_MODAL,
actionType: 'edit'});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showCategories() {\n showModal('subjectmenu.html');\n}",
"function openModalUpdateCategories(categoriesId, name, status) {\n\t// show modal\n\t$('#modal-update-categories').modal({\n\t\tshow : 'true'\n\t});\n\n\t$('#modal-update-categories .modal-body').append(\n\t\t\t\"<input name = \\\"id\\\" id = \\... | [
"0.67575777",
"0.67572814",
"0.65531015",
"0.650923",
"0.6364793",
"0.62876576",
"0.6219257",
"0.6215963",
"0.61496824",
"0.61372435",
"0.6121263",
"0.6095447",
"0.60930216",
"0.6054655",
"0.60542613",
"0.6018041",
"0.59353",
"0.59014237",
"0.58728105",
"0.5869006",
"0.585268... | 0.6824619 | 0 |
Javascript Fluid Meter by Angel Arcoraci MIT License | function FluidMeter() {
var context;
var targetContainer;
var time = null;
var dt = null;
var options = {
drawShadow: true,
drawText: true,
drawPercentageSign: true,
drawBubbles: true,
bubbleAmount: 0,
fontSize: "70px",
fontFamily: "Arial",
fontFillStyle: "white",
size: 300,
borderWidth: 25,
backgroundColo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function FluidDynamics() {\n\n console.log(\"Starting fluid dynamics system.\")\n \n // Get some basic info from system.\n var mobile = navigator.userAgent.match(/iPhone|iPad|iPod|Android|BlackBerry|Opera Mini|IEMobile/i)\n this.canvas = document.getElementById('theCanvas');\n this.context = this... | [
"0.6490969",
"0.63716304",
"0.59410375",
"0.5732394",
"0.5715061",
"0.56600595",
"0.56600595",
"0.56600595",
"0.5656849",
"0.565172",
"0.56466293",
"0.5625467",
"0.55921113",
"0.5533288",
"0.5524168",
"0.5516225",
"0.5490633",
"0.54905176",
"0.54873073",
"0.54502153",
"0.5448... | 0.66734016 | 0 |
Factory to find the applicable discount | function DiscountFactory() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDiscount() {\n \n var order = angular.copy(self.order);\n \n if (order.birthday) {\n order.birthday = dateFilter(order.birthday, 'yyyy-MM-dd')\n }\n \n if (!order.services) {\n ... | [
"0.6711933",
"0.6501625",
"0.61939853",
"0.61726105",
"0.6123063",
"0.6109157",
"0.60724694",
"0.6046034",
"0.60370654",
"0.6035171",
"0.6019349",
"0.6005977",
"0.59920305",
"0.59858185",
"0.59680086",
"0.59616417",
"0.5946635",
"0.59132975",
"0.5910049",
"0.5848683",
"0.5835... | 0.6915658 | 0 |
represents 1/4 of the entire arbitrary shape sep_x and sep_y are the distance of this 1/4 shape away from x axis and y axis | function initArbitraryShape(phi1, phi2, sep_x, sep_y, x, y, innerArrow = true) {
var Curve = []
var xTemp = [], yTemp = [];
//when combine the four parts, let innerArrow = false so the inner arrows can be hidden
var innerColor = magenta;
if(!innerArrow){
innerColor = orange;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"dibujar_p() {\n push();\n stroke('black');\n strokeWeight(3);\n translate(this.posx-((this._shape[0].length*this.longitud)/2),this.posy-((this._shape.length*this.longitud)/2));\n for (var i = 0; i < this._shape.length; i++) {\n for (var j = 0; j < this._shape[i].length; j++) {\n i... | [
"0.5454965",
"0.53536826",
"0.5312562",
"0.52815557",
"0.5249024",
"0.52402025",
"0.5210061",
"0.52100354",
"0.51953065",
"0.517164",
"0.51678175",
"0.51668906",
"0.5156307",
"0.51289344",
"0.512626",
"0.5111419",
"0.5110548",
"0.510924",
"0.5108849",
"0.51050395",
"0.5100829... | 0.5995132 | 0 |
read dead write text file and get location of the dead writes in this program | function readDeadWritesFromFile() {
var deadWriteFile = "experiments/dead_writes_location.txt";
var deadWriteFileContent = fs.readFileSync(deadWriteFile, 'utf8');
var getLines = deadWriteFileContent.split(",");
var mainDeadWriteLoc = [];
for (var iLine in getLines) {
var singleLine = g... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTemp() {\n b.readTextFile(w1, printStatus);\n}",
"function getBeastState() {\nreturn fs.readFileSync('beastState.txt','utf8')\n}",
"function main()\r\n {\r\n var filesystem = WScript.CreateObject(\"Scripting.FileSystemObject\");\r\n var each = new Enumerator(filesystem.GetFolder(GetPath... | [
"0.5463933",
"0.5106895",
"0.5034757",
"0.5006489",
"0.4965135",
"0.4933503",
"0.48704395",
"0.48122227",
"0.48068964",
"0.47106814",
"0.46952856",
"0.46534154",
"0.46488908",
"0.46043274",
"0.45905823",
"0.45762423",
"0.45710614",
"0.454154",
"0.45379913",
"0.45293233",
"0.4... | 0.70013815 | 0 |
Match each source code identifier and any associated array indexing. Extract the indicies and recursivly replace them also. | function replaceArrayRefs(text) {
return replaceIdentifierRefs(text, function (id, indx) {
var k, offset, reply;
if ( id === "index" ) { hasIndex = true; }
for ( k = 0; k < indx.length; k++ ) {
indx[k] = replaceArrayRefs(indx[k]);
}
var arg = hash[id];
var dimen;
var joinStr, bracket, fixin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"compileArrayIndexToReg(opts) {\nlet scope = this._scope;\nlet program = this._program;\nlet indexAndExpression = tokenUtils.getIndexAfterTokenPairs(opts.expression, opts.index, [t.TOKEN_BRACKET_OPEN, t.TOKEN_BRACKET_CLOSE]);\nlet indexExpression = indexAndExpression.expression;\nopts.ind... | [
"0.5688895",
"0.5576806",
"0.55404425",
"0.5472409",
"0.51994556",
"0.5057891",
"0.5001953",
"0.48383364",
"0.48343682",
"0.47989768",
"0.47214705",
"0.47114378",
"0.47114378",
"0.47030896",
"0.4663737",
"0.46574265",
"0.4653935",
"0.46328804",
"0.46315712",
"0.46199554",
"0.... | 0.56137735 | 1 |
Reset to Home Page | static resetToHomePage(params) {
const {navigation} = params;
navigation.navigate('Main');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function goToHome() {\n if ($state.is('home')) $state.reload();\n else $state.go('home');\n }",
"function redirectHome() {\n cleanUp();\n $state.go('app.home');\n }",
"function navigateToHome() {\n\t\t\twindow.location = \"/\";\n\t\t}",
"function backToHomeView (... | [
"0.76356643",
"0.75814843",
"0.74665534",
"0.7464031",
"0.73609346",
"0.7202333",
"0.7177994",
"0.71695024",
"0.7137991",
"0.7121739",
"0.70810676",
"0.70491546",
"0.6958128",
"0.694705",
"0.69212276",
"0.68515885",
"0.6831028",
"0.6829247",
"0.68154395",
"0.6800448",
"0.6747... | 0.76281166 | 1 |
React Component for threads | function Thread(props) {
/*TO DO:
-create a 'posted by: user_name' message for threads
-make subcomments dynamic
-make it so user can only like or unlike, not keep adding likes
-make tick function server dependent. Currently clocks tick out of sync b/c they are a ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Thread(props){\n\n\tlet i;\n\tlet threadPosts = [];\n\tfor (i = 0; i < props.posts.length; i++){\n\t\tthreadPosts.push(<ThreadPost data={props.posts[i]} />)\n\t}\n\treturn (\n\t\t<>\n\t\t\t<h1 className=\"header\"> {props.title} </h1>\n\t\t\t{threadPosts}\n\t\t\t<ThreadForm threadID={props.threadID} />\n\... | [
"0.6409182",
"0.60645616",
"0.5984604",
"0.59670335",
"0.5920319",
"0.5861403",
"0.577028",
"0.576378",
"0.56700706",
"0.5633347",
"0.56211257",
"0.562061",
"0.56145453",
"0.55750334",
"0.556214",
"0.55575085",
"0.55575085",
"0.55429786",
"0.55310404",
"0.55205023",
"0.549274... | 0.6386281 | 1 |
Function to add a thread to threads array | function addThread(name, message) {
//make sure thread is not empty...
if (name === '' || message === '') {
alert("Name and message cannot be empty!");
return;
} else {
console.log("User has added a thread...");
};
const date = new Date();
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"initThreads() {\n let initThreads = [];\n initThreads.push(this.createThread(\"run\", \"init\"));\n return initThreads;\n }",
"function addLineToThread(boxes, lineLengths, tolerance, userConstraints, thread, nextBreakpointIndex) {\n let minNextBreakpointIndex = computeMinNextBreakpointIn... | [
"0.6056616",
"0.5630557",
"0.5600455",
"0.5597772",
"0.5582213",
"0.5573335",
"0.55088794",
"0.54642123",
"0.5427671",
"0.534514",
"0.52927274",
"0.5283623",
"0.5272766",
"0.52668506",
"0.5208205",
"0.5198676",
"0.51697135",
"0.5161245",
"0.51445454",
"0.5067655",
"0.50672233... | 0.6111427 | 0 |
returns message displaying how old a date is | function howOld(createdOn) {
// Time constants
const created = createdOn;
const min = 60 * 1000;
const hour = min * 60;
const day = hour * 24;
const week = day * 7;
const week2 = week * 2;
const week3 = week * 3;
const week4 = week * 4;
con... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"dateToDaysAgoMessage(date) {\n let days = this.dateToDaysAgo(date);\n\n if (days == 0) {\n return \"today\"\n }\n else if (days == 1) {\n return days + \" day ago\"\n }\n else {\n return days + \" days ag... | [
"0.7180345",
"0.7036289",
"0.671959",
"0.66805923",
"0.66803825",
"0.6611827",
"0.6493159",
"0.64816374",
"0.6465168",
"0.6421792",
"0.64002585",
"0.6377531",
"0.6358712",
"0.6214318",
"0.6214318",
"0.62030655",
"0.6194225",
"0.61663496",
"0.61398834",
"0.61293787",
"0.611948... | 0.7107458 | 1 |
sends SIP REGISTER request to login | function sipRegister() {
// catch exception for IE (DOM not ready)
try {
// btnRegister.disabled = true;
if (!REG_realm || !REG_impi || !REG_impu) {
txtRegStatus.innerHTML = '<b>Please fill madatory fields (*)</b>';
btnRegister.disabled... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sipRegister() {\n // catch exception for IE (DOM not ready)\n try {\n //btnRegister.disabled = true;\n if (!txtRealm.value || !txtPrivateIdentity.value || !txtPublicIdentity.value) {\n txtRegStatus.innerHTML = '<b>Please fill madatory fields (*)</b>';\n ... | [
"0.7199108",
"0.705465",
"0.7013146",
"0.6965351",
"0.65853614",
"0.6553807",
"0.6418557",
"0.6297937",
"0.6234336",
"0.6223685",
"0.6191828",
"0.61772716",
"0.61772716",
"0.61066973",
"0.60554045",
"0.6045913",
"0.60425556",
"0.60351795",
"0.60148394",
"0.5994842",
"0.599332... | 0.7179321 | 1 |
Share entire desktop aor application using BFCP or WebRTC native implementation | function sipShareScreen() {
if (SIPml.getWebRtcType() === 'w4a') {
// Sharing using BFCP -> requires an active session
if (!oSipSessionCall) {
txtCallStatus.innerHTML = '<i>No active session</i>';
return;
}
if (oSipSes... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sipShareScreen() {\n if (SIPml.getWebRtcType() === 'w4a') {\n // Sharing using BFCP -> requires an active session\n if (!oSipSessionCall) {\n return \"No active session\";\n }\n if (oSipSessionCall.bfcpSharing) {\n if (oSipSessionCall.stopBfcpShare(oCon... | [
"0.64177525",
"0.62708205",
"0.6236008",
"0.61784315",
"0.61064637",
"0.5977625",
"0.5971836",
"0.5937966",
"0.59224415",
"0.5858181",
"0.5828326",
"0.5817173",
"0.577386",
"0.5726959",
"0.5704237",
"0.5703324",
"0.5672174",
"0.5669347",
"0.56587",
"0.56493133",
"0.5629955",
... | 0.6480039 | 0 |
Mute or Unmute the call | function sipToggleMute() {
if (oSipSessionCall) {
var i_ret;
var bMute = !oSipSessionCall.bMute;
txtCallStatus.innerHTML = bMute ? '<i>Mute the call...</i>' : '<i>Unmute the call...</i>';
i_ret = oSipSessionCall.mute('audio'/*could be 'video'*/, bMute);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function unmute() {\n if (currentCall) {\n currentCall.unmuteAudio();\n }\n}",
"function mute() {\n if (currentCall) {\n currentCall.muteAudio();\n }\n}",
"function processMute (data) {\n controls.setMute(data)\n}",
"function sipToggleMute() {\n if (oSipSessionCall) {\n ... | [
"0.78475636",
"0.77943635",
"0.7707865",
"0.7602573",
"0.75837797",
"0.73676866",
"0.73099214",
"0.72504014",
"0.7223948",
"0.7187499",
"0.71636087",
"0.71040934",
"0.7100418",
"0.69934714",
"0.6978672",
"0.6960839",
"0.69493455",
"0.6931536",
"0.69264853",
"0.6914237",
"0.69... | 0.7804957 | 1 |
Callback function for SIP sessions (INVITE, REGISTER, MESSAGE...) | function onSipEventSession(e /* SIPml.Session.Event */) {
tsk_utils_log_info('==session event = ' + e.type);
switch (e.type) {
case 'connecting': case 'connected':
{
var bConnected = (e.type == 'connected');
if (e.session =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _connected(){// send response to agent-js\nutils.fireCallback(UIModel.getInstance().libraryInstance,CALLBACK_TYPES.SIP_CONNECTED,{message:\"SIP connected\"});}",
"function onAccepted(session) {\n //console.log('Call: Accepted', session.request);\n //console.log('To: ', session.request.to.d... | [
"0.7036774",
"0.68074983",
"0.67848736",
"0.6741877",
"0.6663278",
"0.65867823",
"0.64776206",
"0.63917744",
"0.6318281",
"0.6257587",
"0.6208552",
"0.6137409",
"0.6135551",
"0.6130354",
"0.5985807",
"0.59845036",
"0.5981389",
"0.5970508",
"0.5967213",
"0.59318006",
"0.590368... | 0.685915 | 1 |
I apply the remote data to the local scope. | function applyRemoteData( sections ) {
$scope.sections = sections;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resolveWithRemote(data) {\n\t\t\t//remote data must have ID or we're just going to cause a mess\n\t\t\tif (typeof data[this.getPrimaryKey()] === 'undefined') {\n\t\t\t\tthrow('Error: Model - Cannot resolveWithRemote if passed data has no id');\n\t\t\t}\n\t\t\tthis.setData(data);\n\t\t}",
"function loadR... | [
"0.6616893",
"0.63230693",
"0.6319474",
"0.63049847",
"0.6098462",
"0.6078826",
"0.5977436",
"0.58834267",
"0.58033234",
"0.5732365",
"0.5675906",
"0.5652369",
"0.5652369",
"0.5634034",
"0.552063",
"0.55179185",
"0.551062",
"0.5456816",
"0.5440668",
"0.5357285",
"0.5357285",
... | 0.6480509 | 1 |
two arguments argument[1] is string to be translated into pig latin argument two is the type of tag the string is inside of (, , etc) | function replacePig() {
return piglatin(arguments[1]) + '<' + arguments[2] + '>';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wordToPigLatin(word) {\n\n}",
"static translatePigLatin(str) {\n\n // the short form:\n //return str.replace(/(^[aeiou])(.*)/,\"$1$2way\").replace(/(^[^aeiou]+)(.*)/,\"$2$1ay\");\n\n // The readable form:\n function translateWordsStartingWithVowel(str) {\n return s... | [
"0.665018",
"0.6257649",
"0.61841846",
"0.61648476",
"0.61414295",
"0.6138767",
"0.6112261",
"0.60540986",
"0.5997447",
"0.5980907",
"0.59796554",
"0.59736085",
"0.59498477",
"0.5919574",
"0.59137946",
"0.59104943",
"0.5871956",
"0.5868568",
"0.58544105",
"0.5848717",
"0.5827... | 0.71244025 | 0 |
Play the generated seqence | function playGenSeq() {
game.playerTurn = false;
var delay = 500;
for (var j = 0; j < game.genSeq.length; j++) {
if (game.onOrOff) {
var seqIndex = game.genSeq[j];
var padFlash = "shape" + seqIndex.toString();
game.savedTimer.push(windo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function playSequence() {\n if (game.inProgress === true && game.playSequencing === false) {\n game.playSequencing = true;\n function playSeq2(k) {\n setTimeout(\n function() {\n $(\"#\" + game.sequence.colors[k]).fadeTo(0, .75);... | [
"0.7184376",
"0.71044594",
"0.6998158",
"0.69813246",
"0.68099165",
"0.67952317",
"0.6793796",
"0.67276484",
"0.66921335",
"0.66882366",
"0.66805595",
"0.66391486",
"0.6624447",
"0.6585983",
"0.6569369",
"0.6564",
"0.6551634",
"0.6532392",
"0.65022093",
"0.6483312",
"0.645501... | 0.71258897 | 1 |
Add a random 14 number to game.genSeq | function addToSeq() {
var random = Math.floor((Math.random() * 4) + 1);
game.genSeq.push(random);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addRandomNumber(){\t\t\n\tvar index=Math.floor(Math.random() * 4);\n\tsequence.push(index);\t\n}",
"function generateRandomGameSequence() {\n // random number between 0 and 3\n var rnd = Math.floor(Math.random() * 4);\n gameSequence.push(rnd);\n reproduceGameSequence(gameSequence);\n}",
"function ... | [
"0.7996998",
"0.7327359",
"0.7225446",
"0.7218276",
"0.70495355",
"0.6952337",
"0.6854993",
"0.68071795",
"0.67296153",
"0.6700887",
"0.6684171",
"0.6616358",
"0.65415496",
"0.64808756",
"0.64640653",
"0.6457633",
"0.6448792",
"0.64451027",
"0.6436982",
"0.6405765",
"0.639126... | 0.85208774 | 0 |
Clear current score, reset it to "" | function clearScore() {
game.score = 0;
document.getElementById("myScore").value = "--";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearScore() {\n\tscoreCorrect = 0;\n\tscoreSkipped = 0;\n\tupdateScore();\n}",
"function clearScore() {\n initialAndScore.value = \"\";\n}",
"function resetFinalScore() {\n finalScore.textContent = \"\";\n}",
"function clearScore() {\n var finalScore = document.querySelector('#finalScore')... | [
"0.8528492",
"0.8211519",
"0.813815",
"0.8119884",
"0.80817443",
"0.7950904",
"0.7910843",
"0.7850141",
"0.7829644",
"0.7751824",
"0.7744106",
"0.7708639",
"0.7688823",
"0.7652206",
"0.7645362",
"0.7645362",
"0.7613362",
"0.75980055",
"0.75851715",
"0.75644255",
"0.7558282",
... | 0.83636713 | 1 |
Light off a pad, "pad": shape1shape4, "padNum": 14, | function padLightOff(pad) {
document.getElementsByClassName(pad)[0].style.opacity = "0.5";
stopGoodTones();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"pad() {\r\n noStroke(); // Brittany: Added no stroke to paddle\r\n fill(255);\r\n this.y1 = constrain(this.y1, 0, 500);\r\n rect(this.x1, this.y1, this.pw1, this.ph1);\r\n }",
"function colorSketchPad() {\n //clear the previous sketch\n clearPad();\n\n //create the drawing surface based... | [
"0.6990139",
"0.62091273",
"0.61422586",
"0.6074258",
"0.5950779",
"0.57648873",
"0.5759207",
"0.5740646",
"0.572791",
"0.56939566",
"0.5649241",
"0.5622906",
"0.56119263",
"0.55024093",
"0.54527014",
"0.5366754",
"0.5358355",
"0.53391594",
"0.5266227",
"0.52538365",
"0.51612... | 0.6487126 | 1 |
let calcColPointBig = (d: angle, long: number) => (a: angle, c: Point, pair: boolean) => (pair) ? point(c.x + long Math.cos(a + d), c.y + long Math.sin(a + d)) : point(c.x + long Math.cos(a d), c.y + long Math.sin(a d)) let calcColPoint = calcColPointBig(0.15, 30) | function calcColPointBig(d, long) {
return function innner(a, c, pair) {
//d /= 1.005
long /= 1.0001;
return (pair) ?
point(c.x + long * Math.cos(a + d), c.y + long * Math.sin(a + d)) :
point(c.x + long * Math.cos(a - d), c.y + long * Math.sin(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calcColPointBig(d, long) {\n return function innner(a, c, pair) {\n d -= 0.00001; //d /= 1.0001\n long /= 1.0001;\n return (pair) ?\n point(c.x + long * Math.cos(a + d * 1.2) * 3, c.y + long * Math.sin(a + d * 1.2 /*+ Math.random() / 100*/) * 3) :\n ... | [
"0.7701263",
"0.5947708",
"0.5887382",
"0.5845359",
"0.577539",
"0.56582487",
"0.5656604",
"0.5651046",
"0.5633476",
"0.5585821",
"0.55493176",
"0.55400896",
"0.5534259",
"0.5532361",
"0.550345",
"0.5486299",
"0.5486143",
"0.5485445",
"0.5481951",
"0.5480089",
"0.54773194",
... | 0.76951087 | 1 |
let calcColPointBig = (d: angle, long: number) => (a: angle, c: Point, pair: boolean) => (pair) ? point(c.x + long Math.cos(a + d), c.y + long Math.sin(a + d)) : point(c.x + long Math.cos(a d), c.y + long Math.sin(a d)) let calcColPoint = calcColPointBig(0.15, 30) | function calcColPointBig(d, long) {
return function innner(a, c, pair) {
d -= 0.00001; //d /= 1.0001
long /= 1.0001;
return (pair) ?
point(c.x + long * Math.cos(a + d * 1.2) * 3, c.y + long * Math.sin(a + d * 1.2 /*+ Math.random() / 100*/) * 3) :
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calcColPointBig(d, long) {\n return function innner(a, c, pair) {\n //d /= 1.005\n long /= 1.0001;\n return (pair) ?\n point(c.x + long * Math.cos(a + d), c.y + long * Math.sin(a + d)) :\n point(c.x + long * Math.cos(a - d), c.y + long ... | [
"0.76947963",
"0.5947933",
"0.5885923",
"0.58461916",
"0.5774635",
"0.5658031",
"0.5655716",
"0.5650432",
"0.56337434",
"0.55856305",
"0.5548054",
"0.5539944",
"0.5534391",
"0.55310863",
"0.55025697",
"0.54863054",
"0.5486136",
"0.54849684",
"0.5482604",
"0.54790145",
"0.5476... | 0.77009714 | 0 |
generating terrain based on the last point generated | function generateTerrain() {
background(255);
fill(0);
let xOff = start;
//resetting the flag variables and average height variable
highestPoint = height;
flagX = 0;
averageHeight = 0;
rectNum = 0;
for (let x = 0; x < width; x++) {
let y = noise(xOff) * height;
if (y <= highestPoint) {
/... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_createTerrain() {\n // Map data creation\n // The map is a flat array of successive 3D coordinates (x, y, z).\n // It's defined by a number of points on its width : mapSubX\n // and a number of points on its height : mapSubZ\n \n var mapSubX = 200; // point number on X axis\n var mapSubZ ... | [
"0.71608967",
"0.6986651",
"0.6629577",
"0.6573871",
"0.65449226",
"0.63812804",
"0.6338779",
"0.62065953",
"0.6182635",
"0.60382813",
"0.6035778",
"0.5990921",
"0.59410703",
"0.5940791",
"0.58640987",
"0.5797576",
"0.578787",
"0.57847655",
"0.5710752",
"0.5707906",
"0.570575... | 0.70306796 | 1 |
drawing a flag at the highest point on the screen | function drawFlag() {
fill(255,150,0);
strokeWeight(5);
line(flagX,highestPoint,flagX,highestPoint-50);
triangle(flagX,highestPoint-50,flagX+25,highestPoint-40, flagX, highestPoint-30);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderFlagpole()\n{\n checkFlagpole(); \n push();\n strokeWeight(5);\n stroke(180);\n line(flagpole.x_pos, floorPos_y, flagpole.x_pos, floorPos_y-250);\n noStroke();\n fill(250,0, 250);\n if (flagpole.isReached)\n { \n rect(flagpole.x_pos,floorPos_y-250, 50, 50);\n ... | [
"0.7360381",
"0.71824163",
"0.70850873",
"0.70408",
"0.70023483",
"0.66871345",
"0.66160077",
"0.6594641",
"0.649103",
"0.637155",
"0.6078561",
"0.60035336",
"0.59920853",
"0.59911966",
"0.5986286",
"0.5970275",
"0.59696066",
"0.59677476",
"0.5939297",
"0.5919583",
"0.5908976... | 0.80283904 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.