query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Calculates the current index in the rendered markdown using the partial document text given. This is an expensive call and should be used sparingly. | function getCurrentElementIndex(docTextSoFar) {
try {
var markdownHtml = convertToMarkdownHtml(docTextSoFar);
return countDirectNodes(markdownHtml);
} catch (e) {
return -1;
}
} | [
"indexDocument (uid: any, text: string): SearchUtility {\n this.uids[uid] = true\n\n var fieldTokens: Array<string> = this._tokenize(this._sanitize(text))\n\n fieldTokens.forEach(fieldToken => {\n var expandedTokens: Array<string> = this._expandToken(fieldToken)\n\n expandedTokens.forEach(expande... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Evaluates, or attempts to evaluate, a PropertyDeclaration, before applying it on the given parent | function evaluatePropertyDeclaration({ environment, node, evaluate, statementTraversalStack, typescript, stack }, parent) {
// Compute the property name
const propertyNameResult = evaluate.nodeWithValue(node.name, environment, statementTraversalStack);
if (parent == null) {
evaluate.declaration(node... | [
"function evaluatePropertyAssignment({ environment, node, evaluate, statementTraversalStack }, parent) {\n const initializer = evaluate.expression(node.initializer, environment, statementTraversalStack);\n // Compute the property name\n const propertyNameResult = evaluate.nodeWithValue(node.name, environme... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get maximal font size of label | _maximalLabelFontSize() {
let me = this,
visDatasets = me.visDatasets;
let max= 0;
visDatasets.forEach(dataset => {
let {
fontSize
} = dataset;
max = fontSize > max ? fontSize : max;
});
return max;
} | [
"function calcTextSize () {\n var dim = Math.min(group.innerWidth(), group.innerHeight());\n if (dim < 400)\n return Math.round(100 - 0.15*(500-dim));\n else\n return 100;\n }",
"function updateTextSize() {\n if (label.width > cell.width)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::Signer::SigningProfile.SignatureValidityPeriod` resource | function cfnSigningProfileSignatureValidityPeriodPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnSigningProfile_SignatureValidityPeriodPropertyValidator(properties).assertSuccess();
return {
Type: cdk.stringToCloudFormation(properties.typ... | [
"function CfnSigningProfile_SignatureValidityPeriodPropertyValidator(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('Expe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reset the trex to running at start of game. | reset() {
this.yPos = this.groundYPos;
this.jumpVelocity = 0;
this.jumping = false;
this.ducking = false;
this.update(0, Trex.status.RUNNING);
this.midair = false;
this.speedDrop = false;
this.jumpCount = 0;
this.crashed = false;
} | [
"function reset(){\n setInitialCondition(compute,renderer);\n}",
"resetTrex() {\n }",
"function resetGame() {\n setupPrey();\n setupPlayer();\n setupPredator();\n}",
"reset() {\n this.currentState = this._startState;\n }",
"function resetTrainer() {\n showMenu(menus[\"mainmenu\"], true);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
promptToAddNewStock() menu option 3, prompts to ask the user what item and amount to add to stock | function promptToAddNewStock() {
var questions = [{
type: 'input',
name: 'itemNum',
message: 'Which item # would you stock up?',
validate: validateNumber,
},
{
type: 'input',
name: 'quantity',
message: 'How... | [
"function addStock() {\n\n connection.query(\"SELECT * FROM products\", function (err, results) {\n\n // Message to the manager\n inquirer\n\n .prompt([\n \n {\n name: \"choice\",\n\n type: \"input\",\n\n message: \"Which... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle Elsestatements get previous statements result (if true & else if false => else false) | function handleElse(_pred) {
blockExit();
var pred = JSON.parse(JSON.stringify(_pred));
var _result = getPreviousIfResult(pred);
pred.result = pred.result === undefined ? _result : pred.result && _result;
return pred;
} | [
"function finalResultCheck() {\n if ((finalResult == \"flag\" || finalResult == \"allow\") && result == \"block\") {\n finalResult = result;\n } else if (finalResult == \"allow\" && result == \"flag\") {\n finalResult = result;\n }\n }",
"function jsen_else( ifResult ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Produce rectangles following the pivot algorithm | function pivot_algo (rectangle, origin, items) {
console.log("Length of items to rectangulize: ", items.length);
// Control to avoid excesive recursion
// calls ++;
// if (calls > 20) {
// console.log("20 calls reached, finishing");
// return;
// };
if (items.length <= 2) {
// Only one or two items, we... | [
"function generateRectangles(rectangleArray, prevRect, horz, car){\n\t//if we're dividing horizontally, ie. reducing width\n\tif (horz){\n\t\tsubdivide(rectangleArray, prevRect, true, car);\n\t} else {\n\t\tsubdivide(rectangleArray, prevRect, false, car);\n\t}\n}",
"function rectanglePoints(x,y,width,height){\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ This is what we should use to merge the databanks but it does not work. This is purely experimental. | function MergeDatabanks( rdfDataBank, newRdfDb )
{
// Not sure this is useful.
$.ajaxSetup({cache:true});
var newLength = newRdfDb.size();
// TODO: If the target databank is empty, just assign.
var newTriples = newRdfDb.triples();
for (var i = 0; i < newLength; i++) {
rdfDataBank.add(newTriples[i]);
}
} | [
"merge() {\r\n }",
"function MergeAndSave(tbList) {\n var table = New.FreeTable();\n var csList = tbList[0].ColumnSpecList;\n for(var col=0; col<csList.Count; col++) {\n table.AddColumn(csList[col].Id, (csList[col].DataType=='n'));\n } \n\n var row=0;\n var dsName = \"\";\n var idPrefix = transpo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Will delete usersaved items | deleteSavedItems() {
} | [
"deleteSavedUsers(){\n this.saved = this.deleteChecked(this.saved);\n this.showSavedUsers();\n }",
"function deleteAllAnimeFromUserList() {\n db.transaction((tx) => {\n tx.executeSql(\"delete from userlist\", [], () => {\n console.log(\"useDB: Deleted all anime from userlist in database!\");... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Appends the minimized items container to external element. | _appendMinimizedContainerToExternalElement(itemsContainer) {
const that = this;
itemsContainer.ownerElement = that;
that._dropDownParent.appendChild(itemsContainer);
itemsContainer.setAttribute('animation', that.animation);
if (that.theme !== '') {
itemsContainer.$.... | [
"_appendMinimizedContainerToExternalElement(itemsContainer) {\n const that = this;\n\n itemsContainer.ownerElement = that;\n that._dropDownParent.appendChild(itemsContainer);\n itemsContainer.setAttribute('animation', that.animation);\n\n if (that.theme !== '') {\n item... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `WebCrawlerConfigurationProperty` | function CfnDataSource_WebCrawlerConfigurationPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object,... | [
"function CfnDataSource_WebCrawlerAuthenticationConfigurationPropertyValidator(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.ValidationRe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
complete function to invoke when the HTTP GET completes. This function is passed an instance of node's http.ServerResponse ( with an additional property named "content" which holds the textual content of the response. | function httpGet(url, complete) {
// CAP-0001
http.get(url, function(response) {
var content = "";
response.on("data", function(chunk) { content += chunk; });
response.on("end", function() {
response.content = content;
complete(response);
});
});
} | [
"function httpGet(url, complete) {\n // CAP-0001\n http.get(url, function(response) {\n var content = \"\";\n response.on(\"data\", function(chunk) { content += chunk; });\n response.on(\"end\", function() {\n response.content = content;\n complete(response);\n });\n });\n}",
"function ge... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new online test | function createOnlineTest(newOnlineTest, idDocBase) {
const requestOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: authHeader(),
},
};
const url = `/document_online/?id=${idDocBase}`;
return axios.post(`${apiUrl}${url}`, newOnlineTest, requestO... | [
"function test_create() {\n //create messageTemplate object, please refer to messageTemplate model for supported fields\n let messageTemplate = new MessageTemplate({\"designation\":\"TEMPLATE\",\n \"name\":testName + Date.now(),\n \"pattern\":\"Your test is $TEST\"});\n //call create_messageT... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the now playing text | function updateNowPlaying() {
nowPlaying.innerHTML = media[currentVideo].description;
} | [
"function updateNowPlaying() {\n\t\n\tvar playing = \"\";\n\t\n\t\t\n\t\tif (lsplayer.isLive())\n\t\t\tplaying = '<b>Now <span style=\"color: #FF0000\">LIVE</span>: </b>';\n\t\telse\n\t\t\tplaying = '<b>Now Playing: </b>';\n\t\tplaying += lsplayer.getCurrentContentTitle();\n\t\t\n\t\tvar viewers = \" <b>Viewers:</b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
void Initialize (IObjectId, EncodingType, string) | Initialize(IObjectId, EncodingType, string) {
} | [
"InitializeEncode(IObjectId, int, int) {\n\n }",
"InitializeEncode(IX509PrivateKey, EncodingType, string, IObjectId, int) {\n\n }",
"InitializeFromType(X509ProviderType, IObjectId, bool) {\n\n }",
"Initialize(EncodingType, string) {\n\n }",
"function initOID(oid, name) {\n oids[oid] = name;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function invoked on page load. Sets up the Google Web search control. | function OnLoad()
{
var ws = new GwebSearch();
searchControl.addSearcher(ws);
var options = new GdrawOptions();
searchControl.draw(document.getElementById("searchResults"), options);
searchControl.setSearchCompleteCallback(this, onGoogleSearchComplete);
searchControl.setResultSetSize(GSearch.LARGE_RESUL... | [
"function loadSearch(){\n\n\t\t// Check for settings, set default if absent\n\t\tif ( typeof window.pageSettings == 'undefined') {\n\t\t\twindow.pageSettings = {};\n\t\t}\n\t\tif ( typeof window.pageSettings.gcse_search == 'undefined' || typeof window.pageSettings.gcse_search_id == 'undefined' ) {\n\t\t\twindow.pag... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Apply behavior Seek the brick and Repel the blocks This is a power up | behaviors(bricks, blocks) {
let closest = Infinity;
let closeIndex = Infinity;
for (let i = 0; i < bricks.length; i++) {
const d = p5.Vector.dist(this.pos, bricks[i].pos);
if (d < closest) {
closest = d;
closeIndex = i;
}
}
let seekForce = this.seek(br... | [
"powerUpBrickBreaker() {\r\n if (this.powerUps.isActive(BrickBreaker) && this.powerUps.hitPaddle) {\r\n if(activeEffects) this.particleS.addParticle(floor(random(2, 10)), this.ball.pos);\r\n\r\n this.ball.behaviors(this.bricks, this.blocks);\r\n }\r\n }",
"powerUpBlockBreaker() {\r\n if (this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Save global param value in the HTML5 Web Storage | function updateGlobalParamInStorage(parameter, value) {
if (!analytics.util.isBrowserSupportWebStorage()) {
return;
}
if (analytics.configuration.isParamGlobal(parameter)) {
if (value != null) {
localStorage.setItem(parameter, value); // save param val... | [
"function save_params() {\n // Set the local storage\n if ('localStorage' in window) {\n //save params\n localStorage.setItem('params', JSON.stringify(params));\n console.log('params saved!');\n } else {\n console.log('save_params: no localStorage in window!');\n }\n}",
"sa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draw the progress onto the current browserIconCtx, if enabled. | function drawProgress(init) {
if (settings.showProgress && browserIconCtx && song.info && (init || Math.abs(song.positionSec - lastProgressPosition) > 2)) {
lastProgressPosition = song.positionSec;
if (init) browserIconWithoutProgressImageData = browserIconCtx.getImageData(0, 0, 38, 38);
else bro... | [
"_drawProgressGraphic() {\n if (this.hasDrawGraphicHandler()) {\n this._drawGraphicHandler(this);\n }\n }",
"function _drawProgressBar() {\n\t\tcanvasContext.fillStyle = _progressColor;\n\t\tcanvasContext.beginPath();\n\t\tcanvasContext.rect(_progressBar.getLeft(), _progressBar.getTop(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=== ajax CSRFToken === | function ajaxCsrfToken() {
$.ajaxSetup({
headers: { 'X-CSRF-Token' : $('meta[name=_token]').attr('content') }
});
} | [
"function handleCsrfToken(){\n var token = $(\"meta[name='_csrf']\").attr(\"content\");\n var header = $(\"meta[name='_csrf_header']\").attr(\"content\");\n $(document).ajaxSend(function(e, xhr, options) {\n xhr.setRequestHeader(header, token);\n });\n }",
"function CSRFP... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new [[TemplateExtractor]] from javascript source code. `Source` offsets will be relative to the string, i.e. offset 0 is the first character of the string. If the string is only a subset of a larger string the offsets must be adjusted manually. | static fromString(source, filename) {
const ast = espree.parse(source, {
ecmaVersion: 2017,
sourceType: "module",
loc: true,
});
return new TemplateExtractor(ast, filename || "inline", source);
} | [
"static convertTemplate(src) {\r\n var fx = \r\n ( src.match(/{{\\^/) // add escape function if there is any escaping in template\r\n ? 'function '+Renderer._functionToCode(Renderer.escape) \r\n : ''\r\n ) + (src.match(/{{@/) // add mangle function if there is any mangling in the template... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
execute each FPS: resize, decrement countdowns, draw game, schedule new FPS call | function FPS() {
resize();
timeouts();
(CS.tab === 'game' && S && S.firstTick && CS.enableGraphics) && R.drawCanvas();
$timeout(FPS, Math.round(1000/CS.FPS));
} | [
"function frameRate(fps) {\n timer = window.setInterval(updateCanvas,1000/fps);\n }",
"function updateFPS() {\n\n curFPS = numFramesDrawn;\n numFramesDrawn = 0;\n}",
"function gameModeFramerate() {\n if (state == 1) {\n frameRate = setInterval(draw, 100);\n } else if (state == 2) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the given token type belongs on the stack. | function belongsOnStack(token) {
var ttl = token.type.label;
var ttk = token.type.keyword;
return ttl == "{"
|| ttl == "("
|| ttl == "["
|| ttl == "?"
|| ttl == "${"
|| ttk == "do"
|| ttk == "switch"
|| ttk == "case"
|| ttk == "default";
} | [
"function belongsOnStack(token) {\n const ttl = token.type.label;\n const ttk = token.type.keyword;\n return (\n ttl == \"{\" ||\n ttl == \"(\" ||\n ttl == \"[\" ||\n ttl == \"?\" ||\n ttl == \"${\" ||\n ttk == \"do\" ||\n ttk == \"switch\" ||\n ttk == \"case\" ||\n ttk == \"default\"\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
invoked when application is online | function doOnline() {
console.log('Event: online\n' + 'Network Type: ' + navigator.network.connection.type + '\n');
//setNetworkType();
} | [
"function onOnline () {\n\tconsole.log(\"online\");\n}",
"function onOffline () {\n\tconsole.log(\"offline\");\n}",
"function notifyOnline() {\n if (dw) {\n dw.postMessage({ online: navigator.onLine });\n }\n }",
"onOnline() {\n\t\tthis.logger.info('Client connected... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[MSOFFCRYPTO] 2.3.4. EncryptionInfo Stream | function parse_EncryptionInfo(blob, length) {
var vers = parse_CRYPTOVersion(blob);
switch(vers.Minor) {
case 0x02: return parse_EncInfoStd(blob, vers);
case 0x03: return parse_EncInfoExt(blob, vers);
case 0x04: return parse_EncInfoAgl(blob, vers);
}
throw new Error("ECMA-376 Encryped file unrecognized Versio... | [
"function parse_EncInfoStd(blob){var flags=blob.read_shift(4);if((flags&0x3F)!=0x24)throw new Error(\"EncryptionInfo mismatch\");var sz=blob.read_shift(4);//var tgt = blob.l + sz;\nvar hdr=parse_EncryptionHeader(blob,sz);var verifier=parse_EncryptionVerifier(blob,blob.length-blob.l);return{t:\"Std\",h:hdr,v:verifie... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
HOW SAVING WORKS: for map/point set: regions and points are not transmitted if the column is emptied of data or deleted. If latlon/geoid not in submission, it will be deleted from the set for series: series are not transmitted if the column is emptied out or deleted. updatets is updated for all series in worksheet upon... | function saveSeriesEditor(){
var i,
mySet,
oldHandle,
graphRefreshes = {},
graphWarnings = [],
myData = getMyDataFromEditor(); //returns false if missing name or units or data
//need to add geoid (of bunny for Point... | [
"function editData(setOrGraph){//either a MD.Set or a MD.Graph (not defined for new series)\n if(!account.loggedIn()) {\n dialogShow(\"account required\", dialogues.signInRequired);\n return;\n }\n if($('#outer-show-graph-div').is(':visible')) quickViewClose();\n var seriesSetToEdit, serie... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
typeVarPred :: NonNegativeInteger > Array Type > Any > Boolean | function typeVarPred(arity) {
var filter = arityGte (arity);
return function(env) {
var test2 = _test (env);
return function(x) {
var test1 = test2 (x);
return env.some (function(t) { return filter (t) && test1 (t); });
};
};
} | [
"function isVAR(x) {\n //final int t = tagOf(x);\n //return V == t || U == t;\n return tagOf(x) < 2\n}",
"function predContainsVar(predicate) {\n let containsVar = false;\n for (let arg of predicate)\n containsVar = containsVar || arg.variable;\n return containsVar;\n}",
"function typeV... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This object maintains a stack of ResBlocks, with some helper functions. | function ResBlockStack() {
this.stack = [];
// Stack operations.
this.push = function(newBlock) { this.stack.push(newBlock); }
this.current = function() { return this.stack[this.stack.length-1]; }
this.pop = function() { return this.stack.pop(); }
this.length = function() { return this.stack.length; }
//... | [
"function initBlocks() {\n if(valuesObject.debug)\n print(\"initBlocks()\")\n\n blockStack.init(stackSize)\n}",
"placeBlocks() {\n\t\tlet current = this.array[0];\n\n\t\tcurrent.visited = true;\n\t\tthis.stack.push(current);\n\n\t\twhile (this.stack.length > 0) {\n\t\t\tconst next = current.checkNeig... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
stackAdd(card): Adds the given card to the stack. | function stackAddCard(card) {
this.cards.push(card);
} | [
"function stackAddCard(card) {\n\n this.cards.push(card);\n return this;\n}",
"function addCardToStack(card) {\n var suit = card.suit;\n var rank = card.rank;\n\n var stack = stacks[suit];\n stack.push(card);\n}",
"function stackAddCard(card) {\n\n this.cards.push(card);\n}",
"addCard(card) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
use page count to build array of 'scanComments' promises | function buildCommentsPromises(num) {
while (num > 0) {
commentsPromises.push(scan100Comments(num));
num -= 1;
}
return commentsPromises;
} | [
"function getAllComments(page){\n const pageAllComments = page+1 || 1;\n fetch('https://api.github.com/repos/HGustavs/LenaSYS/issues/comments?since=2020-03-30T00:00:00Z&page='+pageAllComments+'&per_page=100', headers)\n //fetch('https://api.github.com/repos/HGustavs/LenaSYS/issues?since=2020-03-30T00:00:00Z&... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checkedUnchecked() marks the input tag associated to a visual checkbox/radio | function checkedUnchecked(input) {
var recordInput = document.getElementById(input.id);
!recordInput.checked ? recordInput.checked = true : recordInput.checked = false;
} | [
"set checked(value) {\n const isChecked = Boolean(value);\n if (isChecked)\n this.setAttribute('checked', '');\n else\n this.removeAttribute('checked');\n }",
"set checked(v) {\n this.input.checked = v;\n }",
"set checked(value) {\n const el = this.element;\n if (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders all applicants into the DOM. | function renderApplicants(applicants, index, searchString, filters) {
var applTable = document.getElementById("applicants");
applTable.innerHTML = "";
var applArray = [];
for (var i = 0; i < applicants.length; i++) {
var appl = applicants[i];
var applName = appl["first-name"] + " " + appl["last-name"];
... | [
"function render() {\n renderAllPagesElms()\n renderAllPageElms();\n renderAllSectionElms();\n}",
"render() {\n let alarmsHtmlList = [];\n for(let i = 0; i < this.alarms.length; i++) {\n const currentAlarm = this.alarms[i];\n const alarmHtml = createAlarmHtml(currentAlarm.id... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add Circles of Damages to Map | function populateDamageCircles(ticketId) {
var url = '/damages/' + ticketId;
$.ajax({
url: url,
data: {
format: 'json'
},
dataType: 'json',
error: function() {
alert("Something went wrong! Please try again later");
},
success: function(data) {
for (idx in data) {
var damage... | [
"function addCircleToMap(map){ \r\n for(index=0; index<covidCases.length; index++){\r\n var state = covidCases[index].state;\r\n var cases = covidCases[index].caseCount;\r\n var tweets = covidTweets[index].tweetCount;\r\n var stateTweet = stateTweets[state];\r\n \r\n lat = state... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates array of strings (pixel rows) to be used by Phaser's generateTexture. Each char in the string represents a color in the pallete | generatePattern (size) {
return Array.from({length: size}, (v, i) => (
Array.from({length: size}, (v, i) => this.randomPixel()).join('')
))
} | [
"function createTextureArray() {\n const textureArr = new Uint8ClampedArray(HEIGHT * WIDTH * 4);\n\n for (var i = 0; i < HEIGHT; i++) {\n let constant1 = i * WIDTH;\n\n for (var j = 0; j < WIDTH; j++) {\n let r = 0,\n g = 0,\n b = 0,\n a = 0;\n const ground = GROUND[i][j];\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pretty print a debugger message given as an array of parsed dvalues. Result should be a pure ASCII oneliner. | function prettyDebugMessage(msg) {
return msg.map(prettyDebugValue).join(' ');
} | [
"function debugArrayPrint(arr) {\n\t\tvar output = '';\n\t\tfor (var j = 0; j < arr.length; j++) {\n\t\t\tfor (var p = 0; p < arr[j].length; p++) {\n\t\t\t\toutput += String(arr[j][p]);\n\t\t\t}\n\t\t\toutput += \"\\n\";\n\t\t}\n\t\tconsole.log(output);\n\t}",
"function format(values) {\n return values.map(val... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
clickPosterButton allows film information to be opened if a film poster is clicked and information closes again if the same poster is clicked again 0.5 seconds interval for the information to open | function clickPosterButton(id) {
var oldId = $(".information:visible").attr("id");
$(".information:visible").slideUp();
if (id != oldId) {
$("#" + id).delay(500).slideDown();
}
} | [
"function buttonClick() {\n timestamp = duration[duration.length-1];\n console.log(timestamp + \"docReady: \" + docReady);\n if (docReady && timestamp !== undefined) {\n firepad.makeHeaderDialog_(timestamp);\n\n //Create buttons that take you to different parts of the video\n var button = document.creat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates and enters a new root Minecraft function. | createEnterRootFunction(functionName, conflictStrategy) {
const functionPath = this.getResourcePath(functionName).fullPathWithNamespace;
this.currentFunction = this.resources.addResource('functions', {
children: new Map(), commands: [], isResource: true, path: functionPath,
}, confli... | [
"createChildFunction(functionName, parentFunction = this.currentFunction) {\n if (!parentFunction) {\n throw Error('Entering child function without registering a root function');\n }\n const { name: childName, fullName, fullPathWithNamespace } = this.getUniqueChildName(functionName, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
View image in new tab. | viewImageInNewTab()
{
document.getElementById("context-viewimage")
.setAttribute("oncommand", `openTrustedLinkIn(gContextMenu.imageURL, "tab")`);
} | [
"function viewImageInTab(FileManagerDataToview){\n vm.imageCode = $setUrl.imagePath + 'expense/' + vm.expenseForUniquekey.uploadImage[0].uniqueCode;\n console.log(vm.imageCode);\n window.open(vm.imageCode,'Image');\n\n }",
"newTab() {\n history.pushState('', document... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
a function to move shooter | function moveShooter (event) {
squares[currentShooterIndex].classList.remove('shooter');
switch (event.keyCode) {
case 37:
if (currentShooterIndex % width !== 0) currentShooterIndex -= 1;
break;
case 39:
if (currentShooterIndex % width < width - 1) currentShooterIndex += 1;
break;
}
square... | [
"function moveShooter(e) {\n squares[currentShooterIndex].classList.remove('shooter')\n switch(e.keyCode) {\n case 37:\n if(currentShooterIndex % width !== 0) currentShooterIndex -=1\n break\n case 39:\n if(currentShooterIndex % width ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the current block turn count. | getBlockTurnCount() {
return this.current == null ? this.btm : this.btm + this.countBlockTurns(this.current);
} | [
"getLayerTurnCount() {\n return this.current == null ? this.ltm : this.ltm + this.countLayerTurns(this.current);\n }",
"getFaceTurnCount() {\n return this.current == null ?this.ftm : this.ftm + this.countFaceTurns(this.current);\n }",
"getBlockCount() {\n return this.mClient.call(\"getblockcount\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate the index of the card that this button will switch to. | nextCardIndex_() {
const cardSlider = getCardSlider();
const index = cardSlider.currentCard + this.direction_;
const numCards = cardSlider.cardCount - 1;
return Math.max(0, Math.min(index, numCards));
} | [
"getIndex(srcButton) {\n let idx = 0;\n while (this.buttons[idx]) {\n if (this.buttons[idx] == srcButton) {\n return idx;\n }\n idx++;\n }\n }",
"getCardIndex(card){\n let indexOfCard = ranksArray.indexOf(card.rank);\n return in... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds the information of reddit posts to the file object | function addPostsToFile() {
let last = "";
file.worksheet.eachRow((row, numRow) => {
if (numRow === file.worksheet.rowCount && numRow !== 1) {
last = row.values[6]; //Gets the fullname of the last post fetched
}
});
console.log(`[${dateNow()}] Getting new posts from ${SUBREDDIT}`);
getSubredditPosts(last)
... | [
"function processPost(/* Object */ post) {\n var id = post.id;\n if (post.post_type != 'post') {\n console.log('Post [' + id + '] is a re-post, skipping');\n return;\n }\n var signerId = post.signer_id;\n var text = post.text;\n var authorInfo = authors[ signerId ];\n var authorNa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
HRB: Function Name : onIFrameLoad() Description : Dynamically creates print preview of glossary complete course | function onIFrameLoad() {
var curTermIndex = curIndex;
if (curTermIndex < gblArrGlossaryWords.length && gblArrGlossaryWords[curTermIndex].courseInstaceId == curCourseRefId) {
var strGlossDescFile = gblArrGlossaryWords[curTermIndex].descFilePath;
var glossId = strGlossDescFile.substring(strGlossD... | [
"function onGlossaryLoad() {\n chapterContentDiv = document.getElementById(\"chapterContentDiv\");\n if (chapterContentDiv == null) {\n alert(\"chapterContentDiv not found\");\n return;\n }\n if (curIndex == gblArrGlossaryWords.length) {\n\n // Sort glossary\n sortGlossary();... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO(developer): Uncomment these variables before running the sample. parent = 'projects/myproject', // Project for which to manage secrets. secretId = 'foo', // Secret ID. payload = 'hello world!' // String source data. | async function createAndAccessSecret() {
// Create the secret with automation replication.
const [secret] = await client.createSecret({
parent: parent,
secret: {
name: secretId,
replication: {
automatic: {},
},
},
secretId,
});
console.info(`Cre... | [
"async function createAndAccessSecret() {\n // Create the secret with automation replication.\n // const [secret] = await client.createSecret({\n // parent: parent,\n // secret: {\n // name: secretId,\n // replication: {\n // automatic: {},\n // },\n // },\n // secretId,\n // })... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sends moveData recieved from one player to their opponent, and updates game state | function sendMove(moveData, gameIndex){
if(moveData.color === 'white'){
console.log('White moved');
games[gameIndex].state = 'black';
io.to(games[gameIndex].blackId).emit('moveMade', moveData);
}else if (moveData.color === 'black'){
console.log('Black moved');
games[gameIndex].state = 'white';
... | [
"function onMovePlayer(data) {\n\t// Find player in the server side players array\n\tvar movePlayer = playerById(this.id);\n\n\t// If the 'move player' request from the client does not correspond\n\t// to an existing player in the server side players array...\n\tif (!movePlayer) {\n\t\tutil.log(\"Player not found: ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handleSocketTime([String] time) Called by ServerComms.js file to update the svg with JMRI fast clock data. Currently stubbed out. | function handleSocketTime(time)
{
} | [
"function sendTime() {\n io.emit('time', { time: new Date().toJSON() });\n}",
"function sendTime() {\n io.emit('time', {\n time: new Date()\n .toJSON()\n });\n}",
"function sendTime() {\n io.sockets.emit('time', { time: new Date().toJSON() });\n}",
"function sendTime() {\n io.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
2 _isOwner is a helper method and that checks that a record is present and the user owns it. _isAdmin checks that a user is present and that the user is an admin user. | _isOwner() {
return this.record && (this.record.userId == this.user.id);
} | [
"_isOwner() {\n return this.record && this.record.userId == this.user.id;\n }",
"_isOwner() {\n return this.record && (this.record.userId == this.user.id);\n }",
"_isOwner() {\n return this.record && (this.record.userId == this.user.id);\n }",
"isOwnerOrAdmin(user) {\n if (this.getCu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Code to display an entire music xml file in the page. Experimental. | function displayWholeXml(xmlName) {
var fileName = xmlName;
if (xmlName === undefined) {
fileName = "MusicXMLs/" + getRealMusicPieceName() + ".xml";
}
//Need some code here to execute the jar file with the specified parameters.
$.ajax({
type : "GET",
url : fileName,
s... | [
"function getXML(file){\n reader.onload = function (file) {\n var xmlDoc = $.parseXML( file.target.result),\n $xml = $( xmlDoc );\n $xml.find( \"result\" ).each(function () {\n $title = $(this).find( \"title\" ).text();\n $url = $(this).find( \"url\" ).text();\n $description = $(this).find(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Implementation of reservation form submission using JQuery | function captureFormSubmitUsingJQuery(adventure) {
// TODO: MODULE_RESERVATIONS
// 1. Capture the query details and make a POST API call using JQuery to make the reservation
// 2. If the reservation is successful, show an alert with "Success!" and refresh the page. If the reservation fails, just show an alert wit... | [
"function captureFormSubmitUsingJQuery(adventure) {\n // TODO: MODULE_RESERVATIONS\n // 1. Capture the query details and make a POST API call using JQuery to make the reservation\n\n $(\"#myForm\").on(\"submit\", function(event){\n event.preventDefault();\n \n $.ajax({\n url: config.backe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if app is enabled or not. | function isAppEnabled(packageName) {
return promisifyCordovaExec('isAppEnabled', [packageName]);
} | [
"function checkAppEnabled(appID) {\n\n var app_loc = apps_order.indexOf(appID);\n\n console.log(\"checking status of app (\" + appID + \")\");\n\n if (apps_status[app_loc] == true) {\n console.log(\"- enabled\");\n } else {\n console.log(\"- disabled\");\n }\n\n return apps_status[ap... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If we require custom JSONLD handling for the given media type. The JSONLD spec requires JSONLD within script tags to be seen as a single document. As such, we have to buffer all JSONLD until the end of HTML processing, and encapsulate all found contents in an array. | requiresCustomJsonLdHandling(mediaType) {
return !this.onlyFirstScript && !this.targetScriptId && mediaType === 'application/ld+json';
} | [
"function _typedParse(loc, type, data, callback) {\n switch(type.toLowerCase()) {\n case 'text':\n case 'plain':\n case 'text/plain':\n callback(null, data);\n break;\n case 'json':\n case 'jsonld':\n case 'json-ld':\n case 'ld+json':\n case 'application/json':\n case 'applicat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates The Text Objects for the multiplayer stat screen. Like initSinglePlayerScreen, this method should be called only once | function initMultiPlayerStatScreen(){
console.log("initMultiPlayerStatScreen");
var attrstyle = {font: "2em Arial", fill: DEF_COLOR};
var nameStyle = {font: "3em Arial", fill: DEF_COLOR};
//The height of each player's health bar
var MULTI_HEALTHBAR_HEIGHT = 10;
//defines where to start drawing... | [
"addTexts(){\n var startingMessage = (game.singleplayer || game.vsAi) ? \"Current Turn: X\" : \"Searching for Opponent\"\n\n game.turnStatusText = game.add.text(\n game.world.centerX, 50, startingMessage,\n { font: '50px Arial', fill: '#ffffff' }\n )\n //set... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Receives a Resturant object from the controller, adds it to the array of favorites. If it is already in the favorites it is first removed and then added again at the end of the array | function addFavorite(r){
for(var x = 0; x < favorites.length; x++){
if(r.name == favorites[x].name){
favorites.splice(x,1);
break;
}
}
favorites.push(r);
//Removes the initial null Restuarant object when a real one is added
if(favorites[0].name==null){
favorites.splice(0,1);
}
} | [
"updateFavourite({ favourites }, { payload }) {\n const index = favourites.indexOf(payload)\n if (index === -1) favourites.push(payload)\n else favourites.splice(index, 1)\n }",
"function addToRouteFavourites(item) {\n let favourites = JSON.parse(localStorage.getItem('route-favourites') || '[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function. Update the current view because of an Ajax request. | @action update_current_view(data) {
this.page_state.update_current_view(data);
} | [
"function refreshPartial() {\n $.ajax({\n url: \"/refresh\"\n })\n}",
"function refreshPartial() {\n $.ajax({\n url: \"/\"\n });\n $(\".container\").load(location.href + \" .container\");\n}",
"function reRender() {\n\t\t$.ajax({\n\t\t\ttype: \"GET\",\n\t\t\turl: \"/\",\n\t\t\tdatatype: \"text/html\",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stop running scheduled and queued jobs. | stop() {
this._scheduler.stop();
this._queues.stop();
} | [
"stop() {\n this._notify.debug('Stopping all schedules');\n this.started = false;\n for (let schedule of this.schedules)\n schedule.stop();\n }",
"unSchedule() {\n this.job.stop();\n }",
"stop () {\n this._cronJob.stop();\n }",
"stop() {\n if (!this.running) {\n return;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
remove_plane: void Removes plane to wrap. plane: PelletPlane: Plane to be removed. | function remove_plane( plane ){
subplanes.pop( plane );
wrap_plane.remove_actor( plane.actor );
} | [
"removePlane(plane) {\n this.resetPlaneStacks();\n }",
"removePlane(){\n if(this.groundPlane == null){\n return;\n }\n\n var object = this.scene.getObjectById(this.groundPlane.id);\n if(object != null){\n this.scene.remove(object);\n this.groundPlan... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end of file// start of file Object > Path Point A collection of these units make up a Path, they have position and handles (or control points). There are a few Path Point types, and individual handles can be shown or hidden. (bottm of the file) Object > Coordinate A mini object that holds x/y position, as well as if th... | function PathPoint(oa){
oa = oa || {};
this.objtype = 'pathpoint';
this.P = oa.P? new Coord(oa.P) : new Coord({'x':100, 'y':100});
this.H1 = oa.H1? new Coord(oa.H1) : new Coord({'x':0, 'y':0});
this.H2 = oa.H2? new Coord(oa.H2) : new Coord({'x':200, 'y':200});
this.Q = oa.Q? new Coord(oa.Q) : false; // Rem... | [
"function path(type){\n var att = ['opacity', 'stroke-width', 'd'];\n var object = shape('path', att);\n // The group is created here (once for all strokes) for mutipaths,\n // and into onmousedown for single paths\n if(type=='multipath'){\n object.create_group();\n object.single = fals... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
seedFromMnemonic converts a mnemonic generated using this library into the source key used to create it. It returns an error if the passed mnemonic has an incorrect checksum, if the number of words is unexpected, or if one of the passed words is not found in the words list. | function seedFromMnemonic(mnemonic) {
const words = mnemonic.split(' ');
const key = words.slice(0, 24);
// Check that all words are in list
for (const w of key) {
if (english_1.default.indexOf(w) === -1)
throw new Error(exports.NOT_IN_WORDS_LIST_ERROR_MSG);
}
const checksum ... | [
"constructor(words) {\n let content = fs.readFileSync(WORD_LIST_FILE);\n this.wordlist = JSON.parse(content);\n\n // New mnemonic.\n if (words === undefined) {\n // Creating the sequence, with an extra byte for the checksum.\n this.seq = Buffer.alloc(NUM_BYTES + 1);\n\n //\n // ***YO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
NAME changeContact (contactID) creates a form to be submitted that will be responsbile for deleting a contact from the database. called in contacts.pug as an event handler, and will post to /deleteContact in index.js. PARAMS contactID mongoDB _id object so the server can look up the contact and delete it.. | function deleteContact(contactID) {
//Create a form with a hidden element that stores the contact
//ID value which will be named _id
//submit the form via post request to /TEST
let form = document.createElement('form');
form.method = 'post';
form.action = '/deleteContact';
const hiddenField... | [
"function changeContact(contactID) {\n //Create a form with a hidden element that stores the contact\n //ID value which will be named _id\n //submit the form via post request to /TEST\n let form = document.createElement('form');\n form.method = 'post';\n form.action = '/updateForm';\n const hi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Destroy Window Manager selfcontained CSS | destroyStylesheet() {
if ( this._stylesheet ) {
DOM.$remove(this._stylesheet);
}
this._stylesheet = null;
} | [
"cleanWindow() {\n //// remove everything in main\n while (this.main.firstChild) { \n this.main.removeChild(this.main.lastChild);\n }\n this.footer.style.display = \"none\";\n\n while (this.status_bar.firstChild) { \n this.status_bar.removeChild(this.status_b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Q5 Write a function that returns all the names of the pets in order of their owner's last name | function allPetsInOrderOfLastName (){
function ownersLastName (pet1, pet2) {
let owner1 = getOwner(pet1.ownerId)
let owner2 = getOwner(pet2.ownerId)
if (owner1.lastName.toLowerCase() < owner2.lastName.toLowerCase()) {
return -1;
} else if (owner1.lastName.toLowerCase() > ... | [
"function ownerNames(){\r\n\r\n let nameOwner=\"\";\r\n for(var i=0; i<salon.pets.length; i++){\r\n nameOwner += salon.pets[i].ownerName;\r\n }\r\n return nameOwner;\r\n }",
"function petNames(){\r\n\r\nlet namePet=\"\";\r\nfor(var i=0; i<salon.pets.length; i++){\r\n namePet += salon.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
poll for dom element in the frame if it is loaded /slector is in relative to frame | function pollForLoad(domSlector){
var intId;
var isFrameLoaded = function () {
//both frames have been loaded?
if( $("frame[name='bottomFrame']") && $("fra,e[name='bottomFrame']").contents().find("frame[name='mainFrame']").length
&& $("frame[name='bottomFrame']... | [
"function pollReady() {\n if (!iframe.contentWindow.document.getElementById('progress')) {\n setTimeout(pollReady, 100);\n } else {\n resolve(iframe);\n }\n }",
"function c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sets all Dices to be kept | keepAllDices(){
this.dice1Keep = true;
this.dice2Keep = true;
this.dice3Keep = true;
this.dice4Keep = true;
this.dice5Keep = true;
} | [
"keepAll(num, dices){\n for (let i = 0; i < dices.length; i++) {\n if (dices[i] === num){\n switch (i) {\n case 0:\n this.dice1Keep = true;\n break;\n case 1:\n this.dice2Keep ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request data to create draft copilot contest. | function createDraftContestRequest(projectName, projectType) {
var projectHeader = mainWidget.softwareCompetition.projectHeader;
var assetDTO = mainWidget.softwareCompetition.assetDTO;
mainWidget.competitionType = "SOFTWARE";
projectHeader.projectCategory = {};
projectHeader.projectCategory... | [
"createConsortia() {\n let body = JSON.stringify({name: this.consortiumName, description: this.consortiumDescription});\n let uri = this.baseUrl + \"/consortia\";\n let options = {method: 'POST', uri: uri, headers: this.headers, body: body};\n return request(options);\n }",
"functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
HELPER FUNCTIONS Finds and returns the type with the given identity, if any. | function getTypeWithIdentity(typeIdentity) {
var typeDefinitions = extensionInterface.getTypeDefinitions(),
existingType,
existingTypeName,
existingTypeIdentity,
typeNames = objKeys(typeDefinitions),
typeCount = typeNames.lengt... | [
"function type( value ){\n\treturn (exists( value ) ? value.constructor : value);\n}",
"function contentTypes__find(type, fn) {\n\t\tvar types = contentTypes__mkTypesList(type);\n\t\tfor (var i=0; i < types.length; i++) {\n\t\t\tif (types[i] in contentTypes__registry) {\n\t\t\t\treturn contentTypes__registry[type... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adiciona um dom com o slot de feitico. Usada pelo AjustaFilhos, que preenche o indice. | function AdicionaSlotFeitico(div_nivel_slots, precisa_memorizar, chave_classe, nivel, slots, indice) {
div_nivel_slots.appendChild(
CriaDomSlotFeitico(precisa_memorizar, chave_classe, nivel, indice, slots));
} | [
"function CriaDomSlotFeiticoDominio(chave_classe, nivel, conhecidos, slots) {\n var div_slot = CriaDiv();\n div_slot.appendChild(CriaSpan('D:'));\n var select = CriaSelect(\n 'input-feiticos-slots-' + chave_classe + '-' + nivel + '-dom',\n 'feiticos-slots',\n AtualizaGeral);\n PopulaSelectComOptG... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
hash := (tasks:Object>) => Continuable> | function hash(tasks) {
return function continuable(callback) {
var keys = Object.keys(tasks)
var count = 0
var result = {}
if (keys.length === 0) {
return callback(null, result)
}
keys.forEach(function (key) {
tasks[key](function (err, value)... | [
"function hashObjectTask(filePath, write) {\n const commands = ['hash-object', filePath];\n if (write) {\n commands.push('-w');\n }\n return task_1.straightThroughStringTask(commands, true);\n}",
"function TaskList() {\n this.tasks = {}\n this.currentId = 0\n}",
"task(name, description, act... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A single EVP iteration, returns `D_i`, where block equlas to `D_(i1)` | function iter(block) {
let hash = createHash(opts.digest || 'md5');
hash.update(block);
hash.update(data);
hash.update(salt);
block = hash.digest();
for (let i = 1; i < (opts.count || 1); i++) {
hash = createHash(opts.digest || 'md5');
hash.update(block);
block = hash.digest();... | [
"function iter (block) {\n var hash = crypto.createHash(opts.digest || 'md5')\n hash.update(block)\n hash.update(data)\n hash.update(salt)\n block = hash.digest()\n\n for (var i = 1; i < (opts.count || 1); i++) {\n hash = crypto.createHash(opts.digest || 'md5')\n hash.update(block)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns user object wrapping user data given address | get(addr) {
let dep = new Tracker.Dependency;
dep.depend();
this.userReactor.register(dep, addr);
this.membershipReactor.register(dep, addr);
return userController.getUserAsync(addr).then((hash) => {
// address is not registered in userdb.
if(hash == "0x0000000000000000000000000... | [
"function getAddress(user) {\n return users[user].address;\n}",
"function GetPersonal(address) {\r\n return ParseAddress(address)[0];\r\n}",
"function createUserObject(data) {\n return new SkycapUser(data);\n}",
"function parseUserfromDB(results){\n if(results == null || results == undefined){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
populate page divs based on imported project data | function pagePopulate() {
document.getElementById("title-text").innerHTML = projectData.title;
let statusHTML = "";
switch (projectData.status) {
case "inprogress":
statusHTML =
'<p>Project Status: <span class="inprogress">In Progress</span></p>';
break;
case "completed... | [
"function populateProjects() {\n const PROJECT_CATEGORIES = Object.keys(PROJECT_DATA.projects);\n const PROJECT_CONTAINER = document.querySelector(\"#projectsContainer\");\n\n for (let cat of PROJECT_CATEGORIES) {\n const PDATA = PROJECT_DATA.projects[cat];\n const MASTER_CONTAINER = createElement(\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests parsing of InfoItems. | function testInfoItemParse() {
var testStack = [{
'type': 'info',
'text': CAPTION,
'id': ID
}];
info = vsaq.questionnaire.items.InfoItem.parse(testStack);
assert(info instanceof vsaq.questionnaire.items.InfoItem);
assertEquals(ID, info.id);
assertEquals(CAPTION, info.info);
assertEquals(0, tes... | [
"function testInfoItem() {\n var el = info.container;\n\n assertEquals(String(goog.dom.TagName.DIV), el.tagName);\n assertEquals(ID, el.id);\n assertEquals(CAPTION, goog.dom.getTextContent(el));\n}",
"processItems() {}",
"function testUploadItemParse() {\n var testStack = [{\n 'type': 'upload',\n 'te... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns a list of active collisions that have not been already propogated | _getUnpropogated(currentObj, propogated) {
let activeCols = currentObj.activeCols;
let unpropCols = [];
let found = false;
for (let i = 0; i < activeCols.length; i++) {
let indexCol = activeCols[i];
for (let j = 0; j < propogated.length; j++) {
... | [
"getCollisions(p_o) {\n // Make empty list.\n var collision_list = [];\n\n for (var i = 0; i < this.m_updates.length; i++) {\n var p_temp_o = this.m_updates[i];\n\n // Do not consider self.\n if (p_temp_o != p_o) {\n // bounding box of object\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extracts from an array of `Either` all the `Left` elements. All the `Left` elements are extracted in order ```ts assert.deepStrictEqual(lefts([right(1), left('foo'), right(2)]), ['foo']) ``` | function lefts(as) {
const r = [];
const len = as.length;
for (let i = 0; i < len; i++) {
const a = as[i];
if (a._tag === "Left") {
r.push(a.left);
}
}
return r;
} | [
"function lefts(eithers){\r\n var acc = [];\r\n for(var i = 0, l = eithers.length; i < l; ++i){\r\n var either = eithers[i];\r\n if(either.Left)\r\n acc.push(either[0]);\r\n }\r\n return acc;\r\n}",
"function lefts(es) { return get(Elm.List.filter(isLeft)(es)); }",
"function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Energy Graph If an Interactive is instanced on this page pass in the model object, otherwize we'll assume the Interactive is embedded in an iframe. | function setupEnergyGraph(_model, callback) {
var $modelEnergyGraphContent = $("#model-energy-graph-content"),
energyGraphSamplePeriod,
modelEnergyGraph,
modelEnergyData = [];
// private functions
function modelStepCounter() {
if (_model) {
return _model.stepCounter();... | [
"function modelConnect() {\n // edit var modelID to point to desired model; click the Embed button on tool bar to see model number\n var modelID=\"im9572\";\n var getModelElement = document.getElementById(modelID).contentWindow;\n return(getModelElement);\n}",
"get interactiveRenderer () {\n return this._i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This version hides elements that do not contain the substring we are searching for. | function searchNhide(searchvalue, search)
{
var sub = searchvalue.toLowerCase();
var elements = document.getElementsByClassName(search);
if(sub != '') //if the text box is not empty
for(var i = 0; i < elements.length; i++)
{
var searchin = elements[i].innerText;... | [
"function filterBreeds(str){\n console.log(breedsContainer)\n const list = Array.from(breedsContainer.children)\n for( let el of list){\n if(el.textContent[0] === str){\n el.hidden = false\n } else {\n el.hidden = true\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Upload the specified application. | function uploadApp(appPath, appType, apiKeyId, issuerId, options) {
return __awaiter(this, void 0, void 0, function* () {
const args = [
'altool',
'--output-format',
'xml',
'--upload-app',
'--file',
appPath,
'--type',
... | [
"function uploadApp() {\n\treturn new Promise(resolve => {\n\t\t\tconst res = request.post(baseUrl + \"upload\", (err, res, body) => {\n\t\t\t if (err) { console.log(err); }\n\t\t\t resolve(JSON.parse(body).app_url)\n\t\t\t});\n\t\t\tres.form().append('file', fs.createReadStream(__dirname + \"/Calculator.apk\"))\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create or add a callback function to the end of a batch for a given key. | push (key, cb) {
batch[key] = batch[key] || []
batch[key].push(cb)
} | [
"function after (key, func) {\n if (!this.hooks[key]) this.hooks[key] = {};\n if (!this.hooks[key].after) this.hooks[key].after = [];\n this.hooks[key].after.push(func);\n }",
"addBatchCallback(callback) {\n this.batchCallback = callback;\n return this;\n }",
"onSerialize(key, cal... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
paint all nodes that similar to d with the same color. | function markNodesOfSameType(d, color) {
if (d.node.type === "text") {
for (let node of nodes) {
if (node.node.type === "text")
node.fillStyle = color;
else
node.fillStyle = undefined;
}
} else {
for (let node of nodes) {
if (node.node.tagName === d.node.tagName)
node.fillStyle = color;
... | [
"function colorNodes(ns,color) {\n var colorFunc = color ? getYellowColor : getColor;\n\n for (var i=0; i<ns.length; i++) {\n ns[i].color=colorFunc(ns[i].level);\n // Prevent snapping\n delete ns[i].x;\n delete ns[i].y;\n }\n nodes.update(ns);\n isReset = false;\n}",
"function colorByDistance(dis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Villageid=Id of the actual Village Koords= Location of the Village Dorfname= Name of the Village User= Name of the User the Village belongs to Note= Note of the User Villagefav= Save Favourite for this Village(pass 1 to this function to make the favourite global) Lastattack= Time of the Last attack | function add_AttFavs(villageid,koords,dorfname,user,userid,note,villagefav,lastattack)
{
var attFavs=get_AttFavs();
write_AttFavs(addFavs(attFavs,villageid,koords,dorfname,user,userid,note,villagefav,lastattack));
} | [
"function add_MarketFavs(villageid,koords,dorfname,user,userid,note,villagefav)\r\n{\r\n\tvar marketFavs=get_MarketFavs();\r\n\twrite_MarketFavs(addFavs(marketFavs,villageid,koords,dorfname,user,userid,note,villagefav,\"\"));\r\n}",
"function getIdVillageV2(){\r\n\t\t//get the villageID using XPFirst (works for o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::CloudFront::Distribution.OriginGroupFailoverCriteria` resource | function cfnDistributionOriginGroupFailoverCriteriaPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnDistribution_OriginGroupFailoverCriteriaPropertyValidator(properties).assertSuccess();
return {
StatusCodes: cfnDistributionStatusCodesProp... | [
"function CfnDistribution_OriginGroupFailoverCriteriaPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n errors.collect(cdk.propertyValidator('statusCodes', cdk.requiredValidator)(properties.stat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update cached stats with new queue data | function updateQueueData(queueId, mediaType, metrics) {
if (!stats[queueId]) stats[queueId] = { availableAgents: 0, busyAgents: 0 };
if (!mediaType) {
stats[queueId].availableAgents = getQueueObservationMetric(metrics, 'oOnQueueUsers', 'IDLE', stats[queueId].availableAgents ? stats[queueId].availableAgents : 0);
... | [
"function updateQueueStats() {\n var _stats = {\n csa: getQueueStat('CSA'),\n partnerService: getQueueStat('Partner Service'),\n };\n\n if (!utils.objectEquals(__queueStats, _stats)) {\n __queueStats = _stats;\n _eventer.trigger('stats-updated', __queueStats);\n }\n}",
"fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array of all sub components of this component. | getAllComponents() {
if ( this._baseComponent ) {
return this._baseComponent.getAllComponents();
}
return Object.values(this._components);
} | [
"getAll() {\n return this._allComponents;\n }",
"get sublayers()\n {\n return [].concat(this._sublayers);\n }",
"get subnodes() {\n // return a new array, so that the user modifying it doesn't affect\n // this node's actual children.\n return [... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
2 Calculate and return the hero metrics for the data in "this.data" Metrics are: total profit Sum up the profit for each data point average tables served Sum the total number of tables and divide by the [total number of restaurants number of days of data] Ex. 5000 tables, 5 restaurants, 7 days = 5000 / (5 7) = 142 long... | getHeroMetrics() {
let profit = 0;
let tables = 0;
let restaurants = [];
let days = [];
let sortedData = this.data.sort((a, b) => (a.reportDate > b.reportDate) ? 1 : -1);
for (var i = 0; i < this.data.length; i ++) {
profit += this.data[i].profit;
tabl... | [
"function badDefense(data) {\n const losers = getFinals(data).map((el) => {\n const HomeGoalsAgainst = data.reduce((sum, elData) => {\n if (elData.Year === el.Year) {\n if (elData[\"Home Team Name\"] === el[\"Home Team Name\"])\n sum += elData[\"Away Team Goals\"];\n else if (elData[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
lift2 :: Apply f => (a > b > c, f a, f b) > f c . . Lifts `a > b > c` to `Apply f => f a > f b > f c` and returns the . result of applying this to the given arguments. . . This function is derived from [`map`](map) and [`ap`](ap). . . See also [`lift3`](lift3). . . ```javascript . > lift2 (x => y => Math.pow (x, y), [1... | function lift2(f, x, y) {
return ap (map (f, x), y);
} | [
"function lift2(f, x, y) {\n return ap(map(f, x), y);\n }",
"function liftA2(f, a, b) {\n return this.ap(this.map(a, f), b);\n}",
"function lift3(f, x, y, z) {\n return ap(ap(map(f, x), y), z);\n }",
"function liftA2(f, a, b) {\n return this.ap(this.map(a, f), b);\n }",
"function lift3(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Class name begins with upcase char | function class_name(name) {
return /^[A-Z]/.test(_.last(name.split(/\./)));
} | [
"get classNameLower() {\n return this.constructor.name.toLowerCase()\n }",
"function genClassName(str) {\n return str.replace(/\\s+/g, '-').toLowerCase();\n}",
"function genClassName(str) {\n return str.trim().replace(/\\s+/g, '-').toLowerCase();\n}",
"function sanitizeClassname(name) {\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a list of incoming payments using a given payment id, or a list of payments ids, from a given height. This method is the preferred method over get_payments because it has the same functionality but is more extendable. Either is fine for looking up transactions by a single payment ID. | getBulkPayments(payment_ids, min_block_height) {
return __awaiter(this, void 0, void 0, function* () {
return yield this.request("get_bulk_payments", {
payment_ids,
min_block_height,
});
});
} | [
"async checkForPayments(paymentIds, blockHeight = 0) {\n return rpcCall.executeMethod(\n this.rpcEndpoint,\n \"get_bulk_payments\",\n {\n payment_ids: paymentIds,\n min_block_height: blockHeight\n }\n );\n }",
"getPayment(p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
trick the keyboard polling routine to accept one key at a time | function pollKeyStuff() {
var thrufl = 0x81de; // line input done flag
var ch = nextChar();
if (phase < 0) {
phase++;
} else if ((phase === 0) &&
(ccemu.rd(thrufl) === 0)) { // buffer accepting input
keybrd.asciiKey(ch); // set it
... | [
"function keyPressed() {\n lastKeyPressed = key;\n\n sendChannel2();\n \n }",
"static handleKeyPress(event) {\r\n\t\t// loop the handleKeyDown function\r\n\t\tconsole.log('key is pressed continuously');\r\n\t\tEventHandler.handleKeyDown(event);\r\n\t}",
"static waitForKey(keyCode = 32) {\n\n return ne... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
shows the date the question was aired on TV | function showDate(input){
document.getElementById("questiondate").innerHTML = `This question aired on: ${formatDate(input[0].airdate)}`
} | [
"function C009_Library_Jennifer_AskDate() {\n\tC009_Library_Jennifer_CanAskDate = false;\n\tif (ActorGetValue(ActorLove) >= 15) OverridenIntroText = GetText(\"GreatDate\");\n}",
"function showDate(e) {\n console.log(e.toString());\n }",
"function printDate()\n\t{\n\t\tvar time = getTime();\n\n\t\t// Print t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function handles ALL of our intersection checking: stuff that only the player character can interact with: coins, flagpole, other agents stuff that all agents can interact with: canyons, falling off the screen | function checkintersections (agents) {
agents.forEach((agent) => {
if (agent === character) {
// check if player character is intersecting with any coins
coins.some((coin) => {
if (isIntersecting(agent.hitbox, coin.hitbox)) {
findCoin(coin);
}
});
// check if pla... | [
"function playerInteractionCollision(interactionCollisionX, interactionCollisionY, interactionCollisionWidth, interactionCollisionHeight) {\r\n var charRelativeWidth = charX + charWidth; //coordinate for the top right limit of the character\r\n var charRelativeHeight = charY + charHeight; //coordinate... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
reset slider value based on scroll content position | function resetValue() {
var remainder = $scrollPane.width() - $scrollContent.width();
var leftVal = $scrollContent.css("margin-left") === "auto" ? 0 : parseInt($scrollContent.css("margin-left"));
var percentage = Math.round(leftVal / remainder * 100);
$scrollbar.slider("v... | [
"function resetValue() {\n\t\t\t\t\tlet remainder = $scrollPane.width() - $scrollContent.width();\n\t\t\t\t\tlet leftVal = $scrollContent.css('margin-left')==='auto' ? 0 : parseInt($scrollContent.css('margin-left'));\n\t\t\t\t\tlet percentage = Math.round(leftVal / remainder * 100);\n\t\t\t\t\t$scrollbar.slider(\"v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if this is the first time the extension has been loaded | function onFirstLoad() {
let check = localStorage.getItem("sadAnimalsPreviouslyLoaded");
if (check !== "1") {
setSadAnimalTabName();
localStorage.setItem("sadAnimalsPreviouslyLoaded", 1);
}
} | [
"function detectFirstRun()\n{\n firstRun = filterStorage.filterStorage.getSubscriptionCount() == 0;\n\n if (firstRun && (!filterStorage.filterStorage.firstRun || prefs.Prefs.currentVersion))\n reinitialized = true;\n\n prefs.Prefs.currentVersion = info_chrome_js.addonVersion;\n}",
"function detectFirstRun()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called when the body of the car is changed. | function onCarbodyChange(offset)
{
//Find the index which is offset from the current body index by the given offset.
var offsetIndex = (carbodyIndex + offset);
//If it's negative, set the index to the last image:
if(offsetIndex < 0)
carbodyIndex = carbodyImages.length + offset;
//Otherwise just add the offse... | [
"function onBodyChanged()\n{\n\t//Update the display showing which indices these are.\n\tupdateSelectorBox();\n\t\n\t//Set flag, body, colour and wheels images\n\tflagImage.src = flagImages[flagIndex];\n\tcarbodyImage.src = carbodyImages[carbodyIndex];\n\tcolourImage.src = colourImages[colourIndex];\n\twheelImage.s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Construct a new build output against the provided build | function createBuildOutput(build_id, options) {
// Request build order information from the server
inventreeGet(
`{% url "api-build-list" %}${build_id}/`,
{},
{
success: function(build) {
var html = '';
var trackable = build.part_detail.trac... | [
"function newBuildObject() {\n\twindow.currentBuild = {\n\t\tclassName : window.className,\n\t\tbuildName : 'Build Name',\n\t\tgameMode : 0,\n\t\ttraits : {\n\t\t\tline1 : {\n\t\t\t\ttotal : 0,\n\t\t\t\tadept : 0,\n\t\t\t\tmaster : 0,\n\t\t\t\tgrandmaster : 0\n\t\t\t},\n\t\t\tline2 : {\n\t\t\t\ttotal : 0,\n\t\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
selects a list of words considering word length and regex | function selectListWords(wordList, hasnt, minLen, maxLen, fontSize){
var pattern = new RegExp("^[^"+hasnt+"]+$");
var str = "", count=0, result=[];
for (var index in wordList){
var word = wordList[index];
if (pattern.test(word)){ //tests in word doesnt have set of charcter
... | [
"function BOT_extractWords() {\r\n\tvar word, matchlist;\r\n\tvar lemstring = BOT_lemString;\r\n\tvar worldlist = [];\r\n\tvar rex = new RegExp(\"< (\\\\w+) (.*)\");\r\n\tfor(var i=0; i<BOT_maxExtractedWords; i++) { // Words extracted is limited\r\n\t\tif(lemstring.search(rex) != -1) {\r\n\t\t\trex.lastIndex... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
END getShareBoxDiv$ START getShareDivWrapper$ | function getShareDivWrapper$() {
return $('<div/>').addClass('form-group shareDiv').append(
$('<textarea/>').addClass('form-control ASWidgetshareBoxInput')
.attr('placeholder', localizeString("ASWidget-share-sharebox-placeholder", "What do you want to share?"))
);
} | [
"function doModalShare() {\n\tcustomModalBox.htmlBox('yt-ShareContent', '', 'Share'); \n\t$('mb_close_link').addEvent('click', function() {\n\t\t$('yt-ShareContent').injectInside($('yt-ShareContainer'));\n\t\tif($('yt-ShareError')) $('yt-ShareError').remove();\n\t});\n}",
"function renderShareFollow() {\n var ac... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Manche Browser (z.B. Safari 5.1.7) richten ein Element falsch aus wenn folgende Bedingungen gegeben sind: Ein imgKindelement mit Hoehenangabe, aber keiner Breitenangabe ist in dem Element enthalten. Das imgKindelement ist aufgrund der Bildgroesse breiter als das Element. Das Element hat keine Breitenangabe und ist, auf... | function bf_SizeContainerToInnerImg(imgElement, add) {
/* Erst muss das Bild vollstaendig geladen sein, sonst kann seine Breite nicht bestimmt werden - daher einen Event-Handler an das
load-Ereignis binden. */
imgElement.load(function() {
// Die Breite des Elternelements dauerhaft an die Breite des Bildes ... | [
"function GetChildImage (element)\n{\ntry {\nvar oE = element;\n\nif (oE.tagname != \"img\")\n oE = oE.children.tags(\"img\")(0);\n\nreturn (oE);\n}\ncatch (err) {\n alert(err.description + \"\\n\\n\" + \"GetChildImage error.\");\n}\nfinally {\n return;\n}\n}",
"zoomInImg(element) {\n this.swapClasses(eleme... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prepare the user creation dialog | function setupCreateUserDialog(){
dialogs_context.append('<div title=\"'+tr("Create user")+'\" id="create_user_dialog"></div>');
$create_user_dialog = $('#create_user_dialog',dialogs_context);
var dialog = $create_user_dialog;
dialog.html(create_user_tmpl);
//Prepare jquery dialog
dialog.dialog... | [
"function setupCreateUserDialog(){\n dialogs_context.append('<div title=\"Create user\" id=\"create_user_dialog\"></div>');\n $create_user_dialog = $('#create_user_dialog',dialogs_context);\n var dialog = $create_user_dialog;\n dialog.html(create_user_tmpl);\n\n //Prepare jquery dialog\n dialog.di... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds an IAM statement to the default policy. | addToPrincipalPolicy(statement) {
try {
jsiiDeprecationWarnings.aws_cdk_lib_aws_iam_PolicyStatement(statement);
}
catch (error) {
if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
Error.captureStackTrace(error, this.addToPrincipalP... | [
"addToPolicy(statement) {\n if (!this.defaultPolicy) {\n this.defaultPolicy = new aws_iam_1.Policy(this, 'DefaultPolicy');\n this.attachInlinePolicy(this.defaultPolicy);\n }\n this.defaultPolicy.addStatements(statement);\n return true;\n }",
"addToPolicy(statem... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Uses inquirer to prompt the user for one of four actions | function actions() {
inquirer
.prompt({
name: "action",
type: "list",
message: "\n\nWhat would you like to do?\n",
choices: [
"View all products",
"View products with low inventory",
"Add to inventory",
... | [
"function actionPrompt() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"action\",\n message:\"Select an option\",\n choices: [\"Find Concert\", \"Spotify A Song\", \"Find Movie\", \"I'm Feeling Lucky...\",\"Quit\"]\n },\n ])\n .then(funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |