query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Get the local file as an array buffer. | function getFileBuffer() {
var deferred = jQuery.Deferred();
var reader = new FileReader();
reader.onloadend = function (e) {
deferred.resolve(e.target.result);
}
reader.onerror = function (e) {
deferred.reject(e.target.error);
}
reader.rea... | [
"function getFileBuffer() {\n var deferred = jQuery.Deferred();\n var reader = new FileReader();\n reader.onloadend = function (e) {\n deferred.resolve(e.target.result);\n }\n reader.onerror = function (e) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A helper function that takes TypeScript diagnostic errors and returns an error object. | function getError(diagnostics) {
let message = 'Declaration generation failed';
diagnostics.forEach(function (diagnostic) {
// not all errors have an associated file: in particular, problems with a
// the tsconfig.json don't; the messageText is enough to diagnose in those
// cases.
if (d... | [
"_error(err, e) {\n vscode.window.showWarningMessage(e)\n return { err, e }\n }",
"function jsErrorToError(err) {\n return {\n ctor: \"_Tuple2\",\n _0: { ctor: err.name },\n _1: err.message\n };\n}",
"function getErrorObj(){\n\t\t try{ throw Error(\"\")}catch(err){... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function for setting up the deathPercentage slider, required by JQueryUI to attach handlers | function setDeathPercentageSlider() {
var handleA = $(".deathPercentage-rate-slider.lower-handle");
var handleB = $(".deathPercentage-rate-slider.upper-handle");
$('.deathPercentage-slider').slider({
create: function (e, ui) {
handleA.text(0);
handleB.text(0.70);
},
... | [
"function updateDeathPrecentSlider(valA, valB){\n $('.deathPercentage-slider').slider(\"values\", 0, valA)\n $(\".deathPercentage-rate-slider.lower-handle\").text(valA)\n $('.deathPercentage-slider').slider(\"values\", 1, valB)\n $(\".deathPercentage-rate-slider.upper-handle\").text(valB)\n}",
"functi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends the dashboard data to the Firebase Server | function sendDataToFirebase(){
var currentURL = "https://mmap.firebaseio.com/";
var dataLink = getTeam()+"/"+getName();
currentURL += dataLink;
Logger.log(currentURL);
var database = getDatabaseByUrl(currentURL, "rs4XlisWL1eJNTdWkuUx9LrYdH8b8xilyerrJz5B");
var data = database.getData() || def;
... | [
"async postHTTPDataToFirebase(id, data) {\n this.log.verbose(`HeartbeatService.postHTTPDataToFirebase(): Posting heartbeat for project with id: ${id}`);\n this.firebaseService.postHTTPDataToFirebase(id, data);\n }",
"function uploadStats() {\n let data = device.updateTelemetry();\n console.log('Devic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add an accommodation to local storage | function setDetails(accommodation) {
var storedAccommodation = getAllAccommodation() || [];
if(!isFavourite(accommodation.id)) {
storedAccommodation.push(accommodation);
localStorage.setItem('accommodation', JSON.stringify(storedAccommodation));
}
} | [
"function addToLocal(id, expense, date, amount) {\r\n let data = getData();\r\n\r\n let dataObj = {\r\n id,\r\n expense,\r\n date,\r\n amount\r\n };\r\n data.push(dataObj)\r\n\r\n localStorage.setItem(\"Expense\", JSON.stringify(data))\r\n}",
"function addExpensesToLocal... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Accessors Sets the entity metadata of this table metadata. Note that entity metadata can be set only once. Once you set it, you can't change it anymore. | set entityMetadata(metadata) {
if (this._entityMetadata)
throw new EntityMetadataAlreadySetError(TableMetadata, this.target, this._name);
this._entityMetadata = metadata;
} | [
"get entityMetadata() {\n if (!this._entityMetadata)\n throw new EntityMetadataNotSetError(TableMetadata, this.target, this._name);\n return this._entityMetadata;\n }",
"set metadata(value) {\n this._metadata = value;\n }",
"set metadata(value) {\n Guard.assertValidM... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create n canvases on top of the baseCanvas, insert them into the DOM, and push them into layerArray, and return layerArray. The zIndex is consequtive, up from baseCanvas's zIndex. New canvases have no border or background. | function createLayers (baseCanvas, n, layers) {
var z = baseCanvas.style.zIndex || 0;
layers = layers || [];
for (var i = 0; i < n; ++i) {
var canvas = baseCanvas.cloneNode(true);
canvas.style.position = 'absolute';
canvas.style.top = baseCanvas.style.top;
canvas.style.left = baseCanvas.style.left... | [
"generateLayers() {\n // create the canvas container div\n this.canvasDiv = {};\n this.canvasDiv.element = document.createElement('div');;\n this.canvasDiv.element.setAttribute('style', `width: ${this.width}px; height: ${this.height}px; background: #000000;`);\n this.canvasDiv.element.id = 'domParent... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This manages the lifecycle for the RTSP connection over TCP. Sets _client. Handles receiving data & closing port, called during connect. | _netConnect(hostname, port) {
return new Promise((resolve, reject) => {
// Set after listeners defined.
const errorListener = (err) => {
client.removeListener("error", errorListener);
reject(err);
};
const closeListener = () => {
... | [
"initTcpClient() {\r\n if (!this.tcpClient) {\r\n this.tcpClient = host.createTCPClient()\r\n this.tcpClient.setOptions({\r\n receiveTimeout: TCP_IDLE_TIMEOUT,\r\n autoReconnectionAttemptDelay: TCP_RECONNECT_DELAY\r\n });\r\n\r\n this.tcpClient.on('data', (data) => {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
mock int32 data ten days later | function mockInt32Data(now,coefficient){
let timeStamps = [] // timeStamps
let values = [] // values
for (let i = 0; i < counts; i++) {
const t = now.add(1, 'second')
const ts = t.unix() + 8 * 3600 // timeStamp
timeStamps.push(ts)
if (t.second() >= 20 && t.second() <= 3... | [
"function IntegerValue() {}",
"get intValue() {}",
"function Int(value) {}",
"function testInts(header) {\n function verify(value) {\n var buf = doSerialize(value, header);\n var typeChar = buf[header ? 8 : 0];\n assert((typeChar >= 0x30) && (typeChar <= 0x38));\n assert.equal(doParse(buf, header... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
cancel or save repeated grade | function closeRepeat(save) {
// get reference for grade list
var clsGradeList = document.getElementById("clsRepGrade");
// save the grade
if (save && clsGradeList.selectedIndex > 0) {
// get reference for grade box
var clsGradeBox = document.getElementById("clsRepeatGrade" + repeatWhi... | [
"function remove_grade() {\n localStorage.setItem(\"grade_to_delete\", window.event.target.id)\n document.getElementById(\"updateGrade\").addEventListener(\"click\", function () {\n $('#getUserConfirmation').modal('toggle')\n $('#exampleModal').modal('toggle');\n firebase.auth().onAut... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a message with $0 placeholders replaced by arguments. | function get(key) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
var msg = MESSAGES[key];
if (!msg) throw new ReferenceError("Unknown message " + JSON.stringify(key));
// stringify args
args = parse... | [
"function interpolate( message, args ) {\n\t\t\treturn message.replace( /{([^{}]*)}/g, function( a, b ) {\n\t\t\t\treturn args[ b ];\n\t\t\t} );\n\t\t}",
"formatMessage(msg, args, amount) {\r\n const parts = msg.split(/(\\{\\{(\\d+|n)(:[a-zA-Z]+)?\\}\\})/);\r\n if (parts.length === 1) {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Search Coin By Symbol (ATC, BTC...]) | function searchCoins() {
var textToSearch = document.querySelector("#search-country-by-name").value;
result = coins.filter(({ symbol }) => symbol===(`${textToSearch}`));
showAllCoins(result);
} | [
"function coinFinder(coins, symbol) {\n try {\n // console.log('coinFinder', coins)\n const coinReturn = coins.filter(item => item.symbol === symbol);\n // console.log(coinReturn);\n return Promise.resolve(coinReturn);\n } catch(e) {\n return Promise.reject(e);\n }\n}",
"async handleCoinValues(c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is an experimental follower AI | isAI(){
return !this.player.generated && this.player.isNPC() && this.player.team === Player.TEAM_PLAYER;
} | [
"is_ai() {\n return (this.players[(1 + this.ply) & 1].name == AI);\n }",
"waitingForConfidenceFromPlayer(player) {\n return this.friendConfidence === undefined && this.friend == player;\n }",
"async is_follow() {\n const {id} = this.state;\n const followings = await get_object('@storage_foll... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Run through all tests and detect their support in the current UA. | function testRunner() {
var featureNames;
var feature;
var aliasIdx;
var result;
var nameIdx;
var featureName;
var featureNameSplit;
for (var featureIdx in tests) {
if (tests.hasOwnProperty(featureIdx)) {
featureNames = [];
... | [
"function testRunner() {\n var featureNames;\n var feature;\n var aliasIdx;\n var result;\n var nameIdx;\n var featureName;\n var featureNameSplit;\n var modernizrProp;\n var mPropCount;\n\n for ( var featureIdx in tests ) {\n featureNames = [];\n feature = tests[featureIdx];... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
we're swiping, go back to homescreen and possibly save | handleSwipe(that){
if(that.allowClicks){
if(FileManager.canSave()){
that.allowClicks = false;
FileManager.SaveGame(that, true).then((value)=>
{
//if this is the user's first time swiping back in this session, tell them about how quicksave works
if(that.showQuickSaveTip){
that.justQuick... | [
"function backToStart(event) {\n sessionStorage.setItem(\"wasFinished\", \"finished\");\n location.reload();\n}",
"function backstep() {\n // Idle scanner's don't care.\n }",
"function home() {\n settingsScreen = false;\n if(settings.TZtoggle){\n if(settings.homescreen == 1){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds user dash elements to the DOM | async function addUserDash() {
const dashHtml = await getUserDashHtml();
const dashElement = $(dashHtml);
$(dashElement[2]).change(function () {
if (this.childNodes[1].checked) {
displaySaved = true;
// Populate saved places
displaySavedPlaces();
$('#' + SCROLL_ID).children().each(fu... | [
"function setupDashElement() {\n L.StyleEditor.formElements.DashElement = L.StyleEditor.formElements.FormElement.extend({\n /** create the three standard dash options */\n createContent: function createContent() {\n var uiElement = this.options.uiElement;\n var stroke = L.DomUtil.create('div', 'lea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The info of the team. | get info() {
return this._data.info;
} | [
"function getTeamInfo() {\n return __awaiter(this, void 0, void 0, function* () {\n yield Authentication_1.checkIfCachedUserIdExistsAndPrompt();\n const ctx = Authentication_1.getExtensionContext();\n const teamName = ctx.globalState.get(Constants_1.GLOBAL_STATE_USER_TEAM_NAME);\n con... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a file into the src/app folder Used for injecting files prior to build that we don't want to include in the skyuxtemplate but need to test | function writeAppFile(filePath, content) {
return new Promise((resolve, reject) => {
const resolvedFilePath = path.join(path.resolve(tmp), 'src', 'app', filePath);
fs.writeFile(resolvedFilePath, content, (err) => {
if (err) {
reject(err);
return;
}
resolve();
});
});
} | [
"function writeFiles() {\n this.writeFilesToDisk(angularFiles, this, false, ORIGINAL_ANGULAR_TEMPLATE_PATH); // always originals first\n this.writeFilesToDisk(files, this, false, CURRENT_ANGULAR_TEMPLATE_PATH);\n}",
"function writeFiles() {\n this.writeFilesToDisk(reactFiles, this, false, ORIGINAL_REACT_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Continues the enumeration of dual power controls started using yFirstDualPower(). | function YDualPower_nextDualPower()
{ var resolve = YAPI.resolveFunction(this._className, this._func);
if(resolve.errorType != YAPI_SUCCESS) return null;
var next_hwid = YAPI.getNextHardwareId(this._className, resolve.result);
if(next_hwid == null) return null;
return YDualPower.Fi... | [
"switchGame() {\n this.powerSwitch = !this.powerSwitch;\n this.playSequence([1,3,0,2], 250);\n }",
"function SA_DisableNext() \r\n {\r\n \tDisableNext();\r\n }",
"function auto_next() {\n if (auto) {\n if ($(\"#show-intermediate\").is(\":checked\")) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Age on Venus in years | ageVenus() {
let venusianAge = parseInt(this.ageEarthYears()/0.62); //I am 48 years old
return venusianAge;
} | [
"ageInYears() {\n let currentYear = new Date().getFullYear();\n return currentYear - this.birthYear() - 1;\n }",
"mercuryYears(age) {\n let mercuryAge = age * 0.24;\n return mercuryAge;\n }",
"ageMercury() {\n let mercurianAge = parseInt(this.ageEarthYears()/0.24); //I am 125 years old\n ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Color fulfilled proposal in red and add fulfil to accept list. | function showfulfil(fulfil){
var hash = $.sha256(JSON.stringify(fulfil));
var proposal = proposals[fulfil.proposalhash];
if('undefined' === typeof(proposal)) return;
proposal.row.css('background-color', '#FF9999');
// Add fulfil hash to the accept form.
$('select.fulfilhash').append(
$... | [
"function accept() {\n // Show the passed message.\n console.log(color.greenBright(` [✓] Passed`));\n\n // Process the next specs.\n next();\n }",
"function updateColors(e, r) {\n var element;\n var party = getSenator().party;\n\n // Set background color of droplist of d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Run digest only if it is not currently running. | function safeDigest($scope) {
if (!$scope.$root.$$phase) {
$scope.$digest();
}
} | [
"function digest(){\n if (TASK_STACK.length>0){\n triggerStartLoop();\n }\n }",
"function afterDigest(callback) {\n if (me.scope.$$destroyed) { return; }\n\n // Setup a watch to run once\n _cancelDigestUpdate = me.scope.$watch(function() {\n _cance... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
convenience func to increment icon name if it happens to end in a digit | function incrementIconName(name) {
var last = name.substr(-1);
var lastInt = parseInt(last);
if (last == "9") {
var lastTwo = name.substr(-2);
var lastTwoInt = parseInt(lastTwo);
if (! isNaN(lastTwoInt)) {
return name.substring(0, name.length -2) + (lastTwoInt + 1);
... | [
"function incrementIconName(name) {\n let last = name.substr(-1);\n let lastInt = parseInt(last);\n\n if (isNaN(lastInt)) {\n return name + '-01';\n }\n\n if (last === \"9\") {\n let lastTwo = name.substr(-2);\n let lastTwoInt = parseInt(lastTwo);\n if (!isNaN(lastTwoInt))... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compute data for feeding into TreeMap | function computeSectors(data) {
const result = [];
for (const stock of data) {
if (result.some(e => e.name === stock['sector'])) {
for (let obj of result) {
if (obj['name'] === stock['sector']) {
obj['children'].push({ "name": s... | [
"function buildTreemapJSON(data){\n for(var i = 0; i < data.length; i++){\n var homeTeam = data[i][\"HomeTeam\"];\n var awayTeam = data[i][\"AwayTeam\"];\n if(!isInData(homeTeam, treemapDataHome)){\n addKeyToJSON(homeTeam, treemapDataHome);\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load and setup a rule using current config. | loadRule(ruleId, config, severity, options, parser, report) {
const meta = config.getMetaTable();
const rule = this.instantiateRule(ruleId, options);
rule.name = ruleId;
rule.init(parser, report, severity, meta);
/* call setup callback if present */
if (rule.setup) {
... | [
"function init() {\n console.log(\"rule set :%j\", config);\n return new RuleEngine(config, { ignoreFactChanges: true });\n}",
"function loadRuleBase() {\n\truleBase = require(\"./rules-base\");\n}",
"add(rule) { \n this.rules[rule.type] = rule \n rule.parser = this\n }",
"setAnimationConfi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the equivalent islamic(civil) date value for a give input Gregorian date. `gDate` is a JS Date to be converted to Hijri. | fromGregorian(gDate) {
const gYear = gDate.getFullYear(), gMonth = gDate.getMonth(), gDay = gDate.getDate();
let julianDay = GREGORIAN_EPOCH - 1 + 365 * (gYear - 1) + Math.floor((gYear - 1) / 4) +
-Math.floor((gYear - 1) / 100) + Math.floor((gYear - 1) / 400) +
Math.floor((367 * ... | [
"fromGregorian(gDate) {\n const gYear = gDate.getFullYear(),\n gMonth = gDate.getMonth(),\n gDay = gDate.getDate();\n let julianDay = GREGORIAN_EPOCH$1 - 1 + 365 * (gYear - 1) + Math.floor((gYear - 1) / 4) + -Math.floor((gYear - 1) / 100) + Math.floor((gYear - 1) / 400) + Math.floor((367 * (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stop all the workers | stop() {
if (!this.running) {
return;
}
this.running = false;
for (const worker of this.workers) {
worker.stop();
}
} | [
"stop () {\n if (!this.running) {\n return\n }\n\n this.running = false\n for (const worker of this.workers) {\n worker.stop()\n }\n }",
"stop () {\n this.running = false\n for (const worker of this.workers) {\n worker.stop()\n }\n }",
"terminate() {\n this.worker... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that displays the Table that is used to display the created posts by the user | function displayCreatedPosts(){
//outputing the rows of posts
let display_table = document.getElementById("tableDisplayRow");
let output_rows = "<table class='pure-table' id='historyTable'><thead><th>Post Id</th><th>Post Title</th><th>Post link</th></thead><tbody>";
for (let i = 0; i < created_posts.length; i++... | [
"function TableTemplate () {\n\n}",
"LIST_ALL_POSTS() {\n const posts = globby.sync(['**/posts/**.md'])\n // Make table header\n let md = '| Post | Author | Date |\\n'\n md += '|:--------------------------- |:-----|:-----|\\n'\n posts.reverse().forEach((file) => {\n const str = fs.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
addEnterButtonEventListener() This function sets up the event listener for when the "Enter" button is clicked. It simply calls the callback function with the value in the input box. | function addEnterButtonEventListener(buttonID) {
var button = document.getElementById(buttonID);
$("#" + buttonID).on("touchstart", function(event) {
$("#" + buttonID).focus();
event.preventDefault();
});
$("#" + buttonID).on("touchend", function(event) {
enterFunc();
handled = true;
$( "#"... | [
"function inputEnterPress(input, callback, param1, param2) {\n\t$(input).on(\"keypress\", function(e) {\n\tif(e.which == 13) {\n\tcallback(param1,param2);\n}})}",
"onKeyPressInput(e) {\n\t\tif (e.key === 'Enter') this.executeButton();\n\t}",
"function attachEnterListener(){\n\n $('#input').bind(\"enterKey\",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This takes both the row and its children (collapsible rows) and puts them into one element. It is used only so that the rows can be compared. | compressRows(rows) {
const compressedRows = [];
rows.forEach((row, i) => {
if (row.hasOwnProperty('isOpen')) {
compressedRows.push({ parent: row, child: rows[i + 1] });
}
});
return compressedRows;
} | [
"function duplicateRow(i){\n var original=document.getElementById('0');\n //log(original);\n var row=original.cloneNode(true);\n rowID(row, i);\n //blank values\n var sibling=row.firstElementChild; \n \n sibling=sibling.nextElementSibling.nextElementSibling;\n sibling.firstEle... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
And one to calculate percentage occupancy | function updatePercentOccupancy(regions, totalPeople) {
for (var r in regions)
if (totalPeople > 0)
regions[r].pct_occupancy = regions[r].count / totalPeople;
else
regions[r].pct_occupancy = 0.
} | [
"function percentageOfWorld1(population) {\n return population / 7900 * 100;\n}",
"function calcPercentageInUse(total, available){\n return 100 - calcPercentage(total, available);\n}",
"function percentageOfWorld1 (population) {\n return (population / 7900) * 100;\n}",
"function calculateProsperity()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate service type vertical tab html | function getServiceTypeHtml( ServiceType ) {
var serviceStr = "";
serviceStr += '<div class="row">';
serviceStr += '<div class="col-xs-3">';
serviceStr += '<div>'+ServiceType["service_type_title"]+'</div>';
serviceStr += '</div>';
serviceStr += '<div class="col-... | [
"function CreateVerticalTabs( VerticalObj ) {\n var tabStr = \"\"; var j = 0;\n tabStr += '<div class=\"col-xs-3\">';\n tabStr += '<ul class=\"nav nav-tabs tabs-left\">';\n \n $.each(VerticalObj, function(i, TabVal){\n if(j == 0 ) tabStr += '<li class=\"active\"><a href=\"#'+i+'\" da... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Dialog for the stocks warnings messages. | function StocksWarningsDialog(_warningMessages)
{
Dialog.call(this, "div#stocksWarningsDialog");
this.warningMessages = _warningMessages;
} | [
"function showSummaryWarningDialogue() {\n showDialog({\n title: 'WARNING: Inconsistent data',\n text: 'Elements on this page need correcting: \\nThe aggregated category weights must TOTAL 100 \\nProblem groups highlighted in red.'.split('\\n').join('<br>'),\n negative: {\n title:... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A method that handles the collapsible controllers (e.g. panel). | function handleCollapsibleController() {
jQuery('.control-collapse-link').click(function() {
var $button = jQuery(this).parent('span');
var $target = $button.prev('textarea');
var $mark = jQuery(this).find('i');
$target.slideToggle(200);
$mark.toggleClass('fa-chevron-up').toggleClass('... | [
"function collapsedView() {\n\n //$(\"section\").addClass(\"active\"); // TODO: Are we using this? Should apply to all panel IDs\n\n\t\t// Activate accordion effects to all panel-groups (rcol only)\n\t\t// Works in conjunction with removal of same classes in expandedView()\t \n\t\t$(\".rcol\").children().addCla... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Assign digit to each unit of cell if there is only one place for it. Return true if there are no contradictions and false otherwise. | assignUnits(state, cell, digit) {
for (const unit of S.unitList[cell]) {
let places = unit.map(u => state[u].includes(digit) ? u : false).filter(m => m !== false);
if (places.length === 0) {
this.logMessage("Contradiction: no place for " + digit + " in " + S.unitName(unit... | [
"function checkDigitInRow() {\n for (var i = 0; i < 9; i++) {\n for (var d = 0; d < 9; d++) {\n digitFactor = 0;\n for (var j = 0; j < 9; j++) {\n if ((typeof puzzle[i][j] === 'object' && puzzle[i][j][d]) || (typeof puzzle[i][j] === 'number' && puzz... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the author of this CL. | getAuthor() {
return this.cl_.getAuthor();
} | [
"function get_author_name() {\r\n\tif (this.author != null) {\r\n\t\treturn this.author.getTarget().fullname;\r\n\t}\r\n\treturn \"Unknown\";\r\n}",
"function getAuthor() {\n var hasGit = !exec('which git', { silent: true }).code;\n\n if (!hasGit)\n return exec('whoami').output.trim();\n\n var name = exec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getting session key from backend server | function getsessionkey(){
var xhr = new XMLHttpRequest();
xhr.open("Get", apihost+"/user/getsessionkey", false);
// xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');
xhr.onload = function(event){
if(xhr.status === 200){
// console.log(xhr.response);
sessiondata.sessionkey=xhr.response... | [
"function getSessionKey() {\n if (sk) return sk;\n var api_sig = gen_sig(\"api_key\"+api_key+\"methodauth.getSessiontoken\"+token);\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"http://ws.audioscrobbler.com/2.0/?method=auth.getSession&api_key=\"+api_key+\"&token=\"+token+\"&api_sig=\"+api_sig,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Asserts that the `message` contains exactly one `Container` node. | function assertSingleContainerMessage(message) {
const nodes = message.nodes;
if (nodes.length !== 1 || !(nodes[0] instanceof Container)) {
throw new Error('Unexpected previous i18n message - expected it to consist of only a single `Container` node.');
}
} | [
"function assertSingleContainerMessage(message) {\n var nodes = message.nodes;\n if (nodes.length !== 1 || !(nodes[0] instanceof i18n.Container)) {\n throw new Error('Unexpected previous i18n message - expected it to consist of only a single `Container` node.');\n }\n }",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Disables all shadows for an object and its children. | function disableShadows(object, name, force = false) {
if (!name || object.name.toLowerCase().indexOf(name) > -1 || force) {
object.castShadow = false;
force = true;
}
object.children.forEach((child) => {
disableShadows(child, name, force)
});
} | [
"function disableShadows(object, name, force) {\n if ( force === void 0 ) force = false;\n\n if (!name || object.name.toLowerCase().indexOf(name) > -1 || force) {\n object.castShadow = false;\n force = true;\n }\n object.children.forEach((child) => {\n disableShadows(child, name, force);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets screen layer active class and status flag. | setActive () {
this._active = true;
this.$element.addClass('screenlayer-active');
} | [
"setInactive () {\n\t\tthis._active = false;\n\t\tthis.$element.removeClass('screenlayer-active');\n\t}",
"_updateActiveClasses() {\n toggleClass(this.handleEl, 'active', this.isActive);\n toggleClass(this.el, 'active', this.isActive);\n }",
"function setActiveClass() {\n addClass(this.parentN... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handle the creation of a new game load the game to check it doesn't exist generate the initial game state write the initial game state to the validator | createGame (state, payload, player) {
// first - load the game so we can check it doesn't already exist
return state.getGame(payload.name)
.then((game) => {
// if the game already exists - we cannot create it
if (game) {
throw new InvalidTransaction('Invalid Action: Game alread... | [
"function newGame() {\n GameService.createGame()\n .then(function(created_game) { \n $state.go('game_inprogress', {gameId: created_game.id});\n })\n .catch(function(error) {\n console.log('Failed to create a new game');\n });\n }",
"function loadGame(gameData) {\n const... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructor Creates a new TableMetadata based on the given arguments object. | constructor(args) {
// ---------------------------------------------------------------------
// Private Properties
// ---------------------------------------------------------------------
/**
* Table type. Tables can be abstract, closure, junction, embedded, etc.
*/
... | [
"function TableDataObject(name, columns, rowCount) {\n this.name = name;\n this.columns = columns;\n this.rowCount = rowCount;\n}",
"function Table(database, name) {\n this._afterGenDataFn = function (dataRow) { return dataRow; };\n this.name = name;\n this.database = database;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Secondary sign the add claim transaction | async secondarySignAddClaimTransaction(tx, passport, passphrase) {
return new Promise(async (resolve, reject) => {
const privateKey = await this.getWifFromNep2Key(passport.wallets[0].key, passphrase);
const account = new _neon.wallet.Account(privateKey);
const provider = new... | [
"sign(privKey) {\n //\n // **YOUR CODE HERE**\n //\n this.sig2 = utils.sign(privKey, this.prelimHash());\n }",
"async secondarySignAddClaimTransaction(tx, wallet, reverseScripts) {\n return new Promise(async (resolve, reject) => {\n let account = new _neon.wallet.Account(wallet.priv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If a conflict was found with this pair of records, add the previously processed record to its conflict collection. | function ifConflictedGrabTheseRcrds(procesdIdx, recrdIdx, unqField) {
if (conflicted) {
conflictedAry.push(recrdIdx);
if (conflictedAry.indexOf(procesdIdx) === -1) { conflictedAry.push(procesdIdx); }
}
} | [
"function addConflictMetaData() {\n var conflictedCnt = countRecrdsInObj(conflictedRecrds);\n conflictedCnt === 0 ?\n entityObj.validationResults.shareUnqKeyWithConflictedData = null :\n entityObj.validationResults.shareUnqKeyWithConflictedData = {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Runs the change password flow for the given |player|. They will first have to verify their current password, after which they're able to give a new password. | async changePassword(player) {
const verifyCurrentPassword = await Question.ask(player, {
question: 'Changing your password',
message: 'Enter your current password to verify your identity',
isPrivate: true, // display this as a password
constraints: {
... | [
"async function change_password()\n {\n if (await bookmarks.needs_setup()) { return; }\n\n transition_to(\"authentication\",\n {\n message: browser.i18n.getMessage(\"direction_enter_current_password\"),\n\n on_acceptance: async old_hashed_password =>\n {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attempts to retrieve the kittens string from localstorage then parses the JSON string into an array. Finally sets the kittens array to the retrieved array | function loadKittens() {
let storedKittens = JSON.parse(window.localStorage.getItem("kittens"));
if (storedKittens !== null) {
kittens = storedKittens;
}
} | [
"function loadKittens() {\r\n kittens = JSON.parse(window.localStorage.getItem(\"kittens\"))\r\n if (kittens == null) {\r\n kittens = []\r\n }\r\n}",
"function loadKittens() {\n let kittenData = JSON.parse(\n window.localStorage.getItem(\"kittens\"))\n if (kittenData) {\n kittens = kittenData\n }\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
filter for only latest chapters | _pullOnlyLatestChapters(recentChapters, pastChapters) {
// exit early if not getting a pastChapters list
if (!pastChapters || pastChapters.length === 0) {
return recentChapters;
}
let chapterMatchIndex = 0;
let latestChapters = recentChapters;
if (pastChapters.length > 0) {
const l... | [
"function getBooksByAuthor(byAuthorId) {\n let allBooks= books\n .filter(b=>b.authorId==byAuthorId)\n .sort((book1,book2)=>book1.yearOfPublication-book2.yearOfPublication)\n return allBooks;\n}",
"function loadChapters() {\n return AjaxUtils.loadData(CONTEXT.ctx + '/web/chapter/list.action', {sy... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compares cookies for "key" (name, domain, etc.) equality, but not "value" equality. | function cookieMatch(c1, c2) {
return (
c1.name == c2.name &&
c1.domain == c2.domain &&
c1.hostOnly == c2.hostOnly &&
c1.path == c2.path &&
c1.secure == c2.secure &&
c1.httpOnly == c2.httpOnly &&
c1.session == c2.session &&
c1.storeId == c2.storeId
);
} | [
"function areCookiesEqual(a, b) {\n var sameSiteSame = a.sameSite === b.sameSite;\n if (typeof a.sameSite === 'string' && typeof b.sameSite === 'string') {\n sameSiteSame = a.sameSite.toLowerCase() === b.sameSite.toLowerCase();\n }\n return (hasSameProperties(__assign(__assign({}, a), { sameSite:... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the value fom the 'Title' input field and stores it in the titles array | function storeTitleInputValue() {
var titleValue = titleInputValue.value;
titles.push(titleValue);
} | [
"function getTitle() {\n const title = document.querySelector('#title');\n title.addEventListener('change', (e) => {\n if (title.value !== '') {\n searchBooksObj.partialTitle = e.target.value;\n }\n });\n}",
"get value() {\n return this.title.value;\n }",
"function getMovieTitle() {\n v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
I have found that resizing the maze to the actual client dimension work better. Also the click events use these coordinates | function resizeMaze() {
var jq = $("#maze");
jq[0].width = jq[0].clientWidth;
jq[0].height = jq[0].clientHeight;
} | [
"function resizeMaze(){\n if(divGrid.length === 0){\n return;\n }\n let winWidth = window.innerWidth;\n let formHeight = document.getElementsByTagName(\"form\")[0].offsetHeight;\n let winHeight = window.innerHeight - formHeight;\n let hSize = divGrid.length;\n let vSize = divGrid[0].leng... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Computation: convert pounds to kilograms by dividing pounds by 2.205 and round to the tenths. Output: Return the kilgrams to the output field. | function lbsToKilos() {
//Input
let pounds = parseFloat(document.getElementById("pounds").value);
//Computation
let kilograms = pounds / 2.205;
let digits = 1;
let multiplier = Math.pow(10, digits);
kilograms = Math.round(kilograms * multiplier) / multiplier;
//Output
document.getEle... | [
"function kilosToGrams(kilos){\n return kilos * 1000;\n}",
"function convertKilogramstoPounds(kilosWeight) {\n return kilosWeight*2.205;\n }",
"function calculateKilograms(item){\n var kilograms = item.quantity; \n var units = String(item.unitsOfMeasure);\n if (units.toUpperCase() == \"LBS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function uses a random colour to colour each square when the changeSquareColor function is called on it | function randomColor(){
$('.wrapper > div').remove();
var num = 10
userGridSize(num);
$('.square').css("background-color", "#CFCFCF");
$('.square').hover(function () {
$(this).addClass("color");
randomColorMode();
});
} | [
"function colorSquare(e) {\n if (rainbow == true) {\n let r = getRandomInt(255);\n let g = getRandomInt(255);\n let b = getRandomInt(255);\n color = \"rgb(\" + r + \",\" + g +\",\" + b + \")\";\n this.style.backgroundColor = color;\n }\n else {\n this.style.backgro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array of [Degree, Note] tuples Excluded degrees will also be returned with the Degree.included property set to false. For only included (played) chord degrees, use construct() instead. | constructWithExcluded(accidentalMode = DEFAULT_CHORD_ACCIDENTAL_MODE) {
let out = [];
for (let degree in this.degrees) {
out.push([degree, this.root.getInterval(degree.toString())]);
}
return out;
} | [
"function getChordNotes(p_noteIndex){\n var a_chordNotes = new Array(4); // the notes of a chord\n var v_ctr;\n var v_idx =0;\n\n console.log(\"460 [\" + a_scaleNotes[p_noteIndex] + \"]\");\n for (v_ctr=0; v_ctr<4; v_ctr++) {\n a_chordNotes[v_ctr] = a_scaleNotes[(p_noteIndex + v_idx) % 7];\n v_idx = v_i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the deprecation warning function to be used by this file. This way the Tensor class can be a leaf but still use the environment. | function setDeprecationWarningFn(fn) {
deprecationWarningFn = fn;
} | [
"function setDeprecationWarningFn(fn) {\n deprecationWarningFn = fn;\n}",
"function disableDeprecationWarnings() {\n environment_1.ENV.set('DEPRECATION_WARNINGS_ENABLED', false);\n console.warn(\"TensorFlow.js deprecation warnings have been disabled.\");\n}",
"function disableDeprecationWarnings() {\n (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
retrieves image from server to place in imagemodal | function updateImageModal(){
var filename = $('#browser').children().eq(rightIndex).find('.browser-files-file').text();
var string ='<img src="get-imgs?type='+filename+'" alt="' +filename+'" class= "imageModal-image"></img>';
$('#imageModal').find('.modal-body').empty();
$('#imageModal').find('.modal-bo... | [
"function updateImageModal(){\n\t\tvar filename = $('#browser').children().eq(rightIndex).find('.browser-files-file').text();\n\t\t//alert(filename);\n\t\tvar string ='<img src=\"get-imgs?type='+filename+'\" alt=\"' +filename+'\" class= \"imageModal-image\"></img>';\n\n\t\t$('#imageModal').find('.modal-body').empty... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called automatically when the slider value changes Sends data out on serial | function onSliderOutToSerialValueChanged() {
console.log("Slider:", sliderOutToSerial.value());
if (serial.isOpen()) {
serial.writeLine(sliderOutToSerial.value());
}
} | [
"function reportVal(){\n\tvar val = slider.value();\n\tsocket.emit('report', val);\n}",
"function onRangeMessage(name, value){\n\t\t\tconsole.log(\"Received new range message \", value);\n\t\t\t$(\"#\"+name).slider('refresh', value);\n\t\t}",
"function serialEvent() {\n inData = serial.readLine();\n let split... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Author: Rodrigo Costa Description: Function responsible set/remove a particular categeory from the preferencesArray array. Version: 1.0 | function setPreference(preference){
for (var i = 0; i < preferencesArray.length; i++) {
if (preferencesArray[i] == preference){
preferencesArray.splice(i, 1);
return;
}
}
preferencesArray.push(preference);
return;
} | [
"addGoodPref(pref) {\n let i;\n\n //If the preference is not already in the good array\n if (this.good.indexOf(pref) === -1) {\n //Adds to the good array\n this.good.push(pref);\n }\n\n //If the preference is in the neutral array\n if ((i = this.neutra... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set session to local storage | setSession(value){
localStorage.setItem(this.SESSION, value);
} | [
"saveSessionToLocalStorage() {\n if (!this.idle) {\n this.session.end = new Date()\n }\n localStorage.setItem(LOCAL_STORAGE_SESSION_KEY, JSON.stringify(this.session))\n }",
"function saveSession()\n{\n\n // Only save the session if we're not currently importing a session\n if ( !importing )\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
util function to paint entire canvas of specified color | function paintCanvas(color, context) {
const W = context.canvas.clientWidth;
const H = context.canvas.clientHeight;
context.save();
context.fillStyle = color;
context.fillRect(0, 0, W, H);
context.restore();
} | [
"function paintCanvas(color, context) {\n const W = context.canvas.clientWidth;\n const H = context.canvas.clientHeight;\n context.save();\n context.fillStyle = color;\n context.fillRect(0, 0, W, H);\n context.restore();\n}",
"function fillCanvas(color)\n{\n\tlet save = context.fillStyle;\n\t\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lista de status a partir do enum do schema. | function statusFromEnum (enumValues) {
let status = {};
if (! Array.isArray(enumValues))
return;
enumValues.forEach((option) => {
switch (option) {
case 'alx_disponivel':
status[option] = 'Disponível';
break;
case 'alx_indisponivel':
status[option] = 'Indisponível';
... | [
"function getStatusList() {\n var statusList = [];\n angular.forEach(ctrl.status, function(value, key) {\n if (value) {\n statusList.push(key);\n }\n });\n return statusList;\n }",
"function generateOrderStatusEnum... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
resize clock when div size changed | resizeClock() {
//const th = this;
//let elm = ReactDOM.findDOMNode(th);
//let size = Math.min(window.width, window.height);
//console.log("resizeClock: " + size)
/*th.setState({
cw: size,
ch: size
})*/
} | [
"function updateClockSizes() {\n EventFactory.events.forEach(function(e){EventFactory.setSize(e, window.innerWidth/(isMobile?2.5:13))});\n \n EventFactory.setSize(MainEvent, (isMobile?0.95:.6)*windowHW());\n}",
"function setClockSize() {\n var clock = document.getElementById(\"ringClock\");\n console.l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A HOC that creaes a function that creates breadcrumbs from DOM API calls. This is a HOC so that we get access to dom options in the closure. | function _domBreadcrumb(dom) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function _innerDomBreadcrumb(handlerData) {
let target;
let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;
if (typeof keyAttrs === 'string') {
keyAttrs = [keyAttrs];
}
... | [
"function _domBreadcrumb(dom) {\n\t // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t function _innerDomBreadcrumb(handlerData) {\n\t let target;\n\t let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;\n\n\t if (typeof keyAttrs === 'string') {\n\t keyAttrs =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Saves the line folds in the current full editor before it is closed. | function saveBeforeClose() {
// We've already saved all other open editors when they go active->inactive
saveLineFolds(EditorManager.getActiveEditor());
} | [
"function save() {\n var fold = creasePattern.exportFoldData();\n var file = new File([JSON.stringify(fold, null, 4)], \"miura.fold\", {\n type: \"text/plain;charset=utf-8\"\n });\n (0, _fileSaver.saveAs)(file);\n}",
"function save() {\n\tconst fold = creasePattern.exportFoldData();\n\tconst file = new Fil... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
99 hide future scheduled posts unless "showFuture" is set to true or postedAt is already defined | function hideFuturePosts(parameters, terms) { // 102
//
// var now = new Date(); ... | [
"function displayOlderPost()\r\n{\r\n\tconsole.log(\" -- displayOlderPost -- \");\r\n\tif (m_isOlderPostAvailable != false && m_olderPostIndex != null \r\n\t\t&& m_olderPostIndex != undefined && m_olderPostIndex >= 0)\r\n\t{\r\n\t\tDisplayPostByIndex(m_olderPostIndex);\r\n\t}\r\n\telse\r\n\t{\r\n\t\talert(\"Apologi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
delete added app row | function delete_row_added_app(id) {
$(".row_app" + id + "").html("");
$('.row_app').empty();
} | [
"function deleteButtonPressed () {\n \n // Ensure that a specific entry is selected\n if (selected != 0) {\n \n // Ask confirmation from the user to avoid accidental deletion\n var answer = confirm(\"This entry wil... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Include support for 1119 ('Eleven', 'Twelve', 'Thirteen', ... 'Nineteen'). numToWords(0) > 'Zero' numToWords(43) > 'FortyThree' numToWords(2999) > 'TwoThousandNineHundredNintyNine' numToWords(15) > 'Fifteen' numToWords(2483579411) > 'TwoBillionFourHundredEightyThreeMillionFiveHundredSeventyNineThousandFourHundredEleven... | function numToWords(num) {
const numWords = {
0: "Zero",
1: "One",
2: "Two",
3: "Three",
4: "Four",
5: "Five",
6: "Six",
7: "Seven",
8: "Eight",
9: "Nine",
10: "Ten",
11: "Eleven",
12: "Twelve",
13: "Thirteen",
14: "Fourteen",
15: "Fifthteen",
16: "Sixteen",
17: "Seventeen",
18: "... | [
"function numToWords(number){\n\tvar map1 = [\t\t\t\t\t//Map of Values\n\t\t'',\n\t\t'thousand',\n\t\t'million',\n\t\t'billion',\n\t\t'trillion',\n\t];\n\n\tvar map2 = [\n\t\t'zero',\n\t\t'one',\n\t\t'two',\n\t\t'three',\n\t\t'four',\n\t\t'five',\n\t\t'six',\n\t\t'seven',\n\t\t'eight',\n\t\t'nine',\n\t];\n\n\tvar m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Position element el2 below element el | function placeBelow(el, el2) {
pos=getPos(el);
el2.style.position="absolute";
el2.style.left=pos.x+"px";
el2.style.top=(pos.y+el.offsetHeight)+"px";
} | [
"function placeAbove(el, el2) {\n\tpos=getPos(el);\n\tel2.style.position=\"absolute\";\n\tel2.style.left=pos.x+\"px\";\n\tel2.style.top=(pos.y-el2.offsetHeight)+\"px\";\n}",
"function placeRightTo(el, el2) {\n\tpos=getPos(el);\n\tel2.style.position=\"absolute\";\n\tel2.style.left=(pos.x-el2.offsetWidth)+\"px\";\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetches all breakpoints for a certain instance and calls the provided function. | function loadInstanceBreakpoints(instanceId, successHandler) {
$.ajax({
type: 'GET',
url: '/api/debugger/instances/' + instanceId + '/breakpoints',
success: function(breakpoints) {
if (successHandler)
successHandler.apply(null, [breakpoints, instanceId]);
... | [
"addBreakpoints(url, breakpoints, scripts) {\n const _super = Object.create(null, {\n addBreakpoints: { get: () => super.addBreakpoints }\n });\n return __awaiter(this, void 0, void 0, function* () {\n const responses = yield _super.addBreakpoints.call(this, url, breakpoin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Take a geoserver ajax response object and convert it into what you'd expect: a list of javascript objects. Pulls the response out of the FeatureCollection | function parseGeoserverJson(response) {
function parseId(idStr) {
return idStr.match(/\d*$/)[0] // ex: "layergroup.24" -> "24"
}
var features = Ext.util.JSON.decode(response.responseText).features
return _(features).map(function(feature) {
return _(feature.properties).defaults({
id... | [
"_constructGeoJsonResponse(features) {\n var featureSet = features.map(this._constructGeoJson);\n\n var response = {\n type: 'FeatureCollection',\n features: featureSet\n };\n\n return response;\n }",
"toFeatureCollection(data) {\n const features = data.response.venues.map((venue) =>... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new page of `itemsPerPage` Studens | function addItemsToPage(items, itemsPerPage, starNumber) {
const ul = document.createElement('ul');
ul.className = 'student-list';
ul.style.display = 'none';
for (let i = 0; i < itemsPerPage; i++) {
let index = i + starNumber;
if ((i + starNumber) < items.length) {
ul.appendChild(items... | [
"function create_page()\r\n {\r\n scope.big_total_items = scope.data_base.length;\r\n var st = (scope.big_current_page-1)*parseInt(scope.tconfig['ItemsPerPage']);\r\n var end = st+parseInt(scope.tconfig['Item... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Plays a round of rock, paper, scissors based on the input from the user and the computers randomized choice from the function computerPlay() and increments the scores accordingly | function playRound(playerSelect, computerSelect) {
let player = playerSelect.toLowerCase();
let computer = computerSelect.toLowerCase();
if (player == "rock") {
if (computer == "paper") {
result = "You lost! Paper beats rock";
computerScore++;
return result;
}
else if (computer =... | [
"function playRound(playerSelection, computerSelection)\n{\n\n if(playerSelection == \"rock\" && computerSelection == \"paper\") \n {\n computerScore++;\n return \"You lose! Paper beats rock\";\n }\n\n else if(playerSelection == \"rock\" && computerSelection == \"scissor\") \n {\n playerScore++;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the list of initial items. Defaults to none, but the 'showAllItems' property can be enabled to show all items by default. | getInitialItems(props) {
if (props.showAllItems) {
return props.items;
}
else {
return [];
}
} | [
"async loadItems() {\n if (!this.isInitialized(true)) {\n await this.init();\n }\n return super.getItems();\n }",
"getVisibleItems() {}",
"function getItems() {\n return items;\n }",
"get initialItems () {\n const firstParsed =\n (this.currentAstNode.parent.nodes... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
void AsyncProcessResponse(System.Runtime.Remoting.Messaging.IMessage msg, System.Run... | AsyncProcessResponse() {
} | [
"invoke() {\n messaging_1.MessageLoop.sendMessage(this, CompletionHandler.Msg.InvokeRequest);\n }",
"_scheduleSendResponseMessage() {\n\n }",
"async() {}",
"ProcessResponseMessage() {\n\n }",
"async processWithoutTimeout(result) {\n }",
"invokeAsyncMethod() {\n return this.phantom.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
animate control panel movement | function animateControlPanel()
{
service_control_panel.rotation.y -= CP_SPEED;
time_control_panel.rotation.z += CP_SPEED/4;
timeObj["REALTIME"].rotation.y -= CP_SPEED/4;
} | [
"animate(){\n this.x += this.delta(3.1416*2.0,10);\n }",
"function move(options) {\n var style = '-webkit-transform: translate3d(' + options.offset + 'px,0,0)\\n;' +\n '-moz-transform: translate3d(' + options.offset + 'px,0,0)\\n;' +\n '-ms-transform: translate3d(' + options.offset + 'px,0,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up view flight page | function setupView(type) {
// Set link to return to when back button is pressed
document.getElementById('link').setAttribute('href', localStorage.getItem('link'));
// Get data from localStorage based on type of flight
var index = -1;
var data = {};
if (type == 0) {
data = JSON... | [
"view() {\n window.app.intercom.view(false);\n window.app.nav.selected = 'Schedule';\n window.app.view(this.header, this.main, '/app/schedule');\n if (!this.managed) this.manage();\n this.viewAppts();\n }",
"function ViewItineraryPage() { }",
"function setupView() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Opcode 3 takes a single integer as input and saves it to the position given by its only parameter. | async opcode3() {
this.writeData(await this.getConsoleInput(), 1);
this.position += 2;
} | [
"opcode3() {\n this.writeData(this.input[this.inputPosition], this.position + 1);\n this.position += 2;\n this.inputPosition += 1;\n }",
"async opcode3() {\n const input = await this.getInput();\n this.writeData(input, 1);\n\n this.position += 2;\n }",
"async opcode3() {\n const input = a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Describes the server vulnerability assessment details on a resource | function getServerVulnerabilityAssessment(args, opts) {
if (!opts) {
opts = {};
}
if (!opts.version) {
opts.version = utilities.getVersion();
}
return pulumi.runtime.invoke("azure-native:security/v20200101:getServerVulnerabilityAssessment", {
"resourceGroupName": args.resourc... | [
"function showViolations() {\n\t// use get json to select violations\n\t// format information\n\t// show violations in html\n\t// show last inspection date in html\n}",
"function getResourceDetails(resource) {\n if (!resource && vm.hasSelection()) {\n resource = vm.getSelection();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called when cluster details come back from the server. Rebalance the column heights because the sizes have changed. Also get the connectivity between the source and target clusters and add the necessary links. | function onBranchClusterLoaded(targetCol,targetCluster) {
graphWidgetObj.rebalanceColumnHeights();
graphWidgetObj.updateSelection();
//back links
cluster.getAttributeNames().forEach(function(attributeName) ... | [
"function onBranchClusterLoaded(targetCol,targetCluster) {\n graphWidgetObj.rebalanceColumnHeights();\n graphWidgetObj.updateSelection();\n\n //back links\n cluster.getAttributeNames().forEach(function(attrib... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gzip a string or byte array. | function gzip(x) {
var baos = new ByteArrayOutputStream();
var gzos = new GZIPOutputStream(baos);
var bytes;
if (typeof(x) == 'string') {
bytes = (new java.lang.String(x)).getBytes("UTF-8");
} else {
// it had better already be a byte array
bytes = x;
}
gzos.write(bytes, 0, bytes.length);
gz... | [
"function gzip(input,options){options=options||{};options.gzip=true;return deflate$1(input,options);}",
"function gzip(input,options){options=options||{};options.gzip=true;return deflate(input,options)}",
"function gzip(input,options){options = options || {};options.gzip = true;return deflate(input,options);}",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Vectorize a random generator | function vectorize(generator) {
return function () {
var n, result, i, args;
args = [].slice.call(arguments)
n = args.shift();
result = [];
for (i = 0; i < n; i++) {
result.push(generator.apply(this, args));
}
return result;
};
} | [
"static random () { return new Vector2(lerp(-1, 1, Math.random()), lerp(-1, 1, Math.random())); }",
"mutate(rate) { //rate 0 to 1\n function mutator(val) {\n if(Math.random() < rate) {\n return val + Math.random() * 2 - 1;\n }\n else {\n return val;\n }\n }\n\n for(let i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parses the body of the posts form and returns an object with all of the fields of the form. | static parse(body) {
var post = new Object();
post.postId = body.postId;
post.title = body.title;
post.author = body.author;
post.published_on = body.published_on;
post.issue = Number(body.issue);
post.content = body.content;
post.category = body.category;
post.staging = (body.stagin... | [
"function FormBodyParser() {\n\t}",
"function getPostInputs() {\n\t\treturn { title : $blogTitle.val() , description : $blogDescription.val() , content : $blogContent.val() };\n\t}",
"function parsePostObject(postString) {\n \"use strict\";\n // remove 'title: ' from the beginning of the string\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
22. Cart Touch Spin | function cartTouchSpin () {
if($('.quantity-spinner').length){
$("input.quantity-spinner").TouchSpin({
verticalbuttons: true
});
}
} | [
"function cartTouchSpin() {\n\t if ($('.quantity-spinner').length) {\n\t $(\"input.quantity-spinner\").TouchSpin({\n\t verticalbuttons: true\n\t });\n\t }\n\t}",
"function cartTouchSpin() {\r\n\t if ($('.quantity-spinner').length) {\r\n\t $(\"input.quantity-spinner\").Touc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
constructor Initializes a new instance of the `PdfSectionCollection` class. | function PdfSectionCollection(document){/**
* @hidden
* @private
*/this.sections=[];/**
* @hidden
* @private
*/this.dictionaryProperties=new DictionaryProperties();// if (document === null) {
// throw new Error('ArgumentNullException : document');
// }
this.pdfD... | [
"function PdfSectionCollection(document) {\n /**\n * @hidden\n * @private\n */\n this.sections = [];\n /**\n * @hidden\n * @private\n */\n this.dictionaryProperties = new DictionaryProperties();\n // if (document === null) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Callback for end of google search Populates results list | function onSearchComplete(sc, searcher) {
if ( !searcher.results
|| !searcher.results.length )
return;
_resultsCount.set(_resultsCount.get() + searcher.results.length);
searcher.results.forEach(function(res) {
var dir = Elements.createDirectory(
res.unescapedUrl,
res.title,
cre... | [
"onRequestResults(e){\n\t\tconst request = gapi.client.youtube.search.list({\n part: \"snippet\",\n\t\t\ttype: \"video\",\n q: encodeURIComponent(this.keyword).replace(/%20/g, \"+\"),\n maxResults: 50\n\t\t}); \n\t\trequest.execute(response => {\n\t\t\tconst results = response.resu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to get all all item rows main total | function invoice_get_all_item_rows_main_total()
{
var no=$("#invoiceForm .invoice_participantRow .invoice_main-group").length;
var rows_total_amt = 0;
var rows_disc_amt = 0;
var inps = $("input[name='invoice_calculated_discount[]']");
var n = $("input[name='invoice_calculated_discount[]']").length;... | [
"itemTotal(items) {\n let total = 0;\n for (let i = 0; i < items.length; i++) {\n total += items[i].price * items[i].quantity;\n }\n return total;\n }",
"function totalAmount() {\n var total = 0;\n for (var i = 0; i < vm.items.length; i++) {\n total = tot... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get exp needed for next level | function getExpNeededForNextLevel(level, expGroup) {
var expNeeded;
if (level == 100) {
expNeeded = "---"
} else {
for (i=0; i<expNeededPerExpGroup.length; i++) {
// do something
if (expNeededPerExpGroup[i][0] == level) {
for (j=0; j<7; j++) {
if (expNeededPerExpGroup[0][j] == expGroup) {
ex... | [
"neededExp(level){\n return level*10;\n }",
"function getNextLevelExp(userEXPorLVL, isLevel=false) {\n if (isLevel) {\n return levels[userEXPorLVL + 1].totalExp;\n }\n else {\n return levels[getLevel(userEXPorLVL) + 1].totalExp;\n }\n}",
"levelExpNeeded(level) {\n return (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SHPIX[] SHift point by a PIXel amount 0x38 | function SHPIX(state) {
var stack = state.stack;
var loop = state.loop;
var fv = state.fv;
var d = stack.pop() / 0x40;
var z2 = state.z2;
while (loop--) {
var pi = stack.pop();
var p = z2[pi];
if (DEBUG) console.log(
state.step,
(state.loop > 1 ?... | [
"function SHPIX(state) {\n var stack = state.stack;\n var loop = state.loop;\n var fv = state.fv;\n var d = stack.pop() / 0x40;\n var z2 = state.z2;\n\n while (loop--) {\n var pi = stack.pop();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Eliminar un telefono de la lista | function EliminarTel(indice) {
telefonoItems.Eliminar(indice);
MostrarTelefonos(true);
return false;
} | [
"function removePhone(numero, e) {\n e.preventDefault();\n setPhone(phone.filter(ph => ph.tel_numero !== numero))\n }",
"function eliminarContacto(nombreEliminar){\n\tarrayContactos.forEach((elemento,index)=>{\n\t\tif(elemento.nombre==nombreEliminar){\n\t\t\tarrayContactos.splice(index,1);\n\t\t}\n\t});\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
We can't keep a reference to the Popover object, because Bootstrap recreates it internally. | getPopover() {
return jQuery(this.link).data(bootstrap.Popover.DATA_KEY);
} | [
"function initialisePopover() {\n\t$('[data-toggle=\"popover\"]').popover();\n}",
"function applyPopover()\n{\n// $('.applyPopover').popover({\"html\": true});\n}",
"popover(){\n $(\"[data-toggle=popover]\").popover({\n html:true\n });\n }",
"function managePopover() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If value is assigned (checked in the parent validate call), it must by an instance of Model. | async validateType(value: mixed) {
if (value instanceof this.getModelClass()) {
return;
}
this.expected("instance of Model class", typeof value);
} | [
"function ngModelPipelineCheckValue(arg){containerCtrl.setHasValue(!ngModelCtrl.$isEmpty(arg));return arg;}",
"forceValidate() {\n this.setValue(this.getValue());\n }",
"function ngModelPipelineCheckValue(arg) {\n containerCtrl.setHasValue(!ngModelCtrl.$isEmpty(arg));\n return arg;\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The loadBox function is a callback function for the gameBox.php getJSON function. It loads all the game and game box links. It loads all the game box images. | function loadBox(box) {
BD18.bx = null;
BD18.bx = box;
if (typeof(box.links) !== 'undefined' && box.links.length > 0) {
loadLinks(box.links);
}
$.getJSON("php/linkGet.php", 'gameid='+BD18.gameID,function(data) {
if (data.stat === "success" && typeof(data.links) !== 'undefined'
&& data.links.l... | [
"function loadBox(box) {\n BD18.bx = null;\n BD18.bx = box;\n if (typeof(box.links) !== 'undefined' && box.links.length > 0) {\n loadLinks(box.links);\n }\n $.getJSON(\"php/linkGet.php\", 'gameid='+BD18.gameID,function(data) {\n if (data.stat === \"success\" && typeof(data.links) !== 'undefined' \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`articleToHTML` renders an html string from an article object | function articleToHTML(article) {
return '<article class="article">' +
' <section class="featuredImage">' +
' </section>' +
' <section class="articleContent">' +
' <a href="#"><h3>' + article.name + '</h3></a>' +
' <h6>' + article.location.formattedAddress + '</h6... | [
"function articleToHTML(article) {\n return '<article class=\"article\">' +\n ' <section class=\"featuredImage\">' +\n ' <img src=\"' + article.thumbnail + '\" alt=\"\" />' +\n ' </section>' +\n ' <section class=\"articleContent\">' +\n ' <a href=\"#\"><h3>' + artic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Changes the FHIR symbol based on saved state. If the app is running in standalone mode (no FHIR), then null is returned. If there are unsaved changes then a red flame is returned. If changes are currently being saved to the server, a yellow flame is returned. And if everything is saved, then a green flame is returned. | renderSave() {
if (!this.props.FHIR.isEnabled) return null;
const { saving, isUnsaved } = this.state;
if (saving) return <FontAwesomeIcon key="save_icon" size="2x" icon={faGripfire} title="Saving to FHIR server" color="#ffce00" />;
if (isUnsaved) return <FAIButton key="save_button" icon={faGripfire} t... | [
"saveChanges() {\n if (!this.hasChanged) {\n this.ToastService.info('There are no changes to save.');\n return;\n }\n\n // make a copy of the symbol\n const symbolToUpdate = new AlphabetSymbol(this.symbol);\n\n // update the symbol\n return this.Symbol... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a new counter with the given name and count | function addCounter(name, count) {
var html = counterHtml(name, count);
$("#list").append(html);
// setCookie(currentCounters, html);
storeCounter(currentCounters, html);
var countNr = currentCounters;
$(`#input${currentCounters}`).change(() => {
console.log(countNr);
// setCookie(countNr, html);
... | [
"function addCount() {\n\t\tcount++;\n\t}",
"function addToCounter() {\n\tcounter++;\n appendCounter();\n}",
"@action\n addCounter() {\n this.counters.push({\n id: String(Math.random() * 1000000),\n state: new CounterState(this.startingCount),\n });\n }",
"function incrementCounter(counte... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Instantiate VarHeader from the contents of the supplied buffer | static fromBuffer (buffer) {
if (buffer.length !== SIZE_IN_BYTES) {
throw new RangeError(`Buffer length for VarHeader needs to be ${SIZE_IN_BYTES}, supplied ${buffer.length}`)
}
return new VarHeader({
type: buffer.slice(0, 4).readInt32LE(),
offset: buffer.slice(4, 8).readInt32LE(),
... | [
"function fromBuffer(headerBuf) {\n if (!headerBuf) {\n return {}; // TODO\n }\n return {\n magic: headerBuf.readUInt8(0),\n opcode: headerBuf.readUInt8(1),\n keyLength: headerBuf.readUInt16BE(2),\n extrasLength: headerBuf.readUInt8(4),\n dataType: headerBuf.readUI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
user can transfer his will to other owner, ownership of will isntransferring here | async function propTransfer() {
let accounts = await web3.eth.getAccounts();
let Twill = await contract.methods
.transferWill(
toowner,
newTestatorName,
newBeneficiary,
newBeneficiaryAddress,
newOwnerHomeAddress
)
.send({ from: accounts[0] });
consol... | [
"transfer (newOwner, team) {\n try {\n if (!newOwner.isOnTeam(team)) { throw Err.cantOwn }\n if (!newOwner.isCurrentTeam(team)) { throw Err.notCurrent } // indirectly prevents owning another team\n \n team.transfer(newOwner)\n return Say.success(Say.tran... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update views of article; | function updteView(id, position) {
views.push(position);
article.views = views;
database.ref('/articles/' + id).set(article, (error) => {
if (error) {
console.log(error);
} else {
return true;
}
});
} | [
"function increaseArticleViews(id) {\n mongoose\n .model('postModel')\n .findById(id, function(err, doc) {\n doc.views = doc.views + 1;\n doc.save();\n });\n}",
"function updateViews() {\n // Display the appropriate input form.\n showInputForm();\n // Display notes.\n showNotes();\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check the network status every statusInterval milliseconds | function initiateStatusInterval(){
checkStatus();
window.setInterval('checkStatus()', statusInterval);
loginGreeting();
} | [
"update_status_loop () {\n $.getJSON(\"/api/v1/ping\")\n .done((data) => {\n if (data) {\n for (const name in data) {\n if (data[name]) {\n $('#status_'+name).removeClass('d-none');\n $('#status_'+name+\"_invert... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Toggle displaying children as deleted or not deleted | function toggleDeleteRevertChildren($item) {
var $childContainer = $item.find('.js-browse__item .page__container'),
isDeleting = $item.children('.page__container').hasClass('deleted');
if (isDeleting) {
$childContainer.addClass('deleted');
} else {
$childContainer.removeClass('delet... | [
"function toggleChildren(d) {\n if (d.collapsed == true) {\n d.children.forEach(function (childNode) {\n childNode.name = childNode.name.slice(2, -2);\n });\n\n d.children = d._children;\n d._children = null;\n d.name = d.name.slice(2, -2);\n d.collapsed = false;\n } else ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converte todos os feiticos do personagem. | function _ConverteFeiticos() {
_ConverteEscolasProibidas();
_ConverteFeiticosConhecidos();
_ConverteFeiticosSlots();
} | [
"function _ConvertePericias() {\n for (var i = 0; i < gEntradas.pericias.length; ++i) {\n var pericia_personagem = gPersonagem.pericias.lista[gEntradas.pericias[i].chave];\n pericia_personagem.pontos = gEntradas.pericias[i].pontos;\n pericia_personagem.complemento = 'complemento' in gEntradas.pericias[i] ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |