query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
build the request and response actions based on the sources | function intent( sources ){
// get the values from the input fields and set the object to return
function getLoginInputValues(){
return {
username: document.querySelector('.user-input').value,
password: document.querySelector('.user-password').value
}
}
// login cl... | [
"function intent( sources ) {\n // construct the event for the click \n const click$ = sources.DOM\n .select('.btn-get-quote').events('click')\n .map(ev => ( sources.Auth.API.requestRandom ) );\n\n const clickProtected$ = sources.DOM\n .select('.btn-get-quote-protected').events('click')\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set input value to a given | setInputValue(value) {
this._input.value = value;
} | [
"function setValue(input, num){\n input.value = num;\n}",
"function updateInputValue(input, value) {\n input.val(value);\n input.change();\n }",
"setValue(value) {\n this.value = value;\n }",
"function setInputvalue(selector, value) {\n var element = document.querySelector(selec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get tax or tip row. | getTaxRow(displayName) {
let rowEls = [
<RowHeader useMobileUI={this.props.useMobileUI}>
<span className='leftPad'>{`${displayName}:`}</span>
<Swappable className='rightPad' >
<PriceInput
priceObj={this.state.tax}
onChangeCB={this.callbacks.taxUpdater}
... | [
"function getTaxLineItem() {\n return _.find(this.items, function (item) { return item.lineItemTypeField.alias === 'Tax'; });\n }",
"public getRow() : JQuery {\n let row : JQuery = $('<tr></tr>');\n let cell : JQuery;\n\n cell = $('<td></td>') .append(this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adding new message to chat window | function addNewMessage(data){
$chat.append(createMessage(data));
$chat.scrollTop($chat[0].scrollHeight);
} | [
"function appendChat(msg){\n\tvar chatmsgSpan = document.createElement(\"SPAN\");\n\tchatmsgSpan.innerHTML = \"<b>Server: </b>\" + msg.toString() + \"<br/>\";\n\tchatWindow.appendChild(chatmsgSpan);\n\tchatmsgSpan.focus();\n}",
"function newMessage() {\n\tlet chatinfo = `{\n\t\t\"name\": \"`+ profileName.innerHTM... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
const Convert = require("./file"); const dataZ = Convert.toDataZ(json); These functions will throw an error if the JSON doesn't match the expected interface, even if the JSON is valid. Converts JSON strings to/from your types and asserts the results of JSON.parse at runtime | function toDataZ(json) {
return cast(JSON.parse(json), r("DataZ"));
} | [
"verifyJSON (data) {\n try {\n return JSON.parse(data)\n } catch (e) {\n throw { code: -32700, message: 'Parse error: ' + e.message }\n }\n }",
"function JSONtoDatatype(json){\n // Clean up the JSON for better comparisons\n delete json.formattedValue;\n // Ignore/fix patte... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make sure the time difference is not negative, completely filled out and they haven't entered invalid characters into the time fields Shows a warning icon for that row if there is a problem | function checkTimeDifference(startHour, startMin, endHour, endMin, rowNum)
{
var timeDifference = calculateTimeDifference(startHour.val(), startMin.val(), endHour.val(), endMin.val());
// If the timeDifference isn't a number or negative then show the warning icon
if ((isNaN(timeDifference)) || (timeDifference <= 0... | [
"function timeValidator(){\n\tif(time_input.value!=\"\"){\n\t\ttime_input.style.border=\"1px solid #d1d5da\"\n\t\ttime_error.innerHtml=\"\"\n\t\ttime_error.style.visibility=\"hidden\";\n\t\t\n\t\treturn true;\n\t}\n}",
"function validateTime() {\n\tvar timeField = document.getElementById(\"time-input\");\n\tvar i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ecma International makes this code available under the terms and conditions set forth on (the "Use Terms"). Any redistribution of this code must retain the above copyright and this notice and otherwise comply with the Use Terms. / info: > create sets the [[Prototype]] of the created object to first parameter. This can ... | function testcase() {
function base() {}
var b = new base();
var prop = new Object();
var d = Object.create(b);
if (typeof d === 'object') {
return true;
}
} | [
"function testcase() {\n\n var proto = {};\n Object.defineProperty(proto, \"prop\", {\n get: function () {\n return {};\n },\n enumerable: true\n });\n\n var ConstructFun = function () { };\n ConstructFun.prototype = proto;\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: take codeMirrorBox parameter and board param | function compile() {
var board = BOARD
var programText = CODE_MIRROR_BOX.getValue()
var program = compilePuzzleCode(programText, board)
addLineComments(CODE_MIRROR_BOX, program.lineComments)
if (program.constraintViolation) {
$("#constraintBoxDiv").addClass("glow-focus")
} else {
$("#constraintBox... | [
"displayBoard() {\n for (var i = 0; i < 8; i++) {\n for (var j = 0; j < 8; j++) {\n strokeWeight(2.5);\n if (j % 2 === 0 && i % 2 == 0) fill(255);\n else if (j % 2 === 1 && i % 2 == 1) fill(255);\n else fill(35);\n\n rect(\n SQUARE_SIZE + i * SQUARE_SIZE,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates row items for `root` and all children, recursively. | function createEntryRowForRoot(root, level = 0, parentPath = '') {
const path = parentPath + '/' + root.name;
let currentRootIncludesThisRow = true;
if (window.location.hash) {
const rootPath = decodeURIComponent(window.location.hash.substring(1));
currentRootIncludesThisRow = path.indexOf(r... | [
"function createChildNodes(state, result)\n\t{\n\t\tfor (let i=0; i<result.children.length; i++)\n\t\t{\n\t\t\tlet child = result.children[i];\n\t\t\tlet child_id = result.ids[i];\n\t\t\tlet substate = createInternalTree.call(this, child, child_id);\n\t\t\tstate.children.push(substate);\n\t\t\tif (state.value === n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resizes and styles dummy nodes | function resizeDummyNodes(){
clusterBBox = d3.select('.interactive_diagram.' + view).select('.cluster').node().getBBox()
d3.select('.interactive_diagram.' + view)
.selectAll('.node')
.each(function(){
id = d3.select(this).attr('id')
// Define colors for styling t... | [
"function setInitialNodeSettings() {\n for (let i = 0; i < nodeArray.length; i++) {\n let node = nodeArray[i];\n node['width'] = defines.getConstant('nodeWidth');\n\n let innerMargin = defines.getConstant('innerMargin') * 3;\n let textHeight = util.getTextHeight(no... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function updateCategoryProductCounts(categoryId, numOfProducts) this function updates the product counts for a category | function updateCategoryProductCounts(categoryId, numOfProducts)
{
var categoryElements = document.getElementsByName(categoryId);
for (var i=0; i<categoryElements.length; i++)
{
categoryElements[i].lastChild.innerHTML=" ("+numOfProducts+")";
}
} | [
"function updateproductcount(id,newproductcount){\n db.updateProductQuantity(newproductcount,id);\n}",
"function update_num_product() {\n\t\tvar num_product = 0;\n\n\t\t$(\".cart-row-product\").each(function(){\n\t\t\t$(this).find(\"tr\").each(function(){\n\t\t\t\tnum_product +=1;\n\t\t\t});\n\t\t});\n\t\t$(\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Class NumfieldCtl Manages a number field. Principally, this is managing focus state. | function NumfieldCtl(editedEl, parentEl) {
if (!(this instanceof NumfieldCtl)) {
return new NumfieldCtl(editedEl);
}
$(editedEl).css({
'-webkit-user-select': 'none',
'-moz-user-select': 'none',
'-ie-user-select': 'none',
'user-select':... | [
"function VNumTextBox(columnName, isMandatory, isReadOnly, isUpdateable, displayLength, fieldLength, title) {\n\n var displayType = VIS.DisplayType.Integer;\n var length = fieldLength;\n //Init Control\n var $ctrl = $('<input>', { type: 'text', name: columnName, maxlength: length, 'data-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
MODIFIED To replace launch task button with view task button after FTFL Arguments: 1) ID of Reference Field. 2) ID of span containing Launch Button. 3) ID of span containing View Button. 4) ID of View Button. Sample Call: SP_SwapButtonAfterLaunch("txtCAPAReference","LaunchIR","ViewIR","mastercontrol.links.view.Issue Re... | function SP_SwapButtonAfterLaunch()
{
if(arguments.length == 4)
{
var oRefField = document.getElementById(arguments[0]);
var spanLaunch = document.getElementById(arguments[1]);
var spanView = document.getElementById(arguments[2]);
var btnView = document.getElementById(arguments[3]);
if(SP_Trim(oRefField.val... | [
"function modifyLaunchButtonTextField() {\n var popup_launch_type = $(element).find('input[name=popup_launch_type]:checked').val();\n if (popup_launch_type === 'manual') {\n $(element).find('#launch_button .label').text('Launch Button Text');\n $(element).find('#launch_button .setting-help').text('D... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears the historical signals table | function clearTable(){
$('#historicalTable').find('td').remove();
$('#historicalTable').css('visibility', 'hidden');
} | [
"function clearHistory() {\n\thistory = [];\n\n\t// LOOP THROUGH THE CHILD NODES OF THE TABLE AND DELETE \n\t// TRs !THE FIRST\n}",
"async deleteOldSignals() {\n // delete the previous signals\n while (this.signalLog && this.signalLog.length) {\n const signal = this.signalLog.pop().signal;\n logge... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to join all provided AlarmRules with OR operator. | static anyOf(...operands) {
try {
jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudwatch_IAlarmRule(operands);
}
catch (error) {
if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
Error.captureStackTrace(error, this.anyOf);
... | [
"function doOr() {\n doDoubleOp(\"OR\");\n}",
"static allOf(...operands) {\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudwatch_IAlarmRule(operands);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bugzilla: 1654165 Polarion: assignee: nansari startsin: 5.10 casecomponent: Services initialEstimate: 1/6h testSteps: 1. Create Bundle, containing 2 service items, each of which will provision a single VM 2. Navigate to order page of service 3. Order the Service bundle. expectedResults: 1. 2. View the Service. Both VMs... | function test_service_bundle_vms() {} | [
"function test_service_chargeback_multiple_vms() {}",
"function test_notification_banner_vm_provisioning_notification_and_service_request_should_be_in_syn() {}",
"function test_verify_smart_mgmt_orchest_template() {}",
"function test_candu_graphs_vm_compare_host_vsphere65() {}",
"function test_provision_req... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove folder from menu by ID | removeFolderFromMenu(folderId) {
let foldersMenu = document.querySelector('[name="js-folders-menu"]');
if (!foldersMenu) {
return false;
}
let folderItem = foldersMenu.querySelector('[data-folder-id="' + folderId + '"]');
if (folderItem) {
folderItem.remove();
}
} | [
"removeMenu(id) {\n check(id, String);\n delete Context.menus[id];\n }",
"removeDishFromMenu(id) {\n //TODO Lab 1\n }",
"removeDishFromMenu (id) {\n for (var j = 0; j < this.menu.length; j++){\n let menuObject = this.menu[j];\n if (parseInt(id, 10) === parseInt(menuObject[\"id\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function for generate confirmation number | function confirmation(){
var chars ="0123456789ABCDEFGHIJklmNopQRstUvxyZMnOPK"
var string_length=7;
var randomstring='';
for (var i=0; i<string_length;i++){
var rnum= Math.floor(Math.random()* chars.length);
randomstring += chars.substring(rnum,rnum+1);
}
document.confirmpage.confirmnv.value=randomstring;
do... | [
"function generateConfirmationNumber() {\r\n var max = 1000000000;\r\n return Math.floor(Math.random() * Math.floor(max));\r\n}",
"function generateNumCommande() {\n var random = Math.floor(100000000 + Math.random() * 900000000);\n num_commande = 'NH'+random\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Toggle the collapsed state of the document map in the clientside viewer | function toggleDocMap() {
var viewer = $find(viewerID);
// Check the isLoading client-side property before accessing the documentMapCollapsed property.
// Otherwise an exception will be thrown.
if (!viewer.get_isLoading()) {
viewer.set_documentMapCollapsed(!viewer.get_documentMapCollapsed());
... | [
"function toggleScrollMap() {\n scrollMap.canvas.style.setProperty('display', this.checked ? 'block' : 'none');\n}",
"toggle() {\n this.collapsed = !this.collapsed;\n }",
"toggleCollapse() {\n this.setCollapsed(!this.collapsed);\n }",
"function toggleMap() {\n $map.toggleClass('js-show');\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
custom_interaction.js (c) Copyright 2018, Brian Mottershead. All rights reserved. Sets up a customInteraction (CI). If a setupInteraction function is registered for the CI identifier or type (in that order), call it. Note that a CI doesn't necessarily have to be initialized through this mechanism. It might not require ... | function setupCustomInteraction(htmlInteraction) {
let identifier = htmlInteraction.getAttribute(ID);
let type = htmlInteraction.getAttribute("type");
let ci = QTI.CUSTOM_INTERACTIONS[identifier]
|| QTI.CUSTOM_INTERACTIONS[type];
if (ci && typeof ci.setupInteraction==="function") {
let qtiInteraction ... | [
"handleInteraction() {\r\n \r\n }",
"interact() {\n if (this.template.onInteract && this.isInteractable()) {\n this.template.onInteract();\n if (this.interactionSound) {\n audioSystem.playSound(this.interactionSound);\n }\n } else {\n co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lets sort the books in the shelves alphabetically for ease of finding books! | function sortBooksAlphabeticallyByTitle(books) {
return books.sort(sortBy("title"))
} | [
"function sortBooks() {\n let preSortedLibrary = myLibrary.slice();\n myLibrary.sort(function (a, b) {\n let aName = a.title.replace(/^The |^A |^An /i, \"\");\n let bName = b.title.replace(/^The |^A |^An /i, \"\");\n return aName.localeCompare(bName);\n });\n\n let arrayChanged = preSortedLibrary.find(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to find entries for current day | static todaysEntry() {
const todayEntries = DummyDataHelpers.findCurrentDayEntry(dummyEntries);
if (!todayEntries) {
return this.notFound('No entry found for today');
}
return this.success('Todays entry fetched successfully', todayEntries);
} | [
"getTodayEntries(): Array<Entry>{\n let todayEntries = this._entries.filter(entry => entry.date == this.date);\n return todayEntries.filter(entry => entry.fullDate > this._date);\n }",
"function getEntriesForDay(date) {\n const day = date.getDate()\n\tconst month = date.getMonth()\n\tconst year = date.g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Block user with AJAX | async function blockUser(user_id) {
let div_user = event.target;
const button_text = div_user.innerText;
div_user.innerText = "Blocking....";
let connection = await fetch(`/users/block/${user_id}`, {
method: "POST",
});
let response = await connection.text();
if (!connection.ok) {
alert(response);... | [
"function blockUser(bool) {\n xhr = new XMLHttpRequest();\n var url = document.querySelector('#url').value;\n if (bool == true)\n url += '/block';\n else\n url += '/unblock';\n xhr.open(\"POST\", url, true);\n xhr.setRequestHeader(\"Content-type\", \"a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Launches a sexual activity (A) for character (C) | function ActivityRun(C, A) {
// If the player does the activity on herself or an NPC, we calculate the result right away
if ((C.ArousalSettings.Active == "Hybrid") || (C.ArousalSettings.Active == "Automatic"))
if ((C.ID == 0) || (C.AccountName.substring(0, 4) == "NPC_") || (C.AccountName.substring(0, 4) == "NPC-")... | [
"function ActivityEffect(S, C, A) {\n\n\t// Calculates the next progress factor\n\tvar Factor = (PreferenceGetActivityFactor(C, A.Name, (C.ID == 0)) * 5) - 10; // Check how much the character likes the activity, from -10 to +10\n\tFactor = Factor + (PreferenceGetZoneFactor(C, C.FocusGroup.Name) * 5) - 10; // The zo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to remove a given route from favourites in local storage | function removeFromRouteFavourites(item) {
let favourites = JSON.parse(localStorage.getItem('route-favourites') || '[]');
let counter = 0;
let index = 0;
favourites.forEach((i) => {
if (i.id === item.id) {
index = counter;
}
counter++;
})
if (index < favourites.length) ... | [
"function removeFavorite(itemURL){\n if(favorites[itemURL]) {\n delete favorites[itemURL];\n localStorage.setItem('nasaFavorites', JSON.stringify(favorites));\n updateDOM('favorites');\n }\n}",
"removeFavorite(itemUrl) {\n if (favorites[itemUrl]) {\n delete f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Since this should really be rendered as a table, need to calculate the max width for each _column_ on the panel's header and apply that as a min width for the other panels. | _calcColumnWidths() {
if (!this._container) {
return;
}
const columnWidths = Array.prototype.slice.call(this._container.querySelectorAll('.md-panel-header'))
.reduce((maxes, row) => {
const columns = row.querySelectorAll('.md-panel-column');
for (let i = 0; i < columns.length; i... | [
"function setHeaderMinWidth() {\n $(\".dataTables_wrapper\").each(function() {\n var wrapperWidth = $(this).width();\n var tableWidth = $(this).find(\"table.dataTable\").outerWidth();\n if (tableWidth > wrapperWidth) {\n $(this).css(\"min-width\", tableWidth+\"px\");\n }\n });\n}",
"UpdateRowWi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if a given line might be a DOSstyle listing. Example: `120596 05:03PM myDir` | function testLine(line) {
return /^\d{2}/.test(line) && RE_LINE.test(line);
} | [
"function isFormattedLine(line) {\n\tif(renderStringLength(line) < line.length) {\n\t\treturn true;\t//\tANSI or Pipe Codes\n\t}\n\n\tif(line.match(/[\\t\\x00-\\x1f\\x80-\\xff]/)) {\t//\teslint-disable-line no-control-regex\n\t\treturn true;\n\t}\n\n\tif(_.trimEnd(line).match(/[ ]{3,}/)) {\n\t\treturn true;\n\t}\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function for updating user account investment balance by recalculating share share price duplicate function from sampledata.js | function userAcctBalance(acct){
for (let i = 0; i < acct.length; i++) {
acct[i].balance = +(acct[i].price * acct[i].share).toFixed(2);
}
} | [
"function updatePayBalance(newBalance){\n payBalance = newBalance\n}",
"function updateCustomerSecurityBalance(ss, data, customerRow, sharesQuantity, securityColNum, tradeID, customerID, operation, asset, ssBalancesHistory,totalRowsBalancesHistory) {\n Logger.log(\"UPDATING MB\")\n var offsetRow = 1\n var o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Answer Date.now(), but also start a timer that will reject the test if the specified collector[key] has not been set before the timer goes off. | function startSubtest(milliseconds, collector, key, reject, getChannel) {
setTimeout(_ => {
if (collector[key] === undefined) {
const channel = (getChannel && getChannel()) || {};
const failReason = collector.failReason || FAIL_VALUE;
var label = collector.failReason || "... | [
"function checkAndGenerateTimer(dispatch, getState) {\r\n let currentState = getState();\r\n\r\n // if timer is expired af\r\n if (moment().format('X') > currentState.popups.nextPopupTime) {\r\n generateTimer(false)(dispatch, getState);\r\n }\r\n}",
"timer(key, cb, timing) {\n // always clea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find conerts for "artistName" PARAMS: artistName = a name of artist or band maxEvents = the maximum number of events to list | findConcert(artistName, maxEvents = this.maxEvents) {
let query = "https://rest.bandsintown.com/artists/"
+ artistName + "/events?" + this.key;
console.log(`\n=======\nFinding concerts for "${artistName}"`);
this.request(query, (error, response, body) => {
if (error) {
consol... | [
"getTracksMatchingArtist(artistName) {\n const artist= this.getArtistByName(artistName);\n return artist.getTracks();\n }",
"function findByArtist(artistName, array = collection) {\n let results = [];\n // instead of looping through collection as the instructions request I will loop through an input array ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reset old column sorting attributes | _resetOldSorting() {
const rowChildren = this.shadowRoot.querySelectorAll('.th[sorted]');
rowChildren.forEach((el) => el.removeAttribute('sorted'));
} | [
"resetSorting() {\n this.sortBy = undefined;\n this.sortDir = 0;\n }",
"setSortOrders () {\n // Reset sortKey\n this.sortKey = []\n\n let sortOrders = {}\n\n this.columns.forEach(function (column) {\n sortOrders[column.name] = \"\"\n })\n\n this.sortOrders = s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a GraphDefinitionLinkTargetCompartment resource | static get __resourceType() {
return 'GraphDefinitionLinkTargetCompartment';
} | [
"static get __resourceType() {\n\t\treturn 'GraphDefinitionLinkTarget';\n\t}",
"attachRelationshipAsTarget (template, alias, sourceAlias) {\n\t\ttemplate = JSON.parse(JSON.stringify(template));\n\t\ttemplate.target = this.name;\n\t\tif (alias)\n\t\t\ttemplate.targetAs = alias;\n\t\tif (sourceAlias)\n\t\t\ttemplat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return users registered in one single event | function getEventUsers(req, res) {
let eventName = req.query.eventName;
let eventCategory = req.query.eventCategory;
if(eventName === undefined || eventCategory === undefined) {
return res.status(400).json({
success: false,
message: `Usage: eventName=name&eventCategory=category`
})
}
db.child(events ... | [
"static getMembersFromEvents(events) {\n return MatrixRoom.getUniqueEvents(events.filter((event)=>_events.isCreateEvent(event) || _events.isJoinEvent(event)\n )).map((event)=>event.sender\n ).filter((member, index, array)=>array.indexOf(member) === index\n );\n }",
"static getUserEv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Define function that will update the info on screen based on the current schedule | function updateInfo() {
now = new Date();
currentHour = now.getHours();
currentMinute = now.getMinutes();
currentMinute = (currentHour * 60) + currentMinute;
for (var i = 0; i < currentSchedule.length; i++) {
//If the current time is beyond the end of the current schedule, and less then the end of the nex... | [
"function updateSchedule() {\n // clear all textblocks\n $(\"textarea\").empty();\n // check the time and formatting]\n styleSchedule(startHr, endHr);\n // insert the text items\n // i is the id of the textarea associated\n // with each hour on the schedule\n for (i = startHr; i <= endHr; i++) {\n indx =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When the user clicks on the button, open the modal for updating a promotion set correct id and percent to promotion | function openModal(data) {
//change beginning and end inputs to date objects
// Split timestamp into [ Y, M, D, h, m, s ]
var d = data[0]['date_debut'].split(/[- :]/);
var f = data[0]['date_fin'].split(/[- :]/);
// Apply each element to the Date function
var debut = new Date(Date.UTC(d[0], d[1]-1, d[2], d[3], d... | [
"function openModal(promoId) {\n modal.style.display = \"block\";\n\t$('#promoName').val(promoId).change();\n\t\n\t//change percentage of selected element\n\tvar e = document.getElementById('promoName');\n\tvar promo = e.children[e.selectedIndex];\n\tvar percent = promo.getAttribute(\"data-percent\");\n\tdocumen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that check if date from log is between start/end date passed by user | function dateBetween(start,end,data){
let s=start.replace(":"," ");
let e=end.replace(":"," ");
let d=data.day+"/"+data.month+"/"+data.year+" "+data.hour+":"+data.minutes+":"+data.seconds;
s=Date.parse(s);
e=Date.parse(e);
d=Date.parse(d);
return( (s<=d) && (d<=e));
} | [
"isBetween(date, start, end) {\n return this.compareDates(date, start) > 0 && this.compareDates(date, end) < 0;\n }",
"isBetween(date, start, end) {\n return this.compareDates(date, start) > 0 && this.compareDates(date, end) < 0;\n }",
"function dateIsBetween(date, start, end) {\n return (start... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calcula e retorna quem ganhou. 0 Empate 1 jogador 2 Computador | function calcularEscolha(jogador, computador) {
if (jogador == 1 && computador == 1) {
return 0;
}
else if (jogador == 1 && computador == 2) {
return 2;
}
else if (jogador == 1 && computador == 3) {
return 1;
}
else if (jogador == 2 && computador == 1) {
ret... | [
"function calcularEscolha(jogador, computador){\n//pedra\nif(jogador==1 && computador==1){ return 0; }\nelse if (jogador==1 && computador==2) { return 2; }\nelse if (jogador==1 && computador==3) { return 1; }\n//papel\nelse if (jogador==2 && computador==1) { return 1; }\nelse if (jogador==2 && computador==2) { retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Themespecific scroll actions ============================================== | function sunnyjar_theme_scroll_actions() {
"use strict";
// Put here your theme-specific code with scroll actions
// It will be called when page is scrolled (before core actions)
} | [
"function yogastudio_theme_scroll_actions() {\n\t\"use strict\";\n\t// Put here your theme-specific code with scroll actions\n\t// It will be called when page is scrolled (before core actions)\n}",
"function dentario_theme_scroll_actions() {\n\t\"use strict\";\n\t// Put here your theme-specific code with scroll a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get top accessed files | async getTopAccessedFiles(ts, te) {
let token = localStorage.getItem("interset_token");
axios.defaults.headers.common['Authorization'] = token;
// console.log(ts);
let url = `${API_URL}/api/search/0/files/topAccessed?sort=maximum&markup=false&tz=UTC%2B8&count=10&keepAlive=300000`
if((ts!==0) && (te!... | [
"function file_cache_list() {\n\t\tconsole.log(Object.keys(wkof.file_cache.dir).sort().join('\\n'));\n\t}",
"function getFilesLastAccess(files) {\n _.each(files, function(file) {\n if (file.lastAccess&&file.lastAccess.length>0) {\n var accessIndex = _.findIndex(file.lastAccess, fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `StreamingDistributionConfigProperty` | function CfnStreamingDistribution_StreamingDistributionConfigPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('aliases', cdk.listValidator(cdk.validateString))(prop... | [
"function CfnStreamingDistributionPropsValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n errors.collect(cdk.propertyValidator('streamingDistributionConfig', cdk.requiredValidator)(properties.streamingD... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
refresh_color_display() Updates the display of the current color. | function refresh_color_display() {
var hex = current_color.to_hex();
$('#current-color #color-identifiers').text(hex);
$('#current-color #color-background').css('background-color', hex);
$('#current-color #color-text').css('color', hex);
} | [
"async updateDisplay() {\n await this.Config.display.updateDisplay();\n }",
"function refreshDisplay(){\n env.disp.render() ;\n}",
"function displayRefresh() {\r\n g.clear(true);\r\n drawBackground();\r\n drawHands();\r\n Bangle.drawWidgets();\r\n\r\n let Pause = 1000 - (Date.now() % 1000);\r\n Tim... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
saves the run times of the current run | function saveLastRun(mLastRun) {
localStorage.setItem(sLastKey, JSON.stringify(mLastRun));
} | [
"save() {\n saveJSON(this.statistics_, \"simulator_\" + Date.now() + \".json\");\n }",
"function recordTime() {\n ENV.CLEANED = new Date();\n ENV.TIMESUSED = 0;\n write(ENV);\n alertDisplay(`Submitted`,`Cleaning recorded`);\n const lastCleaned = formatTime(1);\n const lastUsed = formatTime(1... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The idea is to minimize the amout of work done to figure out whether the resource is 3rdparty to the document. | is3rdPartyToDoc() {
let docDomain = this.getDocDomain();
if ( docDomain === '' ) { docDomain = this.docHostname; }
if ( this.domain !== undefined && this.domain !== '' ) {
return this.domain !== docDomain;
}
const hostname = this.getHostname();
if ( hostname.e... | [
"function isLinkedResource_Impl(obj) {\n return obj.$terms !== undefined && obj.$terms instanceof LinkedResourceTerms;\n}",
"static isResource(_object) {\n return (Reflect.has(_object, \"idResource\"));\n }",
"function hasResourceLink(req) {\n\t\tvar link = req.get('Link');\n\t\t// look for... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
given a column and a sudoku, returns true if it's a legal column | function isCorrectCol(col,sudoku) {
var rightSequence = new Array(1,2,3,4,5,6,7,8,9);
var colTemp= new Array();
for (var i=0; i<=8; i++) {
colTemp[i] = sudoku[col+i*9];
}
colTemp.sort();
return colTemp.join() == rightSequence.join();
} | [
"function isPossibleCol(number,col,sudoku) {\n for (var i=0; i<=8; i++) {\n if (sudoku[col+9*i] == number) {\n return false;\n }\n }\n return true;\n}",
"function isPossibleCol(number,col,sudoku) {\n\tfor (var i=0; i<=8; i++) {\n\t\tif (sudoku[col+9*i] == number) {\n\t\t\treturn false;\n\t\t}\n\t}\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Firefox 3.x has an issue where the body element won't get proper focus if you click out side it's rectangle. | function focusBody() {
// Fix for a focus bug in FF 3.x where the body element
// wouldn't get proper focus if the user clicked on the HTML element
if (!window.Range.prototype.getClientRects) { // Detect getClientRects got introduced in FF 4
editor.on('mousedown', function(e) {
if (!isDefaultPrevented... | [
"function focusBody(){// Fix for a focus bug in FF 3.x where the body element\n\t// wouldn't get proper focus if the user clicked on the HTML element\n\tif(!window.Range.prototype.getClientRects){// Detect getClientRects got introduced in FF 4\n\teditor.on('mousedown',function(e){if(!isDefaultPrevented(e)&&e.target... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pushes an element to the start of the array, if found. | function pushToStart(arr, value) {
var index = arr.indexOf(value);
if (index > -1) {
arr.splice(index, 1);
arr.unshift(value);
}
} | [
"function pushToStart(arr, value) {\n var index = arr.indexOf(value);\n if (index > -1) {\n arr.splice(index, 1);\n arr.unshift(value);\n }\n}",
"function pushToStart(arr, value) {\n const index = arr.indexOf(value);\n if (index > -1) {\n arr.splice(index, 1);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is used to set values of all registers. | setRegisters(gprs) {
var regCnt = GPR_NAMES.length;
for (var i = 0; i < regCnt; i++) {
this.setRegister(i, gprs[GPR_NAMES[i]]);
}
} | [
"update() {\n for (var reg of this.registers) {\n reg.update();\n }\n }",
"function seti(a, b, c, registers) {\n registers[c] = a;\n return registers;\n}",
"function setValues() {\n\t\t\tprintValue(d, values[0]);\n\t\t\tprintValue(h, values[1]);\n\t\t\tprintValue(m, values[2]);\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render a span for each pup | function renderPupSpan(pup){
// Create a span element
let dogSpan = document.createElement("span")
// Fill in that span with the pups name
dogSpan.innerText = pup.name
//Grab the dog-bar using a DOM method
//append the span to the dogbar
document.getElementById("dog-bar").appendChild(dogSpan... | [
"function renderPups(pups){\n pups.forEach(function(pup){\n renderPup(pup)\n })\n}",
"function render(){\n var i = spans.length,\n span;\n while (i-- > 0) {\n span = spans[i];\n renderSpan(span.start, span.end);\n }\n}",
"formatSpan() {\n let span = document.createEle... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function deconstructs the incoming event off the wire and determines the message type. Text messages are passed through the 'classifier' which uses natural language algorithms to determine a specific keyword for the ChatBot to act upon. | function receivedMessage(event) {
var senderID = event.sender.id;
var recipientID = event.recipient.id;
var timeOfMessage = event.timestamp;
var message = event.message;
console.log("Received message for user %d and page %d at %d with message:",
senderID, recipientID, timeOfMessage);
console.log(JSON.... | [
"function parseMessage(data) {\n switch (data.topic) {\n // https://dev.twitch.tv/docs/v5/guides/PubSub/\n case 'channel-bits-events-v1.' + state.channel_id:\n bits();\n break;\n // https://discuss.dev.twitch.tv/t/in-line-broadcaster-chat-mod-logs/7281/12\n case 'chat_moderator_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the HTML content for tool tip. | tooltip_render(tooltip_data) {
let text = "<h2>" + tooltip_data.state + "</h2>";
text += "<div>Deaths: " + tooltip_data.deaths+"</div>";
text += "<div>Rate per 100,000: " + tooltip_data.rate+"</div>";
return text;
} | [
"function toolTipHTML(data) {\n\n \t\tvar tip = '<h6 class=\"card-title\">'+data.data.prop+'</h6>'\n \t\ttip += '<p class=\"card-text\">'+data.data.expression+'</p>';\n\n return tip;\n }",
"function toolTipHTML(data) {\r\n\r\n \t\tvar tip = '<h6 class=\"c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function for making sure Multi Battle displays valid metas | function updateMultiBattleMetas() {
var cp = parseInt($(".league-select option:selected").val());
var cupSelect = $(".cup-select");
// only show groups with same cp as selected. update whenever league changes
cupSelect.find("option").each(function(index, element) {
element = $(element);
// alw... | [
"function validateTileData() {\n\n}",
"function checkmediumaquamarinefields($is_correct){\n\nhidemediumaquamarine();\n\nif($is_correct){\n initialiseminigameresultscreen(10,true);\n}\nelse{\n initialiseminigameresultscreen(10,false);\n}\n\n}",
"function displayTileInfo(type) {\n\t if (type == \"pokemon\") {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to load the data for the given list of semester codes | function readSemesterData(semesterList) {
// Promise resolves when all sub-tasks are finished
return Promise.all(
// Map each semester code to a promise that fetches the corresponding data
semesterList.map(function(semesterCode) {
return new Promise(function(resolve, reject) {
... | [
"function loadStudents(data){\n\t\tstudents = data.map(function(student){\n\t\t\treturn new Student(student);\n\t\t});\n\t}",
"function loadOccAvailData__ThisYear(data) {\n\n let parsed_data = JSON.parse(data);\n \n //Factors for RevPar vs Rev Graph\n let occ = [];\n let mon = [];\n let avai... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is because JS regexps have no equivalent of zerowidth negative lookbehind assertion for: /(?<!\\)" | function _quote_no_esc(str) {
if (/^"/.test(str)) return true;
let match;
while (match = /^[\s\S]*?([\s\S])"/.exec(str)) {
if (match[1] !== '\\') {
return true;
}
str = str.substr(match[0].length);
}
return false;
} | [
"function _quote_no_esc(str) {\n if (/^\"/.test(str)) return true;\n var match = void 0;\n while (match = /^[\\s\\S]*?([\\s\\S])\"/.exec(str)) {\n if (match[1] !== '\\\\') {\n return true;\n }\n str = str.substr(match[0].length);\n }\n return false;\n}",
"function ne... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
retrieveAnnouncement() Description: Grabs the announcement from the Announcement Google Doc as a string Arguments: doc_id([GoogleDocId] string) Returns: announcement(string) Notes: | function retrieveAnnouncement(doc_id){
var announcement = convertToHTML(doc_id);
return announcement
} | [
"function retrieveAnnouncement(doc_id){\n var announcement = DocumentApp.openById(doc_id).getBody().getText();\n return announcement\n}",
"function get_announcement($http, api_obj) {\n\treturn load_sheet($http, api_obj, \"announcements\")\n\t.then((res) => {\n\t\treturn Promise.resolve(res.data.values)\n\t})\n}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Eye Color Pie Chart | function show_eyeColor(ndx) {
var pieColors = d3.scale.ordinal()
.range(['#4682B4','#8C6746','black', '#B1AA4E', '#FF4500','#ADDFAD','#e9ab18', '#F2BC79', '#B2762D', '#DCAB6E']);
var dim = ndx.dimension(dc.pluck('eye'));
var group = remove_blanks(dim.group(), "");
dc.pieChart('#eye-color')
.height(... | [
"function redCovenants() {\n var covenantsChart = createGraphics.newChart()\n .setChartType(Charts.ChartType.PIE)\n .setOption('title', 'Covenants')\n .setOption('colors', ['#f4cccc', '#ea9999', '#e06666', '#990000'])\n .addRange(redData.getRange(\"O22:R23\"))\n .setOption('backgroundColor', '#00000... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return true if current user already joined this event | checkJoined() {
for (let i = 0; i < this.props.myEvent.member.length; i++) {
if (this.props.myEvent.member[i].id == Meteor.userId()) {
return true;
}
}
return false;
//return this.props.myEvent.member.includes(Meteor.userId());
} | [
"function join_chat() {\n var sio;\n \n if (stateMap.is_connected) { return false; }\n \n if (stateMap.user.get_is_anon()) {\n console.warn('User must be defined before joining chat');\n return false;\n }\n \n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate change in RGB value to reach next colour in 60 steps | function deltaRgb() {
var STEPS = 60;
var delta = {}
for (var key in Colour) {
delta[key] = Math.abs(Math.floor((colour[key] - nextColour[key]) / STEPS));
if(delta[key] === 0) {
delta[key]++;
}
}
... | [
"step() {\n this.currentColor += (this.redComponentRatio * (this.redDiff / this.steps)) & RED;\n this.currentColor += (this.greenComponentRatio * (this.greenDiff / this.steps)) & GREEN;\n this.currentColor += (this.blueComponentRatio * (this.blueDiff / this.steps)) & BLUE;\n return Math.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to store accepted question add 1 point to the score array print the question to the page | function storeAccepted(){
//adds new question value from the input field to qAccepted array
if(document.getElementById("question").value != ''){
//adds new score to score array
score.push(1);
qAccepted.push(document.getElementById("question").value);
//prints array qAccepted to the page
document.getElementB... | [
"function storeRejected(){\n\tif(document.getElementById(\"question\").value != ''){\n\t\t//adds new score to score array\n\t\tscore.push(10);\n\t\t//adds new question value from the input field to qAccepted array\n\t\tqRejected.push(document.getElementById(\"question\").value);\n\t\t//prints array qRejected to the... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Instantiate registry extension Supports Traceur System.register 'instantiate' output for loading ES6 as ES5. Creates the loader.register function Also supports metadata.format = 'register' in instantiate for anonymous register modules Also supports metadata.deps, metadata.execute and metadata.executingRequire for handl... | function register(loader) {
if (typeof indexOf == 'undefined')
indexOf = Array.prototype.indexOf;
if (typeof __eval == 'undefined' || typeof document != 'undefined' && !document.addEventListener)
__eval = 0 || eval; // uglify breaks without the 0 ||
loader._extensions = loader._extensions || [];
loader... | [
"function register(loader) {\n if (typeof indexOf == 'undefined')\n indexOf = Array.prototype.indexOf;\n if (typeof __eval == 'undefined' || typeof document != 'undefined' && !document.addEventListener)\n __eval = 0 || eval; // uglify breaks without the 0 ||\n\n loader._extensions = loader._extensions || [... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
clears the errorMsg and timeout | function clearErrorMsg () {
$timeout.cancel(promise);
promise = $timeout(function(){
$scope.errorMsg = '';
}, 3000);
} | [
"function timeoutFunction()\r\n {\r\n document.getElementById(\"errorMessages\").innerHTML=\"\"\r\n clearFunction(); \r\n }",
"function clearError() {\n _sentCommand = \"\";\n _errorMessage = \"\";\n }",
"clearError(){this.error=!1;this._errortext=this.__initalErrorText}",
"f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns true if the number of "weak" methods to identify service workers is >= 2. | function containsEnoughWeakMethods() {
var weakMethodCount = 0;
weakMethodCount+= isObjectKeyEmpty(serviceWorkerRegistrationInfo) ? 0 : 1;
weakMethodCount+= isObjectKeyEmpty(workboxInfo) ? 0 : 1;
weakMethodCount+= isObjectKeyEmpty(swEventListenersInfo) ? 0 : 1;
weakMethodCount+= isObjectKeyEmpty(swMethodsIn... | [
"function calculateServiceWorkerHeuristic() {\n return !isObjectKeyEmpty(serviceWorkers) || containsEnoughWeakMethods();\n}",
"function areWorkerThreadsAvailable() {\n try {\n require('worker_threads');\n return true;\n }\n catch (error) {\n if (error.code === 'MODULE_NOT_FOUND') {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tell a Yo Mama Joke | function yoMamaJoke() {
axios.get('http://api.yomomma.info').then(res => {
const joke = res.data.joke;
const params = {
icon_emoji: ':laughing:'
};
bot.postMessageToChannel('wilson_channel', `Yo Mama: ${joke}`, params);
});
} | [
"function yoMamaJoke() {\n axios.get('http://api.yomomma.info').then(res => {\n const joke = res.data.joke;\n\n const params = {\n icon_emoji: ':laughing:'\n };\n\n bot.postMessageToChannel('general', `Don't hurt me but, ${joke}`, params);\n });\n}",
"function yoMommaJoke () {\n\taxios.get('htt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
You can modify and use this source freely only for the development of application related Live2D. (c) Live2D Inc. All rights reserved. ============================================================ ============================================================ class L2DModelMatrix extends L2DMatrix44 ======================... | function L2DModelMatrix(w /*float*/, h /*float*/) {
L2DMatrix44.prototype.constructor.call(this);
this.width = w;
this.height = h;
} | [
"function L2DMatrix44() {\n\t this.tr = new Float32Array(16); //\n\t this.identity();\n\t}",
"function L2DViewMatrix() {\n\t L2DMatrix44.prototype.constructor.call(this);\n\t this.screenLeft = null;\n\t this.screenRight = null;\n\t this.screenTop = null;\n\t this.screenBottom = null;\n\t t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
retrives a random color for water | function rndWaterColor() {
return 'rgb(' + colorsWater[Math.floor(Math.random() * 5999) + 1] + ')';
} | [
"function randomColor() { return Math.floor(Math.random() * 16777215); }",
"function pickesColor() {\r\n\r\n\tvar rand = Math.floor(Math.random() * (color.length)) ;\r\n\treturn color[rand];\r\n}",
"function pickRandomColor(){\n\t\treturn colors[Math.floor(Math.random() * colors.length)];\n}",
"function gener... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compresses the given string if it is larger than MAX_SIZE_HTML. log: The logger to use for log messages. htmlString: String containing the html form of the document maxSize: Number indicating the maximum allowed size (in bytes) for html documents callback: The call back to call when this function is done. returns (via ... | function compressHtml(log, config, htmlString, callback) {
log.debug('vler-das-xform-vpr-handler.compressHtml: entering method');
var startTime = new Date();
log.debug('vler-das-xform-vpr-handler.compressHtml: Beginning document compression.');
if(!compressionRequired(config, htmlString)) {
lo... | [
"function purify(htmlInput, options, cb) {\n if (typeof htmlInput === 'undefined') {\n return cb(null, '');\n }\n\n var prefix = options.prefix;\n var postfix = options.postfix;\n const messageDir = options.messageDir;\n const sanitizerLogger = options.logger ? options.logger.get('sanitizer').info : () => ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PROTECTED Sets the network element's identifier. | function setNeId(id) {
this.id = NETWORK_ELEMENT + id;
this.rectid = NETWORK_ELEMENT + id + "rect";
} | [
"setID(e, o) {\n e.setAttribute('id', this.formatID(o));\n }",
"static setID(element)\n {\n const id = `${element.nodeName.toLowerCase()}-${counter++}`;\n element.setAttribute(\"id\", id);\n return id;\n }",
"set _id(value) {\n this.__id = value;\n }",
"setSPARQLVariateId(nodeOrLinkOrAttrib... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the latest content from the IPFS network and Add into ipfsdata. | async function getContent (ipfsNode, hash) {
em.emit('download-start')
// Get the latest content from the IPFS network.
return new Promise((resolve, reject) => {
ipfsNode.get(hash, async function (err, files) {
if (err) {
em.emit('download-stop')
reject(err)
}
const pathStor... | [
"function store() {\n const file = document.getElementById('source').files[0];\n const reader = new FileReader();\n reader.onload = function () {\n var toStore = new Buffer(reader.result);\n ipfs.add(toStore, function (err, res) {\n if (err || !res) {\n return console.error('ipfs add error', er... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
in the constructor we provide SharedCompanyDataService for service and Router for routing to another components | function GetAllCompaniesComponent(_sharedDataService, _router) {
this._sharedDataService = _sharedDataService;
this._router = _router;
} | [
"function UpdateCompanyComponent(_sharedDataService, _router, _route, _formBuilder) {\n this._sharedDataService = _sharedDataService;\n this._router = _router;\n this._route = _route;\n this._formBuilder = _formBuilder;\n this.companyUpdate = new _Common_Company__WEBPACK_IMPORTED_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Indicates if a popup/dropdown element is currently open popups/dropdowns must have A11yClassNames.POPUP to be considered | get popupIsOpen() {
return this.popupHTMLCollection.length > 0;
} | [
"isPaxMenuAlreadyOpen() {\n return browser.isVisible(this.selectors.overlay);\n }",
"function isInPopUp() {\n try {\n return self === top && !!opener && opener !== self && !!window.name;\n } catch (e) {\n return false;\n }\n}",
"function isPopup (el) {\n return el && el.className.index... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parses command flags and maps them to config options according to their respective `percyrc` parameter. The flag input is then merged with options loaded from a config file and default config options. The PERCY_TOKEN environment variable is also included as a convenience. | percyrc(initialOverrides = {}) {
let flags = Object.entries(this.constructor.flags);
let overrides = flags.reduce((conf, [name, flag]) => {
var _flag$percyrc$split$r, _flag$percyrc;
return (_flag$percyrc$split$r = (_flag$percyrc = flag.percyrc) === null || _flag$percyrc === void 0 ? void 0 : _flag$... | [
"percyrc(initialOverrides = {}) {\n let overrides = Object.entries(this.constructor.flags)\n .reduce((conf, [name, flag]) => {\n if (!flag.percyrc || this.flags[name] == null) return conf;\n return set(conf, flag.percyrc, this.flags[name]);\n }, initialOverrides);\n\n // will also vali... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate string for closing xml tag tag: the name of the xml tag | function closeTag(tag) {
return '</' + tag + '>';
} | [
"function closeTag(tag) {\r\n return \"</\" + tag + \">\";\r\n }",
"function endTag(tag) {\n return \"</\" + tag + \">\";\n}",
"function createCloseTag(tagName) {\n return '</' + tagName + '>';\n}",
"closeTag() {\n const { tags, name } = this;\n\n // Our state after this will be S_TEXT, no... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
rescaning of wifi network and store all info | reScanOnPress() {
wifi.reScanAndLoadWifiList((wifiStringList) => {
console.log(wifiStringList);
var wifiArray = JSON.parse(wifiStringList);
// this.setState({
// wifiList: wifiArray,
// });
setTimeout(() => {
let filtere... | [
"function resetNetwork() { \n runCmd( \"wifi\", [], function(text) { console.log (text) });\n}",
"scanNetwork() {\n sessionStorage.setItem(\"update\", false)\n ipcRenderer.send('scan-network');\n }",
"function wifiScanInit(){getNetworks(),rescanIcoHolderEvent()}",
"async _resetNetwork() {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wellness.js Provides links to information about the wellness classes in the form of SmallCard | function DeckB(){
return(
<div>
<h1>Wellness Classes</h1>
<div className='deck'>
<SmallCard img={DiabetesImg} text="Diabetes" />
<SmallCard img={SmokingImg} text="Quit Smoking" />
<SmallCard img={ScaleImg} text="Weight Loss" />
... | [
"function ShowHues(isHuesVisible, isPowderCoatVisible, isSpecialtiesVisible, isPageNumVisible, specialtyTitle) {\n\n $(\"#colouratlas .specialtylist\").toggle(isSpecialtiesVisible);\n\t\t$(\"#colouratlas .filters .powdercoatbanner\").addClass(\"invisiblePowderBanner\");//21-01-2015 - used to show/hide powder... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method will register the specified path to allow access to the static content in the specified folder e.g. staticContent('/img', '/app/img') | staticContent(path, folder) {
this.app.use(path, express.static(folder));
} | [
"_registerStaticPath(app) {\n if (this.instance.staticPath) {\n this.hasStaticContent = true;\n\n // Can only load static content during startup\n // otherwise it will be overridden by error route\n if (this.loadedDuringStartup) {\n const folderPath = path.join(this.addonPath, this.ins... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Chapter Common Achievements, go back to the main menu | function C999_Common_Achievements_MainMenu() {
C999_Common_Achievements_ResetImage();
SetScene("C000_Intro", "ChapterSelect");
} | [
"function returnToMainMenu() {\r\n\r\n // Reset the game state. \r\n resetGameState();\r\n\r\n // End game flag.\r\n gameHasStarted = false;\r\n\r\n // Reload main menu.\r\n startUp();\r\n}",
"function returnToMainMenu() {\n\tmenu = menus.main;\n}",
"goBackToMenu(){\n this.scene.start(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method is used to get all the tasks in the household straight from firestore. Note that this method needs to be awaited as it is async. | async getTasks() {
var firebaseConfig = {
apiKey: config.FIREBASE_KEY,
authDomain: "chores-97427.firebaseapp.com",
projectId: "chores-97427",
storageBucket: "chores-97427.appspot.com",
messagingSenderId: "409040868260",
appId: "1:409040868260:web:7b6d1f00e29554af802731",
me... | [
"async getTasks() {\n var firebaseConfig = {\n apiKey: config.FIREBASE_KEY,\n authDomain: \"chores-97427.firebaseapp.com\",\n projectId: \"chores-97427\",\n storageBucket: \"chores-97427.appspot.com\",\n messagingSenderId: \"409040868260\",\n appId: \"1:409040868260:web:7b6d1f00e295... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================================================== Sets the release time, according to a slider in the GUI theSlider : the slider return the actual value of the release time (in msec) | setReleaseTimeFromGui( theSlider )
{
/// the value of the fader
const valueFader = parseFloat( theSlider.value );
// get the bounds of the fader (GUI)
const minFader = parseFloat( theSlider.min );
const maxFader = parseFloat( theSlider.max );
// get ... | [
"setReleaseTimeFromGui( theSlider )\n {\n /// the value of the fader\n const valueFader = parseFloat( theSlider.value );\n \n // get the bounds of the fader (GUI)\n const minFader = parseFloat( theSlider.min );\n const maxFader = parseFloat( theSlider.max );\n \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the index of the Current context in the queue, can be used to establish parent > child rels | get contextIndex() {
if (this._contextIndex < 0) {
this._contextIndex = this.add(staticProperty("Current", "{3747adcd-a3c3-41b9-bfab-4a64dd2f1e0a}",
// actions
objectPath()));
}
return this._contextIndex;
} | [
"function getCurrentQuestionIndex() {\n return currentQuestion.id;\n}",
"function getCurrentQuestionIndex () {\n //console.log('Getting current question array index');\n const questionIndex = QUESTIONS.findIndex(function(question) {\n return question.id === STORE.currentQuestion;\n });\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
change order of colorArray | function colorSwap(e) {
e.preventDefault();
tmp = colorArray.pop();
colorArray.unshift(tmp);
} | [
"function move_data_to_color_array(colorArray) {\n for (var i = 0; i < arr_color.length; i++) {\n colorArray.push(arr_color[i][0]);\n colorArray.push(arr_color[i][1]);\n colorArray.push(arr_color[i][2]);\n colorArray.push(1);\n }\n}",
"function colorSort(arr){\n let len = arr.le... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end of inisalisasi / Prosedur pilihGambar. Saat Prosedur ini dijanakan akan mengambil nilai dari pilihanGambar yang berisi path gambar. Gambar dimuat menggunakan static method fromURL() dan menset posisi gambar ke tengah canvas. Gamabr diberi filter brighness untuk menurunkan kecerahannya dan membuat teks menjadi lebih... | function pilihGambar() {
var gambar = $("#pilihanGambar").val();
fabric.Image.fromURL(gambar, function (img) {
img.set({
// Needed to position backgroundImage at 0/,
originX: "left",
originY: "top",
});
img.filters.push(filter);
img.applyFilters();
canvas.setBackgroundImage(... | [
"function pilihanGambar_multi() {\n var gambar = $(\"#pilihanGambar-multi\").val();\n\n fabric.Image.fromURL(gambar, function (img) {\n img.set({\n top: 250,\n left: 250,\n });\n\n img.filters.push(filter);\n img.applyFilters();\n\n canvas_multi.setBackgroundImage(\n img,\n canv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Merge results from kernel and context completions. | function mergeReplies(kernel, context) {
// If one is empty, return the other.
if (kernel.matches.length === 0) {
return context;
}
else if (context.matches.length === 0) {
return kernel;
}
// Populate the result with a copy of the kernel matches.
... | [
"function mergeReplies(kernel, context) {\n // If one is empty, return the other.\n if (kernel.matches.length === 0) {\n return context;\n }\n else if (context.matches.length === 0) {\n return kernel;\n }\n // They both have matches, so merge them, wit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Path top credential file | static get credFilePath () {
return path.join(__dirname, '..', '.credentials')
} | [
"accountsFile() {\n const directory = process.env.HOME || process.env.USERPROFILE;\n return path.join(directory, '.password-accounts.json');\n }",
"function readCredentialsFile() {\n if (!fs.existsSync) {\n return {};\n }\n // first look for an env variable called IBM_CREDENTIALS_FILE\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
refresh index by cleaning and indexing all | function refreshIndex(_index){
algolia.deleteByQuery("", function(err) {
if (!err) {
console.log('success deleting all');
}
algolia.saveObjects(_index, function(err, content) {
if (!err) {
console.log('success indexing all');
}
console.log(content);
});
});
} | [
"function reindex()\n\t\t{\n\t\t\tfor (var name in _indexes)\n\t\t\t\t_indexes[name].rebuild();\n\t\t}",
"async function reindexAll() {\n console.log('Refreshing indices to ensure data is commited.');\n console.log('======================================');\n\n console.log('Refreshing articles index...')... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
a function that loops the orientation at 360 to mimick spinning a full 360 deg | function checkLoop () {
//loop when approaching 360/0 from a clockwise spin
if (orientation >= 361) {
orientation = 0 + SPIN_DEG;
}
//loop when approaching 360/0 from a counter clockwise spin
else if (orientation <= -1) {
orientation = 360 - SPIN_DEG;
}
//use 0 in place of 360
else if (orientat... | [
"function turn360(times, period) {\n\n\t\tlet counter = 0;\n\t\t_SteperMotor.gpioDir.write(1);\n\n\t\tlet end = setInterval(function(){\n\t\t\tif (counter < 400 * times) {\n\n\t\t\t\t_SteperMotor.gpioStep.write((counter + 1) % 2);\n\t\t\t\tcounter++;\n\n\t\t\t} else {\n\n\t\t\t\t_SteperMotor.gpioStep.write(0);\n\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Callback needs to do the following: Get the data for the rolling history table. This will be special in that we need to do a check based on the encounter start date | function updateRollingHistory(){
//Get list of rolling history items
var rollingHistoryList = self.retrieveHistoryItems(tableStartDate, tableEndDate);
self.setRollingHistoryArray(rollingHistoryList);
//Build rolling history table
var rollingHistoryTable = self.buildRollingHistoryTable(rollingHistoryList, sele... | [
"_getHistory() {\n if (this.ready) {\n if (this.data_hoursToShow && this.data_hoursToShow > 0 && this.entity_ids.length) {\n // get histroy data\n this.dataInfo = {\n starttime: new Date(),\n endtime: new Date(),\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Save high score for a specific user | function saveCurrentUserHighScore(score) {
//save
Service.setHighScore(score);
//saveCurrentUserData(name, score);
} | [
"function saveHighScore() {\n if (scores.save(score.getLevel(), score.getScore())) {\n showHighScores();\n }\n }",
"function saveHighScore() {\n if (scores.save(mode.get(), score.get())) {\n showHighScores();\n }\n }",
"function postHighScore(user) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the last gamepad state. | function saveButtonsLastState () {
if (!self.isConnected()) {
return;
}
var gamepad = navigator.getGamepads()[ index ];
var total = gamepad.buttons.length;
var i;
for (i = 0; i < total; i++) {
buttonsLastState[ i ] = {
pressed : gamepad.buttons[ i ].pressed,
... | [
"update() {\n if (this.scene.input.gamepad.total) {\n this.pad =\n this.scene.input.gamepad.getPad(0) || this.scene.input.gamepad.pad1;\n }\n }",
"pollStatus() {\n // We're only interested in one gamepad, which is the first.\n this.gamepad = navigator.webkitGetGamepads && navigato... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fixes the positions for all windows | function positionFixup(){
for (var i = tiles.length - 1; i >= 0; i--) {
var layout = returnBalanced(maxCols, maxHeight);
var t = $('#'+tiles[i]);
t.attr({
'row': layout[tiles.length-1][i].row(maxHeight),
'col': layout[tiles.length-1][i].col(maxCols),
'sizex': layout[tiles.length-1][i].sizex(maxCo... | [
"function resetPositions(e) {\n\tbrowserHeight = window.outerHeight;\n browserWidth = window.outerWidth;\n\tfor (var i = 0; i < snowflakes.length; i++) {\n\n var snowflake = snowflakes[i];\n snowflake.xPos = setPosition(50, browserWidth);\n snowflake.yPos = setPosition(50, browserHeight);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is temporary. API returns SDK Test Mode line items. It will be updated in the future | function filterTestModeLineItems(allLineItems) {
const result = allLineItems.filter(lineItem => {
return (lineItem.advertiser != "SDK Test Mode" && lineItem.orderName != "SDK Test Mode");
});
return result;
} | [
"getLineItems() {\n let items = [];\n this.lineItems.forEach(item =>\n items.push({\n type: 'sku',\n parent: item.sku,\n quantity: item.quantity,\n })\n );\n return items;\n }",
"getOrderItems() {\n let items = [];\n this.lineItems.forEach(item =>\n items.pus... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is called with the Download photo button is clicked. | function downloadPhoto() {
// If an operation is in progress, usually involving the server, don't do it.
if (processing) { return false; }
if (currentPhoto == null) {
alert("Please select a photo first.");
return false;
}
// If photo happens to be growing, cut it short.
snapImageToLandingPad();
//... | [
"function photoClick(e) {\n var overlay = document.getElementById('dialog-overlay');\n var wrapper = document.getElementById('dialog-wrapper');\n\n var targ;\n var ee = e;\n if (!ee)\n ee = window.event;\n\n if (ee.target)\n {\n targ = ee.target... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Only enable the save appointment button if the form fields have been filled correctly | function checkFields() {
$('#appointmentInput > input').keyup(function() {
var empty = false;
$('#appointmentInput > input').each(function() {
if ($(this).val() == '') {
empty = true;
}
});
if (!empty) {
$('#saveAppointment').re... | [
"saveAppointment() {\r\n const form = document.querySelector(`.${_CLASSES.form}`)\r\n const id = form.getAttribute('lscalendar-appointment-id')\r\n const day = form.getAttribute('lscalendar-day')\r\n const month = this.current_date.getMonth()\r\n const year = this.current_date.get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to implement a regular expression to remove punctuation from a given sentence | function regexPunct(input) {
var re = /[^\w\s]|_/g; // variable to store the pattern which matches the punctuation mark
// Remove the punctuations in the given string
var regexInput = input.replace(re, " ");
var newRegexInput = regexInput.replace(/\s+/g, " ");
return newRegexInput;
} | [
"function removePunctuation(word) {\n word = word.replace(/(~|`|!|@|#|$|%|^|&|\\*|\\(|\\)|{|}|\\[|\\]|;|:|\\\"|'|<|,|\\.|>|\\?|\\/|\\\\|\\||-|_|\\+|=)/g,\"\")\n return word\n}",
"stripPunctuation(text) {\n return text.replace(/[.,\\/#!$%\\^&\\*;:{}=\\-_`~()]/g,\"\");\n }",
"function removePunctuation(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the id and the text of orgunit Level | function getOrgUnitLevelInformation(orgUnitLevel)
{
var oUnitLevel=null;
//console.log(manifest.dhis2OrgUnitLevel);
for (var i=0;i< manifest.dhis2OrgUnitLevel.length;i++)
{
var unitLevel=manifest.dhis2OrgUnitLevel[i];
//console.log(unitLevel);
//console.log("-----------");
if(unitLevel.id==orgUnitLevel)
{... | [
"getOrgUnitName(id) {\n let orgunit = this.orgtree.treeModel.getNodeById(id);\n return orgunit.name;\n }",
"function getOrganizationnUnitLevelByOrgLevel(id) {\n\n\ttry {\n\n\t\tlgdDwrOrganizationService.getOrganizationnUnitLevelByOrgLevel(id, {\n\t\t\tcallback : handleAdminUnitDepartmentSuccess11... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve the second "p" element and create a NamedNodeMap object from the attributes of the last child by invoking the "getAttributes()" method. Once the list is created an invocation of the "setNamedItem(arg)" method is done with arg=newAttr, where newAttr is a new Attr Node previously created. The "setNamedItem(arg)"... | function hc_namednodemapsetnameditem() {
var success;
var doc;
var elementList;
var newAttribute;
var testAddress;
var attributes;
var districtNode;
var attrName;
var setNode;
doc = load("hc_staff");
elementList = doc.getElementsByTagName("acronym");
te... | [
"function namednodemapchildnoderange() {\n var success;\n if(checkInitialization(builder, \"namednodemapchildnoderange\") != null) return;\n var doc;\n var elementList;\n var testEmployee;\n var attributes;\n var child;\n var length;\n \n var docRef = null;\n if (type... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete the game hosted by the player. | function deleteGame(hostId) {
games.delete(hostId);
} | [
"function removePlayer(game) {\n var player = game.players[game.players.length - 1];\n player.icon.destroy();\n player.buttonDown.destroy();\n player.buttonUp.destroy();\n player.controllerText.destroy();\n player.playerName.destroy();\n game.players.splice(game.players.length - 1, 1);\n}",
"destroy() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
calcIndianCivilCalendar Update from Indian Civil Calendar | function calcIndianCivilCalendar()
{
setJulian(indian_civil_to_jd(
(new Number(document.indiancivilcalendar.year.value)),
document.indiancivilcalendar.month.selectedIndex + 1,
(new Number(document.indiancivilcalendar.day.value))));
} | [
"function calcIndianCivilCalendar()\n{\n setJulian(indian_civil_to_jd(\n (new Number(document.indiancivilcalendar.year.value)),\n document.indiancivilcalendar.month.selectedIndex + 1,\n (new Number(document.indiancivilcalendar.day.valu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
console.log(monkeyTrouble(true, true)); console.log(monkeyTrouble(false, false)); console.log(monkeyTrouble(true, false)); Java > Warmup1 > parrotTrouble We have a loud talking parrot. The "hour" parameter is the current hour time in the range 0..23. We are in trouble if the parrot is talking and the hour is before 7 o... | function parrotTrouble(talking, hour) {
if (talking === true && (hour < 7 || hour > 20)) {
return true;
}
else {
return false;
}
} | [
"function parrotTrouble(talking, hour){\n if (talking === true && hour < 7){\n return true\n } else if (talking === true && hour > 20){\n return true\n } else {\n return false\n }\n}",
"function parrotTrouble(talking, hour)\n {\n return talking && ((hour < 7) || (hour > ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Zero out the values above and below the pivot (using mod 2 arithmetic). | function zeroOutAboveAndBelow(pivotColIndex, pivotRowIndex) {
const pivotRow = transformedMatrix[pivotRowIndex];
const colBitMask = 1 << pivotColIndex;
for (let rowIndex = 0; rowIndex < transformedMatrix.length; rowIndex++) {
if (rowIndex !== pivotRowIndex && (colBitMask & transformedMatrix[rowIndex])... | [
"function ZeroOutArrayNegativeVals(arr){\n}",
"function pivotSort(array, pivot) {\n\n\t\tfunction maxKey (array, pivot) {\n\t\t\tvar key = 0, i = 0;\n\t\t\tvar current = 0, maximum = 0;\n\t\t\tfor (i = pivot; i < array.length; i++) {\n\t\t\t\tcurrent = Math.abs(array[i][pivot]);\n\t\t\t\tif (current > maximum){\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The background url of the team. | get background() {
return this._data.background;
} | [
"function getBackgroundUrl() {\n\tconsole.log(\"model.getBackgroundUrl\");\n\n\tvar place = this.getPlace();\n\tvar result;\n\tif (place) {\n\t\tresult = this.places[place].backgroundUrl;\n\t} else {\n\t\tconsole.log(\"model.getBackgroundUrl: Error. Unknown place.\");\n\t\tconsole.log(\"Can't return the background... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function creates an exception from an TraceKitStackTrace | function exceptionFromStacktrace(stacktrace) {
var frames = prepareFramesForEvent(stacktrace.stack);
var exception = {
type: stacktrace.name,
value: stacktrace.message,
};
if (frames && frames.length) {
exception.stacktrace = { frames: frames };
}
if (exception.type === u... | [
"function exceptionFromStacktrace(stacktrace) {\n var frames = prepareFramesForEvent(stacktrace.stack);\n var exception = {\n type: stacktrace.name,\n value: stacktrace.message,\n };\n if (frames && frames.length) {\n exception.stacktrace = { frames: frames };\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |