query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Final Salary Chart Calcualtor | function finalsalaryChart(statePensionAge){
//final salary chart
var finalsalaryChartArray = new Array();
//list of final salary colors
var finalBarColor =['#4e4e4e','#161616','#000000'];
//Array of finale salaries
angular.forEach($rootScope.finalsalary_list, function(finalSalary, step) {
//fin... | [
"calculateMonthlySalary() {\n let monthlySalary = this.annualSalary / 12;\n return monthlySalary;\n }",
"function calTotalSalary (employeeArray) {\n\n var totMonthSalary = 0;\n for (var i = 0; i < employeeArray.length; i++){\n var empSalary = employeeArray[i].base_salary;\n // console.log(empSalary... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
moves an enum up or down | function MoveEnumObj() {
let e = d.Config.enums
let i = u.GetNumber(event.target.id);
if (i === 0) { return false; }
let enumName = u.ID("selectAdminEnum").value;
let j;
if (event.target.id.charAt(7) === "U") { j = i - 1; }
else { j = i + 1; }
u.Swap(e[enumName], i, j);
u.WriteDict(0);... | [
"moveDown(){\n\t\tthis.aimDir = vec2.down();\n\t}",
"onMoveUpTap_() {\n /** @type {!CrActionMenuElement} */ (this.$.menu.get()).close();\n this.languageHelper.moveLanguage(\n this.detailLanguage_.language.code, true /* upDirection */);\n settings.recordSettingChange();\n }",
"function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TRANSLATE FUNCTIONS Convertis une couleur rgb en la teinte (couleur primaire) de cetteci. | colorToPrimary(rgb)
{
var result = [],
order_rgb = rgb.slice();
var pri_h = 255, // Déclaration des couleurs primaires.
pri_m,
pri_l = 0;
var h,
m,
l;
// Trie les nombres numériquement.
order_rgb.sort(function(a, b){return a - b});
h = order_rgb[2];
m = order_rgb[1];
l = order_rgb[0]... | [
"function rgbToCmy(n) {\n return Math.round((rgbInvert(n) / 255) * 100);\n}",
"function convert_RGB(code) {\r\n var round = Math.round, data = /(\\d+),\\s*(\\d+),\\s*(\\d+)|#(\\w{1,2})(\\w{1,2})(\\w{1,2})/.exec(code), result;\r\n // Nice rgb() code\r\n if (data[1]) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display user select field | function showSelect() {
$("#user").hide();
$("#user_sel").show().focus();
utils.runEval(' Page_Validators[0].controltovalidate = "user_sel" ');
} | [
"function ShowSelectedFieldInputForm(field_title, field_type, field_id){\n \n}",
"function showRegistrationDetails() {\n\tselectOne(sessionStorage.getItem('userID'), function(record) {\n\t\t\n\t\tif(!record) {\n\t\t\tconsole.log('Not found');\n\t\t}\n\t\telse {\n\t\t\t$('#txtFirstName').val(record.firstname);\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Verifies that there is another delay slot in progress | verifyDelaySlot() {
if (this.delaySlot) {
this.pushError("Cannot have a jump/branch instruction in delay slot! [line " + this.line + "]. Ignoring jump/branch in delay slot.");
return true;
}
return false;
} | [
"function reportDelayIfReady() {\n if (firstInputDelay && firstInputEvent && firstInputCallbacks.length > 0) {\n firstInputCallbacks.forEach(function(callback) {\n callback(firstInputDelay, firstInputEvent);\n });\n firstInputCallbacks = [];\n }\n }",
"function checkDelay(time, dPBact... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
edit a atelier in the database and reset atelierToEdit state | async editAtelier({ commit }, atelier) {
const response = await axios.put(
`/ateliers/${atelier._id}.json` + '?auth=' + auth.state.idToken,
atelier
);
commit('updateAtelier', response.data);
} | [
"revert() {\n this.innerHTML = this.__canceledEdits;\n }",
"function changeDate(after, before) {\n if (before !== after) {\n if (before) {\n var _before = $filter('rangeDate')(before);\n dataService.save($scope.xpns, _before);\n }\n if ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
OBJECT: A pair of longitude/latitude points interpreted as a bounding 'box' 0, 2, or 4 arg version: () or (geoPoint1,geoPoint2) or (wlon,nlat,elon,slat) | function geoBox(wlon,nlat,elon,slat) {
if(arguments.length==0) {
this.wlon = -96; this.nlat = 37;
this.elon = -94; this.slat = 35;
}
if(arguments.length==2) {
this.wlon = arguments[0].lon; this.nlat = arguments[0].lat;
this.elon = arguments[1].lon; this.slat = arguments[1].lat;
}
... | [
"function BoundingBox2D(min, max) {\n if (typeof min === \"undefined\") { min = new Vapor.Vector2(); }\n if (typeof max === \"undefined\") { max = new Vapor.Vector2(); }\n this.min = min;\n this.max = max;\n }",
"generateBoundingBox() {\n this.n = parseFlo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the stored theme, user system preference theme, or null. | function getStoredTheme() {
let theme = localStorage.getItem('theme') ? localStorage.getItem('theme') : null;
// check for user system preference
if (theme == null) {
if (!window.matchMedia) {
theme = null;
} else if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
theme ... | [
"function getTheme(theme = {}) {\n return theme['theme'] || theme\n}",
"getCurrentTheme() {\n return this.isDarkTheme ? 'dark' : 'light';\n }",
"get themeData() {\n if (this.manifest) {\n var themeData = {};\n // this is required so better be...\n if (varExists(this.manifest, \"meta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set popup promo cod border height | function popupBorderHeight() {
setTimeout(function () {
var heightPopup = $popup.height();
var val = heightPopup + 44;
$popupBorder.css('border-bottom-width', val+'px');
}, 10);
} | [
"function mapChoosepBorderHeight() {\n setTimeout(function () {\n var heightPopup = $shopForm.height();\n var val = 0;\n (windowWidth >= 768) ? val = parseInt(heightPopup + 1.4 * 12.8) : val = parseInt(heightPopup + 4 * 3.75);\n $shopFormBorder.css('border-bottom-width', val+'px');\n }, 10... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pick a moment m from moments so that m[fn](other) is true for all other. This relies on the function fn to be transitive. moments should either be an array of moment objects or an array, whose first element is an array of moment objects. | function pickBy(fn, moments) {
var res, i;
if (moments.length === 1 && isArray(moments[0])) {
moments = moments[0];
}
if (!moments.length) {
return moment();
}
res = moments[0];
for (i = 1; i < moments.length; ++i) {
if (moments... | [
"createMoment(...args) {\n return (this.options && this.options.useUtc) ? moment.utc(...args) : moment(...args);\n }",
"function moments_request() {\n return async function (observers, ...args) {\n if (!isArray(observers) || observers.length < 1) {\n return undefined;\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function jsValidate() validates the user input. If it contains special characters such as ~ | then display an alert. argForm: Form name of the document. argInputField: input element's name (could be textbox, textarea, etc.) | function jsValidate(argForm, argInputField) {
// If the user input needs to be checked for more characters then please add additional chrs
// in the parentheses of search method. For e.g. to add ";" change it to ".search(/[|~;]/)".
var textToValidate = eval("document."+argForm+"."+argInputField+".value");
... | [
"function checkverifychar(formname,fieldname,message)\n{\n\tvar e=eval(\"document.\" + formname + \".\" + fieldname);\n\t//var alphaExp = new RegExp(\"[a-zA-Z\"+allowchar+\"]\", \"g\");\n\tvar validRegExp = /^[a-zA-Z]+$/\n\t//var alphaExp = new RegExp(\"[a-zA-Z]\", \"g\");\n\tvar isValid = validRegExp.test(e.value)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a function for getV3ProjectsIdRepositoryArchive | getV3ProjectsIdRepositoryArchive(incomingOptions, cb) {
const Gitlab = require('./dist');
let defaultClient = Gitlab.ApiClient.instance;
// Configure API key authorization: private_token_header
let private_token_header = defaultClient.authentications['private_token_header'];
private_token_header.apiKey = 'Y... | [
"postV3ProjectsIdArchive(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getStyles() Fetches the style files and submits them to generateFileList. | async function getStyles() {
const url = '/api/styles';
const response = await fetch(url);
const styleFiles = await response.json();
console.log("HUB: Style files have been recieved");
generateFileList("stylesList", "delStylesList", styleFiles);
} | [
"function getThemeStyleList (bCustomOnly, bThemes, bStyles)\n{\n\tvar styles = new Array(), themes = new Array();\n\tvar supStyles = new Array(), supThemes = new Array();\n\tvar custStyles = new Array(), custThemes = new Array();\n\tvar out = new Array();\n\tif(bStyles)\n\t{\n\t\tvar dirList = doActionBDO (\"DATA_D... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
shows the sites that are blocked and displays a remove button for each site | function showBlockList () {
$("#blocklist").children().remove();
var i=1;
$.each(BLOCKER.getBlockedSites(), function (index, value) {
$("#blocklist").append("<li id='site-"+i+"'> <input type='button' class='pure-button button-remove' id='unblock-"+i+"' value='unblock' /> " + index + "</li>");
... | [
"function deleteAllWebsites() {\n\tdocument.getElementById(\"websitesCategory\").innerHTML = \"Websites\";\n\tdocument.getElementById(\"webMainContainer\").removeChild(document.getElementById(\"websiteContainer\"));\n\n\tvar ul = document.createElement(\"ul\");\n\tul.setAttribute(\"id\", \"websiteContainer\");\n\tu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get first element of the navigation stack | function first() {
return _navigationStack[0];
} | [
"get firstItem() {\n return !this.mainItems ? undefined : this.mainItems[0];\n }",
"function firstCollectionElem(obj){\n\t//get first element, if any\n\tvar elem = $(obj).first();\n\t//check if collection is empty (i.e. has no first element)\n\tif( elem.length == 0 ){\n\t\t//return null if it is empty\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given an array containing repo names, add up how many times each appears and then print out the five repos with the most appearances (or stars). | function printTopFive(starredrepos) {
// Where we will store the repos to be sorted.
let collectedRepos = {};
// Loop over inputted repos, create an object where keys are repo names
// and values are the number of times the repo has been starred.
starredrepos.forEach(function(repo) {
if (collectedRepos[re... | [
"function getStarCount(repos) {\n return repos.reduce((count, { stargazers_count }) => count + stargazers_count, 0);\n}",
"function getSpeciesCount() {\n\t\tvar arrayCount = [];\n\t\tfor (var i = 0; i < data.features.length; i++) {\n\t\t\tfor (var j = 0; j < comNameArr.length; j++) {\n\t\t\t\tif (data.features[i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
certainItem is sold divs manipulated, money comes back | function sellSpecificItem(someItem) {
someItem.shopDivI.style.display = 'block';
someItem.inventoryDivI.style.display = 'none';
money = money + someItem.sellI();
prestige = prestige - someItem.owningI;
someItem.boughtI = false;
updateStats();
message(msgSell + someItem.nameI + ' for ' + someItem.sellI() +... | [
"updateValidShopSelections(currentCash) {\n let shopPrices = this.shopItems.map(function(item) {\n let result = {};\n result.price = getPrice(item.selection);\n result.selection = item.selection;\n return result;\n });\n\n shopPrices.sort((a, b) => a.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function extracts the description to use for the wine varietal If not match is found it returns null. Only runs if hasn't already been set | function extractVarietalInfo(srch){
if(varietalInformation === null){
//Extract the varietal description
if(varietalInfo[srch] === undefined){
return null;
} else {
return varietalInfo[srch][0];
}
} else {
return varietalInformation;
}
} | [
"function getDescription(partition, local_tag){\r\n var partelem = $(\"span.tag:contains(\" + local_tag + \")\").filter(function(){\r\n return $(this).parent().find(\"span.partition\").text() == partition;\r\n });\r\n return partelem.parents(\"li.note_header\").children(\"ul.description\").text();\r\n}",
"g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creating a TabLink class object that we can manipulate | constructor(element, parent) { // constructor provides the instructions to build the object
this.element = element; // sets this instance of the TabLink's element to the one that was passed in
this.tabs = parent; // pulls this instance of tab down from the parent node
this.tabItem = this.tabs.getTab(this.el... | [
"function addObjectTab(wnd, node, data, tab)\n{\n if (!node.parentNode)\n return;\n\n // Click event handler\n tab.setAttribute(\"href\", data.location);\n tab.setAttribute(\"class\", policy.objtabClass);\n tab.addEventListener(\"click\", generateClickHandler(wnd, data), false);\n\n // Insert tab into the ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function to remove a constraint from simulation requires restarting simulation after | function removeConstraint(constraint) {
const index = constraints
.map(c => JSON.stringify({ l: c.leftID, r: c.rightID }))
.indexOf(JSON.stringify({ l: constraint.leftID, r: constraint.rightID }));
if (index === -1) {
console.warn("Cannot delete constraint, does not e... | [
"removeConstraint(constraint) {\n var index = constraintList.indexOf(constraint);\n if (index !== -1) {\n constraintList.splice(index, 1);\n }\n }",
"removeColumnConstraints() {\n $('.ghx-busted-max, .ghx-busted-min').removeClass('ghx-busted-min ghx-busted-max'); // Red/y... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load selected map data | function loadMap(clickedMap,callback){
// Get id value of item
var selectedID = clickedMap.children("td").attr("id");
// Get the complete data for the selected item
var txn, req, store, idx, dataArray = [];
// Request the index for the specified objectStore
txn = db.instance.transaction('zipcod... | [
"function loadMapData()\r\n{\r\n\t//First clear the old shapes from the editor\r\n\t//This is important in the event that we're either\r\n\t//loading a new layer or a completely new image map\r\n\tclearEditor();\r\n\tloadLayers();\r\n\t//Load the shapes onto the layer\r\n\tvar mapLayer = getLayerById( imageMap, cur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update ActiveUsers List with true status | function activeUser()
{
if(getCurrentUserIDFromLocalStorage() != null)
{
var currentUserID = getCurrentUserIDFromLocalStorage();
db.collection('ActiveUsers').doc(currentUserID).set({
active: true
}).then(function() {
console.log("Active list Update!");
... | [
"async _inactivateExistingEntries(params) {\n const oThis = this;\n\n const existingRows = await new StakerWhitelistedAddress()\n .select('id')\n .where(oThis._activeEntriesWhereClause(params))\n .fire();\n\n if (existingRows.length === 0) {\n return responseHelper.successWithData({});\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Are there any default or user scopes defined. | hasAnyScopes() {
if (this.scopes && this.scopes.length > 0)
return true;
if (this.defaultScopes && this.defaultScopes.length > 0)
return true;
return false;
} | [
"function getProfileScope() {\n var requestScope = context.request.query.scope || \n context.request.body.scope;\n var scopes = requestScope.split(' ');\n var required_scope = _.find(scopes, function(scope) {\n return supported_scopes[scope];\n });\n return required_scope;\n }",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is poorly named. It is called when loading a network or changing networks It rebuilds links, labels, and menus, accordingly | function computeLinks(net) {
// Update the name
netName = net;
// Clear all old links
removeLinks();
// Get labels for size and color
nodeSizeLabels = nodeSizeLabelsBase.slice(0);
nodeColorLabels = nodeColorLabelsBase.slice(0);
// get the adjacencies
adj = d3.values(wwdata["network"... | [
"function updateNetwork() {\n if (d3.event) {\n d3.event.stopPropagation();\n }\n node = node.data(graph.nodes, function (d) {\n return d.id;\n });\n node.exit().remove();\n node = node.enter().append(\"circle\").attr(\"fill\", function (d) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reset all selected days | function resetSelectedDays () {
scope.currentWeeks.forEach(function(week, wIndex){
week.forEach(function(day, dIndex){
scope.currentWeeks[wIndex][dIndex].isSelected = false;
});
});
} | [
"function clearDates(){\n beginDate = \"\";\n endDate = \"\";\n days = [];\n\n}",
"resetSelected() {\n\t\tthis.setHour(this.time.hour)\n\t\tthis.setMinute(this.time.minute)\n\t\tthis.setPeriod(this.time.getPeriod())\n\t}",
"resetOptions(){\r\n\t\t// reset all extras;\r\n\t\tconst $selects = $('.sm-box'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Chapter 101 RopeGroup Set player expression | function C101_KinbakuClub_RopeGroup_PlayerSusExpression() {
C101_KinbakuClub_RopeGroup_PlayerPose = "SusPlr_LookDownNeutral";
if (ActorGetValue(ActorSubmission) >= 2) C101_KinbakuClub_RopeGroup_PlayerPose = "SusPlr_LookDownDominant";
if (ActorGetValue(ActorSubmission) <= -2) C101_KinbakuClub_RopeGroup_PlayerPose = "... | [
"function C101_KinbakuClub_RopeGroup_WillLucyTie() {\n\tif (ActorGetValue(ActorLove) >= 3 || ActorGetValue(ActorSubmission) >= 2) {\n\t\tOverridenIntroText = GetText(\"LucyNotTieYou\");\n\t\tC101_KinbakuClub_RopeGroup_CurrentStage = 600;\n\t} else C101_KinbakuClub_RopeGroup_PlayerTied();\n}",
"function C101_Kinba... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
INDEX ORDER FOR DRAWING TRIANGLE | function indexAlgorithm(){
var temp = [];
var offset = 36;
var totalPoints = (revA.length/3);
var i = 0;
for (i = 0; i < totalPoints-offset; i++){
if (i != 0 && (i+1) % 36 == 0) {
temp.push(i);
temp.push(i-35);
temp.push(i+offset);
temp.push(i-35);
temp.push(i+offset);
temp.push(i-35+offset... | [
"function getQuadIndexFromBoardCoord(index) {\n let x = Math.floor(Math.floor(index / 9) / 3);\n let y = Math.floor(Math.floor(index % 9) / 3);\n\n return parseInt(\"\" + x + y);\n}",
"function setTriangle( tri, i, index, pos ) {\n\n\tconst ta = tri.a;\n\tconst tb = tri.b;\n\tconst tc = tri.c;\n\n\tlet i0 = i;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Makes a result handler for mongo queries. | function makeResultHandler(request, response, options) {
return function (error, results) {
if (error) {
log.error(error);
response.status(500).send('Database error: ', error.toString());
} else {
if (options.postLoadProcessor) {
results = options.postLoadProcessor(results, response)... | [
"function MongoModel() {\n \n return {\n // every request is wrapped in this, so we will create the\n //connection if we need it\n doIt : function (callback){\n // if the connection isn't defined, we need to create it\n if (db === null) {\n var uri = 'mongodb://'\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
updateDom updates a 2way binding field | function updateDom (isTemplate) {
addLog('updateDom() was triggered');
_.forEach(scope.dataBoundNodes, function (node) {
//find the matching object and set the node value
node.value = setGetObjPath(false, node.attributes['data-bind'].value);
});
} | [
"_updateDirtyDomComponents() {\n // An item is marked dirty when:\n // - the item is not yet rendered\n // - the item's data is changed\n // - the item is selected/deselected\n if (this.dirty) {\n this._updateContents(this.dom.content);\n this._updateDataAttributes(this.dom.box);\n thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the maximum xcoordinate of the entire rectangle | getMaxX(){ return this.x + this.width } | [
"function getXCoordinatesRange() {\n return (MAX_X_COORDINATE - MIN_X_COORDINATE);\n } // getXCoordinatesRange",
"function largestRectangle(h) {\n\n let stack = [];\n let mx = -1;\n stack.push(0);\n for (let i = 1; i < h.length; i++) {\n let last_index = stack.slice(-1)[0];\n let stack_h = h[last... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch all the documents from the src as described in the "diffs", which is a mapping of docs IDs to revisions. If the state ever changes to "cancelled", then the returned promise will be rejected. Else it will be resolved with a list of fetched documents. | function getDocs(src, diffs, state) {
diffs = clone(diffs); // we do not need to modify this
var resultDocs = [];
function fetchMissingRevs(id, missingRevs) {
var opts = {
revs: true,
open_revs: missingRevs,
attachments: true
};
return src.get(id, opts).then(function (docs) {
... | [
"async function getChangedIds(startTimestamp, endTimestamp) {\n\n let changes = [];\n let nextPage='/changes/location?page=1&perPage=1000&startTimestamp=' + startTimestamp + '&endTimestamp=' + endTimestamp;\n\n do {\n let changeUrl = url + nextPage;\n\n let response = await axios.get(ch... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
show page of PDF | function showPage(page_no) {
_PDF_DOC.getPage(page_no).then(function (page) {
// set the scale of viewport
var scale_required = _CANVAS.width / page.getViewport(1).width;
// get viewport of the page at required scale
var viewport = page.getViewport(scale_required);
// set canvas height
_CANV... | [
"function changePage(num) {\n const newPage = pageNum + num;\n if (newPage < 1 || newPage > pdfDoc.numPages) return;\n pageNum = newPage;\n setArrows(); //Hide and show arrow buttons according to the page number\n queueRenderPage(pageNum);\n}",
"function loadPdf(url){\n console.log(\"Load pdf do... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Workers manages a worker pool. You should probably use this via the AsyncCrypto interface. TODO: Perhaps we should merge this and AsyncCrypto? All we need is a convenient interface for doing computationally intense operations, and automatically manage a default global worker pool. Workers does exactly that. AsyncCrypto... | function Workers () {
if (!(this instanceof Workers)) {
return new Workers()
}
if (!pool) {
if (!process.browser) {
pool = workerpool.pool(__dirname + '/worker.js')
} else {
pool = workerpool.pool(process.env.DATT_NODE_JS_BASE_URL + process.env.DATT_NODE_JS_WORKER_FILE)
}
}
} | [
"async createWorkers () {\n\n let worker;\n if ( !this.fallback ) {\n\n let workerBlob = new Blob( this.functions.dependencies.code.concat( this.workers.code ), { type: 'application/javascript' } );\n let objectURL = window.URL.createObjectURL( workerBlob );\n for ( le... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Flatten an Array of mixins to a map of method name to mixin implementations | function collateMixins(mixins) {
var keyed = {};
for (var i=0; i<mixins.length; i++) {
var mixin = mixins[i];
for (var key in mixin) {
if (mixin.hasOwnProperty(key) && typeof mixin[key]==='function') {
(keyed[key] || (keyed[key]=[])).push(mixin[key]);
}
}
}
return keyed;
} | [
"function applyMixins(properties) {\n var mixins = properties.__mixin__\n if (!is.Array(mixins)) {\n mixins = [mixins]\n }\n var mixedProperties = {}\n for (var i = 0, l = mixins.length; i < l; i++) {\n mixin(mixedProperties, mixins[i])\n }\n delete properties.__mixin__\n return object.extend(mixedPro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the name of the next callback method, by incrementing the global `nextRequestId`. | nextCallback() {
return `ng_jsonp_callback_${nextRequestId++}`;
} | [
"#nextId() {\n const nextId = \"id_\" + this.#currentId;\n this.#currentId++;\n return nextId;\n }",
"function find_next_autogen_key(resourceName,offset) {\n var nextId = 'id_'+(Object.keys(DATA[resourceName]).length + offset);\n if (DATA[resourceName][nextId]) {\n nextId = find_next_autogen_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creates the closure to create the p5 canvas This is so we have access to our 'this' | get setup() {
let self = this;
return function(){
self.p.createCanvas(
$("#" + self.setup_arguments.parent_id).outerWidth(true),
self.setup_arguments.height);
self.p.strokeWeight(self.setup_arguments.stroke_weight);
self.reset();
};
} | [
"function createProcessingWindow(canvas) {\n\n }",
"resize() {\n this.createCanvas();\n }",
"initCanvas() {\n // Create new canvas object.\n this._canvasContainer = document.getElementById(this._canvasId);\n if (!this._canvasContainer)\n throw new Error(`Canvas \"${this._c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
now we can bulid tallestPerson function using reduse | function tallestPerson (array) {
return reduce (array , function (tallest , element) {
if (tallest < element) {
tallest = element } ;
return tallest ;
}) ;
} | [
"function leastOwed(){\n\tvar minPerson = 0;\n\tfor (var person in people){\n\t\tif (people[person].owes < people[minPerson].owes){\n\t\t\tminPerson = person;\n\t\t}\n\t}\n\tif (people[minPerson].owed >= 0){\n\t\treturn FALSEINDEX;\n\t}\n\n\treturn minPerson;\n}",
"function followsLeastPeople(socialData) {\n var... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
List document entries by filter with paging support. | static listAction(filter = null, pager = null){
let kparams = {};
kparams.filter = filter;
kparams.pager = pager;
return new kaltura.RequestBuilder('document_documents', 'list', kparams);
} | [
"static listAction(filter = null, pager = null){\n\t\tlet kparams = {};\n\t\tkparams.filter = filter;\n\t\tkparams.pager = pager;\n\t\treturn new kaltura.RequestBuilder('baseentry', 'list', kparams);\n\t}",
"static list(collection, filter={}) {\n return db.db.allDocs({include_docs: true});\n }",
"stat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pushes a value into high or lowvalue array based on a seperator value | function splitCollectionIfNotZero(highArray, lowArray, comparisonValue, seperatorValue) {
if (comparisonValue != 0 && comparisonValue != null) {
if (comparisonValue > seperatorValue) {
highArray.push(comparisonValue);
}
else if (comparisonValue <= seperatorValue){
... | [
"function mixedNumbers(arr) {\n // change code below this line\n arr.unshift(\"I\", 2, \"three\");\n arr.push(7, \"VIII\", 9);\n // change code above this line\n return arr;\n}",
"function placeInMiddle(arr, vals){\n\tarr.splice(Math.floor(arr.length/2),0,...vals);\n\treturn arr;\n\t\n}",
"functi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the client key specified in a dataldclientkey attr | function getClientKey() {
} | [
"getKey() {\n return new DependencyKey(this.context, this.identifier);\n }",
"get keyName() {\n const prefix = this.guildIDs ? this.guildIDs.join(',') : 'global';\n return `${prefix}:${this.commandName}`;\n }",
"ComputeKeyIdentifier() {\n\n }",
"function getKeyData(keyRow) {\n var k... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is responsible for calling the nesscary compenents to mount to the page before the page does it's initial render. It's intended purpose is to call the function setRoute to set up the User information and _loadFontsAsync to load the custom fonts and getTasks to get all of the tasks associated with the user... | async componentDidMount() {
this._loadFontsAsync();
await this.setRoute();
this.getTasks();
} | [
"async init() {\n this.handleEventHandlers()\n await this.model.load().then(\n res => {\n if (res) {\n this.setupView(res)\n }\n }\n )\n }",
"function activate() {\n user.registerCb(function(){\n routes.fetch(user.getUser().username)\n .then(function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set localStorage. Adds a key prefix to reduce overlap likelihood. | function setLocalStorage(key, value) {
var ood_key = KEY_PREFIX + key;
localStorage.setItem(ood_key, value);
return null;
} | [
"function storePrefixedInputStorageItem(prefix,input_element) {\n var item_data = getInputData(input_element);\n localStorage.setItem(prefix + item_data.id, JSON.stringify(item_data));\n }",
"function store(data,key) {\n\tlocalStorage[key] = JSON.stringify(data);\n}",
"function updateLocalStorage(key, da... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
inject array a2 into array a1 at index | function inject( a1, index, a2 ) {
return a1.slice( 0, index ).concat( a2 ).concat( a1.slice( index ) );
} | [
"function intertwineArrays(a, b) {\n var c = [];\n for (var i = 0; i < a.length; i++) {\n c[c.length] = a[i];\n c[c.length] = b[i];\n }\n return c;\n}",
"function rebuilding(arr, index1, index2) {\n var newArr = arr.map(function (value) { return value });\n var arg = Array.prototyp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Kemudian, karena fungsi makeCoffee() sekarang menangani proses asynchronous, maka fungsi tersebut juga menjadi fungsi asynchronous. Tambahkan async sebelum deklarasi fungsi untuk membuatnya menjadi asynchronous | async function makeCoffee(){...} | [
"function makeCoffee(){\n\tgetCoffee().then(coffee=>{\n\t\tconsole.log(coffee);\n\t});\n}",
"async function getCupcakes() {\r\n cupcakes = await Cupcake.fetchAllCupcakes();\r\n $(\".cupcake_list\").html(\"\");\r\n if (cupcakes) {\r\n for (let cupcake of cupcakes) {\r\n showCupcake(cupcake);\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
======== for comiler ======= const LF = '\n'; const TAB = ' '; | function LF() {
return '\n';
} | [
"function getLineBreak(theForm){\n var retVal;\n var selInd = theForm.WhichPlatform.selectedIndex;\n\n switch (selInd){\n case 0:\n\t retVal = \"\\r\\n\";\n\t\t break;\n\t case 1:\n\t retVal = \"\\r\";\n\t\t break;\n\t case 2:\n\t retVal = \"\\n\";\n\t\t break;\n }\n \n return retVal;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write the following declarations and implementations: Two instance variables: one for your stack and one for your queue A void pushCharacter(char ch) method that pushes a character onto a stack. A void enqueueCharacter(char ch) method that enqueues a character in the instance variable. A char popCharacter() method that... | function Solution(){
let stack = []
let queue = []
this.pushCharacter = (ch) =>{
return stack.push(ch)
}
this.enqueueCharacter = (ch) =>{
return queue.push(ch)
}
this.popCharacter = () => {
return stack.pop();
}
this.dequeueCharacter = () => {
return q... | [
"function Queue(){\n //Stack1 for pushing Queue Items\n let stack1 = new Stack();\n //Stack2 for popping Queue Items\n let stack2 = new Stack();\n\n this.push = function(element){\n stack1.push(element);\n }\n\n this.pop = function(){\n stack2.clear();\n while(!stack1.isEmp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CLOSEALLDIVS: closes all side divs | function closeAllDivs() {
closeDiv(highlightExpandedDivLine);
closeDiv(downplayExpandedDivLine);
closeDiv(highlightExpandedDivBar);
closeDiv(downplayExpandedDivBar);
closeDiv(annotateExpandedDivLine);
closeDiv(annotateExpandedDivBar);
} | [
"function closeAllScreenshots() {\r\n\tcloseDiv(org1_line); \r\n\tcloseDiv(org2_line); \r\n\tcloseDiv(org3_line); \r\n\tcloseDiv(org4_line); \r\n\tcloseDiv(org5_line); \r\n\tcloseDiv(org1_bar); \r\n\tcloseDiv(org2_bar); \r\n\tcloseDiv(org3_bar); \r\n\tcloseDiv(org4_bar); \r\n\tcloseDiv(org5_bar); \r\n}",
"fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
METHODS +++ METHODS +++ METHODS +++ METHODS +++ METHODS +++ METHODS +++ METHODS +++ METHODS +++ METHODS +++ METHODS add a class item object to our list of class items | addClassItm(item){
//add the class item to our list of class items:
this.classItems.push(item);
//every time a class is added, it should be "selected"
this.setSelectedItem(item.getID());
//if this item changes it's name, the list should be updated:
var me=this;
item.onNameChange(function(){me.updateLis... | [
"add(item) {\n this.items.add(item);\n }",
"function Items()\r\n{\r\n // Where we store the object list\r\n this.list = new Array;\r\n \r\n //\r\n // Adds an object to the list\r\n //\r\n // @param new_object ... New object to push\r\n //\r\n if (!Items.prototype.add)\r\n I... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
.prepend adds elements to the front of a target fluent doc(target).prepend(children); legacy doc.prepend(target, children); | function prepend(target, children){
var target = getTarget(target),
children = getTarget(children);
if(isList(target)){
target = target[0];
}
if(isList(children)){
//reversed because otherwise the would get put in in the wrong order.
for (var i = children.leng... | [
"_insertAsFirstChild(element, referenceElement) {\n referenceElement.parentElement.insertBefore(element, referenceElement);\n // bump up element above nodes which are not element nodes (if any)\n while (element.previousSibling) {\n element.parentElement.insertBefore(element, element.previousSibling);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Builds path from the given node to any position where the mask tree breaks Returns true if it made any progress. This is to prevent going backandforth in a road piece | function buildPaths(i, mask, visited, edges, data_array, dp) {
visited[mask][i] = true;
if (dp[mask][i] == 0) return true; // base case
// Test if we can split here
const node_cost = (data_array[i] == 0 ? 1 : 0);
var splitmask = -1;
for (var submask = mask; submask != 0; submask = (submask - 1) & mask) {
const... | [
"function lightUpWinningPath(node) {\n console.log(\"WINNING PATH FOUND\");\n curr = node;\n while (curr) {\n curr.fillType = 3;\n curr = curr.parent;\n }\n startPathFinding = false;\n}",
"finalizeSlicedFindPath() {\n\n\t\tlet path = [];\n\t\tif (this.m_query.status == Status.FAILURE) {\n\t\t\t// Reset... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Allocates the necessary amount of slots for host vars. | function allocHostVars(count) {
if (!getFirstTemplatePass())
return;
var lView = getLView();
var tView = lView[TVIEW];
queueHostBindingForCheck(tView, getCurrentDirectiveDef(), count);
prefillHostVars(tView, lView, count);
} | [
"newAdSlot(placementName, channel, targeting, adUnitPath, slotSize, sizeMappings) {\n return new Promise(((resolve) => {\n let adSlot;\n window.freestar.queue.push(async () => {\n if (!adUnitPath) {\n const mappedName = await this.getMappedPlacementName(placementName, targeting);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::AppMesh::VirtualNode.SubjectAlternativeNameMatchers` resource | function cfnVirtualNodeSubjectAlternativeNameMatchersPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnVirtualNode_SubjectAlternativeNameMatchersPropertyValidator(properties).assertSuccess();
return {
Exact: cdk.listMapper(cdk.stringToCloud... | [
"function cfnVirtualNodeSubjectAlternativeNamesPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnVirtualNode_SubjectAlternativeNamesPropertyValidator(properties).assertSuccess();\n return {\n Match: cfnVirtualNodeSubjectAlternativeNam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets developer metadata URL by developer Id | getDeveloperUrl(developerId) {
let self = this;
return new Promise((resolve,reject) => {
self.contract.methods.developerIpfs(developerId).call({from: self.account})
.then((ipfs) => {
let digest = Buffer.from(ipfs.digest.substring(2), 'hex');
let metadataMultihash = multihashes.... | [
"function getTargetUrl() {\n\tvar connector = remote.connect(\"alfresco\");\n\t\n\tvar response = connector.call(\"/person-node/\" + user.id);\n\t\n\tif (response.status == 200) {\n\t\tvar json = JSON.parse(response);\n\t\treturn \"edit-metadata?nodeRef=workspace://SpacesStore/\" + json.nodeId;\n\t}\n\n\treturn nul... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SetADEBadgeInstallerDefaults() Setup defaults to then use ADEBadgeInstallerInstanceWithDefs() NOTE: on 04/17/08, the (3) buttonLabel params were removed buttonLabelNotRequirements, buttonLabelNot, buttonLabelInst | function SetADEBadgeInstallerDefaults(autoInstall, autoLaunch, badFlashRedirectURL, sendSWFVersion, sendButtonPush)
{
G_bAutoInstall = autoInstall;
G_bAutoLaunch = autoLaunch;
G_strBadFlashRedirectURL = badFlashRedirectURL;
G_bSendSWFVersion = sendSWFVersion;
G_bSendButtonPush = sendButtonPush; // if true, ... | [
"function SetADEBadgeLauncherDefaults(autoInstall, autoLaunch, badFlashRedirectURL, sendADEInstalled)\r\n{\r\n\tG_bAutoInstall = autoInstall;\r\n\tG_bAutoLaunch = autoLaunch;\r\n\tG_bSendADEInstalled = sendADEInstalled;\r\n\tG_strBadFlashRedirectURL = badFlashRedirectURL;\r\n\t\r\n\treturn;\r\n}",
"function creat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decides if the supplied variable is variant label | function isVariantLabel(v) {
return typeof v === "string" || isVariantLabels(v);
} | [
"function isVar(node) {\n return t.isVariableDeclaration(node, { kind: \"var\" }) && !node[_constants.BLOCK_SCOPED_SYMBOL];\n}",
"function isObligatoryLabel(label){\t\r\n\treturn obligatoryDataElementsLabel.includes(label);\r\n}",
"_label(label) {\n return `${label}${label && this.required ? '*' : ''}`;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
drawRectangle(x,y,w,h, fillC, strokeC, lw, fill(b), stroke(b) ) | function drawRectangle(x,y,w,h, fillC, strokeC, lw, fill, stroke ){
ctx.beginPath();
ctx.rect(x,y,w,h);
if(fill == true){
ctx.fillStyle = fillC;
ctx.fill();
}
if(stroke == true){
ctx.lineWidth = lw;
ctx.strokeStyle = strokeC;
ctx.stroke();
}
... | [
"function rect( x,y,w,h, color){\n\t\n var x = x;\n var y = y;\n var w = w;\n var h = h;\n var color = color;\n\n \t//defaults\n if(x == undefined) x = 0;\n if(y == undefined) y = 0;\n if(w == undefined) w = 100;\n if(h == undefined) h = 100;\n if(color == undefined) color = \"lightgr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Widget for a single question. Should be extended for supporting different option widgets. | function AbstractQuestionWidget(question, onAnswer) {
var answer;
this.getAnswer = function () {
return answer;
};
this.setAnswer = function (value) {
answer = value;
onAnswer();
};
this.getTerm = function () {
... | [
"function renderQuestion() {\n $(\"#quiz\").html(`\n <p>${myQuestions[questCounter].question}</p>\n <p><button class=\"answers\">${myQuestions[questCounter].answers.a}</button></p>\n <p><button class=\"answers\">${myQuestions[questCounter].answers.b}</button></p>\n <p><button class=\"answers\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
OPCUAclient method Calls a opcua method of this server. The nodeId has to be the same id, with whom the method was defined | function callOpcuaMethod(nodeId, args, callback){
var methodCallRequest = {
objectId: "ns=1;i=1000", // Node ID of the robot arm
methodId: nodeId,
inputArguments: args
};
session.call(methodCallRequest, callback);
} | [
"op (code) {\n return this.byte(code, \"op\");\n }",
"function opcuaServerPostInitialize(){\n var addressSpace = server.engine.addressSpace;\n\n var robot = addressSpace.addFolder(addressSpace.rootFolder.objects, {browseName: \"Robot02\"});\n\n var opcua_servos = [];\n\n // Add OPCUA-Variable fo e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of the given annotation type, if any. | annotation(type) {
for (let ann of this.annotations)
if (ann.type == type)
return ann.value;
return undefined;
} | [
"annotation(type) {\n for (let ann of this.annotations) if (ann.type == type) return ann.value\n return undefined\n }",
"function getAnnotation (path: NodePath): TypeAnnotation {\n let annotation;\n try {\n annotation = getAnnotationShallow(path);\n }\n catch (e) {\n if (e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is called whenever a burger item is in edit mode and loses focus This cancels any edits being made | function cancelEdit() {
var currentBurger = $(this).data("burger");
if (currentBurger) {
$(this).children().hide();
$(this).children("input.edit").val(currentBurger.text);
$(this).children("span").show();
$(this).children("button").show();
}
} | [
"_evtFocusOut(event) {\n const relatedTarget = event.relatedTarget;\n // Bail if the window is losing focus, to preserve edit mode. This test\n // assumes that we explicitly focus things rather than calling blur()\n if (!relatedTarget) {\n return;\n }\n // Bail i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Vibrant lacks an hsl to hex conversion method, so hsl is converted hsl, then to hex. | function hslToHex(h ,s ,l){
let rgb = Vibrant.Util.hslToRgb(h, s, l);
let hex = Vibrant.Util.rgbToHex(rgb[0], rgb[1], rgb[2]);
// console.log(hex)
return hex;
} | [
"function hslToHex(h, s, l) {\n var color = hslToRgb(h, s, l);\n\n color = color.map(function pad(v) {\n\n v = v.toString(16);\n v.length < 2 ? (v = \"0\" + v) : v; // Add zero before hex number to keep constant length of hex color string\n\n return v;\n });\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a common interview question where you need to write a program to find all duplicates in an array. The elements in the array have no restrictions, but in this algorithm we'll work specifically with integers. Finding duplicates in an array can be solved in linear time by using a hash table to store each element a... | function duplicates(arr) {
// our hash table to store each element
// in the array as we pass through it
var hashTable = [];
// store duplicates
var dups = [];
// check each element in the array
for (var i = 0; i < arr.length; i++) {
// if element does not exist in hash table
// then... | [
"function checkDuplicate(arr){\n return (new Set(arr)).size !== arr.length\n}",
"function findTotalNumberOfDupes(arr) {\n var totalDupes = 0;\n let counts = {};\n\tarr.forEach(elem => {\n counts[elem] = (counts[elem] || 0) + 1;\n\t});\n for(let elem in counts){\n \tif (counts[elem] > 1) totalDupes=totalDu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that clears the grid at the end of the game | function clearGrid() {
score = 0
mode = null
firstMove = false
moves = 10
timer = 60
interval = null
grid.innerHTML = ''
} | [
"function clearGrid() {\n initializeColorGrid();\n draw();\n }",
"clearGrid() {\n for (let row = 0; row < this.N; row++) {\n for (let column = 0; column < this.N; column++) {\n this.grid[row][column].element.remove();\n }\n }\n this.grid =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Geocode the neighbor homes to convert street address to lat/lng Due to unknown reasons the sites (locations) are hard coded, as the geocode API did not work correctly. | function getLocations() {
// Initialize the geocoder.
var geocoder = new google.maps.Geocoder();
var coords = [];
// Geocode the address for the neighbor homes
for (var i=0, len=homes.length; i<len; i++) {
var addr = homes[i].address + ', ' + homes[i].cityStateZip;
geocoder.geocode(... | [
"function geocoder(state) {\n geocoder = new google.maps.Geocoder();\n\n geocoder.geocode( { 'address': state}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n\n var lat = results[0].geometry.location.lat();\n var lng = results[0].geometry.location.lng();\n dispLoc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a query builder with initial `gt` set | static gt(...args) { return this.__query().gt(...args); } | [
"createFilterQuery() {\n const filterType = this.state.filterType;\n const acceptedFilters = ['dropped', 'stale', 'live'];\n\n if (acceptedFilters.includes(filterType)) {\n const liveIDs = this.state.liveIDs;\n if (filterType === 'dropped') return {'events.id': {$nin: liveIDs}};\n if (filter... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the first snapshot since the given date for a given player. Useful for finding the start snapshot for any competition participation. | async function findFirstSince(playerId, date) {
const result = await Snapshot.findOne({
where: { playerId, createdAt: { [Op.gte]: date } },
order: [['createdAt', 'ASC']]
});
return result;
} | [
"async function findFirstIn(playerId, period) {\n if (!PERIODS.includes(period)) {\n throw new BadRequestError(`Invalid period ${period}.`);\n }\n\n const beforeDate = moment().subtract(1, period).toDate();\n\n const result = await Snapshot.findOne({\n where: { playerId, createdAt: { [Op.gte]: beforeDate ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compare result1 with result2: higher scores compare lower; if scores are equal, then lexicographically earlier names compare lower. | function compareResults(result1, result2) {
return(result2.score - result1.score) ||
result1.name.localeCompare(result2.name);
} | [
"function compareByScore(a, b) {\n \"use strict\";\n if ((a.seize && b.seize) || (!a.seize && !b.seize)) {\n i = b.totalScore - a.totalScore;\n return i;\n } else if (a.seize && !b.seize) {\n return -1;\n } else {\n return 1;\n }\n}",
"function scoreSort(a, b){\n retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tell a Chuck Norris joke | function chuckJoke() {
axios.get('https://api.icndb.com/jokes/random').then(res => {
const joke = res.data.value.joke;
const params = {
icon_emoji: ':joy_cat:'
};
bot.postMessageToChannel('random', `Chuck Norris: ${joke}`, params);
});
} | [
"function tellMe(joke){\n // got this code from tts api documentation \n VoiceRSS.speech({\n key: '233e1729322c4d28829ef0d633b14196',\n src: joke,\n hl: 'en-us',\n v: 'Harry',\n r: 0, \n c: 'mp3',\n f: '44khz_16bit_stereo',\n ssml: false\n})\n}",
"func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array of listeners that are listening for any event that is specified. This array can be manipulated, e.g. to remove listeners. | listenersAny() {
return this._anyListeners || [];
} | [
"function findElementsWithListener(eventName) {\n var registeredListeners;\n var attributeListeners;\n\n // Check the registry for listeners.\n if (_elementsWithListeners.hasOwnProperty(eventName)) {\n registeredListeners = _elementsWithListeners[eventName];\n } else {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Receive message from contact 1 second after you've sent it | receiveMessage() {
setTimeout(function () {
app.currentRecipient.messages.push(
{
date: app.getCurrentTime(),
text: 'Ok',
status: 'received'
}
);
}, 100... | [
"function messageLoop()\r\n{\r\n\tvar timeNow = new Date();\r\n\tvar year = timeNow.getFullYear();\r\n\tvar month = timeNow.getMonth() + 1;\r\n\tvar day = timeNow.getDate();\r\n\tvar hour = timeNow.getHours();\r\n\tvar minute = timeNow.getMinutes();\r\n\tvar status = deviceState ? \"On\" : \"Off\";\r\n\tvar usage =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return a number of cards from the top of the deck without changing it if the number id bigger than the deck size, the function will return all the reamining cards in the deck usage: deck.peek(1) | peek(num) {
if (this._cards.length > 0) {
if (num && Number.isInteger(num)) {
return this._cards.slice(0, Math.min(num, this._cards.length));
}
}
} | [
"function getDeck(){\n var shuffledCards, deck;\n $(\".deck\").show(\"explode\", 1000);\n $(\".score-panel\").show();\n shuffledCards = shuffle(cardTypes);\n $(\".card\").each(function(index){\n $(this).show(\"explode\" );\n $(this).children().attr(\"class\", \"fa fa-\" + shuf... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The version of the underlying Pulumi CLI/Engine. | get pulumiVersion() {
if (this._pulumiVersion === undefined) {
throw new Error(`Failed to get Pulumi version`);
}
return this._pulumiVersion.toString();
} | [
"get cliVersion() {\n return this._cliConfig.get('cli-version', null);\n }",
"get nodeVersion() {\n return this._cliConfig.get('node-version', process.versions.node);\n }",
"getServerVersion() {\n if(!_.isUndefined(this.nodeInfo) && !_.isUndefined(this.nodeInfo.server)\n && !_.isUnde... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
convert from base64 in URL (safe, nor not) to bytes | function base64URLToBytes(base64URL) {
return atob(decodeURIComponent(base64URL)
.replace(/[_-]/g, c => toB64[c]));
} | [
"function hex2base64(s){ return Crypto.util.bytesToBase64(hex2bytes(s)) }",
"function base64(data) {\n\tif (typeof data === 'object') data = JSON.stringify(data);\n\treturn Buffer.from(data).toString('base64');\n}",
"toBase64() {\n return this._byteString.toBase64();\n }",
"base64() {\n\t\tif (typeof btoa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The auxiliary function for transform trip in table | function _trip_to_table(sindex, trip) {
var row = trip_to_row(sindex++, trip);
$("#paginated-table").children("tbody").append(row);
var text = get_trip_mtext (trip) || ""; // "Business"; // set default value
var imessage = $("#trip_" + (sindex - 1)).find("input.message");
$(imessage).val(text);
text = get_... | [
"function tripIdCollector() \n{\n let table = document.getElementById(\"scheduledDisplay\"); // Retrieving the trips table\n let rows = table.getElementsByTagName(\"tr\"); // Retrieving table rows\n for (let i = 0; i < rows.length; i++) // For the number of rows\n { \n let currentRow = table.rows... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
draw a cross in the point of a polygon | function drawCross(x, y, color){
ctx.strokeStyle = color;
ctx.beginPath();
ctx.moveTo(x,y+4);
ctx.lineTo(x,y-4);
ctx.closePath();
ctx.stroke();
ctx.beginPath();
ctx.moveTo(x-4,y);
ctx.lineTo(x+4,y);
ctx.closePath();
ctx.stroke();
ctx.fillStyle = "black";
ctx.strokeStyle = "black";
} | [
"function CrossHair(points)\n{\n //The vertices of the Cross Hair\n var L = 0.1;\n var vertices = [\n vec3( L, 10*L, 0),\n vec3( -L, 10*L, 0),\n vec3( -L, -10*L, 0),\n vec3( L, -10*L, 0),\n vec3( 10*L, L, 0),\n vec3( -10*L, L, 0),\n vec3( -10*L, -L, 0),\n vec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Active services before inactive, then sorted by time | sortedMergedServices(servicesFeed) {
return _.flatten([
_.sortBy(servicesFeed.active, 'date_started').reverse(),
_.sortBy(servicesFeed.discontinued, 'date_started').reverse()
]);
} | [
"function sortedServices(providers, services) {\n let sortedServiceRecords = [];\n for (let record of providers) {\n for (let item of record.services){\n if (item in services) {\n sortedServiceRecords.push (record);\n }\n }\n };\n return (sortedServiceRecords);\n}",
"sortTasks() {\n var ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
manage parameters slider & socket | function manageWebParameters(socket, num) {
var pName = 'param'+num;
switch (num) {
case 1 : paramValue = TEMP_FAN; break;
case 2 : paramValue = TEMP_ATTENUATION; break;
case 3 : paramValue = ATTENUATION_SCALE; break;
case 4 : paramValue = CHECK_PERIOD; break;
//case 5 : paramValue = TPS; break;... | [
"function send_to_ppnr_slider(p,s_value){\n var dict = {type : \"slider\", value : s_value};\n var json_message = JSON.stringify(dict);\n connection_ppnr = ppnr_dict[\"client_id\"][p];//123. Might be an error here\n connection_ppnr.send(json_message);\n}",
"function manageWebParametersSave(socket) {\n\tsocket... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes a list to store Sprites. | constructor()
{
// using arrays rather than sets, because draw order is important.
this.spriteList = [];
} | [
"function Sprite_Victory() {\n this.initialize.apply(this, arguments);\n}",
"function SLTReelSprite() {\n this.initialize.apply(this, arguments);\n}",
"function Images() {\n this.list = [];\n this.count = 0;\n this.inline = 0; //inline images\n this.background = 0; //elem... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to clear the openCards array. | function resetOpenCards(){
openCards = [];
} | [
"function resetCards() {\n openCards = [];\n}",
"function clearOpenCardList() {\n\topenCardList = [];\n}",
"function resetMatchedCards() {\n matchedCards = [];\n}",
"function clearCards() {\n for (let [id, card] of cards.entries()) {\n card.removeEvents(id)\n }\n $(\"#deck-display\").empty()\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates game objects states. | __update() {
this.__gameObjects.update();
this.getCurrentEvents().flush();
} | [
"updateRenderStates() {\r\n\r\n if (this.primitive[RENDERSTYLE_POINTS]) {\r\n this.prepareRenderState(RENDERSTYLE_POINTS);\r\n }\r\n\r\n if (this.primitive[RENDERSTYLE_WIREFRAME]) {\r\n this.prepareRenderState(RENDERSTYLE_WIREFRAME);\r\n }\r\n }",
"_update() {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
read the value of playerCount from the database | getCount(){
var playerCountRef = database.ref('playerCount');
playerCountRef.on("value", function (data) {
playerCount = data.val();
})
} | [
"updateCount(count){\r\n //playerCount refers to the database counts whereas count refers to make a change to the original playerCount\r\n database.ref(\"/\").update({playerCount:count});\r\n }",
"function updateNumberOfPlayers(){\n\n // this is the real number of players\n numberOfPlayers ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
waits for second player if second player enters game, successFunction is executed | function waitForPlayer(successFunction) {
firebaseGame.child('player').on('value', function(snapshot) {
var players = snapshot.val();
if(players && players['1'] && players['2']) {
firebaseGame.child('player').off('value');
successFunction();
}
});
} | [
"pass() {\n // in progress: getting the canPass functionality to work.\n // send info to server --> fact that player did not play cards\n //if (this.canPass) {\n //}\n //;else (document.getElementById(\"error_message_game\").innerHTML = \"you cannot pass on the first turn\");\n\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set or reset the timer interrupt. | setTimerInterrupt(state) {
if (state) {
this.irqLatch |= TIMER_IRQ_MASK;
}
else {
this.irqLatch &= ~TIMER_IRQ_MASK;
}
} | [
"startClock() {\r\n // Every millisecond, perform one cpu cycle\r\n this.clock = setInterval(() => this.tick(), 1); // 1 ms delay == 1 KHz clock == 0.000001 GHz\r\n\r\n // Fire interrupt timer at a cycle of once per second\r\n this.interrupt = setInterval(() => this.reg[IS] |= 1, 1000); // every second,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION IN CONVERTING WORDS TO NUMBER | function convertWordsToNum(words){
var value = { //values
"one": 1,
"two": 2,
"three": 3,
"four": 4,
"five": 5,
"six": 6,
"seven": 7,
"eight": 8,
"nine": 9,
"ten": 10,
"eleven": 11,
"twelve": 12,
"thirteen": 13,
"fourteen": 14,
"fifteen": 15,
"sixteen": 16,
"s... | [
"function parseConvertNumbersAndLetters(words, index) {\n var state = 0; //1=first number, 2=first word, 3=second number, 4=second word\n var i = index;\n var n1 = 0;\n var n2 = 0;\n var w1 = '';\n var w2 = '';\n while(i < words.length) {\n var word = words[i];\n for(var j = 0; j < word.length; j++) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets all the file names from the directory containing the results. | getBenchmarkResultsFileNames(resultsDir) {
try {
return filesystem.readdirSync(resultsDir);
} catch (err) {
console.error('Unable to open the given results directory.');
throw err;
}
} | [
"function getFileNames(dir) {\n // Create a list of all the filenames\n filesArr = fs.readdirSync(dir, (err, files) => {\n if (err) {\n throw err;\n }\n return files;\n })\n // Remove all files that aren't .csv files\n filesArr = filesArr.filter((file) => file.includes... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
it save and add step and save to saveCard | function savetosaveCard () {
step++
if (step < saveCard.length) {
saveCard.length = step;
console.log(`reset Savecard ${step} < ${saveCard.length}`)
}
saveCard.push(canvasReal.toDataURL());
console.log(`this saved to saveCard`);
} | [
"save() {\n saveScenario({\n scenarioData: this.state.scenarioData,\n colorData: this.state.colorData,\n pluginData: this.state.pluginData,\n });\n }",
"saveCard(obj, arr, types) {\n\n /* gather values from form */\n let statusValue = $('select.status-select').val();\n l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find utxo tx_hash for particular address Needed only for this example. In real life user will know his own UTXO | function utxoForAddress (address) {
try {
const inputs = combinedInputs.filter(function (account) {
if (account.address === address) return true
return false
})
// one UTXO payment
if (!inputs || inputs.length === 0) throw new Error('No User Inputs found.')
return inputs[0].utxo
} c... | [
"function inputForAddress (address, allInputs) {\n try {\n const addressUTXO = utxoForAddress(address)\n for (let i = 0; i < allInputs.length; i++) {\n const input = allInputs[i]\n const txId = Buffer.from(input.hash).reverse().toString('hex')\n if (txId === addressUTXO.tx_hash) return i\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to update the look of the enhancedURLBar | function updateLook() {
if (gURLBar.focused) {
reset(1);
return;
}
// compute the width of enhancedURLBar first
partsWidth = 0;
Array.forEach(enhancedURLBar.childNodes, function(child) partsWidth += child.boxObject.width);
if (partsWidth > getMaxWidth() || showingHidden)
enhan... | [
"function updateURL() {\n if (gURLBar.focused || editing || window.getComputedStyle(gURLBar).visibility == \"collapse\")\n return;\n // checking if the identity block is visible or not (firefox 12+)\n try {\n origIdentity.collapsed = false;\n } catch (ex) {}\n urlValue = decodeURI(getURI().... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gathers current filter form variables, manually creates key value pairs before adding distance and wage | function getFormData(){
var distance = $('#distance_slider').slider('getValue');
var wage = $('#wage_slider').slider('getValue');
var formArray = $('#filter_form').serializeArray();
var form = {};
$.each(formArray, function (i, input) {
form[input.name] = input.value;
});
form['distance'... | [
"function generate_filter_dict() {\n var fb = $('.applied_filter_block .inner_filter_block');\n var filter_dict = {};\n if( !fb.length) {\n return {}\n } \n fb.each(function() {\n filter_dict[$(this).data('name')] = $(this).data('value')\n }); \n return filter_dict;\n}",
"function saveFilterOptions(f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
if not exist, make array for the x position in this.grid, then at that x pos make another grid array at y pos and set it to value | set(x, y, value) {
if(!this.grid[x]) {
this.grid[x] = []
}
this.grid[x][y] = value
} | [
"function setValueGrid(startRow, startCol, w, h, val) {\n for (var i = startRow; i < startRow + h; i++) {\n for (var j = startCol; j < startCol + w; j++) {\n grid[i][j] = val;\n }\n }\n}",
"function updateGameGrid(x, y, p){\n var t = pixToGrid(x, y);\n gameGrid[t.row][t.col] = p;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to show the layout element dialog | function showLayoutDialog(type) {
resetLayoutDialog();
if (document.getElementById('editID').value != '-1') {
$('#rfelement' + document.getElementById('editID').value).show();
document.getElementById('editID').value = '-1';
}
changeLayoutDialog(type.toString(), false);
$('#newquestio... | [
"function hideLayoutDialog() {\n if (document.getElementById('editID').value != '-1') {\n $('#rfelement' + document.getElementById('editID').value).show();\n document.getElementById('editID').value = '-1';\n }\n $('#newlayout').hide();\n //$('#newquestion_button').show();\n}",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Insertion Sort for Integer | insertionSortInt(arr) {
for (var i = 1; i < arr.length; i++) {
var key = parseInt(arr[i]);
var j = i - 1;
while (j >= 0 && parseInt(arr[j]) > key) {
arr[j + 1] = parseInt(arr[j]);
j = j - 1;
}
arr[j + 1] = key;
}... | [
"function insertSort(arr) {\n var len = arr.length\n\n for(let i = 1; i < len; i++) {\n let j = i, temp = arr[i]\n while(j > 0 && arr[j - 1] > temp) {\n arr[j] = arr[j - 1]\n j--\n }\n arr[j] = temp\n }\n}",
"function insertionSort(arr, arr_size) {\n // There should be atleast 1 eleme... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
COLUMN return the column number that corresponds to the reference. | function COLUMN(value) {
// Return `#VALUE!` when the value is not a reference.
if (!ISREF(value)) {
return error$2.value;
}
// Run the COLUMNNUMBER and convert to base 1.
return COLUMNNUMBER(value.column) + 1;
} | [
"function col(numCol) {\n return numCol * COL + COL_OFFSET;\n}",
"get referencedColumn() {\n if (this.isOwning) {\n if (this.joinTable) {\n return this.joinTable.referencedColumn;\n }\n else if (this.joinColumn) {\n return this.joinColumn.re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create keybinding is pressed. Show notebook/tag form depending on what region is active at the moment. | onCreateKeybinding() {
this.navigateForm({url: `/${this.view.activeRegion}/add`});
} | [
"keyPress(e) {\n // If enter or tab key pressed on new notebook input\n if (e.keyCode === 13 || e.keyCode === 9) {\n this.addNotebook(e);\n }\n }",
"function addOnKeyPressedListener(interpreter) {\n $(document).keypress(function(event){\n if (interpreter.keyPressedList... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the first exterior hit or closest point between the unit sphere and the ray starting at p and going in the r direction. | function rayVsUnitSphereClosestPoint(p, r)
{
var p_len2 = jsgl.dotProduct(p, p);
if (p_len2 < 1)
{
// Ray is inside sphere, no exterior hit.
return null;
}
var along_ray = -jsgl.dotProduct(p, r);
if (along_ray < 0)
{
// Beh... | [
"raycastRoot(minx: number, miny: number, maxx: number, maxy: number, p: vec3Like, d: vec3Like, exaggeration: number = 1): ?number {\n const min = [minx, miny, -aabbSkirtPadding];\n const max = [maxx, maxy, this.maximums[0] * exaggeration];\n return aabbRayIntersect(min, max, p, d);\n }",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
areTheyLogged Basically just calls the validatelogin function and sees if it is true or not. This function is essential because if the user is not logged in, we do not want to allow them to go straight to the game page. We must make them login in first. | function areTheyLogged(form)
{
if(!validatelogin(form)) return false;
return true;
} | [
"function loggedInCheck() {\n // ajax call to check that user has a valid, i.e. non-expired, login cookie\n // if cookie is valid, show logged in user controls\n var loggedIn = true;\n if ( loggedIn ) {\n showUserControls();\n }\n else {\n hideUserControls();\n }\n}",
"function check () {\n\t\tconst ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Copyright (c) 20112012 Turbulenz Limited /global TurbulenzEngine /global Uint8Array /global Uint16Array /global window DDSLoader | function DDSLoader() {} | [
"function WebGLNetworkDevice() {}",
"function loadCmdsTypedArray(arr) {\n var len = 0;\n for (var r = 0; r < arr.length; r++) {\n len += arr[r].length;\n }\n\n var ta;\n if (Float32ArrayCache[len]) {\n ta = Float32ArrayCache[len];\n } else {\n ta = new Float32Array(len);\n Float32ArrayCache[len]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getTypeArity returns the number of generic type parameters the given symbol has. If the symbol is not a type the result is null. | getTypeArity(staticSymbol) {
// If the file is a factory/ngsummary file, don't resolve the symbol as doing so would
// cause the metadata for an factory/ngsummary file to be loaded which doesn't exist.
// All references to generated classes must include the correct arity whenever
// gene... | [
"function getMinTypeArgumentCount( typeParameters )\n{\n let minTypeArgumentCount = 0;\n if ( typeParameters )\n {\n for ( let i = 0; i < typeParameters.length; i++ )\n {\n if ( !hasTypeParameterDefault( typeParameters[ i ] ) )\n {\n minTypeArgumentCount =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check for Approved Change Approval Request | function getApprovedChangeRequest(employeeId, changeType) {
log.debug('employeeId', employeeId);
log.debug('changeType', changeType);
// Look for Approved and
var mySearch = search.create({
type: 'customrecord_... | [
"toggleApproval(currency, current_approval) {\n let new_approval = !current_approval\n if(new_approval) {\n this.approveCurrency(currency)\n } else {\n this.unapproveCurrency(currency)\n }\n }",
"@action\n statusChangeAction(field, value) {\n if (value == 'approved') {\n this.editE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called by InputAdapter when zoom changes. Returns true if event is consumed (zoom will not be applied) | onZoomChange(pointer, zoomValue, prevValue)
{
return false;
} | [
"function onZoom()\r\n{\r\n\tevaluateLayerVisibility();\r\n\t$(\"#zoomlevel\").val(Math.floor(map.getView().getZoom()));\r\n}",
"function checkReturnFromZoom(){\n\t\t\n\t\tif(g_temp.objImage == undefined || g_temp.objImage.length == 0)\n\t\t\treturn(true);\n\t\t\n\t\tvar objSize = g_functions.getElementSize(g_tem... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |