query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
validate input: not empty and less than 40 characters | function validate(input) {
if (!input || input.length > 40) {
alert('Before pressing the Search button, enter a word of less than 40 charaters');
return false;
}
return true;
} | [
"getValidationState() {\n const string = this.state.value\n\n if (string.match(/^[0-9a-zA-Z ]*$/) && string.length <= 40) return true\n else return false\n }",
"function checkInput(input) {\n\tif (input.value.length < 5 || input.value.length > 16) return false;\n\treturn true;\n}",
"function validateL... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears the cache of package managers. | function clearCache() {
// eslint-disable-next-line no-restricted-syntax
for (const manager in packageManagers) {
if (Object.prototype.hasOwnProperty.call(packageManagers, manager)) {
delete packageManagers[manager]
}
}
} | [
"clear() {\n this.cache.forEach((shadowMaps) => {\n shadowMaps.forEach((shadowMap) => {\n shadowMap.destroy();\n });\n });\n this.cache.clear();\n }",
"clearAllCaches() {\n for (key in this.modules) {\n this.clearCache(key)\n }\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION addEmp Prompts for employee first and last name Retrieves roles from db for user to select for employee Retrieves employees from db for user to select as the employee's manager Adds the new employee to the db | function addEmp() {
var empFirstName, empLastName, empRole, empManagerId
// prompt for first and last name
prompt([
{
type: 'input',
name: 'firstName',
message: 'First Name:',
validate: inputStr => {
if (inputStr) {
// validate only letters entered
if (/^[a-... | [
"function addEmployee() {\n db.Employee.getEmployees(managers => {\n db.Role.getRoles(roles => {\n promptSelectRole(roles).then(function (roleid) {\n promptForEmployeeinfo(roleid, managers);\n });\n })\n });\n}",
"function addEmployee() {\n\tinquirer\n\t\t.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Overridden by derived series classes to indicate when markerless display is preferred or not. | get isMarkerlessDisplayPreferred() {
return this.i.cy;
} | [
"get isMarkerlessDisplayPreferred() {\n return this.i.cy;\n }",
"get showSeriesMarkers() {\n return this.showSeriesMarkersProperty;\n }",
"set showSeriesMarkers(value) {\n this.showSeriesMarkersProperty = value;\n this.notifyPropertyChanged();\n }",
"function tipped(col_in... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this (and all heimdall instrumentation) will be stripped by a babel transform / `InternalModel` is the Model class that we use internally inside Ember Data to represent models. Internal ED methods should only deal with `InternalModel` objects. It is a fast, plain Javascript class. We expose `DS.Model` to application co... | function InternalModel(type, id, store, _, data) {
this.type = type;
this.id = id;
this.store = store;
this._data = data || new _emberDataPrivateSystemEmptyObject.default();
this.modelName = type.modelName;
this.dataHasInitialized = false;
//Look into making this lazy
this._deferredTrigg... | [
"function InternalModel(type, id, store, _, data) {\n this.type = type;\n this.id = id;\n this.store = store;\n this._data = data || new _emberDataPrivateSystemEmptyObject[\"default\"]();\n this.modelName = type.modelName;\n this.dataHasInitialized = false;\n //Look into making this lazy\n t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generic XHR Sync Layer for YUI's App Framework | function XHRSyncListLayer() {
} | [
"function XHRSyncLayer() {\n\n}",
"function XHR(config)\n{\n var success_cb = config.success,\n failure_cb = config.failure,\n original_cb = config.callback;\n\n config.url = './do/' + config.params.task;\n delete config.params.task;\n config.params = Ext.applyIf({csrfToken: csrfToken}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method used to allow the PathList to be filled with Paths from a public data object | initialisePathListPDO(pathObject) {
this._routeList = [];
for (let route = 0; route < pathObject._routeList.length; route++) {
let path = new Path();
path.initialisePathPDO(pathObject._routeList[route]);
this._routeList.push(path);
}
} | [
"function refreshPathList(){\n\t\t\tPathListService.refreshPathList(\n\t\t\t\tfunction(data){\n\t\t\t\t\t// record path list data\n\t\t\t\t\tSharedDataService.data.pathListData = data;\n\t\t\t\t\t// path list initialized = true\n\t\t\t\t\tSharedDataService.data.pathListInitd = true;\n\t\t\t\t},\n\t\t\t\tfunction(er... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
nous permet d'ajouter un administrateur (app.post '/administrateurs/ajouter') | function ajouterAdmin(Admin, motdepasse) {
return connSql.then(function (sql) {
let resultat = sql.query("INSERT INTO administrateur (adm, motdepasse) VALUES(?,?)", [Admin, motdepasse]);
return resultat
});
} | [
"function ajouter_utilisateur()\n{\n\t//Cette fonction est d�clar�e dans ajouter_utilisateur.js\n\tshow_ajout();\n}",
"function addAdmin(){\n\tvar data = {\n\t\tname : $(\"#Name\").val(),\n\t\temail : $(\"#Email\").val(),\n\t\tpassword : $(\"#Password\").val(),\n\t};\n\tif(validate(\"#myForm\")){\n\t\tapiPath... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
displays the question to the page, and for each possible answer creates a button | function displayQuestions(question) {
questionElement.innerText = question.question
question.answers.forEach(answer => {
var button = document.createElement('button')
button.innerText = answer.text
button.classList.add('btn')
if (answer.correct) {
button.dataset.correct = answer.correct
}
... | [
"function showQ(question) {\n qEl.innerText = question.question\n question.answers.forEach(answer => {\n var button = document.createElement('button')\n button.innerText = answer.text\n button.classList.add(\"butt\")\n if (answer.correct) {\n button.dataset.correct = ans... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fills up all the grid blocks created in createGrid() by starting in the first cluster's first block then continuing until there are no more blocks in the cluster then moves to the next cluster. checks if the cluster is full and if it is, then it moves to the next cluster. then it checks if the image is currenty attache... | function fillGrid(){
//console.log("filled Grid");
var cluster = 0;
var block = 0;
for (i=0;i<totalImagesReturned;i++){
if (filledClusters.indexOf(""+cluster)!=-1){
cluster++;
block = 0;
i--;
//console.log("filled cluster");
} else {
if (attachedImages.indexOf(""+i)== -1){
//console.log(r... | [
"function expandAllBlocks(){\n\tminimizeAllExpandedBlocks();\n\tfor (var i = 0; i < totalImagesReturned; i++) {\n\t\tvar clusterNumber = i;\n\t\tfilledClusters.push(clusterNumber);\n\t\tvar imageNumber = i;\n\t\tattachedImages.push(imageNumber);\n\t\tvar movingUrl = returnedData.data[i].images.original.url;\n\t\tin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Ensures that text on zoom control is correct according to current JourneyMapState. / / ID of parent mapLocationControl / Bool true if zoom level is such that location can be selected | function SetZoomControlInstructions(mapLocationControl, selectEnabled)
{
// Perform simple string manipulation to obtain zoom control parent
var strControl, arrControl, strParent;
strControl = new String (mapLocationControl);
arrControl = strControl.split('_');
strParent = arrControl[0];
if (strParent != strContr... | [
"function checkZoomLevel() {\n var currentLevel = map.getLevel();\n var bathySwitch = dijit.byId('bathy_contours').attr('value');\n if (bathySwitch) {\n //var currentLevel = map.getLevel();\n dojo.byId(\"msgBathy\").innerHTML = \"\";\n if (currentLevel < 1) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Overload getBindingHandler to have a custom lookup function. | getBindingHandler (/* key */) {} | [
"function getBindingHandler(bindingKey) {\n return options.bindingProviderInstance.bindingHandlers.get(bindingKey);\n }",
"function Component_BindingHandler() {}",
"function getBinding(binding) {\n if (!data.bindings[binding]) return undefined;\n return data.bindings[binding].value;\n }",
"functi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function will completely unselect the team by its value. It will make the team unselected on the ui, remove it from the "current selections" array, and update the selected teams in the NFL_PICKS_GLOBAL variable. | function unselectTeamFull(value){
unselectTeam(value);
removeTeamFromCurrentSelection(value);
var currentTeams = getCurrentTeamSelections();
setSelectedTeams(currentTeams);
} | [
"onTeamUnselect() {\n Datas.Systems.soundCancel.playSound();\n this.windowChoicesTeam.unselect();\n }",
"function setSelectedTeams(teams){\n\t\n\t//Steps to do:\n\t//\t1. Check whether the teams variable is an array.\n\t//\t2. If it is, just keep it.\n\t//\t3. Otherwise, it's a string so check to... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enable the display placeholder | function enablePlaceholder() {
placeholder.style.display = '';
placeholder.innerHTML = 'Enter your age';
} | [
"_showHidePlaceholder() {\n\t\tshowHide(this._exported.placeholder, !this._value);\n\t}",
"function disablePlaceholder() {\n\n placeholder.style.display = 'none';\n }",
"get showPlaceholder() {\n return !(this.hasInput() || this.hasValue());\n }",
"displayPlaceholder() {\n // do not... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Maps the old image data to new destination corners, see above for transformation matrix The fullImage object has a data key. data is an array with 4 values per pixel, for every pixel of the image, going from top to bottom, left to right | map(fullImage, srcCorners, width, height) {
let data = fullImage.data
let destination = [[0, 0], [width, 0], [width, height], [0, height]]
this.transformationMatrix(destination, srcCorners)
let img = document
.createElement('canvas')
.getContext('2d')
.createImageData(width, height)
... | [
"function imgMatrix() {\n\n // our image object inside area\n let $img = $('IMG', MAP_PARENT_AREA);\n\n // offset data of image\n let offset = $img.offset();\n\n // add/update object key data\n img.width = $img.outerWidth();\n img.height =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
EF PARAMS F0 ACON3 & ACOF3 test cases | function GetTestCase_ACONF3 () {
var testCases = [];
for (NN = 1; NN < 4; NN++) {
if (NN == 1) nodeNumber = 0;
if (NN == 2) nodeNumber = 1;
if (NN == 3) nodeNumber = 65535;
for (EN = 1; EN < 4; EN++) {
if (EN == 1) eventNumber = 0;
if (EN == 2) eventNumber = 1;
if (EN == 3) eventNumber = 655... | [
"enterFparams(ctx) {\n\t}",
"function tf_test_fonctionnel1(){\n\t\t\n\t}",
"applyFadingParameters(params) {\n // Apply initial parameter values.\n if (params !== undefined) {\n if (params.fadeNear !== undefined) {\n this.setFadeNear(params.fadeNear);\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Complete the record selection when the selection list window is closed by assigning the result (carried by the closed window) to the fields of this page | function OnSelectingRecord()
{
//If the selection window is closed, clear the timer first, then
//retrieve the returned record
if (selection.closed)
{
//
//Clear the timer
clearInterval(timer);
//
... | [
"onResultsClose() {\n // Set displayValue directly because value hasn'been changes\n // and Ember won't change computed property.\n if (state !== 'selected') {\n if (_this.get('displayValue')) {\n _this.set('displayValue', _this.buildDisplayValue());\n } else {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Starts creating a log dump. | start() {
LogUtil.createLogDumpAsync(
'test', this.onLogDumpCreated.bind(this), true);
} | [
"function startLogs() {\n\tvar txLogFileDir = path.dirname(serverConfig.txLogFile);\n\tvar debugLogFileDir = path.dirname(serverConfig.debugLogFile);\n\t//if target path doesn't exist, use current one\n\tif (!fs.existsSync(txLogFileDir)) {\n\t\ttxLogFileDir = \".\";\n\t}\n\tif (!fs.existsSync(debugLogFileDir)) {\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Minium Spanning Tree function. Input used the Graph called linearVertex which stores the vertex value and edge objects Uses the pickrandom function defined at the top for a starting point to traverse the graph returns MST array | function mst()
{
//v represents the total number of vertex.
//Solution gets stored in MST as an array [starting Vertex, ending Vertex, Weight]
//edges is used to find the minimum value among other edges.
//visited is used so that the traversal only occurs in non visited vertex
var v = n*n;
... | [
"primMST() {\n if(this.size <= 1) {\n return [];\n }\n\n let parents = [];\n let keys = [];\n let mstSet = [];\n\n // Initialize all arrays\n for(let i = 0; i < this.size; i++){\n parents.push(0);\n keys.push(Number.MAX_VALUE);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Example For product = 12, the output should be digitsProduct(product) = 26; For product = 19, the output should be digitsProduct(product) = 1. | function digitsProduct(product) {
if (product === 0) return 10;
else if (product === 1) return 1;
var list = [];
for (var d = 9; d > 1; d--) {
while (product % d === 0) {
product /= d;
list.push(d);
}
}
// console.log(list);
if (product !== 1) {
... | [
"function digitsProduct(product) {\n let y = 1;\n while (y < 10000) {\n y = y.toString();\n let sum = 1;\n for (let i = 0; i < y.length; i++) {\n sum *= Number(y[i]);\n }\n if (sum === product) return Number(y);\n y = Number(y);\n y++;\n }\n return -1;\n}",
"function digitsProduct(pr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Trace selected object back to the root of document | function tracePath(o, path) {
if (o.parent.typename === "Document") {
return path
}
path.push(o.parent)
return tracePath(o.parent, path)
} | [
"function logTree()\n{\n\tappWindow.logElementTree();\n}",
"traverse() {\n this.root.visit(this.root);\n }",
"print(){\n return this.root;\n }",
"function doHighlighting(){\n\tvar objNodes = objViewer.DocumentHandler.ObjectNodes;\n\tfor (var i = 1; i <= objNodes.Count; ++i){\n\t\tvar currNod... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compare the difference between scores A against scores B, question by question. Add up the differences to calculate the totalDifference. | function caculateTotalDifference(scoresA, scoresB) {
var totalDifference = 0;
for (var i = 0; i < scoresA.length; i++) {
totalDifference += Math.abs(scoresA[i] - scoresB[i]);
}
// console.log("totalDifference: " + totalDifference);
return totalDifference;
} | [
"function caculateTotalDifference(scoresA, scoresB) {\n var totalDifference = 0;\n for (var i = 0; i < scoresA.length; i++) {\n totalDifference += Math.abs(scoresA[i] - scoresB[i]);\n }\n return totalDifference;\n}",
"function compareScores() {\n //looping through all 10 questions calculating ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[ZScore, or Standard Score]( The standard score is the number of standard deviations an observation or datum is above or below the mean. Thus, a positive standard score represents a datum above the mean, while a negative standard score represents a datum below the mean. It is a dimensionless quantity obtained by subtra... | function z_score(x, mean, standard_deviation) {
return (x - mean) / standard_deviation;
} | [
"function z_score(x, mean, standard_deviation) {\n\t return (x - mean) / standard_deviation;\n\t }",
"function zScore(mean, sd, value) {\n var score = (value - mean) / sd;\n if (score < -2.9) {\n return -2.9;\n } else if (score > 3) {\n return 3;\n } else {\n return scor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Slice and Dice! For this section, write the following functions using rest, spread and refactor these functions to be arrow functions! Make sure that you are always returning a new array or object and not modifying the existing inputs. remove a random element in the items array and return a new array without that item. | function removeRandom(items) {
let counter = Math.floor(items.length*(Math.random()));
return [...items.slice(0, counter), ...items.slice(counter+1)];
} | [
"function removeRandom(items) {\n let randNum = Math.floor(Math.random() * items.length);\n return [...items.slice(0, randNum), ...items.slice(randNum + 1)];\n\n}",
"function removeRandom(items) {\n const randomIndex = Math.floor(Math.random() * (items.length-1));\n const arr1 = items.slice(0, randomI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Text Model can be used to handle large blocks on content. | function SFTextModel(text) {
this._text = (text) ? text : '';
} | [
"function StructuredText(blocks) {\n\n this.blocks = blocks;\n\n}",
"function StructuredText(blocks) {\n\t\n\t this.blocks = blocks;\n\t\n\t}",
"function StructuredText(blocks) {\n\n this.blocks = blocks;\n\n }",
"function StructuredText(mask, blocks) {\n\n function firstTitle() {\n for(var i=... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Summary: GetParamCode is used to get the current code value of a given string response parameter where the string response parameter has an associated list of selectable items. Parameter inputs: state The Reportal scripting state object. parameter_name The name of the string response parameter to get the value from. Re... | static function GetParamCode (state, parameterName)
{
if (state.Parameters.IsNull(parameterName))
return null;
var parameterValueResponse : ParameterValueResponse = state.Parameters[parameterName];
return parameterValueResponse.StringKeyValue;
} | [
"static function GetParamCode (state, parameter_name,log)\n {\n// log.LogDebug('entered param code');\n// log.LogDebug('parameter_name=[' + parameter_name + ']');\n// log.LogDebug('state.Parameters.IsNull(parameter_name)=[' + state.Parameters.IsNull(parameter_name) + ']');\n if (state.Parameters.IsNull... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a 4x4 matrix with diagonal elements set to the given scalar. | diagonalMat4s(s) {
return math.diagonalMat4c(s, s, s, s);
} | [
"diagonal() {\r\n if (!this.isSquare) {\r\n return null;\r\n }\r\n const els = [];\r\n const n = this.elements.length;\r\n for (let i = 0; i < n; i++) {\r\n els.push(this.elements[i][i]);\r\n }\r\n return Vector.create(els);\r\n }",
"diagonalMat4c(x, y, z, w) {\n return math... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inline Parser class. Note that link validation is stricter in Remarkable than what is specified by CommonMark. If you want to change this you can use a custom validator. | function ParserInline() {
this.ruler = new Ruler();
for (var i = 0; i < _rules$2.length; i++) {
this.ruler.push(_rules$2[i][0], _rules$2[i][1]);
}
// Can be overridden with a custom validator
this.validateLink = validateLink;
} | [
"function ParserInline() {\n\t this.ruler = new Ruler();\n\t for (var i = 0; i < _rules$2.length; i++) {\n\t this.ruler.push(_rules$2[i][0], _rules$2[i][1]);\n\t }\n\n\t // Can be overridden with a custom validator\n\t this.validateLink = validateLink;\n\t}",
"function ParserInline() {\n this.ruler = new... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialise raster bars These are 3 canvases with the raster bars predrawn onto them, which are then moved around in a raster bar stylee! | function rasterBars() {
var grad1Col = '#ff8844'; // Raster base colours (Rasters gradient is black->colour->white->colour->black)
var grad2Col = '#44ff88';
var grad3Col = '#8844ff';
rasterBar1Screen = SeniorDads.ScreenHandler.Codef(640,60,name,zIndex++); // Set up raster canvases
raste... | [
"function draw_rasterBar() {\n \tif ( defaultFalse( currentPart.rasterBar ) ) {\t\t\t// If we're showing the copper pipes...\n \t\trasterBar1Screen.show();\n \t\trasterBar2Screen.show();\n \t\trasterBar3Screen.show();\n \t\trasterBar1Y = 330 - Math.abs(Math.sin(rasterBar1Pos) * 20... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create the content for the search result sidebar | function createResultsSidebarContent(recommendations,showJoyride,callback,searchTerm) {
log(gvScriptName_CSMain + '.createResultsSidebarContent: Start', 'PROCS');
// variable to hold html as we build it
var lvSidebarContentHTML = '';
// Vars to control the flow through the ProductGroup loop
lvSi... | [
"function renderAfterSearch() {\n\n // Hide article details\n $('.articleTitle').hide();\n $('.helpArticleWrapper').hide();\n $('.relatedTopicsWrapper').hide();\n\n // Show search result\n $('.searchResult').show();\n $('.helpItemList').show();\n }",
"generateSi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
suppress completely suppresses an event in all browsers. | function suppress(event)
{
if (!event)
return false;
if (event.preventDefault)
event.preventDefault();
if (event.stopPropagation)
event.stopPropagation();
event.cancelBubble = true;
return false;
} | [
"function silenceEvents() {\n _silenceEvents = true;\n}",
"function silentEvent(e) {\n e.stopPropagation();\n e.preventDefault();\n}",
"ignoreEvent(event) { return true; }",
"ignoreEvent(_event) { return true; }",
"ignoreEvent(_event) {\n return true;\n }",
"function suppressOutEvents(event) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setTimeout(cSend("play"),500); / Functions Send command to mpd, log output to console | function cSend(cmd) {
mpd.send(cmd,function() {
});
} | [
"play() {}",
"function cSend(cmd) {\n\t mpd.send(cmd,function(r) {\n\t\t console.log(r);\n\t });\n }",
"function cSend(cmd) {\n\t mpd.send(cmd,function(r) {\n\t\t console.log(r);\n\t l });\n }",
"async chat_play() {\n await this.mpd.play();\n }",
"function play(){\n //start pla... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Actions: reviewCart function reviewing product(s) in cart prior to confirming purchase | async function reviewCart() {
if (token === "" || typeof token === 'undefined') {
addAgentMessage("Sorry I cannot perform that. Please login first!")
return;
}
await navigateTo('/cart-review');
addAgentMessage('Here are items in your cart. Would you like to place an order?')
} | [
"async function confirmCart() {\r\n const productContext = agent.context.get('cart-review')\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 if (!productContext) {\r\n reviewCa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
insert bb color code | function InsertBBColor(sbID, elm)
{
var idx = elm.selectedIndex;
if(idx != 0)
{
var color = elm.options[idx].value;
var aTag = "[c="+ color +"]";
var eTag = "[/c]";
ShoutInsert(sbID, aTag, eTag);
elm.selectedIndex = 0;
}
} | [
"function insertBBCode(e,t,s){var a=document.querySelector(s),o=$(s),r=a.selectionStart,i=a.selectionEnd,n=o.val(),c=n.substring(r,i),l=e,d=t;o.val(n.substring(0,r)+l+c+d+n.substring(i)),a.focus(),a.selectionStart=r+l.length+c.length+d.length,a.selectionEnd=r+l.length+c.length+d.length}",
"function syntaxColorMou... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For each log, the first word in each log is an alphanumeric identifier. Then, either: Each word after the identifier will consist only of lowercase letters, or; Each word after the identifier will consist only of digits. We will call these two varieties of logs letterlogs and digitlogs. It is guaranteed that each log h... | function reorderLogFiles(logs) {
let dig = [];
let lett = [];
for(let i = 0; i < logs.length; i++){
let lastCode = logs[i][logs[i].length - 1].charCodeAt();
if (lastCode >= 97 && lastCode <= 122) {
lett.push(logs[i]);
}else {
dig.push(logs[i]);
}
}
//把前面貼到後面
lett.sort((a, b) => {
a = a.substrin... | [
"function reorderLogFiles(logs) {\n const digitArr = [];\n const wordArr = [];\n\n // iterate through the logs array and first pass just throw into the correct arrays. Just look at the first number after\n for (let i = 0; i < logs.length; i++) {\n const check = logs[i].split(\" \");\n if (check[1].charCod... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get item number fron url | function getItemNum (url) {
return url.substr (url.lastIndexOf('/')+1, url.length-1);
} | [
"function getItemId() {\n const urlParams = ( new URL( window.location.href ) ).searchParams;\n return urlParams.get( \"item\" );\n}",
"function getItemIdFromUrl(url) {\r\n // If a URL is not supplied, use the current page URL\r\n if (typeof url == 'undefined') {\r\n url = document.location.href;\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate and show a QR code of the specified text | function showQR(text) {
var qrLink = "https://chart.googleapis.com/chart?cht=qr&chl=" + htmlEncode(text) + "&chs=160x160&chld=L|0"
var qrLinkKV = {}; qrLinkKV["url"] = qrLink;
chrome.tabs.create(qrLinkKV);
} | [
"text(text, size, { errorCorrectionLevel = 'M' } = {}) {\n const encodingHints = new Map();\n encodingHints.set(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel[errorCorrectionLevel]);\n const bitMatrix = this.writer.encode(text,\n BarcodeFormat.QR_CODE,\n size, // wi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The default handler for aborted transitions. Redirects replace the current URL and all others roll it back. | function defaultAbortedTransitionHandler(transition) {
var reason = transition.abortReason;
if (reason instanceof Redirect) {
replaceWith(reason.to, reason.params, reason.query);
} else {
goBack();
}
} | [
"function defaultAbortedTransitionHandler(transition) {\n var reason = transition.abortReason;\n\n if (reason instanceof Redirect) {\n LocationActions.replaceWith(reason.to, reason.params, reason.query);\n } else {\n LocationActions.goBack();\n }\n}",
"function defaultAbortHandler(abortReason, location)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this method is used to initialise authentication token for google calendar api | _init() {
return new Promise((resolve, reject) => {
if (this._oauthTokens) {
this._oauthClient.setCredentials(this._oauthTokens);
this._calendar = google.calendar({version: 'v3', auth: this._oauthClient});
resolve();
} else {
this._dbManager.getOAuthToken()
.th... | [
"constructor() { \n \n GdriveToken.initialize(this);\n }",
"createGToken() {\n if (!this.gtoken) {\n this.gtoken = new gtoken_1.GoogleToken({\n iss: this.email,\n sub: this.subject,\n scope: this.scopes,\n keyFile: this... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks if the user already has a pool in the given environment | function hasUserPool(req) {
var userId = getUserId(req),
env = getEnvFromRequest(req);
// check if the pool is already initialised and stored in userPools object
if (userPools && userPools[userId] && userPools[userId].pools && userPools[userId].pools[env])
return true;
// check if the sessionCookie is stored ... | [
"checkPool(pool) {\n return pool ? true : false;\n }",
"function isPoolAccessible(pool) {\n return pool.state == 'ONLINE' || pool.state == 'DEGRADED';\n}",
"function poolIsNamed(pool) {\n assert(pool.name && pool.name.length > 0, Errors.NOT_NAMED);\n}",
"function exists(next){\n let params = {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles storing the current user input for the new resource's url in state when the user is adding a resource to the task. | handleResourceUrlChange(e) {
this.setState({
resourceUrl: e.target.value
});
} | [
"handleAddNewTask() {\n this.addNewTask(this.state.newTaskName);\n }",
"function addUrl() {\n\tconst urlInput = document.getElementById(\"urlInput\");\n\tconst url = urlInput.value;\n\tif (url) {\n\t\tconst transaction = db.transaction([storeName], \"readwrite\");\n\t\tconst objectStore = transaction.objectSt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a ComponentFactoryResolver and stores it on the injector. Or, if the ComponentFactoryResolver already exists, retrieves the existing ComponentFactoryResolver. | function injectComponentFactoryResolver() {
return componentFactoryResolver;
} | [
"function injectComponentFactoryResolver() {\n return componentFactoryResolver;\n }",
"function injectComponentFactoryResolver() {\n return componentFactoryResolver;\n}",
"function injectComponentFactoryResolver() {\n return componentFactoryResolver;\n}",
"function scanComponentFactoryResolver(res... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a new radiation sample to the chart every few seconds | function startEventLoop() {
var startTime = Date.now();
stopEventLoop();
chartUpdater = setInterval(function () {
var secondsPassed = (Date.now() - startTime) / 1000;
radiationSamples.push({
timestamp: Math.floor(secondsPassed + 0.5),
radiation: getNewValue()
... | [
"function incrementTimer() {\n globalTimer += SAMPLE_RATE / 1000;\n graphs.update(); //measure voltages and add them to graph\n}",
"function increaseSeries() {\n increaseCounter();\n var randNumber = generatRandomNumber();\n console.log(randNumber);\n series.push(randNumber);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ataches RTT Texture to frame buffer | attachFrameBuffer() {
this.rttTexture.attachToFrameBuffer();
} | [
"detachFrameBuffer() {\n this.rttTexture.detachFromFrameBuffer();\n }",
"updateTexture() {\n const currentFrame = this.currentFrame;\n this._previousFrame !== currentFrame && (this._previousFrame = currentFrame, this._texture = this._textures[currentFrame], this._textureID = -1, this._textureTrimm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The failed step including the logs | onTestFail(payload) {
this.updateStepStatus(payload);
} | [
"fail(description, error) {\n this.results.get(this.currentContext).failures++;\n this.results.get(this.currentContext).tests++;\n var message = error.message;\n if (error.name != 'AssertionError') error.stack;\n console.log(`[FAILED] ${description}\\n${message}`);\n }",
"function pathToFailureLog... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets up the progressive disclosure mechanism in js by adding a change handler to the control which may satisfy the progressive disclosure condition passed in. When the condition is satisfied, show the necessary content, otherwise hide it. If the content has not yet been rendered then a server call is made to retrieve t... | function setupProgressiveCheck(controlName, disclosureId, baseId, condition, alwaysRetrieve, methodToCall){
if (!baseId.match("\_c0$")) {
jq("[name='"+ escapeName(controlName) +"']").live('change', function() {
var refreshDisclosure = jq("#" + disclosureId + "_refreshWrapper");
if(refreshDisclosure.length){
... | [
"function setupProgressiveCheck(controlName, disclosureId, baseId, condition, alwaysRetrieve, methodToCall) {\r\n if (!baseId.match(\"\\_c0$\")) {\r\n jQuery(\"[name='\" + escapeName(controlName) + \"']\").live('change', function () {\r\n var refreshDisclosure = jQuery(\"#\" + disclosureId);\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DUP[] DUPlicate top stack element 0x20 | function DUP(state) {
var stack = state.stack;
if (DEBUG) console.log(state.step, 'DUP[]');
stack.push(stack[stack.length - 1]);
} | [
"function DUP(state) {\n\t var stack = state.stack;\n\n\t if (exports.DEBUG) { console.log(state.step, 'DUP[]'); }\n\n\t stack.push(stack[stack.length - 1]);\n\t}",
"function DUP(state) {\n var stack = state.stack;\n\n if (exports.DEBUG) {\n console.log(stat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Short notation encoding (internal for this libraries only) Short notation move>code or code>move... | function c0_shortCode(ch7,P1){
var cDret='';
var cDp0="abcdefghijklmnopqrstuvxyz0123456789ABCDEFGHIJKLMNOPQRSTUVXYZ";
var cf1s=c0_f_evals1;
var cf2s=c0_f_evals2;
c0_f_evals1=null;
c0_f_evals2=null;
var cDp=c0_get_next_moves();
c0_f_evals1=cf1s;
c0_f_evals2=cf2s;
var cDp1='';
for(var c77=0;c77<cDp.... | [
"function encodeMove(source, target, piece, capture, pawn, enpassant, castling) {\n return (source) |\n (target << 7) |\n (piece << 14) |\n (capture << 18) |\n (pawn << 19) |\n (enpassant << 20) |\n (castling << 21)\n }",
"function expand_code(s) {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Appends the glare element (if glarePrerender equals false) and sets the default style | prepareGlare() {
// If option pre-render is enabled we assume all html/css is present for an optimal glare effect.
if (!this.glarePrerender) {
// Create glare element
const jsTiltGlare = document.createElement("div");
jsTiltGlare.classList.add("js-... | [
"prepareGlare() {\n // If option pre-render is enabled we assume all html/css is present for an optimal glare effect.\n if (!this.glarePrerender) {\n // Create glare element\n const jsTiltGlare = document.createElement(\"div\");\n jsTiltGlare.classList.add(\"js-tilt-glare\");\n\n const jsT... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
We need to make sure, that we can actually create the folder. We can do so, if the desired output is inside project root | _shouldFolderBeCreated(outputDir) {
// this returns absolute path
// handle absolute path, that points to project
const isAbsolutePathWithProjectRoot = outputDir.includes(process.cwd());
// if output is inside the folder, we're all good
const isPathWithinProjectRoot = !outputDir.... | [
"createOutputFolder(){this.folder=_path.default.join(this.args.output.filename,this.args.getSiteName(),\"lighthouse\");if(!_fs.default.existsSync(this.folder)){_fs.default.mkdirSync(this.folder)}}",
"createOutputDirectory(){\n let dirname = this.output.replace(/!?[\\w-]+\\..*/, \"\");\n if (!Fs.exis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
when the player meet the coin at the same point | function coinCollision() {
if (!(playerX + playerWidth < coinX || coinX + coinWidth < playerX || playerY + playerHeight < coinY || coinY + coinHeight < playerY)) {
coinSound.play();
addScore();
newCoin();
}
} | [
"function checkCoin(coin) {\n if(coin.posY === 0) {\n if (pouch.posX === coin.posX && pouch.posY === coin.posY){\n pouch.coins += 1;\n console.log(\"You have collected \" + pouch.coins + \" coins!\");\n console.log(\"\");\n }\n else {\n console.log(\"Oops! You missed a coin!\");\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wait for parent view to load | _waitForParent(callback) {
if (!this._mustWaitForParent ||
this.parent === null ||
!this.parent.loading) {
callback();
return;
}
// Wait for parent
this.parent.onLoad = callback;
} | [
"_triggerLoaded() {\n\t if (this._alreadyLoaded) {\n\t // Do not trigger event twice\n\t this._triggerUpdated();\n\t return;\n\t }\n\t this._alreadyLoaded = true;\n\t const registry = storage.getRegistry(this._instance);\n\t const events = registry... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convenience method to get the key attribute(s) (hash and/or range) of a model. To call this method use: key.call( model ) | function key() {
var hashName = _.result( this, 'hashAttribute' ) || _.result( this, 'idAttribute' ),
rangeNake = _.result( this, 'rangeAttribute' );
return this.pick( hashName, rangeNake );
} | [
"function key(model){\n model('key')\n .attr('name', 'string')\n //.format('basic', 'KeyName')\n .validate('present')\n .attr('body', 'text')\n //.format('basic', 'PublicKeyMaterial')\n .action('find', find)\n .param('name', [ 'string' ])\n .format('basic', 'KeyName.{i}')\n .... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This object is used to estimate the maximum amplitude (speed) the user will move AND at the same time, we estimate the sampling rate. | function EstimateSampleRate()
{
var frameRateEstimator = new FrameRateEstimator();
/**
* Feed each sampling into this update function.
*/
this.update = function()
{
frameRateEstimator.update();
}
/**
* Get most recent sampling ... | [
"function MaximumDistanceEstimator()\n{\n var previous = null;\n //var stats = new RunningStatistics();\n\n // This is used to tack the top speeds. We will\n // take the minimum max speed, assuming the others\n // are outliers due to noise or system tracking errors\n var speeds = new Array(5);\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[END apps_script_admin_sdk_create_alias] [START apps_script_admin_sdk_list_all_groups] Lists all the groups in the domain. | function listAllGroups() {
var pageToken;
var page;
do {
page = AdminDirectory.Groups.list({
domain: 'example.com',
maxResults: 100,
pageToken: pageToken
});
var groups = page.groups;
if (groups) {
for (var i = 0; i < groups.length; i++) {
var group = groups[i];
... | [
"function groupList() {\n return wrap('group-list', or(\n mailboxList,\n invis(cfws),\n obsGroupList\n )());\n }",
"function listGroups(callback) {\n registry.list(callback);\n}",
"function getAllGroups() {\n var token = getKey('token');\n return $http(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Unwraps a result, returning the content of an `Ok`. Throws if the value is an `Err`, with a message provided by the `Err` value. | unwrap() {
if (this.isOk()) {
return this.value
}
throw Error('Called `Result#unwrap()` on an `Err` value: ' + this.error)
} | [
"unwrapErr() {\n if (this.isErr()) {\n return this.error\n }\n throw Error('called `Result#unwrapErr()` on an `Ok` value: ' + this.value)\n }",
"unwrapOrElse(v) {\n\t\tif(this.isOk) {\n\t\t\treturn this.value;\n\t\t} else {\n\t\t\treturn v;\n\t\t}\n\t}",
"unwrapOrElse(fn) {\n if (this.isOk()) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
for all add expense form views use this code, there is a temp band aid in there. | function setupAddExpenseForm(isCalculatedByLoggedInUser, utils, modal, map, mask) {
var categoryId = "#kn-input-field_238 .select";
var categoryIdChzn = "#connection-picker-chosen-field_238 .chzn-container";
var beginningMileageId = "#field_225" ;
var endingMileageId = "#field_226";
... | [
"function addDemandBase() {\r\n form.addHiddenFields({\r\n \"Demandbase_CompanyName\" : \"\",\r\n \"Demandbase_Industry\" : \"\",\r\n \"Demandbase_SubIndustry\" : \"\",\r\n \"Demandbase... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CAT VACCINE & NEUTER getting all catVaccine | getVaccines() {
return this.catVaccine;
} | [
"reportvrActorsInvrScene() {\n var actors = [];\n mediator_14.mediator.log(`reportvrActors: vr_sc.ch.l = ${vr_scene.children.length}`);\n for (let o of vr_scene.children) {\n mediator_14.mediator.log(`reportvrActors: vr_scene contains c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function is called whenever a chat modal is opened, and whenever the user wants to see previous messages. | function startChatModal(targetTagname) {
// if the user is actually clicking on the avatar images (meaning he wants to go to the user modal, not to the chat modal) of the chatPortals, return.
if(targetTagname == "IMG") {
return;
}
if(typeof $(this).attr("data-chat-id") != "undefined" || typeof $(this).attr("data-us... | [
"function configOpenedChatObserver() {\r\n if (getAriaLive()) {\r\n let callback = (mutationRecord, observer) => {\r\n if (mutationRecord.length == 1) {\r\n let messageElement = mutationRecord[mutationRecord.length - 1].addedNodes[0];\r\n if (messageElement && mActive) {\r\n if (mess... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A card needs a lot of properties that don't come from input EG: When it can be no longer secured, and new keys for new entries Initialize a card INPLACE, return nothing | function initCard(card) {
// Set expiration date for adding security expiring
// This is needed so that someone cannot secure an unsecured card and
// essentially steal it
let hoursToMs = (
24 // Hours
* 60 // Minutes
* 60 // Seconds
* 1000 // Ms
);
let exp = Date.now() + hoursToMs * cfg.sec... | [
"Card() {\n\t\t// Initialize Variables to default values \n\t\tthis.mSuit = \"\";\n\t\tthis.mValue = 0;\n\t\tthis.mAbbv = \"\";\n\t}",
"createCard(t) {\n // prevent user from creating card without all fields \n if (this.newCard.name === \"\" || this.newCard.description === \"\" || this.newC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a function for usersUsernameHooksPost / Creates a new webhook on the specified user account. Accountlevel webhooks are fired for events from all repositories belonging to that account. Note that one can only register webhooks on one&39;s own account, not that of others. Also, note that the username path paramet... | usersUsernameHooksPost(incomingOptions, cb) {
const Bitbucket = require('./dist');
let defaultClient = Bitbucket.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = incomingOptions.apiKey;
// Uncomment the follo... | [
"function createHook({owner, repository, hookName, hookConfig, hookEvents, active}) {\n return this.postData({path:`/repos/${owner}/${repository}/hooks`, data:{\n name: hookName\n , config: hookConfig\n , events: hookEvents\n , active: active\n }}).then(response => {\n return response.data;\n });\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a notification to state.collection | add (state, notification) {
// Assigns unique ID to notification
// this is used for removing the notification after a timeout
let id = uniqueId()
notification.id = id
// Adds the notification to state.collection
state.collection.push(notification)
// Removes the notification... | [
"addNotification(notif) {\n this._displayEmptyState(false);\n this._notifContainerElem.prepend(this._createNotifElem(notif));\n this._incNotifCounter(notif);\n this._alarmOnOff();\n }",
"add (notification, callback) {\n c.crn.notifications.updateOne({_id: notification._id}, n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load marks from a cut and paste in the settings, or use a default | loadMarks() {
this.marksDb = {};
var markList, toCols;
if ( this.props.marks === undefined || this.props.marks.trim() === "") {
markList = solentMarks;
toCols= (x) => { return x};
} else {
markList = this.props.marks.trim().split("\n");
toC... | [
"function getMarkConfig(prop, mark, config, { skipGeneralMarkConfig = false } = {}) {\n return Object(_util__WEBPACK_IMPORTED_MODULE_6__[\"getFirstDefined\"])(\n // style config has highest precedence\n getStyleConfig(prop, mark, config.style), \n // then mark-specific config\n config[mark.type][prop... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Authenticate user with localStorage jwt (JSON Web Token) | function authenticateUser() {
let jwt = localStorage.getItem('jwt');
if (jwt) {
LoginActions.loginUser(jwt);
}
} | [
"static authenticateUser(token) { \n localStorage.setItem('token', token);\n }",
"authenticate(jwt, cb ) {\n if (typeof window !== \"undefined\")\n sessionStorage.setItem('jwt', JSON.stringify(jwt))\n cb()\n \n }",
"static authenticateUser(token) {\n localStorage.se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Chapter 101 RopeGroup Load | function C101_KinbakuClub_RopeGroup_Load() {
// After intro player has a choice each time she goes to the group, until a twin is released
if (C101_KinbakuClub_RopeGroup_CurrentStage > 100 && C101_KinbakuClub_RopeGroup_CurrentStage < 700) {
C101_KinbakuClub_RopeGroup_CurrentStage = 100;
}
// Load the scene param... | [
"function loadGroups(){\n \n groupToLoad = studentGroup;\n\n addRow(groupToLoad);\n // add the name of the group working on that project\n \n}",
"function loadGroup (chosenGroup) {\n if (!chosenGroup) return;\n\n clickedRemoveAllButton(false);\n console.log(chosenGroup.title);\n \n if (SENTRY_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Metoda pro refresh MathJaxu ve vsech boxech. | function refreshMathJax() {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, "extremalBox"]);
MathJax.Hub.Queue(["Typeset", MathJax.Hub, "diffBox"]);
MathJax.Hub.Queue(["Typeset", MathJax.Hub, "spearmanBox"]);
MathJax.Hub.Queue(["Typeset", MathJax.Hub, "serialBox"]);
} | [
"update(){\n MathJax.Hub.Queue([\"Typeset\",MathJax.Hub]);\n }",
"function rerenderMath(id) {\n try {\n if (MathJax) {\n MathJax.Hub.Queue([\"Typeset\", MathJax.Hub, id]);\n } else {\n console.log('MaxJax loading... Please wait...');\n }\n } catch(e) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
increment_column: given a column, will find and give coordinates to all vertices immediately to the right of those in the column. | function increment_column(column, instance, squares_pos) {
new_column = new Array();
for(let i in column) {
let v = column[i];
for(let j in instance.get_neighbours(v)) {
let n = instance.get_neighbours(v)[j];
if(n == v+1) {
new_column.push(n);
squares_pos[n].x = squares_pos[v].x + 1;
sq... | [
"function changeCol(val) {\n\t\tcol+=val;\t\t//increment col coord by value sent to it function\n\t\n\t\tif (col==-1) {\t\t//if incriment pushes column over left edge, incriment it to bring it back \n\t\t\tcol++;\n\t\t}\n\n\t\tif (col==colCount) {\t//if incriment pushes column over right edge, decriment it to bring... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
However, if you use Function.call, you can metaprogram a derivation of the Point2D constructor behavior for a new Point3D type: | function Point3D(x, y, z) {
Point2D.call(this, x, y);
this._z = z;
} | [
"function Point3D(x,y,z)\n{\n this.x = x \n this.y = y \n this.z = z \n\n}",
"function Point3D(x, y, z) {\r\n this.x = x;\r\n this.y = y;\r\n this.z = z;\r\n}",
"function Point3D(x, y, z) {\n this.x = x || 0;\n this.y = y || 0;\n this.z = z || 0;\n}",
"function Point3(x,y,z) {\n\tif... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
onClick() trigger mention insertion on click | function onClick(event) {
if (selectEventTarget(event)) {
insertMention();
} else {
Event.stop(event);
}
} | [
"function onClick(event) {\n const target = event.target;\n let name;\n if (event.altKey) {\n let tempNode;\n if ((tempNode = target.closest('.chat-line__message')) && (tempNode = tempNode.querySelector('.chat-line__username')))\n name = tempNode.textContent.trim();\n } else if ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper method used by the PegaForm instance to reset the force refresh flag. | resetForceRefresh() {
this.setState({ forceRefresh: false });
} | [
"function ft_form_refresh() {\n // \n}",
"function allowRefresh() {\n allowClickRefresh = !allowClickRefresh;\n}",
"refresh() {\n events.offAll(this.form);\n // _getFormFields().forEach(field => {\n // delete field.dataset[VALIDATA_DATA_KEY]\n // });\n this._unbindEvents();\n }",
"function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If the class has a _protected member object (with the protected variables inside) then the subclasses _protected variables will be merged with the fathers protected variables. NOTE: The protected objects will not be merged, the leave will be predominant. | function mergeProtected(obj) {
// Gets the first parent Class
var proto = (0, _getPrototypeOf2.default)((0, _getPrototypeOf2.default)(obj));
while (proto) {
if (_.has(proto, PROTECTED)) {
// we copy the father protected because the _extend overwrites it
var copy = _(proto[PROTECTED]).clone(... | [
"function isClassDerivedFromDeclaringClasses(checkClass, prop) {\n return forEachProperty(prop, function (p) {\n return getDeclarationModifierFlagsFromSymbol(p) & 16 /* Protected */ ? !hasBaseType(checkClass, getDeclaringClass(p)) : false;\n }) ? undefined : checkCla... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns with the type of the operating system. If it is neither [Windows](isWindows) nor [OS X](isOSX), then it always return with the `Linux` OS type. | function type() {
if (exports.isWindows) {
return Type.Windows;
}
if (exports.isOSX) {
return Type.OSX;
}
return Type.Linux;
} | [
"function getOSType() {\n var osTypeName = os.type().toString();\n var osTypes = [OS_WINDOWS, OS_MAC, OS_LINUX];\n var os_type = 'Unknown';\n osTypes.forEach(function(ele, idx, target) {\n if (osTypeName.match(ele)) os_type = ele;\n }); \n return os_type;\n}",
"function getOS() {\n let osTypeName = os.t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attach Event Listener to Static Elements FOLLOW_BUTTON, IMAGE_TAB and VIDEO_TAB | attachEventListenersStaticElements(){
domGetElementById(ids.IMAGE_TAB).addEventListener("click", this.controllerEventHandler.viewImages);
domGetElementById(ids.VIDEO_TAB).addEventListener("click", this.controllerEventHandler.viewVideos);
} | [
"function addClickListeners() {\n\t\t// Some pages have internal/external versions, which require different buttons to be hooked up\n\t\tif (gameType === _stateManager2.default.INTERNAL) {\n\t\t\tdocument.querySelector('.panel-button.how-to-play').addEventListener('click', function () {\n\t\t\t\treturn _EventManage... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ensures the type of the object is a HControl | _ensureValidControl(_ctrl, _warnMethodName) {
if (this.isNullOrUndefined(_warnMethodName)) {
_warnMethodName = '_ensureValidControl';
}
if (this.isntFunction(_ctrl.hasAncestor)) {
console.Warn(
`EventManager#${_warnMethodName} => Not a HClass: `, _ctrl);
return false;
}
els... | [
"function isVuePlotControl(obj) {\n return (obj && (!(typeof obj.control === \"undefined\")));\n }",
"static hasControlSupport(type) {\n return !!controlTypes[type]\n }",
"function GetControlType()\n{\n\treturn m_type;\n}",
"function isInputFormControl(control) {\n return contro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set paysTax to boolean | function tax() {
if (paysTax.checked) {
return true;
} else {
return false;
}
} | [
"setFee(state) {\n document.getElementById(\n \"en__field_supporter_transaction_fee\"\n ).checked = !!state;\n }",
"function setarValorTaxa() {\r\n\r\n valor = jQuery('#cmdfpobroid_taxa option:selected').data('valor');\r\n\r\n valor = tratarMoeda(valor, 'A');\r\n\r\n if (!jQuery('#cmdfpisenca... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Form/form element functions Pass in form.element(s) and iteration will set all to the empty string | function clearFormElementValues() {
var A_elements;
if (arguments[0].isAnArray()) // single argument passed in is an array of form elements.
A_elements = arguments[0];
else if (arguments.length >= 1) // 1+ form.element(s) passed in
A_elements = arguments;
for (var i = 0; i < A_elements.length;... | [
"function clearFields(elements) {\n for( var i = 0; i < elements.length; i++ ) {\n elements[i].value = '';\n }\n}",
"function clear_form_elements(ele) {\n $(ele).find(':input').each(function() {\n switch(this.type) {\n case 'password':\n case 'select-multiple':\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draws a text box (without text) on a canvas, using the roundRect() method. Note that the perceived height of the text box will not be the same as the given height (the actual height will be smaller). | function drawTextBox (context, height, frameWidth) {
context.fillStyle = "rgba(0, 0, 0, 0.5)";
roundRect(context, 0, CANVAS_HEIGHT - (height - frameWidth),
CANVAS_WIDTH, height - (2 * frameWidth),
0, true, false);
} | [
"function drawTextBox(x, y, width, height, text, color)\n{\n context.save();\n \n context.translate(x, y);\n \n context.strokeStyle=\"#aaa\";\n context.fillStyle=\"#000\";\n drawRect(0, 0, width, height, 10);\n \n context.font = \"24px sans-serif\";\n\tcontext.fillStyle = color;\n cont... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
start / stop / toggle the sparkles | function sparkle(enable = null) {
if (enable === null) {
sparkles_enabled = !sparkles_enabled;
} else {
sparkles_enabled = !!enable;
}
if (sparkles_enabled && star.length < sparkles) {
sparkle_init();
}
} | [
"function toggleStopwatch() {\n var elmStopwatchStart = document.querySelector(\"#button-swatch-start\");\n\n switch (modeStopwatch) {\n case \"Pause\":\n // Pause -> Start\n modeStopwatch = \"Start\";\n elmStopwatchStart.style.backgroundImage = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse a vega schema url into library and version. | function default_1(url) {
var regex = /\/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g;
var _a = regex.exec(url).slice(1, 3), library = _a[0], version = _a[1];
return { library: library, version: version };
} | [
"function default_1(url) {\n var regex = /\\/schema\\/([\\w-]+)\\/([\\w\\.\\-]+)\\.json$/g;\n var _a = regex.exec(url).slice(1, 3), library = _a[0], version = _a[1];\n return { library: library, version: version };\n}",
"function getVersion(a) {\n return a.url.substring(1, 3) || \"v1\";\n}",
"function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Binomial Distribution The [Binomial Distribution]( is the discrete probability distribution of the number of successes in a sequence of n independent yes/no experiments, each of which yields success with probability `probability`. Such a success/failure experiment is also called a Bernoulli experiment or Bernoulli tria... | function binomial_distribution(trials, probability) {
// Check that `p` is a valid probability (0 ≤ p ≤ 1),
// that `n` is an integer, strictly positive.
if (probability < 0 || probability > 1 ||
trials <= 0 || trials % 1 !== 0) {
return null;
}
// a [pro... | [
"function binomial_distribution(trials, probability) {\n\t // Check that `p` is a valid probability (0 ≤ p ≤ 1),\n\t // that `n` is an integer, strictly positive.\n\t if (probability < 0 || probability > 1 ||\n\t trials <= 0 || trials % 1 !== 0) {\n\t return null;\n\t ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a string of the elements in the set includeTypeInfo is a bool to include type info for each element | showValues(includeTypeInfo = false) {
let retVal = '{';
this.collection.forEach(function(value, index, collection) {
retVal += value;
if (includeTypeInfo)
retVal += ' (' + typeof(value) + ')';
if (!((index + 1) === collection.length)) {
... | [
"toString() {\n let result = super.toString();\n if (this.typeParameters) {\n const parameters = [];\n this.typeParameters.forEach((parameter) => parameters.push(parameter.name));\n result += \"<\" + parameters.join(\", \") + \">\";\n }\n if (this.type) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a predicate, returns the last element that matches. If predicate is null, then it is treated like 'all'. | function findLast(predicate, array) {
const pred = checkedPredicate('findLast', predicate ? predicate : all);
for (let i = array.length - 1; i >= 0; i--) {
const el = array[i];
if (pred(el)) {
return el;
}
}
return null;
} | [
"function last(predicate, defaultValue) {\n predicate = typeof predicate === 'function' ? predicate : util.defaultPredicate;\n\n let lastValue;\n let found = false;\n for (let item of this.where(predicate)) {\n lastValue = item;\n found = true;\n }\n\n return found ? lastValue : defaultValue;\n}",
"fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show the navigation button | function showNavButton() {
$(this).stop();
$(this).fadeTo(navButtonFadeTime, navButtonOpacity);
} | [
"function mwNavigationButtonClicked() {\n if ( $mwNavigation.hasClass( 'hidden' ) ) {\n showMwNavigation( $mwNavigation );\n } else {\n hideMwNavigation( $mwNavigation );\n }\n }",
"function show() {\n var pos = button.position()\n var height = button.outerHeight(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the listener that is listening to changes in this key k: string, key to find listeners | getListeners(k) {
return this.listeners[k];
} | [
"function addListener(key) {\n\t\t//Create listener for specific key\n\t\tvar l = function(change){\n\t\t\t//Fire it again\n\t\t\tchanged(change,key);\n\t\t};\n\t\t//Add to map\n\t\tlisteners[key] = l;\n\t\t//Return listener callback\n\t\treturn l;\n\t}",
"function getListener(id, callback) {\n\t\t\tvar redisKey... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loop through planes and creates a marker | function createPlaneMarkers(flights) {
clearMarkers();
// Add current flights
flights.current_flights.forEach((flight) => {
createPlaneMarker(flight, '#4caf50');
});
// Add previous flights
flights.previous_flights.forEach((flight) => {
createPlaneMarker(flight, '#2196f3');
... | [
"function addRoadMarkers() {\n for (let k = 0; k < 50; k++) {\n var geometry = new THREE.PlaneGeometry( 10, 50, 32 );\n var material = new THREE.MeshStandardMaterial( {color: 0xfffff0 , side: THREE.DoubleSide} );\n var marker = new THREE.Mesh( geometry, material );\n marker.rotation.x... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
register form validation events | function registerEvents() {
form.on('beforeValidateAttribute', function (event, attribute, messages) {
var ind = getAttributesLangIndex(attribute); //get language index
if (ind !== false && ind !== defaultLangInd) {
if (isLangEmpty(ind)) {
removeErrorA... | [
"registerFieldsValidations() {\n\t\tthis.form.validationEngine(app.validationEngineOptions);\n\t}",
"function formValidator() {}",
"addListeners() {\n this.#validate();\n\n this.#fields.forEach((field) => {\n const input = field.element;\n input.on(\"focusout\", () => {\n input.attr(\"cla... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
.findOne finds the first element that matches the query within the scope of target fluent doc(target).findOne(query); legacy doc.findOne(target, query); | function findOne(target, query){
target = getTarget(target);
if(query == null){
return target;
}
if(isList(target)){
var result;
for (var i = 0; i < target.length; i++) {
result = findOne(target[i], query);
if(result){
break;
... | [
"async findOne(...args) {\n const collection = this;\n\n let opts = extractOptions(collection, args);\n\n switch (args.length) {\n case 2:\n const f = args[1];\n if (f) {\n opts.projection = f;\n }\n // fall through\n case 1:\n // Support direct ObjectId ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CONSTRUCTOR _args `client` and `data` required_ ``` var Subscription = require('coinbase').model.Subscription; var button = new Subscription(client, data); ``` _normally you will get buttons from `Subscription` methods on the `Account` or on a `Button`_ | function Subscription(client, data) {
if (!(this instanceof Subscription)) {
return new Subscription(client, data);
}
BaseModel.call(this, client, data);
} | [
"function Subscription() {\n\n var logger = new Logger('Subscription');\n\n /**\n * Storage keywords for storing subscription settings\n * @type {Object}\n */\n var config = {\n storageKeywords: {\n\n VOIPTN: \"VoipTn\",\n VOIPCRE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
method setDamage of class(using default settings , string interpolation ) | setDamage(damage = 0){
this.health = (this.health < damage) ? 0 : (this.health - damage) ;
console.log(`Health of ${this.name} after damage(${damage}) is: ${this.health}`);
} | [
"SetDamage(num) {\n if (num == 1) { return \"3d6\"; }\n if (num == 2) { return \"3d6+2\"; }\n if (num == 3) { return \"3d8\"; }\n if (num == 4) { return \"3d8+2\"; }\n if (num == 5) { return \"3d10\"; }\n }",
"function updateMonsterDamageText(damage) {\n \n }",
"applyDa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
a function that will return a Block with the appropriate mark and an onclick function Each block will be assigned a specific index in the game state array. 0 to 8. | function showBlock(i) {
return (<Block value={squares[i]} onClick={() => handleClick(i)}/>);
} | [
"function spawnNewBlock() {\n // TODO Change spawning location per block just outside top of the screen\n var decider = Math.round(Math.random() * 6 + 1);\n switch (decider) {\n case 1:\n currentBlock = new block(new coordinate(200, -50), BLOCKS.lBlock);\n break;\n case ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
User Sculpture Management ============================= | function getUserSculptures () {
SocketFactory.emit( 'get:user:sculptures', user.id );
} | [
"function setupCurrentUser()\r\n{\r\n //============================================================\r\n // SETUP CURRENT USER\r\n //============================================================\r\n //Get user id from query string\r\n getCurrentUserId();\r\n //TESTING FB PROFILE PIC\r\n if (currentUserId > 10... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a boolean indicating that there is only one calendar left. | get last_calendar() {
return cal.getCalendarManager().calendarCount < 2;
} | [
"function isNoSchoolDay() {\n return currentScheduleIndex <= -1;\n //might later want to add a check to make sure that currentScheduleIndex is not greater than the number of schedules\n}",
"get all_local_calendars_readonly() {\n // We might want to speed this part up by keeping track of this in the\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show comment scores next to the vote links. [ minScore, maxScore ] specify the range of values to show for; a blank/invalid value equals no limit for that end of the range. | function scoreComments(minScore,maxScore)
{
if( recursion )
return;
MS_observeInserts(function(e)
{
var comments;
if( !e )
comments = document.getElementsByClassName("comment");
else if( e.target.className && e.target.className.indexOf("comment") >= 0 )
comments = [ e.target ];
else if(... | [
"function scoreComments() {\n\tif(userScore === 10) {\n\t\t$(\"#scorecomments\").text(\"WOW, you got a perfect score! You truly have what it takes to be an Earth Defender! You should be proud!\");\n\t} else if (userScore >= 7) {\n\t\t$(\"#scorecomments\").text(\"Great job, you really know your stuff! Congrats, and ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads the activity dictionary that will be used throughout the game to output messages | function ActivityDictionaryLoad() {
if (ActivityDictionary == null) {
// Tries to read it from cache first
var FullPath = "Screens/Character/Preference/ActivityDictionary.csv";
if (CommonCSVCache[FullPath]) {
ActivityDictionary = CommonCSVCache[FullPath];
return;
}
// Opens the file, parse it and ret... | [
"function LoadActivity(){\n var act = Activity();\n\n online = act[\"online\"];\n startTime = act[\"startTime\"];\n inactiveTime = act[\"inactiveTime\"];\n memberRemoveDisplay = act[\"memberRemoveDisplay\"];\n memberAddDisplay = act[\"memberAddDisplay\"];\n saveOnExit = act[\"saveOnExit\"];\n}",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SECTION 4 QUERY AND ENGLISH GENERATION /createEnglish() Using the global english variables first declared in section 1 and used in section 2, creates a string containing a PatientSupporter english query to explain the corresponding PatientSupporter RuleML query. | function createEnglish(){
document.form3.box2.value = "Is " + englishProfileID + " interested in " + englishActivity + "(" + englishAmbience +
"). It would be for " + englishMinRSVP + " to " + englishMaxRSVP +
" people, " + "on " + (englishStartDate == "any day" && englishEndDate == "any day" ? "any day" : (eng... | [
"function createRuleML(){\r\n\t/*Contact should never be used by the GUI, hence why it is statically placed here*/\r\n\tvar string = messageHeader + profileID + activity + ambience + minRSVP + maxRSVP + \r\n\tstartDate + startTime + endDate + endTime + location1 + duration + fitness +\r\n\tmessageFooter;\r\n\tdoc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to create artists Dives | function createArtists (artists) {
listContainer.innerHTML="";
for (let i = 0; i<artists.length; i++) {
// creating dives
let musicBox = document.createElement('div');
musicBox.setAttribute('class', 'musicbox-container-artists');
let imgBox = document.createElement('div');
... | [
"function createArtist(yearId) {\n\tvar artistId = parseInt(Object.keys(draftData[draftId].data.frontData)[Object.keys(draftData[draftId].data.frontData).length - 2]) + 1;\n\n\tdraftData[draftId].data.frontData.years[yearId].mobile.push(artistId);\n\tdraftData[draftId].data.frontData.years[yearId].desktop.push(arti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Actual mining function Postanalysis phase, do additional computation with the collected data and write it out | async postParsingAnalysis () {
var mapped = Object.keys(this.results).map(addr => {return { addr: addr, count: this.results[addr] }})
var sortedByCount = this.sortEntriesByCount(mapped)
var topNentries = this.getTopN(sortedByCount, N)
var fileName = `${this.baseOutPath}-${analysisName}.json`
var fi... | [
"async postParsingAnalysis () {\n var mapped = Object.keys(this.results).map((key) => {\n return {id: key, count: this.results[key]}\n })\n var sortedByCount = this.sortEntriesByCount(mapped)\n var topNentries = this.getTopN(sortedByCount, N)\n\n var fileName = `${this.baseOutPath}-${analysisNam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that add background image on parent block | function setBgImage(pBlockClass){
var elem = pBlockClass.getElementsByTagName('img')[0];
if(elem){
var imgloc = elem.getAttribute('src');
pBlockClass.setAttribute('style','background-image: url('+imgloc.toString()+')');
}
} | [
"function placeBackground() {\n displayModules_1.createImage(this.ctx, this.img, this.sx, this.sy, this.sWidth, this.sHeight, this.x, this.y, this.width, this.height);\n}",
"function inlineBG() {\n\n // Common Inline CSS\n $(\".single-page-header, .intro-banner\").each(function () {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
converts the appointment data so that company and date is displayed to user | function appointmentData(company, date,number){
this.company = company;
this.date = date;
this.number = number;
} | [
"function bookedAppointmentsConverter(appointments) {\n const APPOINTMENT_LENGTH = 0.5; // this is fixed to 30 minutes according to specification.\n const bookedAppointments = [];\n // TODO: There might be issues with locale of time, is it in local or UTC\n // investigate later when testing starts to f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function aboutBoard18 is called from the MAIN menu on most BOARD18 pages. It displays a popup about message. | function aboutBoard18() {
var aboutmsg = 'BOARD18 version ' + BD18.version + '\n';
aboutmsg += '\nAN OPEN SOURCE APPLICATION';
aboutmsg += '\nCopyright (c) 2013 Richard E. Price';
aboutmsg += '\nDistributed under the MIT License';
alert(aboutmsg);
} | [
"function showAbout (msg) {\r\n\tshowInfo(msg);\r\n}",
"function showAbout(msg) {\r\n showInfo(msg);\r\n}",
"function showHelp() \n {\n OpenBlurbWindow('/games/cc/popup/instructions.html', 440, 440, 'Help');\n }",
"function updateBuildingHelp() {\r\n if (SHOWN_DETAILS != -1) {minigames[SHOWN_DE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |