query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Function : mInitializeDropDownList Description : Initialize a select list | function oField_mInitializeDropDownList(p_id, p_list, p_filter, p_placeholder) {
if (typeof p_filter === 'undefined') p_filter = "";
if (typeof p_placeholder === 'undefined') p_placeholder = "Select...";
var h_data = [];
if (p_list !== "") {
h_data = oLists_mGetList(p_list);
}
$("#" + p_... | [
"function initierDropDowns() {\r\n console.log(\"initierDropDowns\");\r\n // Fyll inn dropdown for våpen\r\n initierDropDown(\"vaapen\", \"#selectVaapen\");\r\n initierListView(\"vaapen\", \"#vaapenList\");\r\n\r\n}",
"function initierDropDown(tbl, selId) {\r\n // Fyll inn dropdown\r\n db.transaction(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate a message asynchronously in 300ms. Returns a promise which resolves into the message object | async function generateMessageAsync() {
var messagePromise = new Promise(function(resolve, reject) {
setTimeout(() => {
const newMessage = {
hi: "async",
id: Math.round(Math.random() * 100)
};
resolve(newMessage);
}, 300);
});
return messagePromise;
} | [
"_generateMessage() {\n if (this._stop) return this._closeConnection();\n\n const genString = this._createMessage();\n const multiQuery = this._client.multi();\n multiQuery.set(LAST_GENERATOR_TIME, 1)\n .expire(LAST_GENERATOR_TIME, 10)\n .rpush(this._queueName, genS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Formats a label given a date, number or string. | function _formatLabel(label) {
if (label instanceof Date) {
label = label.toLocaleDateString();
} else {
label = label.toLocaleString();
}
return label;
} | [
"function format_number(label, unit, ndec, dec, grp) {\n if (isNaN(label)) return '';\n if (unit === undefined) unit = '';\n if (dec === undefined) dec = '.';\n if (grp === undefined) grp = '';\n // round number\n if (ndec !== undefined) {\n label = label.toFixed(ndec);\n } else {\n label = label.toStr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
OrionLookup Node for Looking Up Orion User & Group info. | function OrionLookup(config) {
RED.nodes.createNode(this, config);
var node = this;
node.orion_config = RED.nodes.getNode(config.orion_config);
node.username = node.orion_config.credentials.username;
node.password = node.orion_config.credentials.password;
node.status({fill: 'yellow', shape: '... | [
"function localLookup (callback) {\n bo.runtime.sendMessage({\n type: 'localLookup',\n payload: {\n userId: config.userId\n }\n }, callback);\n}",
"async getOuRoot() {\n const d2 = this.props.d2;\n const api = d2.Api.getApi();\n try{\n //get OU tree root... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function scope code here can not use bikeName | function myFun2() {
var bikeName = 'Pulsar'
//code here can use bikeName
} | [
"function getBaseItem(item_name,auction){\n let tiers = baseItems.tiers;\n let reforges = baseItems.reforges;\n let bases = baseItems.bases;\n\n //Step 0: If this is an enchanted book, handle it with getBookBase()\n if(item_name === \"Enchanted Book\"){\n return getBookBase(auction);\n }\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prompts for params, confirms, and uploads to Qualtrics | function main() {
getParams().then((params) => {
const prompt = new Confirm(`Please confirm:\n\tYour Qualtrics API token is: "${params.token}"\n\tYour csv file is: "${params.path}"`);
prompt.run().then((answer) => {
if(!answer) {
process.exit(1);
}
parseCSV... | [
"function onBtnAskClick(e) {\n e.preventDefault();\n \n // find out which of the [Choice][Range][Free] checkboxes are checked\n var ckb = null;\n for (i = 0; i < ckbChoices.length; i++) {\n if (ckbChoices[i].checked) {\n ckb = ckbChoices[i];\n break;\n }\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns array of id pairs, for the specified tag type(i.e. all item flags) item is JSON object from API tagArrayName is the name of the tag variable in API item tagDBName is the column label in DB indexer is the INDEXER object to translate tags to their DB IDs | function castTagArrayForDB(item, tagArrayName, tagDBName, indexer) {
let result = []
let array = item[tagArrayName]
if (array && array.length > 0){
array.forEach((value) => {
let next = {item_id: item.id}
next[tagDBName] = indexer[value]
result.push(next)
})
}
return result
} | [
"function getDocIds(items) {\n\t\tvar docIds = [];\n\t\tfor ( var i in items ) {\n\t\t\tdocIds.push(items[i].id);\n\t\t}\n\t\treturn docIds;\t\t\n\t}",
"generateTags() {\n var tagArray = []\n this.props.tags.forEach((tag, index) => {\n tagArray.push(<Badge id={\"product-tag-\" + index}>{tag}</Badge>)\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts a unit list into a dict of slot friendly lists The dict key is the unit's owner id | function convertUnitList(unitList) {
let batches = {}
for (let unit of unitList) {
if (!batches[unit.OwnerId]) batches[unit.OwnerId] = []
batches[unit.OwnerId].push(unit)
}
return batches
} | [
"function getAllUnits(){\r\n var townArray = uw.ITowns.getTowns(), groupArray = uw.ITowns.townGroups.getGroups(),\r\n \r\n unitArray = {\"sword\":0, \"archer\":0, \"hoplite\":0, \"chariot\":0, \"godsent\":0, \"rider\":0, \"slinger\":0, \"catapult\":0, \"small_transporter\":0, \"big_transporter\":0,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stop the timer on the current tab | function stopTimer(tabId) {
if (tabIntervals[tabId]) {
window.clearInterval(tabIntervals[tabId].intervalID);
tabIntervals[tabId] = null;
}
} | [
"function stopTimeCounter() {\n\tclearInterval(interval);\n}",
"function stopTimer() {\n $stopBtn.attr('disabled', 'true');\n\tclearInterval(interval)\n\t$startBtn.removeAttr('disabled');\n}",
"function stopBattleTimer() {\n clearInterval(battleIntervalId); //stops the interval\n }",
"function s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Iteration methods setTransform(func, n) set the transformation to be appled to the root element, over n times. | function setTransform(func, n) {
if (n === undefined) { n = 1; }
_func = func;
_n = n;
_apply();
} | [
"function iterate(transN, transFunc) {\n\n var _root = this; // the calling object (a raphael element or iteration group)\n var _elements = [];\n var _func, _n = 1;\n\n // ------------------------\n // Iteration methods\n // ------------------------\n\n // - setTransform(func, n)\n // set th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Event handlers / Event handler for when a slot is ready for an ad to rendered | function onReady(slotMethods, event) {
const slot = event.detail.slot;
/* istanbul ignore else */
if (slot.server === 'gpt') {
slot.gpt = {};
// extend the slot with gpt methods
utils.extend(slot, slotMethods);
// setup the gpt configuration the ad
googletag.cmd.push(() => {
slot
.defineSlot()
... | [
"function onVPAIDLoad()\n { \n lkqdVPAID.subscribe(function() { lkqdVPAID.startAd(); }, 'AdLoaded');\n }",
"function contentEndedListener() {\n adsLoader.contentComplete();\n}",
"_checkForSideSlotted() {\n let sideslots = [\n this.shadowRoot.querySelector('#side-nav'),\n this.shadow... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set a relative path prefix | function setPathPrefix(prefix) {
pathPrefix = prefix;
} | [
"function CP_setCssPrefix(val) {\r\n this.cssPrefix = val;\r\n}",
"setPrefix(prefix, uri) {\n if (prefix.slice(0, 7) === 'default') return // Try to weed these out\n if (prefix.slice(0, 2) === 'ns') return // From others inferior algos\n if (!prefix || !uri) return // empty strings not suitable\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Logs all file operations via the verbose event stream, indented. | function logFileOp(message) {
events.emit('verbose', ' ' + message);
} | [
"function logFileChange(event) {\n\t\tvar fileName = require('path').relative(__dirname, event.path);\n\t\tconsole.log('[' + 'WATCH'.green + '] ' + fileName.magenta + ' was ' + event.type + ', running tasks...');\n\t}",
"log() {\n console.info('Internal Playlist Model:')\n this.items.forEach((video,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a client from the pool and runs operation(client). operation(client) should return a promise. After that promise resolves, the client is returned to the pool. After the client is returned to the pool, _run itself resolves to the same thing operation(client) resolved to. | _run(operation) {
return new Promise((resolve, reject) => {
this.pool.connect((err, client, done) => {
if (err) {
// We couldn't even get a client.
reject(err);
return;
}
operation(client).then((result) => {
done();
resolve(result);
... | [
"invoke() {\n return __awaiter(this, void 0, void 0, function* () {\n const inv = new invocation_1.Invocation();\n inv.connection = yield this.pool.connect();\n return inv;\n });\n }",
"getRPCClient () {\n return rpcClient;\n }",
"async request(command, ...a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
remove robbie intro video | function removeIntroVideo() {
$('.intro-video-container').remove();
} | [
"function instructionVideo() {\n\t $(\".game-container\").append(`\n\t <section class='intro-video-container video-container'>\n\t <video poster=\"assests/zoe-instructional-vid.mp4\" class='intro-video' id=\"bgvid\" playsinline autoplay>\n\t <source src=\"assests/zoe-instructional-vid.mp4\" type=\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a set of all the known attributes of a single game. Under the hood, this is performing multiple sql joins to collect all the data. | function getGameAttributes(game_id) {
return pool.getConnection().then(connection => {
const promise = Promise.all([
getMechanics(connection, game_id),
getCategories(connection, game_id),
getArtists(connection, game_id),
getDesigners(connection, game_id),
getFamilies(connection, gam... | [
"fetchAttributes() {\n let result = {};\n Object.values(this.attributes).map(attribute => {\n result[attribute.type] = Utility.getInstance().clone(attribute);\n })\n this.traits.map(trait => {\n Object.values(trait.fetchAttributes()).map(attribute => {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Definitions: .attrs / Test: .attrs should return attributes | function attrsShouldReturnAttributes() {
expect(element.attrs(fixture.el.firstElementChild))
.toEqual({
class: "class",
id: "id"
})
} | [
"getAttributeList() {\n this.ensureParsed();\n return this.attributes_;\n }",
"attribs(arg) {\n let argtype = _Util_main_js__WEBPACK_IMPORTED_MODULE_1__.default.getType(arg).toUpperCase();\n switch (argtype) {\n case \"OBJECT\":\n this._elem.attribs(arg);\n return this;\n case... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find a role by TITLE and Update the description Return success message if updated | update(req, res) {
Role.findOne({ where: { title: req.params.title } })
.then((role) => {
if (role) {
role.updateAttributes({
description: req.body.description,
}).then(() => {
if (req.body.description === '') {
res.status(400).send({ message: ... | [
"updateRole (roleId, inheritRoleId = undefined, description = undefined) {\n assert.equal(typeof roleId, 'string', 'roleId must be string')\n if (typeof inheritRoleId !== 'undefined') {\n assert.equal(typeof inheritRoleId, 'string', 'inheritRoleId must be string')\n }\n if (typeof description !== '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks if a value has a given bit set to 1 | function bit_isset( value, mask )
{
return ( value & mask ) != 0;
} | [
"function is0thSet(value) {\n return (value & 0b01);\n}",
"function are3rdAnd4thBitsSet(value) {\n return (value & 0b11000) === 0b11000;\n}",
"static checkBitmask(bitLength, buffer) {\n const bits = new Uint1Array(buffer.buffer)\n const checkBits = bits.slice(0, bitLength)\n\n return checkBits[0] == ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Searches the array using custom function and returns item if found. Will call `matches` function on all items of the array. If return value evaluates to `true`, index is returned. Otherwise returns `undefined`. | function find(array, matches) {
var index = findIndex(array, matches);
if (index !== -1) {
return array[index];
}
} | [
"function find(arr, callback){\n for (let i=0; i<arr.length; i++){\n if (callback(arr[i], i, arr)) return arr[i];\n }\n return undefined;\n}",
"contains (array, item, f) { return this.indexOf(array, item, f) >= 0 }",
"function findIndexOfItem(array, item){\r\n for (var x = 0; x < array.length; x++) {\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function used to add a notepad to the user's account | function addNotepad()
{
if(notepadCount == 0)
{
$("#notepadTextArea").show();
$("#deleteButton").removeClass("disabled");
}
notepadCount = notepadCount + 1;
notepadNumber = "notepad" + notepadCount;
notepadFlag = notepadCount;
htmlBlock = '<button id="'+notepadNumber+'" type="button" class="btn btn-light... | [
"function fillNotepadName() {\n\tvar npnameContent = [\n\t\t'<div id=\"np-name-wrapper\">',\n\t\t'\t<div id=\"np-name\" onclick=\"renameNotepad(\\'edit\\');\">'+ catalog[notepadIdLocal][\"npname\"] +'</div>',\n\t\t'</div>'\n\t].join(\"\\n\");\n\t$('#np-rename').empty().append(npnameContent);\n}",
"function delete... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the argument size or null if the argument was not found | getSize(attributeName) {
const arg = this.args[attributeName];
return arg ? arg.values.length : null;
} | [
"function args_count(){\n return arguments.length;\n}",
"function len( obj )\n {\n if ( undefined === obj.length && \"number\" !== typeof obj.length )\n { return undefined; }\n \n return obj.length\n }",
"function getLength(arr, cb) {\n\tcb(arr.length);\n}",
"function getDependencySize(dependencyD... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets options on dependent select | function setWidgetOptions($obj, data) {
var exclude = [];
if ($obj.hasClass('dependent-select-last')) {
$obj.next().find('option').each(function(i, option) {
exclude[exclude.length] = parseInt($(option).val());
});
... | [
"function setOptions() {\n optionList.html('');\n var count = 0;\n var optionLength = HTMLSelect.options().length;\n\n if (optionLength > 9) {\n optionList.addClass('is-scroll');\n }\n\n if (optionLength ===... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The below function returns bookings based on VIN or date. 1. If date/VIN is not provided as input then it will return all bookings 2. Throws error incase of invalid date or VIN | function retrieveBookingsHelper(query = {}) {
const { bookingDateTime, VIN } = query;
let bookings = [];
if (VIN) {
if( VIN.length === 17) {
bookings = dbOperations.getBookingsBasedOnVIN(VIN);
} else {
throw errors.INVALID_VEHICLE_VIN;
}
}... | [
"findBookingsByDate(dateStart, dateEnd) {\n return new Promise((resolve, reject) => {\n //console.log(\"SERVICE err: \" + err); \n Booking.findBookingByDate(dateStart, dateEnd, (err, res) => {\n //console.log(\"SERVICE err: \" + err);\n if (err) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change the language for a model. | function setModelLanguage(model, language) {
__WEBPACK_IMPORTED_MODULE_5__standaloneServices_js__["b" /* StaticServices */].modelService.get().setMode(model, __WEBPACK_IMPORTED_MODULE_5__standaloneServices_js__["b" /* StaticServices */].modeService.get().getOrCreateMode(language));
} | [
"function setLanguage(args) {\n\tSETTINGS.LANGUAGE = args.next() || SETTINGS.LANGUAGE\n}",
"function updateLanguageToKorean() {\n localStorage.setItem('lang', 'ko');\n document.title = $('#title-ko').val();\n $('.navbar__language--english').removeClass('language--active');\n $('.navbar__language--korean').add... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to update section status for Phonics Adventure | function updateSectionStatus() {
var lessonStatusObject = _.countBy( _.pluck($scope.contents.currentSection.lessons, 'block'), function(value) {
return value === true ? 'true' : 'false';
});
$scope.contents.currentSection.block = (lessonStatusObject.true > 0);
} | [
"function sectionOn() { }",
"function sectionCompleted(section) {\n var jqSection = $(section);\n\n var topicCompleted = jqSection.hasClass('level2');\n\n var topicId;\n if (topicCompleted) {\n topicId = jqSection.attr('id');\n }\n else {\n topicId = $(jqSection.parents('.section.level... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ResetProfileSettingsBanner class Provides encapsulated handling of the Reset Profile Settings banner. | function ResetProfileSettingsBanner() {} | [
"function setupProfileSwitcher(isPreview, profile) {\n var elements = document.getElementsByClassName(\"profile-switch\");\n\n for (var i=0; i<elements.length; i++) {\n var element = elements[i];\n\n // If we have a profile, we can show the live/preview buttons\n if (profile) {\n element.parentEleme... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
detect Enter/Return key press in Site Search Text input widget, then simulate a click on the Site Search button. | function doSiteSearchKeyPress(e) {
// look for window.event in case event isn't passed in
e = e || window.event;
if (e.keyCode == 13) {
document.getElementById(_pSiteSearchButton).click();
}
} | [
"function watchSearch() {\n\t\t$('#search-button').on('click', findResults);\n\t\tvar key = $('#search-box').on('keypress');\n\t\t// **** Need to get the enter block working. ****\n\t\tif (key.which == 13) {\n\t\t\t$('#search-box').on('keypress'(findResults));\n\t\t}\n\t}",
"function enterToSearch(event) {\n i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Verticallyoriented parallax Initially designed to deactivate for smaller screens but that happens automatically | function runVertParallax() {
$('.intro-download-section').parallax({imageSrc: 'images/sparks_med_res.jpg'});
} | [
"function initImageParallax() {\n const parallaxSections = gsap.utils.toArray(\".with-parallax\");\n parallaxSections.forEach((section) => {\n const img = section.querySelector(\"img\");\n\n gsap.to(img, {\n yPercent: 20,\n ease: \"none\",\n scrollTrigger: {\n trigger: section,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate the response received after sending a speech request with nonspecified audio coding | function validateSpeechFailACNSResponse(response) {
notEqual(response["requestError"], undefined, "requestError");
var re = response["requestError"];
if (re != null) {
notEqual(re["serviceException"], undefined, "serviceException");
var se = re["serviceException"];
if (se != null) {
... | [
"function validateSpeechFailNSResponse(response) {\n notEqual(response[\"requestError\"], undefined, \"requestError\");\n var re = response[\"requestError\"];\n if (re != null) {\n notEqual(re[\"serviceException\"], undefined, \"serviceException\");\n var se = re[\"serviceException\"];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the fire arrival time of point [x, y] | timeTo (x, y) { return this.get(x, y).time } | [
"function calculateArrival(departure) {\n return departure;\n}",
"function calculateNextArrival(train) {\n\n\n //get the current time \n const currentTime = moment();\n\n\n //get the time since the train's first arrival\n const firstArrivalTime = moment(train.firstArrival, \"hh:mm\").subtract(1, \"ye... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the button to edit a feature. | createEditButton(index) {
let scope = this;
let editButtonElement = document.createElement('button');
editButtonElement.className = cssConstants.ICON + ' ' + cssConstants.BUTTON_EDIT_DATA;
editButtonElement.title = langConstants.METADATA_EDIT;
editButtonElement.setAttribute('feat_id', index);
jQ... | [
"createMoveButton(index) {\n let scope = this;\n let modifyButtonElement = document.createElement('button');\n modifyButtonElement.className = cssConstants.ICON + ' ' + cssConstants.EDITOR_FEATURE_MODIFY;\n modifyButtonElement.title = langConstants.EDITOR_FEATURE_MODIFY;\n modifyButtonElement.setAttr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extends buddiesColl with information about watched persons | function setWatchedBuddies() {
watchedBuddiesSet.toArray().forEach(function (uid) {
var model = buddiesColl.get(uid);
if (model) {
model.set('isWatched', true);
}
});
} | [
"completeBorrowProcess(book, user) {\n const allBorrowedBooks = databaseHandler['collectors']; //Returns the collection of collectors\n const dateIssued = new Date().toLocaleDateString(); //Gets and format today date\n\n //Object literal with both user and book information\n const borrowedBook = new col... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if a path is the parent of another. | isParent(path, another) {
return path.length + 1 === another.length && Path.compare(path, another) === 0;
} | [
"isAncestor(path, another) {\n return path.length < another.length && Path.compare(path, another) === 0;\n }",
"isBefore(path, another) {\n return Path.compare(path, another) === -1;\n }",
"parent(root, path) {\n var parentPath = Path.parent(path);\n var p = Node$1.get(root, parentPath... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
convert IATA to location | function IATAConverter(iata) {
switch (iata) {
case 'MZG':
return 'makung';
case 'KHH':
return 'kaohsiung';
case 'TSA':
return 'taipei-sung-shan';
case 'RMQ':
return 'taichung';
default:
return 'null';
br... | [
"function toOpenLocationCode(iotaAreaCode) {\r\n if (!validation_1.isValid(iotaAreaCode)) {\r\n throw new Error(\"The iotaAreaCode is not valid\");\r\n }\r\n return internal_1.iacToOlcInternal(iotaAreaCode);\r\n}",
"function decode(iotaAreaCode) {\r\n const olc = open_location_code_typescript_1... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CHALLENGE Write function named interleave that will take two arrays and interleaves them Example: if you pass it ["a", "b", "c"] and ["d", "e", "f"] then it should return ["a", "d", "b", "e", "c", "f"] NOTE: you can assume each input will be the same length adding "interleave" arrays// string, loop, join, "", map | function interleave(array1, array2) {
var arrayCombined = [];
for (i = 0; i < array1.length; i++) {
arrayCombined.push(array1[i]);
arrayCombined.push(array2[i]);
}
return arrayCombined;
} | [
"function intertwineArrays(a, b) {\n var c = [];\n for (var i = 0; i < a.length; i++) {\n c[c.length] = a[i];\n c[c.length] = b[i];\n }\n return c;\n}",
"function joinArrays(...args){\n\tlet res = [];\n\tfor (let i of args) res.push(...i);\n\treturn res;\n}",
"function joinArrays(){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attempts to play a Track from the queue | async processQueue() {
if (this.queueLock || this.audioPlayer.state.status !== AudioPlayerStatus.Idle || this.queue.length === 0) return;
this.queueLock = true;
const nextTrack = this.queue.shift();
try {
const resource = await nextTrack.createAudioResource();
this.audioPlayer.play(resource)... | [
"function resumeTrack() {\n if (current_track_id !== null) {\n audioTracks[current_track_id].play();\n }\n}",
"playHelper(options) {\n // checks and picking track ID\n if (options.length == 0) {\n console.warn('Tried to play sound with no TrackID options.');\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION 2: Using the user's name along with the day of the week to generate a voiceResponse message specific to that person's name as well as day of the week. | function inputResponse (){
// All of function happening when the "Enter" button is clicked.
$('button').click(function(){
//The value generated from the user's input in the "Name" input box.
var inputValue = $('#inputvalue').val();
//The input box that will be disappearing.
var inputDisappear = $... | [
"function findUserAndRecipient(bot) {\n // controller.hears(['test'], 'direct_message', function(bot, message) {\n bot.api.users.list({}, function (err, response) {\n if (response.hasOwnProperty('members') && response.ok) {\n var members = []\n response.members.for... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
helper function to generate GeoJSON polygon | function createGeoJsonPolygon(coords) {
return {
type: "Polygon",
coordinates: coords
}
} | [
"function drawSVG_Polygon()\n {\n var polygon = scene.create( { t: \"path\", d:\"polygon points:30,0 60,60 0,60\",\n strokeColor: 0x000000ff, strokeWidth: 2, fillColor: 0xFFFF00ff, parent: bg, x: 50, y: 50} );\n\n return polygon;\n }",
"function polyExport(polygon) {\n retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
default fallthrough package provider engine to read packages from config file | function ConfigPackageProvider(settings, params) {
var self = Object.create(ConfigPackageProvider.prototype)
self.config = params.config
return self
} | [
"function readPkgFileFn () {\n fsObj.readFile( fqPkgFilename, 'utf8', storePkgMapFn, abortFn );\n }",
"_eachPackages (cb) {\n for (let packageName in this._packagesConfig) {\n const packageObject = new Package({\n projectKeysDir: this._projectKeysDir,\n package: this._packagesConfig[pack... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create in the smart contract a new meal advertisement. Arguments: data (object): object containing the following fields: time (integer): UNIX timestamp (UTC), in milliseconds price (integer): price for the meal, in wads title (string): short description of the meal description (string): longer description of the meal p... | function createMeal(data, callback) {
var contract = web3.eth.contract(deployedAbi);
var contractInstance = contract.at(deployedAddress);
// what should be the gas amount???
contractInstance.createMeal(data.title, data.description, data.place, data.time, data.price, data.capacity, {
from: web3.eth.accoun... | [
"function Meal(data) {\n Base.call(this, data);\n this.type = 'meal';\n}",
"function createMagazine (data, cb) {\n connection.query(\n 'INSERT INTO `inventory` SET type=?;INSERT INTO `magazines` SET ?, id=LAST_INSERT_ID()', ['magazine', data],\n (err, result) => {\n if (err) {\n cb(err);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find and process stream data in the range (start, end] for process Returns a list of streams sorted by decending time | _getTimeRangeInReverse(startTime, endTime) {
const slices = this.streamBuffer.getTimeslices({start: startTime, end: endTime}).reverse();
return {
streams: slices.map(timeslice => timeslice.streams).filter(Boolean),
links: slices.map(timeslice => timeslice.links).filter(Boolean)
};
} | [
"run(start, values) {\n const current = this.filter.slice(0);\n const toProcess = values.slice(0);\n this.reset(start);\n const out = [];\n\n while (toProcess.length > 0) {\n out.push(this.stream(toProcess.shift() || 0));\n } // Reset the filter back to where it was\n\n\n this.filter = cur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function winDetection(player) returns 'true' if the Palyes is in upper part of the canvas: | function winDetection(player) {
if (player.y >= 0 && player.y <= 20 ) {
gameReset();
return true;
}
} | [
"checkIfWin(){\n\t\tconst g = this.state.grid;\n\t\tvar hits = 0;\n\n\t\tfor(var i = 0; i < this.gridSize; i++) {\n\t\t\tfor(var j = 0; j < this.gridSize; j++) {\n\t\t\t\tif (g[i][j] === \"Hit\") {\n\t\t\t\t\thits++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(hits === this.maxNumberOfShips*2){\n\t\t\tvar theWinner = \"\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks a given node against matching selectors and returns selector index (or 0 if none matched). This function takes into account the ngProjectAs attribute: if present its value will be compared to the raw (unparsed) CSS selector instead of using standard selector matching logic. | function matchingSelectorIndex(tNode, selectors, textSelectors) {
var ngProjectAsAttrVal = getProjectAsAttrValue(tNode);
for (var i = 0; i < selectors.length; i++) {
// if a node has the ngProjectAs attribute match it against unparsed selector
// match a node against a parsed selector only if ng... | [
"matches (selector) {\r\n const el = this.node;\r\n return (el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector).call(el, selector)\r\n }",
"function get_color_index(selector, elem) {\n var result = null;\n $root... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by Python3Parserexpr_stmt. | visitExpr_stmt(ctx) {
console.log("visitExpr_stmt");
if (ctx.augassign() !== null) {
return {
type: "AugAssign",
left: this.visit(ctx.testlist_star_expr(0)),
right: this.visit(ctx.getChild(2)),
};
} else {
... | [
"function Python3Listener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}",
"visitCompound_stmt(ctx) {\r\n console.log(\"visitCompound_stmt\");\r\n if (ctx.if_stmt() !== null) {\r\n return this.visit(ctx.if_stmt());\r\n } else if (ctx.while_stmt() !== null) {\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function tracks if there is a change in the venue Likes to save them and display correct information | function setVenueLikes(id) {
db.ref("likes/venues/" + id).on("value",function(snapshot) {
let likes =
snapshot.val() && snapshot.val().venueLikeCount
? snapshot.val().venueLikeCount
: 0;
$(".venueLikeButton").data("number", likes);
$(".venueLikeButton span").text(likes + ... | [
"function updateLikes(){\n $('#likes').text(photoData[currentPhotoID]['likes']);\n}",
"listenNewLikes() {\n document.querySelectorAll(\"article button\").forEach(likeBtn => {\n likeBtn.addEventListener('click', () => {\n this.totalLikes++;\n this.querySelector(\"as... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=> 'try a different animal or emotion' 3. The digital sum of a number is the sum of all its digits, e.g. digitalSum(1337) should output 14: 1 + 3 + 3 + 7. Use any of the methods of reptition that we have covered so far to implement this function. What should digitalSum of a singledigit number return, e.g. digitalSum(8)... | function digitalSum(n){
if (n < 10){
return n;
}
return (n % 10) + digitalSum(Math.floor(n / 10));
} | [
"function grabNumberSum(s) {\n\treturn s.replace(/\\D/g, \" \").split(\" \").reduce((x, i) => x + +i, 0);\n}",
"function sumAll(n) {\r\n if (n == 1) return 1;\r\n return n + sumAll(n - 1);\r\n}",
"function getDigitsSum(inputNumber) {\n inputNumber += '';\n let sumOfDigits = 0;\n const inputNumberLength... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles switching to the drive view of the app. | function handleDriveClick(event) {
document.getElementById("drive").style.display = 'block';
document.getElementById("home").style.display = "none";
AnalyticsManager.clickedDrive();
} | [
"function switchToView(view) {\n // Hide all views before displaying the one its switching to\n welcome ? welcome.$el.hide() : false;\n setupAssistance ? setupAssistance.$el.hide() : false;\n customUrl ? customUrl.$el.hide() : false;\n marketingConfig ? marketingConfig.$el.hide() : false;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For a user and a Steam game, insert new player achievements Fetch user's achievements for game via Steam API Filter out unearned achievements pass to service to store unseen achievements and award points if isInitial | async function storeNewPlayerAchievements({
userId,
accountId,
gameId,
isInitial,
}) {
const playerAchievements = await getClient()
.getAchievements(accountId, gameId)
.then((result) => {
return result.data.achievements
})
const achievementIds = Object.keys(playerAchievements).filter(
... | [
"async function fetchGameAchievements(accountId, gameId) {\n const achievementData = await getClient()\n .getGlobalAchievements(gameId)\n .then((result) => {\n return result.data.achievements\n })\n const game = await getClient()\n .getOwnedGames(accountId, [gameId], true)\n .then((result) => ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
An implementation of the classical heap container (dynamically sorted array). One can insert here anything provided it has 'key' and 'done' members. Mainly used to sort cells (from the cell map created above) Please note that the HeightMap object embeds a Heap, so you should not need to instantiate another one. | function Heap(size) {
this.last = 1;
this.max = size;
this.table = new Array(size + 1);
/**
Add a cell to the heap
Note this function sets the done flag of the cell. This not only prevents heap overflow, but helps in various cases: no cell can be inserted more than once.
*/
this.addCell = fun... | [
"insert(element) {\n this.heap.push(element);\n for (let i = this.size() - 1; i > 0; i--) {\n let parent = (i - 1) / 2;\n if (this.heap[parent] > this.heap[i]) {\n let temp = this.heap[i];\n this.heap[i] = this.heap[parent];\n this.hea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine if the story is a user's favorite | function storyIsFavorite(story) {
if (currentUser) {
let favoriteIds = currentUser.favorites.map(story => story.storyId);
return favoriteIds.includes(story.storyId);
}
} | [
"function isFavorite(story) {\n // start with an empty set of favorite story ids\n let favoriteStoryIds = new Set();\n\n if (currentUser) {\n favoriteStoryIds = new Set(\n currentUser.favorites.map((story) => story.storyId)\n );\n }\n isFave = favoriteStoryIds.has(story.storyId);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fullScroll Directive for slimScroll with 100% | function fullScroll($timeout){
return {
restrict: 'A',
link: function(scope, element) {
$timeout(function(){
element.slimscroll({
height: '100%',
railOpacity: 0.9
});
});
}
};
} | [
"onScroll_() {\n if (!this.isActive_()) {\n return;\n }\n this.vsync_.run(\n {\n measure: state => {\n state.shouldBeFullBleed =\n this.getOverflowContainer_()./*OK*/ scrollTop >=\n FULLBLEED_THRESHOLD;\n },\n mutate: state => {\n this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Here we simply display each track's image and name by mapping over the track list which was passed down through props. | render() {
const tracks= this.props.tracks
return (
<div>
{tracks.map((track, index)=>{
console.log('track', track);
const trackImg = track.album.images[0].url;
return(
<div
key={index}
className="track"
onClick={(... | [
"function displayTracks(tracks) {\n var tracksList = document.getElementById('show_tracks'); //where to append the list\n var listSize = tracks.length;\n\n for (var i = 0; i < listSize; i++) {\n var trck = tracks[i]; //current track\n var tmpl = document.getElementById('track-template').co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fonction de control sur l'url qui renvoie au code dans ajout.php et la foonction controlerChamp | function controlerUrl() {
return Ctrl.controler(url);
} | [
"function controleAvantAjout() {\n let UrlOk = controlerUrl();\n let TitreOk = controlerTitre();\n let DateOk = controlerDate();\n if (UrlOk && TitreOk && DateOk) ajouter();\n}",
"function addProgram() {\n\tlocation = \"EditPage.php?mode=add&what=program\";\n}",
"function addAgency() {\n\tlocation =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get friends of friends array without duplicates and return friends [] | function getFriendsOfFriendsArray() {
getDirectFriendsArray();
getfriendsOfFriendsArrayWithDuplicates();
//remove duplicates
arrWithoutDuplicates = arrWithDuplicates.filter(function(item, pos) {
return arrWithDuplicates.indexOf(item) == pos;
});
friends = ar... | [
"function getfriendsOfFriendsArrayWithDuplicates() {\n getDirectFriendsArray();\n arrWithDuplicates = [];\n\n for(var i = 0; i < friends.length; i++) {\n\n friend = friends[i];\n var myFriendObj = data[friend - 1];\n\n for(var index in myFriendObj) {\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function for: close chooselinkdialog with cancel | function ChooseLinkCancel() {
// detach connection
if (Conn) {
jsPlumb.detach(Conn);
}
DummyConnection = '';
Core.UI.Dialog.CloseDialog($Dialog);
} | [
"function recordsetDialog_onClickCancel(theWindow)\r\n{\r\n // No need to do any additional processing for now.\r\n dwscripts.setCommandReturnValue(recordsetDialog.UI_ACTION_CANCEL);\r\n theWindow.close();\r\n}",
"function CompleteRemoveLink() {\n var jLinkDialog = g(\"linkDialog\");\n jLinkDialog.style.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
RIVETS END / JQUERY BINDINGS Function to handle radio button click. | function __handleRadioButtonClick(event){
/*
* Soft save here
*/
var currentTarget = event.currentTarget;
$("label.radio").parent().removeClass("highlight");
$(currentTarget).parent().parent("li").addClass("highlight");
var newAnswer = curren... | [
"radioSelectedHandler(e) {\r\n this.radioSelect = e.detail;\r\n }",
"function radioClickEvent(name){\n\n\tradioButtonControl(name);\n\t$('input[name='+name+']').click(function() {radioButtonControl(name);});\n\t\n}",
"static set radioButton(value) {}",
"function initRadioButton() {\n $('input... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
.shift() removes a node from the beginning of the DLL. .shift pseudocode: 1. edge case: if this.length === 0(or !this.head or !this.tail) return undefined. 2. store removing head in a variable. 3. if this.length === 1 set this.head = null and this.tail = null. 4. update this.head to be the next of the removed node. 5. ... | shift() {
if (!this.head) return undefined;
let removed = this.head;
if (this.length === 1) {
this.head = null;
this.tail = null;
} else {
this.head = removed.next;
this.head.prev = null;
removed.next = null;
}
... | [
"removeFromFront() {\n\n if(this.isEmpty()) return null;\n\n var nodeToRemove = this.head;\n\n this.head = this.head.next;\n nodeToRemove.next = null;\n this.counter--;\n return nodeToRemove;\n }",
"pop(){\n\t\tif(this.q1.length == 0)\n\t\t\treturn null;\n\t\tthis.size... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display the output of the Image block. | function displayImageOutput() {
return (
<div
key="content-block-image"
className="content-block-content content-block"
style={ { textAlign: props.attributes.alignmentRight } }
>
<img
src={ props.attributes.imgURL }
alt={ props.attributes.imgAlt }
/>
</div>
);
} | [
"display()\r\n {\r\n image(this.image,this.x, this.y, this.w,this.h);\r\n }",
"function displayStrawCup1() {\n image(strawCup1Img, 0, 0, 1000, 500);\n}",
"display() {\n let coin = c.getContext(\"2d\");\n var img = document.createElement(\"IMG\");\n img.src = \"images/Coin20.pn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
must have custom promisify for storage object or chrome will complain about "must be on an instance of..." | function storagePromisify(action) {
return function(key) {
return new Promise(function(resolve) {
let cb = function(data) {
if (data) return resolve(data);
return resolve();
}
if (key) {
chrome.storage.local[action](key, cb)
} else {
chrome.storage.local[action](cb)
}
})
}
} | [
"function promisize(args) {\n var promise = new Ext.space.Promise();\n\n if (args && (args.onComplete || args.onError)) {\n promise.then(\n typeof args.onComplete == \"function\" ? args.onComplete : undefined,\n typeof args.onError == \"function\" ? args.onError : undefined\n );\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a function called splitNames(fullName) that takes an full name and return an object that contains firstName and lastName as the key. | function splitNames(fullName){
let names = fullName.split(" ");
let obj = {};
obj.firstName = names[0];
obj.lastName = names[names.length - 1];
return obj;
} | [
"getNames( fullName ) {\n \"use strict\";\n // Return firstName, middleName and lastName based on fullName components ([0],[1],[2])\n }",
"function convertNameToObject(string) {\n var name = string.split(\" \");\n var nameObject = {\n firstName: name[0],\n lastName: name[1]\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subscribe to an event. Registers the given function as an event handler for the given event type. | subscribe(eventType, handler) {
let subscribers = this.events.get(eventType);
if (!subscribers) {
subscribers = new Set();
}
subscribers.add(handler);
this.events.set(eventType, subscribers);
} | [
"function sendEvent(event) {\n $.each(subscribers, function(idx, subscriber) {\n if(subscriber.filter(event)) {\n try {\n subscriber.handler(event);\n } catch(e) {\n debug && console.log('Handler ', subscriber, ' failed on message ', event, ' with error ', e);\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
include virtual="included.html" return: the URL in there | function extract_include( element ) {
var inner_text=element.innerText; // 'include virtual="included.html"'
return( inner_text.replace("include virtual=\"","") // 'included.html'
.replace("\"",""));
} | [
"function getIncludePath(name) {\n\n var prefix = \"includes/\";\n\n if (name.match(/^includes/)) {\n prefix = \"\";\n }\n\n if (name.match(/html$/)) {\n return prefix + name;\n }\n\n return prefix + name + \".html\";\n}",
"function includeNavigation() {\n app.getView().render('... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create the HTML input element for the pubs Google Maps Place ID | function createPubID() {
const pubID = document.createElement('input')
// Hide the input element within the form
pubID.type = 'hidden'
pubID.value = pubPlaceID
pubID.name = 'place_id'
return pubID
} | [
"function createGoogleSearch(searchElementId, map) {\n\tvar inputSearch = document.getElementById(searchElementId);\n\tmap.controls[google.maps.ControlPosition.TOP_LEFT].push(inputSearch);\n\treturn new google.maps.places.SearchBox(inputSearch);\t\t\n}",
"function generatePin() {\n document.getElementById('sho... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
makes a handler, tailormade for get or post queries | function handlerMaker( type ) {
var input;
if ("post" === type ) {
input = "body";
} else if ( "get" === type ) {
input = "query";
}
return function ( req, res ) {
// get the error code
var errorCode = parseInt( req[input].error, 10 );
if ( !errorCode ) {
// no code, return a splash page
... | [
"function WrapperHandler (){\n\t//settings parameters \n\tthis.database = \"http://tdk3.csf.technion.ac.il:8890/sparql\";\n\tthis.graph_uri = \"http://dbpedia.org\";\n\t//create api\n\tthis.api = new ApiHandler(this);\n\t//setup wrapper\n\tthis.setup();\n}",
"function handler(req, res, next) {\n readEntity(re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
enviar mensagem ao Kafka | function sendMessageKafka(topic, msg) {
payloads = [ { topic: topic, messages: msg } ];
if (topicoOnline) {
producer.send(payloads, function (err, data) {
console.log(data);
});
} else {
console.error("desculpe, topico '" + topico + "' não está pronto, falha ao enviar a mensagem ao Kafka.")... | [
"sendMessage(topic,message) {\n this.mqttClient.publish(topic, message);\n }",
"function postTo(topic, callback) {\n bus.sendTopicMessage(topic, encode(message), function(error, response) {\n if (error) {\n winston.error('Message send failed...', { topic: topic, error: error });\n } else {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generateHash Returns a hashed version of a string. | function generateHash(string) {
return crypto.createHash('sha256').update(string + configuration.encryption.salt).digest('hex');
} | [
"inputHash(input) {\n return \"\";\n }",
"function hash(text) {\n return crypto.createHash('md5').update(text).digest('hex')\n}",
"function hasher(data) {\n var pre_string = data.lastname + data.firstname + data.gender + data.dob + data.drug;\n var hash = '', curr_str;\n\n hash = Sha1.hash(pre_string)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `VirtualRouterListenerProperty` | function CfnVirtualRouter_VirtualRouterListenerPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object... | [
"function CfnVirtualGateway_VirtualGatewayListenerPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Highlight next valid sibling. | function highlightNext($element) {
var highlighted = $element.query('.'+_CLASSES.HIGHLIGHTED)
var next
if ($element.contains(highlighted)) {
next = getNextValidLi(highlighted)
if (next) {
... | [
"function next () {\r\n return this.siblings()[this.position() + 1]\r\n}",
"function getNextSibling(node, tag){\n\tif (!tag) tag = node.nodeName;\n\ttag = tag.toUpperCase();\n\tvar cont = 20; // Limita o numero de itera��es para evitar sobrecarga no ie\n\twhile (node.nextSibling && node.nextSibling.nodeName && n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Connect Four is a game in which two players take turns dropping red or yellow colored discs into a vertically suspended 7 x 6 grid. Discs fall to the bottom of the grid, occupying the next available space. A player wins by connecting four of their discs horizontally, vertically or diagonally. Given a multidimensional a... | function connectFour(board) {
let col = 7;
let row = 6;
let copyOfSlots = board;
let winner;
//diagonal bottom to top
for (let i = 0; i <= col - 4; i++) {
for (let j = 3; j <= row - 1; j++) {
if (copyOfSlots[j][i] === "Y" &&
copyOfSlots[j - 1][i + 1] === "Y" &&
... | [
"function check_game_winner(state) {\n\n //Patters variable is an array of patterns with each pattern itself an array of x/y co-oridinates.\n //In order to create the pattern matching technique, every possible winning pattern had to be identified with the co-ordinates recorded.\n //Each individual array is a set... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The first input array is the key to the correct answers to an exam, like ["a", "a", "b", "d"]. The second one contains a student's submitted answers. The two arrays are not empty and are the same length. Return the score for this array of answers, giving +4 for each correct answer, 1 for each incorrect answer, and +0 f... | function checkExam(array1, array2) {
let score = 0
for(let i = 0; i < array1.length; i++){
if(array1[i] === array2[i]){
score += 4
}else if (array2[i] === '') {
score += 0
}else{
score -= 1
}
}
if(score < 0){
score = 0
}
return score
} | [
"function calculateScore() {\n for (var i = 0; i < quizLength; i++){\n if (userAnswers[i][1]) {\n quiz[\"questions\"][i][\"global_correct\"]+=1;\n score++;\n }\n quiz[\"questions\"][i][\"global_total\"]+=1;\n }\n}",
"function calculateScore(games) {\n\tconst a = [0, 0]\n\tconst x = games.map(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to remove all event listeners for handle keys. Then adds a new event listener so that user can click play button to return to game. | function nickSelected(){
window.removeEventListener("keydown", handleKeys);
document.getElementById("play").addEventListener("click", playClick);
} | [
"function _removeEvents() {\n BUTTON.removeEventListener('click', open, false);\n MODAL_CLOSE.forEach((item) => item.removeEventListener('click', close, false));\n document.removeEventListener('keydown', _bindKeyPress, false);\n }",
"function removeEventHandlers()\r\n {\r\n // remove k... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the conntrack connection values | function getConnTrackValues(cb)
{
var stderr = '';
var assured = 0;
var total = 0;
var unreplied = 0;
var state = {};
STATES.forEach(function(s) { state[s] = 0; });
var conntrack = _child.spawn('conntrack', ['-L']);
conntrack.stderr.on('data', function (data) { stderr += data.toString(); });
conntrack.stdou... | [
"getConnects() {\n var result = [];\n for (var i = 0; i < this.connectionList.length; i++) {\n result.push(this.connectionList[i]);\n }\n return result;\n }",
"function getConnections() {\n var people = People.People.Connections.list('people/me', {\n personFields: 'na... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if a path ends at one of the indexes in another. | endsAt(path, another) {
var i = path.length;
var as = path.slice(0, i);
var bs = another.slice(0, i);
return Path.equals(as, bs);
} | [
"endsAfter(path, another) {\n var i = path.length - 1;\n var as = path.slice(0, i);\n var bs = another.slice(0, i);\n var av = path[i];\n var bv = another[i];\n return Path.equals(as, bs) && av > bv;\n }",
"isAfter(path, another) {\n return Path.compare(path, another) === 1;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
open remove entity dialog | removeEntity(entity) {
const dialogRef = this.dialog.open(_dialog_confirmation_dialog_confirmation_dialog_component__WEBPACK_IMPORTED_MODULE_1__["ConfirmationDialogComponent"], {
data: "Bạn có thực sự muốn xóa Loại thực thể này không?",
width: '400px',
});
dialogRef.after... | [
"function deleteButtonPressed(entity) {\n db.remove(entity);\n }",
"function _remove() \n {\n dialog.remove();\n }",
"function entryDeleteHandler(evt, repo){\n const form = document.getElementById('entry-edit-form');\n const entryIndex = form.getAttribute('data-en... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set ups the lighting in the scene. | function lightingSetUp(){
keyLight = new THREE.DirectionalLight(0xFFFFFF, 1.0);
keyLight.position.set(3, 10, 3).normalize();
keyLight.name = "Light1";
fillLight = new THREE.DirectionalLight(0xFFFFFF, 1.2);
fillLight.position.set(0, -5, -1).normalize();
fillLight.name = "Light2";
backLight... | [
"function setupLight(){\r\n\r\n\t//an ambient light for \"basic\" illumination\r\n\tambientLight = new THREE.AmbientLight( 0x444444 );\r\n\tscene.add( ambientLight );\r\n\r\n\t//a directional light for some nicer additional illumination\r\n\tdirectionalLight = new THREE.DirectionalLight( 0xffeedd );\r\n\tdirectiona... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Best First Search / Greedy Algorithm | bestFirstSearch(){
var heapOpen = new SortedList(comparer);
var heapClosed = new SortedList(comparer);
heapOpen.add(this.frontier);
while(heapOpen.getCount() > 0){
ITERATIONS++;
var V = heapOpen.popFirst();
MINPRIORITY = V.priority;
V.gener... | [
"function shortestReach(n, m, edges, s) {\n\n let d = []; // расстояния (индекс - расстояние от старта до вершины с этим индексом)\n for (let i = 0; i <= n; i++) {\n d[i] = 10 ** 6; // изначально все расстояния большие\n }\n\n d[s] = 0; // а до стартовой вершины расстояние 0\n\n let q = new Pr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
use regex to remove punctuation from a given string | function removePunctuation(str){
return str.replace(/[.,!?;:()]/g,'')
} | [
"function txtNoPunctuation (txt){\n let strA = txt.toLowerCase();\n let strB = strA.replace(/[+]/g, \" \");\n let strC = strB.replace(/[-]/g, \"\");\n let strD = strC.replace(/[:;.,!@#$%^&*()''\"\"]/g, \"\");\n return strD;\n}",
"function normalize(w) {\n w = w.toLowerCase();\n var c = has(w)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compute a mapping of media type to its ordering where ordering is defined such that large > medium > small. | function getOrderMap(bps) {
// grab the keys in the appropriate order
var keys = Object.keys(bps).sort(function (a, b) {
// get the associated values
var valueA = bps[a];
var valueB = bps[b];
// if a is a number and b is a string
if (typeof valueA === 'number' && typeof ... | [
"function typeComparator(auto1, auto2)\n{\n /************************************************************************************\n * orderType *\n * This function takes an automobile object as a parameter and then checks the type *\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
given the cell positions and text information (coordinate and string), generate the table data and fill the cell accordingly. | function fillCell(cell_pos, text_info) {
var table_data = [];
// propagate and fill the table
for (var i = 0; i < cell_pos.length; i++) {
var cell_data = [];
for (var j = 0; j < cell_pos[0].length; j++) {
var table_data_row = [];
var cell_info = cell_pos[i][j];
var curr_cell_upper_left_x = cell_info[0]... | [
"function createCell(row, content) {\n // insert cell at the end of the row\n var cell = row.insertCell();\n cell.textContent = content;\n}",
"function createTable(table, columnX, columnY) {\n let counter = 0;\n\n for (let valueX of columnX) {\n let row = table.insertRow();\n let cell = row.inser... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate command and trigger it if valid, or show a validation error | function commandTrigger() {
var line = promptText;
if (typeof config.commandValidate == 'function') {
var ret = config.commandValidate(line);
if (ret == true || ret == false) {
if (ret) {
handleCommand();
}
} else {
commandResult(ret, "jquery... | [
"function validateRun (data, command) {\n // no additional validation necessary\n return true;\n }",
"_validateAndParseCommandArguments() {\n const validationErrors = this._validateCommandArguments();\n\n if (validationErrors.length > 0) {\n _forEach(validationErrors, (error) => {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A set of unique items. Items added and removed from the internal list must be equatable with ===. | function Set() {
this._items = [];
} | [
"function ItemSet() {\r\n/**\r\n * @type Object\r\n * @private\r\n */\r\n\tthis._contents = {};\r\n}",
"function unique(arr) {\n return Array.from(new Set(arr));\n }",
"function uniqMethod() {\n\tvar testarray=[1,2,2,1,2,3,1,1,1,4,4,4,4,3,3,5,6,6,7,7];\n\tvar result=_.uniq(testarray);\n\tconsole.log(result)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creates an expression that calculates the normalized frag coord (coordinates range from 0 to 1) | function pos() {
return new NormFragCoordExpr();
} | [
"constructor (gl, fs, ins, outs, dim) {\n this.ins = ins;\n this.outs = outs;\n this.dim = dim;\n if (dim.length == 1) {\n this.w = dim[0];\n this.h = 1;\n }\n if (dim.length == 2) {\n this.w = dim[0];\n this.h = dim[1];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
vm.createHelpRequest = createHelpRequest; vm.getPostedData = getPostedData; | function init() {
// vm.getPostedData();
} | [
"function ProductDetailsDialogController($scope, __DataStore, appServices,\n\t $stateParams, __Form, __Utils, $q, GetProductDetails, $compile, $rootScope, __Auth) {\n\n\t\tvar scope = this;\n\n \tscope.categoryID \t= $scope.ngDialogData.categoryID;\n \tscope.productID \t= $scope.ngDialogData.productI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Note that 'yield' is treated as a keyword in strict mode, but a contextual keyword (identifier) in nonstrict mode, so we need to use matchKeyword('yield', false) and matchKeyword('yield', true) (i.e. matchContextualKeyword) appropriately. | function matchYield() {
return state.yieldAllowed && matchKeyword('yield', !strict);
} | [
"visitYield_expr(ctx) {\r\n console.log(\"visitYield_expr\");\r\n if (ctx.yield_arg() !== null) {\r\n return { type: \"YieldStatement\", arg: this.visit(ctx.yield_arg()) };\r\n } else {\r\n return { type: \"YieldStatement\", arg: [] };\r\n }\r\n }",
"visitYield... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given an array of points, return an SVG path string representing the shape they define | function pointsToPath(points) {
return points.map(function(point, iPoint) {
return (iPoint>0?'L':'M') + point[0] + ' ' + point[1];
}).join(' ')+'Z';
} | [
"function pointsToString(points) {\n\n // first point //\n var string = 'M' + points[0].x + ' '+points[0].y;\n\n // remaining points //\n for (var i=1; i<points.length; i++) {\n string += ' L' + points[i].x + ' '+points[i].y;\n }\n return string;\n}",
"function _getSVGPath(coord, options)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
clears and toggles the update film form | function hideUpdateFilm() {
$("#update-film-result").empty();
$("#update-film-success").empty();
$("#update-film-boxes").toggle("slow");
} | [
"function hideAddFilm() {\n\t$(\"#add-film-result\").empty();\n\t$(\"#add-film-success\").empty();\n\t$(\"#add-film-boxes\").toggle(\"slow\"); \n\t}",
"function hideSearchFilm() {\n\t$(\"#search-film-result\").empty();\n\t$(\"#search-film-boxes\").toggle(\"slow\");\n\t}",
"function hideDeleteFilm() {\n\t$(\"#d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
hopefully this will save a lot of duplicate code loads the navbar and sets the appropriate nav item to active loads into an element with id "nav" | function loadNavBar(activePage) {
$("#nav").load("/partials/navigation.html", function() {
// make the appropriate nav item active after loading
$(".navbar .nav.navbar-nav ." + activePage).addClass("active");
});
} | [
"function changeNavClass(nav_element) {\n document.getElementById(\"nav-about\").className = \"nav-icons\";\n document.getElementById(\"nav-research\").className = \"nav-icons\";\n document.getElementById(\"nav-publication\").className = \"nav-icons\";\n document.getElementById(\"nav-conference\").class... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set style properties on tooltip DOM | setTooltipDOMStyle(tooltipOptions) {
this.tooltipDOM.style.overflowY = 'hidden';
this.tooltipDOM.style.backgroundColor = tooltipOptions.backgroundColor;
this.tooltipDOM.style.border = `1px solid ${tooltipOptions.borderColor}`;
this.tooltipDOM.style.color = tooltipOptions.fontColor;
if (tooltipOptio... | [
"initTooltip() {\n const self = this;\n\n // Array containing all tooltip lines (visible or not)\n self.d3.tooltipLines = [];\n self.curData.forEach(function (datum, index) {\n if (index > self.colorPalette.length) {\n notify().error(\"Palette does not contain e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Support function for returning the correct AuthProvider given a type string | function chooseAuthProviderByType(opts){
const user = getUser();
const redirectUrl = opts.redirectUrl;
const type = opts.type;
const defaultAuth = new Virtru.Client.AuthProviders.GoogleAuthProvider(user, redirectUrl, environment);
switch(type){
case 'google':
return defaultAuth
case 'o365':... | [
"function getAuth(provider) {\n let providers = userDataFactory.providers;\n //if the provider exists, authenticate the user\n if (providers[provider]) return $q.when(providers[provider]);\n return $cordovaOauth[provider](...PROVIDER_DETAILS[provider])\n .then((response) => {\n userDataFacto... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TreeOpenToBranch This function opens the tree to a specified node. This function accepts an array of node id's to use as a path to the desired node. | function TreeOpenToBranch(pathArray)
{
var tree = this;
var currentNode = tree;
var pastNode = tree;
// Cycle through the path array and find the
// path node one at a time. Open each node
// as you get there.
//
... | [
"function setOpenNodes(openNode) \r\n{\r\n\tfor (i=0; i<TreeNodes.length; i++) \r\n\t{\r\n\t\tvar nodeValues = TreeNodes[i].split(\"|\");\r\n\t\tif (nodeValues[0]==openNode) \r\n\t\t{\r\n\t\t\topenNodes.push(nodeValues[0]);\r\n\t\t\tsetOpenNodes(nodeValues[1]);\r\n\t\t}\r\n\t} \r\n}",
"TreePush(str_id=null)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return all[ any[ item.contains(s) for item in items ] for s in substrs ] | function substrMatchAny(substrs,items)
{
for (var i = 0; i < substrs.length; ++i)
if (! matchAny(substrs[i],items))
return false;
return true;
} | [
"function arraySubstring(words, str) {\n const result = [];\n for( let i = 0; i < words.length; i++) {\n if (words[i].includes(str)) {\n result.push(true);\n } else {\n result.push(false);\n }\n }\n return result;\n}",
"function containsAny(str, arr){\n\tif(s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function reads the random.txt file and executes the command with the corresponding search value from the text file. | function doWhatItSays() {
fs.readFile("random.txt", "utf8", function(error, data){
if(error){
return console.log(error);
}
var dataArr = data.split(",");
var command = dataArr[0];
var search = dataArr[1];
commandInput(command, search);
})
... | [
"function random() {\n fs.readFile(\"random.txt\", \"utf8\", function(err, data) {\n if (err) {\n return console.log(err);\n }\n console.log(data);\n })\n }",
"function parseCommand(text) {\n var words = text.split(\" \");\n for (var i = 0; i < words.length; ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes page instance whose _id is pageId | function deletePage(pageId) {
return Page.remove({_id: pageId});
} | [
"function deletePage(pageId) {\n var page = findPageById(pageId);\n var index = pages.indexOf(page);\n pages.splice(index, 1);\n }",
"remove(id) {\n\t\t\tlet index = this.ids.indexOf(id);\n\t\t\tthis.ids.splice(index, 1);\n\t\t\tthis._loadPage();\n\t\t}",
"async discardPa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add the features Notes [1] Initially, add the polygons to the map but not the points. Then use checkZoom to switch that if you zoom out enough. | function addFeatures(){
s.placesLayer = new google.maps.Data();
s.placesLayer.addGeoJson(s.placesGeoJson);
s.placesLayer.setMap(s.map);/*[1]*/
s.pointsLayer = new google.maps.Data();
s.pointsLayer.addGeoJson(s.pointsGeoJson);
// s.pointsLayer.setMap(s.map);
s.additionalFeatureLayer = new google.maps.Data(... | [
"function addPolygons() {\n \n if (typeof postcodeAreas !== 'undefined') {\n postcodeAreas.addTo(mymap);\n legend.addTo(mymap);\n } else {\n postcodeAreas = L.geoJSON(postcodeGeoJSON, {\n onEachFeature: onEachFeature,\n }).addTo(mymap);\n legend.addTo(mymap);\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decorate table rows and cells, tbody etc | function decorateTable(table, options) {
var table = $(table);
if (table) {
// set default options
var _options = {
'tbody' : false,
'tbody tr' : ['odd', 'even', 'first', 'last'],
'thead tr' : ['first', 'last'],
'tfoot tr' : ['first', 'last'],
... | [
"function bootstrapStylePandocTables() {\n $(\"tr.odd\")\n .parent(\"tbody\")\n .parent(\"table\")\n .addClass(\"table table-condensed\");\n }",
"tabulate(\n headers,\n rows,\n options) {\n if (!_.isArray(headers))\n TypeException(\"headers\", \"array\")... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a new animation map w/ base entries of `parent` and extensions and overrides in `child`. Cloning is used such that all of the values are new (so no object pointers point back to `parent` or `child`). | function extendAnims(parent, child) {
let anims = new Map();
for (let base of [parent, child]) {
for (let [key, data] of base.entries()) {
anims.set(key, Anim.cloneData(data));
}
}
return anims;
} | [
"function extendWeapon(parent, child) {\n // build up the weapon\n let weapon = cloneWeapon(parent.weapon);\n // allow full or per-item timing overrides\n objOverride(weapon, child.weapon, 'timing');\n // NOTE: not allowing null to disable parent weapons. could implement\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a promise for a fresh view of the stores and their items. | function loadStores(account) {
// Save a snapshot of all the items before we update
const previousItems = NewItemsService.buildItemSet(_stores);
const firstLoad = (previousItems.size === 0);
ItemFactory.resetIdTracker();
const dataDependencies = [
dimDefinitions.getDefinitions(),
dimBu... | [
"fetchItems(store) {\n let query = encodeURI(this.state.query)\n let id = store['id']\n let request = `api/search?q=${query}&id=${id}`\n console.log(request)\n fetch(request)\n .then(function(response){\n return response.json()\n })\n .then((items) => {\n let activeStores = this.st... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if the expense form has items | function CheckExpenseItems(itemCount)
{
if (itemCount > 0)
{
return true;
}
else
{
return false;
}
} | [
"cartHasUnAvailibleItems() {\n const itemAvailibility = Object.keys(this.state.itemsAvailible).map(\n itemId => this.state.itemsAvailible[itemId],\n );\n return !itemAvailibility.every(itemAvailible => itemAvailible === true);\n }",
"function validation(){\r\n \r\n if (validat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is the raw streamData loaded from the video manifest | get streamData() {
return this._streamData;
} | [
"function onReceiveStream(stream, elementID){\n var video = $('#' + elementID + ' video')[0];\n console.log(video);\n video.src = window.URL.createObjectURL(stream);\n }",
"async function streamingToFacebook(data) {\n const blob = new Blob(recordedBlobs, { type: defaults.videoType });... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |