query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Gets calendar HTML by making GET request to API. Calls submitCalendarHTML if successful. | function getAndSubmitCalendarFromRequest() {
// Make a GET request from API for calendar HTML
const url = `https://www.myu.umn.edu/psp/psprd/EMPLOYEE/CAMP/s/WEBLIB_IS_DS.ISCRIPT1.FieldFormula.IScript_DrawSection?group=UM_SSS§ion=UM_SSS_ACAD_SCHEDULE&pslnk=1&ITG=125034&cmd=smartnav&effdt=${fullClassWeekDate}`;
... | [
"function get_calendar(){\n if ($('.events').length){\n $.ajax({url: CAL_URL, success: expand_instances});\n $('body').click(unclick_cal_event);\n } else {\n console.log('nope'); // Page doesn't need any events, so don't fetch any.\n }\n}",
"function getCalendar(){\r\n let xml = new XMLHttpRequest();... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
////////////////////////////////////////////////////////////////////////////////////////////////////// addArrayToWikiaNavUl A function that adds a menu item to Wikia's Expanded Wiki Navigation // by jgjake2 // Inputs: // topMenuItem see addArrayToWikiaNav // menuItemsArray see addArrayToWikiaNav // wikiNavUl An element... | function addArrayToWikiaNavUl_TopLevel(topMenuItem, menuItemsArray, wikiNavUl){
var newNavMenuItem = document.createElement("li"); // Create the new menu item
var newNavMenuItem_HTML = '<a href="' + topMenuItem[0] + '">' + topMenuItem[1] + '</a><ul class="subnav-2 accent" style="visibility: visible; display... | [
"function addArrayToWikiaNavUl_TopLevel(topMenuItem, menuItemsArray, wikiNavUl){\n var newNavMenuItem = document.createElement(\"li\"); // Create the new menu item\n var newNavMenuItem_HTML = '<a href=\"' + topMenuItem[0] + '\">' + topMenuItem[1] + '</a><ul class=\"subnav-2 accent\" style=\"visibility: vi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper to get the alignment of a tooltip given the size | function determineAlignment(tooltip, size) {
var model = tooltip._model;
var chart = tooltip._chart;
var chartArea = tooltip._chart.chartArea;
var xAlign = 'center';
var yAlign = 'center';
if (model.... | [
"function determineAlignment(tooltip, size) {\n var model = tooltip._model;\n var chart = tooltip._chart;\n var chartArea = tooltip._chart.chartArea;\n var xAlign = 'center';\n var yAlign = 'center';\n \n if (model.y < size.height) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create & inject Filter 'Done' button | function addDoneButton() {
doneButton.innerHTML = "Done";
doneButton.className = 'filter-button-done';
filterSection.insertBefore(doneButton, filterSection.firstChild);
function hideFilters() {
filterSection.style.display = filterSection.style.display === 'none' ? '' : 'none... | [
"function createFilterButton(filter, value) {\n var html = '<button id=\"' + value + '\" class=\"filterButton\">' + filter.label + '</button>';;\n return html;\n}",
"btnDoneClicked() {\n this.props.onChangeFilter('Done')\n }",
"function createDoneButton() {\n let done = document.createElement('button... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
unlock timestamps file so another spider instance can run | async unload() {
if (this.buildTimestampsLock) {
await this.buildTimestampsLock()
this.buildTimestampsLock = null
}
} | [
"async setTimestamp() {\n\t\t// return RNFS.touch(path, timestampDate, timestampDate);\n\t}",
"function TLSave(timeStamp,lockedBy)\n{\n var lockedText='';\n if (lockedBy!='')\n {\n lockedText=timeStamp+'##'+lockedBy;\n }\n else lockedText=timeStamp+'##';\n var lockSave=saveFile(TiddlyLock.LockFile,lock... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show a dropdown to change the theme | function showThemesDropdown() {
// Hide the dropdown if it exists
if (hideDropdown())
return;
// Create main dropdown container
var dropdown = document.createElement('div');
dropdown.classList.add('dropdown');
dropdown.innerHTML = '<h2>Themes</h2>';
// Show non-saving warning if Stora... | [
"ChangeThemeTagShow() {\n $('#Theme option[value=' + _Value_.GetTheme() + ']').attr(\"selected\", true);\n }",
"function showThemeDropdown() {\r\n document.getElementById(\"themeDropdown\").classList.toggle(\"display-none\");\r\n }",
"function onThemeSelected(){\n setTheme(dropdown.value);\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handler triggered when a new file for an artifact is selected. Changes the label to display the file name | function onArtifactFileChange() {
// Show the name of the file
if (this.files.length > 0) {
$('#labelArtifactFile').text(this.files[0].name);
}
} | [
"function file_selected(e) {\n if (e.files.length == 1) {\n $('#upload_button').button('enable');\n $('#new_file_name_container').html('<span id=\"new_file_name\">' + e.files[0].name + '</span>');\n } else {\n $('#upload_button').button('disable');\n $('#new_file_name_container').html('(Use \\'pick fi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse single node in FBXTree.Objects.Material Materials are connected to texture maps in FBXTree.Objects.Textures FBX format currently only supports Lambert and Phong shading models | function parseMaterial( FBXTree, materialNode, textureMap, connections ) {
var ID = materialNode.id;
var name = materialNode.attrName;
var type = materialNode.ShadingModel;
//Case where FBX wraps shading model in property object.
if ( typeof type ===... | [
"function parseMaterial(FBXTree, materialNode, textureMap, connections) {\n var ID = materialNode.id;\n var name = materialNode.attrName;\n var type = materialNode.ShadingModel;\n //Case where FBX wraps shading model in property object.\n if (typeof type === 'object') {\n type = type.value;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the animationclock itself. controlling all animation in the scen | function AnimationClock(){
ClockAnimation();
} | [
"start() {\n this._enableAnimation = true;\n this._numberOfAnimationCycles = 0;\n }",
"function startAnimation () {\n on = true; // Animation angeschaltet\n timer = setInterval(paint,40); // Timer mit Intervall ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DATE FUNCTIONS takes a timeStamp and returns date string in mm/dd/yyyy | getShortDate(timeStamp) {
// pad 0 for single digits
const padZero = (val) => {
return val < 9 ? "0" + val : val;
};
const date = new Date(timeStamp);
const m = padZero(date.getMonth() + 1);
const d = padZero(date.getDate());
const y = date.getFullYear();
return `${m}/${d}/${y}`;
} | [
"function getShortDate(timeStamp) {\n\tconst date = new Date(timeStamp);\n\tconst m = padZero(date.getMonth() + 1);\n\tconst d = padZero(date.getDate());\n\tconst y = date.getFullYear();\n\treturn `${m}/${d}/${y}`;\n}",
"function toDDMMYYYY(date){\n\treturn date.substring(6, 8) + \"/\" + date.substring(4, 6) + \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
scrapes a battle report for information and returns the information as an object representation of the report | function twcheese_scrapeBattleReport(gameDoc)
{
var reportScraper = new twcheese_BattleReportScraper(gameDoc);
var report = new twcheese_BattleReport;
report.attacker = reportScraper.getAttacker();
report.attackerLosses = reportScraper.getAttackerLosses();
report.attackerQuantity = reportScraper.getAttacker... | [
"function twcheese_BattleReport()\n\t{\n\t\tthis.attacker;\n\t\tthis.attackerLosses;\n\t\tthis.attackerQuantity;\n\t\tthis.attackerVillage;\n\t\tthis.buildingLevels;\n\t\tthis.defender;\n\t\tthis.defenderLosses;\n\t\tthis.defenderQuantity;\n\t\tthis.defenderVillage;\n\t\tthis.dot;\n\t\tthis.espionageLevel;\n\t\tthi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
True when the document has been changed (when there are any steps). | get docChanged() {
return this.steps.length > 0;
} | [
"get docChanged() { return !this.changes.empty; }",
"get docChanged() {\n return !this.changes.empty;\n }",
"get docChanged() {\n return !this.changes.empty;\n }",
"get docChanged() {\n return !this.changes.empty;\n }",
"get changed() {\n\t\treturn this.markdown !== this.init... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Maps cards and dropzones to be rendered in standard piles | mapCards(cards) {
var upCardIndex = 1;
var extraTop = 0;
var mappedCards = cards.map((card, index) => {
// If it's a card
if (card.column === undefined) {
// Logic to determine where the card is placed in the stack. ex.(If the card below it has it's back ... | [
"function initDestinationMaps() {\n // Destination card 1 map\n var hike1 = { lat: markerData[0].lat, lng: markerData[0].lon };\n var map2 = new google.maps.Map(document.getElementById(\"map2\"), {\n zoom: 12,\n disableDefaultUI: true,\n center: hike1,\n mapTypeId: \"terrain\"\n });\n var marker = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
retrieves the OTP keys from both split keys. There's 3 of them, but each split key only holds 2. This function with return an array of pad key 1,2, and 3 in the right order. a(key0) b(key0) key1 key2 TYPE 1 b(key1) c(key1) key0 key2 TYPE 2 a(key2) c(key2) key0 key1 TYPE 3 | retrievePads(res1, res2) {
let pads = [[], [], []];
for (let res of [res1, res2]) {
if (res.partType === PART_COMBINATIONS[0]) {
// type 1 code contains pad 2 and pad 3
pads[1].push(res.pad1);
pads[2].push(res.pad2);
} else if (res.... | [
"splitPrivateKey(key) {\n let {keySegments, keyLength} = this.splitInto3Segments(key);\n\n // generate 3 random One Time Pad keys, at the length of one third of the private key length\n let pads = this.createOTPKeys(keyLength);\n\n keys = [\n this.makeSplitKey(PART_COMBINATION... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Language: Gcode (ISO 6983) | function gcode(hljs) {
var GCODE_IDENT_RE = '[A-Z_][A-Z0-9_.]*';
var GCODE_CLOSE_RE = '\\%';
var GCODE_KEYWORDS =
'IF DO WHILE ENDWHILE CALL ENDIF SUB ENDSUB GOTO REPEAT ENDREPEAT ' +
'EQ LT GT NE GE LE OR XOR';
var GCODE_START = {
className: 'meta',
begin: '([O])([0-9]+)'
... | [
"function gcode(hljs) {\n const GCODE_IDENT_RE = '[A-Z_][A-Z0-9_.]*';\n const GCODE_CLOSE_RE = '%';\n const GCODE_KEYWORDS = {\n $pattern: GCODE_IDENT_RE,\n keyword: 'IF DO WHILE ENDWHILE CALL ENDIF SUB ENDSUB GOTO REPEAT ENDREPEAT ' + 'EQ LT GT NE GE LE OR XOR'\n };\n const GCODE_START = {\n classNam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Displays the position ordering for each strategy in the console | function displayConsoleResults() {
main()
console.log("=== Overall Material Rarity Totals ===")
console.log("Wood Dot Totals: " + totalWoodDots)
console.log("Ore Dot Totals: " + totalOreDots)
console.log("Wheat Dot Totals: " + totalWheatDots)
console.log("Sheep Dot Totals: " + totalSheepDots)
... | [
"function debugStrategyTop(strategy) {\n if (debugStrategies) {\n addDebugLine(\"<br>Testing strategy: <i>\"+strategy+\"</i>\");\n }\n}",
"function tableOrders()\n\t\t{\n\t\t\tTable.print(data, Table.ORDER_FOUND);\n\t\t\tTable.print(data, Table.ORDER_ALPHA);\n\t\t\tTable.print(data, Table.ORDER_COLUMN);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hard create a function that takes in 4 numbers. Multiply the first two numbers. If the product is greater than 100 add the sum of the last two numbers and console log the value. If the product is less that 100, subtract the difference of the last two numbers and console log the value. If the product is 100, multiply th... | function fourNums(n1,n2,n3,n4) {
let erg = n1*n2
if (erg > 100) {
erg = erg + n3 + n4
console.log(erg)
} else if (erg < 100) {
erg = erg - (n3 - n4)
} else {
erg = (erg * n3) % n4
alert(erg)
}
} | [
"function sub(num1,num2,num3,num4) {\n let mult = num1 * num2\n if (mult > 100) {\n console.log(mult + num3 + num4)\n } else if (mult < 100) {\n console.log(mult - num3 - num4)\n } else if (mult == 100) {\n alert((num1 * num2 * num3) % num4)\n }\n}",
"function hard (num1,num2,n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adds a misclick incident to the database | function addIncident(member, details, db) {
if (
!db
.get('users')
.find({ serverId: member.guild.id, userId: member.id })
.value()
) {
db.get('users')
.push({
serverId: member.guild.id,
userId: member.id,
incidents: [],
count: 0
})
.write(... | [
"function addSaveIncident() { \n\tvar newincident = $('#selected-incident').val();\n\tvar newcode = $('#incident-number').val();\n\tvar newlevel;\n\tif ((newincident != '') && (newcode !='')) {\n\t\tvar oldcode = $('#oldIncident').html();\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fill our internal list of HlsAudioTracks with data from the master playlist or use a default | fillAudioTracks_() {
let master = this.master();
let mediaGroups = master.mediaGroups || {};
// force a default if we have none or we are not
// in html5 mode (the only mode to support more than one
// audio track)
if (!mediaGroups ||
!mediaGroups.AUDIO ||
Object.keys(mediaGroup... | [
"fillAudioTracks_() {\n let master = this.master();\n let mediaGroups = master.mediaGroups || {};\n\n // force a default if we have none or we are not\n // in html5 mode (the only mode to support more than one\n // audio track)\n if (!mediaGroups ||\n !mediaGroups.AUDIO ||\n Object.k... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove the person from the list of attending people update the table of pubs | function removeAttender(event, ui){
for(let i = 0; i < attending.length; i++){
if ( attending[i] === $(ui.item).attr('data-id')) {
attending.splice(i, 1);
break;
}
}
updatePubList();
} | [
"function removePerson(element, name) {\n // delete from table\n element.parentElement.parentElement.remove();\n // delete from attendee list\n attendeeList = attendeeList.filter(p => { return p.name != name });\n totalField.textContent = attendeeList.length;\n}",
"function delete_person(data) {\n\t\t$('#' +... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
import useScript from "./useScript"; import f_shader from "./fragshader"; import v_shader from "./vertshader"; | function App() {
// useScript("./vert-shader.js", "vertex-shader");
// useScript("./frag-shader.js", "fragment-shader");
// useScript("./sphere.js");
// useScript("./webgl-utils.js", "webgl");
// useScript("./initShaders.js", "init");
// useScript("./MV.js", "mv");
// useScript("./robotArm.js", "rb");
... | [
"function ShaderLibExtra() {}",
"function register(Shader) {\n // Some build in shaders\n Shader['import'](__WEBPACK_IMPORTED_MODULE_0__source_compositor_coloradjust_glsl_js__[\"a\" /* default */]);\n Shader['import'](__WEBPACK_IMPORTED_MODULE_1__source_compositor_blur_glsl_js__[\"a\" /* default */]);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
modifies tool by posting the newobject to the server | function modifyTool(new_tool) {
axios.post(props.url + "/modify", new_tool).then((response) => {
window.location.reload()
});
} | [
"save() {\n\t\tconst tools = this.state.tools;\n\n\t\t// If tool has valid ID then PUT, no ID do a POST (new record)\n\t\tconst method = tools._id ? 'put' : 'post';\n\n\t\t// PUT URL : POST URL\n\t\tconst url = tools._id ? `${BASE_URL}/${tools._id}` : BASE_URL;\n\t\taxios[method](url, tools).then((resp) => {\n\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get User info from server and call callback (setUserDetail) | loadUserDetails() {
$http({ url: statusManagerService.endpointUrl() + "?request=getuserinfo" }).
then(me.setUserDetails, function (err) { });
} | [
"getUserDetails() {\n this.makeGETRequest('getuserinfo','userinfoloaded','userInfo');\n }",
"loadUserDetails() {\n $http({\n url: HsStatusManagerService.endpointUrl() + '?request=getuserinfo',\n }).then(me.setUserDetails, (err) => {});\n }",
"function onUserDetails( result )\r\n{\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call API to fetch favor details | async function getFavor(){
try {
setShowClaim(false);
setShowAlert(false);
let result = await fetch(`/api/favor/${favorId}`, {credentials: 'include', method: "GET"});
let json = await result.json();
if(json.success == false){
setErrMs... | [
"function getFavoriteMovies() {\n fetch('/favorites')\n .then(function(response) {\n return response.json();\n })\n .then(function(responseData) {\n // We created this API so we know the response data is exactly what we want\n FavoriteMovies = responseData;\n });\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Busy when 1) pending network request, or 2) currently playing audio | function isBusy() {
return audioElementsToPlay.length > 0;
} | [
"dispatchAudio() {\n const state = this.state;\n if (state.code !== NetworkingStatusCode.Ready)\n return false;\n if (typeof state.preparedPacket !== 'undefined') {\n this.playAudioPacket(state.preparedPacket);\n state.preparedPacket = undefined;\n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add icons of features | _addIcons(layer) {
if(this._featureIcons && layer.hasLayer(this._featureIcons)) {
layer.removeLayer(this._featureIcons);
}
this._featureIcons = new LayerGroup();
const featuresWithIcons = layer.getLayers().filter(l => l.options && l.options.iconImage && (!this.props.selection || l.feature.id !== this.props... | [
"get features() {\n return [\n {\n label: \"Training\",\n icon: \"custom:custom11\",\n },\n {\n label: \"Consulting\",\n icon: \"custom:custom11\",\n },\n {\n label: \"Community\",\n icon: \"custom:custom11\",\n },\n ];\n }",
"addIcon ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a function for deleteUserHostedPropertyValue / Delete an application property value stored against a user. | deleteUserHostedPropertyValue(incomingOptions, cb) {
const Bitbucket = require('./dist');
let apiInstance = new Bitbucket.PropertiesApi(); // String | The user // String | The key of the Connect app // String | The name of the property.
/*let username = "username_example";*/ /*let appKey = "appKey_example"... | [
"function deleteUserProperty(property) {\n const userProperties = PropertiesService.getUserProperties();\n userProperties.deleteProperty(property);\n}",
"function deleteProperty(user_id, property_id, callback) {\n let sql = `DELETE FROM property WHERE property_id = ? AND user_id = ?`;\n let inserts = [pro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
React hook that provides all the state management logic for a group of checkboxes. It is consumed by the `CheckboxGroup` component | function useCheckboxGroup(props) {
if (props === void 0) {
props = {};
}
var _props = props,
defaultValue = _props.defaultValue,
valueProp = _props.value,
onChangeProp = _props.onChange,
isNative = _props.isNative;
var _useState = (0, _react.useState)(defaultValue || []),
val... | [
"function useCheckboxGroup(props, state) {\n let {\n isDisabled,\n name\n } = props;\n let {\n labelProps,\n fieldProps\n } = useLabel(_babelRuntimeHelpersExtends({}, props, {\n // Checkbox group is not an HTML input element so it\n // shouldn't be labeled by a <label> element.\n labelEleme... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Simplifies API notification objects into only what is needed for render. | processNotifications() {
const { notifications } = this.props;
if (!notifications) {
return [];
}
return notifications.map(notification => ({
title: notification.title,
description: notification.description,
metadata: this.generateMetadataString(notification),
notificationI... | [
"static buildStructuredNotificationObject(rawNotification) {\n let notification = {\n id: rawNotification.custom.i,\n heading: rawNotification.title,\n content: rawNotification.alert,\n data: rawNotification.custom.a,\n url: rawNotification.custom.u,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Unique ID of the Canvas&039; sorting layer. | get sortingLayerID() {} | [
"set sortingLayerID(value) {}",
"get id() {\n return `${this._layer.getID()}-${this._id}`\n }",
"function getID(layer)\r\n\t\t\t{\r\n\t\t\t\treturn layer.url ? layer.id : layer.id;\r\n\t\t\t}",
"function getID(layer)\n{\n\treturn layer.url ? layer.id : layer.featureCollection.layers[0].id;\n}",
"f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GARBAGE COLLECTORS The following functions get rid of uneeded data and operations. setIntervals and instances are dumped when the elements are removed from the DOM on page switch when using AJAX. DESTROY INSTANCES | function instancesGarbageCollector(gcRemovedElementsArea) {
// jQuery UI tabs
var jQueryUITabs = gcRemovedElementsArea.find(".ui-tabs").addBack(".ui-tabs");
if( jQueryUITabs.length ) {
jQueryUITabs.each(function() {
$(this).tabs("destroy");
});
}
// CubePortfolio
var filterElements = gcRemovedElementsArea... | [
"function garbageCollect(){\n if(!Ext.enableGarbageCollector){\n clearInterval(El.collectorThread);\n } else {\n var eid,\n el,\n d;\n\n for(eid in El.cache){\n el = El.cache[eid];\n d = el.dom;\n // ----------------------------------... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Description: Adds menu commands. | function addMenuCommands() {
var navigateMenu = Menus.getMenu(Menus.AppMenuBar.NAVIGATE_MENU);
var viewMenu = Menus.getMenu(Menus.AppMenuBar.VIEW_MENU);
var registerCommandHandler = function (commandId, menuName, handler, shortcut, menu) {
CommandManager.register(menuName, commandId, handler);
m... | [
"function addMenuCommands() {\n var navigateMenu = Menus.getMenu(Menus.AppMenuBar.NAVIGATE_MENU),\n viewMenu = Menus.getMenu(Menus.AppMenuBar.VIEW_MENU),\n registerCommandHandler = function (commandId, menuName, handler, shortcut, menu) {\n CommandManager.register(menuNam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders recording progress bar. | function renderRecordingProgressBar() {
var parentWidth = recordProgress.clientWidth,
width = recordingTime / a.MAX_RECORDING_TIME * parentWidth;
renderRecordingProgressBarValue(width);
} | [
"function _drawProgressBar() {\n\t\tcanvasContext.fillStyle = _progressColor;\n\t\tcanvasContext.beginPath();\n\t\tcanvasContext.rect(_progressBar.getLeft(), _progressBar.getTop(), _progressBar.width, _progressBar.height);\n\t\tcanvasContext.closePath();\n\n\t\tcanvasContext.fill();\n\t}",
"function renderProgres... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
breakPointUnmatch The things which happen when the layout transitions from smallscreen to bigscreen mode | breakPointUnmatch() {
$(".sectionLeft").removeClass("fullSection");
$(".sectionRight").removeClass("fullSection");
$(".sectionLeft").removeClass("hiddenSection");
$(".sectionRight").removeClass("hiddenSection");
ResponsiveLayoutManager.toggleToggleButton(false);
} | [
"breakPointMatch() {\n\t\tResponsiveLayoutManager.switchSection(\"left\");\n\t\tResponsiveLayoutManager.toggleToggleButton(true);\n\t}",
"function exitSplitscreen(newside) {\r\n var oldside,\r\n pickedScreen = $('#metascreen-' + newside).detach(),\r\n root = $(pickedScreen.children('.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calcul d'un angle en radian entre 2 points A et B | function m_angleRad(a, b)
{
return Math.atan2(a.x - b.x, a.y - b.y);
} | [
"static calculateAngle(a: Position, b: Position): number {\n return Math.atan2(b[1] - a[1], b[0] - a[0]);\n }",
"function getAngle(pointA, pointB) {\r\n\t\t return Math.atan2(pointB.x - pointA.x, pointB.y - pointA.y);\r\n\t\t}",
"function getAngle(A, B) {\n // move A to 0,0\n // we could also push to... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Notice that lux_typeOf is NOT EXACTLY equal to In particular, lux_typeOf will return "object" if given Shade expressions Shade expressions are actually functions with a bunch of extra methods. This is something of a hack, but it is the simplest way I know of to get operator() overloading, which turns out to be notation... | function lux_typeOf(value)
{
var s = typeof value;
if (s === 'function' && value._lux_expression)
return 'object'; // shade expression
if (s === 'object') {
if (value) {
if (typeof value.length === 'number'
&& !(value.propertyIsEnumerable('length'))
... | [
"function TypeofExpression() {\n}",
"function dltypeof( vExpression )\n{\n var sTypeOf = typeof vExpression;\n if( sTypeOf == \"function\" )\n {\n var sFunction = vExpression.toString();\n if( ( /^\\/.*\\/$/ ).test( sFunction ) )\n {\n return \"regexp\";\n }\n else if( ( /^\\[object.*\\]$/i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Task: Copy files from includes folder | function includesCopy() {
return src('./src/includes/**/*')
.pipe(newer('./pub/includes'))
.pipe(dest('./pub/includes'));
} | [
"function copyFiles() {\n paths.forEach((path) => {\n const dest = path.replace('src/app/', 'src/compiler-output/app/');\n\n fs.copyFileSync(path, dest);\n })\n}",
"function copyFiles() {\n return gulp.src(paths.root + '/*.*')\n .pipe(gulp.dest(dist.root));\n}",
"setupFiles() {\n return this.fs... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handleClick(digit) handles the onclick event for the numpad. Each button sends the character assigned to it and then adds it to the last space in the string 'num' in state | handleClick(digit){
this.setState({num:this.state.num+digit})
} | [
"function digit_pressed(ev) {\n var digit = parseFloat(ev.target.value);\n append_digit(digit);\n }",
"function handleNumberClick(i) {\n function handleClick() {\n if (i == 0){\n if (!clickNonZero) {\n currentNumber = '0';\n } else {\n currentNumber += '0';\n }\n added... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
alt :: (Either e) => e a b ~> (e a b) > e a b | alt (alternative) {
if (Either.isEither(alternative)) {
return this.isRight ? this : alternative
}
throw new Error('Either#alt expects an Either as an argument')
} | [
"function Left$prototype$alt(other) {\n return other;\n }",
"function alt(m, x) {\n if(!(isAlt(m) && isSameType(m, x))) {\n throw new TypeError('alt: Both arguments must be Alts of the same type')\n }\n\n return x.alt(m)\n}",
"function alt(x, y) {\n return Alt.methods.alt (x) (y);\n }",
"functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function getting authors from local storage | function getAllAuthors() {
return $localStorage.authors;
} | [
"function getAuthors() {\n\tvar snippet = {\n\t\tfields: \"name,about,thumbnail\"\n\t}\n\trimer.author.find(snippet, function(error, value) {\n\t\tif(error) {\n\t\t\tconsole.log(error)\n\t\t}\n\t\telse {\n\t\t\tconsole.log(value)\n\t\t}\n\t})\n}",
"function getAuthors() {\n var authors = $document.querySelecto... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert an enum into a TypeScript const enum declaration. | function getEnumDeclaration(className, enumName, enumData) {
var exportName = className + enumName;
var enumFields = " " + Object.keys(enumData).sort().map(function(enumType) {
return enumType + " = " + enumData[enumType];
}).join(",\n ");
return "declare enum " + exportName + " {\n" + enumField... | [
"function mapDeclareEnum(node: DeclareEnum): DeclareVariable {\n return {\n type: 'DeclareVariable',\n kind: 'const',\n id: nodeWith(node.id, {\n typeAnnotation: {\n type: 'TypeAnnotation',\n typeAnnotation: createAnyTypeAnnotation(node.body),\n loc: node.body.loc,\n range... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update a DB table with the specified JSON data. The update is done by deleting all existing objects and then, inserting the updated objects. | function updateTable( jsonData, successCallback ) {
var dataType;
if ( !jsonData ) {
throw "MobileDb.updateTable: Required parameter jsonData is null or undefined";
}
if ( !db ) {
throw "MobileDb.updateTable: Database instance is not open. Call openDB() before ca... | [
"updateAction(table, dataJson, conditions, callback){\n var query = \"UPDATE %s SET %s WHERE %s\";\n var self = this;\n var set = \"\";\n\n this._injectDate(dataJson);\n\n _(dataJson).forEach((value, key)=>{\n set += key + \"=\" + self._isValueString(value) + \",\"; \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bind event on scroll on active item in fotorama | function mousewheel(e, fotorama, element) {
var $fotoramaStage = fotorama.activeFrame.$stageFrame,
fotoramaStage = $fotoramaStage.get(0);
function onWheel(e) {
var delta = e.deltaY || e.wheelDelta,
ev = e || window.event;
if (... | [
"function mousewheel(e, fotorama, element) {\n var $fotoramaStage = fotorama.activeFrame.$stageFrame,\n fotoramaStage = $fotoramaStage.get(0);\n\n function onWheel(e) {\n var delta = e.deltaY || e.wheelDelta,\n ev = e || window.event;\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inserts knot un in the U knot vector rtimes Ref: Algorithm A5.3 "The NURBS book" | insertKnotU(un, r) {
let p = this.u_degree;
// Knot will be inserted between [k, k+1)
let k = helper_1.findSpan(p, this.u_knots.data, un);
// If un already exists in the knot vector, s is its multiplicity
let s = common_1.count(this.u_knots, un, 0);
if (r + s > p) {... | [
"insertKnot(un, r) {\r\n let p = this.degree;\r\n let dim = this.dimension;\r\n let k = this.findSpan(un);\r\n let isRational = this.isRational();\r\n // If un already exists in the knot vector then s is it's multiplicity\r\n let s = 0;\r\n for (let i = 0; i < this.k... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
endregion region Handle Select Search Person | function handleSelectPersonInSearch(id) {
clearFields();
setIdPeople(id);
handleCloseModalSearchPersonEdit();
inputFocusIdPerson();
} | [
"function handleSearchPerson(idPerson) {\n if (idPerson && !updateRegister) {\n loadDataPerson(idPerson);\n setUpdateRegister(false);\n setTitleUpdate(\"\");\n } else if (!updateRegister) {\n clearFields();\n }\n }",
"function selectSearchResult() {\n //move to position\n setup... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the document contains a canonical link | hasCanonical() {
return this.head.indexOf('rel="canonical"') > -1;
} | [
"function _findCanonical() {\n var tiny, link, doc;\n doc = jetpack.tabs.focused.contentDocument;\n if(tiny = $(\"link[rev='canonical']\", doc).attr(\"href\"))\n link = tiny;\n else if(tiny = $(\"link[rel='shorturl']\", doc).attr(\"href\"))\n link = tiny;\n else if(_links[jetpack.tabs.focused.url])\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Input bal > Initial balance $'s intR > Interest rate %/year nPer > Number of compounding periods, years mDep > Monthly deposits accrued until end of year, $'s Output retirement in an array > $'s | function retireArray(bal,intR,nPer,mDep){
var retirement = [];
retirement[0] = bal;
for(var year=1;year<=nPer;year++){
retirement[year]=retirement[year-1]*(1+(intR/100));
retirement[year]+=(mDep/12);
retirement[year]=retirement[year].toFixed(2);
}
return retirement;
} | [
"function retire(bal, intR, nPer, mDep){\n\t\tvar retirement =bal;\n\t\tfor(var year=1;year<=nYears;year++){\n\t\tretirement*=(1+intRate/100);\n\t\tretirement+=(mDeposit*12);\n\t\tretirement=retirement.toFixed(2);\n\t\t}\n\treturn retirement;\n\t}",
"function retire(bal,intR,nPer,mDep){\n\tvar retirement = bal;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creates a labeled checkbox (deprecated) | function labeledcheckbox(name, callback){
var $span = $("<span />").text(name);
var $chk = $("<input type='checkbox' name='"+name+"' />");
//
$chk[0].onchange = callback;
//
return $("<label />").append($span).append($chk);
} | [
"function createCheckbox(labelText, checked, callback)\n\t{\n\t\tvar label = document.createElement(\"label\"),\n\t\t span = document.createElement(\"span\"),\n\t\t checkbox = document.createElement(\"input\"),\n\t\t elem = document.createElement(\"span\");\n\n\t\tlabel.className = \"ytd-checkbox-label\";\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=========== get list garnihs ============== | function getListGarnish() {
GarnishService.getList($rootScope.userLogin.token).success(function (res) {
$scope.list_garnish = res;
})
} | [
"function getListGM() {\n return typeof GM_listValues !== 'undefined' ? GM_listValues() : [];\n }",
"retrieveGenresList() {\n return thegamesDbApi.retrieveGenresList();\n }",
"function listGists({handle}) { // get gists\n return this.getData({path:`/users/${handle}/gists`})\n .then(respo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function returns the lesion number of the last lesion (order of fillingout) that was completed. | function lookupLastCompletedLesion() {
if( meCompletedLesions[0] == 0 )
return 0;
for( var i = 1; i < myDefaultArrayLength; i++ ) {
if( meCompletedLesions[i] == 0 ) {
return i-1;
}
}
return myDefaultArrayLength;
} | [
"getLastIndexBeforeApproach() {\n const currentFlightPlan = this._flightPlans[this._currentFlightPlanIndex]; // TODO: if we have an approach return last index\n\n if (currentFlightPlan.approach !== FlightPlanSegment.Empty) {\n return currentFlightPlan.approach.offset - 1;\n }\n\n return t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates and enters a new child function of the current function. | createEnterChildFunction(functionName) {
const { childFunction, functionName: realFunctionName } = this.createChildFunction(functionName);
this.currentFunction = childFunction;
// Return its full minecraft name
return realFunctionName;
} | [
"createChildFunction(functionName, parentFunction = this.currentFunction) {\n if (!parentFunction) {\n throw Error('Entering child function without registering a root function');\n }\n const { name: childName, fullName, fullPathWithNamespace } = this.getUniqueChildName(functionName, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Active les clusterers (car, moto, collection) avec leurs options | function enableClusterers() {
clusters.moto = {
gridSize: 50,
styles: [
{textColor: 'white', url: '/media/ui/img/map/cluster-blue.png', height: 33, width: 33},
{textColor: 'white', url: '/media/ui/img/map/cluster-blue.png', height: 33, width: 33},
{textColor: 'white', url: '/media/ui/img/map/cluste... | [
"function chip_has_clusters(options)\n{\n return asPromise.call(this, Clusters.getClusters().then(clusters => !!clusters.length));\n}",
"function chip_has_client_clusters(options)\n{\n return asPromise.call(this, Clusters.getClientClusters().then(clusters => !!clusters.length));\n}",
"get isCluster() {\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Escapes HTML in the label when true. | get escapeLabelHTML() {
return false;
} | [
"function xrxCreateEscapedTag(label, type, value) \n{\n if (type == \"\") {\n return (\"<\" + label + \">\" + value + \"</\" + label + \">\");\n }\n else {\n return (\"<\" + label + \" \" + type + \">\" + value + \"</\" + label + \">\");\n }\n}",
"function renderL... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
AUDIO COMMANDS CSI 1 ... _ ========================== CSI 1 ; 0 ; n ; t ; hex3 '_' : define audio object n = audio number; 164 t = type: 0 = url : unicode encoded characters 1 = UTF8 url : hex3 encoded 2 = raw UTF8 mp3 : hex3 encoded 3 = raw UTF8 mp3 deflated : hex3 encoded 4 = raw UTF8 mp3 Base64: hex3 encoded ( data;... | defineAudioObject(n, type, encoded, asSequence = false) {
return this._seqOrWrite(`${CSI}1;0;${n};${type};${encoded}_`, asSequence);
} | [
"function audioString(someNum, someArray){\n var tempNum, curAudio1, curAudio2, curAudio3;\n \n // Multiply current round by 3 to target correct answers\n tempNum = someNum * 3;\n \n // Create 3 Audio strings\n curAudio1 = 'Audio/Speech_' + someArray[tempNum] + '.mp3';\n tempNum++;\n \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check card s of type t against checkPlayer's no arrays return 1 if card is not present in array, returns index of card if present | function checkNoArrays(checkPlayer,t,s)
{
switch(t)
{
case "suspect":
return players[checkPlayer].suspects.no.indexOf(s);
case "weapon":
return players[checkPlayer].weapons.no.indexOf(s);
case "room":
return players[checkPlayer].rooms.no.indexOf(s);
default:
console.log("error");
return 0;
}
} | [
"indexOf(card){\n for (let i = 0; i < this.piles.length; i++){\n if (this.piles[i].indexOf(card) !== -1){\n return i;\n }\n }\n return -1;\n }",
"checkThreeKind(cardArray){\n var scoreCardArray = [];\n var cardcount=0;\n for(var i =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check to see if we're already in a help session | function ExistingHelpSessionCheck() {
var page = location.pathname.substring(1);
// Little hack to remove the cookie if we're loading the first page
// would need something better to be more generic
if ((page == "index.html") || (page == PageLocation)) {
SetCookie(CookieName, "", 1);
return;
}
va... | [
"hasHelp() {\n return this._help !== \"\"\n }",
"static HasHelpForObject() {}",
"function popupHelp()\n{\n if (helpElt)\n {\n if (!helpElt.helpAlreadyDisplayed)\n { // help for this element never displayed\n displayHelp(helpElt);\n helpElt.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setCurrencyPrefix Sets the symbol that precedes currency. cp The symbol | function setCurrencyPrefixNF(cp)
{
this.currencyPrefix = cp;
} | [
"function setCurrencyPrefixNF(cp)\r\n{\r\n\tthis.setCurrencyValue(cp);\r\n\tthis.setCurrencyPosition(this.LEFT_OUTSIDE);\r\n}",
"function CP_setCssPrefix(val) { \r\n\tthis.cssPrefix = val; \r\n}",
"static setCurrencySign(value) {\n this.currencySign = value;\n }",
"function setCurrencyPositionNF(cp)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reverses a path if it is travelled in reverse. | function invertPath(path) {
var newPath = {
'from': path.to,
'to': path.from,
'path': path.path.map(invertPathOpcode) // Shallow copy
};
newPath.path.reverse(); // Don't forget to reverse the actual order of the opcodes
return newPath;
} | [
"reversePaths() {\n // negate the `reverse` property\n this.reverse = !this.reverse;\n // Sync the `reverse` property value with all `strokes` objects\n this.strokes.forEach( s => s.reverse = this.reverse );\n }",
"reversePath() {\n let currentPoint = this.endPoint;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get random quote function. Makes a random number from 06. returns the quote from quotes array according to randomNumber.06 | function getRandomQuote () {
var randomNumber = Math.floor( Math.random () * 7);
return quotes[randomNumber]
} | [
"function getRandomQuote (){\n randomNo = randomNumber(quotes.length);\n return quotes[randomNo];\n}",
"function getRandomQuote() { \n // quotes.length caps max random number\n const randomNumber = Math.floor(Math.random() * quotes.length); \n // console.log(randomNumber); Testing functionality \n return qu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Serialize the paragraph items | serializeParagraphItems(writer, paraItems) {
let previousNode = undefined;
let isContinueOverride = false;
for (let i = 0; i < paraItems.length; i++) {
let item = paraItems[i];
let isBdo = false;
if (item.characterFormat) {
isBdo = !isNullOrUnd... | [
"serializeParagraphFormat(writer, paragraphFormat, paragraph) {\n if (!isNullOrUndefined(paragraphFormat.styleName)) {\n writer.writeStartElement(undefined, 'pStyle', this.wNamespace);\n writer.writeAttributeString('w', 'val', this.wNamespace, paragraphFormat.styleName);\n wr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if they have a benefiting church set in their cookies or share_code in url, and sets it | function checkHasBenefitingChurch() {
var supportingChurch = $.cookie('supporting_church');
if (supportingChurch) {
var org = $.parseJSON(supportingChurch);
if (typeof org === 'object') {
/**
* Update the org settings
*
**/
$.getJSON... | [
"function setBenefitingChurch(org, closeFancybox) {\n $.cookie('supporting_church', JSON.stringify(org));\n currentOrganization = org;\n var ogImage = $('meta[property=\"og:image\"]').attr('content');\n var shareURL = location.protocol + '//' + location.host + location.pathname + '?gamify_token=' + org.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Keeping a moving average of pageloadtimes for successful verification epochs. | function set_page_load_time(plt) {
var t = total_verification_page_loads * page_load_time;
total_verification_page_loads += 1;
page_load_time = (t + plt)/total_verification_page_loads;
console.log("APPU DEBUG: Current average page-load-time: " +
page_load_time + " ms (total verification page loads:" +
... | [
"flush() {\n const actualEpochs = this.epochs - this.skipN;\n const avgTimings = this.timings.map((x) => x / actualEpochs);\n this.timings.fill(0);\n this.epochs = 0;\n return {\n epochs: actualEpochs,\n elpased: avgTimings\n };\n }",
"static calculateAverageTurnaroundTime() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GETTERS & SETTERS Set WAD Folder | function setWadFolderDir(path)
{
var wadPath = path;
var bytes = new air.ByteArray();
bytes.writeUTFBytes(wadPath);
air.EncryptedLocalStore.setItem("wadFolder", bytes);
return true;
} | [
"set folderURIs(val) {\n Services.prefs.setCharPref(this._prefName, JSON.stringify(val));\n return val;\n }",
"function Folder() { }",
"get folder() {\r\n return new Folder(this, \"folder\");\r\n }",
"function wadSelect() {\n\n var folder = new air.File();\n folder.addEventListener(air.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
purge old calls from active call set every 10 mins | async function purge() {
try {
const count = await purgeCalls();
logger.info(`purged ${count} calls from realtimedb`);
} catch (err) {
logger.error(err, 'Error purging calls');
}
setTimeout(purge, 10 * 60 * 1000);
} | [
"function expireCalls() {\n var i, callback,\n timenow = new Date().getTime();\n\n for (i = currentCalls.length - 1; i >= 0; i -= 1) {\n if ((currentCalls[i].sent + 60000) < timenow) {\n console.log('Expiring call id ' + currentCalls[i].id + ' : no response received');... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a pointer 'ptr' to a nullterminated UTF32LEencoded string in the emscripten HEAP, returns a copy of that string as a Javascript String object. | function UTF32ToString(ptr) {
var i = 0;
var str = '';
while (1) {
var utf32 = HEAP32[(((ptr) + (i * 4)) >> 2)];
if (utf32 == 0)
return str;
++i;
// Gotcha: fromCharCode constructs a character from a UTF-16 encoded code (pair), not... | [
"function AsciiToString(ptr){var str='';while(1){var ch=HEAPU8[ptr++>>0];if(!ch)return str;str+=String.fromCharCode(ch);}}// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',",
"function __getString(ptr) {\n if (!ptr) return null;\n const buffer = memory.buffer;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize form fields from query parameter values if attribute 'datainitializefromurl' is present on the form and attribute 'dataallowinitialization' is present on the field. | maybeInitializeFromUrl_() {
if (
isProxyOrigin(this.win_.location) ||
!this.form_.hasAttribute('data-initialize-from-url')
) {
return;
}
const valueTags = ['SELECT', 'TEXTAREA'];
const valueInputTypes = [
'color',
'date',
'datetime-local',
'email',
'h... | [
"function setDataIntoForm() {\n\n const allParams = getFormParamsFromUrl();\n\n checkParamsWithDefaults(allParams);\n\n setInput(\"account_plan\", queryParamsFromUrl.account_plan);\n setInput(\"account_type\", queryParamsFromUrl.account_type);\n}",
"function setFormFields() {\n var query = querystrin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
random element from a list | function rand_element(list){ return list[Math.floor(Math.random() * list.length)]; } | [
"function randomElement(list) {\n return list[Math.floor(Math.random() * list.length)];\n }",
"function randomElement(list) {\n return list[Math.floor(Math.random() * list.length)];\n}",
"function randomItem(list)\n{\n\treturn list[Math.floor(Math.random() * list.length)]\n}",
"function pickRando... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if all cards are in the same suit. | function detectSameSuit(hand)
{
const suit = hand[0].suit;
for (let i = 1; i < hand.length; i++)
{
if (hand[i].suit !== suit)
{
return false;
}
}
return true;
} | [
"function sameSuit (cards) {\n return suits.some(suit => cards.every(card => card.suit === suit))\n}",
"isSuited() {\n let suites = this.hand.reduce((acc, card) => {\n card.suite === \"h\" ? ++acc.hearts :\n card.suite === \"c\" ? ++acc.clubs :\n card.suite === \"s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gives the borne object from an id | async function getBorne(id) {
let borne = await db.bornes.findOne({ where: { id: id } });
return borne;
} | [
"objectById(id) {\n return this.world.queryObject({ id, instanceType: DynamicObject })\n }",
"function findById(id) {\n return db(\"Bids\").where(\"id\", id).first()\n}",
"static findById(id) {\n return this.all.find(breed => breed.id === id);\n }",
"function get_boat(id) {\n const key = g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getPrevIndex() Returns the previous index in a collection. | getPrevIndex() {
errors.throwNotImplemented("getting the previous index in a collection");
} | [
"async getPreviousIndex() {\n const swiper = await this.getSwiper();\n return swiper.previousIndex;\n }",
"async getPreviousIndex() {\r\n const swiper = await this.getSwiper();\r\n return swiper.previousIndex;\r\n }",
"getPrevIndex(index) {\n errors.assertArgCount(arguments,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
let killerRabbit = Object.create(protoRabbit); killerRabbit.type = "killer"; killerRabbit.speak("SKREEEE!"); CLASSES | function makeRabbit(type) {
let rabbit = Object.create(protoRabbit);
rabbit.type = type;
return rabbit;
} | [
"function makeRabbit(type){\n let rabbit = Object.create(protoRabbit);\n rabbit.type = type;\n return rabbit;\n}",
"constructor (proto) {\n this.proto = proto;\n }",
"function constructors() {\n function Rabbit(type) {\n // type is an INSTANCE variable, it is NOT part of the object referenced b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a new set to the GUI A download dialog will be created if none exists yet. The actual adding to the UI will happen in the onDownloadDialogLoad callback, because the dialog should first be constructed | function addSetToGui(setId)
{
if (!downloadDialog || downloadDialog.closed)
{
var window = Services.wm.getMostRecentWindow(null);
if (!window)
{
logError("Failed to find the main window to open download dialog");
return;
}
// open the download dialog
downloadDialog = window.ope... | [
"function showManageSetDialog() {\n var projectId = getQueryVariable(\"projectId\");\n var dtitle = \"Manage Sets\";\n var link = \"index.php?id=35&projectId=\" + projectId;\n var dialog = $('<div><img src=\"/test/assets/templates/genrep/images/indicator.gif\" /></div>')\n .load(link)\n .dialog({\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
;import PaginaIni from '../../Pages/Home'; import Pedido from './Pages/Pedidos'; import Mudar from './Pages/PastaMudar'; import Produtinhos from './Pages/PastaProdutinhos'; import Produtos from '../Pages/Produtos'; | function Rotas() {
return (
<Switch>
<Route exact path="/" component={PaginaIni} />
{/* <Route exact path="/" component={Produtos} /> */}
<Route exact path="/PaginaIni" component={PaginaIni} />
<Route exact path="/Produtos" component={Produtos} />
... | [
"_pageChanged(page) {\r\n\r\n switch (page) {\r\n case 'login':\r\n import('./login-form.js');\r\n break;\r\n case 'home':\r\n import('./home-page.js');\r\n break;\r\n case 'about':\r\n import('./about-page.js');\r\n break;\r\n case 'admin':\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns next project in sequence using the current pages data as reference | function returnNextPg(page_data){
// Look into projects and get keys
var keys = Object.keys(projects);
//define the size for last project case
var size = keys.length;
// SETS INDEX OF NEXT PAGE
// if last in sequence, next project is the first
if(page_data.index == (size - 1) ){
var next = 0;
}
el... | [
"function setNextProject() {\n projects[currentTemplate].isDisplayed = false;\n\n if (loc < (projectKeys.length - 1)) currentTemplate = projects[projectKeys[loc + 1]].templateName;\n else currentTemplate = projects[projectKeys[0]].templateName;\n\n projects[currentTemplate].isDisplayed = true;\n loc ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Static method to generate a hash passing the timestamp, lastHash and data | static hash(timestamp, lastHash, data, nonce, difficulty) {
return ChainUtil.hash(`${timestamp}${lastHash}${data}${nonce}${difficulty}`).toString();
} | [
"generateHash() {\n return sha256(\n this.index\n + this.previousHash\n + JSON.stringify(this.data)\n + this.timestamp\n + this.nonce\n ).toString()\n }",
"calculateHash() {\n signale.info(\"|> Calculate hash..\");\n const secret =\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the data from db.raw() to DataSet type! | all() {
return Util_1.default.toDataset(this.data);
} | [
"function getRawDataDB () {\n return rawData\n}",
"function getData(){\r\n\treturn db.Execute('SELECT * FROM sampleTable');\r\n}",
"function DataSet () {\n this.all();\n }",
"function convertResultSetData(rows) {\n let resultArray = [];\n rows.forEach(element => resultArray.push(element));\n ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a list of study IDs, extract Study Details. | extractStudyDetails(studiesIntersected) {
var localSearchResultsStudies = [];
for (var i = 0; i < studiesIntersected.length; i++) {
var studyHit = this.studyDict[studiesIntersected[i]];
localSearchResultsStudies.push({
resultType: "study",
id: studyHit.studyId,
title: studyHi... | [
"static getStudyInSession(opencgaSession, studyId) {\n let study = {};\n for (const p of opencgaSession?.projects) {\n for (const s of p.studies) {\n if (s.id === studyId || s.fqn === studyId) {\n study = s;\n break;\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates empty config object | static getEmptyCfgObj() {
return new CfgObject();
} | [
"static empty() {\n return new Config({\n extends: [],\n rules: {},\n plugins: [],\n transform: {},\n });\n }",
"clear() {\n this._config = {};\n }",
"static makeDefault() {\n return new Config(ModelType.MODEL3, BasicLevel.LEVEL2, CGChip.LO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Limpia la columna de validacion de la lista de clientes. | function limpiarMensajesValidacion(){
var indexValidacion = 2;
//tomamos la lista actual del rowset
var listaClientes = listado1.datos;
//realizamos la tranformaion
for (var i=0; i < listaClientes.length; i++){
//limpia el el mensage de validacion
listaClientes[i][indexValidacion] = "";
... | [
"function criarLinhaCliente(cliente){\n const linha = criarElemento('tr');\n linha.incluirFilho(criarElemento('td').adicionarTexto(cliente.id));\n linha.incluirFilho(criarElemento('td').adicionarTexto(cliente.nome));\n const cpf = formatarCPF(cliente.cpf);\n linha.incluirFilho(criarElemento('td').adicionarText... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `ConfluenceSpaceToIndexFieldMappingProperty` | function CfnDataSource_ConfluenceSpaceToIndexFieldMappingPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected... | [
"function CfnDataSource_ConfluencePageToIndexFieldMappingPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper method to create a dictionary where the key is the line number and the value is a list of comment id's that are associated with this line number. | static processData(comments) {
const commentDictionary = {};
for (let i = 0; i < comments.length; i++) {
const comment = comments[i];
const commentRange = comment.line_range.split(",");
for (let i = 0; i < commentRange.length; i++) {
if (commentRange... | [
"static _gatherPreflightCommentStrings(model, startLineNumber, endLineNumber) {\n model.tokenizeIfCheap(startLineNumber);\n const languageId = model.getLanguageIdAtPosition(startLineNumber, 1);\n const config = languageConfigurationRegistry_1.LanguageConfigurationRegistry.getComment... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
open source defaults file in an Atom editor | openDefaults() {
atom.workspace.open(this.defaultsPathname)
} | [
"function createDefaultSettings(){\n\n atom.config.set(\"ti-atom.url\", \"http://\");\n atom.config.set(\"ti-atom.id\", \"my.app.id\");\n atom.config.set(\"ti-atom.copyright\", \"Copyright 2014\");\n atom.config.set(\"ti-atom.publisher\", \"My Company\");\n\n // platforms\n atom.config.set(\"ti-atom.cre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change Theme and Toggle "Appearance" display. In Theme holder | function themeChanger(theme) {
setTheme(theme)
setAppearanceDisplay(!appearanceDisplay)
} | [
"toggleTheme() {\n this.isNightTheme ? this.setDayTheme() : this.setNightTheme();\n }",
"toggle() {\n const newTheme = this.nextTheme;\n this._setTheme(newTheme);\n this.props.setCachedTheme?.(newTheme);\n }",
"function themeChange() {\n if (document.documentElement.hasAttribute('theme'))... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
user presses bet one button. Adds one to coinsPlayed if it is not at max(3). It updates the total coins label but not the variable. This is because we want to decrement the total everytime the user presses the spin button not just when they bet a coin. | function betOne() {
//if player has coins and is not at max
if(coins != 0 && coinsPlayed < 3) {
coinInsertSound.play();
coinsPlayed++;
}else if(coins != 0 && coinsPlayed == 3) { //if user has max 3 coins played change to 1
coinInsertSound.play();
coinsPlayed = 1;
}
//formats the position of t... | [
"function betOne(){\n you.betCount += 1;\n you.coinCount -= 1;\n document.querySelector('.h-bet').textContent = 'your bet: ' + you.betCount;\n}",
"function betClick(e) {\n if (e.target.textContent === 'spin!') return;\n var number = {\"five\": 5, \"ten\": 10};\n var allIn = currentCredits;\n if (e.target.i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ensures the value of the 'control' is a long number. No point of validating range, as in js max and min values seem to be smaller than in Java: [9223372036854776000;9223372036854776000] // isNumber = (isNumber && input = longMinValue); | function validateIsLongNumber(control, message, showMessage)
{
var isNumber=true;
if (control != null)
{
var input = control.value;
var validChars = "0123456789";
var char;
var longMaxValue = 9223372036854775807;
var longMinValue = -9223372036854775808;
for (var i = 0; i < ... | [
"function lonMinValidation(val, id) {\n\tvar NumericVal = val;\n\tif (NumericVal < 0 || NumericVal > 59 || NumericVal == \"\" || NumericVal == null) {\n\t\tjAlert(\"Invalid Longitude minutes : \" + NumericVal);\n\t\tshowAttributesPopup();\n\t\treturn false;\n\t} else {\n\t\tupdateWpArray(id, val);\n\t}\n}",
"func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Automated Testing clear the request/response | function resetReqRes() {
document.getElementById("httpRequest").innerHTML = null;
document.getElementById("httpResponse").innerHTML = null;
} | [
"reset() {\n this.responses.splice(0);\n this.stub.resetHistory();\n }",
"static clear() {\n this.resp = {};\n }",
"resetResponseHolder() {\r\n\t\tthis.responses = [];\r\n\t}",
"reset() {\n this.router.clear();\n this.calls.clear();\n }",
"function resetHttpSpy () {\n fakeHttp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Use `callback` to request user input from all git strategies. | setPromptCallback(callback) {
this.git.getImplementers().forEach(strategy => strategy.setPromptCallback(callback));
} | [
"function callback() {\n console.log(\"github-auth called back! \\\\o/\");\n\n // TODO: Set $:/status/OAuth/UserName et al\n}",
"function getUserInput(event){\n var userInput = document.getElementById(\"user-input-field\").value;\n console.log(\"User typed in: \" + userInput);\n var requestURL = 'https://api... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Outputs a parse tree given a string | function outputParseTreeForString(input, rule) {
let ast = myna.parse(rule, input);
let html = markdownAstToHtml(ast, []);
console.log(html.join(""));
} | [
"function printTree(html) {\r\n html = html.match(/<[a-z]+|<\\/[a-z]+>|./ig);\r\n if (!html) return '';\r\n var indent = '\\n', tree = [];\r\n for (var i = 0; i < html.length; i += 1) {\r\n var token = html[i];\r\n if (token.charAt(0) === '<') {\r\n if (token.charAt(1) === '/') { //dedent on close ta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate multiple html cucumber report | static generateHTMLReport(capabilities) {
const os = require("os");
report.generate({
jsonDir: path.resolve('./test/'),
reportPath: path.resolve('./test/'),
metadata: {
browser: {
name: capabilities.get('browserName'),
... | [
"static createHTMLReport() {\n try {\n reporter.generate(cucumberReporteroptions); //invoke cucumber-html-reporter\n } catch (err) {\n if (err) {\n console.log('Failed to save cucumber test results to json file.');\n console.log(err);\n }\n }\n }",
"function generateReport(h... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
connect to mongo directly to create the fake plugin, along with version info | connectToMongo (callback) {
if (this.mockMode) {
return callback(); // not applicable in mock mode
}
// set up the mongo client, and open it against the versionMatrix collection
this.mongoClientFactory = new MongoClient({ collections: ['versionMatrix'] });
(async () => {
try {
this.mongoClient = a... | [
"mongo() {\n this.mongoConnection = mongoose.connect(process.env.MONGO_URL, {\n useNewUrlParser: true,\n useFindAndModify: true,\n });\n\n // DO NOT FORGET to execute it in this.init()\n }",
"function installMongoTest(req, res, template, block, next) {\n\n if (calipso.config.get('installed'))... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a list of nodes, a function that returns neighbors of a node, and a mapping of the neighbor nodes to their weights, this function returns a mapping of the input nodes to their calculated barycenters. The barycenter values are the average weights of all neighbors of the node. If a node has no neighbors it is assig... | function barycenters(nodes, neighbors, weights) {
var bs = {}; // barycenters
nodes.forEach(function(u) {
var vs = neighbors(u);
var b = -1;
if (vs.length > 0)
b = sum(vs.map(function(v) { return weights[v]; })) / vs.length;
bs[u] = b;
});
return bs;
} | [
"function barycenters(nodes, neighbors, weights) {\n var bs = {}; // barycenters\n\n nodes.forEach(function(u) {\n var vs = neighbors(u);\n var b = -1;\n if (vs.length > 0)\n b = util.sum(vs.map(function(v) { return weights[v]; })) / vs.length;\n bs[u] = b;\n });\n\n return bs... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enriches given schema with given configuration objects puts config into correct places in schema. | enrichSchemaWithConfig(schema, config) {
return mergeWith(schema, config, (currentSchema, currentConfig, key) => {
if ((key === 'properties' || key === 'items') && !currentSchema) {
console.warn(`config => ${JSON.stringify(currentConfig, (configKey, value) => {
if... | [
"enrichSchemaWithConfig(schema, config) {\n return _.mergeWith(schema, config, (currentSchema, currentConfig, key) => {\n if ((key === 'properties' || key === 'items') && !currentSchema) {\n console.warn(`config => ${JSON.stringify(currentConfig, (configKey, value) => {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
external neg: t > t Provides: ml_z_neg const Requires: bigInt, ml_z_normalize | function ml_z_neg(z1) {
return ml_z_normalize(bigInt(z1).negate());
} | [
"function cneg(z) {\n return cmult(MinusOne, z);\n}",
"function ml_z_sign(z1) {\n return bigInt(z1).compare(bigInt.zero);\n}",
"function ml_z_lognot(z1) {\n return ml_z_normalize(bigInt(z1).not());\n}",
"function ml_z_abs(z1) {\n return ml_z_normalize(bigInt(z1).abs());\n}",
"function ml_z_sub(z1, z2) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Diff two text nodes and update the element. | function diffText (previous, current, el) {
if (current !== previous) el.data = current
return el
} | [
"function diffText (previous, current, el) {\n if (current.data !== previous.data) el.data = current.data\n }",
"function diffText (previous, current, el) {\n if (current.data !== previous.data) el.data = current.data\n return el\n }",
"function diffText(previous, current, el) {\n if (curren... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Recommends a blocks per beat value based on the quantization errors of each track. | function recommendBPB() {
let lowestQuantizeError = Infinity;
let bestBPB = 0;
for (let i = 0; i < 8; i++) { // Iterate to 8 for now, maybe double for when semisolid technique becomes a thing
let total = 0;
for (let j = 0; j < midi.trks.length; j++) {
if (!level.noteGroups[j] || level.noteGroups[j].isVisible)... | [
"computeThirdBeat(first_beat, fourth_beat) {\n let newVel = this.chooseRandom(this.#thirdVelocity);\n let newOn;\n let newOff;\n let newQueue;\n\n let candidates = []; //Set of possible candidates\n let third_set = [];\n\n if (key.isMajor()) {\n major.forEach((interval, i) => {\n ca... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns 'remote' if peerType is 'local', and 'local' otherwise. | function getOtherPeerType(peerType) {
if (peerType === 'local') {
return 'remote';
}
return 'local';
} | [
"get peerType() {\r\n return getPeerType(this.message.peer_id);\r\n }",
"function getPeerName(peerConnection) {\n return (peerConnection === localPeerConnection)\n ? 'localPeerConnection'\n : 'remotePeerConnection'\n}",
"function getPeerName(state, peerConnection) {\n return peerConnection ===... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CHANGE HERE: Place your custom code working with PC/SCLite client API here: | function runPcscLiteDemo(callback) {
goog.log.info(logger, 'Starting PC/SC-Lite demo...');
goog.log.setLevel(GSC.PcscLiteClient.Demo.logger, goog.log.Level.FINE);
GSC.PcscLiteClient.Demo.run(
api,
function() {
goog.log.info(logger, 'PC/SC-Lite demo successfully finished');
... | [
"function mm_getAPI()\n{\n}",
"function CCAPI()\r\n{\r\n\t/* Content Communication API Events sent from ESP to the content */\r\n\tCCAPI.EVT_querySAS \t\t\t= \"EVT_querySAS\";\r\n\tCCAPI.EVT_queryPrintDescription \t= \"EVT_queryPrintDescription\";\r\n\tCCAPI.EVT_print \t\t\t= \"EVT_print\";\r\n\tCCAPI.EVT_slideLo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a new scene and save | addNewScene(scene) {
this.scenes.push(scene)
this.saveToFile()
} | [
"saveScene(scene) {\n if (this.getSceneById(scene.id) === null) {\n this.addNewScene(scene)\n return\n }\n\n this.overwriteScene(scene.id, scene)\n }",
"function saveScene() {\n pushGet(compressSceneData(JSON.stringify(toObject())));\n}",
"function saveScene() {\n var result = scene.to... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is the function that deals with the try again buttons so it allow us to clean the input for caculating another interest | function again(){
principal.value = '';
time.value = '';
rate.value = '';
result.value = '';
} | [
"function processInput(){\r\n\tvar currentInput = input.value;\r\n\tinput.value = \"\";\r\n\r\n\tif(validInputs.indexOf(currentInput) == -1 ) {\r\n\t\tmessage.innerHTML = \"Aw try again\";\r\n\t}\r\n\telse {\r\n\t\tresponses [validInputs.indexOf(currentInput)];\r\n\t\tmessage.innerHTML = responses [validInputs.inde... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
in milliseconds. The callback which was binded to the discoverCharacteristics event in line 155 of the main code. Here we read the characteristics and bind them to their respective callback functions. | function accelCallback(error, characteristics) {
if (error) {
console.log("Error discovering ACCEL characteristics!");
}
else {
console.log('Successfully discovered characteristics of ACCEL service!');
//Depending on the UUID of the characteristic, we distinguish X,Y,Z coordinates
for (var i in ch... | [
"function gotCharacteristics(error, characteristics) {\n if (error) console.log('error: ', error);\n console.log('characteristics: ', characteristics);\n\n // Check if myBLE is connected\n isConnected = myBLE.isConnected();\n\n // Add a event handler when the device is disconnected\n myBLE.onDisconnected(onDi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |