query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Returns true if the hand array contains the card | function checkForCarInHand(hand, card) {
for(var i = 0; i < hand.length; i ++){
if (hand[i] == card){
return true;
}
}
return false;
} | [
"in_deck(card) {\n for(i in this.player.deck) {\n if(card === this.player.deck[i]) {\n return true;\n }\n }\n return false;\n }",
"function containsQueenOfHearts(cardArray){\n\n var arrayLength = cardArray['length'];\n var queenPresent = false;\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sendRequestForm("func_name", ["ids"][, callback[, validation]]) A specialized helper that calls sendRequest with the values of forms Form IDs are given in [ids] An extra optional validation function is allowed | function sendRequestForm(func_name, ids, callback, validation) {
var settings = {},
elem, id, i;
// For each of the given IDs:
for(i in ids) {
id = ids[i];
// If an element matches that ID, add it to settings
elem = document.getElementById(id);
settings[id] = elem ? elem.value : "";
... | [
"function sendRequestForm(func_name, ids, callback, validation) {\n var settings = {},\n elem, id, i;\n \n // For each of the given IDs:\n for(i in ids) {\n id = ids[i];\n // If an element matches that ID, add it to settings\n elem = document.getElementById(id);\n settings[id] = elem ? elem... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
defined p47 The restrict function takes a function that acts as a predicate against each object in the table. Whenever the predicate returns a falsey value, the object is disregarded in the final table. | function restrict(table, pred) {
return _.reduce(table, function(newTable, obj) {
if (fns.truthy(pred(obj)))
return newTable;
else
return _.without(newTable, obj);
}, table);
} | [
"function restrict(o,p) {\n for (prop in o) {\n if(!p[prop]) delete o[prop];\n }\n return o;\n}",
"static restrict(o, p) {\n for(let prop in o) { // For all props in o\n if (!(prop in p)) delete o[prop]; // Delete if not in p\n }\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is the the plugin being run on a server with the region service | function checkRegionServer(cb) {
_exec('ps aux | grep HRegionServer | grep -v grep', function (err, stdout, stderr) {
if (err || stderr || !stdout)
return cb('The Graphdat HBase plugin should be run on a Region Server');
else
return cb(null);
});
} | [
"isServer() {\n return Global.IsServer();\n }",
"function isRunningOnServer() {\n\t\treturn (environment === 'server');\n\t}",
"function isServer()\n{\n return server.IsRunning();\n}",
"function isRegionProvider(arg) {\n return arg.getRegion !== undefined;\n}",
"isLocalServer(ip = this.get('server... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate the category of the item. The user must select a category other than 'Select Category...'. | function validateCategory(theCategory) {
var categoryAlert = $(alert);
categoryAlert.text("");
if (theCategory === "Select Category...") {
categoryAlert.text("Please select a category.");
}
if (categoryAlert.text() !== "") {
$("#category-alert").append(categoryAlert);
return false;
} else {
... | [
"validateCategory() {\n this.validateXpath(\n 'itemMeta > links > link[type=\"x-im/category\"]',\n 'At least one category must be chosen.'\n )\n }",
"function validateCategory(category){\n if(category != \"none\")\n return true;\n else\n return false;\n}"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an interpolation binding with 5 expressions. | function interpolation5(prefix,v0,i0,v1,i1,v2,i2,v3,i3,v4,suffix){var lView=getLView();var bindingIndex=lView[BINDING_INDEX];var different=bindingUpdated4(lView,bindingIndex,v0,v1,v2,v3);different=bindingUpdated(lView,bindingIndex+4,v4)||different;lView[BINDING_INDEX]+=5;return different?prefix+stringify$1(v0)+i0+strin... | [
"function interpolation5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {\n var lView = Object(render3_state.m)(), bindingIndex = lView[interfaces_view.a], different = Object(bindings.d)(lView, bindingIndex, v0, v1, v2, v3);\n if (different = Object(bindings.a)(lView, bindingIndex + 4, v4... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Affiche les informations d'un produit pour la page produit.html | async function showProduit(){
let idProduit = getIdProduit();
/* récupère le produit avec l'id récupéré via l'API */
let produit = await getProduits(idProduit);
/* si l'id ne correspond à aucun produit existant, le JSON renvoit un objet vide, donc on affiche un message d'erreur */
if(JSON.stringify(produit) == "... | [
"function ProduitFontion(ProduitService) {\n var vm = this;\n vm.loadAll = loadAll;\n\n loadAll();\n\n function loadAll() {//Fontion qui affiche la liste des produits\n\n ProduitService.query(null, onSuccess, onError);\n\n function onSuccess(data, headers) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this method is called when your extension is activated your extension is activated the very first time the command is executed | function activate(context) {
console.log('Congratulations, your extension "funne" is now active!');
let disposable = vscode.commands.registerCommand('funne.init', () => {
vscode.window.showInformationMessage('welcome to funne!');
});
context.subscriptions.push(disposable);
} | [
"function activateExtension() {\n Privly.options.setInjectionEnabled(true);\n updateActivateStatus(true);\n}",
"function activate(context) {\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funzione che mi permette di inserire i colori in rgba con range [0,255] | function rgba(color){
return [color[0]/255, color[1]/255, color[2]/255, color[3]/100];
} | [
"function rgba(color){\n return [color[0]/255, color[1]/255, color[2]/255, color[3]/100];\n}",
"function rgba(color){\n return [color[0]/255, color[1]/255, color[2]/255, color[3]/100];\n}",
"function rgbaToArgbHex(r,g,b,a){var hex=[pad2(convertDecimalToHex(a)),pad2(mathRound(r).toString(16)),pad2(mathRound(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load the update_user page | function load_update_user_page() {
page = 'update_user';
load_page(load_update_user_data);
} | [
"updateUser(id) {\n const user = this.usersPage[id];\n location.href = \"#/adduser/\" + user._id;\n\n }",
"function updateProfile() {\n vm.editContent = false;\n $(\".userDetail\").attr('readonly', true);\n $(\".userDetail\").addClass(\"updateDetail\");\n console.log(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the stylesheet code from the textarea | getStyleSheet(form, value) {
const content = document.getElementById("stylesheet");
const active = document.getElementById("withStylesheet").checked;
value.stylesheetActive = active; // set stylesheetActive property of query
if (content && content.value.trim().length > 0) {
... | [
"getStyleSheetText(params) {\n return this._client.send(\"CSS.getStyleSheetText\", params);\n }",
"_getStyleData() {\n if (this.stylesheet) return this.stylesheet.css;\n }",
"function convert_code(){\n cssmap={};\n csssheet=parseCSS($(\"#css_text\").val());\n for (i = 0; i < csssheet.leng... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draw the mirror, figure and reflection. If `recompute`, then we recompute the equations. / Otherwise, the existing equations are redrawn according to the new view. | function render(recompute, start = false) {
/// `draw_equations` assumes we have already computed the reflection and simply need to
/// redraw it, on account of the view changing.
function draw_equations(reflection, start, recomputed = false) {
canvas.clear();
if (reflec... | [
"function draw_equations(reflection, start, recomputed = false) {\n canvas.clear();\n\n if (reflection !== null) {\n reflection.plot(canvas, view, settings).then(() => {\n // Save the reflection image in the buffer, so that we can draw on it without\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
endregion Region exponent member | get exponent() {
return this._exponent;
} | [
"get exponent() {\n return this._exponent.value;\n }",
"function Exp()\n {\n\n var e = Math.exp( this.re );\n var r = new Cpx( (e * Math.cos( this.im )) , (e * Math.sin( this.im )) );\n\n return( r );\n \n }",
"get sizeExponent() {\n return this.value & 0b111;\n }",
"function getExpone... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Dynamically creating the forms for scheduling | function renderPlanner() {
var currentTime = moment().format("H");
var currentClass = "";
var isDisabled = "";
for (i = 0; i < 9; i++) {
var time = "";
if (myStorage.getItem("use24hr") == "true") {
time = 9 + i;
} else {
time = twelveHr(9 + i);
}
if (current... | [
"function populateSchedulesForms(){\n for (var i = 0; i<24 ; i ++){\n var a = document.createElement('div');\n a.setAttribute(\"class\",\"tab-pane fade in\");\n a.setAttribute(\"id\",\"menu\"+i);\n document.getElementById(\"schedules_tabs\").appendChild(a);\n for (var j = 0; j<14; j++){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Main method to set/reset ID in headers | async function main_setHeadersIDs() {
// Validate if headers respect the hierarchy and add error in "Problem" panel view
const validationResult = await main_validateHeaders(true);
// If error found, stop the current process
if (validationResult != true) {
// vscode.window.showErrorMessage("It's impossible to set... | [
"function setHeaders(){\n\theaders = [\"ID\",\"Name\"];\n\tfor(var i=0;i<headers.length;i++){\n\t\toutlet(5,\"set \"+ i + \" 0\" + \"\\t\" + headers[i]);\n\t}\n}",
"function headerId(header) {\n var id = header.attr('id');\n\n if (id === undefined || id === '') {\n id = generateUniqueId(header);\n header.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this is used to reset the COMPLETED Flag for ALL Items | clearCompleted() {
records.forEach(function (todo, index) {
todo.completed = false
});
} | [
"markUncompleted(){\n\t\tthis.completed = false;\n\t}",
"clearCompleted() {\n\t\tthis.queryAll('li[completed]').forEach(item => item.remove());\n\t\tthis.save();\n\t\tthis.dispatchCountsUpdated();\n\t}",
"completeAll() {\n console.log('complete All todo');\n todoList.forEach((item) => {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
translate meta description for site | function translateMetaDescription(lang, dict) {
$("meta[name=description]")
.attr("content", dict[lang]["meta-description"]);
} | [
"function getPostSEODescription(post){\n const regex_description = /<p(.*?)>(.*?)<\\/p>/g;\n const meta_description = post.isHome ? config.description : [].concat(post.renderedContent.match(regex_description)).map(function(val){\n return val ? val.replace(/<p(.*?)>/g,'').replace(/<\\/p>/g,'') : '';\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Johnny Five Update the finger servos | function fingerChange (finger, value) {
console.log("finger - Arduino Change on: " + finger + ", to " + value);
arduinoServos[finger].to(value);
board.repl.inject({
s: arduinoServos
});
} | [
"function sweep() { \n server.log(\"sweeping\")\n // Write the current position\n setServo(position) \n // Invert the position\n position = 1.0 - position\n}",
"updateSwipe() {\n let lastDelta;\n if (this.swipe.curPos !== null && this.swipe.lastPos !== null) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gobj.state.constraintFrame = Max( [gobj, gobj.parents]).state.constraintFrame | function updateOneConstraintFrame(index, gobj, sketch) {
var i, parentGObj;
if( gobj.parentsList && gobj.parentsList.length) {
for( i = 0 ; i < gobj.parentsList.length; i++) {
parentGObj = gobj.parentsList[i];
if( parentGObj.state.constraintFrame > gobj.sta... | [
"get xMax() {return this.parentWidth - this.width;}",
"function getParentMaxBounds(shape) {\n var retval = null,\n diameter,\n parentBO = shape.parent.businessObject;\n var parent = shape.parent;\n if (parentBO.type === 'root') {\n retval = { x: 0, y: 0, heigh... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
hashes arrays (no delimiter) | valueIntoHash(values) {
var newArr = [];
var _this = this;
if ($.isArray(values)) {
values.map((value) => {
newArr.push(_this.getHash(value));
});
};
return newArr;
} | [
"function getHashArray( hash ) {\n return hash.split( '/' );\n }",
"function hashing2(arr){ \r\n let hash = {};\r\n arr.forEach(a => {\r\n hash[hashing(a)] = a; \r\n });\r\n return hash;\r\n}",
"valueIntoHash(values){\n\t\tvar newArr = [];\n\t\tvar _this = this;\n\t\tif($.isArray(values)){\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a control to the default column for this section | addControl(control) {
this.defaultColumn.addControl(control);
return this;
} | [
"get defaultColumn() {\r\n if (this.columns.length < 1) {\r\n this.addColumn(12);\r\n }\r\n return this.columns[0];\r\n }",
"static AddDefaultControl() {}",
"function defaultColHandler(v) { return v; }",
"addColumn(){\n var columnId = this.columns.length + 1;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tick / Note: All calls to Velocity are pushed to the Velocity.State.calls array, which is fully iterated through upon each tick. | function tick (timestamp) {
/* An empty timestamp argument indicates that this is the first tick occurence since ticking was turned on.
We leverage this metadata to fully ignore the first tick pass since RAF's initial pass is fired whenever
the browser's next tick sync time occurs, w... | [
"function tick(timestamp) {\n /* An empty timestamp argument indicates that this is the first tick occurence since ticking was turned on.\r\n We leverage this metadata to fully ignore the first tick pass since RAF's initial pass is fired whenever\r\n the browser's next tick sync time occurs, which ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Open arc pathways in a single shape or array of shapes | function openArcRoutes(paths, arcColl, routesArr, fwd, rev, dissolve, orBits) {
forEachArcId(paths, function(arcId) {
var isInv = arcId < 0,
idx = isInv ? ~arcId : arcId,
currBits = routesArr[idx],
openFwd = isInv ? rev : fwd,
openRev = isInv ? fwd : rev,
newB... | [
"function _path(r0, r1, a0, a1, cx, cy, isClosed) {\n cx = cx || 0;\n cy = cy || 0;\n var isCircle = isFullCircle([a0, a1]);\n var aStart, aMid, aEnd;\n var rStart, rEnd;\n if (isCircle) {\n aStart = 0;\n aMid = PI;\n aEnd = twoPI;\n } else {\n if (a0 < a1) {\n aStart = a0;\n aEnd = a1;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enters or leaves the kiosk mode. | setKiosk(flag) {
this.native.setKiosk(flag);
} | [
"function toggle_mode(ev)\n {\n ev.preventDefault();\n set_kiosk_mode(this.checked);\n ev.stopPropagation();\n }",
"function checkKioskMode() {\n\tvar url = new URL(window.location.href);\n\tvar kioskmode = url.searchParams.get(\"kioskmode\") || false;\n\n\tif (kioskmode)\n\t\tLOCKED_PAGES.push(\"faq\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate string that represent derivation | function derivationToPopUpFormat(der) {
var str = "";
for (var i = 0; i < der.length; ++i)
str += " " + nodeToPopUpFormat(der[i]);
return str;
} | [
"function derive(coefficient,exponent) {\n// Return the parameter values multiplied and then turned into a string, followed by exponent string and exponent value - 1 and converted to string, \n return (coefficient * exponent).toString() + \"x^\" + (exponent -1).toString()\n}",
"toStringGeneralLatex() {\n\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a function that just delegates to the named method of this._ and then returns this. | function wrapAndReturn(methodname) {
return function() {
this._[methodname].apply(this._, arguments);
return this;
};
} | [
"function _make_wrapped_method(name, fn) {\n return function() {\n var tmp = this._super;\n\n // Add a new ._super() method that is the same method\n // but on the super-class\n this._super = _super[name];\n\n // The method only need to be bound temporarily, so we\n //... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Data from JSON file | function getData(ID){
var filename = "./src/"+ID+".json";
var data = JSON.parse(fs.readFileSync(filename));
return data;
} | [
"function getJsonData(file) {\n return getFile('src/data/' + path.basename(file.path) + '.json');\n}",
"function getJsonData(){\n const JsonFileURL = \"https://keyur500.github.io/weirdDealsJSON/deals.json\";\n \n fetch(JsonFileURL)\n .then(resonse => resonse.json())\n .then(data =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
; public static const PREVIEW:ToolbarSkin = | function PREVIEW$static_(){ToolbarSkin.PREVIEW=( new ToolbarSkin("preview"));} | [
"function DEFAULT$static_(){ToolbarSkin.DEFAULT=( new ToolbarSkin(\"default\"));}",
"function LIGHT$static_(){ToolbarSkin.LIGHT=( new ToolbarSkin(\"light\"));}",
"function HEADER$static_(){ToolbarSkin.HEADER=( new ToolbarSkin(\"header\"));}",
"function WINDOW_HEADER$static_(){ToolbarSkin.WINDOW_HEADER=( new T... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Challenge Three Split a sentence into an array | function splitSentence(sentence) {
let words = [];
let wordCharacters = '';
for (let index = 0; index < sentence.length; index += 1) {
switch (true) {
case (sentence[index] === ' ' && wordCharacters !== ''):
words.push(wordCharacters);
wordCharacters = '';
break;
case (inde... | [
"function sentenceToArray(string){\n return string.split(\" \"); \n}",
"function splitSentences(input) {\n // regular expression is period, exclamation points, and question marks with any character after them\n // must include . after bracket or else one sentence returned will be an empty string\n var regEx =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Event handler fired when a foucs frame or highlight ( yellow ) frame is removed from the element Focus frame is shown when People Who Performed tool is used to "focus" and element | onFrameHide() {
this.isFrameShowing = false;
if (!this.isSelected) {
this.normalizeDisplayLabels();
}
} | [
"function _handleFrameMouseOut() {\n\t\t// Hide the highlight if the inline editor isn't open. Just a UI tweak.\n\t\tdomHighlight.css('display', 'none');\n\t}",
"function handleFrameMouseOut(e) {\n\n // Hide the highlight if the inline editor isn't open. Just a UI tweak.\n if (highlight)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the payload for the relationship of an individual record. This might return the raw payload as pushed into the store, or one computed from the payload of the inverse relationship. | get(modelName, id, relationshipName) {
this._flushPending();
if (this._isLHS(modelName, relationshipName)) {
return this.lhs_payloads.get(modelName, id);
} else {
(true && !(this._isRHS(modelName, relationshipName)) && Ember.assert(`${modelName}:${relationshipName} is not either side of this re... | [
"get(modelName, id, relationshipName) {\n this._flushPending();\n\n if (this._isLHS(modelName, relationshipName)) {\n return this.lhs_payloads.get(modelName, id);\n } else {\n (true && !(this._isRHS(modelName, relationshipName)) && Ember.assert(`${modelName}:${relationshipName} is not e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draws republican words onto the layout | function drawRep(words) {
svgRep.append("g")
.attr("transform", "translate(" + layoutRep.size()[0] / 2 + "," + layoutRep.size()[1] / 2 + ")")
.selectAll("text")
.data(words)
.enter().append("text")
.style("font-size", function(d) { return d.size + "px"; })
.style("fill", "#FF0000... | [
"function drawWords() {\n let centerX = (leftWristX + rightWristX)/2;\n let centerY = (leftWristY + rightWristY)/2;\n \n let leftHeight = abs(leftWristY - leftHipY);\n let rightHeight = abs(rightWristY - rightHipY);\n \n let avgHeight = (leftHeight + rightHeight)/2\n let handXDiff = int(leftWr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the filename without its extension | function getFilenameWithoutExtension(path) {
if (!path) {
return '';
}
var filename = path.substring(path.lastIndexOf('/') + 1);
var extensionLength = getFileExtension(filename).length;
return filename.slice(0, -(extensionLength + 1));
} | [
"function getFileNameWithoutExt(file){\r\n var f = file.substring(file.lastIndexOf('/'));\r\n return f.substring(1, f.lastIndexOf('.'));\r\n}",
"function trimFileExtension(filename)\n{\n\treturn filename.replace(/\\.[^/.]+$/, \"\");\n}",
"function popExt(filename) {\n return filename.split('.').pop();\n}",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If htmlTagWhiteList is configured on the server, replace/modify htmlTagWhiteList with the server value. if the 'configured htmlTagWhiteList' starts with +, the tags in config are added to the hardcoded htmlTagWhiteList; otherwise, 'configured htmlTagWhiteList' replaces htmlTagWhiteList If there is no configuration on t... | function _getHtmlTagWhitelist() {
var configHtmlTagWhitelist = _getConfigHtmlTagWhitelist(); // if jrsConfigs.xssHtmlTagWhiteList starts with +, the tags are added to the htmlTagWhiteList;
// o/w, jrsConfigs.xssHtmlTagWhiteList replaces htmlTagWhiteList
if (configHtmlTagWhitelist.length > 0 && !_getHtmlTagWhite... | [
"function _getConfigHtmlTagWhitelist() {\n var configHtmlTagWhitelist = jrsConfigs.xssHtmlTagWhiteList;\n configHtmlTagWhitelist = typeof configHtmlTagWhitelist === 'string' ? configHtmlTagWhitelist : \"\";\n configHtmlTagWhitelist = configHtmlTagWhitelist.replace(/\\s/g, ''); //remove the spaces from xss.soft.h... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find the caseSize of a given title | function findCaseSizeOfTitle(data, title) {
if (title === '') {
return data.children.reduce((a, c) => a + c.caseSize, 0);
}
if (data.title !== title) {
if (data.children) {
let match = 0;
data.children.forEach((d) => {
const res = findCaseSizeOfTitle(d, title);
if (res !== 0) {... | [
"function getFsSizeNeeded(titleInfo, catalogTitleSize, latestVersion)\n{\n var spaceNeeded = catalogTitleSize;\n if (isTitleUpdateAvailable(titleInfo, latestVersion)) {\n // Update available - use catalog titleSize for space needed\n } else if (typeof(titleInfo) == \"object\") {\n // No updat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
firstly closes the main navigation by changing height 100% to 0 % and it's children elements to display none. then opening the boards main page. | function closeMenu() {
var startNav = document.getElementById('startNav');
var boardSection = document.getElementById('board_section');
var boardContainer = document.getElementById('board_container');
document.getElementById('mv-scoreboard').style.visibility = "visible";
startNav.style.height = "0em... | [
"function loadMediumWindowContent(){\n\t$('nav').css('height','0px');\n\n\t// if any main nav items were active, remove the 'current' class\n\t$(\".current\").removeClass(\"current\");\t\n\t\n\tdisplayMobileSubnav();\n\t\n\t// if any of the subnav were visible, remove them.\n\t$('div#product-subnav').css('display',... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns true of the obj's primitive representation equals the passed in integer | function primitiveEqualsInteger(obj, integer) {
return obj.primitive && obj.primitive.numerator === integer && obj.primitive.denominator === 1
} | [
"function primitiveEqualsInteger(obj, integer) {\n return obj.meta.primitive && obj.meta.primitive.numerator === integer && obj.meta.primitive.denominator === 1\n}",
"function isInteger(obj) {\n return common.isInteger(obj);\n}",
"function isPrimitive(v) {\n if (v === undefined) return false;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Internal handler for a callback error or value | function _errorOr(value, callback) {
return function(err) {
if (err) {
return callback(err);
}
return callback(null, value);
};
} | [
"function error(err){if(error.err)return;callback(error.err=err);}",
"function error (err) {\n if(error.err) return;\n callback(error.err = err);\n }",
"function errorCallback(callback){return function(error){callback(error);throw error;};} // This utility function creates an anonymous handler function t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a new configuration as a merge of the two. Entries from the passed object takes priority over this object. | merge(rhs) {
return new Config(mergeInternal(this.config, rhs.config));
} | [
"mergeConfig ( new_config ) {\n return merge(this.config, new_config)\n }",
"function mergeConfig() {\n configuration = configuration || {};\n config = deepMerge(defaultConfiguration, configuration);\n }",
"function merge() {\n\t\t\tvar i,\n\t\t\t\targs = arguments,\n\t\t\t\tlen,\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attempts to get the retryafter value from a set of http headers. The retry time is originally denoted in seconds, so if present, it is converted to milliseconds | function tryGetRetryAfterValueTimeInMilliseconds(headers) {
if (headers['retry-after']) {
const retryTime = Number(headers['retry-after']);
if (!isNaN(retryTime)) {
core_1.info(`Retry-After header is present with a value of ${retryTime}`);
return retryTime * 1000;
}
... | [
"function parseRetryAfterHeader(now,header){if(!header){return defaultRetryAfter;}var headerDelay=parseInt(\"\"+header,10);if(!isNaN(headerDelay)){return headerDelay*1000;}var headerDate=Date.parse(\"\"+header);if(!isNaN(headerDate)){return headerDate-now;}return defaultRetryAfter;}",
"function parseRetryAfterHea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lots of parameters for this function. First 3 are standard. Row and Col are the starting row and col of the upperleft tile in the region. width and height are the number of cells to draw in the region x and y denote where to draw the upper left cell. Note that these usually will be negative (a bit cut off). hover warni... | render_region(ctx, tile_size, colors, row, col, start_row, end_row, start_col, end_col, x, y, hover_warning_tiles) {
if (start_row > 0) {
ctx.fillRect(0, 0,this.gui.window_width * tile_size, start_row * tile_size)
}
if (end_row <= this.gui.window_height) {
ctx.fillRect(0, tile_size * end_row + y, this.gui.w... | [
"showTile(){\r\n fill(this.hoverColor); \r\n\r\n stroke(0);\r\n strokeWeight(2);\r\n\r\n rect(this.x,this.y,this.w,this.h);\r\n \r\n if(this.clicked == true){\r\n fill(this.color);\r\n circle(this.x+this.w/2,this.y+this.h/2,this.h/2*1.5)\r\n } ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set a runner as idle: runner_id String, unique identifier for runner callback f(err) | function idleRunner(runner_id, callback) {
client.sadd('wf_idle_runners', runner_id, function (err) {
if (err) {
log.error({err: err});
return callback(new wf.BackendInternalError(err));
}
return callback(null);
});
} | [
"function isRunnerIdle(runner_id, callback) {\n client.sismember('wf_idle_runners', runner_id, function (err, idle) {\n if (err || idle === 1) {\n return callback(true);\n } else {\n return callback(false);\n }\n });\n }",
"function r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
extract just the committee of a string of the form: "[committee]/[topic]/[name]" | function getCommittee(txt) {
var result= "";
for (i = 0; i < txt.length; i++) {
if (txt.charAt(i) == '/')
break;
result += txt.charAt(i);
}
return result;
} | [
"function getTopic(bill) {\n var topic;\n if (bill.subjects_top_term === '') {\n topic = bill.committees.committee\n .replace(new RegExp('Senate '), '')\n .replace(new RegExp(' Committee'), '');\n }\n else {\n topic = bill.subjects_top_term;\n }\n topic = topic\n .repl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check Event host Make sure host name is not empty and length is less than 50 | function checkEventHost(e){
resetInnerHTML('errEventHost');
document.getElementById('eventHost').removeAttribute('class');
var host = document.getElementById('eventHost').value.trim();
var errorMsg = "";
if(host.length < 1) {
errorMsg += '* Event host required';
}
if(host.length > 50){
errorMsg ... | [
"function validHost(value) {\n return validEventName(value);\n}",
"function isValidHost(host) {\n return ((typeof host == \"string\") &&\n host.trim() != \"\");\n}",
"function checkEtcHost() {\r\n page.onResourceRequested = function(requestData, networkRequest) {\r\n var pattern = /https?... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The createModalWindow function does exactly that creates the modal window that provides more information on the user clicked on by the client. To add the 0 in front of months and days that are less than 10, I called the new Date() function, before calling the .getMonth() and .getDate() functions on its result. These va... | function createModalWindow(data, selected) {
let d = data[selected].dob.date;
let bDay = new Date(d);
let bDayMonth = bDay.getMonth();
bDayMonth += 1;
bDayMonth.toString();
if (bDayMonth < 10) {
bDayMonth = "0" + bDayMonth;
}
let bDayDate = bDay.getDate();
bDayMonth.toString();
if (bDayDate < 10) {
bDayD... | [
"function createModalWindow(data, userIndex) {\n const user = data[userIndex]\n //Formates the date of the user birth\n const date = new Date(user.dob.date)\n userBirthDate = date.getMonth() + 1 + '/' + date.getDate() + '/' + date.getFullYear()\n\n\n const userCellNum = formatPhoneNumber(user.cell)\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
save was successful, update field values to reflect what is returned from the server | function onSaveSuccess(data, response, xhr)
{
this.sidebar.layout.removeClass('saving');
this.data.field = data.field;
LiveUpdater.changedModel(this.data.field);
} | [
"function onSaveSuccess(data, response, xhr)\n\t{\n\t\t// update id's and scope in case they change\n\t\t// this happens when switching from global\n\t\t// to page specific fields (switching scope)\n\t\tthis.data.node.data = data;\n\t\tthis.data.node.data.originals = this.originals;\n\t\tthis.data.field = this.data... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
click magic cookies when they appear. If they lead to a frenzy then try to stack them with a spell | function checkForCookies() {
let cookieWrapper = document.getElementById("shimmers");
if (cookieWrapper && cookieWrapper.children.length) {
console.log("COOKIE!");
timeStamp();
// could be a cookie storm, so click all the cookies in there
for (var i=0; i< cookieWrapper.childr... | [
"function GiveCookie()\n\t{\n\t\t//Ethan looks forward when you start to give him a cookie...\n\t\tEnd();\n\n\t\tsetGiveCookieState(1);\n\n\t\t//Hide arm with cookie:\n\t\tHideCookie();\n\n\t\t//Move the cookie forward: cookie image and arm with cookie image are two separate images\n\t\tsetTimeout( \"ShowGiveCookie... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get first paragraph in last row | getFirstParagraphInLastRow(table) {
if (table.childWidgets.length > 0) {
let lastRow = table.childWidgets[table.childWidgets.length - 1];
let lastCell = lastRow.childWidgets[0];
let lastBlock = lastCell.childWidgets[0];
return this.getFirstParagraphBlock(lastBlock... | [
"getLastParagraph(cell) {\n while (cell.nextSplitWidget) {\n if (cell.nextSplitWidget.childWidgets.length > 0) {\n cell = cell.nextSplitWidget;\n }\n else {\n break;\n }\n }\n let lastBlock;\n if (cell.childWidgets... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a function that returns only the months ending in the letter 'y'. | function endInY() {
const regex = /y$/;
const yMonths = monthsArray.filter(month => month.match(regex))
return yMonths
} | [
"function lastmonth(m, y) {\n let month = m === 1 ? 12 : m - 1\n let year = m === 1 ? y - 1 : y\n let monthEnd = dM(month - 1)\n let monthText = month < 10 ? `0${month}` : month\n return (`from-date=${year}-${monthText}-01&to-date=${year}-${monthText}-${monthEnd}`)\n}",
"function filterMonths(months) {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
endif Helper module functions public function getMessages() returns string array | function getMessages(){
//if compile() throws, call getMessages() to retrieve compiler messages
//return logger.getMessages();
return logger.getMessages();
} | [
"static getMessages() {\n\t\ttry {\n\t\t\tconst messages = [];\n\t\t\t\n\t\t\tfor (const ele of this.getMessageElements()) {\n\t\t\t\ttry {\n\t\t\t\t\tconst props = this.getMessageElementProps(ele);\n\t\t\t\t\t\n\t\t\t\t\tif (props != null) {\n\t\t\t\t\t\tmessages.push(props.message);\n\t\t\t\t\t}\n\t\t\t\t} catch ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove targets from animation | function removeTargets(targets) {
const targetsArray = parseTargets(targets);
for (let i = activeInstances.length; i--;) {
const instance = activeInstances[i];
const animations = instance.animations;
for (let a = animations.length; a--;) {
if (arrayContains(targetsArray, animations[a].... | [
"function removeTargets(targets) {\n const targetsArray = parseTargets(targets);\n for (let i = arrayLength(activeInstances)-1; i >= 0; i--) {\n const instance = activeInstances[i];\n const animations = instance.animations;\n for (let a = arrayLength(animations)-1; a >= 0; a--) {\n if (a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the player object linked to given socket | getPlayerFromSocket(socket) {
return this.players[this.getNameFromSocket(socket)];
} | [
"function getPlayerObjectBySocket(key) {\n for (var i=0; i < players.length; i++) {\n if (players[i].socket === key) {\n return players[i];\n }\n }\n}",
"function findPlayer(socket){\n\tif(socket.hasOwnProperty('playerName')){\n\t\tif(Players.hasOwnProperty(socket.playerName))\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve total time from the LocalStorage. | static getTotalTime() {
let totalTimer = 0;
const profiles = Store.getProfiles();
if (localStorage.getItem('profiles') !== null) {
profiles.forEach((profile) => {
totalTimer += profile.monthTime;
});
}
return totalTimer;
} | [
"static getSavedGameTime() {\n const s = localStorage.getItem(`${Constant.GAMENAME}_time`);\n if (s !== null) {\n return Number(s);\n } else {\n return 0;\n }\n }",
"function setElapsed() {\n var time = endTime - startTime;\n timeElapsed += time;\n //var oldTime = chrome.storage.lo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function displayOrder displays the current order total and prompts the user if they would like to do another transaction or exit the app | function displayOrder(){
console.log("***********************************************************");
console.log("* Order Complete! *");
console.log("***********************************************************");
console.log("Your order:");
console.log("______... | [
"async displayOrderSummary() {}",
"function displayOrder(){\n // setOrderHeader();\n // setOrderHeader2();\n //setOrderBody();\n showHistoric();\n //addOrderValue(Value);\n // Value.forEach(addOrderHeader);\n }",
"function showFinalOrder() {\n inquire\n .prompt([\n {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get top accessed servers | async getTopAccessedServers(ts, te) {
let token = localStorage.getItem("interset_token");
axios.defaults.headers.common['Authorization'] = token;
// console.log(ts);
let url = `${API_URL}/api/search/0/servers/topAccessed?sort=maximum&markup=false&tz=UTC%2B8&count=10&keepAlive=300000`
if((ts!==0) && ... | [
"async getTopRiskyServers(ts, te) {\n let token = localStorage.getItem(\"interset_token\");\n axios.defaults.headers.common['Authorization'] = token;\n // console.log(ts);\n let url = `${API_URL}/api/search/0/servers/topRisky?sort=maximum&markup=false&tz=UTC%2B8&count=10&keepAlive=300000`\n if((ts!==... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=========================================================================== Compute the optimal bit lengths for a tree and update the total bit length for the current block. IN assertion: the fields freq and dad are set, heap[heap_max] and above are the tree nodes sorted by increasing frequency. OUT assertions: the fie... | function gen_bitlen(s, desc)
// deflate_state *s;
// tree_desc *desc; /* the tree descriptor */
{
var tree = desc.dyn_tree;
var max_code = desc.max_code;
var stree = desc.stat_desc.static_tree;
var has_stree = desc.stat_desc.has_stree;
var ext... | [
"function gen_bitlen(s, desc)\n\t// deflate_state *s;\n\t// tree_desc *desc; /* the tree descriptor */\n\t{\n\t var tree = desc.dyn_tree;\n\t var max_code = desc.max_code;\n\t var stree = desc.stat_desc.static_tree;\n\t var has_stree = desc.stat_desc.has_stree;\n\t var extra = desc.stat_desc.extra_bit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Push action onto the write queue | _push(...action) {
// If empty action, just return queue promise
if (action.length == 0) {
return this._queue ? this._queue.promise : undefined;
}
// Auto-compact
const {maxFileSize} = this.options;
if (maxFileSize != null && this._nBytes >= maxFileSize) {
this._nBytes = 0;
re... | [
"queue(action){\n Mediator.queue.push(action);\n }",
"registerActions () {\n this.writableStream._write = (command, encoding, callback) => {\n if (command.options) {\n this.thing.callAction(command.type, command.options);\n } else {\n this.thing.callAction(command.type);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
given the interval in string format, return the milliseconds in integer in order to be converted into dates. | function convertIntervalToNumber(interval){
interval_numbers = {"5min" : 300 * constants.MILLI,
"hour" : 3600 * constants.MILLI, "day" : 86400 * constants.MILLI };
interval_i = interval_numbers[interval];
return interval_i;
} | [
"function getTimeIntervalFromMiliseconds(miliseconds, interval = DateIntervals.SECONDS)\n{\n //Check if parameters are proper\n if(!checkIfDateInterval(interval))\n {\n throw Error(\"Date interval is invalid!\"); \n }\n\n if(isNaN(miliseconds))\n {\n throw Error(\"Passed paramete... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
V I E W I T E M S zoto_album_view_item_base Base class for the other album and set view items. It contains the DOM elements shared by the other view item types, as well as the format_title method that takes care of parsing and sizing the album/set title. | function zoto_album_view_item_base(options){
var options = options || {};
options.open_new_window = options.open_new_window || false;
this.$uber(options);
this.__connected = false;;//whether the connections have been made
//guts shared dom elements
this.el = DIV({'class':'invisible album_item'});
this.icon = ... | [
"function zoto_album_view_item(options){\n\tthis.$uber(options);\n\n\tthis.a_view_link = A({href:'javascript:void(0);'}, _('view in lightbox'));\n\n\t//menus\n\tthis.menu_edit = new zoto_album_menu_box_edit();\n\tthis.a_share =A({href:'javascript:void(0)'}, _('share'));\n\tthis.span_divider = SPAN({}, ' | ');\n\tth... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Relax mode show current button | function relaxModeShowCurrentButton() {
var $stopRelaxBtn = $("#relax-done-btn, #relax-done-btn-audio");
//$stopRelaxBtn.stop().css({"opacity" : 0, "display" : "inline-block"}).animate({"opacity" : 0.75}, {"duration" : 400, "queue" : false}); // Task #553
if(relaxBtnTimeOut)
clearTimeout(relaxBt... | [
"function show_next_button(){\n\t\t\t$(p.ref.get(1).next_btn).show().css({display:''});\n\t\t}",
"show() {\n this.button.removeClass(\"hidden\");\n }",
"buttons() {\n this.look.current.style.display = \"none\";\n this.hit.current.style.display = \"none\";\n this.reset.current.style.display = \"inli... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a string representing the suite for this formatter language. | function formatSuite(testSuite, filename) {
var suiteClass = /^(\w+)/.exec(filename)[1];
suiteClass = suiteClass[0].toUpperCase() + suiteClass.substring(1);
var formattedSuite = "<phpunit>\n"
+ indents(1) + "<testsuites>\n"
+ indents(2) + "<testsuite name='" + suiteClass + "'>\n";
for ... | [
"function formatSuite(testSuite, filename) { \n formattedSuite = 'require \"spec/ruby\"\\n' +\n 'require \"spec/runner\"\\n' +\n '\\n' +\n \"# output T/F as Green/Red\\n\" +\n \"ENV['RSPEC_COLOR'] = 'true'\\n\" +\n '\\n';\n \n for (var i = 0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Allows caller to join a staking pool as a maker. | joinStakingPoolAsMaker(poolId) {
const self = this;
assert_1.assert.isString('poolId', poolId);
const functionSignature = 'joinStakingPoolAsMaker(bytes32)';
return {
sendTransactionAsync(txData, opts = { shouldValidate: true }) {
return __awaiter(this, void 0,... | [
"async function makeAndTake() {\n let market = await Market.deployed();\n id = id.plus(1);\n await market.addOffer(product, price, arbiter);\n await market.takeOffer(id, arbiter, { from: taker, value: price });\n }",
"onSpawn() {\n // TODO: make the spawner or factory care about this\n const ty... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Construct a new `HttpResponse`. | function HttpResponse() {
var _this202;
var init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
_classCallCheck(this, HttpResponse);
_this202 = _super148.call(this, init);
_this202.type = HttpEventType.Response;
_this202.body = in... | [
"function HttpResponse() {\n var _this178;\n\n var init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, HttpResponse);\n\n _this178 = _super82.call(this, init);\n _this178.type = HttpEventType.Response;\n _this... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Overall timer tick function, called every second. Depending on seconds remaining, call playTick() or lobbyTick(). Or (if time to change between play lobby) call firstXxxTick() instead. One sec after lobby time begins, check whether our cadence is out of sync if it is, the lobby interval is adjusted to bring the cadence... | function timerTick(context)
{
// logNow('timerTick(): \tsecsRemaining:\t' + secsRemaining + ' \t');
if (secsRemaining >= SECS_IN_LOBBY)
{
playTick(context);
if (secsRemaining == SECS_IN_LOBBY)
{
firstLobbyTick(context);
}
}
else if (se... | [
"function firstTick(context)\n {\n if (secsRemaining == 0)\n {\n secsRemaining = SECS_IN_COMPLETE_CYCLE;\n }\n if (secsRemaining <= SECS_IN_LOBBY)\n {\n firstLobbyTick(context);\n }\n else\n {\n firstPlayTick(context);\n }\n logNow('firstTick... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Import and add module to specific module path. | function addModuleImportToModule(host, modulePath, moduleName, src) {
const moduleSource = getSourceFile(host, modulePath);
if (!moduleSource) {
throw new schematics_1.SchematicsException(`Module not found: ${modulePath}`);
}
const changes = ast_utils_1.addImportToModule(moduleSource, modulePath... | [
"importModule(module_path) {\n if(!module_path.startsWith('./') && !module_path.startsWith('.\\\\')) {\n module_path = './' + module_path;\n }\n let module = require(module_path)\n this.modules[module.command] = module;\n }",
"function addModuleImportToModule(host, module... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extract the numeric part of the version string. | function GetVersion(versionString)
{
var numericString =
versionString.match(/([0-9]+)\.([0-9]+)\.([0-9]+)/i);
return numericString.slice(1);
} | [
"function parseVersionNumber(versionString) {\n return parseFloat(versionString.replace(/[^\\d.]/g, ''))\n }",
"versionStringToNumber(v) {\n\t\tvar v = parseInt(v.replace(/\\./g, \"\"));\n\t\tif(v < 100) {\n\t\t\tv = parseInt(v + \"0\");\n\t\t}\n\t\treturn v;\n\t}",
"function parseVersionNumber (version... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Printing ==================== Function: LoadVBPrinter Purpose: Load Visual Basic printing commands for VB enabled browsers. Input: Output: Loads (writes out) visual basic printing functions. Assumptions: Javascript Globals: gblnIE, gblnCanPrint, gblnMac History: DDSN created back in the Distant Past ===================... | function LoadVBPrinter() {
if (gblnIE && !gblnCanPrint && !gblnMac) with (document) {
writeln('<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');
writeln('<' + 'SCRIPT LANGUAGE="VBScript">');
writeln('Sub window_onunload');
writeln(... | [
"function PrintPage() {\n if (gblnCanPrint) {\n window.print();\n } else if (gblnIE && !gblnMac) {\n vbPrintPage();\n } else {\n alert(\"Your web browser does not appear to support the automatic\\nPrint function. To print this page, please select the \\\"Print\\\"\\noption from the \\\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compares the layers props with old props from a matched older layer and extracts change flags that describe what has change so that state can be update correctly with minimal effort | diffProps(newProps, oldProps) {
const changeFlags = diffProps(newProps, oldProps);
// iterate over changedTriggers
if (changeFlags.updateTriggersChanged) {
for (const key in changeFlags.updateTriggersChanged) {
if (changeFlags.updateTriggersChanged[key]) {
this.invalidateAttribute(k... | [
"updateMapStyle(nextPropsMapStyle) {\n\n // if the mapStyles prop (passed in from redux) is null/empty, nothing\n // to do here\n if (this.props.mapStyle === null || isEmpty(this.props.mapStyle)) {\n return\n };\n\n const thisMap = this.webmap;\n\n // uses the stylesheets read into Immutable ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add category font awesome icon class to an element / Requires: / elem: Element to which the class will be applied / category: Name of the category who's icon class will be applied | function setSelectIcon(elem, category) {
// Call getCategoryIconClass() to return the icon class string
let iconClass = getCategoryIconClass(category.toLowerCase());
// Add the class to the element
elem.addClass(iconClass);
} | [
"function getCategoryIconClass(category) {\n // Call getCategory() to return the icon class string\n return getCategory(category.toLowerCase()).category_icon;\n}",
"function categoryIcon() {\n switch (props.category) {\n case 1:\n return <Icon className=\"fa fa-medkit category-item\" />;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A public method to set the application name to be used by the client | function setApplicationName(appName) {
_appName = appName;
} | [
"function setApplicationName(applicationName) {\n _appName = applicationName;\n }",
"function set_app_name(appname) {\n app_name = appname;\n}",
"setApplicationName(name) {\n this[local.config].module = name;\n }",
"function setApplicationName(value) {\n __params['an'] = value;\n}",
"function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Meeting is joinable 30 minutes before start and until the end of the meeting | get isJoinable() { return !this.hasEnded && Now > this.startTime.plus(minutes(30)) } | [
"function canUserTakeBreak(listOfEvents){\n var currentDate = moment().utc();\n\n for(var i =0; i<listOfEvents.length;i++){\n var start = moment(listOfEvents[i].start.dateTime).utc()\n var end = moment(listOfEvents[i].end.dateTime).utc()\n\n var differenceBetweenStartAndCurrent = Math.abs(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
a single roll can have allocations allowed multiple times. // allocation only allowed for rolls which are either card assigned + stocked in or wip of any department. // if same allocation is requested as already present, discard it too. | async departmentalAllocation(rollAllocation) {
try {
const rollIds = await Promise.all(rollAllocation.map((roll) => roll.RollId));
// // if rolls are stocked in then allocation can be done to any other department other than warehouse.
// // else if rolls are outside W... | [
"checkForReleasedIds(){\n for(let i = 0; i < this[usedIds].length; i++){\n let id = this[usedIds][i];\n if(id.Available === 1){\n this[usedIds].splice(i, 1);//remove from usedlist\n this[unusedIds].push(id);\n }\n }\n this.Amount = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Common function to add loading image. Accepts three parameters elem, position, image_name. Available images names are 'loading_small_purple.gif', 'loading_medium_purple.gif', 'loading_large_purple.gif', 'loading_small_black.gif', 'loading_medium_black.gif', 'loading_large_black.gif', 'loading_small_black_purple.gif', '... | function addLoadingImage(elem, position, image_name, width, height, additional_class)
{
image_name = typeof image_name !== 'undefined' ? image_name : "loading_small_purple.gif";
width = typeof width !== 'undefined' ? width : "0";
height = typeof height !== 'undefined' ? height : "0";
additional_class = typeof addit... | [
"function addLoadingImage(elem, position, image_name, width, height, additional_class)\n{\n\timage_name = typeof image_name !== 'undefined' ? image_name : \"loading_small_purple.gif\";\n\twidth = typeof width !== 'undefined' ? width : \"0\";\n\theight = typeof height !== 'undefined' ? height : \"0\";\n\tadditional_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
changing from mouse to keyboard setting | function settingsChange(e)
{
if(mouseSetting.disabled === true)
{
mouseSetting.disabled = false;
keyboardSetting.disabled = true;
}
else
{
mouseSetting.disabled = true;
keyboardSetting.disabled = false;
}
} | [
"function keyPressed() {\n if( keyCode === 32 ) { // keyCode === 32 is spacebar\n ez = !ez; // toggle easy mode\n }\n}",
"setMouseMode(state) {\n if (typeof state === \"boolean\") {\n state = state ? 2 : -1;\n }\n\n if (state < 0) {\n this.write(this.database.exitMouse);\n } else if (th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compare two comment trees to find the comments that only exist in the second tree. The children of new comments will not be contained in the returned array, however these child comments can still be accessed via the "Children" array of each parent. Effectively this function returns an array of new comment trees. input ... | function compareCommentTrees(base, compare) {
var diff = [];
for (var i = 0; i < compare.length; i++) {
var thisCommentIsNew = false;
if (!commentTreeContainsId(base, compare[i].CommentID)) {
diff.push(compare[i]);
thisCommentIsNew = true;
}
// If this com... | [
"function sortComments(comments) {\n comments.sort(comp);\n $.each(comments, function() {\n this.children = sortComments(this.children);\n });\n return comments;\n }",
"function arrangeCommentTree(cmtList) {\n var maxDepth = 0;\n var newCmtList = cmtList.slice();\n\n var lis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check whether the digit string has consecutive bits | function isConsBits(/*String:digit string string for checking*/ digit){
for(var i=1; i<digit.length-1; i++ ){
var formerBit = parseInt(digit[i-1],10);
var currentBit = parseInt(digit[i],10);
var latterBit = parseInt(digit[i+1],10);
if(formerBit+1==currentBit && currentBit+1 == latter... | [
"function binIsValidRwx(s)\n{\n reString = \"^([01]){9}$\";\n var re = new RegExp(reString);\n\n // Careful: this is not the same as \"return s.match(re);\"\n // because we are coercing the result to be treated as a boolean...\n\n if (s.match(re)) {\n\treturn true;\n } else {\n\treturn false;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to retrieve pallet weight of transaction_detail | function getTransactionPalletWeight() {
var trx_pallet_weight = '0.000';
if (null != transaction_details[getFieldValueById("trxtransactiondetails-pallet_no")]) {
var trx_pallet_weight = parseFloat(transaction_details[getFieldValueById("trxtransactiondetails-pallet_no")]['pallet_weight']);
}
return trx_pallet_weig... | [
"function getTransactionPalletWeight() {\n\tvar trx_pallet_weight = 0;\n\tif (null != transaction_details[getFieldValueById(\"trxtransactiondetails-pallet_no\")]) {\n\t\tvar trx_pallet_weight = transaction_details[getFieldValueById(\"trxtransactiondetails-pallet_no\")]['pallet_weight'];\n\t}\n\t\n\treturn trx_palle... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
loads questions and answers in appropriate space. Also gives the intended answer a correctanswer flag | function loadQuestion() {
callTimer(numMinutes);
getAnswer1.removeAttr("Correct-Answer");
getAnswer2.removeAttr("Correct-Answer");
getAnswer3.removeAttr("Correct-Answer");
getAnswer4.removeAttr("Correct-Answer");
getQuestion.text(questionsArr[QuestionNum].question);
... | [
"function loadQuestion(){\n\t\n\t\tanswer = allQuestions[i].chosenAnswer;\n\t\n\t\t// disable the next button if the question is unanswered. Make sure it is enabled\n\t\t// if there was an answer given\n\t\t// also mark a radio button as checked if the answer is present\n\t\t// this is needed for to allow for back ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
finds all the neighbors of a given node based on the data for the probability for moving between nodes | function getNeighbors(probabilities, nodeLabel){
var neighbors = [];
//loop through all of the probabilities and find
//where the given nodeId is the first one listed
//and store the nodes the given node is connected to
for(var i = 0; i < probabilities.length; i++){
if(probabilities[i][0] === nodeLabel){
nei... | [
"function getNeighbours(node) {\n var parent = node.parentNode,\n data = DataGraphics.getData(node);\n\n return {\n prev: data.prev ? DataPointUtils.findByDataPointId(parent, data.prev) : undefined,\n next: data.next ? DataPointUtils.findByDataPointId(parent, data.next... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if is chinese of not | function isChinese(value) {
var len = value.length;
var cnChar = value.match(/[^\x00-\x80]/g);
return cnChar !== null;
} | [
"function hasChinese(char) {\n return /[\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u3005\\u3007\\u3021-\\u3029\\u3038-\\u303B\\u3400-\\u4DBF\\u4E00-\\u9FFC\\uF900-\\uFA6D\\uFA70-\\uFAD9]|\\uD81B[\\uDFF0\\uDFF1]|[\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883][\\uDC00-\\uDFFF]|\\u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
init_tunnel_cluster("fake", "127.9.2.1", 1, 10000); throws exception on fail | async function init_remote_cluster(name, browserURL, tabs, timeout) {
let puppeteer_cluster = await Cluster.launch({
concurrency: Cluster.CONCURRENCY_REMOTE_PAGE,
maxConcurrency: tabs,
puppeteerOptions: {
headless: true,
ignoreHTTPSErrors: true,
browserURL: browserURL,
},
//monit... | [
"function kn_loopback__restartTunnel()\n{\n}",
"function connect_to_cluster(cb) {\n log('connect_to_cluster: Connecting to cluster ' + CLUSTER_HOSTNAME +\n ' of type ' + CLUSTER_TYPE + ' as user ' + CLUSTER_USER);\n if (CLUSTER_TYPE === 'slurm') {\n log('connect_to_cluster: Setting up actu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a promise to an HTML Div element with an embedded VegaLite or Vega visualization. The element has a value property with the view. By default all actions except for the editor action are disabled. The main use case is in [Observable]( | function container(spec, opt = {}) {
return __awaiter(this, void 0, void 0, function* () {
const wrapper = document.createElement('div');
wrapper.classList.add('vega-embed-wrapper');
const div = document.createElement('div');
wrapper.appendChild(div);
const action... | [
"renderInteractiveVega() {\n return new Promise((resolve, reject) => {\n const vegaElements = this.previewElement.querySelectorAll(\".vega, .vega-lite\");\n function reportVegaError(el, error) {\n el.innerHTML =\n '<pre class=\"langu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Noop matchMedia replacement for nonbrowser platforms. | function noopMatchMedia(query) {
// Use `as any` here to avoid adding additional necessary properties for
// the noop matcher.
return {
matches: query === 'all' || query === '',
media: query,
addListener: function addListener() {},
removeListener: function... | [
"function noopMatchMedia(query) {\n // Use `as any` here to avoid adding additional necessary properties for\n // the noop matcher.\n return {\n matches: query === 'all' || query === '',\n media: query,\n addListener: function addListener() {},\n removeListener: function removeListener() {}\n };\n}"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
after waypoints have been moved, recalculations are necessary: update of internal variables, waypoint type exchange,... | function handleMovedWaypoints(atts) {
var index1 = atts.id1;
var index2 = atts.id2;
//waypoint-internal:
var set1 = waypoint.getWaypointSet(index1);
var set2 = waypoint.getWaypointSet(index2);
waypoint.setWaypoint(index1, set2);
waypoint.setWaypoint(index2, set1);
// map.switchMarkers(index1, ... | [
"_updateWaypoints() {\n this._calculatedWaypointsX = [];\n this._calculatedWaypointsY = [];\n this._calcWaypoints(\n this._waypointsX,\n this._calculatedWaypointsX,\n this.getScrollWidth(),\n \"x\"\n );\n\n this._calcWaypoints(\n this._waypointsY,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Main toplevel component which should render the main routes in the student client. Currently only renders the default `/:workId/editing` route since this client isn't setup with a submission workflow. | function App() {
return (
<Switch>
<Route path="/work/:workdId/editing" component={EditingPage} />
<Route component={NoMatch} />
</Switch>
);
} | [
"openEditPage(sid) {\n ipcRenderer.send('load', {page: 'students_edit', id: sid, type: 'student', currentPage: 'students'})\n }",
"openEditPage(sid) {\n ipcRenderer.send('load', {page: 'teachers_edit', id: sid, type: 'teacher', currentPage: 'teachers'})\n }",
"render() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
use async await for handle asynchronous calls. For send api requests use componentDidMount lifecyle method. componentDidMount() method is the perfect place, where call the setState() method to change the state of sensors and render() the updated data loaded JSX. For example, we are going to fetch any data from an API t... | async componentDidMount() {
try {
/*
Initial update request calls to API and this methods executes only once.
Without this method first 10 seconds not any get request called to an API
*/
this.updateSensor1();
this.updateSensor2();
this.updateSensor3();
this.updateSensor4();
thi... | [
"async componentDidMount() {\n\t\t\ttry {\n\t\t\t\tconst resInitial = await axios.get(\"http://localhost:4000/getAllSensors\");\n\t\t\t\t/*\n\t\t\tInitial get request calls to API and this method executes only once.\n\t\t\tWithout this method first 40 seconds not any get request called to an API\n\t\t */\n\t\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fin funciones Ratings Estrellas SharePoint / Funciones Likes SharePoint este es el evento que hay que vincular con el a o span con el texto de me gusta | function clickBotonMeGusta(selectorDivMeGusta, listID, itemID) {
var meGusta = false;
var textoBotonLike = $(selectorDivMeGusta + " .botonLike").text();
if (textoBotonLike != "") {
if (textoBotonLike == "Me gusta") { meGusta = true; }
SP.SOD.executeFunc("sp.js", "SP.ClientContext", function... | [
"function likesCount(r) {\n\n $('figure#'+ r.id + ' .likes-count').html(\"Liczba polubień: \" + r.photo_likes);\n const likesIndication = $('figure#'+ r.id + ' .likes-indication');\n if (likesIndication.children().data('value') == \"1\") {\n likesIndication.html('<span class=\"btn bt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
job success system callback | function successCb(){
dbm.updateJobFinish(uuid, function(err, rows, fields){
if(err) log.error('update status error:', err);
delete jobpool[uuid];
})
} | [
"onJobSuccess(response) {\n this.currentJob.jobSuccess(response);\n this.queue.dequeue();\n if (this.queue.isEmpty()) {\n this.currentJob = null;\n return;\n }\n this.currentJob = this.queue.peek();\n this.processJob();\n }",
"function callbackJob... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Data enumerator for applications with a HTTP Strict Transport Security service builtin. | function builtinEnumerator(dataService) {
var stuff = [];
var subdomhosts = [];
var stshosts = [];
var permmgr = Cc['@mozilla.org/permissionmanager;1']
.getService(Ci.nsIPermissionManager);
var enumerator = permmgr.enumerator;
while (enumerator.hasMoreElements()) {
var nextPerm = enum... | [
"getSecurityInfo () {\n return this.request('getSecurityInfo')\n }",
"constructor() {\n this.state = \"secure\"\n this.securityState = Ci.nsIWebProgressListener.STATE_IS_SECURE\n this.errorCode = Cr.NS_OK\n this.shortSecurityDescription = \"Content Addressed\"\n this.SSLStatus = {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that executes request and allocate room to either free or busy array | function executeRequest (freeRequest, calendarID, roomName) {
//executing request.
freeRequest.execute(function (resp) {
//appending rooms to array whether busy or free
if (resp.calendars[calendarID].busy.length < 1) {
console.log(`${roomName} is free`);
freeR... | [
"function pull_Requests_To_QueueSystem()\n{\n // Check for new requests that need to be made!\n // handle case where object is just blank (or hasn't been setup yet)\n \n // So this next section is ONLY IF global_CurrentUseCaseObject IS NOT NULL OR EMPTY..\n \n if(global_CurrentUseCaseObject === nu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Callback function for resistance value | function calculateResistanceCallback() {
// get inputs from the DOM
var current = document.getElementById("current").value;
var voltage = document.getElementById("voltage").value;
// sanitize inputs
current = parseFloat(current);
voltage = parseFloat(voltage);
// ver... | [
"static onRSSIValuechanged(res){\n DeviceEventEmitter.addListener('FabacusOnRSSINewValue', (e) => {res(e)})\n }",
"calculateResonanceFunction() {\n let resonanceMap = [85, 15, 0].map((v) => v ** ( (this.resonance-5) / 2 ))\n\n let ret = normalizeAndGetRandomFromMap(resonanceMap)\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If a change has been acknowledged, can be expanded to have an array of responses to add variety. | function successfulChange(response){
response.tell('Merry Christmas!');
} | [
"function addImmediateChoiceResponses(state, userResponse) {\n\n var immediateResponses = userResponse.getIn(['responses'])\n\n if ( immediateResponses == undefined) {\n // no immediate responses\n console.log('// no immediate responses')\n return state\n }\n\n\n\n const nextState = state.update('feed'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hides the parent directory row from table since breadcrumb provides more functionality | function hideParentDirFromTable() {
var parentDirLinkBox = document.getElementById('parentDirLinkBox');
parentDirLinkBox.style.display = 'none';
} | [
"function resetTreeVisiblity () {\n let row = bookmarksTable.rows[0]; // Start at first row in table (which btw cannot be hidden)\n let level;\n while (row != null) {\n\t// We are on an intended to be visible row,\n\trow.hidden = false;\n\t// Check if this is a folder and if meant to be open\n\tif ((row.dataset.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
subscribe to all events in the map | init(){
for(let record of map){
for(let subscriber of record.subscribers){
this.eventPool.on(record.event,subscriber(this.logService));
console.log('subscriber is listenning for '+record.event)
}
}
} | [
"_subscribeToAllEvents() {\n for (const key in Autodesk.Viewing) {\n if (key.endsWith('_EVENT')) {\n this._viewer.addEventListener(\n Autodesk.Viewing[key],\n function(event) {\n console.log(key, event);\n }\n );\n }\n }\n }",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================ Refresh waypoints function ============================================== | function waypointsRefresh(){
setTimeout(function(){
$.waypoints('refresh');
},1000);
} | [
"function waypointsRefresh() {\n\t\tsetTimeout(function() {\n\t\t\t$.waypoints('refresh');\n\t\t}, 1000);\n\t}",
"function waypointsRefresh() {\n setTimeout(function () {\n $.waypoints('refresh');\n }, 1000);\n }",
"function waypointsRefresh() {\n setTimeout(function () {\n $.waypo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
when start time change, update minimum for end timepicker | function tpStartSelect( time, endTimePickerInst ) {
$('#eventEndTime').timepicker('option', {
minTime: {
hour: endTimePickerInst.hours,
minute: endTimePickerInst.minutes
}
});
} | [
"function tpStartSelect( time, endTimePickerInst ) {\n $('#timepicker_end').timepicker('option', {\n minTime: {\n hour: endTimePickerInst.hours,\n minute: endTimePickerInst.minutes\n }\n });\n}",
"function setMinEnd() {\n var startInput = $('#startTime').val();\n va... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Column_INT extends NumericColumn ============================================================================= | function Column_INT() {} | [
"function Column_INTEGER() {}",
"function NumericColumn() {}",
"function Column_NUMERIC() {}",
"function Column_BIGINT() {}",
"function Column_MEDIUMINT() {}",
"function Column_SMALLINT() {}",
"function Column_DECIMAL() {}",
"function isIntegerDBColumnType(columnType)\n{\n var retVal = false;\n\n v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Conditional subtype based on the primary organisation type. Currently this is only required for statutory bodies. A fallback step title is provided for display on the summary when the primary organisation type hasn't been provided yet. i.e. for new applications | function stepOrganisationSubType() {
let title = localise({
en: 'Organisation sub-type',
cy: 'Is-fath y sefydliad',
});
if (currentOrganisationType === ORGANISATION_TYPES.STATUTORY_BODY) {
title = localise({
en: 'Type of statutory body',
... | [
"typeInfoLabel(){\n const { typeInfo, context, schemas } = this.props;\n if (typeInfo && typeInfo.title){\n return (\n <span className=\"type-info inline-block\" data-tip={(typeInfo && typeInfo.description) || null}>\n { typeInfo && typeInfo.title }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the error if it is a 409 conflict, return false if it is another error. | function isBulkWriteConflictError(err) {
if (err && err.status === 409) {
return err;
} else {
return false;
}
} | [
"function isConflict() {\n return operationError.request.status === 409 || operationError.request.status === 412;\n }",
"function isConflictResponse(response) {\n return response.status === 409;\n }",
"get conflict() {\n return this.status == 409 || this.status == 412;\n }",
"hasConflict() {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
multiple generators per wave | function uniqueWave(wl, amp, gens){
this.hertz = w/wl;
this.points = [];
this.wavelength = wl;
this.amplitude = amp;
this.gen = gen;
this.init = function(){
for (var i = 0; i < this.wavelength*this.hertz; i++){
this.points.push(createVector(i, this.gen.next().value));
... | [
"emit() {\n for (let i=0; i<this.count; i++) {\n let p = this.generator(this);\n //this.psys.add(p);\n }\n }",
"function generate_waveforms(){\n// 0.25, (2/PI)sin(PI/4), (1/PI)1, (2/3PI)sin(.75 PI) //short fourier transform for 25% pulse cycle\nvar real = new Float32Array([... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |