query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Get the parent scope of this scope. If we could find the scope for our parentComponent, use that. Otherwise default to global scope | getParentScope() {
return this.cache.getOrAdd('parentScope', () => {
var _a;
let scope;
let parentComponentName = (_a = this.xmlFile.parentComponentName) === null || _a === void 0 ? void 0 : _a.text;
if (parentComponentName) {
scope = this.program.... | [
"function parentFrom(window) {\n if (window.parent !== window) return window.parent;\n}",
"get parent() {\n return tag.configure(ContentType(this, \"parent\"), \"ct.parent\");\n }",
"getParentModel() {\n return this.parentModel;\n }",
"get parentFolder() {\n return Folder(this, \"par... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete pending accountlinks OnBegin | function DeletePendingAccountLinksOnBegin() {
isajaxrunning = true;
//Show spinner and add margin to submit button text
$('#modal-account-pending-guestaccounts-remove-spin').css('display', '');
$('#modal-account-pending-guestaccounts-remove-spin').prev().css('margin-left', '17px');
... | [
"function DeletePendingAccountLinksOnComplete() {\n isajaxrunning = false;\n\n //Hide spinner and reset margin\n $('#modal-account-pending-guestaccounts-remove-spin').css('display', 'none');\n $('#modal-account-pending-guestaccounts-remove-spin').prev().css('margin-left', '');\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
recursively visits a set of nodes assembling a row index to case mapping. | function visit(nodes, level) {
nodes.forEach(function (node) {
if (level === collections.length - 1) {
rowCaseIndex.push(node);
} else {
if (model.isCollapsedNode(node)) {
rowCaseIndex.push(node);
} else {
visit(node.get('children'), level + 1)... | [
"rebuildTreeIndex() {\n let columnIndex = 0;\n\n this.#rootsIndex.clear();\n\n arrayEach(this.#rootNodes, ([, { data: { colspan } }]) => {\n // Map tree range (colspan range/width) into visual column index of the root node.\n for (let i = columnIndex; i < columnIndex + colspan; i++) {\n th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CODING CHALLENGE 202 Write a function that returns the position of the second occurrence of "zip" in a string, or 1 if it does not occur at least twice. Your code should be general enough to pass every possible case where "zip" can occur in a string. | function findZip(str) {
return str.indexOf("zip", str.indexOf("zip") + 3);
} | [
"function secondIndexOf(s1, s2) {\n // Use indexOf twice.\n // const s1Low = s1.toLowerCase();\n // const s2Low = s2.toLowerCase();\n const indexOfFirst = s1.indexOf(s2); \n // console.log(`The index of the first \"${s2}\" from the beginning is ${indexOfFirst}`); \n // console.log(`The index of the ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize the application. The "app" function is called when the document has been completely loaded. Adds event listeners, sets up the dropzone for uploading a file by dragging and creates an instance of the PhotoMosaic library. | function app(){
//Set up the dropzone
var dropZone = document.querySelector('#dropzone input');
dropZone.addEventListener('dragenter',function(e){
e.target.parentNode.classList.add('active');
e.preventDefault();
});
dropZone.addEventListener('dragover',function(e){
... | [
"function initialize() {\n _projectOpen();\n\n ProjectManager.on(\"projectOpen\", _projectOpen);\n\n ProjectManager.on(\"projectClose\", function () {\n FileSystemHandler.stopListenToFileSystem();\n });\n\n DocumentManager.on(\"fileNameChange\", function (event, oldName... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function shows a dialoge box to confirm the user to quit the app. If the user confirms to quit, it gracefully passes beforequit event to willquit. If the user choses to not quit, it prevents the exit of the app and keeps the window active. Note: On macOS, this only works when the user does Cmd+Q or Menu > Quit | function confirmAndQuit(e) {
// dialog options
const messageBoxOptions = {
type: 'question',
buttons: ['Cancel', 'Quit'],
title: 'This will quit the app',
message: 'Are you sure to quit?',
};
//show the dialog
dialog.showMessageBox(null, messageBoxOptions, response => {
// If user chooses ... | [
"function cpsh_onCancelQuit(evt) {\n evt.preventDefault();\n pin.focus();\n quitAppConfirmDialog.hidden = true;\n }",
"function cpsh_onQuit(evt) {\n evt.preventDefault();\n quitAppConfirmDialog.hidden = true;\n WapPushManager.close();\n }",
"quit () {\n this.forceQuit = true\n this.mai... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Properties Check if the current matrix is identity | isIdentity() {
if (this._isIdentityDirty) {
this._isIdentityDirty = false;
const m = this._m;
this._isIdentity =
m[0] === 1.0 &&
m[1] === 0.0 &&
m[2] === 0.0 &&
m[3] === 0.0 &&
... | [
"static identity(){\n return new matrix4([[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]);\n }",
"isIdentityAs3x2() {\n if (this._isIdentity3x2Dirty) {\n this._isIdentity3x2Dirty = false;\n if (this._m[0] !== 1.0 || this._m[5] !== 1.0 || this._m[15] !== 1.0) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set in localStorage that user allowed to send errors to sentry | allowSentry() {
storage.setItem('wallet:sentry', true);
this.updateSentryState();
} | [
"disallowSentry() {\n storage.setItem('wallet:sentry', false);\n this.updateSentryState();\n }",
"function syncError() {\n app.syncState = 'Sync error';\n }",
"storeTempUserCredentials(user) {\n window.localStorage.setItem(this.LOCAL_TEMP_USER, JSON.stringify(user));\n this.setUser(user);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show and Hide objects | function objectShow(id) {
document.getElementById(id).style.visibility = "visible";
} | [
"function toggle_display(idname)\n{\n\tobj = fetch_object(idname);\n\tif (obj)\n\t{\n\t\tif (obj.style.display == \"none\")\n\t\t{\n\t\t\tobj.style.display = \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tobj.style.display = \"none\";\n\t\t}\n\t}\n\treturn false;\n}",
"function show_hide_partner(obj,show_section)\n{\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clear interval timer if id saved in attributes: | function clear_interval(t) {
var interval = parseInt(t.data("interval"));
if (interval > 0) {
clearInterval(interval);
t.data("interval", "");
}
} | [
"_removeTimer() {\n // use clearInterval() to remove your interval. You need to include the timer reference\n\n }",
"function stopTimeCounter() {\n\tclearInterval(interval);\n}",
"function clearSaveTimer()\r\n\t{\r\n\t\tif (UpdateTimeOut)\r\n\t\t{\r\n\t\t\twindow.clearTimeout(UpdateTimeOut);\r\n\t\t\tUpdate... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Got to the first value of a given attribute and return true if data has changed | first(attributeName) {
const arg = this.args[attributeName];
if (arg && arg.idx !== 0) {
arg.idx = 0;
this.emit('state.change.first', {
value: arg.values[arg.idx],
idx: arg.idx,
name: attributeName,
instance: this,
});
return true;
}
return false... | [
"previous(attributeName) {\n const arg = this.args[attributeName];\n if (arg && arg.delta(arg, -1)) {\n this.emit('state.change.previous', {\n delta: -1,\n value: arg.values[arg.idx],\n idx: arg.idx,\n name: attributeName,\n instance: this,\n });\n return true... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
pursue(ing player) (includes facing) | pursueDo() {
// always try to face
this.facePlayer();
this.noAttack();
// if not close enough to attack, also pursue
if (!this.alivePlayerInRange(this.getParams().attackRange)) {
this.moveForward();
}
} | [
"function playPlayerVsComputer(){\n setPlayerVsPlayer({\n AI:true,\n AImove:false\n });\n }",
"function AI_followPlayer() {\n\tif (player) {\n\t\tif (player.x < this.x - 1) this.dx = -2.5;\n\t\telse if (player.x > this.x + 1) this.dx = 2.5;\n\t\telse this.dx = 0;\n\t\t\n\t\tif (player.y < this.y ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
HUD widget that displays worn inventory of a single player It is activated through the main HUD and replaces the message box | function Inventorywidget(hud_instance)
{
MessageBase.call(this, hud_instance);
var i;
this.hud = hud_instance;
this.party = Party;
this.current_party_member = -1;
this.mode = MODE_WEAR;
this.wear_line_lookup = [];
for (i=0; i<30; i++) { this.wear_line_lookup[i] = null; }
/* Poor man's line to wear slot... | [
"function writeUI () {\n player.wherePlayer();\n health.writeThirst();\n}",
"function runBamazon() {\n displayInventory();\n}",
"showInventory() {\n var response = \"\";\n if (this.inventory.length > 0) {\n response = \"INVENTORY\\n\";\n for(var i = 0; i < this.inventory.l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reset the inventory list | static resetInventory() {
var storyInvEl = document.getElementsByTagName("jw-story-inv-list")[0];
storyInvEl.innerHTML = ``;
} | [
"static updateInventory() {\n\t\tthis.resetInventory();\n\t\tstoryData.story.items.forEach(function(item) {\n\t\t\tif (item.owned) UI.addItem(item);\n\t\t});\n\t}",
"function refillInventory(inventory){\n\tfor(let key in inventory){\n\t\tif(itemInventory[key]==undefined){\n\t\t\titemInventory[key] = inventory[key... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Counter for new document ids and names Creates a new empty document | function newDoc() {
docCounter++;
const newDoc = {
id: 'doc-' + docCounter,
title: 'Untitled ' + docCounter,
newPlayerCount: 0,
newTextCount: 0,
newRectCount: 0,
newCircleCount: 0,
newLineCount: 0,
selectedObject: null,
stage: null,
... | [
"create({\n name = \"New document\", width = 1000, height = 1000, layers = [], selections = {}\n } = {}) {\n if ( !layers.length ) {\n layers = [ LayerFactory.create({ width, height }) ];\n }\n return {\n id: `doc_${( ++UID_COUNTER )}`,\n layers,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cria tabela de companias | function createCompaniesTable(){
dynamodb.createTable(paramsCreateCompanies, function(err, data) {
if (err) {
console.error("Unable to create table. Error JSON:", JSON.stringify(err, null, 2));
} else {
console.log("Created table. Table description JSON:", JSON.stringify(data, null, 2)... | [
"function criarItensTabela(dados) {\n\n\tconst linha = tabela.insertRow()\n\n\tconst colunaClienteNome = linha.insertCell(0)\n\tconst colunaPedidoDados = linha.insertCell(1)\n\tconst colunaPedidoHora = linha.insertCell(2)\n\n\tconst dados_pedido = dados.pedido_dados.substr(0, 10) + \" ...\"\n\n\tcolunaClienteNome.a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
wait until ga exists and is instantiated also get optimizely name & variation | function load(event) {
window.removeEventListener("load", load, false); // remove listener, no longer needed
var state = window["optimizely"].get("state");
var decision = state.getDecisionObject({
"campaignId": campaignId
});
// decision is null if no bucketing was done (failed audience conditions, ... | [
"getVariationName(options) {\n return new Promise((resolve, reject) => {\n // First we check that the required options are provided\n if (!options || !options.experimentKey || !options.groupExperimentName) {\n return reject({error: \"Missing required options\"});\n }\n\n // Then, we ch... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[compileWxss compile less or sass or wxss file] | function compileCss(type, src, dist, file) {
let cssHandleFn = cssType[type]
let compile = cssHandleFn ? gulp.src(src).pipe(plumber()).pipe(cssHandleFn()) : gulp.src(src).pipe(plumber());
return compile
.pipe(base64({
extensions: [/\.png#datauri$/i, /\.jpg#datauri$/i],
maxImageSize: 10 * 1024
... | [
"function compileLessAndWriteToCSSFile(filename) {\n const cssFilename = Stylesheets.getDistCSSFileForLessFile(filename);\n const cssMapFilename = Stylesheets.getDistCSSMapFileForLessFile(filename);\n let output = null;\n return readFile(filename)\n .then(buffer => less.render(buffer.toString(), { plugins: [... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
count number of degrees being displayed | function degreeCount() {
var countArr = [];
var listStyle;
count = 0;
// loop through all degrees
for (var i in degreeObj) {
var countSubArr = [];
countSub = 0;
var degObjChild = degreeObj[i].children;
// loop through all degree children
for (var j i... | [
"degrees() {\n return (this._radians * 180.0) / Math.PI;\n }",
"function numGuides(direction) {\n var guides = app.activeDocument.guides;\n var counter = 0;\n for (var i = 0; i < guides.length; ++i) {\n if (guides[i].direction == direction) {\n counter++;\n }\n }\n return counter;\n}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set user in the onlineUsers array | function setOnlineUser(user) {
onlineUsers.push(user)
console.log(`[ ${user.username.toUpperCase()}: IS NOW ONLINE ]`)
console.log('[ONLINE USERS:]')
function allOnlineUsers(onlineUsers) {
for (user of onlineUsers) {
console.log(`* ${user.username}`)
}
}
... | [
"setUsersOnline (state, count) {\n state.usersOnline = count\n }",
"set user(aValue) {\n this._logger.debug(\"user[set]\");\n this._user = aValue;\n }",
"function muut_add_online_user(user) {\n online_user_html = get_user_avatar_html(user);\n var user_faces = widget_online_users... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prints the gameboard to the container. Loads templates for both game board and brick. Bricks are then loaded into the game board and an event listener is added to every brick with addGameMechanics(). | function printGameScreen(tiles) {
var template;
var templateContent;
var div;
template = document.querySelector("#memoryBrickTemplate");
templateContent = template.content.firstElementChild;
template = document.querySelector("#memoryGameTemplate");
div = documen... | [
"initBoard() {\n\n // Create the chess board.\n SHTML.Divs(8, function(index, div) {\n div.classList.add(\"chess-board-row\");\n\n // Create 8 tiles in that row.\n SHTML.Divs(8, function(letterIndex, currDiv, numberIndex) {\n currDiv.classList.add(\"ches... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Swap the src if we are iframe content. The name arg should be the same string as in the OLiframeContent function for the popup. The src arg is a partial, relative, or complete URL for the document to be swapped in. | function OLswapIframeSrc(name, src){
if(parent==self){
alert(src+'\n\n is only for iframe content');
return;
}
var o=parent.OLgetRef(name);
if(o)o.src=src;
else alert(src+'\n\n is not available');
} | [
"function reloadSrcFrame(dataTransfer) {\r\n\tvar srcFrame = dataTransfer.getData(\"srcFrame\");\r\n var srcUrl = dataTransfer.getData(\"srcUrl\");\r\n if(srcFrame == undefined) {\r\n \terror(\"Reload called with null srcFrame\");\r\n \treturn;\r\n }\r\n if(srcUrl == undefined ){\r\n \terror(\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the popup title based on the title of the html document it contains. Uses a timeout to keep checking until the title is valid. | function setPopTitle() {
if (window.frames["popupFrame"].document.title == null || window.frames["popupFrame"].document.title == gPopupTitle)
{
window.setTimeout("setPopTitle();", 99);
}
else
{
document.getElementById("popupTitle").innerHTML = window.frames["popupFrame"].document.title;
}
} | [
"function setDialogTitle(name){\n\t// Set title of browser window\n\twindow.document.title = name;\n\t// Set the inline dialog title\n\tdhtml.getElementById(\"windowtitle\").innerHTML = name;\n}",
"_updateTitle() {\n let ttl = '';\n if (this._curPage) {\n ttl = this._curPage.title();\n }\n docume... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Toggle code block / paragraph. | function toggleCodeBlock(opts, change,
// When toggling a code block off, type to convert to
type) {
if ((0, _utils.isInCodeBlock)(opts, change.value)) {
return (0, _unwrapCodeBlock2.default)(opts, change, type);
}
return (0, _wrapCodeBlock2.default)(opts, change);
} | [
"function swap_encryption_decryption(){\n var crypto_method = decryption_function;\n encryption_mode = !encryption_mode;\n if (encryption_mode){\n crypto_method = encryption_function;\n encrypt.innerHTML = '<strong>3.</strong> Encrypt';\n shift_letter = shift_letter_encrypt;\n password_encrypt = pass... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
allItemsBought returns the IDs of all the items bought by a buyer parameter: [buyerID] The ID of the buyer returns: an array of listing IDs | function allItemsBought(buyerID) {
let arrayOfListings = [];
var logElements = (value, key, map) => {
if (value.buyer == buyerID) {
arrayOfListings.push(key);
}
}
listing.forEach(logElements);
return arrayOfListings;
} | [
"function allItemsBought(buyerID) {\n return itemsBought.child(buyerID).once('value')\n .then(data => data.val())\n .then(items => Object.keys(items))\n .catch(err => [])\n}",
"function itemsToSell(userID) {\n let itemsToSell = [];\n var logElements = (value, key, map) => {\n if (!value.buy... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CONCATENATED MODULE: ./node_modules/underscore/modules/_tagTester.js Internal function for creating a `toString`based type tester. | function tagTester(name) {
var tag = '[object ' + name + ']';
return function(obj) {
return _setup["t" /* toString */].call(obj) === tag;
};
} | [
"function fnExoticToStringTag() {}",
"static string(v) { return new Typed(_gaurd, \"string\", v); }",
"toSTRING() {\n switch (this._type) {\n case \"NODE\":\n return this._value.nodeType === 1 ? this._value.outerHTML : this._value.nodeValue;\n case \"STRING\":\n return this._value;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Highlights data in the Entity Viewer | function EntityViewerHighlighter(dm_entity_id, entity_id) {
//If a dm_entity_id (used for the title) has been passed...
if (dm_entity_id !== null){
//Highlight the title of the current panel in the Entity Viewer
//(Could make this a bit more accurate by actually finding the specific panel)
var selectedPanel = ... | [
"onLayerHighlight() {}",
"function highlightFeature(e) {\n e.target.setStyle(highLightStyle);\n}",
"function highlightFeature(e) {\n\tvar layer = e.target;\n\n\t// style to use on mouse over\n\tlayer.setStyle({\n\t\tweight: 2,\n\t\tcolor: '#666',\n\t\tfillOpacity: 0.7\n\t});\n\n\t\n\t\n\tinfo_panel.update(laye... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Input of Slider 1 | function xSlider()
{
let xval = document.getElementById("inputvalx").value;
document.getElementById("outputvalx").innerHTML = xval;
} | [
"function ySlider()\n{\n let yval = document.getElementById(\"inputvaly\").value;\n document.getElementById(\"slidervaly\").innerHTML = yval;\n}",
"addSlider(slider) {\n this.slider = slider;\n }",
"onSliderValueChanged() {\n this.setBase();\n const label = `${this.name}: ${JSON.st... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add farm detail to investment opp | async addFarmToInvestmentMethod(req, res, next) {
try {
const {
body,
models: { Investments },
} = req;
var { farm, investment } = body;
farm = JSON.parse(JSON.stringify(farm));
console.log(farm);
var inv = await Investments.findById(investment);
if (!inv) {... | [
"async addFarmerToInvestmentMethod(req, res, next) {\n try {\n const {\n body,\n models: { Investments },\n } = req;\n var { farmer, investment } = body;\n var inv = await Investments.findById(investment);\n if (!inv) {\n throw Error('Couldnt find this investment');\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function will read from record6 of the modules.txt file the services that were selected to be present in the demo for Common Entry System. The values are stored in the var commonEntryServices, defined in modules_....html | function getCommonEntryServices()
{
var current = eval("record6");
//iterate through the data from the text file and store into an array
for(var i=0; i < record6.length; i++){
commonEntryServices[i] = current[i];
}
}//end getCommonEntryServices | [
"getServices() {\n let services = []\n this.informationService = new Service.AccessoryInformation();\n this.informationService\n .setCharacteristic(Characteristic.Manufacturer, \"OpenSprinkler\")\n .setCharacteristic(Characteristic.Model, \"OpenSprinkler\")\n .setCharacteri... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The AWS::Glue::Partition resource creates an AWS Glue partition, which represents a slice of table data. For more information, see CreatePartition Action and Partition Structure in the AWS Glue Developer Guide. Documentation: | function Partition(props) {
return __assign({ Type: 'AWS::Glue::Partition' }, props);
} | [
"ExportPartition(string, string, int) {\n\n }",
"InstallPartition(string, string, int, string, string, string) {\n\n }",
"visitTable_partition_description(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitModel_column_partition_part(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitNew_p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles the No outcome on the Overwrite Modal Confirm. | function overwriteNo(okCallback, cancelCallback) {
showModalDialog('Save diagram as',
true, Data.SavedDiagramTitle,
'OK', () => saveOK(okCallback),
undefined, undefined,
'Cancel', cancelCallback);
} | [
"function interventionDialogNoClick () {\n if (globals.interventionType === NEXT_PROBLEM_INTERVENTION)\n sendInterventionDialogYesNoConfirmInputResponse(\"InputResponseNextProblemIntervention\",processNextProblemResult,\"no\");\n else\n sendInterventionDialogYesNoConfirmInputResponse(\"InputResp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
asserts that a data object "looks like" a summary coverage object | function assertValidSummary(obj) {
const valid =
obj && obj.lines && obj.statements && obj.functions && obj.branches;
if (!valid) {
throw new Error(
'Invalid summary coverage object, missing keys, found:' +
Object.keys(obj).join(',')
);
}
} | [
"function validateCentralDataObject(centralDataObj) {\n\t\t\t\t\tif (!angular.isArray(centralDataObj)) throw new Error(\"'centralDataObj' must be an array\");\n\t\t\t\t\tif (centralDataObj.length === 0) throw new Error(\"'centralDataObj' must include atleast one object\");\n\t\t\t\t\t// TODO - validate the intral s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Couple a POP3 parser with a request/response model, such that you can easily hook Pop3Protocol up to a socket (or other transport) to get proper request/response semantics. You must attach a handler to `.onsend`, which should fire data across the wire. Similarly, you should call `.onreceive(data)` to pass data back in ... | function Pop3Protocol() {
this.parser = new Pop3Parser();
this.onsend = function(data) {
throw new Error("You must implement Pop3Protocol.onsend to send data.");
};
this.unsentRequests = []; // if not pipelining, queue requests one at a time
this.pipeline = false;
this.pendingRequests = []... | [
"function receiveCallback(data) {\n receiveWhois(session,data);\n }",
"function make_parser(owner){\n\n\tvar parser = new HTTPParser('response');\n\n\tparser.owner = owner;\n\n\t//\n\t// hooks to the real parser\n\t//\n\n\tparser.onMessageBegin = function () {\n\t\t//console.log('parser.onMessag... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
lognow(msg) console.log the timestamp & msg | function lognow (msg) {
if (msg) return console.log(moment(Date.now()).format('YYYY/MM/DD HH:MM:SS') + ' ' + msg)
return console.log(moment(Date.now()).format('YYYY/MM/DD HH:MM:SS'))
} | [
"function log(msg) {\n\tvar time = new Date();\n\tconsole.log(time.getHours() + \":\" + time.getMinutes() + \":\" + time.getSeconds() + \".\" + time.getMilliseconds() + \" - \" + msg);\n}",
"function logMsg(msg){\r\n var moment = require('moment');\r\n moment().format();\r\n var now = moment().format('YYYY-MM-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
void MoveComponents (string, Variant, string) | MoveComponents(string, Variant, string) {
} | [
"CopyComponents(string, Variant, string) {\n\n }",
"function moveComponents(updwn)\r\n{\r\n\tvar directn = parseInt(updwn);\r\n\thideAllDialogs();\r\n var stateDisplay = document.getElementById('stateDisplay');\r\n stateDisplay.value = globalBreadBoard.toString();\r\n\r\n okToClear = true;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
tryUnlock controls when the loading page switches to the open forms page | function tryUnlock() {
if (!isLoaded()) {
return showPage(pages.loading);
}
clearNotLoading();
openFormsButton.removeAttribute("disabled");
newFormButton.removeAttribute("disabled");
// separating this last one allows closed forms to lag if needed
if (state.closedForms) closedFormsButton.removeAttribu... | [
"function blockContent()\n{\n\t// show stop button\n\tdocument.getElementById('next_link').style.display = \"none\";\n\tdocument.getElementById('submit_link').style.display = \"none\";\n\tdocument.getElementById('exit_link').style.display = \"\";\n\tonLastScreen();\n\t\n\t// set progress bar to 100%\n\tdocument.get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function when called will return a table header row based on the generateTableHeader functions called in it. | function generateTableHeaderRow(){
var headerRowHTML = "";
// TODO: Question 2 - Add additional table headers here to
// give a header for each table data element.
headerRowHTML += '<tr>';
headerRowHTML += generateTableHeader("ID#");
headerRowHTML += generateTableHeade... | [
"function buildTableHeading() {\n row = document.createElement(\"tr\");\n\n tableHeadings.forEach(function (heading) {\n console.log(heading);\n row.appendChild(createNodeAndText(\"th\", heading));\n });\n return row;\n }",
"function constructHeaderTbl() {\t\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
validation method for Hotel inputs | function validateInputs(hotelToSave){
var valid = true;
if(isNaN(hotelToSave.ratePerRoom)) {
hotel.validationMessages.rateShouldBeNumber = true;
valid = false;
}
if( hotelToSave.contact !== undefined) {
if(isNaN(hotelToSave.contact.phone1)) {
hotel.validationMessages.phone1ShouldBeNumber = true;
... | [
"function venueValidation() {\r\n //Setup venue\r\n var venue = $(\".venue\");\r\n\r\n //Validate the venue when we select an option\r\n venue.change(function() {\r\n var venueSelect = $(this).val();\r\n\r\n if($.inArray(venueSelect, venues) !== -1) {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update a subscription Updates an existing subscription to match the specified parameters. When changing plans or quantities, we will optionally prorate the price we charge next month to make up for any price changes. To preview how the proration will be calculated, use the upcoming invoice endpoint. reqData = | function update_subscription(subscription_id,reqData,callback)
{
stripe.subscriptions.update(
subscription_id,
reqData,
function(err, subscription) {
if(err)
{
callback(err,null);
}
else
{
console.log(subscription);
callback(null,subscription);
}
}
);
} | [
"function updateSku(req, res) {\n\n\tlet { updateSku } = query.sku\n\tlet { sku, price } = req.body\n\tlet { product_id, sku_id } = req.params\n\n\tdb.query(updateSku, [sku_id, sku, price, product_id], (err, data) => {\n\n\t\treturn err ? res.status(500).send({ message: `Error updating the price to product: ${err}`... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the next pixel from the image | function nextPixel() {
if (remaining === 0) return EOF;
--remaining;
var pix = pixels[curPixel++];
return pix & 0xff;
} | [
"function getStartingPoint() {\n let firstVisitX = Math.floor(random(0, width));\n let firstVisitY = Math.floor(random(0, height));\n let mapIndex = 0;\n let randomIndex = Math.floor(random(0, imgColors.size));\n let firstColor;\n for(let value of imgColors.values()) {\n if(mapIndex === ran... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Whether the folder pane is visible. When we're inactive, we stash the value in |this._folderPaneVisible|. | get folderPaneVisible() {
// Early return if the user wants to use Thunderbird without an email
// account and no account is configured.
if (
Services.prefs.getBoolPref("app.use_without_mail_account", false) &&
!MailServices.accounts.accounts.length
) {
return false;
}
if (thi... | [
"set folderPaneVisible(aVisible) {\n this._folderPaneVisible = aVisible;\n }",
"onDisplayingFolder() {\n let displayedFolder = this.view.displayedFolder;\n let msgDatabase = displayedFolder && displayedFolder.msgDatabase;\n if (msgDatabase) {\n msgDatabase.resetHdrCacheSize(this.PERF_HEADER_CACH... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
nextEnable() Enables the next button. | function nextEnable() {
// Make sure the button is displayed first.
$('#btnNextStep').show();
// If enabling of the Next button has not been blocked, enabled the Next button.
if ( window.j2w.blockNextEnable === false ) {
$('#btnNextStep').removeAttr('disabled');
}
} | [
"enable_next_button() {\n $('.nav_next_button').prop('disabled', false);\n $('.nav_next_button').removeClass('button_disabled');\n }",
"enableNextButton() {\n this.setState({ nextDisabled: false })\n if (!this.state.displayedComponent.is_complete) {\n this.markComponentAsComplete(this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Keeps the provided canvas fully sized to the window. | function keepFullSize(canvas) {
function resize() {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
}
window.onresize = resize;
resize();
} | [
"_setCanvasSize () {\n const p = this._props,\n style = this._canvas.style;\n\n style.display = 'block';\n style.width = '100%';\n style.height = '100%';\n style.left = '0px';\n style.top = '0px';\n }",
"function resizeCanvas() {\n\t\t\t// When zoomed out to less than 100... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
constructor de objeto caja se le pasa un objeto imagen, un vector que es para comparar lo que se le arrastra, una x Y y, el tipo que es un texto de la caja un alto y ancho que es para el tamano de la imagen | function caja(imagen,vector,x,y,tipo,alto,ancho){
this.imagen = imagen;
this.vector = vector;
this.x = x;
this.y = y;
this.tipo = tipo;
this.alto = alto;
this.ancho = ancho;
} | [
"function Rectangulo(x, y, ancho, alto)\n{\n\n this.x = x;\n this.y = y;\n this.ancho = ancho;\n this.alto = alto;\n\n}",
"function escogerImagen(objeto)\n{\n var imagen=\"\";\n\n if(objeto.estado == \"Clear\")\n {\n imagen=\"sol.png\";\n }\n else if(objeto.estado == \"Rain\")\n {\n imagen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Unregister the modal component | unregister() {
this.customModal = undefined;
} | [
"close() {\n this.showModal = false;\n\n this.onClose();\n }",
"function closecancelpanel(){\n $.modal.close();\n }",
"function closeModal() {\n if (showModal) {\n setShowModal(false);\n props.location.openModal = false;\n if (success) {\n history.push(\"/... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines the number of containers that are adjacent to sources. NOTE: THIS MUST MATCH CALCULATIONS IN role.harvester2.determine_destination()!!! | function count_source_containers(room) {
let room_sources = room.find(FIND_SOURCES);
// Go through all sources and all nearby containers, and pick one that is not
// claimed by another harvester2 for now.
// TODO: Prefer to pick one at a source that isn't already claimed.
let retval = 0;
... | [
"calculateTravelCost(previous, next) {\n if (next.row !== previous.row && next.col !== previous.col) {\n return 14;\n }\n return 10;\n }",
"CheckDistance(sourceObject, destinationObject) {\n let distance = Phaser.Math.Distance.Between(sourceObject.x, sourceObject.y, destinationObject.x, dest... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends a training request for a version of a specified LUIS app. This POST request initiates a request asynchronously. To determine whether the training request is successful, submit a GET request to get training status. Note: The application version is not fully trained unless all the models (intents and entities) are ... | trainApplicationVersion(params) {
return this.createRequest('', params, 'post');
} | [
"getVersionTrainingStatus(params) {\n return this.createRequest('', params, 'get');\n }",
"function trainModel() {\n app.models.train(\"pets\").then(\n (response) => {\n console.log(response);\n },\n (error) => {\n console.error(error);\n } \n );\n}",
"async function updateInt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Performs an Elasticsearch query and returns the number of hits. | async countHits(index, type, query) {
const searchOptions = {
index: index,
type: type,
body: query
};
const response = await this._client.count(searchOptions);
return response.count;
} | [
"async count(where = {}, options = {}) {\n return this.em.count(this.entityName, where, options);\n }",
"function searchCardsCount(response, numItems, offset, name) {\n var sql = \"SELECT COUNT(*) FROM cards WHERE card_name LIKE '%\" + name + \"%';\";\n\n connectionPool.query(sql, function(err, re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines if a route should be reused. This strategy returns `true` when the future route config and current route config are identical. | shouldReuseRoute(future, curr) {
return future.routeConfig === curr.routeConfig;
} | [
"get reconfigured() {\n return this.startState.config != this.state.config\n }",
"shouldReset() {\n const { resourceShouldRefresh } = this.optionsTemplate;\n\n return (_.isBoolean(resourceShouldRefresh) && resourceShouldRefresh)\n || (_.isFunction(resourceShouldRefresh) && resourceShouldRef... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts data to .pot string | function convert(data) {
var pot = '';
function append(s) { pot += s + '\n'; }
//Metadata
append('msgid ""');
append('msgstr ""');
append('"Language: en\\n"');
append('"Content-Type: text/plain; charset=UTF-8\\n"');
append('"Content-Transfer-Encoding: 8bit\\n"');
append('"X-Generator: makepot.js ' ... | [
"function formatTacktickMessage(data) {\n var key = data.subtype === 'heading'?'FFP':'FFD';\n key += data.index;\n\n var parts = [\"PTAK\",key].concat(data.values);\n return parts.join(',');\n}",
"function translation() {\n return gulp\n .src(theme.php.src)\n .pipe(wpPot({\n domain: 'wpg_theme',... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sort & redraw all widgets | function redrawWidgets() {
let W = global.WIDGETS;
global.WIDGETS = {};
Object.keys(W)
.sort() // see comment in boot.js
.sort((a, b) => (0|W[b].sortorder)-(0|W[a].sortorder))
.forEach(k => {global.WIDGETS[k] = W[k];});
Bangle.drawWidgets();
} | [
"function selectionSort()\n{\n\tfor (var i = 0; i < dataArray.length; i++)\n\t\t{\n\t\tsSort(i);\n\t\tsleep(500);\n\t\tredraw();\n\t\t}\n}",
"function refreshWidgets() {\n widgetArray = [];\n curGroupWidgets = [];\n curPageWidgets=[];\n s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Applies formatting to the caret postion | function applyCaretFormat() {
var rng, caretContainer, textNode, offset, bookmark, container, text;
rng = selection.getRng(true);
offset = rng.startOffset;
container = rng.startContainer;
text = container.nodeValue;
caretContainer = getParentCaretContainer(selection.getStart());
if (caretC... | [
"handleUnderline(){\n this.sliceString();\n this.post.value = this.beg + \"__\" + this.selection + \"__\" + this.end;\n }",
"formatAll(options) {\n this._textEditor.transact(() => {\n const re = exports._createIsTableRowRegex(options.leftMarginChars);\n let pos = this... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a live data proxy for the given reference. The data of the reference's path will be loaded, and kept insync with live data by listening for 'mutated' events. Any changes made to the value by the client will be synced back to the database. | static async create(ref, defaultValue) {
let cache, loaded = false;
const proxyId = id_1.ID.generate(); //ref.push().key;
let onMutationCallback;
let onErrorCallback = err => {
console.error(err.message, err.details);
};
const clientSubscriptions = []; //, sna... | [
"ref(path = \"/\") {\n return this._mocking ? this.mock.ref(path) : this._database.ref(path);\n }",
"createProxy() {\n\t\treturn new Proxy(this, {\n\t\t\tget(target, prop, receiver) {\n\t\t\t\tlet x = +prop;\n\t\t\t\treturn new Proxy(target, {\n\t\t\t\t\tget(target, prop, receiver) {\n\t\t\t\t\t\tlet z ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
round to nearby lower multiple of base | function floorInBase(n,base){return base*Math.floor(n/base);} | [
"function floorInBase(n,base){return base*Math.floor(n/base)}",
"function roundToGrid(numb) {\n\treturn Math.round(numb/10) * 10;\n}",
"function roundUp(n, up)\n{\n if (n % up == 0)\n return(n);\n else\n return(n + (up - (n % up)));\n}",
"function round5(x)\r\n{\r\n return Math.round(x/5)*5;\r\n}",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
isolate fourth box in LEVEL FOUR | function levelFourGridBox4(j) {
let box4 = 16;
let across = 2;
let nextLine = 12;
if (
(j > box4 && j < box4 + across) ||
(j > box4 + nextLine && j < box4 + nextLine + across)
) {
return true;
} else {
return false;
}
} | [
"function levelFourGridBox5(j) {\n let box5 = 17;\n let across = 2;\n let nextLine = 12;\n if (\n (j > box5 && j < box5 + across) ||\n (j > box5 + nextLine && j < box5 + nextLine + across)\n ) {\n return true;\n } else {\n return false;\n }\n}",
"function updateBoxesLeft() {\n\n if (boxesLeft ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Modifica a la persona por legajo Recibe la persona ya modificada | function ModificarPersona(persona, legajo, tipo) {
listaPersonas.forEach(function (auxPersona, indice) {
if (auxPersona instanceof personas.Alumno) {
if (auxPersona.getLegajo() == legajo && tipo == 'Alumno') {
listaPersonas[indice] = persona;
}
... | [
"editMentor() {}",
"function fModificar(){\n //FRMPanel.fSetTraStatus(\"UpdateBegin\");\n fDisabled(false,\"iEjercicio,\");\n FRMListado.fSetDisabled(true);\n }",
"update(newPerson) {\n // condLog(\"Update the Ahnentafel object\", newPerson);\n\n if (newPerson && newPerson._data.Id) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pour faire comme en ruby : Projet.new() | static new (projet_id)
{
return new Projet(projet_id)
} | [
"inicializa(){\n globais.placar = criarPlacar();\n }",
"function libro(indice,isbn,titulo,autor,anio,editorial){\n\tthis.indice=indice;\n\tthis.isbn=isbn;\n\tthis.titulo=titulo;\n\tthis.autor=autor;\n\tthis.anio=anio;\n\tthis.editorial=editorial;\n}",
"function Personne(nom, prenom, pseudo) {\n this.nom ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
func to add items to player's inventory | function addToInventory(toAdd) {
inventory.push(toAdd)
console.log('You have added ' + toAdd)
} | [
"function addToInventory() {\n\t// Querying the Database\n\tconnection.query(\"SELECT * FROM products\", function (err, res) {\n\n\t\tif (err) throw err;\n \n // Setting up our results in the console.table NPM\n consoleTable(\"\\nCurrent Inventory Data\", res);\n \n\t\t// Inquirer asking... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hide all payment methods on load | function hideAllPaymentOptions() {
creditCard.style.display = 'none';
paypal.style.display = 'none';
bitcoin.style.display = 'none';
} | [
"function hidePaymentOptions() {\n // loop through paymentOptions object and set display to none\n for (prop in paymentOptions)\n toggleView(paymentOptions[prop], false);\n }",
"function setupPaymentMethods17() {\n const queryParams = new URLSearchParams(window.location.search);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Paste HTML at caret | function pasteHtmlAtCaret(html, selectPastedContent) {
var sel, range;
if (window.getSelection) {
// IE9 and non-IE
sel = window.getSelection();
if (sel.getRangeAt && sel.rangeCount) {
range = sel.getRangeAt(0);
range.deleteContents();
// Range.create... | [
"handleCopyCut(event) {\n event.stopPropagation();\n let activeNode = this.getActiveNode();\n if(!activeNode) return;\n\n // If nothing is selected, say \"nothing selected\" for cut\n // or copy the clipboard to the text of the active node\n if(this.selectedNodes.size === 0) {\n if(event.type... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Main function for mask setting T is textarea or input type text Mask is string with mask, RegExp syntax color je backgroundColor set by error or null sndsrc is sound file played by error or null sndlen is length of file in msec, it could be longer due delay before starting playing Ins is insert key value (0 Insert mode... | function SetMask(T,Mask,Ins,color,sndsrc,sndlen,digits){
MS.Digits;
if(digits==null) digits = Formats.Digits;
if(digits){
digits = digits.split(digits.charAt(0)).slice(1);
for(var i=0;i<10;i++) digits[i] = new RegExp(ToRegExp(digits[i]),"g");
}
ME.Digits;
var Last = T.value==null?T.innerHTML:T.value,... | [
"function Test(v){\r\nif(digits) for(var i=0;i<10;i++) v = v.replace(digits[i],i);\r\nif(v.search(RMaskEdit)==-1){ \r\n if(color) {\r\n T.style.backgroundColor = color;\r\n if(BTimeout) clearTimeout(BTimeout);\r\n BTimeout = setTimeout(function(){T.style.backgroundColor = oldcolor;},200);\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
> false /Task 6: The function returns the average of the length of two words passed in as argument. | function computeAverageLengthOfWords(word1, word2){
return (word1.length + word2.length)/2;
} | [
"function averageWordLength(str) {\n\treturn Math.round(str.replace(/[^\\w\\s]/g,'').split(\" \").map(x => x.length).reduce((x, i) => x + i) / str.split(\" \").length * 100) / 100;\n}",
"function average(txt){\n if (txt.length === 0){\n return 0;\n } else{\n let strNoPunctuation = txtNoPunctua... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sets current location/url to that of the biggest image on the page, as determined by widthheight | function viewBiggestImage() {
var list = document.body.getElementsByTagName("img");
if(list.length <= 0)
return;
var areaMax = 0;
var biggestImageIndex = 0;
for(var i = 0; i < list.length; i++){
if(list[i].src === "") // skip img tags that don't have a src; they aren't displayed
... | [
"function setShowImgSize(url, callback) {\n $('<img/>').attr('src', url).on('load', function() {\n var w = this.naturalWidth,\n h = this.naturalHeight,\n s = imgShowMaxSize;\n if (w > s || h > s) {\n if (w > h) {\n h = Math.floor(h * (s / w));\n w = s;\n } ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function which indicates that we are not cleaning git repo | function dontClearRepo(callback) {
addCheckMark(callback);
} | [
"function ensureGitClean(done) {\n git.status(function(err, out) {\n if (err) { throw err; }\n if (!/working directory clean/.exec(out)) {\n throw new Error('Git working directory not clean, will not bump version');\n }\n });\n\n done();\n}",
"isClean () {\n const build_path = path.join(th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
recupera todos los conceptos de pagos, cobros o ajustes para popular selects | function get_conceptos () {
$.ajax({
type: 'GET',
url: '/api/movimiento/getconceptos'
})
.done(function (data) {
conceptos = JSON.parse(JSON.stringify(data))
var select_compras = ''
$('#select-compras').empty()
$('#select-ventas').empty()
$('#select-ajustes').empty()
... | [
"function checaFormaPagto(formaPagtoCadastrada) {\n\n for (var i = 0; i < $scope.formaPagtosAvista.length; i++) {\n for (var j = 0; j < formaPagtoCadastrada.length; j++) {\n if ($scope.formaPagtosAvista[i].Id === formaPagtoCadastrada[j].FormaPagtoId &&\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add Driver form to database. Not used yet | function addDriver(driver){
return db('drivers')
.insert(driver)
.returning(['id',"driver_name"])
} | [
"function bindSelectedToForm() {\n saveKPForm.find('#kp-id').val(selected.id);\n saveKPForm.find('#kp-number').val(selected.number);\n saveKPForm.find('#kp-name').val(selected.title);\n kpLevelList.val(selected.kLevel).trigger('change');\n saveKPForm.find('#kp-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
dit is de draw functie die alles tekent op een bepaald moment/een bepaalde scene | function draw() {
if (currentScene === 1) {
drawTitleScreen();
drawPlayButton();
drawPractiseButton();
drawRules();
hint.draw();
hint.update();
goalSign();
}
if (currentScene === 2) { // zoals je kan zien wordt dit getekent bij scene 2
... | [
"shop() {\n // this sets the current scene to \"shop\"\n this.current = \"shop\";\n \n // this draws the floor\n background(148, 82, 52);\n \n //this draws the shelves\n for (let i = 0; i < 4; i++) {\n this.vShelf(50 + this.pxl * 3 * i, 400);\n }\n \n for (let i = 0; i < 2; i++... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This set the history to allow back/forwards buttons. This is for the user group administration list user groups page. | function setHistoryUserGroupList(offset, size, ordinal, direction) {
'use strict';
if (offset === undefined || offset === null || isNaN(offset)) {
offset = 0;
}
if (size === undefined || size === null || isNaN(size)) {
size = 20;
}
if (ordinal === undefined || ordinal === null || ordin... | [
"function setHistoryUserGroupAdd() {\n 'use strict';\n \n var historyState = {};\n var content = '';\n historyState.pageUrl = 'user_group.php';\n historyState.pageAttributes = 'a=add';\n historyState.pageTitle = butrGlobalConfigurations.company_name + ' | Butr | '+butr_i18n_GroupAdministration+' | '+butr_i18... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates new row in db NewsArticle with ned article | createOne (json: jsonUpdate, callback: mixed) {
let val = [json.headline, json.category, json.contents, json.picture, json.importance];
super.query(
"insert into NewsArticle (headline,category,contents, picture, importance) values (?,?,?,?,?)",
val,
callback
);
} | [
"function User_Insert_Articles_Articles0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 9\n\nId dans le tab: 47;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 48;\nsimple\nNbr Jointure: 1;\n Joint n° 0 = produit,ar_produit,pd_numero\n\nId dans le tab: 49;\nsimple\nNbr Jointure: 1;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function for adding new story to page | async function addNewStoryOnPage(evt){
evt.preventDefault();
//get input value
const title = $('#story-title').val();
const author = $('#story-author').val();
const url = $('#story-url'). val();
//updates storyList with new story you want to submit
await storyList.addStory(currentUser, {title, author, ur... | [
"function generateNewStory(newStory) {\n var ownStoryStatus = \"\";\n if(LOGGED_IN){\n ownStoryStatus = checkOwnStory(newStory);\n }\n const result = generateStoryHTML(newStory, ownStoryStatus);\n\n $allStoriesList.append(result);\n }",
"function addStoryIdToUrl() {\n if (xhr.readyStat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function increase or decrease the percentage of the element to stretch | function stretch() {
const pixelScrolled = window.scrollY;
const viewportHeight = window.innerHeight;
const totalHeightScrollable = main.scrollHeight;
// convert pixels to percentage
const pixelsToPercentage =
(pixelScrolled / (totalHeightScrollable - viewportHeight)) * 120;
// set the width of the flui... | [
"function expand(percent) {\n\ttopp.position.y = 3.5 * percent;\n\tcpu.position.y = 1 * percent;\n\tgpu.position.y = 1 * percent;\n\tram.position.y = 2 * percent;\n\tssd.position.y = 2 * percent;\n\tbattery.position.y = -2 * percent;\n\tdvd.position.y = -1 * percent;\n\tbus.position.y = -2 * percent;\n\tbottom.posi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sanitizes given action with given function. | function sanitizeAction(actionSanitizer, action, actionIdx) {
return __assign({}, action, { action: actionSanitizer(action.action, actionIdx) });
} | [
"function actionCreator(action){\n return action\n}",
"function _sanitize(value) {\n\t\t\treturn (\"\" + value).replace(/[^a-zA-Z0-9_]/g, \"\").replace(/^_+/, \"\");\n\t\t}",
"function swallow(action, name) {\n return function(result) {\n return action(result).catch(function(e) {\n console.error... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Apply the user's cookie preferences Deletes any cookies the user has not consented to. | function resetCookies () {
let options = getConsentCookie()
// If no preferences or old version use the default
if (!isValidConsentCookie(options)) {
options = JSON.parse(JSON.stringify(DEFAULT_COOKIE_CONSENT))
}
for (const cookieType in options) {
if (cookieType === 'ver... | [
"static clearCookie() {\n var cookies = document.cookie.split(\";\");\n\n for (var i = 0; i < cookies.length; i++) {\n var cookie = cookies[i];\n var eqPos = cookie.indexOf(\"=\");\n var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;\n if (name.trim().toLowerCase() == 'voti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
show Hide >> NewJob , AssistJob, Others in TimeSheet | function showHideAccTimeSheet(type)
{
if(type=="NewJob")
{
document.getElementById("assistJob").style.display="none";
document.getElementById("others").style.display="none";
document.getElementById("newJob").style.display="";
document.getElementById("StartStop").sty... | [
"function disableFunctionOnStartTimeSheet()\r\n {\r\n\t \r\n\t document.getElementById(\"timeSheetMainFunction\").style.display=\"none\"; \r\n\t document.getElementById(\"showStatusOfTimeSheet\").style.display=\"\"; \r\n\t \r\n\t \r\n }",
"function hideAppliedJobs() {\n for (let appliedJob of g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
divides the number at the end of string one by the number at the start of string two and merges the result returning a new expression string | function divide(str1, str2) {
var end = endNumber(str1);
var start = startNumber(str2);
//if missing a value or divisor is 0 evaluation is impossible
if(start.value === undefined || end.value === undefined) {
throw new Error("malformed expression");
}
if (start.value === 0) {
throw ... | [
"function multiply(str1, str2) {\n var end = endNumber(str1);\n var start = startNumber(str2);\n //if missing a value evaluation is impossible\n if(start.value === undefined || end.value === undefined) {\n throw new Error(\"malformed expression\");\n }\n\n var product = end.value * start.valu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gibt eine Funktion auf dem clioent die heist connect und die gibt er die url mit. Bedingung wenn du nach 8 sekunden keine antwort kriegst hats nicht geklappt. handle connect connecthandler receives two standard parameters, an error object and a database client object | function handleConnect(_e, _client) {
if (_e)
console.log("Unable to connect to database, error: ", _e); //error wird ausgegeben wenn es nicht geklappt hat
else {
console.log("Connected to database!"); //verbunden zur datenbank
db = _client.db(databaseName); // wir speichern uns die db a... | [
"function errHandler(err){\n\tif (err){\n\t\tconsole.log(`DB ERROR [${err.code}]: ${err.sqlMessage}`)\n\t\tprocess.exit();\n\t}\n\telse{\n\t\tconsole.log('DB connected successfully\\n');\n\t}\n}",
"function connect() {\n client.connect(function (_remote, conn) {\n self.remote = _remote; \n clearI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
showing views after clicking on the links | function navigateTo() {
let viewName = $(this).attr('data-target');
showView(viewName)
} | [
"viewWasClicked (view) {\n\t\t\n\t}",
"function displayView(view) {\n console.log(view);\n // hämta alla sidor/get all views\n const pageView = document.getElementById(\"page1\") \n const loginView = document.getElementById(\"logIn\") \n const varningView = document.getElementById(\"varning\") \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Announce Race Car Number | function announceRaceCarNumber(delay){
if(soundDelayTimer == delay){
carPlaces[0].myAnnc.play();
}
} | [
"function rentalCar (name,age){\n\tif(age < 21){\n\treturns 'You cannot have the keys'\t\n\t}\n\treturn \"Have fun driving\"\n}",
"function takeANumber(katzDeliLine,name){\n\n // add new customers name to the line\n katzDeliLine.push(name);\n\n var position = katzDeliLine.length;\n //find the index of the per... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given an index or array of indices, returns the word or array of words they encode. | idxToWord(idx) {
if(Array.isArray(idx)) {
var result = [ ];
for(var i = 0; i < idx.length; i++)
result.push(this._idxToWord[idx[i]]);
return result;
} else {
return this._idxToWord[idx];
}
} | [
"idxToNormIdx(idx) {\n if(Array.isArray(idx)) {\n var result = this.idxToWord(idx);\n return this.wordToNormIdx(result);\n } else {\n var word = this.idxToWord(idx);\n return this.wordToNormIdx(result);\n }\n }",
"wordToIdx(word) {\n if(Ar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
topLeft > \/ / \ < bottomRight Creates wall corners based on parameters worldPivot (Vector3) Centered pivot that would be spaceApart/2 away from every wall if all are created spaceApart (float) The distance between walls on the same axis (distance from up to down and from left to right) bottomLeft, topLeft, topRight, b... | function makeCorners( worldPivot, spaceApart, bottomLeft, topLeft, topRight, bottomRight, material ) {
var object;
var box;
if ( bottomLeft ) {
object = new THREE.Mesh( new THREE.CylinderGeometry( WallThickness / 2 - 2.25, WallThickness / 2 - 2.25, WallLength, 3 ), material );
object.position.set( worldPivot.... | [
"function makeWalls( worldPivot, spaceApart, left, up, right, down, material ) {\n\n\tvar object;\n\tvar box;\n\n\t// right\n\tif ( right ) {\n\n\t\tobject = new THREE.Mesh( new THREE.BoxBufferGeometry( spaceApart, WallLength, WallThickness, 4, 4, 4 ), material );\n\t\tobject.position.set( worldPivot.x, 50, worldPi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find the inverse tangent (degrees). | function atan (tangent) { return deg(Math.atan(tangent)); } | [
"function tan (angle) { return Math.tan(rad(angle)); }",
"function theta_oh(o,h) {\n console.log((Math.asin(o/h))*180/Math.PI)\n}",
"function getDegreeValue() {\r\n var transformValue = ballStyle.transform;\r\n var values = transformValue.split('(')[1].split(')')[0].split(',');\r\n var a = values... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This will remove all whitespace on the left of the friend name | function removeWhiteSpace(friend) {
for (var i = 0; i < friend.length; i++) {
if (friend.charAt(i) !== ' ') {
return friend.slice(i);
}
}
} | [
"function removeWhiteSpaceFromUsername(username) {\n if (username) return username.replace(/\\s/g, \"\")\n}",
"function tinyFriend(friends) {\n let tinyName = friends[0];\n \n for (let i = 0; i < friends.length; i++) {\n let friendName = friends[i];\n if (friendName.length < tinyName.lengt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
buildLiteralMap returns a map of literal from given text and separators | function buildLiteralMap(text, sep) {
const literalMap = new Map();
let literal = "";
// traverse through the text. find literals and build map[literal] = count
for (const char of text) {
if (sep.has(char)) {
if (literalMap.has(literal)) {
const count = literalMap.get(literal)
litera... | [
"function searchLiterals(literalInputPipes, text, sep) {\n const literalMap = buildLiteralMap(text, sep)\n const literalInputArray = literalInputPipes.split('|')\n\n let outputTotal = {\n \"total\": literalInputArray.length,\n \"result\": []\n }\n Object.freeze(outputTotal)\n\n for (const literal of lit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
dispose and unused rows | disposeRows() {
// keep rows still in use, remove the others
const keepers = [];
this.rows.forEach((row) => {
if (row.updateReference === this.updateReference) {
keepers.push(row);
} else {
this.sceneGraph.root.removeChild(row);
}
});
this.rows = keepers;
} | [
"dispose() {\n var element = table.element;\n if (element) {\n element.innerHTML = \"\";\n }\n this.stopListening(this.table);\n this.table = null;\n this.slider = null;\n }",
"dispose() {\n var table = this.table;\n var element = table.element;\n if (element) {\n $.empty(ele... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wrap build artifact in abstract contract | static async fromBuildArtifact(buildArtifact, links, artifactName = 'UntitledContract') {
return new AbstractContract(buildArtifact.abi, buildArtifact.bytecode, buildArtifact.networks, links, artifactName);
} | [
"function ParentThirdPartyInterface() {}",
"contract(contractName) {\n contractName = this.normalizeName(contractName);\n let sourcePath = this.getSourcePath(contractName);\n\n if (!this.contractExists(contractName))\n throw new Error(`Contract source not found: ${sourcePath}`);\n\n\n let dataPa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the catalog object so that the pages object can be found /Root specifies the /Catalog object number | async determineCatalog() {
const rootMatch = /\/Root\s*\d+\s*0\s*R/gm
const root = this.docString.match(rootMatch)[0]
const catalogObjNum = root.match(/\d+(?!\s+R)/gm)[0]
this.catalogObj = this.getObjectAt(catalogObjNum)
await this.determineTrailer()
} | [
"function find() {\n isSearched = false;\n var storeLocatorForm = app.getForm('storelocator');\n storeLocatorForm.clear();\n\n var Content = app.getModel('Content');\n var storeLocatorAsset = Content.get('store-locator');\n\n var pageMeta = require('~/cartridge/scripts/meta');\n pageMeta.update... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The AWS::EC2::SecurityGroupEgress resource adds an egress rule to an Amazon VPC security group. When you use the AWS::EC2::SecurityGroupEgress resource, the default rule is removed from the security group. Documentation: | function SecurityGroupEgress(props) {
return __assign({ Type: 'AWS::EC2::SecurityGroupEgress' }, props);
} | [
"function EgressMessage(ingressMessage) {\n\tthis.req_ = ingressMessage;\n\tthis.headed_ = false;\n\tthis.keepAlive_ = false;\n}",
"function EgressOnlyInternetGateway(props) {\n return __assign({ Type: 'AWS::EC2::EgressOnlyInternetGateway' }, props);\n }",
"async function createNetworkSecurity... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sets the height map by calling the height generator to the chunk | SetHeightmap(img) {
const heightmap = new HeightGenerator(
new Heightmap(this._params.guiParams.heightmap, img),
new THREE.Vector2(0, 0), 250, 300);
for (let k in this._chunks) {
this._chunks[k].chunk._params.heightGenerators.unshift(heightmap);
this._chunks[k].chunk.Rebuild();
... | [
"set requestedHeight(value) {}",
"function setHeightChangeCallback(callback) {\n // pass the callback along to the sub blocks\n truePart.setHeightChangeCallback(callback);\n falsePart.setHeightChangeCallback(callback);\n }",
"changeHeights() {\r\n //1) Initalize height of four cor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
nANDI: buttons ANDI (small code) // Created By Social Security Administration // ==========================================// NOTE: This only contains the code for finding errors and none for displaying the error code | function init_module() {
//create nANDI instance
var nANDI = new AndiModule("8.1.0", "n");
nANDI.index = 1;
//This object class is used to store data about each button. Object instances will be placed into an array.
function Button(element, index, role, elementInTabOrder, nameDescription, alerts, a... | [
"function insertAndiBarHtml(){\n\t\tvar menuButtons = \n\t\t\"<div id='ANDI508-control-buttons-container'>\"\n\t\t\t+\"<button id='ANDI508-button-relaunch' aria-label='Relaunch ANDI' title='Press To Relaunch ANDI' accesskey='\"+andiHotkeyList.key_relaunch.key+\"'><img src='\"+icons_url+\"reload.png' alt='' /></butt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attaches the listeners responsible for creating a resizer for each image, except for images inside the HTML embed preview. | _setupResizerCreator() {
const editor = this.editor;
const editingView = editor.editing.view;
editingView.addObserver( ImageLoadObserver );
this.listenTo( editingView.document, 'imageLoaded', ( evt, domEvent ) => {
// The resizer must be attached only to images loaded by the `ImageInsert`, `ImageUpload` or... | [
"_thumbnailsBoxResized() {\n this._updateSize();\n this._redisplay();\n }",
"function initializeEvents(){\n var images = getImgArray(); \n images.forEach(addConcentrationHandler);\n}",
"function imsanity_resize_images() {\n\t// start the recursion\n\timsanity_resize_next(0);\n}",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Marks the control and all its descendant controls as `touched`. | markAllAsTouched() {
this.markAsTouched({ onlySelf: true });
this._forEachChild((control) => control.markAllAsTouched());
} | [
"_handleFocusChange() {\n this.__focused = this.contains(document.activeElement);\n }",
"checkValidity() {\n this.select.checkValidity();\n }",
"handleBlur() {\n this._focussed = false;\n }",
"isNotFocused () {\n this._content.setFocusedFalse()\n }",
"function checkboxFocusReset() ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PROFILE Profile main content Used to find email addresses directly available on the profile. Recruiter : $("profileugc") Sales Navigator : $("background") Free LinkedIn : $("background") | function getMainProfileContent(html) {
var $html = $('<div />',{html:html});
if (isRecruiter()) {
profile_main_content = $html.find("#profile-ugc").html();
} else {
profile_main_content = $html.find("#background").html();
}
return profile_main_content;
} | [
"function currentProfile() {\n return {\n handle: $('#handle').text(),\n email: $('#email').text(),\n keys: [{\n name: 'default',\n signature: $('.signature').first().text()\n }]\n };\n}",
"function getStaffByGender(url)\n {\n \n jQue... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
insert element li in ul function | function InsertLiInUL() {
ul.insertAdjacentElement('beforeend', li);
} | [
"function insertElementLiInUL() {\n ul.insertAdjacentElement('beforeend', li);\n}",
"function list() {\r\n var x = document.getElementsByTagName(\"li\")[9];\r\n x.setAttribute(\"id\", \"list\");\r\n }",
"function addListItem(contentToAdd, itemName = \"li\") {\n var listToUse = document.getE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A comment can contain an image or avatar. | function CommentAvatar(props) {
var className = props.className,
src = props.src;
var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('avatar', className);
var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__["q" /* getUnhandledProps */])(CommentAvatar, props);
var ElementType = Object(__WEBP... | [
"newCommentDomAvatar(comment){\n return (`<li class=\"comment-list-element\" id=\"comment-${comment._id}\"> \n\n <div class=\"the-comment\">\n \n <div class=\"commentor-dp\">\n <img src=\"${comment.user.avatar }\" alt=\"${ comment.u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Empties the list of folders on the page | function clearBookmarkFolders() {
while ($bookmarksList.children.length > 0) {
$bookmarksList.removeChild($bookmarksList.firstChild);
}
} | [
"resetFolders(){\n // clear folder paths \n this._folderPaths = [];\n\n // update file\n return this.update();\n }",
"function clearHomepage() {\n //TODO Change the homepage from empty context to user defined\n data.getPage(space.homepage.id, function (response... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reset existing doughnut chart | clearDoughnutChart() {
while (this.chartCategory.firstChild) {
this.chartCategory.removeChild(this.chartCategory.firstChild);
}
let canvas = document.createElement("canvas");
canvas.id = "chart-categories";
canvas.width = 100;
canvas.height = 350;
this.chartCategory.appendChild(canva... | [
"function clearChart() {\r\n\td3.select('#chartDiv').selectAll('svg').remove();\r\n}",
"function reset() {\n svg_g.selectAll(\".brush\").call(brush.move, null);\n svg_g.selectAll(\".brushMain\").call(brush.move, null);\n }",
"function makeClimbChart(total, gave, got)\n{\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the distance of the character to a point in the world. | function distance_to_point(x, y) {
return Math.sqrt(Math.pow(character.real_x - x, 2) + Math.pow(character.real_y - y, 2));
} | [
"playerDistTo(location) {\n return location.distTo(this.getPlayerPos());\n }",
"distanceTo (x, y) { return this.get(x, y).dist }",
"getDistance(x, y) {\n return Math.sqrt(Math.pow(this.x - x, 2) + Math.pow(this.y - y, 2));\n }",
"get distance(){\n\t\treturn(google.maps.geometry.spherical... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make a request to the ENG1003 campusnav web service for Clayton campus paths. | function getClaytonPaths()
{
let data = {
campus: "clayton",
callback: "initPage"
};
jsonpRequest("https://eng1003.monash/api/campusnav/", data);
} | [
"function getCampgroundById(parkCode) {\n return axios\n .get(`https://developer.nps.gov/api/v1/campgrounds?parkCode=${parkCode}&api_key=O4VdhmolNStlPLj2bo2DfPKWks3F8J9xfihpGqTf`)\n .then(result => result.data);\n}",
"async function apiColocRequest() {\n let myPromise = new Promise(function(myRe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clear opponent after he's lost | function resetOpp(){
$("#opponent-pic").replaceWith(originalStateOppPic.clone(true));
$("#oppStats").replaceWith(originalStateOppStats.clone(true));
players.finishGame = false;
players.winsCount++;
} | [
"function resetTurn() {\n playerBet = 0;\n}",
"function removeGame() {\n\t//todo: add formal message telling client other player disconnected\n\tsocket.emit('delete game', gameID);\n\tclient.fleet = ['temp2', 'temp3', 'temp4', 'temp5'];\n\tenemyFleet = new Array(4);\n\tclient.clearGrids();\n\tsocket.off(gameI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |