query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
When the custom widget is updated, the Custom Widget SDK framework executes this function first | onCustomWidgetBeforeUpdate(oChangedProperties) {
} | [
"onCustomWidgetBeforeUpdate(oChangedProperties) {\n\n\n\n }",
"function updateWidget()\n {\n //todo\n }",
"onCustomWidgetBeforeUpdate(oChangedProperties) {\r\n\r\n\t}",
"onCustomWidgetAfterUpdate(oChangedProperties) {}",
"onCustomWidgetBeforeUpdate(oChangedProperties) {}",
"onCustomWidgetB... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Used to make a fake box because using slice was making a weird error; Param: boxes, the acutal grid Return: array holding current strings in grid | function makeFakeBox(boxes) {
let arrayFake = []
for (let i = 0; i < boxes.length; i++) {
arrayFake.push(boxes[i].innerText);
}
return arrayFake;
} | [
"function initBoxes() {\n boxes = {};\n for (var i = 0; i < 4; i++) {\n var row = 'abcd'.charAt(i);\n for (var j = 0; j < 4; j++) {\n boxes[row+j] = {x: j, y: i};\n }\n }\n }",
"function setUpGame(){\n\t//Iterate through the grid and draw box... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reusable Circular Bar Chart Component | function componentBarsCircular () {
/* Default Properties */
var width = 300;
var height = 300;
var transition = { ease: d3.easeBounce, duration: 500 };
var colors = palette.categorical(3);
var dispatch = d3.dispatch("customValueMouseOver", "customValueMouseOut", "custom... | [
"function chartBarChartCircular () {\n\n /* Default Properties */\n var svg = void 0;\n var chart = void 0;\n var classed = \"barChartCircular\";\n var width = 400;\n var height = 300;\n var margin = { top: 20, right: 20, bottom: 20, left: 20 };\n var transiti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
redirect to root in seconds | function redirect2root()
{
rd2RootItvl = setInterval('countDown4redirect(5)', 100);
} | [
"function changeWindowToRoot() {\n window.location.replace('/');\n}",
"redirectRootRequest(req, res, next) {\n res.redirect(`${req.url}/index.html`);\n }",
"function redirect(req, res) {\n res.redirect('/');\n }",
"function goToRoot() {\n goTo();\n }",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add shortcode section code | addShortCodeSection(ID) {
var shortcode = `if (get_post_meta($post->ID, '` + ID + `', true)) :
$`+ ID + ` = get_post_meta($post->ID, '` + ID + `', true);
endif;`;
shortcodeArr.push(shortcode);
} | [
"createSection(section) {\n // ˅\n this.builder.push(`* ${section}`); // Section\n this.builder.push(``); // Blank line\n // ˄\n }",
"function appendSection(){\n\t\tvar panelSeklly = '<section>\\n' + \n\t\t\t\t\t' \\n' + \n\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
htmlizer for plain text in escalation notes | function escnotes(txt){
txt=txt.replace(/<!--defang_/g,'<');
txt=txt.replace(/</g,'<');
txt=txt.replace(/-->/g,'>');
txt=txt.replace(/>/g,'>');
txt=txt.replace(/defang_@/g,'@');
txt='<div>'+txt.replace(/\n(Entered on [0-9\-]+ at [0-9\:]+ by .*?)\n/mg,"</div>\n<b class='esc_user'>\$1</b><div clas... | [
"function html(h, node) {\n\t return h.dangerous ? h.augment(node, u('raw', node.value)) : null;\n\t}",
"function tidy_xhtml() {\r\n var text = String(this);\r\n\r\n text = text.gsub(/\\r\\n?/, \"\\n\");\r\n\r\n text = text.gsub(/<([A-Z]+)([^>]*)>/, function(match) {\r\n return '<' + match[1].toLow... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a point down the ray, t units. | pointAlong(t) {
return this.origin.add(this.direction.normalize().scale(t));
} | [
"getPoint(t) { return this.origin.add(this.direction.multiply(t)); }",
"tangentAt(t) {\n assert && assert(t >= 0, 'tangentAt t should be non-negative');\n assert && assert(t <= 1, 'tangentAt t should be no greater than 1');\n\n // tangent always the same, just use the start tangent\n return this.getSt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the final node (in depthfirst evaluation order) that is a descendant of the logical element. As such, the entire subtree is between 'element' and 'findLastDomNodeInRange(element)' inclusive. | function findLastDomNodeInRange(element) {
if (element instanceof Element) {
return element;
}
var nextSibling = getLogicalNextSibling(element);
if (nextSibling) {
// Simple case: not the last logical sibling, so take the node before the next sibling
return nextSibling.previousSi... | [
"rightmostDescendant(node) {\n const outgoing = this.getOutgoing(node)\n if (outgoing.length == 0) return node\n return this.rightmostDescendant(outgoing[outgoing.length - 1])\n }",
"findLastNode() {\n return this.findNodes().reverse()[0];\n }",
"get lastChild() { ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Force a thunkish thing until WHNF | function __(thunkish,nocache)
{
while (thunkish instanceof $)
thunkish = thunkish.force(nocache);
return thunkish;
} | [
"function Fay$$force(thunk){\r\n return function(type){\r\n return new Fay$$$(function(){\r\n Fay$$_(thunk,type);\r\n return new Fay$$Monad(Fay$$unit);\r\n })\r\n }\r\n}",
"function thunk(thing) {\n\treturn function(callback) {\n\t\tconsole.log(\"trying\")\n\t\tlongWalk(thing,callback)\n\t}\n}",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes the record of workouts held in local storage and sends them to MongoDB. | saveToMongo(workoutId) {
let finalVal;
// Get all values for keys in local storage in the current exercise list.
const exNames = this.state.exercises.map(exObj => {
return exObj.exerciseName
})
AsyncStorage.multiGet(exNames, (err, store) => {
// Map over the return values array and return... | [
"async function saveWorkout() {\n const name = workoutName;\n const data = {\n name: name\n };\n console.log(data);\n let response = await fetch(`/api/workouts/`,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(data)\n })\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns the removed card | removeCard(card) {
const cardIndex = this.findCardIndex(card);
if (cardIndex !== -1)
return this.cards.splice(cardIndex, 1).pop();
else
throw new Error(`card: ${card.type} cannot be removed as it is not found.`)
} | [
"removeCard(card) {\n var index = this.hand.indexOf(card);\n return this.hand.splice(index,1)[0];\n }",
"removeCard() {\n delete this._response.card;\n }",
"removeCard(leavingEmpty = false){\r\n if (this.card){ //If it contains a card, remove it\r\n let card = this.card;\r\n card.i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set Destinataires rapport PDF | function set_destinataires_pdf()
{
RMPApplication.debug ("begin set_destinataires_pdf");
var my_pattern = {};
var options = {};
col_destinataires_pdf_tpi.listCallback(my_pattern, options, set_destinataires_pdf_ok, set_destinataires_pdf_ko);
RMPApplication.debug ("end set_destinataires_pdf");
} | [
"save_pdf () {\n this.pdf_canvass.save(\"offer_tag_document.pdf\"); // will save the file in the current working directory\n\t}",
"function gerarPdf(texto){\n var docDefinition = {\n content: [texto]\n };\n \n var now = new Date();\n \n var pdfDoc = printer.createPdfKitDocument(docDefinition);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create an object and pass the values in the text fields to that object asking admin that he exactly want to delete store manager by using sweetalert if admin gives cancel then store manager will not delete if admin gives ok the values in the object is send to the delete end point by using axios if the success value tha... | onSubmit(e){
e.preventDefault();
const storemanager = {
userid: this.state.userid,
username: this.state.username,
contact: this.state.contact,
email: this.state.email,
password: this.state.password
}
console.log(storemanager);... | [
"function makeDelete(){\r\n\t\t console.log('call make delete function....');\r\n\t\t console.log(self.selected_receipt);\r\n\t\tif(self.selected_receipt.length == 0 ) {\r\n\t \t\tself.message =\"Please select atleast one record..!\";\r\n\t\t\tsuccessAnimate('.failure');\r\n\t\t} else {\r\n\t\t\tvar activate_flag... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end of file// start of file Object > Segment A Segment stores and acts on a piece of a Path according to the mathmatical definition of a Bezier curve. Paths in Glyphr Studio are a collection of Path Points, which themselves contain a point and two handles. Bezier curves, on the other hand, are represented as two points... | function Segment(oa){
// debug('\n SEGMENT - START');
oa = oa || {};
this.objtype = 'segment';
this.p1x = numSan(oa.p1x) || 0;
this.p1y = numSan(oa.p1y) || 0;
this.p2x = numSan(oa.p2x) || this.p1x || 0;
this.p2y = numSan(oa.p2y) || this.p1y || 0;
this.p3x = numSan(oa.p3x) || 0;
this.p3y = numSan(oa... | [
"function Segment(i,e,t,n){this.path=i,this.length=i.getTotalLength(),this.path.style.strokeDashoffset=2*this.length,this.begin=\"undefined\"!=typeof e?this.valueOf(e):0,this.end=\"undefined\"!=typeof t?this.valueOf(t):this.length,this.circular=\"undefined\"!==n?n:!1,this.timer=null,this.animationTimer=null,this.dr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array of the input's parent schemas starting from the root, and ending with the input itself's schema. | getSchemaList(schema, rootSchema) {
const parentFormGroupKeys = schema.name
.replace(/\[['"]?([^'"\]])['"]?]/g, '.$1')
.split('.');
const parentSchemaList = parentFormGroupKeys
.map((group, index) => parentFormGroupKeys
.slice(0, index)
... | [
"parents()\n\t{\n\t\tlet list = [];\n\n\t\tlet ref = this;\n\t\ttree.findConnections({node2: ref})\n\t\t\t.forEach(connection =>\n\t\t{\n\t\t\tif (list.indexOf(connection.outputPlug.node) == -1)\n\t\t\t\tlist.push(connection.outputPlug.node);\n\t\t});\n\n\t\treturn list;\n\t}",
"getChildSchemas() {\n return se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create helper function to append schedules to members | async function appendSchedules(members) {
return Promise.all(
members.map(async (member) => {
const schedules = await db("schedules")
.select("*")
.where({ member_id: member.id });
member.schedules = sche... | [
"addToSchedule()\n\t{\n\t\t//Simple For Loop Through All Office Hour Data:\n\t\tthis.state.officeHours.forEach(function(officehour){\n\t\t\tofficehour.addToSchedule()\n\t\t})\n\t}",
"static async addSchedule(req, res) {}",
"createSchedulesFromList() {\n _forEach(SpawnPatternCollection.spawnPatternModels,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creates article element and calls all functions needed to create a note | function createNote(obj, type ) {
let article = document.createElement("article");
article = articleAttributes(article);
article.appendChild(createDiv1(obj));
article.appendChild(createDiv2(type, article));
article.appendChild(createBtnConfirm());
return article;
} | [
"createNote() {\n // set properties\n console.log(\"create note\");\n let popupElem = $(Constants.DOMStrings.notePopup);\n $(popupElem).css('background-color', '#ffffff');\n $(popupElem).find(Constants.DOMStrings.notePopup_title).html('xNotes: The Coolest Note App!');\n $(p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
temporary helper to check if we already have the message in our feed cache | function messageIsCached(state, a) {
if (!a) return false
for (var i=0; i < state.feed.getLength(); i++) {
var b = state.feed.get(i)
if (util.toHexString(a.signature) == util.toHexString(b.signature)) {
return true
}
}
return false
} | [
"function cachedJsonCheck(cacheKey, msg) {\n var newJson = JSON.stringify(msg);\n if (cachedJson[cacheKey] === newJson) {\n return true; // cached\n }\n cachedJson[cacheKey] = newJson;\n return false; // not cached, send (cache already updated)\n }",
"function Ad... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
multiplyAll:list>number Multiplica todos los elementos de una lista. S function multiplyAll(list) multiplyAll([1,2,3])>6 multiplyAll([0,1])>0 multiplyAll([1,1,5])>5 | function multiplyAll(list) {
if(length(list)==1) {
return first(list);
} else {
return first(list) * multiplyAll(rest(list));
}
} | [
"function multiplyAll(...args) {\n let result = 1;\n args.forEach((element) => {\n result *= element;\n });\n\n return result;\n}",
"function multiplyAll(numbers) {\n var product = 1;\n numbers.forEach(function (number) {\n product *= number;\n });\n return product;\n}",
"function mult... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Detects whether an element's content has vertical overflow | function hasVerticalOverflow(element) {
return element.clientHeight < element.scrollHeight;
} | [
"function hasVerticalOverflow(element) {\n return element.clientHeight < element.scrollHeight;\n}",
"function hasVerticalOverflow(element) {\n return element.clientHeight < element.scrollHeight;\n}",
"function isOverflown(element) {\r\n return element.scrollHeight > element.clientHeight || element.scroll... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Start animation interval timer and store refernce for later use (to stop interval). | function start () {
animationInt = window.setInterval(animationManager, animatorIntervalTime);
} | [
"function startAnimation() {\n\tintervalRef = setInterval('animateSprite()',200);\n\t}",
"startTimer() {\n if (!this.interval) return;\n this.updateTimer();\n }",
"function startAnimation() {\n const animation = animate(selectedAnimation());\n\n if (interval === null && index === 0) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
draws the arms and hands of the clock based on the hands properties. computes the area that can be used to move each hand. | function setHands() {
drawHand(hands.minute.radius, hands.minute.color, hands.minute.angle);
drawHand(hands.hour.radius, hands.hour.color, hands.hour.angle);
hands.hour.area = getHandArea(hands.hour.radius, hands.hour.angle);
hands.minute.area = getHandArea(hands.minute.radius, hands.minute.angle);
$.event.trigger... | [
"function drawShape(hands) {\n fill(255, 0, 0);\n // Each hand object contains a `landmarks` property,\n // which is an array of 21 3-D landmarks.\n for (var i = 0; i < hands.length; i++) {\n var landmarks = hands[i].landmarks;\n\n for (var j = 0; j < landmarks.length; j++) {\n var [x, y, z] = landma... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=== Tools ============================================================================================= Tool for trigger creation USE: insist() controller.when: function to check triggering. The first time the when returns true the "do"" method will be executed controller.do: function with logic to execute when "when" ... | function insist(ctrl) {
var controller = {
when: function () {
return true;
},
execute: function () {
},
each: 20
}.merge(ctrl);
controller.check = function () {
if (!this.when())
setTimeout(t... | [
"enterTrigger_when_clause(ctx) {\n\t}",
"function checkTriggers(){\n\t\t\t\tif (!$scope.field.triggers) return;\n\t\t\t\t\n\t\t\t\t/* Process each trigger */\n\t\t\t\tangular.forEach($scope.field.triggers, function(val, index){\n\t\t\t\t\tvar fireTrigger = false;\n\t\t\t\t\t/* Parse conditions */\n\t\t\t\t\tangul... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the selectedPicture to be the picture that was just clicked. If votable, the vote button will be displayed. | function updateSelectedPicture(picture, votable) {
$("#selectedPictureImg").attr("src", picture.children()[0].src);
$("#caption").text(picture.children()[0].alt);
clickedPicture = picture;
if (votable) {
$("#voteButton").show();
} else {
$("#voteButton").hide();
}
} | [
"votePicture() {\r\n // get the url of the state.currentPictureURL\r\n const pictureURL = this.state.currentPictureURL;\r\n this.pushVoteToFirebase(pictureURL);\r\n // decrement votes remaining for this session\r\n const newVotesRemaining = this.state.votesRemaining - 1;\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper to clear selected after add or update | function clearSelected() {
selectedUser = null;
selectedUserId = null;
editIndex = null;
} | [
"clearSelectedItems() {\n this.selection = Object.create(null);\n }",
"clearSelection() {\n this.selected = null\n }",
"clearSelection() {\n if (!this.disallowEmptySelection && (this.state.selectedKeys === 'all' || this.state.selectedKeys.size > 0)) {\n this.state.setSelectedKeys(new... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to check if user is over budget and if so, show the yaBroke window | function checkOverBudget(){
if (wbi <= 0){
$("#yaBroke").css("display", "flex");
$("#yaBrokeFlash").css("display", "flex");
};
} | [
"function checkBust() {\n if (playerScore > 21) {\n document.getElementById(\"result\").innerHTML = \"Busted!\";\n document.getElementById(\"result-description\").innerHTML = \"Sorry, looks like you busted! Want to play again?\";\n endGame();\n }\n }",
"function c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Defining method allLetter with parameter job | function allLetter(job){
var letters = /^[A-Za-z]+$/;
if (job.value.match(letters)){
return true;
} else {
alert('Occupation must be alphabet characters');
return false;
}
} | [
"function letterGenerator(letter) {\n\n}",
"function e(letters) {\n\n}",
"function H(letters) {\n\n}",
"wordLettersGenerator(){\n var wordArr = this.word.split(\"\");\n for (var i = 0; i < wordArr.length; i++){\n var newLetter = new Letter(wordArr[i]);\n this.wordLetters.pu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Chapter 101 RopeGroup Load unknown remaining twin | function C101_KinbakuClub_RopeGroup_LoadRemainingTwin() {
if (C101_KinbakuClub_RopeGroup_LeftTwinKidnapped || C101_KinbakuClub_RopeGroup_LeftTwinReleased) {
C101_KinbakuClub_RopeGroup_CurrentStage = 450;
C101_KinbakuClub_RopeGroup_LoadRightTwin();
}
else C101_KinbakuClub_RopeGroup_LoadLeftTwin();
} | [
"function C101_KinbakuClub_RopeGroup_Load() {\n\n\t// After intro player has a choice each time she goes to the group, until a twin is released\n\tif (C101_KinbakuClub_RopeGroup_CurrentStage > 100 && C101_KinbakuClub_RopeGroup_CurrentStage < 700) {\n\t\tC101_KinbakuClub_RopeGroup_CurrentStage = 100;\n\t}\n\n\t// Lo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CONCATENATED MODULE: ./src/cluster/components/K8s/Services/ServiceList/ServiceList.jsx / Copyright 2019 Gravitational, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicab... | function ServiceList(props) {
var namespace = props.namespace,
services = props.services;
var filtered = services.filter(function (item) {
return item.namespace === namespace;
});
return /*#__PURE__*/react_default.a.createElement(Table_Table, {
data: filtered
}, /*#__PURE__*/react_default.a.crea... | [
"getComponent(nextState, cb) {\n /* Webpack - use 'require.ensure' to create a split point\n and embed an async module loader (jsonp) when bundling */\n require.ensure(\n [],\n require => {\n /* Webpack - use require callback to define\n dependencies for bundling */\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
findDepUpgrades can add more than one upgrade to allUpgrades | async function findDepUpgrades(dep) {
const npmDependency = await npmApi.getDependency(dep.depName);
const upgrades =
await versionsHelper.determineUpgrades(npmDependency, dep.currentVersion, config);
if (upgrades.length > 0) {
logger.verbose(`${dep.depName}: Upgrades = ${JSON.stringify(upgrades... | [
"async function findDepUpgrades(dep) {\n const npmDependency = await npmApi.getDependency(dep.depName);\n const upgrades =\n await versionsHelper.determineUpgrades(npmDependency, dep.currentVersion, inputConfig);\n if (upgrades.length > 0) {\n logger.verbose(`${dep.depName}: Upgrades = ${JSON.str... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate the end time for a subtitle based on the start time and message length using a very simple formula. Most of the logic here is making sure to handle overflows from seconds > minutes > hours correctly. | function calculateEndTime(startTime, message) {
const reg = /(\d+):(\d+):(\d+),000/;
const match = startTime.match(reg);
let addTime = 5 + (0.2 * message.length);
let seconds = parseInt(match[3]) + addTime;
let minutes = Math.floor(parseInt(match[2]) + Math.floor(seconds / 60));
seconds %= 60;
let millis ... | [
"function calcEndTime(start, duurtijd) { return (parseInt(start.split(\":\")[0], 10) + parseInt(duurtijd, 10)) + \":\" + start.split(\":\")[1]; }",
"generateSubtitleTimeCodeStr(subtitle)\n\t{\n\t\tlet timeCodeStr;\n\n\t\ttimeCodeStr = ('00' + subtitle.start.getHours()).substr(-2, 2) + ':';\n\t\ttimeCodeStr = time... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renames directory and confirms that an alert dialog is shown. | async function renameDirectoryFromDirectoryTreeAndConfirmAlertDialog(newName) {
const appId = await setupForDirectoryTreeContextMenuTest();
await navigateWithDirectoryTree(appId, '/My files/Downloads/photos');
await renamePhotosDirectoryTo(appId, newName, false);
// Confirm that a dialog is shown.
await rem... | [
"function renameDirectoryFromDirectoryTreeAndConfirmAlertDialog(newName) {\n var windowId;\n return setupForDirectoryTreeContextMenuTest().then(function(id) {\n windowId = id;\n return navigateWithDirectoryTree(windowId, '/photos');\n }).then(function() {\n return renamePhotosDirectoryTo(windowId, newNa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is to generate bins sorted by Pick Sequence number | function getBinsBypickSeqNo(binArr,loc)
{
var binNewinOrder = new Array();
var binText = new Array();
var finalBin = new Array();
var filter = new Array();
nlapiLogExecution('DEBUG','loc ',loc);
filter.push(new nlobjSearchFilter('internalid',null, 'anyof', binArr));
if(loc!=null && loc!='')
{
filter.push(ne... | [
"makeBin(dataSorted, lower, upper) {\n // initialize new bin\n var bin = {\n lower: lower,\n upper: upper,\n amount: 0\n };\n // count number of observations in each bin\n for (let x of dataSorted) {\n if (x > upper) break;\n if (x > lower) bin.amount += 1;\n }\n\n retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
we use it to delete/undo the last step while user accidently added a emoji in wrong place | function deleteEmoji() {
if(undo_control == true){
working.once('value', (snapshot) => {
const ourData = snapshot.val();
console.log('You received some data!', ourData);
const ourKeys = Object.keys(ourData);
var lastIndex = ourKeys.length - 1;
var k = ourKeys[lastInd... | [
"undo() {\n // ˅\n if (this.pastCommands.length !== 0) {\n this.pastCommands.pop();\n }\n // ˄\n }",
"undoAddTags (text) {\n\n let textContainer = document.querySelector(\"#\" + text)\n\n if (this._history.length !== 0 ) {\n this._redo.push(t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
clear search related cache | function clearSearchCache() {
$rootScope.searchString = null;
$rootScope.currentCategory = null;
$rootScope.filters = null;
$rootScope.cheapestPrice = null;
$rootScope.preferredPrice = null;
$rootScope.preferredCurrency = null;
$rootScope.cache = null;
} | [
"function clearSearchResults() {\n searchResultsCache.length = 0;\n // Remove all existing search results\n while (resultsSectionElem.firstChild) {\n resultsSectionElem.removeChild(resultsSectionElem.firstChild);\n }\n }",
"clearSearchResults() {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Devuelve el indice del elemento de la lista que corresponde a la clave. | findIndex(elementos, clave) {
for (var i = 0; i < elementos.length; i++) {
if (elementos[i].clave == clave)
return i;
}
return -1;
} | [
"function obtenerPosicionListaEditable(clave, lista){\n this.posicion = 0;\n if (lista.codSeleccionados().length > 0){\n for(var k=0;k<lista.datos.length;k++) {\n if (lista.datos[k][0] == clave) {\n posicion=k;\n break;\n }\n\t\t\t} ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find objects in a Tiled layer that containt a property called "type" equal to a certain value | function findObjectsByType(type, map, layer) {
var result = new Array();
map.objects[layer].forEach(function(element){
if(element.properties.type === type) {
//Phaser uses top left, Tiled bottom left so we have to adjust
//also keep in mind that the cup images are a bit smaller than the ti... | [
"function findObjectsByType(type, map, layer) {\n\treturn map.objects[layer].filter(element => {\n\t\tif (element.type === type) {\n\t\t\t//Phaser uses top left, Tiled bottom left so we have to adjust the y position\n\t\t\t//also keep in mind that the cup images are a bit smaller than the tile which is 16x16\n\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Uses the twitch API to see if a given twitch streamer is online. Modifies the "Online" database. INPUT: A document containing information from the "Players" database about a specific twitchUsername, a specific lolAccount to look up. OUTPUT: Maintains the "Game" database with twitch streamers that are in a League game. | function checkIfInGame(data, lolAccount) {
var apiQuery = "";
apiQuery = "https://" + data.region + "." + riotAPI + servers[data.region] + "/" + lolAccount + "?api_key=" + apiKey;
var riotRequest = https.get(apiQuery, function(res) {
var riotData = '';
/* Append the twitch stream data */
res.... | [
"function checkIfOnline(callback) {\n var interval = setInterval(function() {\n client.api({\n url: 'https://api.twitch.tv/kraken/streams/' + auth.username.toLowerCase(),\n method: 'GET',\n headers: {\n 'Accept': 'application/vnd.twit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add new Wallet Transaction | addWalletTransaction(payload) {
return this.request.post('transaction', payload);
} | [
"function addTransaction(tx) {\n\n\t // Get user's secret key\n\t keychain.requestSecret(id.account, id.username, function (err, secret) {\n\t if (err) {\n\t console.log(\"client: txQueue: error while unlocking wallet: \", err);\n\n\t return;\n\t }\n\n\t var transaction = ripple.T... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the current audio object | getAudioObject() {
return app.audioObject;
} | [
"get audioContext() {\n return this.context;\n }",
"getPlayingAudio() {\n return SoundManager.get().items[this.getPlayingKey()]\n }",
"getAudioContext() {\n return this.audioCtx;\n }",
"function CurrentMediaAudio(programIndex) {\n return ATMPlayer.CurrentMediaAudio(programIndex);\n}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
resetGroups() Resets all unlocked sliders in each group to equal values. If an array of groups is provided, will only reset those. Parameters: groups............(Object) containing all of the groups group.............(Array) groups names | function resetGroups(groups, group){
let reset = typeof group === "undefined" ? Object.keys(groups) : [group];
for (i in reset){
let keys = [];
let total = 0;
//console.log('group:', groups[reset[i]])
for (j in groups[reset[i]]){
!groups[reset[i]][j].lock ? keys.push(j) : null;
... | [
"function clear_groups()\r\n {\r\n clear_resources();\r\n\r\n // Remove all groups\r\n $('ul', access_groups).empty();\r\n\r\n // Set the selected group to nothing\r\n selected_group = null;\r\n }",
"resetActiveGroups... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the right header to indicate to GitHub API the targeted version. | function setGitHubApiVersionHeader(config) {
if (gitHubApiUtils.isGitHubApiUrl(config.url)) {
config.headers['Accept'] = gitHubApiVersionHeader;
}
return config;
} | [
"function setGitHubApiVersionHeader(config) {\n if (gitHubApiUtils.isGitHubApiUrl(config.url)) {\n config.headers['Accept'] = gitHubApiVersionHeader;\n }\n return config;\n }",
"function DocSearchVersionHeader({version, isLast}) {\n const versions = isLast ? [version, 'latest']... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make a retweet with a Id of a tweet. | function retweet(retweetId){
Twitter.post('statuses/retweet/', {
id: retweetId
}, function(err, response) {
if (err) {
console.log('Something went wrong while RETWEETING...');
console.log(err);
}
else if (response) {
console.log('Retweeted!!!');
console.log(response)
}
});
} | [
"function retweet(tweetId) {\n T.post('statuses/retweet/:id', {\n id: tweetId\n }, ((err, data, response) => {\n if (err) {\n console.log('Something went wrong:\\n', err);\n } else {\n console.log('RETWEET SUCCESSFUL !!!');\n }\n }));\n}",
"function retweet(tweet) {\n twitter_writer.po... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This let's you add items. Pass the arguments as strings and it will add to the inventory and the list of available actions. It incorporates the strings well enough to make them keywords. | function youGotAnItem(itemName, itemAction) {
if (inventory.includes(itemName) === true) {
$(".big-text").hide().html('You already have that.').fadeIn(800);
} else {
// This may need refactor later with new setup.
availableActions.pop();
availableActions.push('<li>');
... | [
"function _addToInventory(items) {\n if (typeof items === 'string') items = [items];\n inventory = inventory.concat(items);\n }",
"function addItem() {}",
"function addInventoryItem() {\n\n\tpromptUserNewItem();\n\n }",
"function addToInventory() {\n\titemNames = [];\n\titemInfo = [];\n\tvar ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create plot of price paid in different auction vs. density of area | function makePlot(bids) {
var margin = {top: 20, right: 20, bottom: 30, left: 40},
width = 760 - margin.left - margin.right,
height = 338 - margin.top - margin.bottom;
/*
* value accessor - returns the value to encode for a given data object.
* scale - maps value to a visual display encoding... | [
"function tete() {\n const callPriceDataFromDB = () =>\n fetchDataFromDB()\n .then(prices => {\n prices.forEach(price => state.ticks.push(price))\n constructBidArrays(state.ticks)\n })\n\n function createPlot(plotName, plotData, layout) {\n Plo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set point on map | function setPointOnMap(ax, ay) {
myMap.geoObjects.removeAll();
var onePoint = new ymaps.Placemark(
[ay, ax], {},
{
preset: "islands#redIcon",
});
myMap.geoObjects.add(onePoint);
myMap.setCenter([ay, ax], 16);
} | [
"function setMarker(point) {\n\n }",
"function setMapPointCoordinate(coordinate){\n\n map.setCenter(coordinate);\n map.setZoom(12);\n // var map = new google.maps.Map(document.getElementById('map'), {\n // zoom: 11,\n // center: coordinate\n // });\n var marker = new google.maps.Marker({\n po... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function for display tvshow image and summary | function displayTvShow() {
$.ajax({
url: `http://api.tvmaze.com/shows/${$show_id}`,
type: "GET",
dataType: "json",
}).done(function (response) {
$show_title.append(`<p>${response.name} ⭐ ${$show_rating}</p>`);
$show_img.append(`<img src='${response.image.original}' class='img-fluid' alt=... | [
"function displayImage(img) {\n\tdisplayBar.querySelector('img').setAttribute('src', img.getAttribute('src').replace('small', 'large'));\n\tdisplayBar.querySelector('img').setAttribute('alt', img.getAttribute('alt'));\n\tdisplayBar.querySelector('figcaption').innerHTML = img.getAttribute('alt');\n}",
"function fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return true if the given string is a palindrome. // Otherwise return false. | function palindrome(str) {
// Good luck!
return true;
} | [
"function isPalindrome(str) { }",
"function canStrBecomePalindrome(str) {}",
"function isPalindrome(str) {\n\n}",
"function isPalindrome(str) {\n // implementation\n}",
"function palindrome(string) {\n let processedContent = string.toLowerCase();\n return processedContent === reverse(processedContent);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collect (and optionally limit) all unique pivot values. | function pivotKeys(key$$1, limit, pulse) {
var map = {},
list = [];
pulse.visit(pulse.SOURCE, function(t) {
var k = key$$1(t);
if (!map[k]) {
map[k] = 1;
list.push(k);
}
});
// TODO? Move this comparator to vega-util?
list.sort(function(u, v) {
retur... | [
"function Pivot_pivotKeys(key, limit, pulse) {\n var map = {},\n list = [];\n\n pulse.visit(pulse.SOURCE, function(t) {\n var k = key(t);\n if (!map[k]) {\n map[k] = 1;\n list.push(k);\n }\n });\n\n // TODO? Move this comparator to vega-util?\n list.sort(function(u, v) {\n return (u<... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add users to newly created SPGroup | function AddUsersToGroup(spuUsers)
{
usersList = "";
var url = _spPageContextInfo.siteAbsoluteUrl + "/_api/web/sitegroups/getByName('" + $scope.newGrpName + "')/users";
for (var userCount = 0; userCount < spuUsers.length; userCount++)
{
if (spuUsers... | [
"function addUserToGroup(userID, userGroup){\r\n\tvar userInfo = getUserInfo_v2(userID); // gets User Active Directory Data since SPServices requires it for adding to groups.\r\n\t\t\t\t\t\t\t\t\t\t // userInfo.Name is the SharePoint AD Login Name\r\n\t$().SPServices({\r\n\t\toperation: \"AddUserToGroup\",\r\n\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Step 3: rename AdsManagerLogger.xxx to this.props.ama.logger.xxx | function _renameAdsManagerLoggerCall(j, root) {
const loggerCalls = root.find(j.MemberExpression, {
object: { name: "AdsManagerLogger" }
});
if (loggerCalls && loggerCalls.length > 1) {
loggerCalls &&
loggerCalls.replaceWith(path => {
return j.memberExpression(j.memberExpression(j.memberExp... | [
"function LoggerManager() {}",
"addBetterLoggingMixins(log) {\n log.genLog = ((replaceFn, ...params) => {\n if (params[0]) {\n const data = Object.assign({}, params[0]);\n if (typeof params[0] !== 'string') {\n if (params[0] instanceof Error) {\n params[0] = JSON.stringif... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
loads the employee list for the admin | function loadEmployeeList() {
let xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
// define functionality for response
if (xhr.readyState == 4) {
// check response status
switch (xhr.status) {
case (200):
let myArr = JSON.parse(xhr.responseText);
for ( let idx in myArr) {
... | [
"function getEmployees() { Model.getAllEmployees(renderPage); }",
"function getEmployees() {\n\t\t\temployeeService.getEmployees().then(function(data) {\n\t\t\t\tvm.employees = data;\n\t\t\t});\n\t\t}",
"function loadEmployees() {\n API.fetchEmployees()\n .then((res) => {\n return setEmployee({\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds radio group functionality for specified button group | function addRadioGroupFunctionality(buttonGroupClassName) {
let buttonGroup = $(buttonGroupClassName).children();
for (let i = 0; i < buttonGroup.length; i++) {
buttonGroup[i].addEventListener("click", function () {
let current = $(buttonGroupClassName + " .btn--stripe-active")[0];
... | [
"function skRadioButtonGroup() {\n this._radioButtons = [];\n\n this.addRadioButton = function (btn) {\n btn._parentGroup = this;\n this._radioButtons.push(btn);\n }\n\n this.onSetSelected = function (selectedBtn) {\n var i;\n for (i = 0; i < this._radioButtons.length; i++) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collection of all defined accumulations. | get accumulations() {
return this.getNodeByVariableCollectionId('accumulations').variableCollection;
} | [
"collect() {\n const collected = [];\n for (const x of this.iter) {\n collected.push(x);\n }\n return collected;\n }",
"async collect() {\n const collected = [];\n for await (const x of this.iter) {\n collected.push(x);\n }\n return collected;\n }",
"function accumulators(_, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setupHTMLPointers() store all the pointers of html elements | function setupHTMLPointers() {
$body = $('body');
$front = $("#front");
$left = $("#left");
$right = $("#right");
$back = $("#back");
$down = $("#down");
$up = $("#up");
$end = $("#end");
dirArray = [$front, $left, $back, $right, $down, $up, $end]; // store objTrigger container in the array
$invento... | [
"function bindElements() {\n pageElement = document.getElementById(PAGE_ID);\n listElement = pageElement.querySelector('ul');\n deviceNameElement = pageElement.querySelector('#device-info-name');\n deviceStatusElement = pageElement.querySelector('#device-info-status');\n deviceAdd... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate hash method name by method name by yhongm | static generateHashMNameByMName(name) {
return `yrv_${YrvUtil.getHashCode(name)}`
} | [
"hash() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4()}${s4()}${s4()}`;\n }",
"function hashAlgorithm() {\n var matches = accessToken.mac_algorithm.match(/(sha-\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Print the summary of a LayersModel object. | function printSummary(model, lineLength, positions,
// tslint:disable-next-line:no-any
printFn) {
if (printFn === void 0) { printFn = console.log; }
var sequentialLike = isModelSequentialLike(model);
// Header names for different log elements.
var toDisplay = ['Layer (type)', 'Output shape', 'Param #']... | [
"function summary(){\n tfvis.show.modelSummary({name: 'Model Summary'}, model);\n}",
"function getLayerSummary(layer) {\n let outputShape;\n if (Array.isArray(layer.outputShape[0])) {\n const shapes = layer.outputShape.map(s => formatShape(s));\n outputShape = `[${shapes.join(', ')}]`;\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
_populateVoice Description: Create a new voice for a new measure in the paste destination | _populateVoice(voiceIndex) {
this._populateMeasureArray();
const measures = this.measures;
let measure = measures[0];
let tickmap = measure.tickmapForVoice(this.destination.voice);
let voice = this._populatePre(voiceIndex, measure, this.destination.tick, tickmap);
let startSelector = JSON.parse(... | [
"_populateVoice(voiceIndex) {\n this._populateMeasureArray();\n const measures = this.measures;\n let measure = measures[0];\n let tickmap = measure.tickmapForVoice(this.destination.voice);\n let voice = this._populatePre(voiceIndex, measure, this.destination.tick, tickmap);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
changeSettingsPane(id) is called when a settings page will be changed | function changeSettingsPane(id) {
// Turn all divs off
document.getElementById("generalSettingsDiv").style.display = "none";
document.getElementById("wordsSettingsDiv").style.display = "none";
document.getElementById("pagesSettingsDiv").style.display = "none";
// Turn selected div on
document.getElementById(id)... | [
"function showSettingsPane(name) {\n\tcurrentPane = name;\n\t[].forEach.call(document.querySelectorAll('.settings-pane'), function (el) {\n\t el.style.display = 'none';\n\t});\n\tvar el = document.getElementById(name);\n\tel.style.display = 'block'\n}",
"function onSettingsPageUpdated(tabId, changeInfo, tab) {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Rule 4: HORIZONTAL LINE SMUSHING (code value 2048) Smushes stacked pairs of "" and "_", replacing them with a single "=" subcharacter. It does not matter which is found above the other. Note that vertical smushing rule 1 will smush IDENTICAL pairs of horizontal lines, while this rule smushes horizontal lines consisting... | function vRule4_Smush(ch1, ch2) {
if ( (ch1 === "-" && ch2 === "_") || (ch1 === "_" && ch2 === "-") ) {
return "=";
}
return false;
} | [
"function getHorizontalSmushLength(txt1, txt2, opts) {\n if (opts.fittingRules.hLayout === FULL_WIDTH) {return 0;}\n var ii, len1 = txt1.length, len2 = txt2.length;\n var maxDist = len1;\n var curDist = 1;\n var breakAfter = false;\n var validSmush = false;\n var seg... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Unificar en una array las x1 y f1 Ej: xi = [1,2,3] fi = [1,3,2] > expandir(xi, fi) = [1, 2, 2, 2, 3, 3] | function expandir(xi, fi) {
let expandir = [];
for (i=0; i<xi.length; i++){
for(a=0; a<fi[i]; a++) {
expandir.push(xi[i]);
}
};
return expandir;
} | [
"static Expand(A, expandx, expandy) {\n\n\t\tvar outputx = A[0].length * expandx;\n\t\tvar outputy = A.length * expandy;\n\n\t\tvar output = this.Create(outputy, outputx);\n\n\t\tfor (var y = 0; y < A.length; y++) {\n\t\t\tfor (var x = 0; x < A[0].length; x++) {\n\t\t\t\tfor (var SZy = 0; SZy < expandy; SZy++) {\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generateVerification creates a random string for including in the OAuth2 request, which is then validated in the response. | function generateVerification () {
var verification = ''
var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
for (var i = 0; i < 32; i++) {
verification += possible.charAt(Math.floor(Math.random() * possible.length))
}
return verification
} | [
"function generateVerification() {\n var verification = \"\";\n var possible =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < 32; i++) {\n verification += possible.charAt(\n Math.floor(Math.random() * possible.length)\n );\n }\n return verification;\n}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Indicates whether a dark theme is currently in use. | function is_using_dark_theme() { return localStorage.getItem("theme") === "dark"; } | [
"function inDarkMode() {\n let style = getComputedStyle(document.documentElement);\n // (Note that this must compare the computed 'color' and 'background-color'\n // properties because those will be normalized to rgb() style; custom\n // properties like '--in-content-page-color' are returned as written.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves the SerializedProperty that defines the end range of this property. | GetEndProperty() {} | [
"get end() {\n return this.ranges.length ? this.ranges[ this.ranges.length - 1 ].end : null;\n }",
"get end() {\n return this.start + this.length;\n }",
"get activeRangeEnd() {\n return this.activeRangeEnd$.value;\n }",
"getEnd() {\n if (this._end === null) {\n this._end ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
highlight the given sequence | function hSeq(seq) {
/** unhighlight all others */
for (var i=0; i<sequences.length; i++)
hmatch(sequences[i], false);
/** highlight selected sequence */
hmatch(sequences[seq], true);
} | [
"function highlight() {\r\n for (var i = 0; i < wordsInSpan.length; i++) {\r\n if (\r\n wordsInSpan[i].getAttribute(\"middleOffset\") >=\r\n lineOffsetsTop[index] &&\r\n wordsInSpan[i].getAttribute(\"middleOffset\") <=\r\n lineOffsetsBottom[index]\r\n ) {\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes an array of nodes or a single node and adds to the tree in the location specified by the parent and left sibling IDs | function addNode(leftSibID, parentID, node) {
// saveTree = savedtree || scope.main.regexTree;
if (Array.isArray(node)) {
//removeNode from modify-tree factory returns an array that is in order. we need to add last item first, so this for loop
//starts at the end of the array... | [
"newSibling() {\n if (this.selectedNodes.size == 1 && this.notesText.hidden == true) {\n for (let node of this.selectedNodes) {\n const nodeID = node.getAttribute(\"idr\").slice(5); // the IDR will be like groupxxx\n const nodeObj = this.d3Functions.objects[nodeID].JSobj; // Get the object rep... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
isComplete f() / Toggles a check mark based on state of todo item: completed or not Arguments: event the event object passed in from listener that is parsed i.e e.target | function isComplete(e){
if(e.target.classList == "todo active") {
e.target.className = 'todo';
console.log("item already completed");
}
else{
e.target.className = 'todo active';
console.log('now complete');
}
} | [
"function markCompleted(e) {\n const todoId = e.target.parentElement.getAttribute(\"id\");\n const todo = todoAppData[selectedProjectId].todos.filter(\n (e) => e.todoId === todoId\n )[0];\n if (!todo.completed) {\n todo.completed = true;\n e.target.innerHTML = \"Undone\";\n } else {\n todo.complete... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A dropin replacement for the D3 axis, supporting the decorate pattern. | function axis$1 () {
var decorate = noop,
orient = 'bottom',
tickFormat = null,
outerTickSize = 6,
innerTickSize = 6,
tickPadding = 3,
svgDomainLine = d3.svg.line(),
ticks = _ticks();
var dataJoin$$ = dataJoin().selector('g.tick').eleme... | [
"function FunctionPlotterAxis(options) {\n let axis,\n axisType,\n fontSize,\n fontWeight,\n position,\n tickCount,\n where;\n\n axis = this;\n\n init(options);\n\n return axis;\n\n function init(options) {\n _required(options);\n _defaults(options);\n\n position = definePosition();\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
unsubscribe of new advert echo | unsubscribeToNewAdvert (VueRootInstance, companyId) {
if (this.getEcho(VueRootInstance)) {
VueRootInstance.$options.$echo.leave('update-adverts-for-company.' + companyId)
}
} | [
"async unsubscribe() {\n await this._client.helix.webHooks.sendHubRequest({\n mode: 'unsubscribe',\n topicUrl: this.topicUrl,\n callbackUrl: this.callbackUrl\n });\n }",
"function unsubscribe(id, del) {\n BGcall(\"unsubscribe\", {id:id, del:del});\n}",
"functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes all the periods of a course and returns a string of these periods | function coursePeriods(periodsArray){
var nbPeriods=periodsArray.length;
var texte="";
for (var i=0;i<nbPeriods;i++){
texte+=periodsArray[i]
if (i!==nbPeriods-1){
texte+=", "
}
}
return texte;
} | [
"function getPeriodText(param) {\n\n if (!param.startDate || !param.endDate)\n return \"\";\n\n var fromDate = Banana.Converter.toDate(param.startDate);\n var toDate = Banana.Converter.toDate(param.endDate);\n var firstDayOfPeriod = 1;\n var lastDayOfPeriod = new Date(toDate.getFullYear(),toDate.getMonth()+... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the active domain, if one exists | function getActiveDomain() {
utils_1.logger.warn('Function `getActiveDomain` is deprecated and will be removed in a future version.');
var sentry = getMainCarrier().__SENTRY__;
return sentry && sentry.extensions && sentry.extensions.domain && sentry.extensions.domain.active;
} | [
"function getActiveDomain() {\n var sentry = getMainCarrier().__SENTRY__;\n\n return sentry && sentry.extensions && sentry.extensions.domain && sentry.extensions.domain.active;\n}",
"function getActiveDomain() {\n var sentry = getMainCarrier().__SENTRY__;\n return sentry && sentry.extensions && sentry.ext... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Private Methods / Get Albums by Date | function getAlbumsByDate(callback){
var response = {"errorMessage":null, "results":null};
try {
mongoClient.connect(database.remoteUrl, database.mongoOptions, function(err, client){
if(err) {
response.errorMessage = err;
callback(response);
}
... | [
"function getSongsByDate(callback){\n var response = {\"errorMessage\":null, \"results\":null};\n try {\n mongoClient.connect(database.remoteUrl, database.mongoOptions, function(err, client){\n if(err) {\n response.errorMessage = err;\n callback(response);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to call 'findLastSnapShotDate.ajaxcchit'(which find the last snapshot date ),retrieve the date and shows it adjacent to the filtered items. | function findLastSnapShotDate(element){
var instAjax = new Ajax.Request(
'findLastSnapShotDate.ajaxcchit',
{
method: 'get',
parameters: 'element='+element,
onComplete: function(req) {
if((req.responseText != "Failure")
... | [
"getLastSearchTime(sid){\n\n let items = this.#search_items[sid];\n if (!items){\n return\n }\n let dates = []\n for (var i = 0; i < items.length; i++) {\n dates.push(new Date(this.#items[items[i]].list_start))\n }\n \n var latest = new ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize the Kii SDK and ThingIF SDK Should be the first action your application makes. | initialize(appID, appKey, serverLocation) {
let kiiSite = _kii.KiiSite.US;
let thingifSite = _thingif.Site.US;
if (serverLocation === 'US') {
kiiSite = _kii.KiiSite.US;
thingifSite = _thingif.Site.US;
}
if (serverLocation === 'JP') {
kiiSite = _kii.KiiSite.JP;
thingifSite = _... | [
"function init() {\n /**\n * Get API key and secret.\n */\n var auth = utils.getAuth();\n\n /**\n * Set up the SDK.\n */\n sdk.utils.setup({\n key: auth.key,\n secret: auth.secret,\n });\n\n return {\n out: out,\n sdk: sdk,\n };\n}",
"function init(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
toSource() for type descriptors. Warning: user exposed! | function DescrToSource() {
if (!IsObject(this) || !ObjectIsTypeDescr(this))
ThrowTypeError(JSMSG_INCOMPATIBLE_PROTO, "Type", "toSource", "value");
return DESCR_STRING_REPR(this);
} | [
"function toSource (obj) {\n if (obj.type && obj.type === 'csg') {\n var csg = CSG.fromObject(obj)\n return toSourceCSG(csg)\n }\n if (obj.type && obj.type === 'cag') {\n var cag = CAG.fromObject(obj)\n return toSourceCAG(cag)\n }\n return ''\n}",
"type(source, descriptor, kind = 'default', isTyp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Have the logic for creating grid for role | function createRoleTable() {
var token = getClientStore().token;
sessionStorage.token = token;
totalRecordsize = retrieveRoleRecordCount();
if (totalRecordsize == 0) {
objCommon.displayEmptyMessageInGrid(getUiProps().MSG0231, "Role");
$("#chkSelectall").attr('checked', false);
$("#chkSelectall").attr('disable... | [
"_createGrid() {\n this.gridOption = this.artifactoryGridFactory.getGridInstance(this.$scope)\n .setColumns(this._getColumns());\n //.setMultiSelect()\n //.setBatchActions(this._getBatchActions())\n if(this.features.isGlobalRepoEnabled()) {\n this.gridOption... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PRIVATE METHODS ////////////////////////////////////// Recalibrates axes to be oriented to current this.data rotations | performRecalibration() {
this.sensorRotations.setRotationFromEuler(this.eulerOrigin);
// Apply gyroscope rotations
this.sensorRotations.rotateZ(this.data.alpha * this.RAD);
this.sensorRotations.rotateX(this.data.beta * this.RAD);
this.sensorRotations.rotateY(this.data.gamma * th... | [
"rotate() {\n this.rotateFlag = !this.rotateFlag;\n if (this.rotateFlag) {\n this.drawTmp = this.draw;\n const tmpSize = [this.width, this.height];\n const tmpMargin = this.marginAll;\n this.draw = () => {\n // placeholder for axis to prevent draw Axis\n this.axisHandles.x = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
formatting the URL to add ed2k links to mlDonkey | function getMLDonkeyLink(links) {
// Url to add ed2k links to mldonkey
return emuleUrl + "submit?jvcmd=multidllink&links=" + links;
} | [
"function getCustomLink(links, cat) {\r\n\t// Url to add ed2k links to custom application\r\n\r\n\treturn 'http://192.168.0.43/ed2k.php?cat=' + cat + '&post=' + encodeURIComponent(window.location) + '&ed2k=' + links;\r\n\t//return emuleUrl +'ed2k.php?cat=' + cat + '&post=' + encodeURIComponent(window.location) + '&... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends a post request to back end for accout creation | async createAccount(body){
// console.log("Creating Account...");
data = {
URI: ACCOUNTS,
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: this.buildFormBody(body)
}
return await this.sendRequest(data)... | [
"function CreateBeneficiary() {\r\n var accountNumber = \"\";\r\n var data = {\r\n BeneficiaryAccountNumber : 0, //LONG\r\n DisplayName : \"\"\r\n };\r\n services.postService(apiUrl.beneficiary.Post_Create(accountNumber), data).then(function (response) {\r\n });\r\n}",
"function click... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the TIDO schema currently contains two types of schematron messages: | function getMessageType(schematronRole) {
return schematronRole === 'warning'
? MessageType.WARNING
: MessageType.ERROR;
} | [
"function sendSchema() {\n var schemaObj = reflectionApi.getObjectSchema(obj);\n sendMessage(\"schema\", {schema: schemaObj});\n }",
"function example_publish_message(message_type, result){\n //returns a string like: '{msg: \"hey there\"}'\n var example = message_type_to_example_message[message_type]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
:: child: Datastore / :: transform: KeyTransform | constructor (child /* : Datastore<Value> */, transform /* : KeyTransform */) {
this.child = child
this.transform = transform
} | [
"constructor(child\n /* : Datastore<Value> */\n , transform\n /* : KeyTransform */\n ) {\n this.child = child;\n this.transform = transform;\n }",
"function transformKey(key) {\n\t\t\tif (options.schema) {\n\t\t\t\treturn Query.getQueryPathSubschema(options.schema, key)[1];\n\t\t\t} else {\n\t\t\t\tret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return Observable of data from the serversuccess EntityAction with the given Correlation Id, after that action was processed by the ngrx store. or else put the server error on the Observable error channel. | getResponseData$(crid) {
/**
* reducedActions$ must be replay observable of the most recent action reduced by the store.
* because the response action might have been dispatched to the store
* before caller had a chance to subscribe.
*/
return this.reducedActions$.pip... | [
"getSaveEntitiesResponseData$(crid) {\n /**\n * reducedActions$ must be replay observable of the most recent action reduced by the store.\n * because the response action might have been dispatched to the store\n * before caller had a chance to subscribe.\n */\n return t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an asynchronous decompression stream | function AsyncDecompress(cb) {
this.G = AsyncGunzip;
this.I = AsyncInflate;
this.Z = AsyncUnzlib;
this.ondata = cb;
} | [
"function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }",
"function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }",
"async... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Setup the listeners for this circle | setupListeners() {
var {circle} = this.state;
var {maps, map} = this.props;
if(maps && circle) {
maps.event.addListener(circle, 'radius_changed',e => {
if(typeof this.props.onRadiusChange === 'function')
this.props.onRadiusChange(circle.getRadius());
});
maps.event.addLi... | [
"_setupListeners() {\n this._setupScrollListeners();\n this._setupResizeListener();\n this._setupWheelListener();\n }",
"setupListeners() {\n this.setupLeagues();\n this.setupDrivers();\n }",
"function __setupListeners(){\r\n //Navigation buttons\r\n d3.select('#prev').on('click',... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A contrustor for the p2pserver connecting the blockchain and transaction pool to it. param: blockchain the blockchain associated w/ the p2pserver. transactionPool the transaction pool associated w/ the p2pserver. | constructor(blockchain, transactionPool)
{
this.blockchain = blockchain;
this.blockchain.addBlock([], []);
this.blockchain.addBlock([], []);
this.transactionPool = transactionPool;
this.sockets = [];
} | [
"constructor(blockchain, transactionPool, wallet, p2pServer) {\n this.blockchain = blockchain;\n this.transactionPool = transactionPool;\n this.wallet = wallet;\n this.p2pServer = p2pServer;\n }",
"createTransaction(recipient, amount,blockchain, transactionPool){\n\n this.bal... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lets first create a generic function to paint cells | function paint_cell(x, y, paintColor) {
ctx.fillStyle = paintColor;
ctx.fillRect(x * cw, y * cw, cw, cw);
ctx.strokeStyle = "white";
ctx.strokeRect(x * cw, y * cw, cw, cw);
} | [
"function paint_cell(x, y, type)\n\t{\n\t\tif(type == \"food\") ctx.fillStyle = \"#FF0000\";\n\t\telse if(type == \"p2\") ctx.fillStyle = \"#00FF00\";\n\t\telse if(type == \"p1\") ctx.fillStyle = \"#0000FF\";\n\t\tctx.fillRect(x*cw, y*cw, cw, cw);\n\t\tctx.strokeStyle = \"white\";\n\t\tctx.strokeRect(x*cw, y*cw, cw... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve a Bot from the Manager. | static getBot(id) {
return __awaiter(this, void 0, void 0, function* () {
return BotManager.bots[id];
});
} | [
"function getBotByID(id) {\n\tvar request = new XMLHttpRequest();\n\trequest.open('GET', '/explorer/3bot/' + id, false);\n\trequest.send();\n\tif (request.status != 200) {\n\t\treturn null;\n\t}\n\treturn JSON.parse(request.responseText).record;\n}",
"function bot(){\n if(this.bot === undefined){\n // bot tok... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the site script syntax (JSON) for a specific list | getSiteScriptFromList(listUrl) {
return __awaiter(this, void 0, void 0, function* () {
return yield this.clone(SiteScripts$1, `GetSiteScriptFromList`)
.execute({ "listUrl": listUrl });
});
} | [
"function renderScriptList(slist) {\n return _.map(slist, function(each) {\n return tListItem(each.data);\n });\n }",
"getJavascript() {\n var jsCollection = this.getSectionsOfType('javascript');\n return this.concatenate(jsCollection);\n }",
"function cslGetScriptList(callback) {\n chrome... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a Shop tag with Action 9 (Order Receipt / Confirmed) productID: required. Product ID to set on this Shop tag productName: required. Product Name to set on this Shop tag quantity: required. Quantity to set on this Shop tag productPrice: required. Price of one unit of this product customerID: required. ID of cust... | function cmCreateShopAction9Tag(productID, productName, productQuantity,
productPrice, customerID, orderID,
orderTotal, categoryID,ParentSKU,ParentSKUcatID,ParentSKUflag) {
var index = cmGetProductIndex(productID);
if(index!=-1){
var oldPrice = cmShopPrices[index];
var oldQty = cmShopQtys[index];
var ne... | [
"function cmCreateNewShopAction9Tag(productID, productName, productQuantity, productPrice, customerID, orderID, orderTotal, categoryID, attributes, extraFields) {\n\tif ((typeof(cm_currencyCode) == \"undefined\") || (!cm_currencyCode)) {\n\t\tcm_currencyCode = \"\";\n\t}\n productPrice = productPrice.toString().... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function (called by the New Format button) completely changes the paragraph text along with its font styling. It also changes the ordered list numbering style to "A", which is alphabetical. | function changeFormat() {
document.getElementById("formatP2").innerHTML = "This is the newly formatted paragraph, complete with <br>color change, font change, and <b>bolded letters.</b> Also, <br>notice how the list below changed as well."
document.getElementById("formatP2").style = "color:#6600cc; font-family:seri... | [
"function applyParagraphStyle(pStyle, paragraph){\n $(paragraph).css(\"font-family\", pStyle[\"font-family\"]);\n $(paragraph).css(\"font-size\", pStyle[\"font-size\"]);\n $(paragraph).css(\"font-style\", pStyle[\"font-style\"]);\n $(paragraph).css(\"font-weight\", pStyle[\"font-weight\"]);\n $(parag... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the request came through Layer0 edge. Notes: If the request came through Layer0 edge then `x0version` has been injected. | static isRequestFromEdge(req) {
return typeof req.headers[constants_1.HTTP_HEADERS.x0Version] == 'string';
} | [
"findCurrentLayer0Version() {\n const allPackages = this.layer0AllPackages();\n\n if (isEmpty(allPackages)) {\n throw new MissingLayer0PackagesError(`There is no layer0 packages installed in ${this.path}`);\n }\n\n return allPackages[0][1];\n }",
"function isVersionRequest(req) {\n var ur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end of init function mapReady function that fires when the first or base layer has been successfully added to the map. Very useful in many situations. called above by this line: dojo.connect(map, "onLoad", mapReady) | function mapReady(map){
//Sets the globe button on the extent nav tool to reset extent to the initial extent.
dijit.byId("extentSelector").set("initExtent", map.extent);
//Create scale bar programmatically because there are some event listeners that can't be set until the map is created.
//Just uses a simple ... | [
"function mapReady(map){ \n\n //searchLogic();\t\n\t//Sets the globe button on the extent nav tool to reset extent to the initial extent.\n\tdijit.byId(\"extentSelector\").set(\"initExtent\", map.extent); \n\t\n\t//Create scale bar programmatically because there are some event listeners that can't be set until ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
open the comments of the currently selected story. | function opencomments(upperCase){
clickAnchor(upperCase,getItem("comments"));
} | [
"function openComments(url) {\n\twindow.open(url, 'Comments', 'width=700,height=600,screenX=100,screenY=100,toolbar=0,resizable=1,scrollbars=1');\n}",
"function openComments(url) {\r\n\twindow.open(url, 'Comments', 'width=700,height=600,screenX=100,screenY=100,toolbar=0,resizable=1,scrollbars=1');\r\n}",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the loop variable cannot be used in the condition | checkLoopUsageCondition(stream, node) {
let self = this;
if ((node.is(getAttrType)) && (node.getNode('node').is(nameType)) && (node.getNode('node').getAttribute('name') === 'loop')) {
throw new TwingErrorSyntax('The "loop" variable cannot be used in a looping condition.', node.getTemplateLin... | [
"checkLoopUsageCondition(stream, node) {\n let self = this;\n if ((node.is(get_attribute_1.type)) && (node.getNode('node').is(name_1.type)) && (node.getNode('node').getAttribute('name') === 'loop')) {\n throw new syntax_1.TwingErrorSyntax('The \"loop\" variable cannot be used in a looping c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Can be an object of additional parameters to transfer to the server, or a `Function` that gets invoked with the `files`, `xhr` and, if it's a chunked upload, `chunk` arguments. In case of a function, this needs to return a map. The default implementation does nothing for normal uploads, but adds relevant information fo... | params (files, xhr, chunk) {
if (chunk) return {
dzuuid: chunk.file.upload.uuid,
dzchunkindex: chunk.index,
dztotalfilesize: chunk.file.size,
dzchunksize: this.options.chunkSize,
dztotalchunkcount: chunk.file.upload.totalChunkCount,
dzchunk... | [
"function r_fun_call_multipart(fun, args, handler) {\n testhtml5();\n var formdata = new FormData();\n $.each(args, function (key, value) {\n formdata.append(key, stringify(value));\n });\n return r_fun_ajax(fun, {\n data: formdata,\n cache: false,\n contentType: false,\n pro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When StartDate and EndDate could be free variables, the following code snippet was used, saved for later use if(isNaN(timeDate.getFullYear())) year = "EndYear\n"; else year = ""+ timeDate.getFullYear() + "\n"; if(isNaN(timeDate.getMonth())) month = "EndMonth\n"; else month = ""+ timeDate.getMonth() + "\n"; if(isNaN(tim... | function elementSelectedEndDate(){
var choice, day,month,timeDate,year ;
choice = document.form.endDate.value;
timeDate=new Date("" + choice);
if(isNaN(timeDate.getFullYear())) year = "<Var>EndYear</Var>\n "; else year = "<Ind type=\"integer\">"+ timeDate.getFullYear() + "</Ind>\n ";
if(... | [
"function elementSelectedEndTime(){\r\n\tvar choice, throwAwayDate, hour, minute,timeDate;\r\n\tchoice = document.form.endTime.value;\r\n\tif (!(choice == \"\")) throwAwayDate = \"12/12/2000 \";\r\n\t//Date portion of Date object is not used, only the hours and minutes are used. Date object parses time fairly well.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Normalize the point by dividing by its homogeneous coordinate w | normalize() {
if (this._vector[3] !== 0) {
this._vector[0] = this._vector[0] / this._vector[3];
this._vector[1] = this._vector[1] / this._vector[3];
this._vector[2] = this._vector[2] / this._vector[3];
this._vector[3] = 1;
}
} | [
"function normalize(point) {\n var oneOverLen = 1 / ParticleUtils.length(point);\n point.x *= oneOverLen;\n point.y *= oneOverLen;\n }",
"function normalize(point) {\n const oneOverLen = 1 / length(point);\n point.x *= oneOverLen;\n point.y *= oneOverLen;\n }",
"function normal... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method used to send a command to a namespace | function sendCommandToNamespace(commandKey, params, expires) {
this.publish( createEnvelope('command.' + commandKey, params, expires) );
return this;
} | [
"command(command) {}",
"function sendCommand(command) {\n swfobject.getObjectById('lightIRC').sendCommand(command);\n}",
"send(cmd) {\n if (Object.keys(this.cmds).includes(cmd)) {\n this.write(this.cmds[cmd]);\n } else{\n let c = { name: 'Custom', cmd: cmd, timeout: 1000, re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
doFingerPrinting(); Main function which is reponsible to do the fingerprinting. | function doFingerPrinting() {
var coreAttributesNav = getCoreAttributesNav();
var coreAttributesScr = getCoreAttributesScr();
var pluginsList = getPluginsList();
var mimeTypesList = getMimeTypesList();
var attributes = coreAttributesNav + "," + coreAttributesScr + "," + pluginsList + mimeTypesList;
var key = ""... | [
"function getBrowserFingerPrinting()\n{\n // create canvas element\n var canvas = document.createElement('canvas');\n\n if (typeof(canvas.getContext) === \"undefined\")\n {\n addConsoleLog(\"Not support browser finger printing on current browser.\");\n return \"\";\n }\n\n var ctx;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Computes the geometry and assigns it to the geometry attribute of this class this.fullGeometry is an array with four features: arc (linestring), arc extremity 1 (point), arc extremity 2 (point), chord (linestring) this.geometry is only the arc (for display purposes) | computeGeometry() {
var pointList=[];
var segments = 100;
pointList.push(this.center);
var dAngle= segments+1;
for(var i=0;i<dAngle;i++)
{
var Angle = this.alpha - (this.alpha-this.omega)*i/(dAngle-1);
var x = this.center[0] + this.radius*Math.cos(... | [
"get geometry () {\n let derivedGeom = this._derivedGeometry\n const baseGeom = this._baseGeometry\n if (!derivedGeom || derivedGeom.baseGeometry !== baseGeom) {\n derivedGeom = this._derivedGeometry = Object.create(baseGeom)\n derivedGeom.baseGeometry = baseGeom\n derivedGeom.attributes = O... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |