query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
This is where the magic happens. This function creates a simple template string for the controltype. If we just append this string in the container, it will not be found by Angular. So before appending it, we use the $compile function to register it in Angular and run the link function of the directive and pass in its ... | function appendControlElement(scope, element){
// build the simple template of the control directive
var template = '<div tkvr-'+ scope.control.type +'>{{control.title}}</div>';
// tell angular about the new created directive
var newElement = $compile(template)(scope);
// append the newly created el... | [
"function generateDirective(type) {\n var directiveName = 'plugin-' + scope.plugin.slug + '-' + type;\n var generatedTemplate = '<' + directiveName + '></' + directiveName + '>';\n element.empty();\n element.append($compile(generatedTemplat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an array of RDF triples for the given graph. | function _graphToRDF(graph, namer, options) {
var rval = [];
var ids = Object.keys(graph).sort();
for(var i = 0; i < ids.length; ++i) {
var id = ids[i];
var node = graph[id];
var properties = Object.keys(node).sort();
for(var pi = 0; pi < properties.length; ++pi) {
var property = properties... | [
"function _graphToRDF(graph, namer, options) {\r\n var rval = [];\r\n\r\n var ids = Object.keys(graph).sort();\r\n for(var i = 0; i < ids.length; ++i) {\r\n var id = ids[i];\r\n var node = graph[id];\r\n var properties = Object.keys(node).sort();\r\n for(var pi = 0; pi < properties.length; ++pi) {\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is where we dispatch our toggleStat action from. When a checkbox is clicked, it calls this function, which in turn calls our dispatchable action to update the store | handleToggleClick(statName) {
this.props.toggleStat(statName);
} | [
"_updateAllStatus(e){\n let complete = e.target.checked ? 1 : 0;\n this.props.dispatch(updateAllStatus(complete))\n }",
"function onClick () {\n // Update checked status and UI.\n _.checked = !_.checked\n updateUi()\n\n // Trigger callback.\n _.callback && _.callback(_.checked)\n }",
"upd... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Causes the main loop to reconsume the current character, such as after encountering a "parse error" that changed state and needs to reconsume the same character in that new state. | function reconsumeCurrentCharacter() {
charIdx--;
} | [
"function reconsumeCurrentCharacter() {\n charIdx--;\n }",
"function reconsumeCurrentCharacter() {\n charIdx--;\n }",
"consumeChar() {\n this.currentChar = this.nextChar;\n this.nextChar = this.readable.read(1);\n }",
"function consume() {\n this.p++;\n// console.l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return the requisitions details by id | function getRequisitionDetailsById(prefixId,id,listRequisitions)
{
var foundRequisition=null;
for(var i=0;i<listRequisitions.length;i++)
{
if(prefixId+listRequisitions[i].id==id)
{
foundRequisition=listRequisitions[i];
break;
}
}
return foundRequisition;
} | [
"function requirement_detail(req, res, next) {\n Requirement.findById(req.params.id)\n .populate('content')\n .exec((err, requirement) => {\n if (err)\n return next(err);\n if (requirement === null) {\n const error = new Error('Requirment not found');\n error.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
convert a JS array into a java ArrayList | function toArray(arr){
var list = new ArrayList(arr.length);
for(i in arr)
list.add(toJava(arr[i]));
return list;
} | [
"function _jsifyCollection(javaCollection) {\n var arr = [];\n var it = javaCollection.iterator();\n while (it.hasNext()) {\n var elem = it.next();\n var obj = jsify(elem);\n arr.push(obj);\n }\n return arr;\n }",
"function caml_js_to_array(a)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
puts maximum coins in the slotmachine(3) | function betMax() {
if(coins >= 3 && coinsPlayed < 3) {
coinInsertSound.play();
coinsPlayed = 3;
//formats the position of the labels so they appear to fit inside the LED displays
document.getElementById('U_COINS').style.left = 790 - (coins.toString().length*40);
//updates labels
document.g... | [
"function calculQuantiteMax(product){\n var cout = product.cout;\n var croissance = product.croissance;\n var n=1;\n var prix = cout;\n while (prix <= currentWorld.money){\n n = n+1;\n prix = calculCout(cout,croissance,n);\n }\n return n-1;\n}",
"function maxCoins(penceLimit, de... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
select a random tweet | function selectTweet(tweets) {
const index = Math.floor(Math.random() * tweets.length)
return tweets[index];
} | [
"function pickRandomTweet() {\n\t\t\t\t\t// Store tweetNumber so we can change which bird is highlighted\n\t\t\t\t\ttweetNumber = Math.floor(Math.random() * fakeTweets.length);\n\t\t\t\t\tconsole.log(tweetNumber)\n\t\t\t\t\tvar randomTweet = fakeTweets[tweetNumber];\n\t\t\t\t\t// Log the random tweet. Finished app ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes a tile from the TileCache | function removeTileFromCache(tileName,params) {
var item = getItem(tileName, params);
var tileKey = getTileKey(item);
delete tileCache[tileKey];
} | [
"clear() {\n this.tileCache.clear();\n }",
"removeTile(tile: MdGridTile) {\n ListWrapper.remove(this.tiles, tile);\n }",
"clearTileCache() {\n this.i.clearTileCache();\n }",
"remove(tile) {\n this.el.removeChild(tile);\n }",
"clearTileCache() {\n this.i.mu();\n }",
"clearTi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the lowest number of guesses in a single puzzle | getLowestNumberOfGuesses() {
return this.colorPuzzles.reduce((min, puzzle) => {
return Math.min(min, puzzle.getNumberOfGuesses());
}, this.colorPuzzles[0].getNumberOfGuesses());
} | [
"function minPackCount(packs, total) {\n // Set initial sub problem\n var count = [0];\n\n // Loop from 1 to total\n for(var i = 1; i <= total; i ++) {\n // Max int means no solution yet\n count.push(Number.MAX_SAFE_INTEGER)\n\n // Check if each problem can be solved by solving a sub problem\n for(v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
component routes requests made to /tables/new | function Tables() {
//JSX
return (
<>
<main>
<Switch>
<Route exact={true} path={"/tables/new"}>
<NewTable />
</Route>
<Route>
<NotFound />
</Route>
</Switch>
</main>
</>
);
} | [
"function Tables() {\n return (\n <main>\n <Switch>\n <Route path={\"/tables/new\"}>\n <NewTable />\n </Route>\n <Route>\n <NotFound />\n </Route>\n </Switch>\n </main>\n );\n}",
"createNew(tableName, newObject) {\n return fetch(`${remoteURL}/${... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns jquery element with "reveal your location" button | function revealLociDiv() {
let result = $('<div></div>');
let btn = $('<a id="revealLoci" class="btn btn-primary padded form-control" data-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false" aria-controls="collapseExample">'+tr("Show current location")+'</a>');
let lociDiv = $('<di... | [
"function showMyCalendarsPopup() {\n $(MY_CALENDARS_POPUP).foundation('reveal', 'open');\n}",
"get confirmButton() {\n return $('#location-confirm');\n }",
"toggleReveal () {\n this.get('_toggleReveal').perform()\n }",
"function showHelpModal(){\n\t$(\"#helpModalId\").reveal({\n\t ani... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete selected tasks. Todoist will prompt for deletion. Since todoist prompts, this is not treated as a 'dangerous' action. As such, if WHAT_CURSOR_APPLIES_TO is 'all' or 'most', then instead applies to the cursor if there is no selection. | function deleteTasks() {
const mutateCursor = getCursorToMutate();
if (mutateCursor) {
clickTaskMenu(mutateCursor, 'task-overflow-menu-delete', false);
} else {
withUnique(
openMoreMenu(),
'li[data-action-hint="multi-select-toolbar-overflow-menu-delete"]',
click,
... | [
"function deleteSelectedItems() {\n if (calendarController.todo_tasktree_focused) {\n deleteToDoCommand();\n } else if (calendarController.isInMode(\"calendar\")) {\n deleteSelectedEvents();\n }\n}",
"async delete() {\n const items = this._sortedItems.filter(item => this.selection[item.path]);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function takes the user ID from the body of the request It constructs a new Degree Plan object for the corresponding student if the information provided is valid It addes the new degree plan to the Degree Plans collection It returns an error message in the case of a failure in any of the previous steps | function createNewDegreePlan(req, res) {
const errors = validationResult(req);
if (!errors.isEmpty()) {
return res.status(400).json({
errors: errors.array()
});
}
async function find (name, query) {
let courses = []
collection = mongoose.connection.db.collection(name)
courses = colle... | [
"function createPlan(userId, plan) {\n return $http.post(\"/api/user/\"+userId+\"/plan\", plan)\n .then(function (response) {\n return response.data;\n });\n }",
"function saveDegreePlan(req, res) {\n try {\n Plan.updateOne({\"studentID\": req... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: parse the JSON and update the DOM to display the token | function showToken(response){
console.log(response);
} | [
"function fetchToken() {\r\n const URL = `http://mumstudents.org/api/login `\r\n fetch(URL, {\r\n method: \"POST\",\r\n headers: { \"content-type\": 'application/json' },\r\n body: JSON.stringify({\r\n \"username\": \"mwp\",\r\n \"password... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds force in the Y direction | addYForce(ddy) {
this.ddy += ddy
return this
} | [
"updateYPos(){\n this.y -= this.yVel;\n this.yVel *= 0.9;\n //gravity\n this.yVel -= 3;\n }",
"gravity(force) {\n this.ay += force; //accelerates downwards\n }",
"_reverseY() {\n this._dy = -this._dy;\n }",
"moveY(y) {\n this.move(new Vector(0, y));\n }"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Notifies OcclusionTester that a Marker has updated its Worldspace position. | markerWorldPosUpdated(marker) {
if (!this._markers[marker.id]) { // Not added
return;
}
const i = this._markerIndices[marker.id];
this._positions[i * 3 + 0] = marker.worldPos[0];
this._positions[i * 3 + 1] = marker.worldPos[1];
this._positions[i * 3 + 2] = mar... | [
"markerWorldPosUpdated(marker) {\n const rtcCenter = marker.rtcCenter || [0, 0, 0];\n const hash = rtcCenter.join();\n let rtcOcclusionTester = this._rtcOcclusionTesters[hash];\n if (!rtcOcclusionTester) {\n return;\n }\n rtcOcclusionTester.markerWorldPosUpdated(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test the jscache interface. | function testJsCache(callback)
{
var key = 'test#' + token.create();
var value = {a: 'a'};
var cache = new exports.Cache();
testing.assert(!cache.getItem(key), 'Should not getItem()', callback);
testing.assertEquals(cache.size(), 0, 'Invalid size() before get', callback);
cache.setItem(key, value);
testing.asser... | [
"function testSimpleCache() {\n\n var firstExpiration = false;\n var secondExpiration = false;\n\n var cache = new org.jboss.core.service.query.SimpleTimeCache(0.4); // 400ms\n assertNotNull(cache);\n\n setTimeout(function() { firstExpiration = true; }, 500);\n setTimeout(function() { secondExpiration = true;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks the stock of the store in the DB against a current stock, and updates accordingly. This is to provide correct stock information, add new beers and remove sold out beers. TODO: Rewrite this to an upsert statement instead, so updatestore can replace "getFromVinmonopolet" | async function updateStore(store){
return new Promise(async function(resolve, reject){
const tableName = formatName(store)
db.run('CREATE TABLE IF NOT EXISTS '+tableName+' (vmp_id INT UNIQUE, stockLevel INTEGER NOT NULL, last_updated DATETIME, FOREIGN KEY(vmp_id) REFERENCES beers(vmp_id))');
const facets... | [
"function updateStock() {\n\tconnection.query(\"UPDATE products SET ? WHERE ?\", \n\t\t[{stock_quantity: remainingQuantity, product_sales: productSales }, {item_id: chosenItem().item_id}],\n\t\t ( err, res ) => {\n\t\t \tif ( err ) throw err;\n\t\t\t\tconsole.log(`Your current total is $${custTotal}.`.bold.cyan);\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Redirects to the extension options page to enter a team | function alertNoTeamEntered() {
alert('Oops. No Slack team was entered.');
chrome.runtime.openOptionsPage();
} | [
"function selectTeam() {\n window.top.location.href = '' + IPMProAppCP.setupurl + '?Pid=' + IPMProAppCP.projectName + '&TeamMemid=teammembers';\n}",
"function teamHandler() {\n setDisplayMenu(false);\n return history.push(\"/team\");\n }",
"function gotoOptionsPage() {\n document.getElementById(gotoS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Executes DatabaseService.searchTableDataWithQuery as a promise API. | executeDatabaseSearchQuery(params) {
return new Promise((resolve, reject) => {
return LVService.searchTableDataWithQuery(params, null, null).subscribe(response => resolve(response && response.body && response.body.content), reject);
});
} | [
"searchQuery(value) {\n let result = this.tableData;\n if (value !== '') {\n result = this.fuseSearch.search(this.searchQuery);\n }\n this.searchedData = result;\n }",
"function employeesSearch() {\n connection.query(\"SELE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SRP0[] Set Reference Point 0 0x10 | function SRP0(state) {
state.rp0 = state.stack.pop();
if (DEBUG) console.log(state.step, 'SRP0[]', state.rp0);
} | [
"function SRP0(state) {\n\t state.rp0 = state.stack.pop();\n\n\t if (exports.DEBUG) { console.log(state.step, 'SRP0[]', state.rp0); }\n\t}",
"function SRP0(state) {\n state.rp0 = state.stack.pop();\n\n if (exports.DEBUG) {\n console.log(state.step, 'SRP0[]', st... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
js_startSlide Init slider default slide 1. | function js_startSlide() {
reset();
sliderImages[0].style.display = 'block'; // Show image 1.
temporal[current].innerHTML = current + 1 + "/" + sliderImages.length; // Print number image is in current location.
dots[current].classList.add("active"); // Add class active dot current image.
} | [
"function startSlide(){\n console.log(\"automatically changing slides\")\n changeSlide(1)\n setTimeout(startSlide, 4000);\n}",
"function startUp(){\n var counter = 0;\n $('.slide').each(function(){\n $(this).attr(\"id\", 'slide-'+ ++counter);\n });\n global_maxSlide = counter;\n con... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Normalize the node masters count | async normalizeMastersCount() {
if(!await this.isMaster()) {
return;
}
let masters = await this.db.getMasters();
const size = await this.getNetworkOptimum();
if(masters.length > size) {
masters = _.orderBy(masters, ['size', 'address'], ['desc', 'asc']);
... | [
"get dedicatedMasterCount() {\n return this.getNumberAttribute('dedicated_master_count');\n }",
"initNmines(){\n\t\tfor (let i = 0; i<this.width; i++){\n\t\t\tfor (let j = 0; j<this.height;j++){\n\t\t\tthis.nmines_array[i][j] = this.countMines(i,j);\n\t\t\t}\n\t\t}\n\t}",
"function computeNodeBreadths... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check to see if every element in the matrix is an array and that every element in the array is greater than 0. | function positiveMatrix (input) {
return input.every(function(val){
if(Array.isArray(val) === false){
return false;
}
return val.every(function(innerVal){
return innerVal > 0;
});
});
} | [
"function positiveMatrix (input) {\n return input.every(x => Array.isArray(x) === true && x.every(y => y>0) === true);\n}",
"function positiveMatrix (input) {\n return input.every(function(data){\n return data.every(function(element){\n return element > 0 && Array.isArray(data);\n });\n });\n}",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funcion para limpiar un formulario | function limpiarFormulario(idForm){
var form=document.getElementById(idForm);
if(form!=null){
for(var i in form.elements){
if(form.elements[i].nodeName == "TEXTAREA"){
form.elements[i].value="";
}
//console.log(form.elements[i].type);
... | [
"function init_inpt_formulario_cargar_recorrido() {\n // Inputs del formulario para inicializar\n}",
"function adaptaFormulario () {\r\n\tvar mBajaEl = getFormElementById(\"motivobaja_c\");\r\n\tif (! mBajaEl) {\r\n\t\tconsole.error(\"No se ha definido el campo Motivo de baja.\");\r\n\t} else {\r\n\t\tvar mBaj... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION: pick DESCRIPTION: Select the form element with the given label. ARGUMENTS: none RETURNS: string | function FormFieldsMenu_pick(formElementLabel)
{
var retVal = false;
if (this.formMenu)
{
// If we are prepending a 'None' label, treat '' as 'None'.
if (formElementLabel == "" && this.bPrependNoneLabel)
{
formElementLabel = MM.LABEL_None;
}
retVal = this.listControl.p... | [
"function selectElement(path, label){\n key_flag = false;\n \tfor(var x=0; x< data_object.length; x++){\n \t\tif(data_object[x][\"key\"] === label){\n \t\t\tkey_flag = true;\n \t\t\tdocument.getElementById('label_input').setAttribute('color','red');\n \t\t\tdocument.getElementById('label_input... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Detects if the current browser is a BlackBerry Touch device, such as the Storm. | function DetectBlackBerryTouch()
{
if (uagent.search(deviceBBStorm) > -1)
return true;
else
return false;
} | [
"function DetectBlackBerryTouch()\n{\n if ((uagent.search(deviceBBStorm) > -1) ||\n (uagent.search(deviceBBTorch) > -1))\n return true;\n else\n return false;\n}",
"function is_touch_device() {\r\n return false;\r\n }",
"function isTouchDevice() {\r\n\t\t\treturn !!('ontouchstart' in ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Posts the current slide data to the notes window. | function post( event ) {
let slideElement = deck.getCurrentSlide(),
notesElements = slideElement.querySelectorAll( 'aside.notes' ),
fragmentElement = slideElement.querySelector( '.current-fragment' );
let messageData = {
namespace: 'reveal-notes',
type: 'state',
notes: '',
markdown: false,
wh... | [
"function post( event ) {\n\n\t\t\tvar slideElement = Reveal.getCurrentSlide(),\n\t\t\t\tnotesElement = slideElement.querySelector( 'aside.notes' ),\n\t\t\t\tfragmentElement = slideElement.querySelector( '.current-fragment' );\n\n\t\t\tvar messageData = {\n\t\t\t\tnamespace: 'reveal-notes',\n\t\t\t\ttype: 'state',\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DISPLAY FILE CONTEXT MENU | function displayContextMenu(e,file,folder,isLin) {
stopBrowserActions(e);
showFileContextMenu(e,file,folder,isLin);
} | [
"static DisplayContextMenu(doc) {\n if (!ImGui.BeginPopupContextItem())\n return;\n const buf = `Save ${doc.Name}`;\n if (ImGui.MenuItem(buf, \"CTRL+S\", false, doc.Open))\n doc.DoSave();\n if (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
===========================================================================// Get My Address in localStorage =========================================================================== | function getMyAddr () {
var serializedAccount = localStorage.getItem('account')
var msg = "s"
var ret
if (serializedAccount !== null) {
var acc = ethClient.Account.deserialize(serializedAccount)
console.log(acc)
console.log(acc.getAddress())
msg = acc.getAddress()
ret = true
} else {
m... | [
"function getAddress() {\n 'use strict';\n var address = sessionStorage.getItem('address');\n return JSON.parse(address);\n }",
"function getAddressFromLocalStorage(key) {\n return localStorage.getItem(key);\n}",
"function loadAddress(){\n if(localStorageEnabled()){\n var localStr =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the css specified in 'props' on element 'el' From | function css (el, props) {
if (typeof el === 'string') el = qs(el)
if (!el.style) return
var key, pkey
for (key in props) {
if (props.hasOwnProperty(key)) {
pkey = pfx(key)
if (pkey !== null) {
el.style[pkey] = props[key]
}
}
}
return el
} | [
"function setElementCss(el, css){\n for (var property in css){\n if (!(property in el.style)){\n warn('\"' + property + '\" is not a valid css property');\n }\n el.style[property] = css[property];\n }\n }",
"function applyCSS(dom_el, css) {\n Object.assign(dom_el.style,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks whether we are logged into Facebook and have the user_friends Facebook permission, and calls the success and fail callbacks correspondingly | function ensureFacebookPermissions(loginFunc, successCallback, failCallback) {
console.log('Checking FB login status');
// 1. Check if logged in
loginFunc(
response => {
if (response.status === 'connected') {
console.log('FB logged in');
// 2. Check if we have the permissions needed
... | [
"function getFriends_FB() {\r\n\t// if the person has not pressed login button\r\n\r\n\tif (!loggedIn) {\r\n\t\tloginFacebook();\r\n\t}\r\n\r\n\tdocument.getElementById(\"status\").innerHTML = \"Please wait...\";\r\n\r\n\t// if the person is loggedIn\r\n\tif (loggedIn) {\r\n\r\n\t\tFB\r\n\t\t\t\t.api(\r\n\t\t\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Supports an advanced search for limit by subreddit | function search_subreddit(){
$.get('/api/subreddit/' + $('#search_input').val(), function(data){redraw_page(data)})
} | [
"async getSubreddit() {\n const {\n sortBy,\n searchQuery,\n timeInterval,\n hasTimeInterval,\n } = this.state;\n const sortByListings = `${sortBy}Listings`;\n let timeIntervalProperty = \"\";\n\n if (hasTimeInterval) {\n time... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function returns true if the graph has a cycle, false if it does not | hasCycle() {
for (let node of this.nodes.values()) if (this.hasCycleFrom(node)) return true;
return false;
} | [
"hasCycle() {\n const numOfNodes = this.nodes.size;\n const numOfEdges = this.getNumOfEdges();\n const numOfConnectedComponents = this.getNumOfConnectedComponents();\n return numOfEdges > numOfNodes - numOfConnectedComponents;\n }",
"hasCycle(node, visited, links, isChild){\n // set node as visite... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create function that returns the name and balance of cash on an account in a list getNameAndBalance(11234543); should return: ['Igor', 203004099.2] | function getNameAndBalance(number){
let result = [];
accounts.map(e => {
if(e.accountNumber === number){
result = [e.clientName, e.balance];
}
})
return result;
} | [
"function getNameAndBalance(param){\n accounts.forEach(value => {\n if (value.accountNumber === param) {\n console.log([value.clientName, value.balance]);\n }\n })\n}",
"function getBalance(account){\n\treturn account.balance;\n}",
"function getBalance(account) {\n console.log('Your current balanc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find employees by city | function employeesByCity (id) {
var i;
var employeesInCity = [];
for (i = 0; i < employees.length; i++) {
if (employees[i].city === id) {
employeesInCity.push(employees[i])
}
}
return employeesInCity;
} | [
"function findByCity(city) {\n print('Searching appartements in ' + city)\n var appartements = db.appartements.find({'location.city': city}).pretty().toArray();\n //printjson(appartements)\n print('Found ' + appartements.length + ' appartements in ' + city)\n}",
"function viewPersonsByCity(city)\n{\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find shortest transformation TRIED USING SETS, DOESNT MATTER!!! DFS SOLUTION | function s(beginWord, endWord, wordList) {
// for each word find one letter transformations
// find shortest traversal
/*
time:
create graph, o(length of wordlist * length of wordlist * length of word), o(n2m)
traverse, o(nm)
=> simplify, o(mn2)
space:
create graph, o(mn2)
stack heig... | [
"function solveMe(start, end) \n{const dijkstra = (edges,source,target) => {\n const Q = new Set(),\n prev = {},\n dist = {},\n adj = {}\n \n const vertex_with_min_dist = (Q,dist) => {\n let min_distance = Infinity,\n u = null\n \n for (let v of Q) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the matching files for a given pattern. Used to share code between get and post. | function pattern_searching(pattern) {
// yes, I can see the potential optimizations of b-trees, tries and so on,
// but i'm worried about the web services more today
results = [];
try {
files = fscache.getcache();
//todo security/cleaning of the pattern
let repattern = RegExp("^"... | [
"function filesByMimetype(pattern)\n {\n return m_properties.files.value().filter(function (meta)\n {\n return meta.mimeType.startsWith(pattern);\n })\n .map(function (meta)\n {\n return meta.uri;\n });\n }",
"function findPattern(files,regex){... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION DEFINITIONS //////////////////// Plan ABC benefit calculation | function calcPlanABCBenefit (plan_p, age_p, salary_p, serviceCredit_p) {
// let ageFactor = lookupAgeFactor (plan_p, age_p);
// Why is this not working if declared outside of function? Never mind. Why not just use the lookup function in the formula itself?
return salary_p * serviceCredit_p * lookupAgeFacto... | [
"function calcPlanEBenefit (age_p, salary_p, serviceCredit_p) {\n return salary_p * 0.02 * serviceCredit_p * lookupERA(age_p);\n}",
"function calcProductCostBenefit() {\n\n Object.keys(Game.ObjectsById).map(function(product) {\n\n Game.ObjectsById[product].costBenefit = (Game.ObjectsB... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the provider name from a callback path | function getProvider(pathname) {
var items = pathname.split("/");
var index = items.indexOf("callback");
if (index > 0) {
return items[index - 1];
}
} | [
"function GetProviderName(pcode,Names) {\n var pname = \"\";\n if (Names.Length) {\n var PObject = Names[pcode];\n if (PObject!=undefined) {\n pname = Names[pcode];\n }\n }\n return pname;\n}",
"function provider(str) {\n return 'provider/' + str;\n}",
"function getP... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Drive the item page to add carrot to cart and increment counter. | function invokeItemPage(){
addCart();
displayCounter();
addCartForItem('carrot');
} | [
"function cartCounter() {\n setCounter(counter + 1);\n }",
"function addItem() {\n itemsInCart++;\n console.log(\"Item added to cart!\");\n console.log(\"Item(s) in cart = \" + itemsInCart);\n}",
"function addItemToCart() {}",
"function addCartClick() {\r\n document.getElementById('clickcount').... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: Delete memoizeProps/State and move to reconcile/bailout instead | function memoizeProps(workInProgress, nextProps) {
workInProgress.memoizedProps = nextProps;
} | [
"function memoizeProps(workInProgress, nextProps) {\n\t workInProgress.memoizedProps = nextProps;\n\t }",
"function memoizeProps(workInProgress, nextProps) {\n workInProgress.memoizedProps = nextProps;\n }",
"function memoizeProps(workInProgress, nextProps) {\n workInPro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convenience function to scroll to an element in the main page by its id. id: the id as a string that should be scrolled to easingFunction: defines the scrolling rate over time; defaults to ease in and out sin. You can either use one of the predefined functions from EASING_FUNCTIONS or a custom one. duration: scroll dur... | function smoothScrollToId(id, {
duration, easingFunction,
offsetTop = 0,
offsetLeft = 0,
} = {}) {
const element = document.getElementById(id);
smoothScrollToElement(element, {
duration: duration,
easingFunction: easingFunction,
offsetTop: offsetTop,
offsetLeft: offsetLeft
});
} | [
"function scrollToId(id) {\n var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var offset = Math.round(document.getElementById(id).getBoundingClientRect().top);\n scrollToY(document.scrollingElement.scrollTop + offset, duration);\n}",
"function scrollToId(id){\n var eleme... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handler for the init() FUSE hook. You can initialize your file system here. cb: a callback to call when you're done initializing. It takes no arguments. | function init(cb) {
console.log("File system started at " + options.mountPoint);
console.log("To stop it, type this in another shell: fusermount -u " + options.mountPoint);
cb();
} | [
"function InitFileSystem(onReady, onError) {\n fileSystemGo = false;\n fsError = \"\";\n onReadyCallback = onReady;\n onErrorCallback = onError;\n RequestFileSystem();\n}",
"function caml_fs_init (){\n var tmp=joo_global_object.caml_fs_tmp\n if(tmp){\n for(var i = 0; i < tmp.length; i++){\n ca... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
if player 1 is hit by the bullet of player 2 (rocket), display: player 2 win screen | function p1Hit(rocket2, bullet) {
sound[2].play();
if ((state != p2winsScreen)) {
state = p2winsScreen;
}
} | [
"function p2Hit(rocket1, bullet) {\n sound[2].play();\n if ((state != p1winsScreen)) {\n state = p1winsScreen;\n }\n}",
"function playerWasShot(player, bullet){\n bullet.kill();\n if (player1.getIsInvincible() === false && player1.getHealth() != \"invincible\") { //We only damage the player if not inv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
4. Return the highest number in an array. | function highestNum (array) {
var highNum = array[0];
for (let z = 1; z < array.length; z++) {
if (array[z] > highNum) {
highNum = array[z];
}
}
return highNum;
} | [
"function getHighest(array) {\n return Math.max.apply(null, array);\n}",
"function getHighest($array){\n var biggest = Math.max.apply( null, $array );\n return biggest;\n}",
"function highestNumber(array) {\n var max = array[0];\n array.forEach(function(e) {\n if (e > max) {\n max = e;\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DESC: Send multiple dead xrg messages | function xqserver_msgdeadxrg_multiple(){
setup(l_qwXRG);
engine.MsgAdd(l_dwSessionID,++l_dwSequence,QWORD2CHARCODES(g_qwUserId),1,g_dw0QType,g_bstr0QTypeData,g_dw0QTypeDataSize);
for (i=0;i<10;i++){
engine.MsgDeadXRG(0,++l_dwSequence,l_qwXRG.dwHi,l_qwXRG.dwLo);
}//endfor
engine.MsgList(l_dwSessionID,++l_dw... | [
"function xqserver_msgdeadxrg_nodataforXRG(){\r\n\tsetup(l_qwXRG);\r\n\tengine.MsgDeadXRG(0,++l_dwSequence,l_qwXRG.dwHi,l_qwXRG.dwLo);\r\n\tengine.MsgList(l_dwSessionID,++l_dwSequence,g_qwUserId.dwHi,g_qwUserId.dwLo,g_dw0QType,g_qwCookie.dwHi,g_qwCookie.dwLo,0,0,10,0xFFFFFFFF);\r\n\tConfirmListReplyHResult(engine,E... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Apply a jsonpatch operation on an object tree | function apply(tree, patches, validate) {
var result = false, p = 0, plen = patches.length, patch, key;
while (p < plen) {
patch = patches[p];
p++;
// Find the object
var path = patch.path || "";
var keys = path.split('/');
... | [
"function apply(tree, patches, validate) {\n var result = false, p = 0, plen = patches.length, patch, key;\n while (p < plen) {\n patch = patches[p];\n p++;\n\n // Find the object\n var path = patch.path || \"\";\n var keys = path.split('/');\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create saves a record to elasticsearch under the provided id. If the record already exists it will not be inserted. | async function create(record, indexArg = indexName) {
logger.trace('creating record', logRecord ? record : null);
const query = {
index: indexArg,
type: recordType,
id: record[idField],
body: record,
refresh: forceRefresh,
};
... | [
"function create(record) {\n logger.trace('creating record', record);\n\n let query = {\n index: index_name,\n type: record_type,\n id: record[id_field],\n body: record,\n refresh: true\n };\n\n return elasticsearch.create(query);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetches all messages of the specified category | function fetchMessagesOracleProcedure(category, callback) {
oracledb.fetchAsString = [oracledb.CLOB];
oracledb.getConnection(oracleConfig, function(err, connection) {
if (err) {
return callback(err);
}
var fetch_query = 'SELECT identifier, payload_title, payload_content, TO_C... | [
"async fetchByCategory(category) {\n const calls = [];\n const snapshot = await this.AllCallsRef.where(\"category\", \"==\", category).get();\n snapshot.docs.forEach((callDoc) => {\n calls.push(callDoc.data());\n });\n return await this.db.fetchDisplayData(calls);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show Aprendizagens if a Disciplina is chosen | function showAprendizagens(DiscisplinasID, AprendizagensID) {
let disciplina = document.getElementById(DiscisplinasID).value;
let aprendizagem = document.getElementById(AprendizagensID);
if (disciplina == 0){
aprendizagem.style.display = "none";
}
else {
aprendizagem.style.display = "block";
}
} | [
"function showHideVisa(visa){\n if(visa.value=='Nepalese')\n document.getElementById('non_nepali').style.display='none';\n else\n document.getElementById('non_nepali').style.display='block';\n\n}",
"function useAlpha() {\n\n if ( alpha === false ) alpha = true;\n else alpha = false;\n\n displayANOV... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: isDag(G) Purpose: Returns a value 1 if a graph is acyclical and a value 0 if it is not. This is used to determine transitivity in decision making problems. Input: G, which is an array describing a graph as below G = new Array(); G[1][1] = '0'; G[1][2] = '1'; G[2][1] = '1'; G[2][2] = '0'; Notation: G[from][to]... | function isDag(Graph) {
for (var x = 1; x < Graph.length; x++) {
/* now, we loop through all of the paths, while keeping track of the visited ones */
//document.write('<br>starting at '+x+'<br>');
followPath(x, Graph);
}
transitHolds = isdag;
} | [
"function isDAG()\r\n{\r\n\t//check if a specific graph is diracted acyclic graph.\r\n\tfor (var i = 0, j = 0; i < this.warshallTC.length && j < this.warshallTC.length; i++, j++)\r\n\t\tif (this.hasPath(i, j))\r\n\t\t\treturn false;\r\n\treturn true;\r\n}",
"function detectCycleDFS(graph) {\n if (!graph) retur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array of roles which have a given permission. | async getRolesForPermission (permission) {
const roles = []
forEach(await this.getRoles(), role => {
if (includes(role.permissions, permission)) {
roles.push(role.id)
}
})
return roles
} | [
"function role_permissions(roles, callback) {\n var permissions = [],\n fetch = [];\n\n if (roles) {\n // TODO: Here we could do with some caching like Drupal does.\n roles.forEach(function (name, rid) {\n fetch.push(rid);\n });\n\n // Get permissions for the rids.\n if (fetch) {\n db.qu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Will set cookieconsent_status cookie to settings | allowSettingsCookies() {
//Set allow cookie
const expires = this.cookieExpireDate();
document.cookie = 'cookieconsent_status=dismiss;' + expires + ';path=/';
//Set cookie scripts
console.log('All scripts for this website have set like in settings in this browser.');
} | [
"function setConsent(consent) {\n var cookieExpiry = new Date(); // Get current date\n cookieExpiry = new Date(cookieExpiry.setMonth(cookieExpiry.getMonth() + cookieValidity)); // Create expiry date\n document.cookie = cookieName+'={\"consent\":'+consent+',\"timestamp\": \"'+Date.now()+'\"}; domain='+cooki... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Use this function to draw all of your shapes. Recall that VAOs should have been set up the call to createShapes() You'll have to provide a Model Matrix for each shape to be drawn that places the object in the world. An example is shown for placing the teapot | function drawShapes() {
//reference methods: http://glmatrix.net/docs/module-mat4.html
let teapotModelMatrix = glMatrix.mat4.create();
let teapotColumnModelMatrix = glMatrix.mat4.create();
let teapotTopModelMatrix = glMatrix.mat4.create();
let teapotBaseModelMatrix = glMatrix.mat4.create();
... | [
"function drawShapes() {\n \n if (cur_shader == 'wireframe' ) {\n setUpCamera (wireframe_program);\n drawWireframe ();\n }\n if (cur_shader == 'phong') {\n setUpCamera (phong_program);\n drawPhong();\n }\n \n if (cur_shader == ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines if a file behind a given key should be send via `attach://` instead of the key itself | function mustAttachIndirectly(key) {
return indirectAttachmentFields.has(key);
} | [
"function isKeyAFile(){\n var k = addressable.parse( key );\n if(k && k.scheme == \"file\"){\n return readKeyFile();\n }\n if(k.scheme){\n opts.key = key;\n return isCertAFile();\n }\n fs.exists(key, function(exists){\n if(exists){ return readKeyFile() }\n opts.key = key;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sync distros from API | function syncLocalDistros() {
var db = window.openDatabase(window.dbName, window.dbVersion, window.dbName, window.dbSize);
$.getJSON(window.serviceURL + window.apiFile + window.apiKey + 'appsyncdistros', function (data) {
var distros = data.items;
db.transaction(
function (transaction) {
$.each(distros, fu... | [
"syncConf() {\n this.syncRepo(CONF_REPO, CONF_DIST)\n }",
"async syncAssets() {\n for (let i = 0; i < this.__packages.length; i++) {\n let pkg = this.__packages[i];\n await qx.tool.utils.Promisify.poolEachOf(pkg.getAssets(), 10, asset =>\n asset.sync(this.__target)\n );\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The project location fields are conditional based on the project country, so don't include them if the country hasn't been provided yet. | get fields() {
const allFields = [
fields.projectLocation,
fields.projectLocationDescription,
fields.projectPostcode,
];
return conditionalFields(
... | [
"function includeIfCountry(country, fields) {\n return isForCountry(country) ? fields : [];\n }",
"function wpsc_update_location_labels( country_select ) {\n\n\tvar country_meta_key = wpsc_get_element_meta_key( country_select ),\n\t\tlabel, country_code;\n\n\tif ( country_meta_key == 'billingcountry' ) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
to be overriden with custom animation | animation() {} | [
"function Animation(){}",
"function animate() { }",
"inAnimationComplete(){}",
"function Animator()\n\t{\n\t}",
"function modalAnimation() {}",
"animate(){\n this.x += this.delta(3.1416*2.0,10);\n }",
"function animations() {\n\tarthur.srcX = arthur.currentFrame * arthur.width;\n\tif (arthur.g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set label text of dismiss button | setDismissButtonText(t) {
this.dismissButtonText = t;
} | [
"setDismissButtonText(t){this.dismissButtonText=t}",
"function ui_setButtonLabel(id_button, str_label){\n\tui_setInputValue(id_button, str_label);\n}",
"function modalSetCloseText(modal, text) {\n if (text) {\n $(modal).find('#modal-form-close').html(text);\n }\n}",
"function refreshLabel () {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Map the given property dictionary, in which all property names may be in lowercase, to the equivalent camelCase names, using the given control class's prototype for reference. Properties which are not found in the control class are dropped. | function restorePropertyCase( controlClass, properties ) {
if ( $.isEmptyObject( properties ) ) {
return properties;
}
// Build a map of properties available on the control.
// This can be lossy, but it'd be bad practice to have two properties
// on ... | [
"function makeLowercaseSetterAliases(object) {\n console.log('making lowercase aliases.')\n const props = Object.getOwnPropertyNames(object)\n for (let prop of props) {\n const lowercaseProp = prop.toLowerCase()\n if (lowercaseProp != prop) {\n const descriptor = Object.getOwnPrope... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the json for this clazz | get clazz() {
return this._json
} | [
"function getJSON() {\n\t\treturn _json;\n\t}",
"static get json () {\n return new jsfJson();\n }",
"toJSON() {\n\t\tthis.className = this.constructor.name;\n\t\treturn this;\n\t}",
"convert_to_json() {\n return JSON.stringify(this);\n }",
"toJSON() {\n var json = super.toJSON();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: Maybe it is better to handle SelectionGroupTitle in selection manager instead. | getSelectionGroupTitle() {
return this.selectionGroupTitle;
} | [
"function changeCustomSelectTitle(event) {\n let selectedItem = event.currentTarget;\n let selection = event.currentTarget.parentNode.parentNode.previousElementSibling;\n let title = event.currentTarget.parentNode.parentNode.firstElementChild;\n selection.selectedIndex = parseInt(selectedItem.dataset.in... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if we need to clear the text input if clearOnEdit is enabled | checkClearOnEdit(ev) {
if (!this.clearOnEdit) {
return;
}
// Did the input value change after it was blurred and edited?
if (this.didBlurAfterEdit && this.hasValue()) {
// Clear the input
this.clearTextInput(ev);
}
// Reset the flag
... | [
"checkClearOnEdit() {\r\n if (!this.clearOnEdit) {\r\n return;\r\n }\r\n // Did the input value change after it was blurred and edited?\r\n if (this.didBlurAfterEdit && this.hasValue()) {\r\n // Clear the input\r\n this.value = '';\r\n }\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visits an AssignmentExpression or VariableDeclarator, and if the right hand side is an empty string literal, replaces it with a call to `this.renderer.newSequence`. | function visitAssignment(node, rightChildKeyName) {
var rightChild = node[rightChildKeyName];
if (n.Literal.check(rightChild) && rightChild.value === '')
node[rightChildKeyName] = newSequenceNode;
} | [
"assignmentStatement() {\n const left = this.variable()\n const token = this.token\n this.eat('ASSIGN')\n const right = this.expr()\n const node = new Assign(left, token, right)\n return node\n }",
"function AssignmentExpression() {\n}",
"function _AssignmentExpressionEmitter() {\n}",
"_par... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve the value of a findandreplace setting | function searchOption(name){
const pkg = atom.packages.getActivePackage("find-and-replace");
return pkg ? pkg.mainModule.findOptions[name] : undefined;
} | [
"function getSetting(s) {\n\t\treturn documentSettings[constants[s]];\n\t}",
"function getSetting(s) {\n return documentSettings[constants[s]];\n }",
"function customSearchAndReplace( str )\n{\n // Process prefs\n if (prefs.hasOwnProperty(\"sandr\"))\n for (let n in prefs.sandr)\n st... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
XML signature validatior validates a single XML signature | function validateXMLSignature(xml, signatureNode, credential) {
const sigCheck = new SignedXml();
sigCheck.keyInfoProvider = new CertKeyInfo(credential.certificate);
sigCheck.loadSignature(signatureNode);
const isValid = sigCheck.checkSignature(xml);
if (isValid) {
return 0;
}
else {
return sigCheck.validat... | [
"validateSignature(fullXml, currentNode, certs) {\n const xpathSigQuery = \".//*[\" +\n \"local-name(.)='Signature' and \" +\n \"namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#' and \" +\n \"descendant::*[local-name(.)='Reference' and @URI='#\" + currentNode.getAttribute... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check whether there have been any new notifications since the last one we fetched this simply polls: since the request is quite light, this will scale quite a way, but eventually it might be better to longpoll or even use push technology | async function checkForNotifications() {
const credentials = 'same-origin';
try {
const response = await fetch('/ajax/notifications/last-update', { credentials });
if (!response.ok) { notifyFail('Notification latest-timestamp failed!'); return; }
const lastNotificati... | [
"hasNewUpdates () {\n\t\tconst url = `http://api.ft.com/content/notifications?since=${this.since}&apiKey=${process.env.FAST_FT_KEY}`;\n\t\treturn fetch(url)\n\t\t\t.then(res => res.json())\n\t\t\t.then(json => !!json.notifications.length)\n\t\t\t.catch(captureError);\n\t}",
"function pollNotifications () {\n s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get previous word offset from span | getPreviousWordOffsetSpan(span, selection, indexInInline, type, isInField, isStarted, endSelection, endPosition) {
if (span.text === '\t' || span.text === '\v') {
if (isInField) {
endSelection = false;
return;
}
if (indexInInline === span.lengt... | [
"getPreviousWordOffset(inline, selection, indexInInline, type, isInField, isStarted, endSelection, endPosition) {\n if (inline instanceof TextElementBox) {\n // tslint:disable-next-line:max-line-length\n this.getPreviousWordOffsetSpan(inline, selection, indexInInline, type, isInField, i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called by private renderers in ./lib, returns the view matrix with which to render this PerformanceModel. The view matrix is the concatenation of the Camera view matrix with the Performance model's world (modeling) matrix. | get viewMatrix() {
if (!this._viewMatrix) {
return this.scene.camera.viewMatrix;
}
if (this._viewMatrixDirty) {
math.mulMat4(this.scene.camera.viewMatrix, this._worldMatrix, this._viewMatrix);
math.inverseMat4(this._viewMatrix, this._viewNormalMatrix);
... | [
"get modelViewMatrix() {\r\n\t\treturn SpiderGL.Math.Mat4.dup(this.modelViewMatrix$);\r\n\t}",
"getViewMatrix() {\r\n\t\treturn this.camera.getViewMatrix();\r\n\t}",
"get modelViewMatrix() {\n\t\treturn SpiderGL.Math.Mat4.dup(this.modelViewMatrix$);\n\t}",
"getModelViewMatrix(){\n\t\treturn this.mapUniforms.g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
advances automatically to next person | function autoAdvance() {
var currentPersonIndex = currentFeaturedPerson.personIndex;
if (currentPersonIndex == peopleArray.length - 1) {
changeToPerson(0);
} else {
changeToPerson(currentPersonIndex + 1);
}
} | [
"function nextPerson() {\n\n if (currentIndex != people.length - 1) {\n currentIndex++;\n } else {\n currentIndex = 0;\n }\n\n selectBox(currentIndex);\n\n clearInterval(timerNext);\n timerNext = setInterval(nextPerson, 10000);\n }",
"function nex... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ajax to get all of the data belonging to the searched formular, which will be needed for its creation on the page. | function searchFormular(){
var documentForms = document.getElementsByTagName("form");
var formularSearchForm = documentForms[2];
var formularSelect = formularSearchForm.getElementsByTagName("select")[0];
var formularID = parseInt(formularSelect.options[formularSelect.selectedIndex].value);
var xhttp;
if (win... | [
"function ajaxSearch() {\n\t\t \t\n\t\t \t$(\"input[name='name']\").keyup(function(event) {\n\t\t \t\t\n\t\t \t\tvar companyName = event.target.value;\n\t\t \t\t\n\t\t \t\t$.ajax({\n\t\t \t\t\t\n\t\t \t\t\ttype: 'get',\n\t\t \t\t\n\t\t \t\t\turl: 'http://localhost:8080/search/companies... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
saves the wish list to local storage as a JSON so that it can loaded again upon a page refresh | saveData(){
localStorage.setItem("wish_list", JSON.stringify(this.asDict()));
} | [
"function saveWishlist() {\n localStorage.setItem(\"wishlist\", JSON.stringify(wishlist));\n}",
"function saveWishes(newWish){\n var wishes = localStorage.getItem('wishes');\n wishes = JSON.parse(wishes);\n wishes.push(newWish);\n localStorage.setItem('wishes', JSON.stringif... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Map a position through this mapping. | map(pos, assoc = 1) {
if (this.mirror)
return this._map(pos, assoc, true);
for (let i = this.from; i < this.to; i++)
pos = this.maps[i].map(pos, assoc);
return pos;
} | [
"mark(sourcePos: Object) {\n let map = this.map;\n if (!map) return; // no source map\n\n let position = this.position;\n\n // Adding an empty mapping at the start of a generated line just clutters the map.\n if (this._lastGenLine !== position.line && sourcePos.line === null) return;\n\n // If thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Swap the actual CSS files depending on Audition color theme | function swapCSS(cssfilename) {
if ($("#ccstyleTheme").length)
$("#ccstyleTheme").remove();
var link = document.createElement('link');
$("head").append('<link id="ccstyleTheme" href="css/styles-' +
cssfilename + '.css" rel="stylesheet" type="text/css" />');
} | [
"function updateCSS() {\n\t\t$( \"body\" ).append( \"<link href=\\\"\" + model.parsethemeUrl() + \"\\\" type=\\\"text/css\\\" rel=\\\"Stylesheet\\\" />\" );\n\t\tvar links = $( \"link[href*=parsetheme\\\\.css]\" );\n\t\tif ( links.length > 1 ) {\n\n\t\t\t// Wait a few seconds before removing previous theme(s) to av... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate a vertical position for the image We use the image size to align all the images along the bottom of the timeline. | function calculateTimelineImageY(image, scaleFactor) {
var bottomY = Session.get('timelineImagesHeight') -
(image.thumbHeight * scaleFactor) -
((imageBorder * 2) * scaleFactor) -
imageBottomPadding;
return bottomY;
} | [
"getPositionY() {\n let posY = 0;\n if (!this.isFirstLine()) {\n let previousLineSibling = this.config.images[this.getPreviousLineSibling()];\n posY = previousLineSibling.height + previousLineSibling.top;\n }\n return posY;\n }",
"fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set the mode of the control | mode (control, mode) {
return this.set(0x01, control, controllerModes[mode.toUpperCase()])
} | [
"set mode(value) {\n\t\tif (this._mode !== value) {\n\t\t\tthis._mode = value;\n\t\t\tthis.setLnFunction();\n\t\t}\n\t}",
"function setControlMode(mode) {\n if (ctrlMode === 'select') {\n selectMode = 'start';\n unmarkAll();\n showSClickBox = false;\n }\n if (mode === 'addObject' || ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A ServiceResponse is returned from the service call. | function ServiceResponse(values) {
assign(this, values);
} | [
"handleSuccess(result) {\n this[this.responseKey]\n .status(200)\n .send(result);\n }",
"get response () {\n\t\treturn this._response;\n\t}",
"getAddVoucherResultSuccess() {\r\n return this.store.pipe(Object(_ngrx_store__WEBPACK_IMPORTED_MODULE_1__[\"select\"])(getProcessS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds amount talent points into talent with talentId | function addPoint(amount, talentId, talents, details, talentDetails) {
var row = talentDetails[talentId].row,
tree = talentDetails[talentId].tree,
pointsUsedInTree = details[tree].total,
lastActiveRow = details[tree].lastActiveRow;
// not adding any points on init
if (amount == 0) r... | [
"function addPoint() {\n var pointAdded = talentHelper.addPoint(1, scope.talentId, scope.talentsSpent, scope.talentsSpentDetails, scope.talentDetails);\n update(pointAdded);\n }",
"addpoints(amount) {\r\n this.points = this.points + amount;\r\n }",
"awardPoints(numPoints) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CALLER if array Identifies the dimensions of the array and calls converter with each value of any array | function test (input) {
for (var i = 0; i < input.length; i++) {
if (Array.isArray(input[i])) {
stringifier (input[i]);
}
else {
converter (input[i]);
}
... | [
"function transform(array){\n if (!(Array.isArray(array) && array.length)) {\n\t return \"non empty array of arguments is needed\";\n };\n\treturn array.map( function (num){ return function(){return num} } );\n}",
"function ArrayConversion(conversions, arg) {\n this.arg = arg;\n this.conversions = conversio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is for copy the selected description to the XML Data Island, then what user see is the description, not the code itself. fieldSelected is field selected xmlGrid is the the xml data island representation of the grid dispFieldName is the column name(in ... ) in xml data island for the displayed description ... | function copySelectedTextToXMLDataIsland(fieldSelected , xmlGrid , dispFieldName){
var dispText=fieldSelected [fieldSelected.selectedIndex].text;
if(isStringCodeValue(fieldSelected.value)) {
xmlGrid.recordset(dispFieldName).value=dispText;
} else {
dispText='';
xmlGrid.recordset(dispFieldName).value=dispT... | [
"function onSelectV(strSerialized, strField, strTemp)\n{\n\tvar strXMLData = \"\";\n\tvar objForm = document.forms[afmInputsFormName];\n\tif(strField != \"\")\n\t{\n\t\tvar typeUpperCase = arrFieldsInformation[strField][\"type\"];\n\t\ttypeUpperCase = typeUpperCase.toUpperCase();\n\t\tvar formatUpperCase = arrFiel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper for SetPhysicsTrans. Says if an object should be snapped to | function ShouldSnap(hitbox_before, hitbox_after, hitbox_obj)
{
var upper_before = hitbox_before[0];
var bottom_before = hitbox_before[1];
var upper_after = hitbox_after[0];
var bottom_after = hitbox_after[1];
var upper_obj = hitbox_obj[0];
var bottom_obj = hitbox_obj[1];
var eq_thres = 0.... | [
"hasSnapped() {\n return this.strength === -1;\n }",
"isSnadder() {\n let tile = tiles[this.spot];\n return tile && tile.snadder !== 0;\n }",
"isSShaped(){\r\n let b = this.end.getBounds()\r\n let p = this.start.getConnectionPoint(new Direction(1,0))\r\n return (b.x >= p.x + 2 * ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Secure exchange of messages between two objects using DH key exchange Object, Object > Null | function secureMessageExchange(oAlice, oBob, p, g) {
keyExchange(oAlice, oBob, p, g);
oAlice.transmit(oBob);
oBob.transmit(oAlice);
} | [
"function diffieHellmanExchange(public_key) {\n if (crypto_debug == true) {\n console.log('Attempting DH key exchange with server...'); }\n\n var session = {'_token': getCookie(chat_id),'_public_key': public_key};\n $.post('/api/' + chat_id + '/dh-exchange', session, function (Keydata) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resolve the user from the userOrResolver property | resolveUser() {
if (this.user) {
return;
}
if (typeof this.userOrResolver === 'function') {
this.user = this.userOrResolver();
}
else {
this.user = this.userOrResolver;
}
} | [
"async resolveUser () {\n\t\t// find or create a \"faux\" user, as needed\n\t\tthis.user = this.request.user = await this.findOrCreateUser(this.request.body.creator);\n\t\tthis.users.push(this.user);\n\t}",
"async resolveUser(search){\n\n\t\tlet user = null;\n\n\t\tif(!search || typeof search !== \"string\") retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
version of that string extending any long vowels to 5 characters. Examples: > longLongVowels('Good') 'Goooood' > longLongVowels('Cheese') 'Cheeeeese' > longLongVowels('Man') 'Man' | function longLongVowels(string){
let vowels = ['a', 'i', 'u', 'e','o']
let newString = ''
let index = 0
while(index < string.length){
if(index !== string.length - 1
&& string[index] === string[index+1] && vowels.indexOf(string[index]) !== -1){
newString += string[index]... | [
"function longVowels(string) {\n newStr = '';\n vowList = ['a', 'e', 'i', 'o', 'u'];\n for (let i = 0; i < string.length; i++) {\n if (vowList.includes(string[i])) {\n if (string[i] === string[i + 1]) {\n newStr += string[i].repeat(5);\n i++;\n } e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if message can be display by id | function checkScreenId(messageId, id) {
for (var x = 0; x < messageId.id.length; x++) {
if (messageId.id[x] == id) {
return 1;
break;
}
}
} | [
"function checkId(id) {\n if (id != restrictedChatId) {\n return false;\n }\n return true;\n}",
"function isMessageOnScreen(msgId) {\r\n if ($(`#${msgId}`).length) {\r\n return $(`#${msgId}`);\r\n } else {\r\n return false;\r\n }\r\n}",
"function hasMessage(id) {\n var fieldId = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load clientCurriculum and append to req. | function load(req, res, next, id) {
ClientCurriculum.get(id)
.then((clientCurriculum) => {
req.clientCurriculum = clientCurriculum;
return next();
})
.catch(e => next(e));
} | [
"function load(req, res, next, id) {\n _models.ClientCurriculum.get(id).then(function (clientCurriculum) {\n req.clientCurriculum = clientCurriculum;\n return next();\n }).catch(function (e) {\n return next(e);\n });\n}",
"function load(req, res, next, id) {\n _models.Curriculum.g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
\brief For a given list of objects returns a function that validates the presence and validity of the specified properties. \param props list of object properties to validate. Each property is an object w/ a 'name' and 'type' (as in typeof()). | function makePropertyValidator(props) {
return function (object) {
var _hasProperty = function(o, prop, type) { return o != null && (prop in o) && typeof (o[prop]) === type; };
return !props.some(function (prop) { return !_hasProperty(object, prop.name, prop.type); });
};
} | [
"function CfnAllowListPropsValidator(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('Expected an object, but received: ' ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks whether `node` has a comment (that ends) on the previous line or on the same line as `node` (starts). | function hasCommentBefore(node, sourceCode) {
return sourceCode.getCommentsBefore(node).
some(comment => comment.loc.end.line >= node.loc.start.line - 1);
} | [
"static isCommentNode(node) {\r\n const kind = node.getKind();\r\n return kind === typescript_1.SyntaxKind.SingleLineCommentTrivia || kind === typescript_1.SyntaxKind.MultiLineCommentTrivia;\r\n }",
"function isCommentNode(node) {\n return isNode(node) && node.type === 3;\n}",
"function isCo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Example 1812. Implementing timeouts Issue an HTTP GET request for the contents of the specified URL. If the response arrives successfully, pass responseText to the callback. If the response does not arrive in less than timeout ms, abort the request. Browsers may fire "readystatechange" after abort(), and if a partial r... | function timedGetText(url, timeout, callback) {
// Create new request.
var request = new XMLHttpRequest();
// Whether we timed out or not.
var timedout = false;
// Start a timer that will abort the request after timeout ms.
var timer = setTimeout(// Start a timer. If triggered,
... | [
"function timedGetText(url, timeout, callback) {\n let request = new XMLHttpRequest();\n let timedout = false; // Whether we timed out or not\n // Start a timer tha will abort the request after timeout ms \n let timer = setTimeout(function() {\n timedout = true; // set a flag and then\n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
tail :: [a] > [a] drop head element | function tail(a) {
return drop(1, a);
} | [
"function tail(a) {\n\t return drop(1, a);\n\t }",
"function tail(a) {\n\t return drop(1, a);\n\t }",
"function tail (a) {\n return drop(1, a)\n}",
"function tail(a) {\n return drop(1, a);\n }",
"function tail(a) {\n\t return drop(1, a);\n\t}",
"removeTail() {\n if(this.length =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Restore chat window | function restoreChatWindow()
{
try
{
//var divChatDisplay = document.getElementById('divChatDisplay');
//increase the height up to a 180px
//divChatDisplay.style.height = 200 +'px';
... | [
"function minRestoreChatWindow()\r\n {\r\n try\r\n {\r\n if( minimized )\r\n restoreChatWindow();\r\n else\r\n minimizeChatWindow();\r\n }\r\n catch(ex){}\r\n }",
"function restoreWindow()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
month of birth validation | function validateBirthmonth(month_of_birth) {
if (month_of_birth < 1 || month_of_birth > 12) {
alert("month invalid");
}
else {
month_of_birth = month_of_birth;
return month_of_birth;
}
} | [
"function validateDOB(errMessages)\t{\r\n\tvar dobRules = \"<p>The <b>DOB</b> field must be 7 characters and in the format mmmyyyy, (m-month, y-year). The month must also be all uppercase or all lowercase letters.</p>\";\r\n\t\r\n\tvar dob = document.getElementById(\"dob\");\r\n\tdob = dob.value.trim();\r\n\tvar do... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Crea un array de n aleatorios, como minimo 1 function aleatorios | function aleatorios(limite = 1) {
let r = []
for (let i = 0; i < limite; i++) {
r[i] = numeroAlAzar100()
}
return r
} | [
"function generate_array(n, a) {\n\n A = [];\n\n for (let nh = 0; nh < n; nh++) {\n A.push(a);\n }\n\n return A;\n}",
"function newArray(n) {\n const array = [];\n for (let i = 0; i < n; i++) {\n array.push(i);\n }\n return array;\n }",
"function generarTeclas(ni... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function calls for gettign the details of product. | function fetchDetailsForProduct() {
if (kony.net.isNetworkAvailable(constants.NETWORK_TYPE_ANY)) {
kony.application.showLoadingScreen("loadskin", "Fetching product details...", constants.LOADING_SCREEN_POSITION_FULL_SCREEN, false, true, {enableMenuKey: true, enableBackKey: true, progressIndicatorColor: "ffffff77"... | [
"async function getProductDetails() {\r\n const productName = agent.parameters.productname\r\n\r\n if (token === \"\" || typeof token === 'undefined') {\r\n addAgentMessage(\"Sorry I cannot perform that. Please login first!\")\r\n return;\r\n }\r\n\r\n\r\n let product = await getProductByName(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
OutcomePracticability picker event handler | function OnOutcomePracticability_Change( e )
{
Alloy.Globals.AeDESModeSectionEight["OUTCOME_PRACTICABILITY"] = e.id ;
} | [
"function OnVulnerableFacilities_Changed( e )\r\n{\r\n current_vulnerable_facilities = e.value ;\r\n}",
"function getConfidence() {\n\n let sliderStart = Math.floor(Math.random() * 100) + 1;\n\n //clear buttons and realign button group to fit confidence question\n buttons.inner... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function displayAllElements will display the max number of elements that the API has for the specific category | function displayAllElements(kind){
//kind will be vehicles, people, starships, etc
switch(kind){
case 'people':
generatePeople(maxNumberOfPeople);
break;
case 'planets':
generatePlanets(maxNumberOfPlanets);
break;
case 'films':
generateFilms(maxNumberOfFilms);
break;
case 'specie... | [
"function displayMaxCards() {\n var maxNum = getMaxNum();\n var categoryItems = $(\".category-page-filter\").find(\".category-items\").children(\".category-item\");\n \n var dblockCategoryItems = categoryItems.filter(function(i,item) {\n if($(item).hasClass(\"hiden-filter\")) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
scroll the active element into view in the sidenav | function initSidenavScroll() {
let sidenav = $(".sidenav-list");
let sidenav_active_elements = $(".sidenav .active");
if (sidenav_active_elements.length > 0) setTimeout(() => { //setTimeout gives bootstrap time to execute first
sidenav[0].scrollTop = sidenav_active_elements[0].offsetTop - 60;
})... | [
"scrollToActive() {\n this.scroll.scrollIntoView(this.getElementAt(this.activeItemIdx));\n }",
"scrollToActive () {\n if (!this._sidebar.classList.contains('sidebar-fixed') || this._scroller === null) return\n\n const active = this._sidebar.querySelector('.nav-item.active:not(.open) > .nav-link')\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs keywords for the eBay search (TIDY THIS UP) | function getEbayKeywords(title) {
// Year of issue release
var year = title.issue_date.split("-");
year = year[0];
// Booleans (annual, special, variant)
var annual = parseInt(title.annual) === 1 ? " Annual" : " -Annual";
var special = parseInt(title.special) === 1 ? " Special" : " -Special -Edition";
va... | [
"function keywords () {\n var nyc = [\"New York\", \"New York City\", \"NYC\"];\n var sf = [\"San Francisco\", \"SF\", \"Bay Area\"];\n var la = [\"Los Angeles\", \"LA\", \"LAX\"];\n var austin = [\"Austin\", \"ATX\"];\n var sydney = [\"Sydney\", \"SYD\"];\n}",
"function buildKeyword... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |