query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
The onDefaultDate() function to display default date (current date) into input tag. | function onDefaultDate() {
var defaultDate = checkTime(parseInt(DAY.getDate())) + " - " + checkTime((parseInt(MONTH) + 1)) + " - " + YEAR;
document.getElementById("birthday").value = defaultDate;
} | [
"function displayDate() {\n console.log(currentDate);\n dateToday.text(currentDate);\n }",
"function setCurrentDateAsInput() {\r\n var date = new Date();\r\n var month = date.getMonth() + 1;\r\n var day = date.getDate();\r\n var currentDate = (day < 10 ? '0' : '') + day + '.' +\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function validates a set of selected files as having the appropriate title format required for multiplefile select, merge and upload operations, upon success it returns a sorted list of files | function validVideoFileSet(files) {
if (files.length) {
var prefixname = "";
var filenos = [];
for (var i=0; i<files.length; i++) {
var file = files[i];
var fileparts = file.name.split(".");
var fileno = parseInt(fileparts[fileparts.length-2], 10);
... | [
"function fileTypeValidate(fileName,fileType){\r\n\r\n\t//get file name and extention name\r\n\t//var fileName=$(\"PB__FileInput\").value;\r\n\tvar fileExName=getFileExName(fileName);\r\n\tfileExName=fileExName.toLowerCase();\r\n\t\r\n\t//define file type list\r\n\t//image file list\r\n\tvar imageList=new Array(\"j... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Params: A hashable object x This method returns the first occurence equal to the parameter, or an error otherwise It does not necessarily return what the parameter is, it returns the first occurence equal to that | get(x)
{
let target=null
if(x instanceof Hashable)
{
let i=this.evaluatePosition(x);
if(this.#_arrayOfll[i].search(x)!=null)
{
target=this.#_arrayOfll[i].search(x);
//break;
}else
{
th... | [
"evaluatePosition(x)\n {\n let position=-1;\n if(x instanceof Hashable)\n {\n let hashCode=x.hashVal();\n position= hashCode%this._size;\n }\n return position;\n }",
"function objectWithKeyAndValue(hashArray, key, value)\n {\n for (var i = 0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Capture keyboard key presses. If the key pressed is a digit then add it to the current cell. If it is a space then empty the current cell. | function keyPress(evt) {
if (current_cell == null)
return;
var key, key1;
if (evt) {
// firefox or chrome
key = evt.key;
key1 = evt.keyCode;
}
else {
// IE
key = String.fromCharCode(event.keyCode);
}
if (key1 == 8 || key1 == 46) {
Verif... | [
"handleBoardKeyPress(e) {\n if (!this.state.helpModalOpen && !this.state.winModalOpen) {\n if (49 <= e.charCode && e.charCode <= 57) {\n this.handleNumberRowClick((e.charCode - 48).toString());\n // undo\n } else if (e.key === \"r\") {\n this.handleUndoClick();\n // redo\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add robbie intro video play, delay and remove | function introVideo() {
$(".game-container").append(`
<section class='intro-video-container video-container'>
<video poster="assests/snakes on a plane.mp4" class='intro-video' id="bgvid" playsinline autoplay>
<source src="assests/snakes on a plane.mp4" type="video/webm">
<source src... | [
"function instructionVideo() {\n\t $(\".game-container\").append(`\n\t <section class='intro-video-container video-container'>\n\t <video poster=\"assests/zoe-instructional-vid.mp4\" class='intro-video' id=\"bgvid\" playsinline autoplay>\n\t <source src=\"assests/zoe-instructional-vid.mp4\" type=\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set up a beforeCreate lifecycle hook to hash the password before the object is created in the database and return the new userdata object | async beforeCreate(newUserData) {
newUserData.password = await bcrypt.hash(newUserData.password, 10);
return newUserData;
} | [
"static beforeCreate(user) {\n console.log('beforeCreate');\n user.password = user.generatePasswordHash(user.password);\n }",
"async $beforeInsert () {\n\t\tif (this.password) {\n\t\t\tthis.password = await bcrypt.hash(this.password, saltRounds)\n\t\t}\n\t}",
"async beforeUpdate(updatedUserData... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Implements a subset of Node's stream.Transform in a crossplatform manner. | function Transform() {} | [
"function Transform() {\n stream.Transform.call(this, {objectMode: true});\n }",
"function createSplitter() {\n let transform = new stream_1.Transform();\n let buffer = Buffer.alloc(0);\n transform._transform = (chunk, _encoding, callback) => {\n buffer = Buffer.concat([buffer, chunk]);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
clears selected sides. Then, selects the slide whose start time is the nearest one less than or equal to the input time parameter | function selectSlide(time) {
nearest = -1;
for (i in slideIndices) {
var numi = parseInt(i);
$(slideIndices[i].displayDiv).addClass('unselected');
$(slideIndices[i].displayDiv).removeClass('selected');
if (numi<=time && numi>nearest) {
nearest=numi;
}
}
if (nearest >-1){
... | [
"resetSelected() {\n\t\tthis.setHour(this.time.hour)\n\t\tthis.setMinute(this.time.minute)\n\t\tthis.setPeriod(this.time.getPeriod())\n\t}",
"function topSugSlide() {\n if (timer !== undefined) {\n clearInterval(timer); // stop previous cycle\n }\n timer = cycle(); // set new cycle\n}",
"fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process the escape sequence that starts at the current position in the text. This method is called to ensure that `peek` has the unescaped value of escape sequences. | processEscapeSequence() {
const peek = () => this.internalState.peek;
if (peek() === $BACKSLASH) {
// We have hit an escape sequence so we need the internal state to become independent
// of the external state.
this.internalState = Object.assign({}, this.state);
... | [
"skipWhitespace() {\n while (!this.isEOF() && this.isWhitespace(this.peekChar())) {\n this.readChar();\n }\n }",
"function ensureChars() {\n\t\t\twhile (pos == current.length) {\n\t\t\t\taccum += current;\n\t\t\t\tcurrent = \"\"; // In case source.next() throws\n\t\t\t\tpos = 0;\n\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
do x=floor(x/n) for bigInt x and integer n, and return the remainder | function divInt_(x,n) {
var i,r=0,s;
for (i=x.length-1;i>=0;i--) {
s=r*radix+x[i];
x[i]=Math.floor(s/n);
r=s%n;
}
return r;
} | [
"function mod(x, n) {\n return (x % n + n) % n;\n}",
"function mod(x,n) {\r\n var ans=dup(x);\r\n mod_(ans,n);\r\n return trim(ans,1);\r\n }",
"function inverseMod(x,n) {\r\n var ans=expand(x,n.length);\r\n var s;\r\n s=inverseMod_(ans,n);\r\n return s ? trim(ans,1) : null... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clear the summary, except for any prefixes of the form "[bracketed text]" or "keyword:". If there were any, add a trailing space. This is useful to people who like to encode issue classification info in the summary line. | function TKR_keepJustSummaryPrefixes(s) {
var matches = s.match(/^(\[[^\]]+\])+|^(\S+:\s*)+/);
if (matches == null) {
return '';
}
var prefix = matches[0];
if (prefix.substr(prefix.length - 1) != ' ') {
prefix += ' ';
}
return prefix;
} | [
"function closeSummary(){\n $scope.showSummary = false;\n $scope.summary = '';\n $scope.message = '';\n }",
"updateSummary() {\n const summary = this.details.drupalGetSummary();\n this.detailsSummaryDescription.html(summary);\n this.summary.html(summary);\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a boolean indicating if the given quaternion is identity | static IsIdentity(quaternion) {
return (quaternion &&
quaternion.x === 0 &&
quaternion.y === 0 &&
quaternion.z === 0 &&
quaternion.w === 1);
} | [
"isIdentity() {\n if (this._isIdentityDirty) {\n this._isIdentityDirty = false;\n const m = this._m;\n this._isIdentity =\n m[0] === 1.0 &&\n m[1] === 0.0 &&\n m[2] === 0.0 &&\n m[3] === 0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new GenericController from a gamepad | function GenericController(vrGamepad){return _super.call(this,vrGamepad)||this;} | [
"function touchController(){\n\t var e = document.createElement('div');\n\t \te.id=\"touchControlls\";\n\t\tdocument.body.appendChild(e);\n\t \n\t var touchCont = $('#touchControlls');\n\t var leftKey = document.createElement('div');\n\t \tleftKey.id=\"left\";\n\t\tleftKey.setAttribute('class','to... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
avocados jump out of a random bowl (1 to 6) | function randomBowl(bowls){
const index = Math.floor(Math.random()* bowls.length);
const bowl = bowls[index];
if (bowl === lastBowl){
return randomBowl(bowls);
}
lastBowl = bowl;
return bowl;
} | [
"function randomGoal() {\n goal = Math.floor(Math.random() * 100 + 20);\n}",
"jumpToRandom(){\n\t\tthis.coinCount -= 5;\n\t\tthis.updateCoinCount();\n\t\tconst randomTile = Math.floor(Math.random()*40 +1);\n\t\tthis.currentPosition = randomTile;\n\t\tthis.movePiece();\n\t\t$('.resultmessage__container').html(`... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
console.log(letFunction('statement')); Given a array of numbers, write a function classifyingNumbers that returns a category for each number in an object. | function classifyingNumbers() {
let array = [1, 2, 3, 4, 5];
let object = {...[1, 2, 3, 4, 5]};
return object;
} | [
"function cookingByNumbers(arr) {\n\tlet num = arr.shift();\n\tfor (let i = 0; i < arr.length; i++) {\n\t\tnum = perform(num, arr[i]);\n\t\tconsole.log(num);\n\t}\n\n\tfunction perform(num, operation) {\n\t\tswitch (operation) {\n\t\tcase 'chop':\n\t\t\treturn num / 2;\n\t\tcase 'dice':\n\t\t\treturn Math.sqrt(num)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
convert an absolute path to a relative path, relative to the opensearchdashboards repo | getRelative(absolute) {
return _path.default.relative(this.opensearchDashboardsProject.path, absolute);
} | [
"getAbsolute(...subPath) {\n return _path.default.resolve(this.opensearchDashboardsProject.path, ...subPath);\n }",
"function relatizePath(path) {\r\n\t\tif ('string' !== typeof path && 'function' === typeof path.getAttribute)\r\n\t\t\tpath = path.getAttribute('d');\r\n\t\treturn Raphael.pathToRelative(path).... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
:: name: string decoder: Decoder | constructor(name /*: string*/, decoder /*: Decoder<mixed, a>*/) {
this.name = name
this.decoder = decoder
} | [
"constructor(index /*: number*/, decoder /*: Decoder<mixed, a>*/) {\n this.index = index\n this.decoder = decoder\n }",
"function decode(content, encoding, decoder = \"text\") {\n if (encoding) {\n content = Buffer.from(content, encoding).toString();\n }\n switch (decoder) {\n case \"json\":\n tr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sort Type Groups by start / duration / start > duration | function sortPriorityGroup(group, type) {
String.prototype.toInt = function () {
return this.split(":").join("");
};
if(type === 0 || type === 3) {
group.sort(function (a,b) {
return a.time.start - b.time.start;
});
} else if (type === 1) {
group.sort(functio... | [
"function sortByDuration(a, b) {\n var durA = a.get(\"end\").getTime() - a.get(\"start\").getTime();\n var durB = b.get(\"end\").getTime() - b.get(\"start\").getTime();\n return durA - durB;\n }",
"sortSequence () {\n this.sequence.sort(function (a, b){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
El objetivo de este fichero es crear la clase objetoAjax (en JavaScript a las clases se les llama prototipos) | function objetoAjax(metodo) {
/*Primero necesitamos un objeto XMLHttpRequest que cogeremos del
constructor para que sea compatible con la mayorรญa de navegadores
posible. */
this.objetoRequest = new ConstructorXMLHttpRequest();
this.metodo = metodo;
} | [
"constructor() {\n this.xmlhttp = new XMLHttpRequest();\n }",
"function IAjaxCloneable() {}",
"function getCategorias(){\n $.ajax({\n url:ruta, // la URL para la peticiรณn\n data:\"categoria=null\",\n type: 'POST', // especifica si serรก una peticiรณn POST o GET\n dataType:... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Automatically generated. Tests for the `Range` constructor of the `:exceptioninfo` type. | function range_ques_(exception_info) /* (exception-info : exception-info) -> bool */ {
return (exception_info._tag === _tag_Range);
} | [
"function offsetShouldThrowOnInvalidElement() {\n expect(() => {\n element.offset(\"invalid\")\n }).toThrow(\n new TypeError(\"Invalid element: 'invalid'\"))\n}",
"inRangeIdea (num, start, end) {\n let startRange\n let endRange\n if (!end) {\n startRange = 0\n endRange = start\n } el... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to get user npm config input | function getUserNpmInput() {
console.log('');
const npmrcPath = __dirname + '/../.npmrc';
const yarnPath = __dirname + '/../.yarnrc';
const npmRegExp = {
name: /init[.-]author[.-]name =? ?["']?([^"']*)["']?\n/,
email: /init[.-]author[.-]email =? ?["']?([^"']*)["']?\n/,
url: /i... | [
"function readConfig (argv) {\n return new BB((resolve, reject) => {\n const npmBin = process.platform === 'win32' ? 'npm.cmd' : 'npm'\n const child = spawn(npmBin, [\n 'config', 'ls', '--json', '-l'\n // We add argv here to get npm to parse those options for us :D\n ].concat(argv || []), {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Used by EventTargetoff Removes the passed in handler from the array of handlers or removes all handlers if handler is undefined. Deletes the array of handlers if it is empty after handlers have been removed. | function removeSelectorHandler(selectorHandlers, selector, handler) {
var handlers = selectorHandlers[selector];
if (handlers) {
if (handler) {
for (var i = 0; i < handlers.length; i++) {
if (handlers[i].f === handler) {
handlers.splice(i--, 1); // Use i-- so i has the same value when th... | [
"remove(handler) {\n // de-register all of its event types\n for (let et of handler.eventsHandled()) {\n this.deregister(et, handler);\n }\n // remove it from our list\n this.handlers.splice(this.handlers.indexOf(handler), 1);\n }",
"off... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generator that yields a path recursively when it has not been visited | * __pathsGenerator(path, node) {
const endingSlash =
(node.children.length > 0 || node.endsWithSlash) ? '/' : '';
const currentPath = path + node.name + endingSlash;
if (!node.visited) {
yield currentPath;
node.visited = true;
}
for (const child of node.children) {
yield * ... | [
"*ancestors(root, path) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n for (var p of Path.ancestors(path, options)) {\n var n = Node$1.ancestor(root, p);\n var entry = [n, p];\n yield entry;\n }\n }",
"get nextPath() { return th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Total spend by role using joins and derived tables | function totalRole() {
connection.query("SELECT Title, SUM(SalaryTotal) as 'Total Spend by Role' FROM ( SELECT title as Title, SUM(salary) as SalaryTotal, name as Department FROM employee LEFT JOIN role ON employee.role_id = role.id LEFT JOIN department ON role.department_id = department.id GROUP BY role_id) derived_... | [
"function sumOfIncomeAndExpense() {\n console.log(`Sum of withdrawal\n ${transactions\n .filter((record) => record.type === \"withdrawal\")\n .reduce((sum, record) => sum + record.amount, 0)}\n `);\n console.log(`Sum of deposit\n ${transactions\n .filter((record) => record.type === \"deposit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adding the capability to hide/show narrow nav menus. | function navNarrowMenuDisplay() {
// Get the target element ID.
$('[data-show-target]').click(function(event) {
// The "trigger" element that was selected.
var triggerElement = event.target;
// The target menu to "show".
var targetId = $(triggerElement).data('showTarget');
var $target = $(targ... | [
"toggleMenu() {\n\n /* conditional check to figure out wheter to add or remove 'hidden' and replacing it with 'block', or the other way around */\n if ($('nav.nav').hasClass('hidden')) {\n $('nav.nav').removeClass('hidden');\n $('nav.nav').addClass('block');\n } else {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION: extPart.getWhereToSearch DESCRIPTION: get whereToSearch value from ext data ARGUMENTS: partName ext data participant filename RETURNS: whereToSearch string | function extPart_getWhereToSearch(partName)
{
return dw.getExtDataValue(partName, "searchPatterns", "whereToSearch");
} | [
"function extPart_getQuickSearch(partName)\n{\n return dw.getExtDataValue(partName, \"quickSearch\");\n}",
"function extPart_findInString(partName, theStr, findMultiple)\n{\n var retVal = null;\n var searchPatts = extPart.getSearchPatterns(partName);\n var quickSearch = extPart.getQuickSearch(partName);\n if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This methods splits the parentNodes if it refers to an Inline styling elements In this approach, recursion continues so long we have a direct encapsulation of 'inline styling' ancestors | function splitDomRecursive(/*CKEDITOR.dom.range*/ range, /*CKEDITOR.dom.element*/ parentNode, /*CKEditor.style*/ style, editor){
if(parentNode.type === CKEDITOR.NODE_ELEMENT && parentNode.getName){
var parentName = parentNode.getName();
var newParent, newRange;
switch(parentName){
... | [
"parent() {\n\t const parents = [];\n\t this.each(el => {\n\t if (!parents.includes(el.parentNode)) {\n\t parents.push(el.parentNode);\n\t }\n\t });\n\t return new DOMNodeCollection(parents);\n\t }",
"continue() {\n let parent = this.node.parent\n return parent ? indent... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cache all files in public folder | async function cacheFiles() {
const files = await io.readdir(PUBLIC_FOLDER);
const readPromises = [];
files.forEach(file =>
readPromises.push(io.readFile(`${PUBLIC_FOLDER}/${file}`)
.then(data => filesCache.set(file, data))
.catch(err => err) // prevent breaking on rejection... | [
"async function cacheResources() {\n const cache = await caches.open(STATIC_CACHE);\n await cache.addAll(FILES_TO_CACHE);\n return self.skipWaiting();\n}",
"function loadFileCache() {\n\tcachedFileInfo = getLocalSetting(\"cachedFileInfo\", {});\n}",
"static instances(){\n return Object.keys(__cache).map(p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Automatically generated. Tests for the `Pattern` constructor of the `:exceptioninfo` type. | function pattern_ques_(exception_info) /* (exception-info : exception-info) -> bool */ {
return (exception_info._tag === _tag_Pattern);
} | [
"infoFail(message, metadata, metadataStyles) {\n let _messageType15 = t.string();\n\n let _metadataType17 = t.nullable(t.object());\n\n let _metadataStylesType16 = t.nullable(t.object());\n\n t.param('message', _messageType15).assert(message);\n t.param('metadata', _metadataType17).assert(metadata);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Once a CSlevel and startDate have been selected, select the most likely salary from the dropdown Called from init when startDateTxt has changed, and from populateSalary if startDateTxt is a date () I don't get it. What's the difference btween selectSalary and getSalary? They both start the same way: get the startDateTe... | function selectSalary () {
//if (!(levelSelect.value > 0 && levelSelect.value <= 5))
if (parts && levelSel.value >0 && levelSel.value <= 5) { // if you have a start date, and a CS-0x level
let startDate = getStartDate();
startDateTxt.value = startDate.toISOString().substr(0,10)
let timeDiff = (TABegin - st... | [
"function populateSalary () {\r\n\tremoveChildren(stepSelect);\r\n\tif (levelSel.value >0 && levelSel.value <= 5) {\r\n\t\tcreateHTMLElement(\"option\", {\"parentNode\":stepSelect, \"value\":\"-1\", \"textNode\":\"Select Salary\"});\r\n\t\tfor (var i = 0; i < salaries[(levelSel.value-1)].length; i++) {\r\n\t\t\tcre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
redis commands grouped using `multi` or `pipeline` may yield errors per result. this helper checks each result for errors and combines them into a single error that can be handled | _validateMultiResults (results, callback) {
const errors = results.map(result => result[0])
if (errors.some(error => !!error)) {
callback(new Error(`${compact(errors)}`))
} else {
callback()
}
} | [
"_getErrors() {\n this._client.lpopAsync(this._queueName + ERRORS_QUEUE_TAG).then((reply) => {\n if (reply === null) {\n this._log('All errors processed');\n this.stop();\n this._closeConnection();\n } else {\n this._log(reply)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse the given string into a BingoBoard. | static parse(boardAsString) {
const items = [];
const rows = boardAsString.trim().split(/\s*\n\s*/);
for (var i = 0; i < rows.length; i++) {
const values = rows[i].split(/\s+/);
for(var j = 0; j < rows.length; j++) {
items.push(new BingoBoardItem(Number(v... | [
"function parseBoard() {\n var result = \"\\n 1 2 3\\na\";\n for (x in board) {\n for (y in board[x]) {\n if ((y + 1) % 3 != 0 || (x + 1 == 1 && y + 1 == 1)) {\n result += board[x][y] + \"|\";\n } else {\n if (y == 2 &... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
filterizer takes arg for order to sort results in. Finds recipes based on the four filter options. | function filterizer (e) {
setCurrentPage(1)
let filteredRecipeList = recipes
for (const [k] of Object.entries(filter)) {
if(k === "style") {filter.style !== "All" && (filteredRecipeList = filteredRecipeList.filter(r => r.styles[0].id === parseInt(filter.style)))}
if(k === "fermentable") {filter.... | [
"function filterList() {\n\tevent.preventDefault();\n\n\trecipeID = [];\n\tvar fSearch = document.getElementById(\"filterSearch\");\n\tvar fDiet = document.getElementById(\"dietOptions\");\n\tvar fExcluded = document.getElementById(\"exclIngr\");\n\tvar fAllergy = document.getElementById(\"allergyOptions\");\n\tvar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Chapter 101 RopeGroup Release the twin on the right | function C101_KinbakuClub_RopeGroup_ReleaseTwin() {
if (C101_KinbakuClub_RopeGroup_CurrentStage == 400) C101_KinbakuClub_RopeGroup_LeftTwinStatus = "Released";
else C101_KinbakuClub_RopeGroup_RightTwinStatus = "Released";
if (ActorGetValue(ActorName) == "Lucy") C101_KinbakuClub_RopeGroup_LucyFree = true;
C101_Kinba... | [
"function rally(winner) {\n court.rally(winner);\n}",
"function C101_KinbakuClub_RopeGroup_WillLucyTie() {\n\tif (ActorGetValue(ActorLove) >= 3 || ActorGetValue(ActorSubmission) >= 2) {\n\t\tOverridenIntroText = GetText(\"LucyNotTieYou\");\n\t\tC101_KinbakuClub_RopeGroup_CurrentStage = 600;\n\t} else C101_Kinb... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function countConcepts() returns an array of each unique concept in summaryLinks (subjects and objects) with its count as either subject or object | function countConcepts() {
var counts = [];
for (var i = 0; i < summaryLinks.length; i++) {
for (var j = 0; j < summaryLinks[i].predicate.length; j++) {
// subject
var conceptFound = findConcept(summaryLinks[i].source, counts);
if (conceptFound == -1) { // predication not found
var count1 = [... | [
"function getCountedObjects(){\n var counted = {};\n for (var i = 0; i < detections.length; i++){\n var lbl = detections[i].label;\n if (!counted[lbl]) counted[lbl] = 0;\n counted[lbl]++;\n }\n return counted;\n}",
"function saliency() {\n\n\tvar conceptCount = countConcepts(); // go through each pre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
method that validates & sanitizes the user input for fasta targets: | function validate_fasta(fasta) {
//split fasta data into multiple fasta targets:
var fasta_targets = fasta.split("\n>");
var added_tars = [];
var errors = [];
angular.forEach(fasta_targets, function(fasta_target, index) {
// prepend ">" which was trimmed during the split to the... | [
"function checkDNA (seq1, seq2) {\n\n}",
"function comprobarAlias(a) {\n var contAlias = a.value;\n var expresionAlias = /^[A-Z,a-z,0-9]{3,14}$/;\n\n if(comprobarExpresion(a, expresionAlias)==true){\n validado[1] = true;\n if(debug){\n console.log(\"Validado 1=> \"+validado[1]);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Applies hour budgets in sheet to tasks which do not yet have hour budgets. Logic flow: get all tasks for a project store task id's in an array don't store tasks with hour budgets for each task without hours lookup the task's name, store that in the array don't store tasks which are defaults loop through the sheet, matc... | function updateProjectTaskHours() {
var error = checkControlValues();
if (error != "") {
Browser.msgBox("ERROR:Values in the Controls sheet have not been set. Please fix the following error:\n " + error);
return;
}
var successCount = 0;
var result = JSON.parse(getProjectTasks());
... | [
"function sortTasks() {\n var sheet = SpreadsheetApp.getActiveSheet();\n var data = sheet.getDataRange().getValues();\n var totalRowCount = data.length;\n\n var toDoTasks = [];\n var backlogTasks = [];\n var doneTasks = [];\n\n var headerRowSheetIndex = 1;\n for (var i = 0; i < data.length; i++) {\n if (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new Object3D instance | function Object3D() {
_super.call(this);
this._castShadows = true;
this.matrix = new Trike.Matrix4();
this.worldMatrix = new Trike.Matrix4();
this.disposed = false;
this._modelViewMatrix = new Trike.Matrix4();
this._normalMatrix = new T... | [
"function create_3dView() {\n var scene = new WebScene({\n portalItem: {\n id: \"159d275b250b4db1978a728bd20fa2ec\"\n }\n });\n\n var view = new SceneView({\n map: scene,\n container: \"globe\"\n })\n }",
"function Container3d() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns all the reviewers, including owner for a CL that match a filter. | filterReviewers(filter) {
var codeReviewLabel = this.json_.labels['Code-Review'];
return ((codeReviewLabel && codeReviewLabel.all) || [])
.filter(function(reviewer) {
return !!reviewer._account_id && filter(reviewer);
});
} | [
"async function authorFilter(bookToFilter){\n const authorBooks = bookToFilter.filter(book => book.author.name === args.author)\n \n return authorBooks\n }",
"function classFilter(owner) {\r\n\t const name = getDisplayName(owner);\r\n\t return (name !== null && !!(filter.in... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
3.2.2. Folding White Space and Comments FWS = ([WSP CRLF] 1WSP) / obsFWS | function fws() {
return wrap('fws', or(
obsFws,
and(
opt(and(
star(wsp),
invis(crlf)
)),
star(wsp, 1)
)
)());
} | [
"function isNsfw(text) {\n return text.toLowerCase().indexOf(\"nsfw\") != -1;\n}",
"function expand_spaces(message)\r\n{\r\n var exclude_open = new Array(\"[code]\", \"[pre]\", \":[\", \":/\");\r\n var exclude_close = new Array(\"[/code]\", \"[/pre]\", \"]:\", \"/:\");\r\n var open, close;\r\n var co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Definition and Implementation for ProgressSection Object Constructor | function ProgressSection(title, start, end, numSteps, fractionOfParentStep) {
this.start = start;
this.end = end;
this.numSteps = numSteps;
this.fractionPerStep = (end-start)/numSteps;
this.stepsComplete = 0;
this.curStepFractionComplete = 0;
this.fractionOfParent = fractionOfParentStep;
this.title = ti... | [
"function Task (number, taskName, startDate, endDate, progress) {\n\t\tthis.number = number; \n\t\tthis.taskName = taskName; \n\t\tthis.startDate = startDate;\n\t\tthis.endDate = endDate;\n\t\tthis.progress = progress;\n\t\tthis.details = \"Task Details\" + \"\\n\" + \n\t\t\t \"Name: Lorem ipsum dolor si... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create multi range slider | function createMultiRangeSlider(inputRange) {
var data4Slider = [], maxRange = 0, inputRangeLen = inputRange.length;
// Generate data for slider
for (var i = 0; i < inputRangeLen; i++) {
maxRange += inputRange[i];
data4Slider.push(maxRange);
}
if (rangeSlider != 0) {
// slider already created
rangeSlider.n... | [
"function createSlider() {\n\n //the value that we'll give the slider - if it's a range, we store our value as a comma separated val but this slider expects an array\n var sliderVal = null;\n\n //configure the model value based on if range is enabled or not\n if ($scope.model.config.enab... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`getActions()` returns all actions from the db | function getActions() {
return db('actions');
} | [
"getActions() {\n return Object.keys(this.actions)\n .map(a => this.actions[a]);\n }",
"get taskActions(){\r\n\t\treturn this.cache('taskActions', function(data){\r\n\t\t\treturn data \r\n\t\t\t\t|| this.actions.filter(this.isTask.bind(this)) }) }",
"function getActiveActions() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PRIVATE Build keyframes from geojson features. | _createFrames() {
const features = this.options.features;
// get sorted list of dates
const dates = features.map(f => new Date(f.properties[this.options.timeKey])).sort((a,b) => a - b );
// uniq list of ISO strings
this._times = [...new Set(dates.map(d => d.toISOString()))];
this._frameLayers = {};
t... | [
"getGeoJson(mode) {\n const stops = this.getGeoJsonStops(mode).features;\n const edges = this.getGeoJsonEdges().features;\n \n // Append the edge features to the stop features\n const geoJson = stops.concat(edges);\n \n return {\n 'type': 'FeatureCollection',\n 'features': geoJson\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
initialises spectron for e2e test | function initialiseSpectron () {
let electronPath = path.join(__dirname, '..', 'node_modules', '.bin', 'electron')
const appPath = path.join(__dirname, '..')
if (process.platform === 'win32') {
electronPath += '.cmd'
}
return new Application({
path: electronPath,
args: [appPath],
env: {
... | [
"function initSimon() {\n $('[data-action=start]').on('click', startGame);\n\n }",
"function init() {\n checkBiquadFilterQ().then(function(flag) {\n hasNewBiquadFilter = flag;\n context = new AudioContext();\n hasIIRFilter = context['createIIRFilter'] ? true : false;\n });\n\n const magStyle... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find inspections that include search term | function filterItems() {
//console.log(inspections)
return inspections.filter(function(inspection) {
return inspection.address.toLowerCase().indexOf(search.toLowerCase()) !== -1 || inspection.permit_id.toLowerCase().indexOf(search.toLowerCase()) !== -1
})
} | [
"function search1(searchTerm) {\n let docsWithTerm = []\n let reportsWithTerm = []\n let selectedReports = []\n docToRep = {}\n\n Object.keys(store.page).forEach(page => {\n if (page.body.includes(searchTerm) || page.footnote.includes(searchTerm)) {\n docsWithTerm.push(page.document... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Run through a subreddit's RSS feed and keep downloading items until either: 1. there's nothing left to download, or 2. we caught up to what we downloaded last time. | async function catchUp(whenDone, subreddit, since, lastId) {
console.log(
`Catching up on ${subreddit.base}${lastId ? ` before ${lastId}` : ``}`
);
// Get the RSS feed:
let url = `https://www.reddit.com/r/${subreddit.base}.rss?limit=50`;
if (lastId) url = `${url}&after=${lastId}`;
let feed;
try {
... | [
"function startdownload()\n{\n\tdl_settimer(-1);\n\n\tif (downloading)\n\t{\n\t\tif (d) console.log(\"startdownload() called with active download\");\n\t\treturn;\n\t}\n\n\tif (dl_queue_num >= dl_queue.length) dl_queue_num = dl_queue.length-1;\n\t\n\tif (dl_queue_num < 0)\n\t{\n\t\tif (d) console.log(\"startdownloa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Allow `appAttributes` to be a function for lazyinstantiation based on `req` and `res`. | function getAppAttributes(attrs, req, res) {
if (typeof attrs === 'function') {
attrs = attrs(req, res);
}
return attrs || {};
} | [
"mountOnto(expressApp) {\n this.routes.forEach(route => {\n const method = route.method.toLowerCase();\n const handler = makeExpressHandler(this.appId, route.handler);\n expressApp[method].call(expressApp, route.path, handler);\n });\n return expressApp;\n }",
"function handle_init_app(re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete the bill by billId. | function deleteBill(billId)
{
KptApi.confirm(messages.deleteMsg, function(){
$.mvcAjax({
url : "Order.do?cmd=deleteOrderAjax",
data : {billId: billId},
dataType: 'json',
success : function(data, ts)
{
if (data.result.resultCode == result.FAIL)
{
KptApi.showError(data.result.resultMsg);
... | [
"function deleteButton() {\n const idToDelete = $(this)\n .parent()\n .attr('data-id');\n console.log(idToDelete);\n\n API.deleteBill(idToDelete).then(() => {\n refreshBillList();\n });\n}",
"deleteById(id) {\n return this.del(this.getBaseUrl() + '/' + id);\n }",
"function deleteDebtByID(token,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return if a square with side length size at x,y overlaps any obstacles | onObstacle(x, y, size) {
for (var i = 0; i < this.obstacles.length; i++) {
var squareTopLeft = new Pair(x, y);
var squareBottomRight = new Pair(x+size, y+size);
var obstacleRect = this.obstacles[i].rectangle;
var overlap = this.getOverlap(squareTopLeft, squareBottomRight, obstacleRect.top_left, obstacleRe... | [
"function checkShipIntersection(){\n var placementFootPrint = 0,\n rowForThisFunc = row,\n colForThisFunc = col;\n\n if (isHorizontal) {\n for(var i = 0; i < shipLength; i++) {\n placementFootPrint += gameBoard[rowForThisFunc][colForThisFunc];\n colForThisFunc++;\n }\n } else {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
MantisLink / / Appends the location of the page and open the given url in a new window. / The url to open | function MantisLink(UrlString)
{
var location = new String(window.top.location).toLowerCase();
location = location.substring(location.indexOf("components"));
var description = "A test in the test framework failed.\nSee it on QA:\nhttp://qa/tests/" + location;
description = description + "\nor on your local machin... | [
"function openLocationInfo(){\n\tvar myWindow=window.open(\"\",\"\",\"width=1000,height=300\");\n\tmyWindow.document.write(\"Site is hoasted on: \" + location.host + \"(\"+ location.hostname + \":\" + (location.port ? location.port : \"?\") + \")<br>\");\n\tmyWindow.document.write(\"Site URL: \"+ location.href + \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Names of people a person follows | function follows (pId, socialData) {
var follows = socialData[pId].follows;
var namesFollows = [];
follows.forEach(function(element) {
namesFollows.push(printName(element, socialData));
});
return namesFollows;
} | [
"function followers(){\n for(var person in data){\n var followersString = \"\";\n followersString += data[person].name + \" follows \";\n data[person].follows.forEach(function(follower, index, followers){\n if(index === followers.length - 1 && index !== 0){\n followersString += \"and \";\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParsertype_function_spec. | visitType_function_spec(ctx) {
return this.visitChildren(ctx);
} | [
"visitType_procedure_spec(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function parseType() {\n var id;\n var params = [];\n var result = [];\n\n if (token.type === _tokenizer.tokens.identifier) {\n id = identifierFromToken(token);\n eatToken();\n }\n\n if (looka... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return energy, optionally formatted | function getEnergy(num, power, secs, formatted){
var e = num * power * secs / 100;
var units = ['','k','M','G','T','P','E'];
var i = 0;
while(e>100){
e /= 1000;
i ++
}
if(formatted)
return e.toFixed(2) + ' ' + units[i];
return num * power * secs / 100;
} | [
"getEnergyPercent() {\n return this.getNetEnergy() / this.maxEnergy\n }",
"getNetEnergy() {\n return this.maxEnergy - this.fatigue\n }",
"function wettingFastOutput(){\r\n\r\n var outstring = \"Wetting Fast with parameter ฮถ = \" + paramZeta + \", parameter ฮด = \" + paramDelta +\r\n \" and paramete... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the calculated license and image Possible licenses: 'ccby' 'ccbysa' 'ccbynd' 'ccbync' 'ccbyncsa' 'ccbyncnd' 'cc0' 'reserved' | function _updateLicense() {
var s = _shareSettings.sharing;
var a = _shareSettings.adaptations;
var c = _shareSettings.commercial;
if (s == 'cc0' || s == 'reserved') {
_license = s;
} else
{
_license = 'cc-by';
if (c == 'no') {
_license += '-nc';
}
if (a == 'no') {
_license += '-nd';... | [
"function changeCopyRight()\n{\n console.log(\"\\tStart changeCopyRight\");\n var i;\n\n var name = \"\";\n var short = \"\";\n var url = \"\";\n var image = \"\";\n\n console.log(\"\\t\\tOpgegeven licence in config is [\" + respecConfig.licence + \"]\");\n if( respecConfig.licence != null)\n {\n var... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Classes definitions MOUSE CLASS This class handles status and event for the mouse input | function __Mouse() {
this.x = 0;
this.y = 0;
this.xWin = 0;
this.yWin = 0;
this.button = __config.nullString;
this.target = __config.nullString;
this.evnt = __config.nullString;
// this function set the status of the mouse on each event
this.fire = function(e) {
/... | [
"implementMouseInteractions() {\t\t\n\t\t// mouse click interactions\n\t\tthis.ctx.canvas.addEventListener(\"click\", this.towerStoreClick, false);\n\t\t\n\t\t// mouse move interactions\n\t\tthis.ctx.canvas.addEventListener(\"mousemove\", this.towerStoreMove, false);\t\n\t}",
"grabbingState (input) {\r\n this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes the element from a page if a property is true. Opposite of keepIf. Example: `` | function removeIf(el, property) {
var binding = this
, parent = el.parentNode
binding.change(function() {
var value = binding.value(property)
if (value && el.parentNode) {
el.parentNode.removeChild(el)
} else if (value && !el.parentNode) {
parent.appendChild(el)
}
});
} | [
"function keepIf(el, property) {\n var binding = this\n , parent = el.parentNode\n\n binding.change(function() {\n var value = binding.value(property)\n if (!value && el.parentNode) {\n el.parentNode.removeChild(el)\n } else if (value && !el.parentNode) {\n parent.appendChild(el)\n }\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
createElementEditor creates a text box and update button pair based on the arguments: name: specifies the property name target: specifies the target reference with the property | function createElementEditor(name, target) {
var content = target[name];
//Create the wrapper element
var wrapper = $.create('div');
//Create the header element (shows the property name)
var header = $.create('div');
header.innerHTML = name;
//Create the input field element
var textbo... | [
"createEditButton(index) {\n let scope = this;\n let editButtonElement = document.createElement('button');\n editButtonElement.className = cssConstants.ICON + ' ' + cssConstants.BUTTON_EDIT_DATA;\n editButtonElement.title = langConstants.METADATA_EDIT;\n editButtonElement.setAttribute('feat_id', inde... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call fn(value, prop, path) on all '.props' and assiging the value back into the validator. | function mapValidator(v, fn, scope, path) {
if (!scope) {
scope = {};
}
if (!path) {
path = new ast.PathTemplate();
}
if ('.scope' in v) {
scope = v['.scope'];
}
for (var prop in v) {
if (!v.hasOwnProperty(prop)) {
continue;
}
if (p... | [
"function isPropValid()\n{\n\n}",
"function CfnResolverPropsValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('E... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
should be used of every tree table to extend the presentation items the method 'addPresentationAttributesToItemFromEntity' should be used defaultCollapsed: normally the trees are all collapsed, but if u want another default behaviour and have the tree all open, u can defaultCollapsed as false | generateDataViewTreeItem (entity, id, pParent, isLeaf, defaultCollapsed) {
let item = this.dataView ? this.dataView.getItemById(id) : null
let treeItem = this.generateDataViewItem(entity, id)
treeItem.level = pParent ? pParent.level + 1 : 0
treeItem.isCollapsed = item ? i... | [
"function itemTree() {\n return col('col-12 col-xl-3', \n div('itemTree', itemTreeTitle() + '<hr>' + itemTreeChange() + '<hr>' + itemTreeTree() + '<hr>' + itemTreeAdd())\n )\n}",
"function setChildrenVisibleState(item) {\n if (typeof item.ChildrenVisible == \"undefined\" || item.ChildrenVi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
deselect stuff when the mouse leaves | function on_mouse_out_editor()
{
// deselect things on it
editor_deselect(editor_context);
} | [
"function mouseouthandler(event) {\n //console.log(\"the mouse is no longer over canvas:: \" + event.target.id);\n mouseIn = 'none';\n }",
"function unselectFeature() {\n if (highlight) {\n highlight.remove();\n }\n }",
"function _mouseLeave(e) {\r\n mouse.posX = 0;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function creates special monster | function createSpecialMonster(x, y) {
console.log("create special");
var monster = svgdoc.createElementNS("http://www.w3.org/2000/svg", "use");
monster.setAttribute("x", x);
monster.setAttribute("y", y);
if (Math.floor(2* Math.random()) == 0){
monster.speed = MONSTER_SPEED;
monster.c... | [
"function createMob() {\n var rand = Math.random();\n var tear = 1;\n if (rand < 0.5) {\n tear = 1;\n } else if (rand < 0.8) {\n tear = 2;\n } else if (rand < 0.95) {\n tear = 3;\n } else {\n tear = 4;\n }\n enemy = new Monster(LEVEL, tear);\n updateMob();\n}",
"function createMonsters(number... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
tell the scheduler that `count` jobs arrived and were started | function startJobs( scheduler, type, count ) {
for (var i=0; i<count; i++) {
scheduler.waiting(type);
scheduler.start(type);
}
} | [
"function triggerActions(count) {\n const queue = [];\n\n const cb = (msg) => {\n // console.log(msg);\n const node = document.createElement(\"div\");\n node.innerHTML = `<div>${msg}</div>`;\n document.getElementById(\"app\").appendChild(node);\n const next = queue.shift();\n if (next) next();\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the play mode to sequential, resuming from where it left off (if still playing) using a new speed | newSequenceSpeed() {
this.stop()
this.playMode = PlayModes.SEQUENCE
this.playInterval = window.setInterval(() => {
if (this.playIndex >= this.stateSequence.length) this.playIndex = 0
this.setDialsDirect(this.stateSequence[this.playIndex++])
}, this.createDelayFromSpeed())
} | [
"changePlayerMode() {\n this._inPlayerMode = !this._inPlayerMode\n this.reset()\n }",
"playNext() {\n\n // if it is the last chord of the sequence start again from the first one, otherwise go to the next one\n if (this.playing >= this.sequence.length - 1) {\n this.playing = 0; ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that verify the callback execution when the given event is triggered. | function callbackTriggerTests(context) {
it('should execute the provided callback when the keys that are entered match the key combination', function () {
var e = $.Event(context.type, { keyCode: context.keyCode, ctrlKey: context.ctrlKey, shiftKey: context.shiftKey, altKey: context.altKey});
... | [
"function fireCallback(eventName,v){var eventData=getEventData(eventName,v);if(!options.v2compatible){trigger(container,eventName,eventData);if(options[eventName].apply(eventData[Object.keys(eventData)[0]],toArray(eventData))===false){return false;}}else{if(options[eventName].apply(eventData[0],eventData.slice(1))=... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
count number of unique brands and display on card | function BrandCount() {
const results_arr = [...new Set(sneakers.map(sneakers => sneakers.Brand))]; //set collects all the unique values. (...) spreads the values in an array. map returns a list of the property values of Brand
var brandNum = results_arr.length; //get length of results array to get number of ... | [
"function showBrandCounts(items){\n\t\"use strict\";\n\tvar brand1= 0;\n\tvar brand2 = 0;\n\tvar brand3 = 0;\n\tvar brand4 = 0;\n\tfor (var i = 0; i < items.length; i++) {\n\t\tif ((items[i].getElementsByTagName(\"brand\")[0].childNodes[0].nodeValue) === \"Armani\") {\n\t\t\tbrand1++;\n\t\t}\n\t\tif ((items[i].get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
import math def isPrime(n): if (n % 2 == 0): return (n == 2) start at 3, go up to sqrt(n) + 1 step of 2 to only cycle thru odd numbers for i in range(3, int(math.sqrt(n)) + 1, 2): if (n % i == 0): return False return True | function isPrime(n) {
if (n % 2 == 0) return (n == 2);
// start at 3, go up to sqrt(n) + 1
// step of 2 to only cycle thru odd numbers
for (let i = 3; i < Math.sqrt(n); i + 2) {
if (n % i == 0) {
return false;
}
}
return true;
} | [
"function is_prime(n)\n{\n let r, i;\n if ((n % 2) == 0)\n {\n return false;\n }\n\n r = Math.floor(Math.sqrt(n));\n for (i = 3; i <= r; i += 2)\n {\n if ((n % i) == 0)\n {\n return false;\n }\n }\n return true;\n}",
"function is_prime(n)\n{\n var r, i;\n if ((... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns the first obj with a prop === val | function obj_find(obj, prop, val) {
for (let k in obj) {
let v = obj[k]
if (v[prop] === val)
return v
}
return null
} | [
"function findFirstProp(objs, p) {\n for (let obj of objs) {\n if (obj && obj.hasOwnProperty(p)) { return valueize(obj[p]); }\n }\n}",
"function arr_find(arr, prop, val) {\n\treturn arr.find(v => { return v && v[prop] === val })\n}",
"function filter(obj, prop, val) {\n\tvar arr = []\n\tfor (var k in obj) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return near boxes which are in the map | function nearBoxes(x, y, mode, filterMode) {
if (typeof filterMode === 'undefined') {
var filterMode = FILTER_MODE_NONE;
}
var coordinates = nearCoordinates(x, y, mode);
// Filter coordinates that are out of map.
boxes = coordinates.filter(function(item) {
... | [
"function findCorners() {\n var corners = [];\n for (var y = 0; y < map.length; ++y) {\n for (var x = 0; x < map[y].length; ++x) {\n if (map[y][x] !== WALL) {\n var diagonalBoxes = nearBoxes(x, y, COORD_MODE_DIAGONAL);\n for (var i = 0; i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method called when component is disposed and removed from DOM | dispose() {
// Perfect place to remove eventlisteners etc
} | [
"static finishedRenderingComponent() {\n\t\trenderingComponents_.pop();\n\t\tif (renderingComponents_.length === 0) {\n\t\t\tIncrementalDomUnusedComponents.disposeUnused();\n\t\t}\n\t}",
"dispose() {\n this.context = null;\n\n // remove all global event listeners when component gets destroye... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
uu.canvas.VML class class Silverlight | function Silverlight(node) { // @param Node: <canvas>
Silverlight.init(this, node);
} | [
"function vml(tag,attr){return createEl('<'+tag+' xmlns=\"urn:schemas-microsoft.com:vml\" class=\"spin-vml\">',attr);}// No CSS transforms but VML support, add a CSS rule for VML elements:",
"function root(element, name)\r\n{\t\r\n\t/*-------------------------------------------------------------------------------... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if this script is running under nodejs | function is_nodejs() {
return (typeof process === 'object' &&
typeof process.versions === 'object' &&
typeof process.versions.node !== 'undefined');
} | [
"function assertNodeEnv() {\r\n return assert(isNode, 'This feature is only available in NodeJS environments');\r\n }",
"isOnServer() {\n return !(typeof window !== 'undefined' && window.document);\n }",
"function isNodeEnv(env) {\n return (\n typeof process !== \"undefined\" &&\n process... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
phrase: this is the actual phrase the Phrase object is representing. This property should be set to the phrase parameter, but converted to all lower case. | constructor (phrase) {
this.phrase = phrase.toLowerCase();
} | [
"phrase(phrase) {\n for (let map of this.facet(EditorState.phrases))\n if (Object.prototype.hasOwnProperty.call(map, phrase))\n return map[phrase];\n return phrase;\n }",
"phrase(phrase) {\n for (let map of this.facet(dist_EditorState.phrases))\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
_parseEvolutionConditions Parse the HTML in the conditions list from the flattened object. Currently this only successfully parses Level conditions Inputs: flattened See _flattenEvolutionTree for input format. Modified in place to extract condition information from html Outputs: None | static _parseEvolutionConditions(flattened) {
for(let e = 0; e < flattened.evolutions.length; e++) {
const condition = flattened.evolutions[e].condition;
const condText = condition.textContent;
/*
* for now, let's just parse for pokemon that e... | [
"static parseEvolutionTreeFromDexPage(evolutionTreeParser, html, dexIDMap) {\n const rootName = DexPageParser.getInfoFromDexPageHeader(html).name;\n const tree = html.find('.evolutiontree').eq(0);\n const flattened = evolutionTreeParser.parseEvolutionTree(rootName, tree, dexIDMap);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handler to imperatively update the value of a form field | function updateField(field, value) {
util.update(form, field, value);
} | [
"updateValue() {\n [...this.template.querySelectorAll('lightning-input')].forEach(\n (element) => {\n element.value = this._value;\n }\n );\n\n this._updateProxyInputAttributes('value');\n\n /**\n * @event\n * @name change\n * ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Executes `action` for each integer between `start` upto `end` (including both `start` and `end` ). If `start > end` the function returns without any call to `action` . If `action` returns `Just`, the iteration is stopped and the result returned | function for_while(start0, end, action) /* forall<a,e> (start : int, end : int, action : (int) -> e maybe<a>) -> e maybe<a> */ {
return _bind_for_while(start0, end, action);
} | [
"function _fast_for_while(start0, end, action) /* forall<a,e> (start : int, end : int, action : (int) -> e maybe<a>) -> e maybe<a> */ {\n function rep(i) /* (i : int) -> 16052 maybe<16051> */ { tailcall: while(1)\n {\n if ($std_core._int_le(i,end)) {\n var _x20 = action(i);\n if (_x20 == null) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a list of OrChoice objects from the given set of orchoice options. | populateOrChoices(orChoiceOptions) {
if (!this.props.combinatorContract || !orChoiceOptions) {
return [];
}
var orChoices = [];
var combinators = splitContract(this.props.combinatorContract);
var orIndex = 0;
for (var i = 0; i < combinators.length; i++) {
... | [
"function getChoices(chains) {\n return chains.map(chain => {\n const name = text_transform_1.TextTransform.padText(chain.name, 25);\n const description = chain.description ? ` ${text_transform_1.TextTransform.ellipsis(chain.description, 50)}` : '';\n const collection = description ? text_tr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new ActiveUser instance. Parameters: id: int caret: Caret colour: string | constructor(id, caret, colour) {
this.id = id;
this.caret = caret.copy();
this.colour = colour;
} | [
"copy() {\n return new ActiveUser(this.id, this.caret, this.colour);\n }",
"function CreateUser(name, age) {\n\tthis.name = name;\n\tthis.age = age;\n}",
"function createInactiveUser(name, admin, email, password, members, callback){\n\n var hashPass = require('crypto')\n .createHash('sha1')\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION CHE GENERA UN'ARRAY CON ALL'INTERNO I 'type' CHE UTILIZZEREMO PER INDICARE QUALI ICONE DEVONO CAMBIARE COLORE | function genTipo(icons) {
//CREIAMO UN NUOVO ARRAY VUOTO CHE POPOLEREMO CON UN LOOP DI TIPO FOREACH
const tipi = [];
//LOOP SULL'ARRAY DI 'ICONS'
icons.forEach( (icon) => {
//SE GLI OGGETTI CONTENUTI ALL'INTERNO DELL'ARRAY 'tipi'' NON HANNO L'ATTRIBUTO 'type', PUSHIAMOLO DENTRO TRAMITE UN IF
... | [
"function light_array_creator(light_constructor){\n arr = [];\n for(i = 0; i < 1000; i++){\n arr.push([])\n for(j = 0; j < 1000; j++){\n arr[i].push(new light_constructor);\n }\n }\n return arr;\n}",
"function colunaComoLinha(coluna) {\n var elems = [];\n for (var i = 0; i ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
EXPORT / IMPORT triggers the export route to GPX function | function handleExportRouteClick() {
theInterface.emit('ui:exportRouteGpx');
} | [
"function exportSvgClick() {\n const filename = Data.IsSavedDiagram ?\n Data.SavedDiagramTitle :\n decodeURIComponent(Data.Filename);\n\n const svgXml = getSvgXml();\n exportSvg(filename + '.svg', svgXml);\n}",
"function exportGraphicFiles()\r{\r var graphics = docData.selectedDocument.allGraphics;\r $... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Diferentes Filtro A Aplicar A La Imagen Tu Puedes Cambiarlos Y Crear Nuevos, solo tienes que jugar con elementos como el tono la saturacion la intencidad etc this.render() aplica los cambiaos que se hacen a la imagen. $('foto').html( ''); esta linea nos sirve para regresar la imagen original...y aplicar el filtro sobre... | function filtro1(){
$('#foto').html( '<img src="'+im+'" id="foto_filtro"/>');
Caman('#foto_filtro', function () {
this.greyscale();
this.contrast(5);
this.noise(3);
this.sepia(100);
this.channels({red:8,blue:2,green:4});
this.gamma(0.87);
this.render();
... | [
"function retrocederFoto() {\r\n if(posicionActual <= 0) {\r\n posicionActual = IMAGENES.length - 1;\r\n } else {\r\n posicionActual--;\r\n }\r\n renderizarImagen();\r\n }",
"function pasarFoto() {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make a post request. endPointPath the api endpoint including the beginning / postData data to post done function to call when post succeeds | function makePost(endpointPath, postData, done) {
var options = {
hostname: 'localhost',
port: 3000,
path: endpointPath,
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': postData.length
}
};
var req = http.... | [
"function sendNewPostEvent(postData) {\n request.post(TIMELINE_POST_EVENT_URL, {\n json: postData\n })\n .on('response', function (res) {\n if (res.statusCode != 200) {\n console.log(\"ERROR \" + res.statusCode + \": Could not send New Post event!\");\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a function for getV3ProjectsIdBuildsArtifactsRefNameDownload | getV3ProjectsIdBuildsArtifactsRefNameDownload(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_heade... | [
"getV3ProjectsIdRepositoryBlobsSha(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_header.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
You're given three inputs, all of whicha re instances of a class that have a "directReports" property pointing to their direct reports. The first input is the top manager in an organizational chart (i.e. the only instance that is not anybody else's direct report), and the other two inputs are reports in the organizatio... | function getLowestCommonManager(topManager, reportOne, reportTwo) {
return getOrgInfo(topManager, reportOne, reportTwo).lowestCommonManager;
} | [
"function greatestCommonDevisor(a, b){\n if (!b) return a;\n\n return greatestCommonDevisor(b, a % b)\n\n}",
"function smallestCommons(arr) {\n\n const [min, max] = arr.sort((a, b) => a - b);\n const numberDivisors = max - min + 1;\n\n let upperBound = 1;\n for (let i = min; i <= max; i++) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Dynamically load DataTables plugin homepage: v1.9.4 license GPL or BSD | function LoadDataTablesScripts(callback){
function LoadDatatables(){
$.getScript('/hiapt/resources/datatables/jquery.dataTables.js', function(){
$.getScript('/hiapt/resources/datatables/ZeroClipboard.js', function(){
$.getScript('/hiapt/resources/datatables/TableTools.js', function(){
$.getScript('/hiapt/reso... | [
"function initFilesDataTable() {\n console.log(\"initFilesDataTable\");\n\n var path = window.location.pathname;\n path = path.substr(0, path.indexOf(\"/files/\"));\n\n var subdir = window.location.pathname;\n subdir = subdir.substr(subdir.indexOf(\"/files/\")+\"/files/\".length);\n\n var table = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a parts array for a relName where first part is plugin ID, second part is resource ID. Assumes relName has already been normalized. | function makeRelParts(relName) {
return relName ? splitPrefix(relName) : [];
} | [
"function getParams(parts) {\n return parts.split(';').reduce((acc, attribute) => {\n let [key, value] = attribute.trim().split('=');\n key = key.trim();\n\n if (value === undefined || key === 'rel') {\n return acc;\n }\n\n acc[key] = value\n .trim()\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates a two URL's to fetch all historic values. | function generateHistoricURLs() {
return [{
url: `${config.baseURL}?&fechaInicio=01/01/1998&fechaFinal=${moment().format('DD/MM/YYYY')}&PreciosPorId=2&RegistrosPorPagina=1000000&OrigenId=25&Origen=Sinaloa&DestinoId=-1&Destino=Todos`, source: true,
}, {
url: `${config.baseURL}?&fechaInicio=01/01/1998&fechaFi... | [
"function generateURLQuery()\n{\n var url=window.default_query + \"&xml=1&order_by=log_id\";\n if (window.last_log_id != -1)\n\turl += \"&log_id_op=>&log_id=\"+window.last_log_id;\n else\n\turl += \"&date_from=\"+window.start_date+\"&date_from_unit=gregorian\";\n\n if(window.user_id)\n\turl += \"&user_i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
\returns true if oll has some selected cases | function ollHasSelected(oll)
{
var ollMap = zbllMap[oll];
for (var coll in ollMap) if (ollMap.hasOwnProperty(coll)) {
collMap = ollMap[coll];
for (var zbll in collMap) if (collMap.hasOwnProperty(zbll))
if (collMap[zbll]["c"])
return true;
}
return fal... | [
"function testChoice() {\n var status = 40;\n var qualifiedState = true;\n $.each(checkChoice, function (ele, index) {\n if (checkChoice[ele] == '') {\n status -= 10;\n } else {\n switch (ele) {\n case \"address\":\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sort by multiple parameters example: People.sort(dynamicSort("Name", "Surname")); | function dynamicSort() {
/*
* save the arguments object as it will be overwritten
* note that arguments object is an array-like object
* consisting of the names of the properties to sort by
*/
var props = arguments;
return function (obj1, obj2) {
var i = 0, result = 0, numberOfPr... | [
"function sort() {\n var sortBy = sortOptions.value;\n\n if (sortBy === \"lname\") sortByLname();\n else if (sortBy === \"gender\") sortByGender();\n else if (sortBy === \"region\") sortByRegion();\n else sortByFname();\n}",
"function SortParams() {\n var fields = [];\n for (var _i = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
method to play the audio file when a certain note is clicked on. audio files are stored in the public folder | handleTuningNoteClick(i){
let current_tuning_name = this.state.current_tuning.name;
let audio_source = "/audio-files/" + current_tuning_name + "/" + i.toString() + ".mp3";
let audio = new Audio(audio_source);
audio.play();
} | [
"function playAudio(filename){\n\tif (soundEnabled) {\n\t\tvar audio = new Audio(\"audio/\" + filename) ;\n\t\taudio.play();\n\t}\n}",
"function playButtonSound() { \nsound.src = 'music/click.mp3'\nsound.play() }",
"function play(){\n\treadAndPlayNote(readInNotes(), 0, currentInstrument);\n}",
"function plays... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Looks up the value of the given `name` in the given context `stack`. | function lookup(name, stack, defaultValue) {
if (name === ".") {
return stack[stack.length - 1];
}
var names = name.split(".");
var lastIndex = names.length - 1;
var target = names[lastIndex];
var value, context, i = stack.length, j, localStack;
while (i) {
localStack = stack.s... | [
"function findVariableInScopeStack(name) {\n for (const scope of scopeList) {\n if (name && scope && name in scope) {\n return scope[name];\n }\n }\n return null;\n}",
"lookupStack(name) {\n const len = this.stack.length - 1;\n for (let i = len; i >= 0; i--) {\n const frame = this.stack[i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a parameter to the active router. | addParameter (param, opts) {
debug (`adding parameter ${param} to router`);
let handler;
if (isFunction (opts)) {
handler = opts;
}
else if (isObjectLike (opts)) {
if (opts.action) {
// The parameter invokes an operation on the controller.
let controller = this._resolve... | [
"function addOrUpdateUrlParam(name, value)\n{\n var href = window.location.href.split('#')[0];\n var regex = new RegExp(\"[&\\\\?]\" + name + \"=\");\n if(regex.test(href))\n {\n regex = new RegExp(\"([&\\\\?])\" + name + \"=\\\\d+\");\n window.location.href = href.replace(regex, \"$1\" + name + \"=\" + v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
binding.ts offers a convenient subscribe() function that creates a binding to an observable, a a plain value, or a function from which it builds a computed. | function subscribeBindable(valueObs, callback) {
// A plain function (to make a computed from), or a knockout observable.
if (typeof valueObs === 'function') {
// Knockout observable.
const koValue = valueObs;
if (typeof koValue.peek === 'function') {
const sub = koValue.subs... | [
"function Binding(value){\r\n\t\tthis.value= value;\r\n\t\tif(value){\r\n\t\t\tvalue._binding = this;\r\n\t\t}\r\n\t}",
"function addBindingProperty(e)\n {\n if(!e.binding)\n {\n e.binding = ko.dataFor(e.target);\n }\n\n return e;\n }",
"function subscription_model(d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A wrapper object for SVG elements | function SVGElement() {} | [
"createSVGElement(w,h){const svgElement=document.createElementNS(svgNs$1,'svg');svgElement.setAttribute('height',w.toString());svgElement.setAttribute('width',h.toString());return svgElement;}",
"createSvgRectElement(x,y,w,h){const rect=document.createElementNS(svgNs$1,'rect');rect.setAttribute('x',x.toString());... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
VARIABLES FUNCTIONS Description: Display the HTML content of a certain DOM element Though it's a browser window, CDpedia Details View panel doesn't support HTML code view, so we need a workaround for testing after the tag fields have been replaced by the app. Usage: debug('myID', 'e'); debug('Hello World', 'd'); ARGUME... | function debug(cItem, cMode)
{
var target = $('body').find('#debug');
target.css('display', 'block');
var orig = $(target).html();
switch(cMode)
{
case 'tag':
var item = f(cItem);
var content = '<xmp>' + item.html() + '</xmp>';
break;
case 'str':
var content = cItem;
break;
case 'mix':
var ... | [
"function debug(text){\n stats.setContent(stats.getContent()+\"<br>\"+text);\n}",
"function inspectSelection() {\n\tvar dom = dw.getDocumentDOM();\n\tvar theObj = dom.getSelectedNode(); //new TagEdit(dom.getSelectedNode().outerHTML);\n\n\t// Call initializeUI() here; it's how the global variables get\n\t// initi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle Valija func.prototype. If func is a genuine function, return its shadow's pseudoprototype, creating it (and its parent pseudoprototypes) if needed. Otherwise as normal. | function getFakeProtoOf(func) {
if (typeof func === 'function') {
var shadow = getShadow(func);
return shadow.prototype;
} else if (typeof func === 'object' && func !== null) {
return func.prototype;
} else {
return void 0;
}
} | [
"function protoShorthandMix1(func) {\n var __proto__ = 42;\n return {__proto__, __proto__: {}};\n}",
"function instanceOf(obj, func) {\n if (typeof func === 'function' && obj instanceof func) {\n return true;\n } else {\n return cajita.inheritsFrom(obj, getFakeProtoOf(func));\n }\n }",
"fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to set authed user | function setAuthedUser (id) {
return {
type: SET_AUTHED_USER,
id
}
} | [
"set user(aValue) {\n this._logger.debug(\"user[set]\");\n this._user = aValue;\n }",
"function setUserID(){\n if(isNew){\n spCookie = getSpCookie(trackerCookieName);\n getLead(isNew, spCookie, appID);\n }\n }",
"set user(aValue) {\n this._logService.debug(\"gsDiggEvent.user[set]\");\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
initialise les images, les sons de ta bd | function initImgs(){
for(var i = 1; i <= datas.nbrOfImages; i++) {
// gรฉnรจre les images dans l'index.html
$scope.data.items.push({src: "img/bd/Case" + i + ".jpg"});
}
} | [
"function setDefaultImages() {\n if (imageIndex == 1) {\n index = 8;\n r = 260;\n }\n else if (imageIndex == 2) {\n index = 2;\n r = 429;\n }\n else if (imageIndex == 3) {\n index = 9; \n r = 2384;\n }\n}",
"function init() {\n var img = new I... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the only element in the iterable. If the iterable is empty or has more than one element, an error is thrown. | function getOnlyElement(iterable) {
var iterator = iterable[Symbol.iterator]();
var firstIteration = iterator.next();
if (firstIteration.done)
throw new Error('getOnlyElement was passed an empty iterable.');
var secondIteration = iterator.next();
if (!secondIteration.done)
throw new Er... | [
"function getFirstElement(iterable) {\n var iterator = iterable[Symbol.iterator]();\n var result = iterator.next();\n if (result.done)\n throw new Error('getFirstElement was passed an empty iterable.');\n\n return result.value;\n }",
"function any( iterable )\n {\n var res = false;\n \n fore... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================================================== IAA Rate Factors (RF) for IAA Compute IAA rate factor (RF). Currently, only time and temperature affect rate of IAA production, and these are modeled elsewhere. | function compute_RF_IAA(ibu) {
var RF_IAA = 1.0;
return RF_IAA;
} | [
"function compute_LF_ferment(ibu) {\n var LF_ferment = 0.0;\n var LF_flocculation = 0.0;\n\n // The factors here come from Garetz, p. 140\n if (ibu.flocculation.value == \"high\") {\n LF_flocculation = 0.95;\n } else if (ibu.flocculation.value == \"medium\") {\n LF_flocculation = 1.00;\n } else if (ibu.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |