query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Gets all cities from INITIALCITIES from cities_database.js and displays on map as markers in next function. | function showInitialCities() {
Object.keys(INITIALCITIES).forEach(function(cityName) {
displayTeleportCity(cityName);
});
} | [
"function populateCityList() {\r\n var cityIds = new Object();\r\n cityIds[WME_ADD_UNKNOWN] = \"No City\";\r\n for (var cit in wazeModel.cities.objects) {\r\n var city = wazeModel.cities.get(cit);\r\n if (city && cityIds[city.id] == null && city.name != null && city.name.length > 0) {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
config.init() / Common utility to canculate width and height of the qr code. Depends on jquery. Returns a minimum of 120 if browser is too small and a maximum of 400 as to not make the person lean back in their chair. | function getQRCodeSize () {
var height = $(document).height();
var width = $(document).width();
var max = Math.min(height, width, 400 + 120);
return Math.max(max - 120, 120);
} | [
"function JsQRScannerReady() {\n //create a new scanner passing to it a callback function that will be invoked when\n //the scanner succesfully scan a QR code\n var jbScanner = new JsQRScanner(onQRCodeScanned, provideVideoQQ);\n //reduce the size of analyzed images to increase performance on mobile devi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add parameters to the menu query string. This is a common function for entity folder "tab" pages. | function cisEntityFolderGetMenuQueryString(id, url)
{
var tempUrl = '';
var tempPKUrl = '';
if (getObject("pk")) {
tempPKUrl = "pk=" + getObject("pk").value;
}
if (getObject("entityType")) {
tempPKUrl = tempPKUrl + "&entityType=" + getObject("entityType").value;
}
i... | [
"function updateQueryString() {\n\tsessionStorage[\"query\"] = \"start=\" + sessionStorage[\"start\"] + \"&end=\" + sessionStorage[\"end\"] + \"&pipeline=\" + sessionStorage[\"pipeline\"] + \"&datacen=\" + sessionStorage[\"datacen\"] + \"&network=\" + sessionStorage[\"network\"] + \"&farm=\" + sessionStorage[\"farm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to render error modal if there is an error string | function renderError() {
if (typeof errorMessage === 'string') {
return (
// JSX to create the modal
<ErrorModal message={errorMessage}/>
)
}
} | [
"function ajaxErrorModal( model, xhr, options, message, title ){\n message = message || DEFAULT_AJAX_ERR_MSG;\n message += ' ' + CONTACT_MSG;\n title = title || _l( 'An error occurred' );\n var details = _ajaxDetails( model, xhr, options );\n return errorModal( message, title, details );\n}",
"func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Highlight the selected blocknumber | function mark_selected(block_number) {
if (block_number === " ") return;
// Change color for selection of a new block
for(row = 0; row < game_board.length; row++) {
for (column = 0; column < game_board[row].length; column++) {
var div_name = game_board[row][column];
var chil... | [
"highlightSelected() {\n\n this.highlighter.setPosition(this.xStart + this.selected * this.distance, this.yPosition + this.highlighterOffsetY);\n\n }",
"function blockClassSelected() {selectedBlock.attr('class', 'selected')}",
"highlight() {\n this.model.set('isSelected', true);\n }",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
reload the original's copies into the original variables | reloadVariables() {
this.firstTime = this.firstTimeCopy;
this.userString = this.userStringCopy;
this.sepString = this.sepStringCopy;
this.running = this.runningCopy;
this.compareDisplay = this.compareDisplayCopy;
this.compToPref = this.compToPrefCopy;
this.speed = this.speedCopy;
} | [
"restoreOriginalState() {\n\n\t\t\tconst originalValueOffset = this.valueSize * 3;\n\t\t\tthis.binding.setValue( this.buffer, originalValueOffset );\n\n\t\t}",
"function resetVars() {\n\t\tidArrays = [];\n\t\tdeathArrays = [];\n\t\tfollowUpArrays = [];\n\t\tdataType = \"number\";\n\t\tsources = 0;\n\t\tNs = [];\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends a request to the YouTube Data API to retrieve the title of the YouTube video. | function retrieveVideoTitle(videoID) {
var actionURL = 'https://www.googleapis.com/youtube/v3/videos?id=' + videoID +
'&key=' + GOOGLE_API_KEY + '&fields=items(snippet(title))&par' + //eslint-disable-line no-undef
't=snippet';
var submitMethod = 'get';
return Promise.resolve($.ajax... | [
"function getVideoMetaData(opts, callback) {\n debug('fn: getVideoMetaData');\n var videoId;\n\n if (typeof opts === 'string') {\n videoId = opts;\n }\n\n if (_typeof(opts) === 'object') {\n videoId = opts.videoId;\n }\n\n var _opts$hl = opts.hl,\n hl = _opts$hl === void 0 ? 'en' : _opts$hl,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
runs once after starting the game, will pick 5 random questions from the triviaQuestion array and put them into randArr | function randQ(){
for (let i = triviaQuestion.length -1; i > 0; i--){
const j = Math.floor(Math.random()*i);
const temp = triviaQuestion[i];
triviaQuestion[i] = triviaQuestion[j];
triviaQuestion[j] = temp;
}
for (let i=0; i < 5; i++){
randArr.push(triviaQuestion[i]);
... | [
"function displayTrivia(){\n copyAnswerArray = answerArray.slice(0); // create a copy of the questions\n shuffle(copyAnswerArray);// shuffle the answers\n if (question[0].length > 50){ // Changes font size of question if too big\n questionDisplay.style.fontSize = 1.25 + 'em';\n }\n else {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Dimensionality (type) of the texture (Read Only). | get dimension() {} | [
"static get VERTEX_FLOAT_SIZE() { return 3 + 3 + 2; }",
"get tileSize() {}",
"getDimensions() {\n return {\n length: this.topLeft.lat - this.bottomLeft.lat,\n width: Math.abs(this.topLeft.long) - Math.abs(this.topRight.long)\n }\n }",
"get scale() {\n\t\treturn {\n\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
new Interpreter() new Interpreter(lastInterpreter) new Interpreter(errorHandler) new Interpreter(lastInterpreter, errorHandler) | constructor(){
var last_interpreter = null;
var on_error = null;
if (arguments.length == 2) {
last_interpreter = arguments[0];
on_error = arguments[1];
} else if (arguments.length == 1 && arguments[0] instanceof Interpreter) {
last_interpreter = arguments[0];
} else if (arguments.l... | [
"function resetInterpreterAndSequencerStore() {\n _storesSequencerStoreJs2['default'].resetState();\n /* SequencerStore now has new node/link refs,\n update via function closure */\n stateToNodeConverter = new _StateToNodeConverterStateToNodeConverterJs2['default'](_storesSequencerStoreJs2['default']... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Implement Queue using stacks | function Queue(){
//Stack1 for pushing Queue Items
let stack1 = new Stack();
//Stack2 for popping Queue Items
let stack2 = new Stack();
this.push = function(element){
stack1.push(element);
}
this.pop = function(){
stack2.clear();
while(!stack1.isEmpty()){
... | [
"function Solution(){\n let stack = []\n let queue = []\n this.pushCharacter = (ch) =>{\n return stack.push(ch)\n }\n this.enqueueCharacter = (ch) =>{\n return queue.push(ch)\n }\n this.popCharacter = () => {\n return stack.pop();\n }\n this.dequeueCharacter = () => {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates GLA rule 2 general exception block state according to corr blocks presence. | function updateRule2GeneralExceptionConditionsBlock() {
var rule2GeneralExceptionIsEnabled = $("#ruleBlock2FormBlocks").data('corrBlocks').length !== 0;
var checkbox = $("#ruleBlock2GeneralExceptionCheckboxContainer").find("input");
if (!rule2GeneralExceptionIsEnabled) {
checkbox.prop('checked', fal... | [
"function initRule2Block() {\n $('#ruleBlock2').find('.formBlockHeader').html(languageConstants.gla.rule2.label);\n $('.corrElementBlock #controlCheckboxLabel').html(languageConstants.gla.rule2.corrElementExceptionControlCheckboxLabel);\n initBlock2GeneralExceptionConditionsBlock(glaRule2Data.exbl);\n $... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function which pushes lowercase copies of items in buttons array to lowerCaseButtons array, only needs to run ONCE, probably does not need to be a Fxn? | function lowerCaseArray(){
for (var index = 0; index < buttons.length; index++) {
lowerCaseButtons.push(buttons[index].toLowerCase());
};
} | [
"generateButtonList(){\n\t mapButtonList = mapNameSnapshots.split(\"|\");\n\t mapButtonList.shift();\n }",
"function generateAbcBtns() {\n let html = '';\n for (const letter of alphabet) {\n html += `<button class=\"my-btn btn-abc btn btn-primary m-1 col-1 p-1\" id=\"btn-${letter}\">${... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generating score table with players name | function ScoreTable() {
this.player1 = joueur1;
this.player2 = joueur2;
var tableau = document.createElement("table");
tableau.setAttribute("class","score");
tableau.setAttribute("id","score");
var tmp_tr = document.createElement("tr");
tmp_tr.appendChild(document.createElement("th"));
... | [
"function populateLeaderboardTable() {\n\t// Ordeno el json dependiendo del score y los partidos ganados, perdidos o empatados\n\tleaderboardJson = leaderboardSorted(leaderboardJson);\n\t// imprimo las 5 primeras posiciones\n\tleaderboardTable.innerHTML = \"\";\n\tleaderboardJson.slice(0, 5).forEach(player => {\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loop through the main sheet and upload stories to Harvest. If upload is toggled to false, get story hours and return them. Do not upload. | function scanSheet(upload) {
upload = (typeof upload == 'undefined' ? true : upload);
var statusCol = 0;
var epicCol = statusCol + 3;
var titleCol = statusCol + 5;
var hoursCol = statusCol + 12;
var startRow = 10;
var hours = [];
var startTime = new Date();
Logger.log("Started sc... | [
"function updateProjectTaskHours() {\n var error = checkControlValues();\n if (error != \"\") {\n Browser.msgBox(\"ERROR:Values in the Controls sheet have not been set. Please fix the following error:\\n \" + error);\n return;\n }\n\n var successCount = 0;\n\n var result = JSON.parse(ge... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
recursive function callback from DrawOtherPlayer counter order player in game | function DrawingOtherPlayer(i,counter) {
if (i == playerNumber - 1) return true
$.ajax({
url:'/get_card_other_player?id='+players[i].id,
dataType: 'json',
index: counter,
player: i,
success: function(data) {
countCard[this.player] = data.count
var cardInHand = $('#player'+this.index+... | [
"function doPlayerGraph(e, res)\n{\n\tvar data, datas, i, j, p, max;\n\n\tdata = [];\n\tfor (i = 0; i < res.players.length; i++) {\n\t\tp = res.players[i].player;\n\t\tif (p.joined < 0)\n\t\t\tcontinue;\n\t\t/* \n\t\t * This is inefficient: just top up the number of\n\t\t * projected rounds incrementally.\n\t\t */\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reuses old values when equal. If anything is unequal, returns newProps asis. Great for PureComponent, but won't be feasible with React, so just eliminate and use React's DOM diffing. | function recycleProps(oldProps, newProps, equalityFuncs) {
var comboProps = {}; // some old, some new
var anyChanges = false;
for (var key in newProps) {
if (key in oldProps && (oldProps[key] === newProps[key] ||
(equalityFuncs[key] && equalityFuncs[key](oldProps[key]... | [
"shouldComponentUpdate(nextProps, nextState) {\n return nextState.tipState !== this.state.tipState\n }",
"_updateUniformTransition() {\n // @ts-ignore (TS2339) internalState is alwasy defined when this method is called\n const {\n uniformTransitions\n } = this.internalState;\n\n if (uni... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fades in the text indicating the state of tasklist request. | function tasklistFadeInResultText(){
$( "#tableWrapper" ).animate({
opacity: 0.5
}, 1000, function() {
tasklistFadeOutResultText();
});
} | [
"function tasklistFadeOutResultText(){\n \n $( \"#tableWrapper\" ).animate({\n opacity: 1\n }, 1000, function() {\n if (!tasksFetched)\n tasklistFadeInResultText();\n });\n}",
"animatePlaceholderStatus() {\n Animate.blink(this);\n }",
"function mFade() {\n\tgetId('... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
= = = = = = = = = = = = = = This function is used to select all of the data in the Load Save text box thereby saving the user from having to scroll down to manually select all the text. | function selectAllData() // sad = select all data
{
var sad = document.getElementById('stateDisplay');
sad.focus();
sad.select();
} | [
"function do_select_all() {\n var baseurl = document.getElementById('selfurl');\n // Make asynchronous call to self page with flag to select all for current page\n YUI().use(\"io-base\", function(Y) {\n var uri = baseurl.value + \"&do_select_all=1\";\n var cfg = {\n method: 'POST',... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decode an input with RLP | function _decode(input) {
var length, llength, data, innerRemainder, d;
var decoded = [];
var firstByte = input[0];
if (firstByte <= 0x7f) {
// a single byte whose value is in the [0x00, 0x7f] range, that byte is its own RLP encoding.
return {
data: input.slice(0, 1),
... | [
"function OrionDecode(config) {\n RED.nodes.createNode(this, config);\n var node = this;\n\n node.status({fill: 'yellow', shape: 'dot', text: 'Idle'});\n\n function ov2wavCallback(response) {\n node.send(response);\n }\n\n node.on('input', function(msg) {\n if (msg.hasOwnProperty('event_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Play an action by name | playAction(name) {
this.action(actions[name])
} | [
"function useAction(slot:int){\r\n\tclickAudio.Play();\r\n\tGameStateScript.setClicked(slot);\r\n}",
"function __generateActionName(name) {\n\t return 'action:' + name;\n\t}",
"function greet(action){\n action();\n}",
"function performSelectedAction(){\r\n\tswitch(selectedAction){\r\n\tcase GameScreenAc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stores confirmed(repriced) offer in a session | storeConfirmedOfferInSession(confirmedOffer) {
this.storeInSession(KEYS.CONFIRMED_OFFER, confirmedOffer);
} | [
"confirmOrder() {\n\n // Trigger redirect in next render\n this.setState({confirmed: true});\n\n // create order model\n var orderModel = {\n cart: this.props.cart,\n offer: null\n }\n\n // Post order to API\n var confirmOrder = this.props.postO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
convert level status to int | function statusToInt(status) {
switch(status) {
case 'open': return 0;
case 'bronze': return 1;
case 'silver': return 2;
case 'gold': return 3;
default: return null;
}
} | [
"function levels(stat) {\n\treturn parseInt(document.getElementById(stat + \"_levels\").value);\n}",
"formatLevel(leveledScore) {\n return leveledScore.level;\n }",
"get statusAsCode() {\n return this._cancerProgression.value.coding[0].code.value;\n }",
"function getLevelRo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
logic to scroll the carousel step 1 | _carouselScrollOne(Btn) {
let itemSpeed = this.speed;
let translateXval = 0;
let currentSlide = 0;
const touchMove = Math.ceil(this.dexVal / this.itemWidth);
this._setStyle(this.nguItemsContainer.nativeElement, 'transform', '');
if (this.pointIndex === 1) {
... | [
"function nextSlide(step) {\n pos = Math.min(pos + step, 0);\n setTransform();\n }",
"autoScrollOn() {\n const carouselItemsLength = this.carouselItems.length;\n\n if (!this.disableAutoScroll) {\n if (\n this.activeIndexItem === carouselItemsLength - 1 &&\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if there is a recentlyWatched variable in localstorage otherwise it creates it | function checkRecentlyWatched() {
if (localStorage.getItem("recentlyWatched") == null) {
recentlyWatched = [];
localStorage.setItem("recentlyWatched", JSON.stringify(recentlyWatched));
} else {
recentlyWatched = JSON.parse(localStorage.getItem("recentlyWatched"));
... | [
"function checkLocalStorage() {\n if (!Array.isArray(topicsList)) {\n topicsList = [];\n }\n if (!Array.isArray(favList)) {\n favList = [];\n }\n}",
"function checkStorage() {\n var storage = JSON.parse(localStorage.getItem(\"dayPlanner\"));\n if (storage === undefined || storage === null || stora... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts a utf8 byte buffer or a JSON string into an object and returns it. | function objectFactory(data) {
// if we are given an object Object, no-op and return it now.
if (_.isPlainObject(data)) {
return data;
}
// If we are given a byte Buffer, parse it as utf-8
if (data instanceof Buffer) {
data = data.toString('utf-8');
}
// If we now have a st... | [
"parseJsonToObject(str) {\n try {\n const obj = JSON.parse(str);\n return obj;\n } catch (error) {\n return {};\n }\n }",
"function decode(content, encoding, decoder = \"text\") {\n if (encoding) {\n content = Buffer.from(content, encoding).toString();\n }\n switch (decoder) {\n ca... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate Grouping Routes Content | groupingRoutes() {
if (!this.routes || this.routes.length <= 0) {
throw Error("Route Names Data Not Found.")
}
// Empty Routes File Content
var moduleRoutes = "";
moduleRoutes += "<?php \n\n";
moduleRoutes += "// " + this.module + " Module Routes\n";
moduleRoutes += "$routes->group('... | [
"getRoutes() {\n let routes = [];\n this.getGroups().forEach(group => {\n routes = routes.concat(group.routes);\n });\n if (this.fallback) {\n routes = routes.concat(this.fallback.routes);\n }\n return routes;\n }",
"getGroups() {\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
using countLetters from before var reducer2 = (accu2, element2) => accu2 + countLetters2(element2); | function reducer2(a, e) {
var summ = 0;
if (typeof a == "string") { // this handles the initial case where the first element is used
summ = a.length; // as the starting value.
}
else {
summ = a;
}
return summ + countLetters(e);
} | [
"function reduce(wordAndOccurence){\n\tvar word; // used to store the word\n\tvar occurence = 0;// used to store the occurence of the word\n\t\n\tfor (var key in wordAndOccurence){ // we loop on \"wordAndOccurence\"\n\t\tword = key; // we know that it's only one word so we get it for later\n\t\t/*var numberOccurenc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts an ABC pitch to a frequency in Hz. | function pitchToFrequency(pitch) {
return midiToFrequency(pitchToMidi(pitch));
} | [
"toFrequency() {\n return (0, _Conversions.mtof)(this.toMidi());\n }",
"function getFrequency(value) {\n\tif (!ctx) {\n\t\treturn 0;\n\t}\n\t// get frequency by passing number from 0 to 1\n\t// Clamp the frequency between the minimum value (40 Hz) and half of the\n\t// sampling rate.\n\tvar minValue = 40;\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given an ontology's prefix, it returns its reduced prefix from the prefixes list | function getPrefixFromConf(prefix) {
var values = Object.keys(prefixList).map(function(key) {
return prefixList[key];
});
var position = valuePosition(prefix,values);
var newPrefix = "";
var keys = Object.keys(prefixList);
if (position >= 0 && position < keys.length) {
newPref... | [
"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 // remove any existing prefix targeting this uri\n // for (let exi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get random Flight status codees In order to generate the random number 0,10,20,30,40,50 for status from FlightSuretyApp contract related to status code to submit the oracles Flight status codees UNKNOWN = 0 TIME = 10 LATE_AIRLINE = 20 LATE_WEATHER = 30 LATE_TECHNICAL = 40 LATE_OTHER = 50 | function getRandomStatusCode() {
return (Math.floor(Math.random()*6))*10;
} | [
"function get_random_state() {\n // Since the only valid initial states are OPEN and BLOCKED, we can just round the random number to either 0 or 1 and map it to one of the board states\n var random_value = Math.round(Math.random());\n return (random_value == 0) ? board_state.OPEN : board_state.BLOCKED;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build an LR automaton for the grammar, using the provided "build" functions. | function automaton(grammar, build) {
var states = [ { kernel: build.initial() } ];
var state;
var l;
var s = 0;
var transitions, symbol, kernel;
var i;
// While no more states have been added... (outer loop)
while (s < states.length) {
// Process exi... | [
"build() {\n\t\tconst self = this;\n\n\t\tself.buildTags();\n\t\tself.buildTree();\n\t}",
"function buildRules( languageNode )\n{\n\tvar contextList, contextNode, sRegExp, rootNode;\t\n\tvar rulePropList, rulePropNode, rulePropNodeAttributes, ruleList, ruleNode;\n\n\trootNode = languageNode.selectSingleNode(\"/*\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
funcion para asiganarle el producto registrado a la sucursal de donde se registra este producto | function asignarProdutoSucursal(keyProducto){
/*key sucursal es llamada del valor de un hidden que esta en area.php*/
var keySucursal= document.getElementById("lb1").value;
var requestData = {};
requestData.websafeSucursalKey=keySucursal;
requestData.websafeProductoKey=keyProducto;
gapi.client.doom... | [
"function agregarProductoEmpresa(i){\n\t\tvar keySucursal= document.getElementById(\"lb1\").value;\n\t\tvar keyProducto= document.getElementById('keyProducto'+i).value;\n\t\t\n\t\tvar requestData = {};\n\t\t\n\t\trequestData.websafeSucursalKey=keySucursal;\n\t\trequestData.websafeProductoKey=keyProducto;\n\t\t\n\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Chat tab function (since 1.1) | function chat_tab()
{
$.tab = 'chats';
$('#tab-chats').addClass('active-tab');
$('#tab-contacts').removeClass('active-tab');
var URL = $.base_url + 'ajax/chat_contacts_ajax.php';
var token = $('#token').val();
$.ajax({
type: "POST",
url: URL,
data: {post_tabs: 'chats', token: token},
cache: false,
... | [
"function contacts_tab()\n{\n\t$.tab = 'contacts';\n\t\n\t$('#tab-contacts').addClass('active-tab');\n\t$('#tab-chats').removeClass('active-tab');\n\t\n\tvar URL = $.base_url + 'ajax/chat_contacts_ajax.php';\n\tvar token = $('#token').val();\n\t\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: URL,\n\t\tdata: {post_tabs:... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes everything inside the subtemplates of a message. | function removeInnerTemplateTranslation(message) {
var match;
var res = '';
var index = 0;
var inTemplate = false;
var tagMatched;
while ((match = SUBTEMPLATE_REGEXP.exec(message)) !== null) {
if (!inTemplate) {
res += message.substring(index, match.index + match[0].length);
... | [
"function templateDel(template) {\n var id = template.getId();\n var queryParams = {parentId : id};\n var subtemplates = templateTable.query(queryParams), targets = targetTable.query(queryParams);\n var i;\n\n for (i=0; i<subtemplates.length; i+=1)\n templateDel(subtemp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
open url in smoothbox | function opensmoothboxurl(openURLsmoothbox){
openSmoothBoxInUrl(openURLsmoothbox);
return false;
} | [
"function openImage() {\n window.open($(this).prop('src'));\n }",
"function _openYoutube(){\n Linking.openURL(songData.sections[2].youtubeurl.actions[0].uri);\n }",
"function openBox() {\n let xhttp = new XMLHttpRequest();\n const url = '/openBox';\n\n // Check if req was handled correctl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Words is an array of arrays, of length (colors). if with_positions is true, words is an array of [start,end] positions instead | display_raw_text(div, raw_text, word_lists=[], colors=[], positions=false) {
div.classed('lime', true).classed('text_div', true);
div.append('h3').text('Text with highlighted words');
let highlight_tag = 'span';
let text_span = div.append('span').text(raw_text);
let position_lists = word_lists;
... | [
"wordAt(pos) {\n let { text, from, length } = this.doc.lineAt(pos)\n let cat = this.charCategorizer(pos)\n let start = pos - from,\n end = pos - from\n while (start > 0) {\n let prev = findClusterBreak(text, start, false)\n if (cat(text.slice(prev, start)) != d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the AAM segments for the user. | function getUserSegments() {
return audienceManagerUserSegments;
} | [
"function _getSegments() {\n switch ($scope.options.timeScope) {\n case 'day':\n return _getHours();\n case 'range':\n return _getDaysForRange();\n case 'month':\n return _getDaysForMonth();\n case 'week':\n default:\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extract the DOI for eLife articles | function get_eLife(theURL) {
// http://elife.elifesciences.org/cgi/content/short/3/0/e01539?rss=1
var myDOITMPi = theURL.lastIndexOf("/")
var myDOITMP = theURL.substring(myDOITMPi+2,theURL.length) // +2 to get rid of /e
var myDOITMPi = myDOITMP.indexOf("?")
var myDOI = myDOITMP.substring(0,myDO... | [
"function get_Nature(theURL,mycompstr) {\r\n var theDOI = theURL.substring(mycompstr.length,theURL.length+1);\r\n return theDOI;\r\n}",
"function getElements() {\n\n for(let i = 0; i < 6; i++) {\n var idxBeg = $(\"source\").value.indexOf(begSubstrings[i]);\n eoeElements[i] = $(\"source\").value.subst... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is initially called when the "start viewing" button of a display frame is pressed and keeps calling itself every [interval] msec, refreshing the frame until it becomes inactive. | function updateDisplay(display_frame_name)
{
var interval = 5000;
var display_frame = getDisplayFrame(display_frame_name); ... | [
"refresh(timeNow, enableAnimation) {\n }",
"function startTimer() {\n setInterval(displayNextImage, 3000);\n}",
"NewFrame(time)\n {\n if(this.WantsSaveIniSettings)\n {\n this.WantsSaveIniSettings = false;\n // XXX: save settings to .prefs file/dir\n window... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle click on canvas elements to show toolbar near clicked one | function elementClickedHandler() {
showToolbar(this);
} | [
"function onCanvasClick(args) {\n // correct the coordinates: this will also account for any overflow\n // applied to the canvas\n var cx = args.clientX, cy = args.clientY;\n var rect = canvas.getBoundingClientRect();\n cx -= rect.left; cy -= rect.top;\n\n // transform pixe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compiles an action: i.e. optimize regular expressions and case matches and do many sanity checks. This is called only during compilation but if the lexer definition contains user functions as actions (which is usually not allowed), then this may be called during lexing. It is important therefore to compile common cases... | function compileAction(lexer, ruleName, action) {
if (!action) {
return { token: '' };
}
else if (typeof (action) === 'string') {
return action; // { token: action };
}
else if (action.token || action.token === '') {
if (typeof (action.token) !== 'string') {
_mona... | [
"function compileAction(lexer, ruleName, action) {\n if (!action) {\n return { token: '' };\n }\n else if (typeof (action) === 'string') {\n return action; // { token: action };\n }\n else if (action.token || action.token === '') {\n if (typeof (action.token) !== 'string') {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cancel an ongoing download Param: id: The download request id. callback: Called when download is cancelled. Basically added as event listener for events.cancel event. API is similar to nodejs standard pattern. | cancelDownload(id, callback = dummyFunction) {
let fd = this.downloads[id];
if (fd instanceof FileDownloader) {
// fd corresponds to a file
// Add event listener and cancel download
this.downloads[id].on(events.cancel, callback);
this.downloads[id].cance... | [
"function cancel(id) {\n\n var execItem = execData[id];\n\n if (execItem && execItem.state == 'waiting') {\n clearTimeout(execItem.timeoutID);\n execItem.timeoutID = 0;\n execItem.state = 'cancelled';\n }\n\n return this;\n }",
"function cancelContra... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Populate the event drop down with the calendar files | function popEvtList() {
var theTable = document.getElementById('FileLogTable');
var calNames = "";
var opt = document.createElement('option');
var selecter = document.getElementById('evtDropDown');
//reset the selecter
selecter.options.length = 0;
for(var i = th... | [
"function populateDropdown ( dropdown, start_path )\n {\n var items = [];\n var items_full_path = start_path.getFiles();\n \n for (i = 0; i < items_full_path.length; i++)\n {\n var path_split = items_full_path[i].toString().split(\"/\");\n if (path_split[p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a JRON predicate value from a supplied rdfquery node and base and prefix options | function pred_toJRON (rdfnode, options)
{
return node_toJRON(rdfnode, options).__iri.toString();
} | [
"function node_fromJRON (jronnode, prefixes, options)\n {\n if (typeof jronnode == \"string\")\n {\n return $.rdf.literal('\"'+jronnode+'\"', options);\n };\n if (typeof jronnode == \"number\")\n {\n var xsdNs = \"http://www.w3.org/2001/XMLSchema#\";\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Increment turn number if less than maximum turn count else returns 1. | incrementturnCount() {
let currentturnCount = this.state.currentturnCount;
let maxturnCount = this.state.maxturnCount;
return currentturnCount < maxturnCount ? currentturnCount + 1 : -1;
} | [
"incrementWins() {\n this.wins += 1; \n }",
"function increaseMoveCounter( )\n {\n moves.textContent = ++moveCounter;\n starRating( );\n }",
"function currentRoundIndex(gameSnap) {\n return completedRounds(gameSnap).length;\n}",
"calculateTurnMeter() {\n this.turnMeter += this.tic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Getting the latlng from textarea and Spliting the latlng based on new line | function textArea(){
var text = document.getElementById("info").value;
var splitValue = [];
splitValue = text.split("\n");
importLatLng(splitValue);
} | [
"function readLatLngFields() {\n current_lat = jQuery(field_lat).text();\n current_lng = jQuery(field_lng).text();\n }",
"function gpsToLatLng(text) {\n var text = text.replace(/\\s+$/,'').replace(/^\\s+/,'');\n\n // simplest format is decimal numbers and minus signs and that's about it\n //... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the currentlyselected month based on a model value. | _setSelectedMonth(value) {
if (value instanceof DateRange) {
this._selectedMonth = this._getMonthInCurrentYear(value.start) ||
this._getMonthInCurrentYear(value.end);
}
else {
this._selectedMonth = this._getMonthInCurrentYear(value);
}
} | [
"function setCurrMonth(today) {\n form.chooseMonth.selectedIndex = today.getMonth();\n }",
"function setMonth() {\n\tvar element = document.getElementById(\"selected_month\");\n\tMONTH = element.options[element.selectedIndex].value;\n\tsetDateContent(MONTH, YEAR);\n}",
"function changeMonth(){\n va... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to post information submitted in ticket creation form | function handlePostCreate() {
$.ajax({
type: "POST",
url: "api/ticket",
data: {
first_name: $("#first_name").val(),
last_name: $("#last_name").val(),
company: $("#company").val(),
title: $("#title").val(),
... | [
"function createFormHandler(e) {\n e.preventDefault()\n// Add innerHTML apending to Brainstormer in this section\n const characterInput = document.querySelector(\"#user-edit-character\").value\n const setupInput = document.querySelector(\"#user-edit-setup\").value\n const twistInput = document.querySelector(\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets reimbursements based on the employee and reimbursement type | function getReimbursement(){
var jhttp = new XMLHttpRequest();
document.getElementById("listbody").innerHTML = "";
var getType = new Object;
var reimburseType = document.getElementById("type").value;
getType.type = reimburseType;
getType.eid = e;
if(e == 0 || e == undefined){
if(reimburseType == "all" || reimb... | [
"function getApprovedChangeRequest(employeeId, changeType) {\r\n log.debug('employeeId', employeeId);\r\n log.debug('changeType', changeType);\r\n // Look for Approved and \r\n var mySearch = search.create({\r\n type:... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"Seattle" "Providence" "New York" Write a function called displayHometownData that console.logs all the values inside of the hometown object | function displayHometownData() {
var obj = instructorData.additionalData.moreDetails.hometown;
for (key in obj) {
console.log(obj[key]);
}
} | [
"function displayHometownData() {\n var hometownArray = instructorData.additionalData.moreDetails.hometown;\n for(var key in hometownArray){\n console.log(hometownArray[key]);\n }\n}",
"function displayCities() {\n var cityArray = instructorData.additionalData.moreDetails.citiesLivedIn;\n for (var i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a new event for playerId | @action addNewEvent(playerId) {
const playerIndex = this.trackingList.findIndex(player => player.id === playerId);
if (playerIndex === -1) return;
const player = this.trackingList[playerIndex];
let newEvent = {};
newEvent.timestamp = new Date();
newEvent.isUpdated = false... | [
"function send_message_player_added(uuid){\r\n let data = {\r\n \"cmd\" : \"player_added\"\r\n }\r\n send_message(uuid, data);\r\n}",
"async function addEventToGame(game_id,event){\n let events_ids = await DButils.execQuery(`SELECT GamesEvents.gameid, Events.eventid FROM Events JOIN GamesEvents ON Events... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This builds our custom html license code using various refactored functions for handling all the nastiness... | function output_license_html ()
{
var output = get_comment_code() + '<a rel="license" href="' + license_array['url'] + '"><img alt="Creative Commons License" border="0" src="' + license_array['img'] + '" class="cc-button"/></a><div class="cc-info">' + license_array['text'] + '</div>';
try {
i... | [
"function renderLicenseSection(license) {\nvar licenseLink = renderLicenseLink(license);\nif (license === 'MIT' || 'Apache' || 'GPLv2') {\n return ('Licensed under the ' + licenseLink)\n} else if (license === 'none') {\n return ('')\n}\n}",
"function changeCopyRight()\n{\n console.log(\"\\tStart changeCopy... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method will load users for a given company id | function loadUsersByCompanyId(companyId) {
var queryString = "companyId=" + companyId;
clearUserDD();
if (companyId !== "") {
$.ajax({
type: "GET",
url: "emulation/users",
data: queryString,
dataType: "json",
beforeSend: function() {
... | [
"function _loadUsers()\n {\n var sql = \"select * from Users where 1\"\n db.all(sql, function(err, rows)\n {\n if(rows)\n {\n rows.map(function(row)\n {\n var user = new User(db, row)\n Users[row.userId] = user\n })\n }\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pending: get asset meta list from Assethub | async function retrieveAssetMetaAll() {
try {
const response = await axios.get(ASSETHUB_SERVER_API_BASE_URL + 'asset/meta/list');
return await response.data
} catch (error) {
console.log(error);
return {
result: {
code: 400,
}
}
... | [
"function getAllAssets() {\n return new Promise((resolve, reject) => {\n if (!process.env.API_URL_LIST) {\n console.log(process.env.API_URL_LIST);\n reject('No URL found to get all Assets.');\n }\n\n request(process.env.API_URL_LIST, (error, response, body) => {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
compute the CSS classes of the Modal(popup) based on the value of isModalOpen property | get modalClass() {
return `slds-modal slds-modal_medium ${
this.isModalOpen ? "slds-fade-in-open" : ""
}`;
} | [
"renderGreenModal() {\n return (\n <Modal\n isOpen={this.state.showGreenModal}\n onRequestClose={this.handlecloseGreenModal}\n style={customStyles}\n >\n <h2>Green Type</h2>\n {/* TODO: */}\n </Modal>\n )\n }",
"open(options = {}) {\r\n if (!options.mo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fetches matches played with account_id | function getMatchesPlayedWithId(account_id)
{
const JSON_OBJ = queryPlayedMatches(MY_ID, account_id);
return JSON_OBJ;
} | [
"function queryPlayedMatches(my_account_id, target_account_id)\n{\n const PLAYED_WITH_URL = \"https://api.opendota.com/api/players/\" +\n my_account_id +\n \"/matches?included_account_id=\" +\n target_account_id;\n console.log(\"api call queryPlayedMatches\");\n return JSON.parse(apiQu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Move the screen to an element within the page. Example: 'header' | function moveToPageElemnt(element) {
$('body, html').animate({ scrollTop: $(element).offset().top }, 600);
} | [
"move_horseProfile_TabsHeader(){\n browser.touchAction('//android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[12]/android.widget.HorizontalScrollView', ['longPress',\n { action: 'moveTo', x: 0, y: (this.horseProfile_Y_Location_TabHeader-500)}, 'release'\n ])\n }",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checkColl(): check if x,y coord are in array of cells | function checkColl(x, y, array){
for(var i = 0; i < array.length; i++){
if(array[i].x == x && array[i].y == y){
return true;
}
}
return false;
} | [
"function isAt(x, y){\n for(var i = 0; i < tileArray.length; i++){\n if(tileArray[i]._x == x && tileArray[i]._y == y){\n return true;\n }\n }\n return false;\n }",
"contains(x, y) {\r\n if (!this.isEnabled()) return false;\r\n if (x < this.at().x ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A socket.io Encoder instance | function Encoder() {} | [
"encodeData(type, value) {\n return this.getEncoder(type)(value);\n }",
"function initSocketIO(){\n io.on('connection', function(socket){\n\n });\n}",
"function nextServerDataRegisterWriter(ctr) {\n if (initialServerDataBuffer) {\n initialServerDataBuffer.forEach((val)=>{\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set to size of the popup windows (G+ and Twitter) for different screen sizes | function setPopUpSize() {
if(document.documentElement.clientWidth <= 640) {
popUpwidth = 320;
popUpHeight = 460;
}
else {
popUpwidth = 550;
popUpHeight = 420;
}
} | [
"function popupPVAsWindow_onresize(e)\n{\n}",
"function ResizeHandler() {\n setMaxWindowWidth((window.innerWidth - 800) / 2);\n setMaxWindowHeight((window.innerHeight - 700) / 2);\n }",
"_resizeWindowManager() {\n const kMargin = 200;\n let required_height = 0;\n let required_width = 0;\n for... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
vbScript mid syntax: mid(string1, start[,end]) string1: string to cust from; start: start of cut; end: end of cut (if no end, then to end of string1) | function Mid(strMid, intBeg, intEnd) {
//setup variables in case there is no intEnd (optional value in vbScript)
if (strMid==null || strMid=="" || intBeg < 0) { return ''; }
intBeg -= 1; //reset vbScript 1 base
if (intEnd==null || intEnd=="") {
return strMid.substr(intBeg);
} else {
... | [
"function stringSlice(str,start,end){\n if(end === undefined || end > str.length){end = str.length}\n var newStr = \"\";\n if(start < 0){start += str.length}\n for(var i = start; i < end; i++){\n newStr+=str[i];\n }\n return newStr;\n}",
"function cutFirst(string){\n return string.sub... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Dada una cantidad de dinero (entera) y un las monedas posibles, devolver la misma cantidad de dinero en monedas. Ejemplo : dameMonedas(46, [25, 10, 5, 2, 1]) Donde 46 es la cantidad de plata. y 25, 10, 5, 2, 1 son las monedas que existen. Salida : 25, 10, 10, 1 | function cantidadMonedas(valor) {
let resto = valor;
const moneda = [];
while (resto != 0) {
if (resto > 25) {
moneda.push(25);
resto -= 25;
} else if (resto > 10) {
moneda.push(10);
resto -= 10;
} else if (resto > 5) {
... | [
"function medianaSalarios(lista) {\n // necesitamos la mitad de la mediana de salarios\n // parseInt le quita los decimales al resultado\n const mitad = parseInt(lista.length / 2);\n\n // verificamos si la lista de nuestro pais de personas es par o impar\n if (esPar(lista.length)) {\n // devue... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function for makeVariableResponseGraph: given a graph and a variable name, returns the axis label text associated with that variable. | function getAxisTextForVariable (graph, variable) {
let series = graph.data.columns.find(s => {
return caseInsensitiveStringSearch(s[0], variable);
});
if(_.isUndefined(series)) {
throw new Error("Cannot build variable response chart from single variable chart");
}
series = series[0];
//see if... | [
"label(attributeName) {\n const arg = this.args[attributeName];\n return arg ? arg.label : null;\n }",
"function getZaxisText(){\n var units;\n \n if(layerDetails.zaxis !== undefined){\n units= layerDetails.zaxis.units.toLowerCase();\n\t\n\t//TODO we can't use the corrent name from the prop... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set one result table row with a link | function set_one_row(tguri, which){
var tr = Util.dom.element("tr"),
td1 = Util.dom.element("td", "(" + which + " found)"),
td2 = Util.dom.element("td"),
anc = Util.dom.element("a", tguri);
anc.href = tguri;
anc.className = "uri";
anc.innerHTML = anc.innerHTML.replace("/chname/", "/<b>chname... | [
"function AddTableLinks(oResultTable, oPrintedTable){ \n\n //Detail list columns\n var idColumnIndex_Id = GetTableColumnIndex(oResultTable, \"counter\", false /*count only visible columns*/);\n\n \n $(\"tr\", oPrintedTable).each(funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if this relation's type is "onetomany". | get isOneToMany() {
return this.relationType === RelationTypes.ONE_TO_MANY;
} | [
"get isManyToOne() {\n return this.relationType === RelationTypes.MANY_TO_ONE;\n }",
"get isOneToOne() {\n return this.relationType === RelationTypes.ONE_TO_ONE;\n }",
"get isOwning() {\n return !!(this.isManyToOne ||\n (this.isManyToMany && this.joinTable) ||\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load various packaged styles for the addon and undo on unload | function loadStyles(addon, styles) {
let sss = Cc["@mozilla.org/content/style-sheet-service;1"].
getService(Ci.nsIStyleSheetService);
styles.forEach(function(fileName) {
let fileURI = addon.getResourceURI("styles/" + fileName + ".css");
sss.loadAndRegisterSheet(fileURI, sss.USER_SHEET);
unlo... | [
"function addStyles() {\n\t styles.use();\n\t stylesInUse++;\n\t}",
"reStyle() {\n console.log('restyle')\n this._destroyStyles();\n this._initStyles();\n }",
"_destroyStyles() {\n if (!this.styleSheet) {return}\n this.styleSheet.destroy();\n this.styleSheet = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gl = webgl2 context =fs = glsl str ins, outs = [3,1,4..] dim = [1024, 1024] .. | constructor (gl, fs, ins, outs, dim) {
this.ins = ins;
this.outs = outs;
this.dim = dim;
if (dim.length == 1) {
this.w = dim[0];
this.h = 1;
}
if (dim.length == 2) {
this.w = dim[0];
this.h = dim[1];
}
if (di... | [
"function WebGlRenderUtility() {\n}",
"function WebGLTurbulenzEngine() {}",
"render(program, renderParameters, textures){\n //renders the media source to the WebGL context using the pased program\n let overriddenElement;\n for (let i = 0; i < this.mediaSourceListeners.length; i++) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a function for postV3ProjectsIdMergeRequestsNoteableIdNotes | postV3ProjectsIdMergeRequestsNoteableIdNotes(incomingOptions, cb) {
const Gitlab = require('./dist');
let defaultClient = Gitlab.ApiClient.instance;
// Configure API key authorization: private_token_header
let private_token_header = defaultClient.authentications['private_token_header'];
private_token_header... | [
"postV3ProjectsIdIssuesNoteableIdNotes(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_hea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hide preloader when window is fully loaded | function hide_preloader_on_load()
{
$(window).load(function()
{
fade_out_preloader();
});
} | [
"showLoader () {\n if (this.hideLoader) return\n this.loadingWrapper.style.display = 'flex'\n this.canvas.style.display = 'none'\n }",
"function showLoading() {\n loader.hidden = false;\n quoteContainer.hidden = true; \n}",
"function hideLoading() {\n\t\tanimate(loadingDiv, {\n\t\t\topacity: 0\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
called when progress is made loading the video. param e the event passed to the handler | function onProgress(e) {
if (video.buffered.length > 0)
{
var end = video.buffered.end(0),
start = video.buffered.start(0);
load_bar.setAttribute("width", Math.ceil((end - start) / video.duration * 100).toString());
}
} | [
"function video_done(e) {\n\tthis.currentTime = 0;\n}",
"function changeBackgroundVideoFileProgress(message) {\r\n changeBackgroundVideoContentProgress(message, liveBackgroundType);\r\n}",
"handleCutVideo() {\n let self = this;\n\n // send event to parent that our task is starting\n self... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate and clean up any scope values This happens after we have set the scope values | function validateScopeValues(scope, pageCount) {
// Block where the page is larger than the pageCount
if (scope.page > pageCount) {
scope.page = pageCount;
}
// Block where the page is less than 0
if (scope.page <= 0) {
scope.page = 1;
}
//... | [
"function cleanForm() {\n\t\t\tvm.srchInputName = \"\";\n\t\t\tvm.srchInputPhone = \"\";\n\t\t\tvm.srchInputAddress = \"\";\n\t\t\tgetContacts();\n\t\t}",
"function cleanSelection() {\n $scope.presets = undefined;\n $scope.selectedCategory = undefined;\n $scope.selectedPreset = un... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CODING CHALLENGE 90 Create a function that takes an array of students and returns an array of student names. | function getStudentNames(students) {
return students.map( x => x.name);
} | [
"findStudentCourses(courseArray){\r\n \tlet studentCourseList = [];\r\n \tfor(let courseName of courseArray){\r\n studentCourseList.push(this.courses.get(courseName));\r\n\t\t}\r\n\t\treturn studentCourseList;\r\n\t}",
"function getFullNames(runners) {\n /* CODE HERE */\n let name = [];\n runn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts object keys to dataattrs | function toDataAttrs(object) {
const convObject = {};
Object.entries(object).forEach(entry => {
const [name, value] = entry;
convObject[`data-${toDashString(name)}`] = value;
});
return convObject;
} | [
"static createAttrDataObj(el){\n var res = {};\n DATA_MAP.forEach(function(value, key, map) {\n if(el.hasAttribute(key)){\n \n if(key == \"value\"){\n res[value] = el.value; \n } else if (key == \"data-cell_label\"){\n var refNames = value.split('-');\n var r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sprite_HpGaugeTS The sprite for displaying the hp gauge. | function Sprite_HpGaugeTS() {
this.initialize.apply(this, arguments);
} | [
"function Sprite_HpBar() {\n this.initialize.apply(this, arguments);\n}",
"drawHealth() {\n document.querySelector(\".monster-health__remain\").style.width =\n (this.health / this.startHealth) * 100 + \"%\";\n document.querySelector(\n \".monster-health__remain\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
inserting into XOR Linked List | insert() {
let newNode = new Node(1);
newNode.npx = XOR(this.head, null);
// logic to update the next pointer of the previous element once the next element is being set.
// (null ^ 1)^ null will nullify null and the output will be 1
if(this.head !== null) {
let next ... | [
"addBefore(key, data) {\n if (this.head == null) return;\n \n let currentNode = this.head;\n let prevNode = null;\n\n while (currentNode != null && currentNode.data != key) {\n prevNode = currentNode;\n currentNode = currentNode.next;\n }\n\n if (currentNode) {\n let tempNode = n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If an anchor exists in the URL, it attempts to load the anchor by searching the role and lesson titles | function loadAnchor() {
var anchor = "" + window.location;
var index = anchor.indexOf('?');
if (index != -1) { anchor = anchor.substring(0,index); }
index = anchor.indexOf('#');
if (index == -1 || index == anchor.length-1) {
return false;
}
anchor = decodeURIComponent(anchor.substring(index+1));
for (va... | [
"function load_href( href ) {\n\t\t\t//console.log( href );\n\t\t\t$overlayBox.addClass('loading');\n\t\t\t// is inline element\n\t\t\tif ( href.match(/#/) ) {\n\t\t\t\tvar url = window.location.href.split('#')[0],\n\t\t\t\t\ttarget = href.replace(url,'');\n\t\t\t\tif (target == '#') return;\n\t\t\t\tvar $target = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
explodes the boxplot according to the given parameters (hides the boxplot box and draws points) | explode_boxplot(width, radius, yscale, quartiles, box_data, mouseover, mousemove, mouseleave, mouseclick){
var trans = d3.select("#boxplot").select("g.box").transition()
.ease(d3.easeBackIn)
.duration(300);
// hide boxplot box
trans.select('rect.box')
.attr('x',width*0.5)
.attr('width',0)
.... | [
"function drawGexpOverview(i) {\n \n //var gexp = getCol(dataPro,1).map(function(d) { return d.value })\n var gexp = getCol(dataPro,i)\n\n var g = document.getElementById('gexp_panel1'),\n\twindowWidth = g.clientWidth,\n\twindowHeight = g.clientHeight;\n\n var margin = {top: 30, right: 0, bottom: 30,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets executed after a chart has finished rendering If the level is weekly it highlights the current day If the level is monthly it adds the previous and next buttons | function generateChartCallback (chart) {
if (chartsCurrentLevel === chartsLevel.weekly) {
//if we are on level weekly we need to highlight the current day but only if the chartsWeeklyPeriod is 0 (period which contains the current date)
if (chartsWeeklyPeriod === 0) {
highlightCurrentDayInChart(chart);
}
/*... | [
"renderButtons(startOfMonth, firstDate) {\n const startVisibleDate = this.startVisibleDate;\n const endVisibleDate = this.endVisibleDate;\n const line = [];\n let i = 0;\n for (i = 0; i < 7; ++i) {\n // monday..sunday\n let active = false;\n let selected = false;\n let dimmed = fa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set thumbnail sizes (width and height) and URLs (for all resolutions (xs, sm, me, la, xl) and levels (l1, lN) | function GoogleThumbSetSizes(level, startI, tn, data, kind ) {
var sizes=['xs','sm','me','la','xl'];
for(var i=0; i<sizes.length; i++ ) {
tn.url[level][sizes[i]]=data.media$group.media$thumbnail[startI+i].url;
if( kind == 'image' ) {
tn.width[level][sizes[i]]=data.medi... | [
"function setFigure(){\n\n\t\t\t\tvar sizes = new Object();\n\n\t\t\t\tvar mediaObj = element.data();\n\n\t\t\t\t$.each(mediaObj, function(media, path){\n\n\t\t\t\t\tvar num;\n\n\t\t\t\t\tnum = media.replace(/[^\\d.]/g, '');\n\n\t\t\t\t\tif(!num)\n\t\t\t\t\t\tnum = 0;\n\n\t\t\t\t\tsizes[num] = path;\n\n\t\t\t\t});\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is to go back to driver listings | function clickHandlerBack(e) {
e.preventDefault();
console.log("Back to Listings button in MomViewDrvProfile clicked");
sessionStorage.removeItem("driverCardId");
history.push('/drvList');
} | [
"function goBack() {\n if (pageStack.slice(-1)[0] === 'persons-list') {\n clearPersonList();\n }\n\n window.location.hash = pageStack.slice(-2)[0];\n pageStack = pageStack.slice(0, pageStack.length - 2);\n checkPageNav();\n}",
"goBack(){\n BusinessActions.goBack();\n }",
"function goBack() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
iam_instance_profile computed: true, optional: false, required: false | get iamInstanceProfile() {
return this.getStringAttribute('iam_instance_profile');
} | [
"function InstanceProfile(props) {\n return __assign({ Type: 'AWS::IAM::InstanceProfile' }, props);\n }",
"constructor(scope, id, props) {\n super(scope, id, { type: CfnInstanceProfile.resourceTypeName, properties: props });\n cdk.requireProperty(props, 'roles', this);\n thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if the parent caret container node isn't empty if that is the case it will remove the bogus state on all children that isn't empty | function unmarkBogusCaretParents() {
var i, caretContainer, node;
caretContainer = getParentCaretContainer(selection.getStart());
if (caretContainer && !dom.isEmpty(caretContainer)) {
tinymce.walk(caretContainer, function(node) {
if (node.nodeType == 1 && node.id !== caretContainerId && !dom.isE... | [
"isEmpty(editor, element) {\n var {\n children\n } = element;\n var [first] = children;\n return children.length === 0 || children.length === 1 && Text.isText(first) && first.text === '' && !editor.isVoid(element);\n }",
"function is_line_container_clean(wrapper) {\n var c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
| |Private functions| / Sends a geocode request using the beach name. Adds the latitude and longitude to the swellcast data map and pushes it onto the geocodedBeachs global array. | function geocode(swellcastData, callback) {
/* Add 'Australia' to the search term in case areas of the same name exist overseas */
var searchTerm = swellcastData.name + " Australia";
var geocodeUrl = "";
geocodeUrl = "https://maps.googleapis.com/maps/api/geocode/json?address=";
geocodeUrl += searchTerm... | [
"function geocodeAddress(geocoder, address, place_name) {\r\n geocoder.geocode({ address: address }, function(results, status) {\r\n if (status === google.maps.GeocoderStatus.OK) {\r\n var iconBase = \"https://maps.google.com/mapfiles/kml/pushpin/\";\r\n map.setCenter(results[0].geometry.location);\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Injects a helper function defined by helperAstFn into the current file at the top scope. | function inject(plugin, helper, helperAstFn) {
var dependencyInjectors = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];
var ref = getHelperRef(plugin, helper);
if (ref) {
return ref;
}
ref = plugin.file.scope.generateUidIdentifier(helper);
var expression = null;
var inject... | [
"enterFunctionModifier(ctx) {\n\t}",
"enterFunctionLiteral(ctx) {\n\t}",
"enterStaticImportOnDemandDeclaration(ctx) {\n\t}",
"enterKotlinFile(ctx) {\n\t}",
"function insertLibFunc() {\r\n\r\n var pO = CurProgObj;\r\n\r\n var sel1 = document.getElementById('selWin');\r\n var libind = sel1.selectedIn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes a Condition by ID | deleteConditionFromList(_cond_id) {
deleteCondition(_cond_id);
this.listConditions();
} | [
"function deleteCondition(conditionID) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = g_references[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Right click to element. | static rightClickElement(element) {
this.waitElement(element, timeToWait);
//this.moveToComponent(element);
element.rightClick();
} | [
"function handleRightClick(event) {\n var target = event.target || event.toElement;\n\n if (!target) {\n return;\n }\n\n var figure = findFigure(scribe, target);\n\n if (figure) {\n event.preventDefault();\n event.st... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the stream of myclub objects related to a stream of groups | function combined_stream_from_groups(groups, URLfunc) {
/*
* Record the stream created for the last group.
* This will be drained last, and when ended, we must
* also end the output.
*/
var last = null;
/*
* Reduce the stream of groups into a single stream that receives
* all ... | [
"function getObjStreams(obj) {\n let stack = [obj]\n let streams = []\n while(stack.length) {\n const vals = R.values(stack.pop())\n streams = R.concat(streams, R.filter(flyd.isStream, vals))\n stack = R.concat(stack, R.filter(isObj, vals))\n }\n return streams\n}",
"static async match_groups_tracks... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Evaluate whether the before and after controls should be enabled or disabled. If the header is at the beginning of the list (scroll distance is equal to 0) then disable the before button. If the header is at the end of the list (scroll distance is equal to the maximum distance we can scroll), then disable the after but... | _checkScrollingControls() {
if (this.disablePagination) {
this._disableScrollAfter = this._disableScrollBefore = true;
}
else {
// Check if the pagination arrows should be activated.
this._disableScrollBefore = this.scrollDistance == 0;
this._disab... | [
"checkBetLinesShow () {\n if (this.getService(\"LinesService\").getWinLines().length > 0){\n linesManager.disableMouseOverForLabels();\n } else {\n linesManager.enableMouseOverForLabels();\n }\n }",
"[updateButtons]() {\n\t\t\tconst self = this;\n\t\t\tconst _self = _... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SEARCH BY INGREDIENT TESTS | function testIngr() {
// test searchByIngredient with reasonable term
searchByIngredient('gin').then( function(res) {
if (res) {
logger.info(res[0]);
} else {
logger.warn('Search \'gin\': No results');
}
}, function(err) {
logger.error('Error resolving se... | [
"function search(searchString, titleSearchBool, tagsSearchBool, commentsSearchBool) {\r\n\tvar theTerms = splitSearchString(searchString);\r\n\tif (theTerms.length == 0) {\r\n\t\tvar allEntries = dataHandler.getAllEntries();\r\n\t\treturn allEntries;\r\n\t}\r\n\t\r\n\tvar positiveMatches = [];\r\n\tvar negativeMatc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ChangeName,Change the name of the ship(NO UPDATE DB YET) Returns new name if updated successfully or undefined otherwise | function changeName( shipObj, newName )
{
DEBUG_MODE && console.log( "Calling changeName in ShipBO, new name:" , newName );
if ( shipObj == undefined )
{
DEBUG_MODE && console.log( "ShipBO.changeName: shipObj is undefined" );
return undefined;
}
if ( newName == undefined )
{
... | [
"changeName(newName) {\n this.name = newName;\n updateTeam(this._id, \"name\", this.name);\n }",
"function NameChanged()\n\t\t{\n\t\t\tnameChanged = 1;\n\t\t}",
"function changeName(){\n\n const newName = prompt(\"What would you like the new name to be?\");\n \n if(newName !=\"\"){\n\n he... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CHECKING IF USER HAS AN API TOKEN | function user_has_api_token()
{
if(
(localStorage.getItem("admin_access_token") != null && localStorage.getItem("admin_access_token").trim() != "")
&& (localStorage.getItem("admin_firstname") != null && localStorage.getItem("admin_firstname").trim() != "")
&& (localStorage.getItem("admin_s... | [
"function checkToken(_token, currentUserId) {\n try {\n //ayth6) server decodes token and compares the user's userid with the token's decoded userid\n //ayth6a) if good then can continue with action\n //ayth6b) else ??? return u failed\n const token = _token;\n // next will keep any fields created\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes event listeners if defer mode is 'belowfold' | function removeBelowfoldListeners() {
removeEvent(win, SCROLL, scrollListener);
removeEvent(win, RESIZE, resizeListener);
// Is orientationchange event supported? If so, remove the listener
orientationSupported && removeEvent(win, ORIENTATIONCHANGE, orientationc... | [
"function addBelowfoldListeners() {\n addEvent(win, SCROLL, scrollListener); \n addEvent(win, RESIZE, resizeListener);\n\n // Is orientationchange event supported? If so, let's try to avoid false \n // positives by checking if win.orientation has actually changed.\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetching user's country emergency phone numbers. | getEmergencyPhoneNumbers(country) {
let self = this;
return new Promise(function(resolve, reject) {
self.$http.get('http://gkamtzir.webpages.auth.gr/api.php/country/emergency/' + country)
.then(resolve, reject);
});
} | [
"function getPhoneCodeCustom(country, metadata)\r\n{\r\n\treturn Object(__WEBPACK_IMPORTED_MODULE_18__es6_getCountryCallingCode__[\"a\" /* default */])(country, metadata)\r\n}",
"function phoneNoselect() {\n if ($('#msform').length) {\n $(\"#phone\").intlTelInput();\n $(\"#phone\").in... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fetch stats data and update state | async fetchStats() {
MongoClient.connect(
MONGO_URL,
{ useNewUrlParser: true },
async (err, client) => {
assert.equal(null, err);
// Stats Preparation Commande
const stats_preparation_commande = await getStats(
client,
ID_LIST_COMMANDE_A_PREPARER,
... | [
"_fetchState() {\n this._fetchLeagues();\n this._fetchSeasons();\n this._fetchRallies();\n this._fetchDrivers();\n }",
"getStats() {\n const propertyId = this.props.property.propertyId;\n axios.get(`http://localhost:1235/statistics/${propertyId}?distance=1755000`)\n .then(res => {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
All webhook calls are sent in POST | function handleWebHookPostRequest(req, res) {
let promises = [];
const data = req.body;
dashbot.logIncoming(data);
try {
if (data.object === 'page') {
data.entry.forEach(function (entry) {
entry.messaging.forEach(function (event) {
//Handle each message separately
promises.... | [
"function webhook(req, res, next) {\n\n console.log(\"Made it to the webhook!\")\n\n switch(req.body.type) {\n case \"message-created\":\n messageCreated(req.body);\n console.log(\"Message created!\")\n break;\n case \"space-members-added\":\n spaceMembersAdded(req.body);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generic mapping function. Will map the given key to the corresponding value in the mapping. If the key is not inside the mapping, `key` will be returned. | function _map(key, mapping) {
if (key in mapping) return mapping[key];
return key;
} | [
"function mapKey(key) {\n if (key == 73) {\n return \"1\";\n } else if (key == 79) {\n return \"2\";\n } else if (key == 80) {\n return \"3\";\n } else {\n return 'Error(mapKey): No key match!'\n }\n}",
"get(key) {\n let index = this._hash(key);\n if (this.keyMap[index]) {\n for (let i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
That function is not in use right now, but it's purpose is to copy every style that is applied on one element to another. | function copyCssStyle(sourceNode, targetNode) {
var computedStyle = window.getComputedStyle(sourceNode);
Array.from(computedStyle).forEach(function(key) {
return targetNode.style.setProperty(key, computedStyle.getPropertyValue(key), computedStyle.getPropertyPriority(key));
});
} | [
"function reinjectStyles() {\n if (!styleElements) {\n orphanCheck();\n return;\n }\n ROOT = document.documentElement;\n docRootObserver.stop();\n const imported = [];\n for (const [id, el] of styleElements.entries()) {\n const copy = document.importNode(el, true);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
owlCarousel Sort random function | function random(owlSelector){
owlSelector.children().sort(function(){
return Math.round(Math.random()) - 0.5;
}).each(function(){
$(this).appendTo(owlSelector);
});
} | [
"function owlCarouselContent(){\n generate();\n let brojElemenataCarousel = 6;\n let parent = document.getElementById(\"automobili\");\n let child = document.createElement(\"div\");\n child.classList.add(\"owl-carousel\", \"first-owl\");\n parent.appendChild(child);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The SceneManager is intended to be the single API for working with BabylonJS's scene and asset loader. It handles all of the boilerplate required. | function SceneManager()
{
EventEmitter.call(this);
this.meshes = {};
} // end SceneManager | [
"LoadScene()\n {\n\n if ( this.__loaded )\n {\n console.error( \"Unable to load scene, already loaded \" )\n return;\n }\n\n this.LocalSceneObjects.forEach( element => {\n\n let _constructor = element[0];\n let _serializedCallback = eleme... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |