query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
rectSet An object for tracking collections of intersecting rectangles and the path around them | function rectSet(){
this.covers = [];
this.paths = [];
this.primed = null;
} | [
"function rectSetPath(ctx, rectSet) {\n rectSet.forEach(function(r) {\n ctx.rect(r[0], r[1], r[2], r[3]);\n });\n }",
"function rectChooseMultiObject(){\n\tthis.beginPoint = createVector(0, 0); // is position of mouse when mouse down\n\tthis.endPoint = createVector(0, 0); // is positio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes the fx from the queue | function fx_remove_from_queue(fx) {
var currents = fx.cr;
if (currents) {
currents.splice(currents.indexOf(fx), 1);
}
} | [
"dequeue (fn) {\n this.queue.splice(this.getFunctionIndex(fn), 1)\n }",
"function remove () {\n fsCount[key]--\n\n // Remove from queue when emptied.\n if (fsCount[key] === 0) {\n delete fsQueue[key]\n delete fsCount[key]\n }\n }",
"function remove_file_from_queue() {\n\tvar file_id =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns array of items in_array that are not_in array | array_new_items(in_array, not_in) {
let result = [];
for (let i = 0; i < in_array.length; i++) {
if (not_in.indexOf(in_array[i]) === -1) {
result.push(in_array[i]);
}
}
return result;
} | [
"function arrayNotContains(array, values) {\n if (!(array instanceof Array))\n return false;\n return values.every(value => array.indexOf(value) === -1);\n}",
"function arrayNotContains(array, values) {\n if (!(array instanceof Array))\n return false;\n return values.every(function (valu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a stack parser implementation from Options.stackParser | function stackParserFromStackParserOptions(stackParser) {
if (Array.isArray(stackParser)) {
return createStackParser(...stackParser);
}
return stackParser;
} | [
"function stackParserFromStackParserOptions(stackParser) {\n if (Array.isArray(stackParser)) {\n return createStackParser(...stackParser);\n }\n return stackParser;\n }",
"function _getParser(options){\r\n return (options && options.parser) || setDefaultParser();\r\n}",
"get stack() {\n /... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change provider in home route | function changeProvider(route, provider) {
switch (route.type) {
case 'collections':
case 'collection':
case 'search':
if (route.params === void 0) {
route.params = {};
}
route.params.provider = provider;
}
if (route.paren... | [
"function go_providers() {\n $state.go('providers.list');\n }",
"function setProvider(p) {\n\t\tprovider = p;\n\t}",
"function setProvider(provider) {\n _provider = provider;\n}",
"function registerHomeRoute(\n $stateProvider\n ) {\n $stateProvider.state(\n \"home\",\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Aging LIFO queue A queue where elements will have two fates: > The element is dequeued within a specific peroid of time > A queue specific period of times passes and the element is dequeued. TOOD: Is there a better name? This could also be confused with a LIFO queue where a number of operations occur before evicting el... | function aging_lifo_queue( timer ){
timer = timer || real_clock_timer();
var self = [];
self.timeout = 1000;
self.enqueue = function( element, expiryCallback ){
expiryCallback = expiryCallback || nope;
var expiryClock = timer.expiresAt( self.timeout, function(){
self.splice( self.lastIndexOf( handle ), 1 );... | [
"function TidyFifoQueue() { }",
"timeout() {\n if (this.queue.length === 0 && this.timer !== null) {\n clearTimeout(this.timer);\n this.timer = null;\n return;\n }\n\n const removed = [];\n const now = Date.now();\n\n this.queue.forEach((item) => {\n if (item.timeout <= now) {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ajax adm com post | function ajaxPostAdmin(funcao, array, action){
jQuery(function(){
jQuery.ajax({
url: getUrlController()+"/admin"+action,
dataType: "json",
type: "post",
data:array,
beforeSend: function() {
},
success: function(json){
... | [
"function ajax_post(url,cmd){\r\n var dt = new Date();\r\n url = url + '?t=' + dt.getTime();\r\n var xmlhttp = false;\r\n xmlhttp = (window.XMLHttpRequest)?new XMLHttpRequest():new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n xmlhttp.open(\"POST\", url,false);\r\n xmlhttp.setRequestHeader('Content-Type', 'applic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
3. Display the product of all numbers using reduce Answer: | function reduceProduct() {
const product = numbers.reduce((acc, cur) => {
return acc * cur
})
document.getElementById('reduced').innerHTML += ' ' + product
} | [
"function reduceProduct() {\n const result = numbers.reduce((prev, curr) => {\n return prev * curr\n })\n document.getElementById('reduced').innerHTML += ' ' + result\n}",
"function myReduce() {\n const reducer = (accumulator, currentValue, currentIndex, array) => accumulator * currentValue;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
encode data as json string | _jsonEncode( data ) {
if ( typeof data === 'object' ) {
try { let json = JSON.stringify( data ); return json; }
catch ( e ) { return JSON.stringify( e ); }
}
return '{}';
} | [
"function encode(data) {\r\n if (data == null) {\r\n return null;\r\n }\r\n if (data instanceof Number) {\r\n data = data.valueOf();\r\n }\r\n if (typeof data === 'number' && isFinite(data)) {\r\n // Any number in JS is safe to put directly in JSON... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
API call to backend app to get all publications | getPublications() {
return this.perform('get', '/publications');
} | [
"function getPublications(){\n const AUTHOR = \"Ayoub-Karine\";\n const HAL_API_URL = 'https://api.archives-ouvertes.fr/search/' +\n '?q=auth_t:(\"'+AUTHOR+'\")'+ \n '&fl=docType_s,authFullName_s,title_s,citationRef_s,label_s,label_bibtex,seeAlso_s' +\n '&sort=producedDate_s desc';\n fetch(HAL_API_URL)\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a new instance of a Fullscreen action set | function create(app) {
return new Fullscreen(app);
} | [
"_initFullScreenControl(opt) {\n let topt = {};\n if (opt.hasOwnProperty('className') && opt.className) {\n topt.className = opt.className\n }\n if (opt.hasOwnProperty('label') && opt.label) {\n topt.label = opt.label\n }\n if (opt.hasOwnProperty('labelActive') && opt.labelActive) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Copy placeholder value from clue table to the newly created curr clue. | function copyOrphanEntryToCurr(clueIndex) {
if (!clueIndex || !clues[clueIndex] || !clues[clueIndex].clueTR ||
!isOrphan(clueIndex) || clues[clueIndex].parentClueIndex) {
return
}
let clueInputs = clues[clueIndex].clueTR.getElementsByTagName('input')
if (clueInputs.length != 1) {
console.log('Miss... | [
"updatePlaceholder() {\n if (!this.node.placeholder) {\n const placeholder = this.getPlaceholderFormat();\n this.node.placeholder = placeholder;\n }\n }",
"function addClue () {\n viewModel.selectedClue = {\n name: 'New Clue',\n question: ' ',\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
numberOfAnswers should return an integer that is the number of choices for the current question | function numberOfAnswers () {
return quiz.questions[quiz.currentQuestion].choices.length
} | [
"function numberOfAnswers () {\n return quiz.questions[quiz.currentQuestion].choices.length;\n}",
"function numberOfAnswers() {\n return quiz.questions[quiz.questionIndex].choices.length\n}",
"function numberOfAnswers() {\n return quiz.questions[quiz.currentQuestion].options.length\n}",
"function numberOfC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Selects the first element with a given class name that is a child of a given parent object. | function selectOne(parent, classtext) {
var objects = parent.getElementsByClassName(classtext);
return objects[0];
} | [
"function findClassInChildren(parent, name) {\n\tif ( !parent ) return null;\n\tif ( !parent.childNodes ) return null;\n\tfor (var i = 0, childNode; i <= parent.childNodes.length; i ++) {\n \tchildNode = parent.childNodes[i];\n \t\tif (childNode && name == childNode.className) {\n \treturn childNode;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this lists the intervals of the scale | function listIntervals(scale) {
const intervals = document.querySelector("#scaleIntervals");
if (scale === "major") {
intervals.innerHTML = "P1, M2, M3, P4, P5, M6, M7"
}
else if (scale === "minor") {
intervals.innerHTML = "P1, M2, m3, P4, P5, m6, m7"
}
else if (scale === "majorP... | [
"function calculateIntervals(scale){\n var intervals = [];\n // Setting up scale array for the interval calculation process\n scale.push(scale[0]+12);\n // Calculating interval array\n var prec = scale[0];\n for(var i = 1; i < scale.length; i++){\n intervals.push(scale[i]-prec)\n prec = scale[i];\n }\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete all students that have homework score <= 60 | async function example14() {
try {
const {result} = await studentsCollection.deleteMany({
scores: {
$elemMatch: {
type: 'homework',
score: {$lt: 60}
}
}
});
console.log(`Deleted ${result.n} articles with results lower than 60`);
} catch (error) {
conso... | [
"async function deleteNonEligibleStudents(client, eligibleScore) {\n const result = await client\n .db(\"myDB\")\n .collection(\"enrollment\")\n .deleteMany({ score: { $lt: eligibleScore } });\n console.log(`${result.deletedCount} document(s) was/were deleted`);\n}",
"function filter90AndAbove(score){\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
intWhile(); / You say it's your birthday If 2 given numbers represent your birth month and day in either order, log "How did you know?", else log "Just another day...." | function birthday(month,day){
if (month===7 && day===7){
console.log("How did you know?");
} else console.log("Just another day....")
} | [
"function youSayItsYourBirthday(num1, num2) {\n let month = 8;\n let day = 2;\n if(num1 == month || num2 == month){\n if(num1 == day || num2 == day){\n console.log(\"How did you know?\");\n }\n } else{\n console.log(\"Just another day...\");\n }\n}",
"function yourBi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
API call to get current Account settings | function getAccountSettings() {
APIUtils.getAllUserAccountProperties()
.then((settings) => {
$scope.accountSettings = settings;
})
.catch((error) => {
console.log(JSON.stringify(error));
$scope.accountSettings = null;
})
... | [
"static getSettings() {\n const apiClient = new APIClientFactory().getAPIClient(Utils.getCurrentEnvironment(), Utils.CONST.API_CLIENT).client;\n const promisedSettings = apiClient.then(client => {\n return client.apis['Settings'].getSettings();\n });\n return promisedSettings.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
else if Write a function addWithSurcharge that adds two amounts with surcharge. For each amount less than or equal to 10, the surcharge is 1. For each amount greater than 10 and less than or equal to 20, the surcharge is 2. For each amount greater than 20, the surcharge is 3. Example: addWithSurcharge(10, 30) should re... | function addWithSurcharge(a, b) {
let surcharge = 0;
if (a <= 10) {
surcharge = surcharge + 1;
} else if (a >= 10 && a<=20) {
surcharge = surcharge + 2;
} else {
surcharge = surcharge + 3;
}
if (b <= 10) {
surcharge = surcharge + 1;
} else if (b >= 10 && b <= 20) {
surcharge = surcharge + 2;
} el... | [
"function addWithSurcharge(a, b) {\n\nlet surcharge = 0;\n\nif (a <= 10) {\n surcharge = surcharge + 1;\n} else {\n surcharge = surcharge + 2;\n}\n\nif (b <= 10) {\n surcharge = surcharge + 1;\n} else {\n surcharge = surcharge + 2;\n}\n\nreturn a + b + surcharge;\n}",
"function addWithSurcharge(a, b) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
finction that controls the reel 2 spinning | function spin2(){
i2++;
if (i2>=numeberReel2){
coin[1].play();
clearInterval(reel2);
return null;
}
reelTile = document.getElementById("slot2");
if (reelTile.className=="s1"){
reelTile.className = "s0";
}
let d2 = Math.floor(Math.random() * 5) + 1;
reelTile.className = "... | [
"function Spin() {\n wheel.AcclToRadsPerSec(Math.PI * 2, 3000, new ArcsinMapper_1.default());\n setTimeout(() => {\n console.log(\"slowing down\");\n //note this currently always decels to 0.\n wheel.AcclToRadsPerSec(0, 3000, new ArcsinMapper_1.default());\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
drawsnitch() Draw the snitch as an ellipse with alpha based on health | function drawsnitch() {
image(snitchImage, snitchX, snitchY);
} | [
"function setupsnitch() {\n snitchX = width/5;\n snitchY = height/2;\n snitchVX = -snitchMaxSpeed;\n snitchVY = snitchMaxSpeed;\n snitchHealth = snitchMaxHealth;\n}",
"function drawHat() {\n\tctx.strokeStyle = 'yellow';\n\tctx.strokeRect(player.x, player.y, player.width, player.height / 3);\n\tctx.strokeRect... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function confirms if the use wants to exit the Modal | function AskBeforeExit(modal) {
var question = confirm('Are you sure you want to exit? You might loose the your values!');
if (question == true){
modal.style.display = 'none';
}
return modal.style.display;
} | [
"function onClosePopupYesBtnClick() {\n app.exit();\n }",
"function confirmExit() {\r\n // 'view' and 'status' (which is the instrument status view) do not have editable data, so \r\n // do not prompt user\r\n if (!submitted && !quicklink && componentView != 'view' && componentView != 'status') {\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
USER DATA Get session user ID. | getUserId() {
return this.getSession().user.userId;
} | [
"function getuserid() {\n return getCookie(\"USER_ID\")\n}",
"getUserID() {\n if(this.loggedIn()) {\n const payload = Token.payload(AppStorage.getToken())\n return payload.sub\n }\n }",
"function getUserID() {\r\n\treturn _spUserId;\r\n}",
"async function getUserId(re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The friendly display should use month names instead of numbers and ordinal dates instead of cardinal (1st instead of 1). Do not display information that is redundant or that can be inferred by the user: if the date range ends in less than a year from when it begins, do not display the ending year. Additionally, if the ... | function makeFriendlyDates(arr) {
var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var start = arr[0].split('-'), startStr = '';
var end = arr[1].split('-'), endStr = '';
var result = [];
function toNum(str) {
return +... | [
"function makeFriendlyDates(arr) {\n \n \n var tracker = [];\n \n var output = [];\n \n \n \n \n var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n \n \n \n // Months & Day Variables -------------------------------... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the date of the party. | renderDate() {
return moment.utc(this.props.party.date).format('MM/DD/YYYY [at] h:mm A');
} | [
"function displayDate(date) {\r\n if (showDate === true) {\r\n return (\r\n <Typography color=\"textSecondary\">\r\n Departure Date: {date}\r\n </Typography>\r\n );\r\n }\r\n }",
"function dateRendered() {\r\n \"use strict\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process requests in provided JSON, the "items" field. | processRequests() {
debug('Processing requests ...');
let buffer = [];
const { item } = this.data;
if (!item || !item.length) {
throw new Error('JSON is missing requests ("item" field)');
}
for (const request of item) {
const array = this.processRequest(request);
buffer = bu... | [
"processItems() {}",
"_processItems()\n\t{\n\t\tconst response = {\n\t\t\torigin: \"Form._processItems\",\n\t\t\tcontext: \"when processing the form items\",\n\t\t};\n\n\t\ttry\n\t\t{\n\t\t\tif (this._autoLog)\n\t\t\t{\n\t\t\t\t// note: we use the same log message as PsychoPy even though we called this method dif... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Router function to set public routes. | function setPrivateRoutes() {
// PUT routes
_app.put('/user-admin', UserAdminCtrl.handleRequest);
} | [
"function setPublicRoutes() {\n}",
"initRoutes() {\n }",
"createRouters() {\n for (let resource in this.resources.public) {\n this.addPublicRouter(this.resources.public[resource]);\n }\n for (let resource in this.resources.private) {\n this.addPrivateRouter(this.resources.private[resource]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
stores a custom field for the selected account should one exist | function storeCustomFieldIfExistsThenRedirect() { // TODO: FIX THIS
let acc = JSON.parse(accessAccount());
let shortID = acc.currentAccountID;
let th = accessSignIn();
console.log(th);
th = JSON.parse(th);
let token = th.token;
console.log(token);
let longAccountID = "http%3A%2F%2Faccess.auth.theplatf... | [
"function defaultPaidField() {\n return \"NO\";\n}",
"addAccount() {}",
"function customFieldEdit(userId, doc) {\n const card = ReactiveCache.getCard(doc.cardId);\n const customFieldValue = ReactiveCache.getActivity({ customFieldId: doc._id }).value;\n Activities.insert({\n userId,\n activityType: 'se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If evaluated tag is an img, pass to image reformatting process If anything else, insert contents into inline text frame at new column width and 1px height Apply autoSize object style to inline frame to scale height to contents | function parseTags(nodes, size) {
//Locate Object Styles defined in document
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
var figureWidth = String(textFrameWidth * (columnSizes[size] / 100)) + "in"; //width of inline figure calculated based on column width
//targeting figure thumbnails... | [
"function createImageInfor(img) {\n\t\t\t\tvar html = '';\n\t\t\t\thtml += '<p class=\"stc-imginf\"><span>' + img.width + ' x ' + img.height + '<span></p>';\n\t\t\t\treturn html;\n\t\t\t}",
"function createSummaryAndThumb(pID, isRegular) {\r\n var div = document.getElementById(pID);\r\n var imgtag = \"\";\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Receive damage should receive 1 argument and remove received damage from the health | receiveDamage(damage) {
this.health -= damage;
} | [
"applyDamage(damage){\n this.hp -= damage;\n }",
"takeDamage(damage = 1) {\n if (this.health - damage < 0) {\n this.health = 0;\n } else {\n this.health -= damage;\n }\n }",
"applyDamage(damage) {\n if (this.health > 0) {\n this.health = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the player could use badly romantic arrow in theory | function couldUseBadlyRomanticArrow() {
return have() && haveBadlyRomanticArrowUsesRemaining();
} | [
"isArrowKey( keyCode ) {\n return ( keyCode === KeyboardUtils.KEY_RIGHT_ARROW || keyCode === KeyboardUtils.KEY_LEFT_ARROW ||\n keyCode === KeyboardUtils.KEY_UP_ARROW || keyCode === KeyboardUtils.KEY_DOWN_ARROW );\n }",
"function getBadlyRomanticArrowUses() {\n return Math.max(0, (0, _property.get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
We want to disable legend for small screen sizes | function onPieResize(pie, sizes) {
if(sizes.width < 300) {
pie.options.legend.display = false;
}
else {
pie.options.legend.display = true;
}
} | [
"function minimize() {\r\n\r\n\t\tlegendContent.selectAll('*').style(\"visibility\", \"hidden\");\r\n\t\tplusSignVLine.style(\"visibility\", \"visible\");\r\n\t\tlegendsOn = false;\r\n\t}",
"function showMiniLegend()\n{\n\tvar l_hide = SVGDocument.getElementById(\"legendpanel_detail\");\n\tif (l_hide)\n\t{\n\t \t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if this Bezier curve is approximately a straight line within given tolerance. | isLine(tolerance = 1e-6) {
if (this.dimension !== 2) {
throw new Error("isFlat check only supported for 2D Bezier curves");
}
if (this.degree === 1) {
return true;
}
return helper_1.arePointsColinear(this.cpoints, tolerance);
} | [
"function isCloseToLine(dotloc){\n\n var isClose = false;\n for(var i=0; i<points.length-1; i++){ //check every line segment\n \n var d = calcDist(points[i], dotloc, points[i+1]); //calculate the line segment distance between these points\n\n if(d < TOLERANCE){\n //console.log(\"\\tClose to \"+i+\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If name contains an alphabetical character, check the name checkbox. Used by multiple readers. | function checkName(namestring) {
if (/[A-Za-z]/.test(namestring)) nameCheckbox.checked = true;
} | [
"function checknameControl(name) {\n if (!name) {\n return 'An name is required.';\n }\n return '';\n }",
"function checkName(Name) {\n\tName = document.getElementById('playerName').value;\n\tif (Name == 0) {\n\t\treturn false;\n\t}\n\telse {\n\t\treturn true;\n\t}\n}",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to retrieve wikipedia data | function getWikipediaData(data){
var numberPages = 10;
var searchString = encodeURI(data);
var apiURL = prot + '//en.wikipedia.org/w/api.php?action=opensearch&search=' + searchString + '&profile=fuzzy&suggest=true&format=json';
//formatversion=2 - for json requests
//continue= ... | [
"function getWikiInfo() {\n var url = \"https://en.wikipedia.org/w/api.php?action=query\" +\n \"&list=search&srsearch=\" + attributes.name + \"&srwhat=text&prop=extracts|pageimages|imageinfo|pageterms|info&exintro=1&explaintext=1&exlimit=20&pilimit=20&piprop=original\" +\n \"&generator=geosearc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ACK ALL ALERT ////////////////////////////////////////// triggered by: user button arguemnts: MID what it does: sends a message to the server to ack all the alerts for this box why: to get ridge of all alerts in the alert view at once ///////////////////////////////////////// ACK ALL ALERT | function ack_all_alert(mid){
var cmd_data = { "cmd":"ack_all_alert", "mid":mid};
con.send(JSON.stringify(cmd_data));
show_alarms(mid); // its already open, but this will reset the content
get_alarms(mid); // and this should send us an empty list
} | [
"function ack_alert(id,mid){\n\t// remove field\n\t$(\"#alert_\"+mid+\"_\"+id).fadeOut(600, function() { $(this).remove(); });\n\n\t// decrement nr\n\tvar button=$(\"#\"+mid+\"_toggle_alarms\");\n\tvar open_alarms=parseInt(button.text().substring(0,button.text().indexOf(\" \")))-1;\n\tvar txt=$(\"#\"+mid+\"_toggle_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
12 Create a function called addToEnd that accept an array and value and return the entire array with add this value to the end of this array var nums= [1,2,3,8,9] Ex: addToEnd(nums,55) => [1,2,3,8,55] try more cases by your self | function addToEnd(arr,x){
arr.splice(nums.length-1, 1,x);
return arr;
} | [
"function addToEnd(number,value){\n return number.push(value);\n}",
"function addToEnd(arr,value){\r\n\tarr.splice(arr.length,0,value)\r\n\treturn arr\r\n}",
"function addToEnd(arr, val) {\n\n arr[arr.length - 1] = val\n\n return arr\n}",
"function addToEnd(arr,x){\n\tarr.push(x);\n\treturn arr;\n}",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse a dataflow operator. | function parseOperator(spec, ctx) {
if (isOperator(spec.type) || !spec.type) {
ctx.operator(spec,
spec.update ? operatorExpression(spec.update, ctx) : null);
} else {
ctx.transform(spec, spec.type);
}
} | [
"function parseOperator(spec) {\n const ctx = this;\n if (isOperator(spec.type) || !spec.type) {\n ctx.operator(spec, spec.update ? ctx.operatorExpression(spec.update) : null);\n } else {\n ctx.transform(spec, spec.type);\n }\n }",
"function parseOperatorParameters(spec,ctx){var op,params;i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create two arrays, initialize their elements and display them | function start()
{
var n1 = new Array( 5 ); // allocate five-elements array
var n2 = new Array(); // allocate empty array
// assign values to each element of array n1
var length = n1.length; // get array's length once before the loop
for ( var i = 0; i < length; ++i )
{
n1[ i ] = i;
} // end for
// creat... | [
"function start()\n{\n var n1 = new Array( 5 ); // allocate five-element array\n var n2 = new Array(); // allocate empty array \n \n // assign values to each element of array n1 \n var length = n1.length; // get array's length once before the loop\n\n for ( var i = 0; i < n1.length; ++i ) \n {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate an oldstyle exception return. | function gen_exception_return(/* DisasContext * */ s)
{
gen_op_movl_reg_TN[0][15]();
gen_op_movl_T0_spsr();
gen_op_movl_cpsr_T0(0xffffffff);
s.is_jmp = 2;
} | [
"function Exception() {}",
"static throwError() { return new Error(...arguments); }",
"function Exception() {\n return;\n}",
"function exception_example_return( ) {\n\n\t//\n\t//\tTRY Block\n\t//\n\ttry {\n\t\t//\n\t\t// Werfe eine neue Exception vom Typ MyError\n\t\t//\n\t//\tthrow new MyError(\"Banane\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handles pushing the zoom level up button | function ControllerMagUp(e) {
'use strict';
var sel = this.parentNode.zoomsel;
magzoom += 1;
if (magzoom === 10) {
magzoom = 9;
}
checkZoomLevel(magzoom, this.parentNode);
sel.selectedIndex = magzoom;
zoomImage(sel.options[sel.selectedIndex].value, this.parentNode.canv... | [
"function ControllerMagUp(e) {\n var sel = this.parentNode.zoomsel;\n // removed this... but it requires that magzoom *always* be set correctly\n //if (sel.selectedIndex == 0 || sel.selectedIndex == 1) {\n //magzoom = this.parentNode.canvas.origZoom;\n //}\n\n magzoom += 1;\n if (magzoom == 10)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
chase(chased) Sets velocity to move towards the position of the provided "chased" clown | chase(chased) {
// Determine the distance between the two
let dx = this.x - chased.x;
let dy = this.y - chased.y;
// If x distance is negative, the chaser should move right
if (dx < 0) {
this.vx = this.speed;
}
// If x distance positive the chaser should move left
else {
thi... | [
"function chase(chaser, chased) {\n // Determine the distance between the two\n let dx = chaser.x - chased.x;\n let dy = chaser.y - chased.y;\n\n // If x distance is negative, the chaser should move right\n if (dx < 0) {\n chaser.vx = chaser.speed;\n }\n // If x distance positive the chaser should move le... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines user's email address from a given user ID. | function idToEmail(user_id) {
if (users[user_id].email !== undefined) {
return users[user_id].email;
} else return "None";
} | [
"function IdToEmail(id) {\n const arr = users.filter(u => u.id === id);\n return arr[0] ? arr[0].email : 'unknown_email';\n}",
"function getUserEmail(userId, cb) {\n\t\tmodelUser.findById(userId).select('email').lean().exec(cb);\n\t}",
"function userEmail(userId) { \n user=Meteor.users.findOne(userId);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funcion para crear mediante javascript el listado de canciones | function crearPlayList(){
const listado = document.createElement('ol')
listado.setAttribute("id", 'listadoMusica')
for (let i = 0; i<canciones.length; i++){
const item = document.createElement('li')
item.appendChild(document.createTextNode(canciones[i]))
item.setAttribute("id", canciones.indexOf(cancion... | [
"function crearPlayList(){\n\tconst listado = document.createElement('ol')\n\tlistado.setAttribute(\"id\", 'listadoMusica')\n\tfor (let i = 0; i<canciones.length; i++){\n\t\tconst item = document.createElement('li')\n\t\titem.appendChild(document.createTextNode(canciones[i])) \n\t\titem.setAttribute(\"id\", cancion... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Distinguishes between a V1 and V2 Proxy Integration Request | function isProxyRequestContextV2(ctx) {
return ctx.version === "2.0";
} | [
"function isCommonReqEqual(url, serverInstance) {\n console.info('==> trying to get the url ', url);\n try {\n let isEqual = true;\n\n const directReqObj = serverInstance.getRequestRecord(url);\n const proxyReqObj = serverInstance.getProxyRequestRecord(url);\n\n // ensure the proxy header is correct\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all jobs associated with the given runner_id runner_id String, unique identifier for runner callback f(err, jobs). `jobs` is an array of job's UUIDs. Note `jobs` will be an array, even when empty. | function getRunnerJobs(runner_id, callback) {
client.smembers('wf_runner:' + runner_id, function (err, jobs) {
if (err) {
log.error({err: err});
return callback(new wf.BackendInternalError(err));
}
return callback(null, jobs);
});
} | [
"function runJob(uuid, runner_id, callback) {\n if (typeof (uuid) === 'undefined') {\n return callback(new wf.BackendInternalError(\n 'WorkflowRedisBackend.runJob uuid(String) required'));\n }\n var multi = client.multi();\n\n return client.lrem('wf_queued_job... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Chapter Common Achievements, overrides the image display with any image from any chapter (related to the selected achievement) | function C999_Common_Achievements_ShowImage(ImagePath) {
C999_Common_Achievements_Image = ImagePath;
} | [
"function C999_Common_Achievements_Run() {\n BuildInteraction(C999_Common_Achievements_CurrentStage);\n if ((C999_Common_Achievements_Image !== undefined) && (C999_Common_Achievements_Image.trim() != \"\")) {\n DrawImage(C999_Common_Achievements_Image, 600, 0);\n }\n}",
"function aiImage(aichoice)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the display name paragraph. | function createDisplayNameParagraph(displayName) {
var p = document.createElement('p');
p.innerText = displayName;
return p;
} | [
"function createDisplayNameParagraph(displayName) {\n var p = document.createElement('p');\n p.innerText = displayName;\n\n return p;\n}",
"function createDisplayNameParagraph(key, displayName) {\n var p = document.createElement('p');\n if (displayName) {\n p.innerHTML = displayName;\n } ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Registers an activity event handler for the _end of conversation_ activity. | onEndOfConversation(handler) {
return this.on('EndOfConversation', handler);
} | [
"onEndOfConversationActivity(context) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.handle(context, 'EndOfConversation', this.defaultNextEvent(context));\n });\n }",
"function createEndOfConversationActivity() {\n return { type: index_1.ActivityTypes.End... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
go from a document to a country location | function locateServerFromDoc(doc, cb) {
const out = {
countryName: COUNTRY_UNKNOWN.countryName,
countryCode: COUNTRY_UNKNOWN.countryCode
};
withLocationProperty(doc.rules, (err, value) => {
if(err) {
return cb(err);
}
// TODO: implement x-* field location identification
... | [
"function addLocation(){\n collectionCountries.find().forEach(doc => {\n \n //check if country info has lat and long fields \n if(\"countryInfo\" in doc) {\n const cntryInfo = doc.countryInfo;\n // console.log(cntryInfo);\n if((\"lat\" in cntryInfo && cnt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PROBLEM: Longest Peak we want to find the longest peak basically the length of a consecutive incline then a consecutive decline HIGH LEVEL STRATEGY: find the peak => if i > i 1 && i < i + 1 keep expanding outwards maybe? create a left & right pointer keep moving them outwards until left < left 1 right < right + 1 save ... | function longestPeak(array) {
let maxLen = 0
let len = 0
for (let i = 1; i < array.length - 1; i++) {
if (array[i] > array[i+1] && array[i] > array[i-1]) {
let left = i - 1
let right = i + 1
while (left > 0 && array[left] > array[left - 1]) {
left ... | [
"function longestPeak(array) {\n // a variable to hold the running longest peak length\n let longestPeakLength = 0;\n\n // set a pointer, that starts from idx 1 (second element)\n // and goes till array.length-1 (second last)\n // this pointer will keep track of the element\n // to be checked if a peak or not... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns the value at a given index and column name | getValue(index, column) {
var availableKeys = Object.keys(this.data.intervalls[0]);
if (this.contains(availableKeys,column) == true){
var value = this.data.intervalls[index][column];
return value;
}else{
throw new Error("Column name ["+column+"] is not available. Available columns are: ... | [
"function getFromColumn(headerRow, row, columnName) {\n return row[headerRow.indexOf(columnName)];\n}",
"function getCellValue(row, index){ return $(row).children('td').eq(index).text() }",
"function getCellValue(row, index) {\n return $(row).children('td').eq(index).text()\n }",
"functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=============================================================================== / The get100dData and getP100dData are responsible for fetching the data from the local JSON and displaying the right amount of kilometers in the correct div. However, this isn't the best way to do so since it would require way too many swi... | async function get100dData() {
const response = await fetch(json100DPath)
const data = await response.json()
console.log(data)
switch(speed) {
case 70:
if(isAcOn === false && wheelSize === 19 && speed === 70 && temperature === -10) {
tesla100DRange.innerText = (data[... | [
"function gnarMeterData() {\n gnarRates = [\n 1 * multiplyer,\n 2 * multiplyer,\n 3 * multiplyer,\n 4 * multiplyer,\n 5 * multiplyer\n ];\n\n if (measurements === styleOptions.metric) {\n surfMaximum = Math.round(surfMaximum * 3.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find blockchain storage with count max | findLastStorage(storageInfo) {
let countMaxStorageNumber = -1;
let countMaxStorageName;
for (let storageName in storageInfo) {
if (storageInfo[storageName].storageNumber > countMaxStorageNumber) {
countMaxStorageNumber = storageInfo[storageName].storageNumber;
... | [
"getMostUsedDestCurrency() {\n let maxCurrUsageCount = 0;\n let maxCurrCode;\n for (let curr in this.data.currencies) {\n if (maxCurrUsageCount < this.data.currencies[curr]) {\n maxCurrUsageCount = this.data.currencies[curr];\n maxCurrCode = curr;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a new SP.FieldBoolean to the collection | addBoolean(title, properties) {
const props = {
FieldTypeKind: 8,
};
return this.add(title, "SP.Field", extend(props, properties));
} | [
"static Boolean(name, def = false) { return ModelBase.Field(name, Boolean, def); }",
"function setBool(key, value) {\r var existing = isBoolSet(key);\r try {\r store(key, (value != null && Boolean(value)));\r } \r catch (e) {\r \r }\r return existing;\r}",
"function AntObject_Fie... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
> Set Back to Default > Todo vuelve al valor inicial (Borrar la barra de input, normalmente queda lo ultimo escrito.) | function setBackToDefault() {
// console.log('set Back to Default'); // Para ver en la consola que cuando add un item , se imprime algo.
grocery.value = ''; // Input
editFlag = false; // Para el IF
editID = ''; //
submitBtn.textContent = 'submit'; // Cada vez que suceda un evento, vuelve a decir Submit
} | [
"function setBackToDefault(){\n\tconsole.log('set back to default')\n\tgrocery.value = ''\n\teditFlag = false\n\teditId = ''\n\tsubmitBtn.textContent = 'submit'\n}",
"function restore(ele) {\r\n if (ele.value == '') {\r\n ele.value = ele.defaultValue;\r\n }\r\n}",
"function undoClearInput() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Chapter 101 RopeGroup Player threatens amelia to try stopping her. | function C101_KinbakuClub_RopeGroup_TryStopMe() {
if (ActorGetValue(ActorSubmission) <= 0) {
C101_KinbakuClub_RopeGroup_CurrentStage = 125;
OverridenIntroText = GetText("StoppingYou");
} else LeaveIcon = "Leave";
} | [
"function C009_Library_Yuki_StopPleasure() {\n\t\n\t// Release the player\n\tC009_Library_Yuki_NoPleasure();\n\tActorSetPose(\"\");\n\tCommon_PlayerPose = \"\";\n\n\t// Yuki can fall asleep if she was drugged\n\tif (C009_Library_Yuki_SleepingPillFromPleasure) {\n\t\tOverridenIntroText = GetText(\"DizzySleep\");\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Map function with 2 parameters: array.names and callbackfunction | function myMap(names, cb) {
// New empty array to store the output
var results = [];
// Loops through the array
for (var i = 0; i < names.length; i++) {
// New variable is defined as the callback function taking the item from the loop
var result = cb(names[i]);
// Push the item to the empty array
... | [
"map(callback, ...names) {\n const result = [];\n this.each(\n (path, index, value) => {\n result[index] = callback(path, index, value);\n },\n ...names,\n );\n return result;\n }",
"map(callback, ...names) {\n const result = [];\n this.each((path9, index, value) => {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION register = checks if the user is already registered if registered, returns details of individual and prompts individual for next action if not register, prompts user to input room number | function register(id) {
var user = userExists(id);
var text = 'failed';
if (Object.getOwnPropertyNames(user).length === 0) {
text =
"Welcome to Eusoff Gym Bot. You do not exist in our system yet. Let's change that." +
'\n\n' +
'<b> What is your room number? </b>';
send... | [
"function register(id) {\n var user = userExists(id);\n var text = 'failed';\n\n if (Object.getOwnPropertyNames(user).length === 0) {\n text =\n \"Welcome to Eusoff Gym Bot. You do not exist in our system yet. Let's change that.\" +\n '\\n\\n' +\n '<b> What is your room number? </b>';\n send... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
extract cell reference formula arguments | function getFormulaArgs(formula) {
var args = formula.match(/=\w+\((.*)\)/i)[1].split(getDelimiter());
for (var i = 0; i < args.length; i++) {
var arg = args[i].trim().split('!')
arg[0] = arg[0].replace(/'/g, '')
args[i] = arg.join('!');
}
return args;
} | [
"function returnFormulaArgs(formula) {\n var args = formula.match(/=\\w+\\((.*)\\)/i)[1].split(getDelimiter());\n for (i = 0; i < args.length; i++) {\n var arg = args[i].trim().split('!')\n arg[0] = arg[0].replace(/'/g, '')\n args[i] = arg.join('!');\n }\n return args;\n}",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates and stores the gauge for the wind direction. | static createWindDirectionGauge() {
var gauge = new RadialGauge(this.createWindDirectionOptions('windDirectionCanvas'));
LivewindStore.storeGauge('windDirection', gauge);
gauge.draw();
} | [
"static createWindSpeedGauge() {\r\n var gauge = new RadialGauge(this.createWindSpeedOptions('windSpeedCanvas'));\r\n LivewindStore.storeGauge('windSpeed', gauge);\r\n gauge.draw();\r\n }",
"static createWindSpeedGustsGauge() {\r\n var gauge = new RadialGauge(this.createWindSpeedOpt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Switch to the given tab in a browser and focus the browser window | function focusTab(tab) {
let browserWindow = tab.ownerDocument.defaultView;
browserWindow.focus();
browserWindow.gBrowser.selectedTab = tab;
} | [
"switchFocus() {\n browser.switchWindow(this.pageTitle);\n }",
"function SelectBrowserTab(/**string*/partOfUrl)\r\n{\r\n\tvar iter = 10;\r\n\twhile(iter>0)\r\n\t{\r\n\t\tvar url = Navigator.GetUrl();\r\n\t\tLog(\"Url: \"+url);\r\n if (!url)\r\n {\r\n break;\r\n }\r\n\t\tif(url.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this will blur and darken the elements defined in brackets (e.g. everything except the active step): | function backgroundBlur(allExcept) {
allExcept.forEach(
element => element.style.filter = "blur(0.6vmin) brightness(40%)"
);
} | [
"blur() {\n this.foreground.blut();\n }",
"function applyBlur()\n\t\t\t\t{\n\t\t\t\t TweenMax.set($('.main-img'), {webkitFilter:'blur('+ blurElement.a + 'px)'}); \n\t\t\t\t}",
"function addBlurDarken() {\n\tworkHistorySection.find(\".timeline-icon\").addClass(\"blur-and-darken\");\n\tworkHistorySec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads the System tokens from the database and stores the results in a system_token_request map | function system_token_request() {
var MongoClient = require('mongodb').MongoClient, format = require('util').format;
MongoClient.connect(require('util').format('mongodb://%s:%s/%s', config.mongodb.host, config.mongodb.port, config.mongodb.database), function (err, db) {
if (err) throw err;
var collection = ... | [
"static loadTokensList() {\n const { availableTokens, network, walletAddress } = store.getState();\n\n if (network !== 'mainnet') return Promise.resolve();\n\n const availableTokensAddresses = availableTokens\n .filter(token => token.symbol !== 'ETH')\n .map(token => token.contractAddress);\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function // ajax post call, delete existing image, called if chosen from saveObject function. edit case; | function removeExistingImage(id, which) {
$.ajax({
url: 'Controllers/existEditor/' + which + 'Controller.php',
type: "POST",
data: {id: id, removeExistingImage: true},
success: function (response) {
//no need to response in this case.
},
});
} | [
"function doDeletePhoto(x) {\n let data = { cmd:'delete', PRID: propData.PRID, idx: x };\n var dat = JSON.stringify(data);\n var url = '/v1/propertyphotodelete/' + propData.PRID + '/' + x;\n\n return $.post(url, dat, null, \"json\")\n .done(function(data) {\n // if (data.status === \"s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The cell typically contains a threerow table: order heading, description, and organization information. | function createOrderInfo(oiCell) {
var rows = oiCell.firstChild.rows,
ordInfo = rows.item(0),
descInfo = rows.item(1),
orgInfo = rows.item(2),
order = {},
a;
// Order heading
if(ordInfo) {
order.title = ordInfo.textContent.... | [
"function formatExpandableShortOrders ( rowData ) {\n return '<table class=\"inner-table\">'+\n '<tr>'+\n '<td class=\"column-one\"></td>'+\n '<td class=\"order-sumbmitted-column\"><div class=\"label-text\">Submitted</div> <div class=\"data-text\">'+rowData[2]+'</div></td>'+\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Disable selection of marker pages already in coordinates' table. Page selector is an Asm select. | function disableMarkerPagesSelection() {
var $imCoordinatesTables = $('div.image_marker_main_wrapper table.InputfieldImageMarkers');
$imCoordinatesTables.each(function () {
var $table = $(this);
var $parent = $table.parents('div.image_marker_main_wrapper');
var $allSelected = $table.find("input.marker... | [
"function disable_selection_mode() {\n $('#add-annotation').show();\n $('#cancel-annotation').hide();\n $('.docviewer-annotations').show();\n $('.docviewer-pages').css('overflow', 'auto');\n $('.docviewer-cover').css('cursor', '-webkit-grab');\n $('.docviewer-cover').die('mousedown');\n $('.doc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inserts a new line in the console. | function _insertNewLine()
{
$(_consoleSelector).val($(_consoleSelector).val() + '\n' + _hostAndPrompt);
// Set the limit for erasing the conosole to the beginning of the newline.
_eraseLimit = $(_consoleSelector).val().length;
} | [
"function newLine () {\n console.log('\\n');\n}",
"insertLinebreak() {\n this.insertText('\\n');\n }",
"function insertLine( text ) {\n document.writeln( text );\n }",
"insertLinebreak() {\n let promptCell = this.promptCell;\n if (!promptCell) {\n return;\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removing objects outside of reachable map and those whose should be destroyed according to game logic | function deleteNotNeededGameObjects() {
bulletInfos = bulletInfos.filter(bi => bi.bullet.damage > 0 && !isOutsideOfReachableMap(bi.location));
playerInfos = playerInfos.filter(pi => pi.player.hp > 0 && !isOutsideOfReachableMap(pi.location));
barrierInfos = barrierInfos.filter(bi => bi.barrier.hp... | [
"function editorDestroyAllMapObjects() {\n edPlayerStart.destroy();\n edPlayerStart = null;\n edExit.destroy();\n edExit = null;\n edTiles.forEach(o => {\n o.forEach(s => s.destroy());\n });\n edTiles = [];\n edEnemies.forEach(o => { if (o) o.destroy(); });\n edEnemies = [];\n edPickups.forEach(o => { ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
_endEvent( event ) Properly terminates a DOM event | function _endEvent ( event )
{
if ( event.stopPropagation )
{
event.stopPropagation();
}
else
{
event.cancelBubble = true;
}
event.preventDefault(); // prevents weirdness
return false;
} | [
"function _endEvent ( event )\n\t{\n\t\tif ( event.stopPropagation )\n\t\t{\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tevent.cancelBubble = true;\n\t\t}\n\t\tevent.preventDefault(); // prevents weirdness\n\t\treturn false;\n\t}",
"function finishEvent() {\r\n\tcancelEvent();\t\r\n}",
"exitEv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create Aemet request options | function createAemetOptionsForRequest(url) {
return {
method: 'GET',
qs: {
'api_key': APIKeys.aemet_api_key
},
url: url,
headers: {
'Accept': 'application/json;charset=UTF-8', // Responde text/plain;charset=ISO-8859-15, Aemet debe corregirlo
'Accept-Charset': 'UTF-8',
'cach... | [
"function genBaseOptions() {\n const options = {\n method: 'GET',\n headers: {\n Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',\n 'User-Agent': _.sample(agents),\n Referer: _.sample(referers),\n },\n timeout: MAX_REQUEST_TIMEOUT,\n }\n return opti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function should update the inner html of the dropdown label to be the current value stored in the `semester` variable. | function updateDropdownLabel() {
// code goes here
semesterDropLabel.innerHTML = semester
} | [
"function updateDropdownLabel() {\n // code goes here\n drop_label.innerHTML = semester;\n}",
"function updateDropdownLabel() {\n // code goes here\n dropDownBarLabel.innerHTML = semester\n}",
"function updateSemester() {\n $(\"#semester\")\n .text(\"Year \" + sem.acadYear + \" SEM\" +... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates a password for the current page. Will try to find the username too. | function generate_password() {
base.emit("generate-password", {
url: document.location.toString(),
username: find_username(),
});
} | [
"function generatePassword() {\n var pw = mainForm.master.value,\n sh = mainForm.siteHost.value;\n\n // Don't show error message until needed\n hide(mainForm.pwIncorrect);\n\n // Only generate if a master password has been entered\n if (pw !== '') {\n if (settings.rememberPa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
default config for an insert button group: image | get insertButtonGroup() {
return {
type: "button-group",
subtype: "insert-button-group",
buttons: [this.imageButton, this.symbolButton],
};
} | [
"static defaultButton(img, lnk)\n\t{\n\t\tvar button = document.createElement('div');\n\t\tbutton.setAttribute('class', 'poll-builer-add-button');\n\t\tbutton.innerHTML = 'Add to Poll';\n\t\tbutton.addEventListener('click', function(evt){ evt.preventDefault(); });\n\t\tvar s = button.style;\n\t\ts.cursor = 'pointer... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function will check to see if there are any more pictures before or after the image that is currently being viewed. if there are no images after, it turns the right arrow off if there are no images before, it turns the left arrow off | function check_ends(img){
// check for pictures before
if (img.parent().prev().children().length <= 0){
$('img#arrow-left').addClass('arrow-hide');
} else {
$('img#arrow-left').removeClass('arrow-hide');
}
// check before pictures after
if (img.parent().next().children().leng... | [
"function checkArrows(i) {\n if (i == 0) {\n $('#leftArrow').css('display', 'none');\n $('#rightArrow').css('display', 'inline');\n } else if (i == images.length - 1) {\n $('#rightArrow').css('display', 'none');\n $('#leftArrow').css('display', 'inline');\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Procedure/Functie: toevoegen_tabs_in_grid() Beschrijving: 'Deze functie voegt elke card tab aan de daarvoor bestemde grid' | function toevoegen_card_tabs_in_grid() {
card_tabs_data__arr.map( (card_tab__obj, idx) => {
$x('.grid_' + eval(idx + 1)).append( aanmaken_card_tabs(idx))
})
} | [
"function aanmaken_card_tabs(idx)\n {\n var v_card_tab__html = ''; // deze variable zal de volledige tab structuur bevatten\n var v_card_tab_pgnaam__html = ''; // deze variable bevat de html voor de tab pagina namen\n var v_card_tab_pgcnt__html = ''; // deze variable bevat de htm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create a circular doubly linked list from polygon points in the specified winding order | function linkedList(data, start, end, dim, clockwise) {
var sum = 0,
i, j, last;
// calculate original winding order of a polygon ring
for (i = start, j = end - dim; i < end; i += dim) {
sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);
j = i;
}
// link points into circ... | [
"function linkedList(points, clockwise) {\n var sum = 0,\n len = points.length,\n i, j, last;\n\n // calculate original winding order of a polygon ring\n for (i = 0, j = len - 1; i < len; j = i++) {\n var p1 = points[i],\n p2 = points[j];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
UPDATING INFO If they chose to update employee role... | function directUserFromUpdateInfo () {
if (nextStep == "The role for an existing employee") {
updateEmployeeRole();
}
} | [
"function updateEmployeeRole() {\n console.log(\"employee role updated\"); \n\n}",
"function updateRole() {\n\n}",
"function updateEmployeeRole() {\n inquirer.prompt([\n {\n type: \"list\",\n message: \"Which employee's role would you like to update?\",\n name: \"employeeId\",\n choic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For Updating cart item | function update_cart_item(cart_id){
showHint('quote-item.jsp?cart_id='+cart_id+'&update_cartitem=yes',cart_id,'quote_item');
} | [
"function update_cart_item(cart_id){\r\n showHint('bill-item.jsp?cart_id='+cart_id+'&update_cartitem=yes',cart_id,'bill_item');\r\n}",
"async updateCart_Of_User(){\n }",
"function updateCart(){\n\t\tstorage(['items', 'subtotal'], function(err, col){\n\t\t\t//console.log(\"Cart Collection - \" + JSON.stringif... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: getCurrentFileOrDefault Description: This function will see if TaskPaper is already running. If it is, then it will return the file it has open. Otherwise, it will return the last saved TaskPaper file location. Inputs: | function getCurrentFileOrDefault() {
var pFile = LaunchBar.executeAppleScript('if application "TaskPaper" is running then',
'tell application id (id of application "TaskPaper")',
' set a to file of the front document',
' return POSIX path of a',
'end tell',
'else',
... | [
"function getActiveFile() {\n return activeFile;\n }",
"function getActiveFile() {\n var active = getActiveTab();\n if(!active) {\n return false;\n }\n return lt.objs.tabs.__GT_path(active);\n }",
"function getFilePath()\n{\n\ttry\n\t{\n\t\tatom.workspace.getActiveTextEditor(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check for changes in the settings | function checkForSettingChanges()
{
var changesDetected = false;
g_settingChanges.forEach(function(element)
{
if (element.hasChanged() == true)
{
changesDetected = true;
}
}, this);
var applyButton = document.getElementById('apply_setting_changes');
if (chan... | [
"_settings_changed() {\n \tif (!this.settings_already_changed) {\n \t\tMain.notify(\"Please restart BaBar extension to apply changes.\");\n \t\tthis.settings_already_changed = true;\n \t}\n }",
"settingsChanged() {\n var lastChecksum = this._stateManager.getAtomSettingsChecksum()\n var ch... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if response has success and data fields | function hasSuccessAndData(res) {
assert(res.body.success, "response should have success field");
assert(res.body.data, "response should have data field");
} | [
"function checkData(res) {\n assert.equal(res.body.success, \"true\", \"success should be true\");\n assert.equal(res.body.data, testData.note.data, \"request and response data should be equal\");\n }",
"validateResponse (data) {\n\t\tAssert.deepStrictEqual(data, {}, 'empt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get Argo server namespace | getArgoServerNS() {
return client.query({ query: Query.argoServerNS })
} | [
"async getNamespace(request) {\n return doFetch(request,\"NamespaceService\",\"GetNamespace\")\n\t}",
"async namespace() {\n return this.release.namespaces.get(this.typePrefix);\n }",
"get namespace() {\n return this.extractNamespace(this.options);\n }",
"function getNamespace() {\n\tvar ns =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find deep value diff between frames | valDiff(toUpdate) {
let res = {};
toUpdate.forEach((entity) => {
res[entity.id] = {};
Object.keys(entity).forEach((key) => {
if (this.frameNew[entity.id][key] === undefined ||
this.frameOld[entity.id][key] === undefined) {
res[entity.id][key] = 0;
... | [
"refDiff() {\n let res = {\n toAdd: [],\n toRemove: [],\n toUpdate: [],\n };\n Object.keys(this.frameNew).forEach((key) => {\n !this.frameOld[key] && res.toAdd.push(this.frameNew[key]);\n this.frameOld[key] && res.toUpdate.push(this.frameNew[key]);\n });\n Object.keys(th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a program URL from the site, extract its program ID. If the input does not match the known URL patterns, it is assumed to be a program ID. | function isolateProgramID(programUrl) {
var match = KA_PROGRAM_URL.exec(programUrl);
if (match) {
programUrl = match[1];
}
return programUrl;
} | [
"function isolateProgramID(programUrl) {\n var match = KA_PROGRAM_URL.exec(programUrl);\n if (match) {\n programUrl = match[1];\n }\n\n return programUrl;\n}",
"function isolateProgramID(programUrl) {\n var match = KA_PROGRAM_URL.exec(programUrl);\n\n if (match) {\n programUrl = match[1];\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
OnClickEventHandlers Method for Handling The Loan Application by User, If they don't have exsisting loan then they can get a loan up too double of current bank account balance. If they have a loan then it will reject by displaying a prompt saying that you can't have more then one loan. | function applyLoan() {
// Check Whether User Has Loan
if (hasActiveLoan === false) {
// How Much Loan Do User Want
const amountUserWant = prompt("What is your name?");
console.log(amountUserWant)
// Reject if Asked Amount is more then Double Current Bank Account Balance with P... | [
"function takeLoan() {\n loanSum = 0\n //Loan must be paid back before getting another!\n //only one loan before buying computer\n if (outstandingLoan > 0) {\n alert(\"You already have an unpaid loan\")\n } else if (loanCount > laptopsBought) {\n alert(\"You can't take another loan unti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The first element 10 is the product of all array's elements except the first element 1 The second element 2 is the product of all array's elements except the second element 5 The Third element 5 is the product of all array's elements except the Third element 2. | function productArray(numbers){
let result = []
numbers.forEach((number, index) => {
let res = 1;
numbers.forEach((subNumber, subIndex) => {
if(index !== subIndex) {
res *= subNumber
}
})
result.push(res)
})
return result
} | [
"function productOfArrElements(array){\n return array.reduce(function(preVal, el, i, arr){\n return preVal * el;\n });\n}",
"function productReduce(array) {\n return array.reduce((total, n) => { return total *= n});\n}",
"function productOfAllElements(arr) {\n return arr.reduce(function (tota... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
clear the new task row | function clearNewTaskRow(obj)
{
const kids = obj.children();
const taskNameBox = $(kids[2]);
const taskNameInput = $(taskNameBox.children()[1]);
clearVal(taskNameInput);
const spoon = kids.filter(".spoon");
for (let i = 0; i < spoon.length; i++) {
let spoonBox = $(spoon[i]);
let spoonForm = $(spoonB... | [
"function clearTaskTable() {\n for (let ii = taskTable.rows.length - 1; ii >= 2; ii--) {\n taskTable.deleteRow(ii);\n }\n rowIndex = 2;\n}",
"function clearTaskTable () {\n\t$('#taskDisplay').find('#taskTable').find('tr:not(.head)').remove();\n}",
"static clearField() {\n taskId.value = '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the name of LDAP attribute which holds user password | function getPasswordAttributeName(){
return 'userPassword';
} | [
"get passwordData() {\n return this.getStringAttribute('password_data');\n }",
"get password() {\n return this.hasAttribute('password');\n }",
"function CFDataSourceMenu_getPassword()\r\n{\r\n var retVal = \"\";\r\n \r\n var connRec = MMDB.getConnection(this.getValue());\r\n if (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================================= Parse text blob for receipt properties ============================================================= | function parseReceipt(text, callback) {
var receipt = {};
receipt.title = find.title(text);
receipt.total = find.total(text);
receipt.date = find.date(text);
receipt.fullText = text;
return callback(null, receipt);
} | [
"function getLineProperties(wtext, lineNum) {\n var line = wtext.getLine(lineNum);\n for (var key in lineTypes) {\n var type = lineTypes[key];\n var prefix = type.prefix;\n if (wtext.lineHasPrefix(lineNum, prefix)) {\n var fullPrefix = line.text.match(pr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to create the GSM Alarm | function createAlarm (alarmName, description, alarmType, alarmPath) {
return gsm.addAlarm(prefixURI+"/"+alarmName, //alarmURI
description, //alarmName
alarmPath, //path
"Motorola IRD4500... | [
"function alarmSendCode() {\n var cmd = \"2001\" + alarmPassword + \"00\";\n cmd = appendChecksum(cmd);\n sendToSerial(cmd);\n}",
"function alarmArm() {\n var cmd = \"0331\" + alarmPassword + \"00\";\n cmd = appendChecksum(cmd);\n sendToSerial(cmd);\n}",
"function alarmArmAway() {\n var cmd... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Controller for the Taxonomy Page. To allow the viewers and the functionality to be reused | function vjD3TaxonomyControl(viewer){
var originalurl = "http://?cmd=ionTaxDownInfo&taxid=1&level=2&raw=1";
vjDS.add("","dsTaxTree","http://?cmd=ionTaxDownInfo&taxid=1&level=2&raw=1");
vjDS.add("", "dsRecord", "http://?cmd=ionTaxInfo&taxid=&raw=1")
vjDS.add("","dsTreeViewerSpec","static://type_id,name,t... | [
"function BaseTaxonomiesController($rootScope, $scope, $translate, $location, TaxonomyResource, TaxonomiesResource, ngObibaMicaSearch, RqlQueryUtils, $cacheFactory, VocabularyService) {\n $scope.options = ngObibaMicaSearch.getOptions();\n $scope.RqlQueryUtils = RqlQueryUtils;\n $scope.metaTaxonomy = Taxono... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Returns a list of movies that fit the specified params. callback(error, data) On success, gets the filtered list as JSON On fail, gets the error. | function getFilteredMovies(filter, callback) {
var options = {
method: 'GET',
endpoint:'movies5s',
qs: {ql:""}
};
// Build query from params specified
if (filter.name != '') {
if (options.qs.ql != "") // For multiple parameters
options.qs.ql += ",";
op... | [
"function filterMovies(movies, callback) {\n logger.log(`filterMovies: incoming movies: ${movies.length}`);\n\n // pull values from the config\n const topMoviesIndex = config.movieFilter.topMoviesIndex;\n const minUserScore = config.movieFilter.minUserScore;\n const minCriticScore = config.movieFilter.minCriti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tracks the pointer X position changes and calculates the "endFrame" for the image slider frame animation. This function only runs if the application is ready and the user really is dragging the pointer; this way we can avoid unnecessary calculations and CPU usage. | function trackPointer(event) {
var userDragging = ready && dragging ? true : false;
var demoDragging = demoMode;
if(userDragging || demoDragging) {
// Stores the last x position of the pointer
pointerEndPosX = userDragging ? getPointerEvent(event).pageX : fakePointer.x;... | [
"_updateDragPosition() {\r\n // Current position + the amount of drag happened since the last rAF.\r\n const newPosition = this._wrapperTranslateX +\r\n this._pointerCurrentX - this._pointerLastX;\r\n \r\n // Get the slide that we're dragging onto.\r\n let slideIndex;\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the span element that holds the total amount to pay for the activities. | function createTotalSpan()
{
const span = createAppendElement(activitesFieldset, 'span', 'id', 'subtotal');
span.style.display = 'none';
} | [
"function createTotal() {\n var total = document.createElement(\"label\");\n total.innerHTML = \"Total: $0\";\n total.setAttribute(\"id\",\"total\");\n total.style.fontSize =\"1.2em\";\n total.style.fontWeight =\"400\";\n\n document.getElementsByClassName(\"activities\")[0]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate config from bindings / istanbul ignore next: not easy to test | function makeConfig(binding) {
var config = {};
// If Argument, assume element ID
if (binding.arg) {
// Element ID specified as arg. We must pre-pend #
config.element = '#' + binding.arg;
}
// Process modifiers
Object(__WEBPACK_IMPORTED_MODULE_1__utils_object__["e" /* keys */])(binding.modifiers).... | [
"function makeConfig(binding) {\n var config = {};\n\n // If Argument, assume element ID\n if (binding.arg) {\n // Element ID specified as arg. We must pre-pend #\n config.element = '#' + binding.arg;\n }\n\n // Process modifiers\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils_object__[\"b\" ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
funcion que verifica si las animaciones estan corriendo o estan en pausa y redirige a otra funcion | function verificarEstadoAnimacion() {
if (animacionCirculoA.playState === "running") {
modificarEstadoAnimacion("running");
cambiarIcono("fa-pause-circle", "fa-play-circle");
} else {
modificarEstadoAnimacion("paused");
cambiarIcono("fa-play-circle", "fa-pause-circle");
}
} | [
"function CheckAnims(ent){\n if(ent.animationcontroller.GetAvailableAnimations().length > 0){\n EnableAnims();\n }else\n frame.DelayedExecute(1.0).Triggered.connect(EnableAnims);\n}",
"function checkAnimationComplete(){\t\n\tvar targetName = '';\n\tfor(n=0;n<animation_arr.length;n++){\n\t\tif($.pukiAnima... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load a specific version of a Planta into the studio | function loadVersion(versionId) {
// perform ajax request
$.ajax({
type: 'POST',
url: '/planta/' + plantaID + '/loadVersion',
crossDomain: true,
data: {'versao': versionId},
dataType: 'json',
async: true,
success: function (response) {
resetStu... | [
"function loadRev() {\n // TODO: implement\n }",
"function load(){\n\tvar prog = programSelect.value;\n\tif(prog == \"Load from file\"){\n\t\tfilePicker.click(); //The filePicker has registered on change to call loadProgramFromDisk with the selected files\n\t}\n\telse if(prog == \"Custom... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the two inputted coordinates are approximately equivalent | function coordinatesAreEquivalent(coord1, coord2) {
return (Math.abs(coord1 - coord2) < 0.000001);
} | [
"function coordinatesAreEquivalent(coord1, coord2) {\n return (Math.abs(coord1 - coord2) < 0.000001);\n }",
"function equalCoord (a, b) {\n return (a[0] == b[0] && a[1] == b[1]) ? true : false \n}",
"function isEqualCoord(p1, p2){\r\n return p1[0] == p2[0] && p1[1] == p1[1]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The DraggableDrawable allows a drawable object to become draggable. This class provides additional functionality to a drawable object without subclassing it and is considered to be a much easier approach when new features are needed to an object without altering the existing base code. | function DraggableDrawable(drawable) {
/**
* A reference to this object.
*
* @typedef {DraggableDrawable}
* @private
*/
var self = this;
/**
* Initialize the DraggableDrawable.
*
* @param {cardmaker.Drawable} drawable The d... | [
"function Component_Draggable() {\n\n /**\n * Mouse/Pointer x coordinate\n * @property mx\n * @type number\n */\n this.mx = 0;\n\n /**\n * Mouse/Pointer y coordinate\n * @property my\n * @type number\n */\n this.my = 0;\n\n /**\n * Stepping in pixels.\n * @property ste... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |