query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
=== Add and remove asset class from sidebar menu === | function addAssetClass(item) {
itemMenu.forEach((item) => {
item.classList.remove("is-menu__item--active");
});
item.classList.add("is-menu__item--active");
} | [
"function menuRemoveClass(){\n $('.page-sidebar-menu li a').removeClass('menu-active');\n $('.page-sidebar-menu li a i').removeClass('icon-active menu-active');\n $('.page-sidebar-menu li a span').removeClass('span-active menu-active');\n m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is the 'loadQuestionsAndAnswers' function. This function pulls the class names from the 'click' event tied to the activateDivs function. It stores those classes in two variables and passese them into the 'CheckCat' function. | function loadQuestionAndAnswers(event) {
pointValue = event.target.classList[0];
cat = event.target.classList[1];
checkCat(cat, pointValue);
} | [
"function activateDivs() {\n divsArr.forEach(div => {\n div.addEventListener(\"click\", event => {\n handleClickEvent();\n loadQuestionAndAnswers(event);\n event.target.style.visibility = \"hidden\";\n audio.play();\n });\n });\n}",
"function initialiseCategories() {\n let categoryB... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Navbar auth on click (redirect to profile) | function navbarAuthInit() {
$('.navbar-auth').on('click', function(){
window.location.href = "profile.html";
});
} | [
"profileBtn () {\n const profileButton = document.querySelector('.profile-btn');\n const profileButtonNav = document.querySelector('.profileBtnNav');\n this.auth.onAuthStateChanged(user => {\n if (user) {\n const pathname = window.location.href.split('/');\n pathname[pathname.length - 1]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function: REQ_MGMT launcher for REQuirement ManaGeMenT args: returns: | function REQ_MGMT(id)
{
var _FUNCTION_NAME_="REQ_MGMT";
var pParams = tree_getPrintPreferences();
var action_url = fRoot+req_manager_url+"?item=requirement&requirement_id="+id+args+"&"+pParams;
//alert(_FUNCTION_NAME_ + " " +action_url);
parent.workframe.location = action_url;
} | [
"function reqMgmtCmd(mgmtCmdPrefix, cmd, cb){\n\thttpReq({ \n options: {\n host : config[configIndex].TPhost,\n port : config[configIndex].TPport,\n path : '/'+config[configIndex].AppEUI+'/'+config[configIndex].version+'/mgmtCmd-'+config[configIndex].nodeID + '_' + mgmtCmdPrefix,\n method: 'P... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get desktop shortcut id. | function getDesktopShortcutId(installPath) {
return "desktopShortcut_" + makeUniqueShortId(installPath)
} | [
"function getStartMenuShortcutId(installPath) {\n\treturn \"startMenuShortcut_\" + makeUniqueShortId(installPath)\n}",
"function getDesktop() {\n\tif (Ext.isEmpty(this.SitoolsDesk)) {\n\t\treturn null;\n\t}\n\telse {\n\t\treturn this.SitoolsDesk.app.desktop;\n\t}\n}",
"static async getId() {\n if (!AutoBid.h... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Recuperar tareas por ID | async function recuperarTareaPorId(req, res, next) {
const idTarea = req.params.tid;
let tarea;
try {
tarea = await Tarea.findById(idTarea).populate('id_usuario');
} catch (error) {
const err = new Error('No se han podido recuperar los datos')
err.code = 500; // Internal Server ... | [
"ambilMahasiswa(id) {\n for(var i=0; i < this.mahasiswa.length; i++) {\n if(this.mahasiswa[i].id == id) this.row = this.mahasiswa[i]\n }\n }",
"function seleccionaArticuloEdicion(id){\n articuloSeleccionado=id;\n var arreglo = new Array();\n arreglo=articulos;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
delete a sensor from an array based on a sensor id | function DeleteSensorFromId (sensors,sensor_id) {
for(var i=0;i < sensors.length; i++) {
if (sensors[i]._id === sensor_id) {
sensors.splice(i, 1); // remove 1 element from position i
}
}
} | [
"function deletarArr(id) {\n // console.log(cupsHistory);\n\n for (let i = 0; i < cupsHistory.length; i++) {\n if (cupsHistory[i].id == id) {\n cupsHistory.splice(i, 1);\n }\n }\n }",
"delete(id) {\n let index = this.getIndexOf(id);\n if (index > -1) {\n this.d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function which used for show notification when generation is finished | function genrationFinished(data){
generateNotification("Generation finished", data.solFile);
} | [
"completeCreation (creationComplete) {\n\t\tthis.flags.creationComplete = creationComplete;\n\t}",
"function notificationPreview() {\r\n $scope.notificationGenerator.showNotification = !$scope.notificationGenerator.showNotification;\r\n }",
"function generateFile_onclick() {\n updateTemplateF... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Brian Willis 2/19/20 First setup 03/03/20 Corrected IF statement to OR instead of and. This should fix the issue of the currentMonthlyCount not resetting at the beginning of the month. Monthly Sheet limit blocked at device and copy logging. Convert double sided sheet cost for copy jobs to single sided so that the Sheet... | function cancelDevicePrintReleaseHook(inputs, actions, MAX_SHEETS_PER_MONTH) {
var sped = "SpedTeachers";
var unrestricted = "UNRESTRICTED";
var name = inputs.user.fullName;
var userName = inputs.user.username;
var email = inputs.user.email;S
var pages = inputs.heldJob.totalPages;
var copies... | [
"function cancelDeviceJobLogHook(inputs, actions, MAX_SHEETS_PER_MONTH) {\n var sped = \"SpedTeachers\";\n var unrestricted = \"UNRESTRICTED\"\n var name = inputs.user.fullName;\n var userName = inputs.user.username;\n var document = inputs.job.documentName;\n var duplex = inputs.job.isDuplex;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
i.e. tab is in a window of type "normal", not "popup", "panel", "app", or "devtools" We don't mute tabs in other types of windows because they are generally trusted and there is no UI control for unmuting them. | function isTabInNormalWindow(tab) {
const windowId = tab.windowId;
assert(Number.isInteger(windowId));
return windowIdToType[windowId] === "normal";
} | [
"function muteTabs()\n{\n// adapted from https://github.com/danhp/mute-tab-chrome/blob/master/src/background.js\n chrome.windows.getAll({populate: true},\n\t\t\t function(windowList) {\n\t\t\t windowList.forEach(function(window) {\n\t\t\t\t window.tabs.forEach(function(tab) {\n\t\t\t\t\t\tif (tab.audible ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find a subtree pair that satisfies the association rule | function findSatisfyingSubtree(subtreePairs, nextRule) {
if (subtreePairs.length < 1) return null;
for (var j = 0; j < subtreePairs.length; j++) {
var nextPair = subtreePairs[j];
if (nextPair.transactions === undefined) continue;
var... | [
"lowestCommonAncestor(node1, node2) {}",
"lowestCommonAncestor(node1, node2) {\n \n }",
"allCommonAncestor(tree, value1, value2) {\n\n }",
"findPath(from_, to) {\n // TODO: something more efficient\n const findpath = (set, acc) => {\n for (let n of set) {\n // console.log()\n i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the interfaces to know about this implementation. This is an rare and unfortunate use of mutation in the type definition implementations, but avoids an expensive "getPossibleTypes" implementation for Interface types. | function addImplementationToInterfaces(impl) {
impl.getInterfaces().forEach(function (type) {
type._implementations.push(impl);
});
} | [
"function addImplementationToInterfaces(impl) {\n impl.getInterfaces().forEach(function (type) {\n type._implementations.push(impl);\n });\n}",
"function setInterfaces() {\n var options = is;\n for (var option in options) {\n if (hasOwnProperty.call(options, option) && is['function']... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Continuous updates of activity list | function runActivityFun() {
setTimeout(function() {
if (window.history.state == "list") updateActivity(); // Only update on list page
runActivityFun(); // Call itself after 30 seconds
}, 1000*30);
} | [
"static updateActivity() {\n let numStreams = Object.keys(this.onlineChannels).length;\n let activity = `${numStreams} stream${numStreams == 1 ? \"\" : \"s\"}`;\n this.discordClient.user.setActivity(activity, {\n \"type\": \"WATCHING\"\n });\n\n console.log('[StreamActivity]', `Update current ac... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the vertex normals and points for the cube | function setCube() {
var verts = [];
verts = verts.concat(quad(1, 0, 3, 2));
verts = verts.concat(quad(2, 3, 7, 6));
verts = verts.concat(quad(3, 0, 4, 7));
verts = verts.concat(quad(6, 5, 1, 2));
verts = verts.concat(quad(4, 5, 6, 7));
verts = verts.concat(quad(5, 4, 0, 1));
for (var i = 0; i < ... | [
"SetNormals() {}",
"function setNormals(vertex, normals, faces)\n{\n //populate all vertex normals with 0\n for( i = 0; i < vertex.length; i++ )\n {\n // var temp = vec3.fromValues(0,0,0);\n normals.push(0);\n }\n // console.log(\"set\"+normals.length);\n //find average face normals ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
! Container of all BoundingBox \class BoundingBox | function BoundingBox(rects) {
this.rects = rects;
} | [
"function BoundingBox(width, height) {\n this.width = width;\n this.height = height;\n this.offsetx = 0;\n this.offsety = 0;\n }",
"GetBoundingBoxes()\n\t{\n\t\treturn Object.values(this.collection).map(function(component)\n\t\t{\n\t\t\treturn {\n\t\t\t\tcomponent: component,\n\t\t\t\tBB: component._... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load song info from last.fm and provide it to given callback. The callback takes parameters loved and info, which both might be null. On errors, loved is set to a string providing the error message. | function getLastfmInfo(songInfo, cb) {
if (songInfo) {
if (isIgnoreLastFm(songInfo)) {
cb(i18n("songIgnored"), null);
return;
}
var params = { artist: songInfo.artist, track: songInfo.title };
if (localSettings.lastfmSessionName) params.username = localSettings.lastfmSessionN... | [
"function loadCurrentLastfmInfo() {\n song.lastfmInfo = null;\n song.loved = null;\n var songInfo = song.info;\n getLastfmInfo(songInfo, function(loved, lastfmInfo) {\n if (songInfo != song.info) return;//song meanwhile changed\n song.lastfmInfo = lastfmInfo;\n song.loved = loved;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
on fail appends an error message to gifwrapper | function failed() {
$('.gif-wrapper').empty();
$('.gif-wrapper').append('<p>Error Loading images, try again.</p>');
} | [
"function apiError(response){\n\tvar responseText = $.parseJSON(response.responseText);\n\t$(\"#error\").html(\"There was an error calling the Giphy API.<br>Status: \"+responseText.meta.status+\"<br>\"+responseText.meta.msg);\n\t$(\"#error\").css(\"display\", \"block\");\n\n\t//increments the error count\n\terrorCo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Accepts an array of transactions, creating a new block with them and adding it to the chain. | addBlock(transactions) {
// Your code here
} | [
"addTransactions(TXarray) {\n TXarray.forEach(curTX => {\n if (curTX.blockheight !== this.currentBlock) {\n return;\n }\n // Process balance for sender account\n this.addBalanceTo(curTX.sender, -curTX.amount);\n // Process balance for reci... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return true if username is available for the roomID, false otherwise. | function check_username(socket, type, username){
var rID = roomID(type);
var dfd = new $.Deferred();
//Get the list of users in the room
//and check if any of them conflict
//with username
socket.emit('get_users', {room: rID});
socket.once('send_users', function(data){
var users = data.usernames;
... | [
"function isUsernameAvailable(username){\n\t\tif(typeof username === \"string\"){\n\t\t\t//TODO do an ajax call to see if its available in the db.\n\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"async isUsernameAvailable(username) {\n const users = await this.User.find({ username });\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ShowTableRow ========= ResetFilterRows ==================================== | function ResetFilterRows() { // PR2019-10-26 PR2020-06-20
//console.log( "===== ResetFilterRows ========= ");
filter_dict = {};
filter_mod_employee = false;
Filter_TableRows(true); // true = set filter isactive
let filterRow = tblHead_datatable.rows[1];
if(!!filterRo... | [
"function Filter_TableRows() {\n //console.log( \"===== Filter_TableRows ========= \");\n\n\n //for (let i = 0, tblRow, show_row; tblRow = tblBody_datatable.rows[i]; i++) {\n // tblRow = tblBody_datatable.rows[i]\n // show_row = t_Filter_TableRow_Extended(filter_dict, tblRow);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate the gauge callouts if they're defined | generateCallouts (calloutConfig) {
debug && console.log(Util.timestamp(), 'C3GaugeWrapper.generateCallouts:', this.containerId);
let self = this,
svg = d3.select('#' + self.containerId + ' svg'),
innerRadius = self.chart.internal.radius,
outerRadius = self.chart.internal.r... | [
"function buildGauge(data){\n \n}",
"function buildGauge(wfreq) {\n console.log(wfreq);\n // Enter the washing frequency between 0 and 180\n var level = parseFloat(wfreq)/5;\n \n // Trig to calc meter point\n var degrees = 180 - level;\n var radius = 0.5;\n var radians = (degrees * Math.PI) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end function submitLineSelection / NAME: setUpLineSliders DESCRIPTION: function called to setup definition of line chart yaxis slider... ARGUMENTS TAKEN: none ARGUMENTS RETURNED: none CALLED FROM: CALLS: none | function setUpLineSliders() {
//
// set up vertical slider on line chart
$("#vertical-line-slider-range").slider({
orientation: "vertical",
range: true,
disabled: true,
min: aleph.yMain.domain()[0],
max: aleph.yMain.domain()[1],
values: [aleph.yMain.domain()[0], aleph.yMain.domain... | [
"function updateChartFromSliders() {\n var xMin = $('#min-zoom').val();\n var xMax = $('#max-zoom').val();\n var xaxis = plotRef.getOptions().xaxes[0];\n xaxis.min = xMin;\n xaxis.max = xMax;\n plotRef.setupGrid();\n plotRef.draw();\n}",
"function initializeLineChartOption() {\n\tinputHighestValue.value = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Used to find the "formRow" (i.e. the parent container) for the field | function getFormRow(element) {
try {
return $(element).parents('.form-group');
} catch (e) {
return false;
}
} | [
"function findEditFormContainer($personTr) {\n return $personTr.next().find('div.form_box');\n}",
"parentField() {\r\n let parent = this.$parent\r\n for (let i = 0; i < 3; i++) {\r\n if (parent && !parent.$data._isField) {\r\n parent = parent.$parent\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Related artifacts such as additional documentation, justification, or bibliographic references. | get relatedArtifact() {
return this.__relatedArtifact;
} | [
"function foundationFhirRelatedArtifact() {\n return {\n relatedArtifactResource: {\n resourceType: \"RelatedArtifact\",\n type: \"citation\"\n },\n resourceType: \"RelatedArtifact\"\n };\n}",
"get relatedArtifact () {\n\t\treturn this._relatedArtifact;\n\t}",
"a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Showing a searchable list of saved in LS places | function listPlaces() {
//Implement print check, so that list gets printed ONCE, not spammed
if(localStorage['places']){
a = JSON.parse(localStorage.getItem('places'));
$('#list').text("");
for (n=0; n<a.length; n++) {
var appendConstructor = '<img src='+'"'+a[n].iconType+'">' + " " + a[n].placeTitl... | [
"searchList () {\n this.showAlert(undefined, false); //hide alert box if shown\n this.clickClearRoute();\n if (this.searchString().indexOf('\\\\') >= 0) { //symbol \\ cannot be used in regexp\n this.showAlert(SEARCH_ERROR_TEXT + '\\\\');\n } else {\n const regex = new RegExp(this.searchString(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
read calendar from local storage, then parse it | function importCalendar() {
var calendarString = "";
// read string from localStorage
// http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_webstorage_local
if (typeof(Storage) != "undefined") {
// Store
calendarString = localStorage.getItem("calendarData");
var... | [
"function loadCalendar() {\n const storedCalendar = JSON.parse(localStorage.getItem(\"events\"));\n if (storedCalendar) {\n events = storedCalendar;\n }\n\n }",
"function retrieveStoredCalendar() {\n\n // Check if the calendar has been stored to the localStorage and retrieve\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The user clicked on one of the search results. Triggers the zooming of the map to the corresponding map feature | function handleSearchResultClick(e) {
theInterface.emit('ui:zoomToMarker', {
position : e.currentTarget.getAttribute('data-position'),
layer : e.currentTarget.getAttribute('data-layer')
});
} | [
"function _zoomToResult(event) {\n $('#resolverSearchResult').find('.selected').removeClass('selected');\n $(this).addClass('selected');\n\n var index = $(this).attr(\"mizar_feature_index\");\n var selectedFeature = response.features[index];\n NameResolver.zoom... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
We've found a rebate that applies to productid in the program we're localizing to update the DOM to reflect the discount Configurable product handler: this page contains a configrable product, so list out the eligible configurations. if the eligiblerebateoptions list has any members, we need to add the current incentiv... | function updateConfigQuotes(productid, incentive) {
var amount = parseFloat(incentive.rebateAmount); // widget delivers rebateAmount in a string
var line = document.getElementById("configproduct" + productid);
var wrapper = document.getElementById("product-options-wrapper");
var i;
var imgdiv = document.createEle... | [
"function updateConfigQuotes(productid, incentive) {\n\tvar amount = parseFloat(incentive.rebateAmount); // widget delivers rebateAmount in a string\n\tvar line = document.getElementById(\"configproduct\" + productid);\t\n\tvar wrapper = document.getElementById(\"product-options-wrapper\");\n\tvar i;\n\tvar imgdiv ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check tag format is 'svg' or 'png' | function checkTagTypeFormat(req,res,next){
console.log('*processSvgTag');
var tagDoc = req.query.tagDoc;
if (tagDoc.format == 'svg' || tagDoc.format == 'png' ){
next();
}else{
res.send('Not supported tagId');
}
} | [
"function svgasimg() {\r\n\t\t\treturn document.implementation.hasFeature(\r\n\t\t\t\t\"http://www.w3.org/TR/SVG11/feature#Image\", \"1.1\"\r\n\t\t\t);\r\n\t\t}",
"function isSvg(val) {\n var reg = /\\.svg$/ig;\n return reg.test(val);\n }",
"function checkImageFeature() {\n var svgStatus = false;\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Channel class Every sockets info to channels. Channels are needed to communicate directly with the model | function Channel(name) {
var _this = this;
this.attach = function(obj) {
return Channel.prototype.attach.apply(_this, arguments);
};
this.ask = function(question) {
return Channel.prototype.ask.apply(_this, arguments);
};
this.onmessage = function(event) {
ret... | [
"updateSocketChannel() {\n for (let key in this.channels) {\n if (this.channels.hasOwnProperty(key)) {\n let channel = this.channels[key];\n channel.setSocket(this.ws);\n }\n }\n }",
"function channel(c){\nthisChannel = c;\n}",
"function Chann... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Serialize a DOCTYPE node. See: | function serializeDoctype (node) {
var r = '<!DOCTYPE ' + node.name;
if (node.publicId) {
r += ' PUBLIC "' + node.publicId + '"';
}
if (!node.publicId && node.systemId) {
r += ' SYSTEM';
}
if (node.systemId) {
r += ' "' + node.systemId + '"';
}
r += '>';
return r;
} | [
"function serializeDoctype(node) {\n var r = '<!DOCTYPE ' + node.name;\n\n if (node.publicId) {\n r += ' PUBLIC \"' + node.publicId + '\"';\n }\n\n if (!node.publicId && node.systemId) {\n r += ' SYSTEM';\n }\n\n if (node.systemId) {\n r += ' \"' + node.systemId + '\"';\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to load category stats data | function loadCategoryStatsData(data) {
category_stats = data;
} | [
"function loadCategories() {\n CrudService.getItems(CrudService.endpoints.CATEGORIES_ENDPOINT).success(function (data) {\n CrudService.response.categories = JSON.parse(JSON.stringify(data));\n }).error(function (data) {\n Flash.clear();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
renderSortOptions Callback function that renders the col filter div | function renderSortOptions(col, status, colname) {
str = "";
if (status == -1) {
if (col == "ccode" || col == "class" || col == "credits" || col == "start_period" || col == "end_period" || col == "study_program" || col == "tallocated") {
str += "<span onclick='myTable.toggleSortStatus(\"" +... | [
"function renderSortOptions(col, status, colname) {\n str = \"\";\n if (status == -1) {\n\n if (col == \"ccode\" || col == \"class\" || col == \"credits\" || col == \"start_period\" || col == \"end_period\" || col == \"students\" || col == \"study_program\" || col == \"time_allocation\") {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
private context: SkillContext; private _json: any; | constructor(context) {
this.context = context;
this._json = this.baseRequest();
} | [
"function Skill(attribute){\n this.attribute = attribute;\n}",
"function SkillName(){\n}",
"getSkills(lang){\r\n return this.userData['language_data'][lang].skills;\r\n }",
"enterJson(ctx) {\n\t}",
"constructor(requirement, skill) {\n this.RequiredLevel = requirement;\n this.Skill... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end move_dumb() / mmove(x,y,xd,yd) Function to actually perform the monster movement int x,y,xd,yd; Enter with the from coordinates in (x,y) and the destination coordinates in (xd,yd). | function mmove(aa, bb, cc, dd) {
if ((cc == player.x) && (dd == player.y)) {
hitplayer(aa, bb);
return;
}
var item = itemAt(cc, dd);
var monster = player.level.monsters[aa][bb];
player.level.monsters[cc][dd] = monster;
if (item.matches(OPIT) || item.matches(OTRAPDOOR)) {
switch (monster.arg) ... | [
"function mmove(sx, sy, dx, dy) {\n let monster = monsterAt(sx, sy);\n if (!monster) {\n console.log(`mmove(): no monster at ${sx},${sy}`);\n return;\n }\n\n //console.log(`${sx}->${dx}, ${sy}->${dy}`);\n\n if (dx == player.x && dy == player.y) {\n /* The destination is the player, so the monster atta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function breaks a word into an array of letter json objects This is used when generating new words | function breakWord (word, color) {
var letters = [];
for (var i = 0; i < word.length; i++) {
var letter = { letter: word.charAt(i),
color: color,
score: getLetterScore(word.charAt(i)) };
letters.push(letter);
}
return letters;
} | [
"function makeLetterArray(word) {\n\tvar array = [];\n\tfor (var char of word) {\n\t\tvar newLetter = new Letter(char); // Stored in upper case\n\t\tarray.push(newLetter);\n\t}\n\treturn array;\n}",
"function parseWord(word) {\n for (let i = 0; i < word.length; i++) {\n wordParser.add(word[i]); //add ea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Translates a position along the time axis to facilitate scaling events when excluding certain days or hours | getScaledPosition(position) {
const { include, unit, weekStartDay } = this.timeAxis;
// Calculations are
if (include) {
const dayWidth = this.getSingleUnitInPixels('day');
// Have to calculate day before hour to get end result correct
if (include.day && DateHelper.compareUnits(unit, 'da... | [
"getScaledPosition(position) {\n const {\n include,\n unit,\n weekStartDay\n } = this.timeAxis; // Calculations are\n\n if (include) {\n const dayWidth = this.getSingleUnitInPixels('day'); // Have to calculate day before hour to get end result correct\n\n if (include.day && DateHel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a function `whisperShout` that accepts a lowercase string. It should log that lowercased string to the console, wait three seconds, and then return the string in all capital letters. | function whisperShout(str) {
console.log(str);
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(str.toUpperCase);
});
});
} | [
"function logShout(string) {\n return console.log(string.toUpperCase())\n}",
"function logShout(string) {\r\n console.log(shout(string));\r\n}",
"function logShout(string){\n console.log(shout(string));\n}",
"function logShout(string) {\n console.log(shout(string))\n}",
"function logShout(string) {\n c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
pluginParent access the plugin's "parent" | getPluginParent() {
return this.pluginParent;
} | [
"get parent() {\n return utils.getComponent(this.parentPath);\n }",
"get parent() {\n\t\treturn this.__parent;\n\t}",
"function parent() {\n return this[0] ? this[0].parent : null;\n}",
"get parent() {\n return this._parent;\n }",
"parent() {\n let ary = [], p;\n this.q.forEach(functi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the latitude bounds if latitude is a single coordinate | function getLatBoundsForSingleCoordinate(a){var b=a[0]-PADDING<GEO_BOUNDS.LAT_MIN?GEO_BOUNDS.LAT_MIN:a[0]-PADDING,c=a[1]+PADDING>GEO_BOUNDS.LAT_MAX?GEO_BOUNDS.LAT_MAX:a[1]+PADDING;return[b,c]} | [
"function getLngBoundsForSingleCoordinate(a){var b=a[0]-PADDING<GEO_BOUNDS.LNG_MIN?GEO_BOUNDS.LNG_MIN:a[0]-PADDING,c=a[1]+PADDING>GEO_BOUNDS.LNG_MAX?GEO_BOUNDS.LNG_MAX:a[1]+PADDING;return[b,c]}",
"function bounds(data) {\n\twindow.console.log('parser.bounds');\n\n\tconst bounds_coords = {\n\t\t'latitude_northmost... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: unit test for the student object and its methods Precond: none Postcond: all the tests passed Params: none Returns: none | function studentTest() {
console.log("Testing the student class:");
var assert = require('assert');
console.log("Testing constructor... ");
var student0 = new Student("John", "05/23/1995", ["Jake", "Bill", "Tom"], "hello!", "Computer Science");
console.log("Constructor passed!");
console.log("Testing accessors.... | [
"function Student() {}",
"function student(fullName, studies, city, markAv){\r\n this.fullName = fullName;\r\n this.studies= studies;\r\n this.city = city;\r\n this.markAv = markAv;\r\n}",
"callRegisterStudent()\n {\n newStudent = new Student(this.name, testEmail, testcommunity);\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converting from a nonPRE block to a PRE block in formatting operations. | function toPre(block, newBlock) {
// First trim the block content.
var preHtml = block.html();
// 1. Trim head/tail spaces, they're not visible.
preHtml = replace(preHtml, /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, '');
// 2. Delete ANSI whitespaces immediately before and after <BR> be... | [
"function toPre( block, newBlock )\r\n\t{\r\n\t\tvar bogus = block.getBogus();\r\n\t\tbogus && bogus.remove();\r\n\r\n\t\t// First trim the block content.\r\n\t\tvar preHtml = block.getHtml();\r\n\r\n\t\t// 1. Trim head/tail spaces, they're not visible.\r\n\t\tpreHtml = replace( preHtml, /(?:^[ \\t\\n\\r]+)|(?:[ \\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates new duration element Example: 12m 30s | function Duration(time) {
var d = document.createElement('span');
d.classList.add('duration');
d.innerText = time;
return d;
} | [
"function duration(getDuration) {\n const durat = document.createElement('p')\n durat.innerText = getDuration\n durat.setAttribute('id', 'duration')\n document.querySelector('#append-plant').append(durat)\n}",
"function elementSelectedDuration(){\r\n\tvar filler,hour,hours,minute,minutes,throwAwayDate,timeDat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
makeSwordMark() Purpose: returns an Object3D containing two crossed swords origin: center of the ground underneath where the two swords cross Parameters (see sword_objects.js for more detail): swordLength (number): the length of each sword swordWidth (number): the width of each sword swordThickness (number): the thickn... | function makeSwordMark (swordLength, swordWidth, swordThickness) {
var frame = new THREE.Object3D();
//the hilt is to the right of the tip
var sword1 = new THREE.Object3D();
var sword = new Sword(swordLength, swordWidth, swordThickness, 0xFFD700, 1);
sword.frame.position.set(0, sword.bladeLength, 0);
sword.frame... | [
"function generateCrossword(){\nvar items = [\n [0, 0, 0, 0, 0, 0, 'o', 0, 0],\n [0, 0, 0, 'p', 0, 0, 'r', 'e', 'd'],\n [0, 0, 0, 'u', 0, 0, 'a', 0, 0],\n [0, 0, 'b', 'r', 'o', 'w', 'n', 0, 0],\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load Initial Buttons using the topicArray. Defines click event on the button that will invoke getGifs() by passing the search term | function loadButtons(arrayOfTopics) {
$(".buttonArea").empty();
arrayOfTopics.forEach(function(arrayItem) {
$(".buttonArea").append(
$("<button>", {
type: "button",
class: "btn btn-success btn-sm m-3 animalButton",
text: arrayItem.toUpperCase()
}).on("click",... | [
"function initializeButtons() {\n // Loops through the array of topics and makes a button for each\n for (var i = 0; i < topics.length; i++) {\n makeButton( topics[i] );\n }\n}",
"function displayButtons() {\n $(\"#gifsView\").empty();\n for (var i = 0; i < topics.length; i++) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes the page number elements across all the slides in the document | function removePageNumbers() {
var slides = presentation.getSlides();
for (var i = 0; i < slides.length; ++i) {
var elements = slides[i].getPageElements();
for (var j = 0; j < elements.length; ++j) {
if (elements[j].getPageElementType() === SlidesApp.PageElementType.SHAPE &&
elements... | [
"function removeitemperpage() {\n $(\".k-pager-sizes\")\n .contents()\n .filter(function () {\n return this.nodeType === 3;\n }).remove();\n}",
"function removeitemperpage() {\n $(\".k-pager-sizes\")\n .contents()\n .filter(function () {\n return this.nodeType === 3;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds getaggregateFunction() to the task queue | function makeAggregateTask({
property,
successCallback,
aggregatefn,
origin,
query,
errorCallback
}) {
let options = {
query: query,
errorCallback: errorCallback
};
let args = [property, aggregatefn, successCallback, origin, options];
tasks.push({ args: args, fn: getaggregateFunction });
} | [
"function Aggregator() {\n }",
"add(fn) {\n this.queue.push(fn);\n this.processQueue();\n }",
"function setupQueueFunctionQueued() {\n // Generate all currently queued functions.\n generateAvailableQueued();\n }",
"enqueue(task) {\n if (typeof task !== 'function') {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gridlet creator (divisions of the image grid, positioned with backgroundimages to replicate the look of an entire slide image when assembled) | function huge_it_gridlet(width, height, top, img_top, left, img_left, src, imgWidth, imgHeight, c, r) {
var delay = (c + r) * count;
/* Return a gridlet elem with styles for specific transition.*/
return jQuery('<div class="huge_it_gridlet_1" />').css({
width: width,
heig... | [
"function huge_it_gridlet(width, height, top, img_top, left, img_left, src, imgWidth, imgHeight, c, r) {\n var delay = (c + r) * count;\n /* Return a gridlet elem with styles for specific transition.*/\n return jQuery('<div class=\"huge_it_gridlet_1\" />').css({\n wid... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
same as detectIBeacons (intoduced in v1.1.0) adds iBeacon parser to detect them | function addIBeaconsDetection(): Promise<any> {
return new Promise((resolve, reject) => {
BeaconsManager.addParser(PARSER_IBEACON, resolve, reject);
});
} | [
"function createBeacons(){\n var mintBeaconRegion = createBeacon('mintEstimote', '31B32E3C-5E8B-68F8-0493-FF9DCAA7C4B7', 10002, 48896);\n var iceBeaconRegion = createBeacon('iceEstimote', '29644B63-3EBD-AE99-ED00-0608F6A708A4', 28374, 41843);\n var blueberryBeaconRegion = createBeac... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter items in collection based on callback and return in an array | function filter(collection, callback) {
var arr = [];
each(collection, function (x) {
if (callback(x)) {
arr.push(x);
}
});
return arr;
} | [
"function myFilter(collection, pred){\n result = [];\n for (var i = 0; i < collection.length; i++){\n if (pred(collection[i])){\n result.push(collection[i]);\n }\n };\n return result;\n}",
"filter(callback) {\n\n // return limited collection\n return new Todos( { todos: this._data.tod... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
================================================================================== 'a' is treated as the answer, and 'b' is treated as the value submitted by a user truncate a or b on the sig digit position according to the following rule: a b ______________________________________________ |a| >= 1: 1 integer digit wit... | function truncate(a, b)
{
var mag = Math.abs(a);
var aTrunk = a;
var bTrunk = b;
var d = 0; // default is no slop
if (mag >= 100) // 3 or more interger digits:
{
// do truncation - compare only up to 3rd sig digit:
aTrunk = mathTools.truncateToSigFigs(aTrunk, 3);
bTrunk ... | [
"function calculate(){\n let termArray = splitInput();\n console.log(termArray)\n if (termArray.length < 3){\n return \"finish the problem lady!\"\n }\n let a = parseFloat(termArray[0])\n console.log(a);\n let b = parseFloat(termArray[2]);\n console.log(b);\n let op = termArray[1];... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Opens popup with estimation for current request Called by 'Show Estimation' button | function onShowEstimation(){
var rest = new Ab.view.Restriction();
rest.addClause("wr.wr_id",$("wr.wr_id").value,"=");
View.openDialog("ab-helpdesk-workrequest-estimation.axvw",rest,false);
} | [
"function showCalculatePopup() {\n var baseURL = 'file://' + __dirname + '/html/goldmanCalculation.html';\n resultsWindow = new BrowserWindow({\n width: 450,\n height: 450,\n show: false,\n alwaysOnTop: true,\n resizable: false,\n icon: '../images/icon.ico'\n });\n resultsW... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Place the piano keys in their default state, with none selected. | function resetPianoKeys() {
for (const element of pianoKeys) {
element.classList = 'pianoKey';
}
} | [
"resetKeys() {\r\n keys.A.isDown = false;\r\n keys.D.isDown = false;\r\n keys.W.isDown = false;\r\n cursors.left.isDown= false;\r\n cursors.right.isDown= false;\r\n cursors.up.isDown= false;\r\n }",
"resetKeys() {\r\n keys.A.isDown = false;\r\n keys.D.isDown = false;\r\n cursors.left.i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The current gnav position is diagramless or does not have a known clue in the current direction. | function gnavIsClueless() {
if (currentRow < 0 || currentCol < 0) {
return false
}
let gridCell = grid[currentRow][currentCol]
return (gridCell.isDiagramless ||
(currentDir == 'A' &&
(!gridCell.acrossClueLabel ||
!clues['A' + gridCell.acrossClueLabel] ||
!clues['A' + gridCell.across... | [
"get isTranslation () { return this.vector.x !== 0 || this.vector.y !== 0 }",
"function navalnyAlert(){\n drawNavalny();\n var pos = 10;\n if(ballotMovingDirection === 'left') {\n ballotBoxPos.x -= pos;\n if(ballotBoxPos.x <= 0) {\n ballotMovingDirection = 'right';\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::WAFv2::WebACL.ManagedRuleGroupConfig` resource | function cfnWebACLManagedRuleGroupConfigPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnWebACL_ManagedRuleGroupConfigPropertyValidator(properties).assertSuccess();
return {
AWSManagedRulesATPRuleSet: cfnWebACLAWSManagedRulesATPRuleSetProp... | [
"function cfnWebACLManagedRuleGroupStatementPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnWebACL_ManagedRuleGroupStatementPropertyValidator(properties).assertSuccess();\n return {\n ExcludedRules: cdk.listMapper(cfnWebACLExcludedR... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if two authors are equal. | function author_equal(a, b) {
return a['name'] == b['name'] && a['email'] == b['email'];
} | [
"function compareAuthors(quote1, quote2) {\n if (quote1.author < quote2.author ){\n return -1;\n } else if (quote1.author > quote2.author){\n return 1;\n } else {\n return 0;\n }\n}",
"function do_check_author(aActual, aExpected) {\n do_check_eq(aActual.toString(), aExpected.name);\n do_check_eq(aA... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
an example for callback hell: getMovieRef, insertMovieRef0, getMovieMeta, insertMovieRef | function getMovieRef(args) {
var ref = args.path + "/pic-" + fmtIx(args.pos);
args.pathpos = ref;
console.log("getMovieRef: " + ref);
readServer("mediaPath",
ref,
function (res) { insertMovieRef0(res, args); }
);
} | [
"fetchMovieInfo( id, callback ) {\n let url = this._getUrl( '/movie/'+ id, {} );\n this._fetchData( url, callback );\n }",
"save(callback, movie) {\n startconnection();\n movie.id = crypto.randomBytes(20).toString('hex');\n connection.query(\"INSERT INTO movie SET ?\", movi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a list of all integers such that low <= num < high | function range(low,high) {
var ret = [];
for(var i = low; i < high; i++) ret.push(i);
return ret;
} | [
"function range(low, high) {\n\tret = [];\n\tfor (var i = low; i < high; i++) {\n\t\tret.push(i);\n\t}\n\treturn ret\n}",
"function numbersBetween(a, b) {\n let low;\n let high;\n let numbers = [];\n\n if (a > b) {\n low = b;\n high = a;\n } else {\n low = a;\n high = b;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch resources from each source. If source is a function, call the function and return the resource. If source is a URL, get the data via synchronized ajax call. If the source is an object, return it as is. | function _fetchResourceSource(source, currentView) {
var resources = source.resources;
if (resources) {
if ($.isFunction(resources)) {
return resources();
}
} else {
var url = source.url;
if (url) {
var data=... | [
"function fetchResourceSource(source, currentView) {\n var resources = source.resources;\n if (resources) {\n if ($.isFunction(resources)) {\n return resources();\n }\n } else {\n var url = source.url;\n if (url) {\n var data = {};\n if (typeof currentView === 'obje... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get matches across all rows and redirect user to the first match | function getMatches(query) {
query = query.toLowerCase()
matchIndexes = []
getColumnMatches(company, query)
getColumnMatches(category, query)
getColumnMatches(mission, query)
getColumnMatches(product, query)
// Remove duplicate indicies
matchIndexes = [...new Set(matchIndexes)]
// Remove index 0 (... | [
"function findMatches() {\n if (!this.value) { \n suggestions.innerHTML = \"\";\n return; \n }\n const wordToMatch = this.value;\n const finalEndpoint = `${endpoint}&per_page=${pages}&with_people=${with_people}&with_paywall=${with_paywall}&c=${wordToMatch}&t=${new D... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles global enabling/disabling for the geo insertion dialog. | function enableDialog(enable) {
$('insertGeoLocation').disabled = !enable;
$('geoOkButton').disabled = !enable;
$('geoCancelButton').disabled = !enable;
} | [
"function EnableSettingControlOptions(bEnable) {\n $('.GeoTrackingOption').prop('disabled', !bEnable); \n }",
"function EnableMapPanelGeoTrackingOptions(settings) {\n var bAllow = settings.bAllowGeoTracking;\n var bOffPathAlert = settings.bOffPathAlert;\n var bTracking = settings.bE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sorting data in store | sort(key: string, descending: boolean) {
// Sorting data in store using in the given field
this.crudStore.setData(this.crudStore.getData().sort(
(a, b) => this._eq(a[key], b[key], descending)
));
} | [
"function doSort() {\n store.sort(getSorters(), \"ASC\");\n }",
"function sortData (data) {\n ...\n}",
"function doSort() {\r\n statementTableDataStore.sort(getSorters(), \"ASC\");\r\n }",
"sort () {\r\n this._data.sort((a, b) => a.sortOrder !== b.sortOrder ? b.sortOrder - a.sortOrde... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
remove a control point from a world | function removePoint(world) {
if (params.realTime) {
if (CPlist.length >= 4) {
world.removeObject(CPlist[CPlist.length - 1].mesh);
CPlist.pop();
CPlist_positions.pop();
}
}
} | [
"function remove_point(point) {\n\tpoint.map_point.setMap(null);\n\tdelete spawned_points[point.index];\n\tvisible_points--;\n}",
"removeDot() {\n this.context.world.remove(this.dot, this.light);\n }",
"removeControlPointLayer() {\n\t\tthis.mapUtil_.removeLayer(this.controlPointLayer_);\n\t}",
"removePoin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
THE MAIN RECURSIVE FUNCTION OF THE PARSER. THE JOB OF parseSceneNode IS TO TRAVERSE THE JSON OBJECT jsonNode AND POPULATE A CORRESPONDING Three.js SceneNode | function parseSceneNode(jsonNode, sceneNode)
{
debug("parseSceneNode " + jsonNode["name"] + ":" + jsonNode["type"] + "\n");
if (jsonNode === undefined || sceneNode === undefined) return;
// Handle the transform of the node (translation, rotation, etc.)
parseTransform(jsonNode, sceneNode);
// Load ... | [
"function parseScene(jsonParseTree)\n{\n debug(\"parseScene\\n\");\n\n var scene = new THREE.Scene();\n currentScene = scene;\n parseSceneNode(jsonParseTree, scene);\n startTime = (new Date()).getTime() * 0.001; // reset start time\n}",
"unpackScene() {\n var gen = this.tree.iterate();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
kvm_Input3 End kvm_Input4 Start | function kvm_input4(device_id) {
console.log("kvm_input4 clicked: " + device_id);
kvm4_post_data = {
device_type: "kvmswitch",
device_id: device_id,
command: JSON.stringify({status: "INPUT4"})
};
//
console.log("POST kvm_input4 method by jQuery");
jQuery.ajax({
... | [
"function kvm_input3(device_id) {\n console.log(\"kvm_input3 clicked: \" + device_id);\n kvm3_post_data = { \n device_type: \"kvmswitch\",\n device_id: device_id, \n command: JSON.stringify({status: \"INPUT3\"})\n };\n //\n console.log(\"POST kvm_input3 method by jQuery\");\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate login/email from fname & lname | function autofillLogin() {
var dLogin = document.getElementById("desired_login");
var dEmail = document.getElementById("desired_email");
var fname = document.getElementById("fname");
var lname = document.getElementById("lname");
dLogin.value = fname.value + "." + lname.value;
dEmail.value = fna... | [
"function generateUserName(email) {\n let username, fname, lname, owner;\n\n username = email.split(\"@\");\n username = username[0].split(\".\");\n\n fname = username[0];\n lname = username[1];\n\n fname = fname.charAt(0).toUpperCase() + fname.slice(1);\n lname = lname.charAt(0).toUpperCase() + lname.slice(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
(From IPython Notebook keyboard shortcuts dialog) The IPython Notebook has two different keyboard input modes. Edit mode allows you to type code/text into a cell and is indicated by a green cell border. Command mode binds the keyboard to notebook level actions and is indicated by a grey cell border. Command Mode (press... | function createNormalModeKeyboardShortcuts(_) {
var normalModeKeyboardShortcuts = [['enter', 'edit mode', switchToEditMode],
// [ 'shift+enter', 'run cell, select below', runCellAndSelectBelow ]
// [ 'ctrl+enter', 'run cell', runCell ]
// [ 'alt+enter', 'run cell, insert below', runCellAndInsert... | [
"function keyPressed() {\n if( keyCode === 32 ) { // keyCode === 32 is spacebar\n ez = !ez; // toggle easy mode\n }\n}",
"function editOnKeyDown(e) {\n var keyCode = e.which, editorState = this.props.editorState;\n switch (keyCode) {\n case Keys.RETURN:\n // The top-level co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION: dwscripts.stripCFOutputTags DESCRIPTION: This function returns the given expression with the open and close CFOUTPUT tags removed. ARGUMENTS: expression string the string to remove the CFOUTPUT tags from RETURNS: string | function dwscripts_stripCFOutputTags(expression)
{
var retVal = expression.toString();
var exp1 = /<cfoutput[^>]*>/gi;
var exp2 = /<\/cfoutput[^>]*>/gi;
retVal = retVal.replace(exp1,"");
retVal = retVal.replace(exp2,"");
return retVal;
} | [
"function dwscripts_canStripCfOutputTags(charRange, checkForBind)\n{\n var isNested = false;\n var startOffset = 0;\n var endOffset = 0;\n var dom = dw.getDocumentDOM();\n\n // If we were not given a charRange, then get the current selection\n if (charRange)\n {\n startOffset = charRange.startoffset;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
teamDataSavedListener Listener for when a new season is saved and stores a season selector for that season. | function teamDataSavedListener () {
ipc.send('store-team-season', module.exports.internal.dataObj.seasons.length - 1)
} | [
"function teamDataSavedListener () {\n debug('team data saved, storing season selector')\n ipc.send('store-team-season', 0)\n}",
"function teamDataSavedListener () {\n module.exports.internal.stateManager.showState('add-first-team', 'add-first-season')\n}",
"function teamSeasonStoreListener () {\n debug('te... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
contains returns a boolean for if substr is found within str. | function contains( str, substr ) {
return !!~('' + str).indexOf(substr);
} | [
"function contains(str, substr) {\n return !!~(\"\" + str).indexOf(substr);\n }",
"function contains (str, substr) {\n return !!~('' + str).indexOf(substr)\n }",
"function contains( str, substr ) {\nreturn !!~('' + str).indexOf(substr);\n}",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes existing records and Inserts discussion topic seed data into database. Takes in seed data. | async function discussionInsert(seed) {
try {
const deleted = await DiscussionTopic.deleteMany();
console.log(`Number of Discussion Topic records deleted: ${deleted.deletedCount}`);
const data = await DiscussionTopic.insertMany(seed);
console.log(`${data.length} Discussion Topic records inserted!`);
... | [
"function seedDB() {\n // Remove all campgrounds from DB.\n Campground.deleteMany({}, err => {\n if (err) {\n console.log(err);\n } else {\n console.log('All campgrounds has been removed!');\n // Remove all comments from DB.\n Comment.deleteMany({}, err => {\n if (err) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
routine to process dual select boxes with three options 'append' get selected data from first object and append it to second object 'remove' remove select data from object 'move' do an 'append' then a 'remove' code assumes that the last element in the list is a blank entry | function process_dual_select_option (what1, what2, option) {
var index;
var msg ="";
var doit = "T";
if (((what1.selectedIndex == -1) || (what1[what1.selectedIndex].value == "")) && (option != 'moveall')) {
alert ("You must make a selection first");
} else {
for (var i = 3; i < arguments.length; i++) ... | [
"function move_selectbox_item(from_obj, to_obj) {\n var len = 0;\n for (i = 0; i < from_obj.length; i++) {\n if (from_obj.options[i].selected) {\n if (to_obj.length == null) len = 0;\n else len = to_obj.length;\n to_obj.options[len] = new Option(from_obj.options[i].name... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Firefox compatibility shim duplicateTabIn duplicates tab in a place specified by the parameter |where|. |where| can be: "tab" new tab "tabshifted" same as "tab" but in background if default is to select new tabs, and vice versa "tabfocused" same as "tab" but override any background preferences and focus the new tab "wi... | function duplicateTabIn(aTab, aWhere, aDelta)
{
OpenSessionHistoryIn(aWhere, aDelta, aTab);
} | [
"function duplicateTab(tab) {\n\tchrome.tabs.duplicate(tab.id, null);\n}",
"function reOrderOrCreate(keyword, urlString, pos, tabs) {\n\tfor (var i = 0, l = tabs.length; i !== l; i++) {\n \t\tvar t = tabs[i];\n \t\tif (t.url.indexOf(keyword) >= 0) {\n \t\t\tchrome.tabs.move(t.id, {index:pos});\n \t\t\treturn;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Router to heartbeat check wps system | function wrf_heartbeat(req, res) {
console.log("WRF: heartbeat");
res.json({success: true, ready: true, status: "Online"});
} | [
"function wps_heartbeat(req, res) {\n\tconsole.log(\"WPS: heartbeat\");\n\tres.json({success: true, ready: true, status: \"Online\"});\n}",
"_check_heartbeat() {\n let difference = Date.now() - this.#last_ping;\n let max_duration = this.#heartbeat_duration * this.#heartbeat_margin;\n if (diff... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update cursor style from params. | updateCursor() {
this.style(this.progressWave, {
borderRightWidth: this.params.cursorWidth + 'px',
borderRightColor: this.params.cursorColor
});
} | [
"setCursorStyle(params) {\n const param = params[0] < 1 ? 1 : params[0];\n switch (param) {\n case 1:\n case 2:\n this._terminal.setOption('cursorStyle', 'block');\n break;\n case 3:\n case 4:\n this._terminal.set... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
List the objects in the bucket using S3 ListObjects V2 __Arguments__ `bucketName` _string_: name of the bucket `prefix` _string_: the prefix of the objects that should be listed (optional, default `''`) `recursive` _bool_: `true` indicates recursive style listing and `false` indicates directory style listing delimited ... | listObjectsV2(bucketName, prefix, recursive, startAfter) {
if (prefix === undefined) {
prefix = ''
}
if (recursive === undefined) {
recursive = false
}
if (startAfter === undefined) {
startAfter = ''
}
if (!isValidBucketName(bucketName)) {
throw new errors.InvalidBuck... | [
"listObjects(bucketName, prefix, marker, recursive) {\n\n if (prefix === undefined) prefix = ''\n if (recursive === undefined) recursive = false\n if (!isValidBucketName(bucketName)) {\n throw new errors.InvalidBucketNameError('Invalid bucket name: ' + bucketName)\n }\n if (!isValidPrefix(prefix... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A polyfill for getting transforms objects. It's not possible to get individual parts of a transform like scale, rotate, translate, etc. so we have to get the whole transform matrix then get individual parts. | getElemTransformMatrix(elem) {
const matrix =
elem.css('-webkit-transform') ||
elem.css('-moz-transform') ||
elem.css('-ms-transform') ||
elem.css('-o-transform') ||
elem.css('transform');
// JavaScript returns a "none" string if there is not transform... so
// let's return nu... | [
"getValuesFromTransformMatrix(element) {\n let computedStyles = window.getComputedStyle(element);\n\n let transformMatrix =\n computedStyles.transform ||\n computedStyles.webkitTransform ||\n computedStyles.mozTransform;\n\n if (transformMatrix === \"none\") {\n transformMatrix = \"matr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
prettify code blocks in text | function styleCode() {
var shouldPrettify = false;
$("pre code").parent().each(function() {
if (!$(this).hasClass("prettyprint")) {
$(this).addClass("prettyprint");
shouldPrettify = true;
}
});
if (shouldPrettify) { prettyPrint(); }
} | [
"function google_code_prettify()\n{\n if (prettyPrint) {\n var prettify = false;\n var blocks = document.querySelectorAll('pre code');\n for (var i = 0; i < blocks.length; i++) {\n if (0 > blocks[i].className.indexOf('prettyprint')) {\n blocks[i].className += ' pret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process a 'deleted' model event. | deletedProcessor(event, message)
{
// Use the <moduleName>/DELETE-LOCAL action to completely remove the resource locally.
let action = this.getStateModuleName(event, 'Deleted') + '/DELETE-LOCAL';
this.vue.$store.dispatch(action, message.data);
} | [
"function onModelDeleted (modelName, modelId) {\n console.log('[MQ]: onModelDeleted ' + ' ' + modelId);\n\n return Q()\n .then(() => {\n return deleteObjects(modelName, modelId)\n }).then(result => {\n console.log('[MQ]: onModelDeletedFromAlgolia ', modelName, modelId, result);\n });\n}",
"as... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
NumberLines Add line numbers in front of each line of a given textarea. Parameters: field: a textarea ID. | function NumberLines(field)
{
var short_names;
if (short_names = document.getElementById(field))
{
var new_text = "";
var old_text = short_names.value;
// remove first number
old_text = old_text.replace(/^\s*\d+\.[ \t]*/m, "");
// remove trailing lines
old_tex... | [
"function updateLineNumberBar() {\n\tif (!showLineNumbers)\n\t\treturn;\n\n\tvar newNumLines = getNumLines();\n\tvar linesToInsert = [];\n\tif (newNumLines > numLines) {\n\t\tfor (var i = numLines + 1; i <= newNumLines; i++)\n\t\t\tlinesToInsert.push('<br>' + i);\n\t\tvar currentLines = $('#lineNumbers').html();\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function calls for hiding up arrow. | function hideUpArrow() {
ProductDetailsScreen.FlexImageUpArrow.isVisible = false;
ProductDetailsScreen.FlexImageDownArrow.isVisible = true;
} | [
"function hideDownArrow() {\n ProductDetailsScreen.FlexImageUpArrow.isVisible = true;\n ProductDetailsScreen.FlexImageDownArrow.isVisible = false;\n}",
"function hideArrow() {\n if(arrow){\n setArrow(false)\n }\n }",
"function showDownArrow () {\r\n\t\t$('.sliceButton').animate({opacity: '0'},500)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
configure_plane_size: void Updates screen size and offset according to global.stage size and current index of workspace. | function configure_plane_size(){
plane_width = global.stage.width;
configure_plane_height();
configure_plane_offset();
} | [
"function configure_plane_height(){\n\tplane_height =\t((workspace_indexer.workspace_count - 1)\t*\n\t\t\t\t\t sliding_height )\t\t\t\t\t\t\t+\n\t\t\t\t\tglobal.stage.height;\n\tfor( let i in subplanes )\n\t\tsubplanes[i].set_size( plane_width, plane_height );\n}",
"function configure_plane_offset(){\n\tplane_off... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Callback firing when a lazy load media element has loaded. Making sure it only fires one per section in normal conditions (if load time is not huge) | function onMediaLoad(section){
if(options.scrollOverflow){
clearTimeout(g_mediaLoadedId);
g_mediaLoadedId = setTimeout(function(){
if(!hasClass($body, RESPONSIVE)){
scrollBarHandler.createScrollBar(section);
}
... | [
"function lazyLoad(destiny){\n if (!options.lazyLoading){\n return;\n }\n\n var panel = getSlideOrSection(destiny);\n\n $('img[data-src], img[data-srcset], source[data-src], source[data-srcset], video[data-src], audio[data-src], iframe[data-src]', panel).fo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a description for a debug adapter running as a socket based server. | function DebugAdapterServer(port, host) {
this.port = port;
this.host = host;
} | [
"function connectDebugAdapter(server) {\n var socket = net.createConnection(server.port, server.host);\n return {\n input: socket,\n output: socket,\n dispose: function () { return socket.end(); }\n };\n}",
"function describeAddress(socket) {\n if (socket.remoteFamily === \"IPv6\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Start WebSocket communication to get the rotational data from IMU | function initWebSocket() {
var socket = new WebSocket( "ws://localhost:8081" );
socket.onopen = openSocket;
socket.onmessage = updateRotation;
function openSocket() {
socket.send( "WebSocket is opened." );
}
function updateRotation( result ) {
var data = result.data.replace( /"/g, "" ).split( " " );
... | [
"function wsStart() {\n\t\tvar ws = new WebSocket(opts.websocket);\n ws.onopen = function() { opts.intro_messages.opening.created_at = new Date(); send_to_wire(opts.intro_messages.opening); };\n ws.onclose = function() { if(opts.debug) { opts.intro_messages.closing.created_at = new Date(); send_to_wir... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get previous valid offset | getPreviousValidOffset(paragraph, offset) {
if (offset === 0) {
return 0;
}
let validOffset = 0;
let count = 0;
let value = 0;
let bidi = paragraph.paragraphFormat.bidi;
for (let i = 0; i < paragraph.childWidgets.length; i++) {
let lineWidg... | [
"previousValue(offset = 1) {\n if (offset < 0) {\n offset = Math.abs(offset)\n }\n\n return this[this.length - 1 - offset]\n }",
"getLastOffset() {\n return parseInt(this.offset) + 1;\n }",
"get lastOffset() {\n var _a, _b;\n return (_b = (_a = this._mathfiel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
object to keep tracking of post ids for a given user, that is, which posts have already been received, processed, shown + which ones to request. modes of operation: "latestFirstTime" this is the first time the timeline is obtained, we known nothing about the last post ids. there will be no gap since timeline is empty o... | function idTrackerObj()
{
this.latest = -1;
this.oldest = -1;
this.gapHigh = -1;
this.gapLow = -1;
// getRequest method creates a single user item of getposts rpc list parameter
this.getRequest = function (mode) {
if( mode == 'latest' || mode == 'latestFirstTime' ) {
this.ga... | [
"function processLastHave(userHaves)\n{\n var reqConfirmNewPosts = [];\n var newPostsLocal = 0;\n for( var user in userHaves ) {\n if( userHaves.hasOwnProperty(user) ) {\n // checks for _idTrackerMap as well. the reason is that getlasthave\n // returns all users we follow, but ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
combines the results from FPR and FileQC queries then merges them on the file id if appropriate | function mergeFprsAndFqcs (
fprs,
fqcs,
includeRunInfo,
filterByQcStatus = false
) {
// first, remove run info if necessary
fprs = fprs.map((fpr) => maybeRemoveRunInfo(includeRunInfo, fpr));
// merge the FileQCs with FPRs first...
const fileids = fqcs.map((fqc) => fqc.fileid);
const mergedFqcs = fqcs.... | [
"function yesFprYesFqc (fpr, fqc) {\n if (fpr.fileid != fqc.fileid)\n throw new Error('Error: tried to merge non-matching files');\n const merged = Object.assign({}, fpr);\n merged.upstream = parseUpstream(merged.upstream);\n merged.qcstatus = convertBooleanToQcStatus(fqc.qcpassed);\n merged.username = fqc.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to catch event for button payroll staff on each records in table data employee | function catchEventButtonPayroll(buttonpayroll) {
buttonpayroll.addEventListener('click', function () {
let data = listEmployee._findByID(buttonpayroll.getAttribute('data-id'));
let employeeparse = JSON.parse(data);
let payrollstaff = employeeparse._NumberWorkingDay * employeeparse._Salary +... | [
"function enableemployer(obj)\n{\n\tvar token = $('#editemployerform > input[name=\"_token\"]').val();\n\tvar id = obj.closest(\"tr\").find(\"td:nth-child(1)\").text();\n\t$.post('/adminenableemployer', {_token: token, id: id}, function(data){\n\t\tobj.removeClass('btn-success').addClass('btn-danger');\n\t\tobj.chi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to get intake overview details | function getIntakeInfo() {
var intakeId = vm.TemplateModelInfo.matterId ? vm.TemplateModelInfo.matterId : vm.TemplateModelInfo.intakeId;
var dataObj = {
"page_number": 1,
"page_size": 250,
"intake_id": intakeId,
"is_migrated": 2
... | [
"function getSummary() {\n navigation.navigate(\"Summary\", {\n username: username,\n token: token,\n tripname: tripname,\n });\n }",
"getOverview() {\n return this._overview;\n }",
"summary () {\n return api.homescreenV3(this.tier, this.headers.ACCOUNT_ID, { headers: this.headers }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set multiple tips to a class | function setTips(targetClass, position, trigger) {
var $targets = $(targetClass);
position = position || "right";
trigger = trigger || "hover";
$.each($targets, function(index, target) {
var $target = $(target);
makeTip($target, $target.data("content"), position, trigger);
});
} | [
"function updateTips(t, tips) {\n\ttips.text(t).addClass(\"ui-state-highlight\");\n\tsetTimeout(function() {\n\t\ttips.removeClass(\"ui-state-highlight\", 1500);\n\t}, 500);\n}",
"function updateTips(tips, text) {\r\n tips\r\n .text(text)\r\n .removeClass(\"alert-light\")\r\n .addClass(\"a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Run express server for preview URLS served by this server: Any static file inside assets directory /fragmentpreview?collection=&fragment=: Gets a preview /previewconstants.js: Gets server related constants in JS vars : Redirects these requests to liferayportal | _runExpressServer() {
const app = express();
app.use(express.static(path.join(__dirname, 'assets')));
let collectionId = '';
let fragmentId = '';
let pageTemplateId = '';
app.get('/fragment-preview', (request, response) => {
collectionId = request.query.collection;
fragmentId = req... | [
"async function preview(inlineConfig = {}) {\n const config = await resolveConfig(inlineConfig, 'serve', 'production', 'production');\n const app = connect();\n const httpServer = await resolveHttpServer(config.preview, app, await resolveHttpsConfig(config.preview?.https));\n setClientErrorHandler(httpS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Scores the games for a given set of tickets | function scoreTickets(tickets, player) {
var gameNum = 1;
for(var game in tickets) {
if(tickets.hasOwnProperty(game)) {
if(runLotto(tickets[game]) != false && runLotto(tickets[game])[0] != false) {
var results = runLotto(tickets[game]);
var division = results[... | [
"computeRoundScores() {\n //the only score guaranteed to match the gameState (which may have changed) is the latest one\n const roundNumber = this.state.gameState.roundNumber;\n const threshold42 = this.state.gameState.threshold42 || 999;\n for (var playerNumber in this.state.players) {\n var game ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
is a Uint8array, and fails with an exception including "what" if it is not. | function assertUint8Array(obj, what) {
if (!(obj instanceof Uint8Array)) {
throw new Error('invalid ' + what + ': ' + obj);
}
} | [
"function assertUint8Array(obj, what) {\n if (!(obj instanceof Uint8Array)) {\n throw new Error('invalid ' + what + ': ' + obj);\n }\n }",
"function is_uint8array(bin) {\n return Object.prototype.toString.call(bin) === '[object Uint8Array]';\n}",
"ensureUint8Array(obj) {\n return obj instanc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Analyse a document and adds all forms and handlers to them | function analyze_document(document) {
add_form_buttons(document);
document_submit_catcher(document);
} | [
"function writeForms(xml) {\n\n\t//get our data first from our data handler function. we will\n\t//then use this data to populate the forms we create\n\tif (datahandler) \n\t{\n\t\tvar func = eval(datahandler);\n\t\tvar ret = func();\n\t\tif (ret) formdata = ret;\n\t\telse formdata = \"\";\n\t}\n\n\t//proccess our... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Increment matched couple number and display it | function incrementMatchedCouples() {
matchedCouplesNumber++;
MATCHED_COUPLE_DISPLAY.textContent = matchedCouplesNumber;
} | [
"function incrementMatchedCouples() {\r\n matchedCouplesNumber++;\r\n MATCHED_COUPLE_DISPLAY.textContent = matchedCouplesNumber;\r\n}",
"function increaseScore(){\n matched_pairs += 1;\n}",
"function displayCount(){\n var num;\n if (marks.length > 0) {\n num = cur + 1;\n } else {\n num = 0;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add and Remove a class from an item | function addC(item, className) { item.classList.add(className) } | [
"function replaceClassForItem() {\n\t//Check to see if the item's class is unselected\n\tif (this.className == \"item-unselected\") {\n\t\tthis.classList.remove(\"item-unselected\"); //Remove the item-unselected class\n\t\tthis.classList.add(\"item-selected\"); // Add the items selected class\n\n\t//Check to s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets or Sets the text color | get textColor() {
return brushToString(this.i.a5);
} | [
"get textColor() {\n return brushToString(this.i.t7);\n }",
"get textColor() {\n return brushToString(this.i.b2);\n }",
"get textColor() {\n return brushToString(this.i.dc);\n }",
"set text_color(value){\n this._text_color = value;\n this.div.style.color = value;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears the currently displayed profile of one exists | function clearProfile(){
var num_rows = profileTable.rows.length;
if (num_rows != 1){
while (num_rows > 1) {
profileTable.deleteRow(num_rows);
num_rows = profileTable.row.length;
}
}
} | [
"clearProfile() {\n\t\tthis.profile.innerHTML = '';\n\t}",
"clearProfile() {\n this.profile.innerHTML = '';\n }",
"clearProfile() {\n this.profile.innerHTML = '';\n }",
"clearProfile() {\n this.profile.innerHTML = ``;\n }",
"clearUser() {\n this.profileDiv.innerHTML = '';\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the importance of the current day | function getDayImportance() {
if (vm.goals === undefined) {
return;
}
var total = 0;
for (var i = 0; i < vm.goals.length; i++) {
total += vm.goals[i].importance;
}
return total;
} | [
"function getDayImportance() {\n\t\t\tvar total = 0;\n\n\t\t\tfor (var i = 0; i < vm.tasks.length; i++) {\n\t\t\t\ttotal += vm.tasks[i].importance;\n\t\t\t}\n\n\t\t\treturn total;\n\t\t}",
"function getDayFinishedImportance() {\n\t\t\tif (vm.goals === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar total = 0;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |