query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
author: Ali El Zoheiry. description: takes the column number of the column that reached the required height, and start making it fade in and out every 500 mili seconds. params: col: the column number of the column to be flashed success: the height of this column is greater than 7, it will start flashing. failure: | function suspenseCont(col){
suspenseTimerArray[col] = setTimeout(function(){
var suffix = "-" + col;
$("td[id*=" + suffix + "]").fadeTo('fast', 0.7).fadeTo('fast',1);
suspenseCont(col);
}, 500);
} | [
"function triggerCol(col) {\n col = floor(col);\n\n for (let r = 0; r < rows; r++) {\n if (grid[r][col]) {\n chirps[r][currentBank].play();\n }\n }\n}",
"function fadeIn() {\n i += 20;\n if (i > 500) {\n // Stop the interval as modal has reached it's max\n modalImg.style.opacity = 1;\n cl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
bool IsToolbarInstalled(strCTID) /This function returns true if the toolbar /with the given CTID is installed. | function IsToolbarInstalled(strCTID) {
var oToolbar = new TPI.Toolbar(strCTID);
var oRes = oToolbar.IsVisible();
return oRes.returnValue;
} | [
"function RefreshToolbarByCTID(strCTID) {\n var oToolbar = new TPI.Toolbar(strCTID);\n var oRes = oToolbar.Refresh();\n return oRes.returnValue;\n }",
"function AddComponentByXML(strXML, strCTID) {\n var oToolbar = new TPI.Toolbar(strCTID);\n var oRes = oToolbar.AddComponentB... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create product quantity: input | function createQtyInput(){
const qtyInput = document.createElement("input");
qtyInput.setAttribute("class", "prod-qty")
qtyInput.setAttribute("placeholder", "0");
qtyInput.setAttribute("type", "number");
return qtyInput;
} | [
"function quantityChanged(event) {\n let input = event.target;\n if(isNaN(input.value) || input.value <= 0) {\n input.value = 1\n }\n let id = input.parentElement.previousElementSibling.children[2].innerText\n updateQuantityLocalStorageBasket(id)\n updateBasketTotal();\n}",
"function upda... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
IMGUI_API void SetScrollX(float scroll_x); // set scrolling amount [0..GetScrollMaxX()] | function SetScrollX(scroll_x) { bind.SetScrollX(scroll_x); } | [
"function scrollStep(x, y) {\n if (x !== 0) {\n const originX = parseFloat(Data.Svg.Node.style.left);\n const deltaX = window.innerHeight * x;\n const left = originX - deltaX;\n Data.Svg.Node.style.left = left.toFixed(0) + 'px';\n }\n if (y !== 0) {\n const originY = parseFloat(Data.Svg.Node.style... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Define the MeasureQueryParams constructor | function MeasureQueryParams(params) {
// calling super constructor
StatisticsQueryParams.call(this, params);
} | [
"initializeFilterValuesFromQueryString() {\n this.clearAllFilters()\n\n if (this.encodedFilters) {\n this.currentFilters = Object.keys(this.encodedFilters).map(\n key => ({ name: key, value: this.encodedFilters[key] })\n )\n\n thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
addDefinitionListButtons DESCRIPTION: Automatically creates and binds events to expand/collapse all buttons designed for improving UX of OUE site definition lists. PARAMETERS: slctrDefList: selector string for locating definition list elements within the DOM that contain collapsible definitions expandAllClass: CSS clas... | function addDefinitionListButtons(slctrDefList, expandAllClass, collapseAllClass, btnDisablingClass,
dtActivatingClass, ddRevealingClass, animSldDrtn) {
var thisFuncName = "addDefinitionListButtons";
var thisFuncDesc = "Automatically creates and binds events to expand/collapse all buttons designed for improving U... | [
"function attachListItemButtons(li) {\r\n let up = document.createElement(\"button\");\r\n up.className = \"up\";\r\n up.textContent = \"Up\";\r\n li.appendChild(up); \r\n \r\n let down = document.createElement(\"button\");\r\n down.className = \"down\";\r\n down.textContent = \"Down\";\r\n li.appendChild... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds all the questions of a quiz. | function findAll(quizId) {
// Find the parent quiz.
return findParentQuiz(quizId)
.then((quiz) => {
if (quiz) {
// Find the questions.
return quiz
.getQuestions({
// Exclude foreign keys.
attributes: {
exclude: ['quizId']
},
... | [
"function getAllQuestionParts() {\n $.ajax({\n url: 'get/',\n dataType: 'json'\n }).done(function(data) {\n initQuestionParts(data['questions']);\n }).fail(function(request, error) {\n console.log('Error while getting all question parts');\n });\n }",
"function setAvailableQuestio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get all info about an owned shoe. This creates a handy object that includes both the saved data as well as vanity (name, icon) | getShoe(save) {
if (save == null)
return null;
let shoe = _.cloneDeep(save)
let base = data.shoes[shoe.id];
shoe.name = base.name;
shoe.icon = base.icon
shoe.legProtection = base.legProtection;
shoe.modifierText = []
shoe.flags = [];
/... | [
"getPokeDetails() {\n let pokeData = this.state;\n return {\n name: pokeData.name,\n imgData: this.getPokeImgs(pokeData.sprites),\n type: this.getPokeType(pokeData.types),\n hp: pokeData.base_experience,\n weight: pokeData.weight,\n hei... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[MSXLS] 2.5.10 Bes (boolean or error) | function parse_Bes(blob) {
var v = blob.read_shift(1), t = blob.read_shift(1);
return t === 0x01 ? BERR[v] : v === 0x01;
} | [
"function SysFmtToBoolean(){}",
"function recordsetDialog_onClickOK(theWindow, sbRecordset)\r\n{\r\n if (!sbRecordset.checkData(false))\r\n {\r\n alert(sbRecordset.getErrorMessage());\r\n }\r\n else\r\n {\r\n dwscripts.setCommandReturnValue(recordsetDialog.UI_ACTION_OK);\r\n theWindow.close();\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
revoke btn for expanding revoke btn on hover | function revoke_mouseover(revo)
{
revo.classList.remove('btn-revoke-in-active');
revo.classList.add('btn-revoke-active');
} | [
"function revoke_mouseout(revo)\n{\n revo.classList.remove('btn-revoke-active');\n revo.classList.add('btn-revoke-in-active');\n}",
"function toggleIconToMinus() { \r\ndocument.getElementById(\"plus\").style.display=\"none\"; document.getElementById(\"minus\").style.display=\"block\"; \r\n}",
"function u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Makes current user's scribbles (un)selectable | function toggleSelectable (qid, c, isSelectable) {
var layersList = $('#scribing-layers-' + qid);
// Hide scibbles by other users
layersList.find('option').each(function (i, o) {
$(o).data('toggleLayer')(false);
});
// Make own scribbles un/selectable
$.each(c.getObjects(), function (i, obj) {
obj.s... | [
"get selectable() { return true }",
"highlight() {\n this.model.set('isSelected', true);\n }",
"function activateSkull() {\n\tisClickable = false;\n\tif (!isSkullEnabled) {\n\t\t$(\"#darknessFalls\").fadeIn(300, function () {\n\t\t\t$(\".text-effect\").textEffect({fps: 10})\n\t\t\t$(\"#skullOn\").fadeIn(200... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds any shape to the canvas | function AddShapeToCanvas(shape){
self.canvas.add(shape);
self.DropDefault_X +=10;
self.DropDefault_Y +=10;
self.canvas.isDrawingMode = false;
} | [
"add(shape) {\n // store shape offset\n var offset = shape.__position;\n\n // reset shapes list cache\n this.__shapes_list_c = void 0;\n\n // add shape to list of shapes and fix position\n this.__shapes.push({\n shape: shape,\n offset: offset.clone()\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates a markov chain for the headlines | function markov()
{
var generator = titlegen.create();
generator.feed(headlines);
saveHeadline(generator.next());
} | [
"function generateDescriptionChain(length) {\n var descriptions = [];\n for (var i = 1, j; i <= length; i++) {\n var inTriples = [],\n outTriples = [];\n for (j = 1; j <= (i > 1 ? conditionCount : 1); j++)\n inTriples.push('?a' + j + ' ex:' + relation + i + ' ?b' + j + '.');\n outTriples.push... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the next character from the expression. The character is stored into the char c. If the end of the expression is reached, the function puts an empty string in c. | function next() {
index++;
c = expression.charAt(index);
} | [
"function next() {\n\n\tvar c = getc();\n\tif(c == '/') {\n\t switch(peek()) {\n\t\tcase '/':\n\t\t for(; ; ) {\n\t\t\tc = getc();\n\t\t\tif(c <= '\\n') {\n\t\t\t return c;\n\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase '*':\n\t\t //this is a comment. What kind?\n\t\t getc();\n\t\t if(peek() == '!') {\n\t\t\t// ki... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Responds to button touches and executes functions to assign the correct value for the player's selection button.rock.addEventListener("touchstart", pressTheButton); button.paper.addEventListener("touchstart", pressTheButton); button.scissors.addEventListener("touchstart", pressTheButton); | function pressTheButton() {
value = this.value;
playerInput(value);
cpuInput();
determineWinner();
display();
} | [
"function buildGameButton(){\n\tbuttonStart.cursor = \"pointer\";\n\tbuttonStart.addEventListener(\"click\", function(evt) {\n\t\tplaySound('soundButton');\n\t\tgoPage('tutorial');\n\t});\n\t\n\tbuttonGotIt.cursor = \"pointer\";\n\tbuttonGotIt.addEventListener(\"click\", function(evt) {\n\t\tplaySound('soundButton'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
save the whole form on field blur | function startListenerSaveOnChange() {
var inputValue = []
$(".auto-save").on('focus', 'input', function () {
//save value form field on focus to test latter if it had changed
inputValue[$(this).prop('name')] = $(this).val();
})
$(".auto-save").on('change', " input[type='radio'], select,... | [
"onBlur(event) {\n let payload = Immutable.fromJS(this.props).set('value', this.state.value);\n Dispatcher.dispatch(FIELD_BLUR, payload.toJSON());\n }",
"handleBlur() {\n this._focussed = false;\n }",
"function afterSubmit() {\n getAllQuotes()\n form.reset()\n form.elements[0].focus()\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates the group total and places it in the totalTd provided using a clone of the | function calculateGroupTotal(cellsToTotal, totalTd, groupTotalDiv, rowIndex, columnIndex) {
var total = 0;
var values = new Array();
var hasInvalidValues = false;
var extraData = groupTotalDiv.data("params");
var functionName = groupTotalDiv.data("function");
for (var i = 0; i < cellsToTotal.l... | [
"function GroupTotals() {\n this.__groupTotals = true;\n\n /***\n * Parent Group.\n * @param group\n * @type {Group}\n */\n this.group = null;\n }",
"writeTotals(model) {\n \tmodel.colorRowTotals.forEach((val, index) => {\n \t\tdocument.getElementById(`tot... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Getter for the end marker. This object is sent when queue is shutdown | get end() {
return this.endMarker;
} | [
"get endTimeZoneName()\n\t{\n\t\treturn this._endTimeZoneName;\n\t}",
"get endTimeZoneId()\n\t{\n\t\treturn this._endTimeZoneId;\n\t}",
"get stopped() {\n return Memory.getObject(allProperties, this).stopped;\n }",
"getTail() {\n return this._tail;\n }",
"get minorTickEndExtent() {\n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return block object from next pieces queue | function getNextBlock () {
// ensure something to pull from
fillBag();
// take block from next pieces queue
let nextBlock = nextPieces.pop();
// ensure STILL something to pull from
fillBag();
return nextBlock;
} | [
"getLatestBlock() {\n return this.chain[this.chain.length - 1];\n }",
"function loadNextItem() {\n\tif (queue.length === 0) {\n\t\t// if there's something playing stop it.\n\t\tloadCandidate(null);\n\t\t\n\t\tif (refillingQueue) {\n\t\t\t// loadNextItem will be called when the queue is refilled\n\t\t\treturn;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the translated text for the key | function translate(key) {
var lang = getLang(),
text = translations[key];
if (typeof text === 'undefined') {
if (SC_DEV) { console.log('Unable to get translation for text code: "'+ key + '" and language: "' + lang + '".'); }
return '-';
}
return text;
} | [
"function translate(text, dictionary){\n\t// TODO: implementați funcția\n\t// TODO: implement the function\n}",
"function getStringBasedOnLocale(langDictKey, stringKey, obj) {\n return substitute(langDictionary['en'][langDictKey][stringKey], obj || {}) || '[UNKNOWN]';\n }",
"function getString(key)\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
receive message to block and toggle blocked to 1, to 0 if message means to unblock. | function updateBlockMedia(message){
if("blockMedia" in message){
console.log("blocking");
blocked =1;
}else if("unblockMedia" in message){
console.log("not blocking");
blocked =0;
}
} | [
"flipBlock(){\n if(!this.started) return false;\n if(this.active.flip(this.grid)) postMessage(this.state);\n else console.log(\"couldn't flip\");\n }",
"is_blocker() {\n return true;\n }",
"function blockUnblock(_block, peerIds) {\n if (typeof _block !== 'boolean') {\n thro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create the no cookies notification message | function createNoCookiesNoticeBox(message) {
$('<div/>', { 'class': 'alert is--warning no--cookies' }).append($('<div/>', { 'class': 'alert--icon' }).append($('<i/>', { 'class': 'icon--element icon--warning' }))).append($('<div/>', {
'class': 'alert--content',
'html': message... | [
"function showInitialSystemNotificationMessageIfExists()\n{\n\tvar notificationIDInput = document.getElementById('system_notification_id');\n\tif (notificationIDInput == null)\n\t\treturn;\n\t\n\tvar notificationID = notificationIDInput.value;\n\tif (notificationID == null)\n\t\treturn; // no message present\n\t\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a ChangeDetectorRef (a.k.a. a ViewRef) | function injectChangeDetectorRef() {
return createViewRef(getPreviousOrParentTNode(), getLView(), null);
} | [
"function ref(callback) {\n return {\n type: 'ref',\n callback: callback,\n }\n }",
"onRef (ref) {\n this.childComponentFunctions = ref\n }",
"constructor(props) {\n super(props);\n this.inputElementRef = React.createRef();\n }",
"render() {\n return (\n <Checkbox\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sanityCheck() Checks to make sure that the user is requesting a possible password (Called from updatePassRequirements()) | function sanityCheck(){
if(!passLowerCase && !passUpperCase && !passNumeric && !passSpecial){
// We can't have a password without anything in it!
passLowerCase=true;
document.getElementById("include-lowercase").checked=true;
}
if(passLength>maxPassLength){
// Larger passwords are more secure, but ... | [
"function checkRequirements() {\n if (password!==repeatPassword && repeatPassword.length > 0) {\n firstInputIssuesTracker.add(\"passwords must match\");\n }\n\n if (password.length < 8) {\n firstInputIssuesTracker.add(\"fewer than 8 characters\");\n } else if (password.length > 100... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mocks the kWidget object | function _kWidgetMock() {
root.kWidget = {
api: class {
/**
* mock constructor for the kWidget api class
*/
constructor() {
this.doRequest = (obj, cb) => {
cb(response);
};
}
},
};
} | [
"function setActiveWidget(type) {\n switch (type) {\n // if measure distance is clicked\n case \"distance\":\n activeWidget = new DistanceMeasurement2D({\n viewModel: {\n view: view,\n mode: ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checkBody comes from the express validator tests the desc (not empty) and album id (numeric) checks field and gives error message | function validatePhoto( req, res, next){
req.checkBody('description', 'Invalid description').notEmpty();
req.checkBody('album_id', 'Invalid album_id').isNumeric();
// checks whether the validation lib detected any issues with the performed tests
var errors = req.validationErrors();
if (errors) {
var response = {e... | [
"function validateFormulaBody(req, res, next){\n const bodyContent = req.body;\n const badReqError = \"request body must be a { formula } object\";\n if(typeof bodyContent !== 'object' || !bodyContent){\n return sendBadReqError(res, badReqError);\n } \n if(Object.keys(bodyContent).length !== 1 |... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the window for the node | function get_window(node) {
return get_document(node).defaultView;
} | [
"function createWindow(nodeint) {\r\n\treturn new BrowserWindow({\r\n\t\twidth: 800,\r\n\t\theight: 600,\r\n\t\twebPreferences: {\r\n\t\t\tnodeIntegration: nodeint\r\n\t\t}\r\n\t});\r\n}",
"function getTestWindow () {\n\n var iframe,\n w = getWindow(),\n testWindow = null;\n \n if (w) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes in github ID of developer and returns the starindex i.e. If the starindex of a developer is s, then he/she has s repositories with at least s stars while the remaining repositories have less than s stars. | function getStarIndexRepos(userId)
{
var options = {
url: urlRoot + "/users/" + userId + "/repos",
method: "GET",
headers: {
"User-Agent": "EnableIssues",
"content-type": "application/json",
"Authorization": token
} ,
};
// Send a http request to url and specify a callback that will be called upo... | [
"function getStarCount(repos) {\n return repos.reduce((count, { stargazers_count }) => count + stargazers_count, 0);\n}",
"function getStarredRepos(users) {\n\n let loopEndPoint = users.length;\n let loopCounter = 0;\n let namesOfStarredRepos = [];\n\n// Given an array of github user names\n users.forEach(fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setup() Creates the predator and prey objects | function setup() {
createCanvas(500,500);
// Instantiate the predator using the constructor
predator = new Predator(width/2,height/2,25,5,color(255,0,0));
// Run a loop numPrey times to create each prey
for (var i = 0; i < numPrey; i++) {
// Instantiate a new prey object
var newPrey = new Prey(random(... | [
"_preload () {\n const preloader = new Preloader();\n\n preloader.run().then(() => { this._start() });\n }",
"function setup() {\n state = model.geneticEngine().state(); // Cleanup.\n\n cancelTransitions();\n viewportG.selectAll(\"g.genetics\").remove();\n g = null;\n\n if (!model.get(\"DNA\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function randomly chooses specified number of questions (numberOfQuestions) from source pool of questions (sourcePool) and adds them to list of questions used for that quiz instance (destinationPool). | function randomizeQuestions(sourcePool, destinationPool, numberOfQuestions) {
/* numberOfQuestions must NOT excede the number of questions in source pool.
If it does, we set it to the number of questions available in the main pool */
if (numberOfQuestions > sourcePool.length)
numberOfQuestions = sourcePoo... | [
"function randQ(){\n for (let i = triviaQuestion.length -1; i > 0; i--){\n const j = Math.floor(Math.random()*i);\n const temp = triviaQuestion[i];\n triviaQuestion[i] = triviaQuestion[j];\n triviaQuestion[j] = temp;\n }\n for (let i=0; i < 5; i++){\n randArr.push(triviaQ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SET THE INITIAL CALENDAR DATE TO TODAY OR TO THE EXISTING VALUE IN dateField | function setInitialDate() {
// CREATE A NEW DATE OBJECT (WILL GENERALLY PARSE CORRECT DATE EXCEPT WHEN "." IS USED AS A DELIMITER)
// (THIS ROUTINE DOES *NOT* CATCH ALL DATE FORMATS, IF YOU NEED TO PARSE A CUSTOM DATE FORMAT, DO IT HERE)
calDate = new Date(inDate);
// IF THE INCOMING DATE IS INVALI... | [
"function setToday() {\n\n \n // SET GLOBAL DATE TO TODAY'S DATE\n calDate = new Date();\n\n // SET DAY MONTH AND YEAR TO TODAY'S DATE\n var month = calDate.getMonth();\n var year = calDate.getFullYear();\n\n // SET MONTH IN DROP-DOWN LIST\n tDoc.calControl.month.selectedIndex = month;\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
responsible for increasing the count of the petCount property on the cat object | function petCat(){
cat.petCount++
drawCat()
} | [
"incrementCount() {\n _count.set(this, _count.get(this) + 1);\n _price.set(this, Number(_price.get(this)) + Number(_product.get(this).getPrice()));\n }",
"function numPeticIncrement() {\n var userId = getUserId(),\n petitions = getPetitions(),\n typeUs = t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
To enable mouseSupport, you can call your FlipCard.mouseSupport.add(); | get mouseSupport() {
const _this = this;
return {
add() {
for (const card of _this.options.domObjects.cardList) {
card.addMouseSupport();
}
return _this;
},
remove(... | [
"function enableClickOnCard () {\n\topenCardList[0].click(flipCard);\n}",
"implementMouseInteractions() {\t\t\n\t\t// mouse click interactions\n\t\tthis.ctx.canvas.addEventListener(\"click\", this.towerStoreClick, false);\n\t\t\n\t\t// mouse move interactions\n\t\tthis.ctx.canvas.addEventListener(\"mousemove\", t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The method will query the DB to return the gameID of the given team ids | async function getGameID(game_time,home_team_id, away_team_id){
let result = await DButils.execQuery(`SELECT gameid FROM Games Where GameDateTime = '${game_time}' AND
((HomeTeamID = ${home_team_id} AND AwayTeamID = ${away_team_id}) OR
(HomeTeamID = ${away_team_id} AND AwayTeamID = ${home_team_id}))`)
if(result.... | [
"async function getTeamsGames(team1, team2, seasonId){\n const games = await db_utils.execQuery(\n `SELECT gameId, homeTeam, awayTeam FROM Games WHERE seasonId='${seasonId}' AND \n ((homeTeam='${team1}' AND awayTeam='${team2}') \n OR (homeTeam='${team2}' AND awayTeam='${team1}'))`\n );\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
========= get_datadicts_from_sel_btn ======== // PR20230504 | function get_datadicts_from_sel_btn() {
return (selected_btn === "btn_ete_exams") ? ete_exam_dicts :
(selected_btn === "btn_duo_exams") ? duo_exam_dicts :
(selected_btn === "btn_ntermen") ? ntermentable_dicts :
(selected_btn === "btn_results") ? grade_exam_result_... | [
"function get_datadict_from_table_element(el){\n return get_datadict_from_tblRow(t_get_tablerow_selected(el));\n }",
"function get_datadict_from_table_element(el){\n// --- lookup exam_dict in ete_exam_rows or in grade_exam_rows\n const tblRow = t_get_tablerow_selected(el);\n const map_id ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: deepClear clears and recreates If called with an object created using deepPrototype, deepClear will restore it to its original state. If called on an object that has one prototype level, the result will be an object with a deep prototype. If called on an object that has no prototype, results in an empty objec... | function deepClear(obj, up, level) { //** Change so to this uses prototypes of objects instead of trying to copy their members... **** Done, but need to test...
shallowClear(obj);
return deepProto(obj, up, level);
} | [
"function deepCopy (obj, up, level) { //** With changes made to deepUpdate, is this now the same as deepProto??? ****I think it's a little different... I think the copy has no prototype at the top level, so a shallowClear will result in an empty object.\r\n\t//**I think there's a problem here now. Changing <obj> wi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
:: OBJECT|VOID > this|OBJECT Sets "attribs" OBJECT with given OBJECT: NOTE: If no argument is given, set attributes are returned: | attribs(attribs) {
if (attribs === undefined) {
return this._attribs;
} else {
if (typeof(attribs) === "object") {
this._attribs = attribs;
return this;
}
throw new _Error_main_js__WEBPACK_IMPORTED_MODULE_2__.default("YngwieElement attributes can only be set with OBJECT",... | [
"attribs(arg) {\n let argtype = _Util_main_js__WEBPACK_IMPORTED_MODULE_1__.default.getType(arg).toUpperCase();\n switch (argtype) {\n case \"OBJECT\":\n this._elem.attribs(arg);\n return this;\n case \"UNDEFINED\":\n return this._elem.attribs();\n default:\n throw ne... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creating new zombie id | function newZombieId() {
let id = new Date();
return id.getTime();
} | [
"function uniqueId() {\n return id++;\n }",
"function do_create() {\n let id;\n // Check if we already have an id or if\n // we need to generate a new one.\n if (null != ent.id$) {\n // Take a copy of the existing id and\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a function for postV3ProjectsIdBuildsBuildIdRetry | postV3ProjectsIdBuildsBuildIdRetry(incomingOptions, cb) {
const Gitlab = require('./dist');
let defaultClient = Gitlab.ApiClient.instance;
// Configure API key authorization: private_token_header
let private_token_header = defaultClient.authentications['private_token_header'];
private_token_header.apiKey = ... | [
"postV3ProjectsIdPipelinesPipelineIdRetry(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function should be called before updating $scope.state.params | function updateStateParams(newParams, updateHistory, updateUrl) {
updateHistory = _.isUndefined(updateHistory) || !!updateHistory;
updateUrl = _.isUndefined(updateUrl) || !!updateUrl;
var isEmbedded = $scope.isEmbedded;
// Remove all items after current and then store current
if (updateHi... | [
"function updateState() {\n\t\t\tvar state = {\n\t\t\t\tday : scope.day,\n\t\t\t\tdriverName : scope.selectedDriverRun && scope.selectedDriverRun.driverName,\n\t\t\t\tstartRun : scope.selectedDriverRun && scope.selectedDriverRun.startRun,\t\t\t\t\n\t\t\t\tstore : scope.store\n\t\t\t};\t\n\t\t\t_.chain(state).extend... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handling the dropdown's filter state. | dropdownSelected(eventKey, event) {
event.preventDefault();
this.props.dispatch({type: "setSetsFilter", filter: eventKey})
.then(() => {
if (this.filterListState.current.value) this.filterList();
});
} | [
"function handleFilter () {\n $('.js-checked-filter').on('change', function (){\n let usrInput;\n if( $(this).is(':checked') ) usrInput = 'noCheckedItems';\n else {usrInput = 'noFilter';}\n\n setFilter(usrInput);\n renderShoppingList();\n });\n}",
"onBetFiltersChange(filter) {\n\t\tthis.setState(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if any hover tooltips are currently active. | function hasHoverTooltips(state) {
return state.facet(showHoverTooltip).some((x) => x)
} | [
"_isHovering() {\n if (this._dock.hover) {\n return true;\n } else {\n return false;\n }\n }",
"function IsItemHovered(flags = 0) {\r\n return bind.IsItemHovered(flags);\r\n }",
"function PopUp_Hover() {\n var _return = false;\n\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
tw: Stop running the VM Note: This only stops the loop. It will not stop any threads the next time the VM starts | stop() {
this.runtime.stop();
} | [
"function stop() {\n\tif (monitorThread) {\n\t\tclearInterval(monitorThread);\n\t\tmonitorThread = null;\n\t} else {\n\t\tconsole.err(\"ERR: Attempted to halt monitor thread but no instance existed.\")\n\t}\n}",
"stop() {\n if (!this.stopped) {\n for (let timeout of this.timeouts) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
id/slug/key helpers If the input is a string, it's the key/slug/id. Otherwise, if it exists, assume it's a project/repo/PR Otherwise, use this pageState's project/repo/PR. | function getProjectKey(projectOrKey){if(typeof projectOrKey==='string'){return projectOrKey;}else if(!projectOrKey){throw new Error(AJS.I18n.getText('bitbucket.web.error.no.project'));}return projectOrKey.getKey?projectOrKey.getKey():projectOrKey.key;} | [
"function inputFromInputId (inputId) {\n let keypath = ractive.get(`inputLinks.${inputId}`)\n if (keypath) {\n return ractive.get(keypath)\n }\n }",
"function processGitHubData(data) {\n const { login, id } = data;\n // only works with two names\n return {\n username: login,\n id... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to draw scatter plot, x,y = origin x, y are the center of graph, w = the width, h = height, data0: data for yaxis, maxData0/minData0 = min&max for yaxis, name0 = name of yaxis, 0 is use for y axis, 1 is use for xaxis | function scatterPlot(x, y, w, h, data0, maxData0, minData0, name0, data1, maxData1, minData1, name1){
var gap0 = (maxData0 - minData0) / 10.0;
var gap1 = (maxData1 - minData1) / 10.0;
var iNumb = 10;
fill(0);
text(name0, x - 1.1* w / 2, y - 1.2 * h / 2);
fill(0);
text(name1, x + 1.2 * w / 2, y + 1.1 ... | [
"function plot(can,ctx,x,y,xwidth,ywidth,options){\n\n}",
"static netScatterPlot (canvasID,position,size,data) {\n let canvas = document.getElementById(canvasID);\n let ctx = canvas.getContext('2d');\n // draw rectangle\n ctx.beginPath();\n ctx.fillStyle = 'rgb(220,220,220)';\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Starts the IntroJS tutorial. | function startIntro(){
var intro = introJs();
intro.setOptions({
steps: [
{
intro: "Welcome! This webpage will help you explore unemployment data in different areas of Münster."
},
{
element: '#settingsBox',
intro: "Use this sidebar to customize the data that is displayed on the map.",
... | [
"function startIntro(){\n var intro = introJs();\n intro.setOptions({\n steps: [\n { \n intro: \"Hello world!\"\n },\n {\n element: document.querySelector('.cont'),\n intro: \"This is a tooltip.\"\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check for changes and commit them if there are any | function commit_changes(file, user, message)
{
// try to diff file in repo
simpleGit.diff([ file ], function(err, data) {
if(err) {
console.error(err)
return;
}
if(data) // diff is not empty
commit(file, user, message);
});
// check for new files not added in repo
simpleGi... | [
"function checkForUntrackedChanges(cb){\n git.changes((changes) => {\n if(changes){\n if(changes.untracked){\n mess.warning(\"You have uncommitted changes. They will be stashed and returned to you after deployment\");\n mess.yesOrNo(\"Stash changes and continue?\",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return true if new pool | function addRqPool(key, cb) {
var isNew = false,
pool = rqPool[key];
if (!pool) {
pool = [];
rqPool[key] = pool;
isNew = true;
}
pool.push(cb);
return isNew;
} | [
"isBusy() {\n return this.totalTasks() >= this.options.maxPoolSize;\n }",
"checkPoolStatus(cb, scope) {\n // Check connection pool settings are the same for the active pool\n if (\n this.checkConnectionDetails(\n this.options.mySQLSettings,\n this.poolSettings[this.currentSessionId()]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends `default.json` that matches the path of the request from the data dir. Assumes a rigid directory structure that matches the route exactly. | function sendDefault(req, res) {
var endpoint,
splitPath = req.params[0].split('?')[0].split("/"),
mockPath = mockFileRoot + req.params[0] + '/' + 'default.json',
mockResponse;
if (splitPath.length > 2)
endpoint = splitPath[splitPath.length - 2];
try {
res.json(getMock(mockPath))
} ... | [
"function getDefault (id, data) {\n\tconsole.log(data);\n\tvar source = cat(MESSAGE_DIR+id);\n\treturn swig.render(source, {locals: data});\n}",
"function loadDefault(category, type, model, callback) {\n var defaultPath = path.join(templatePath, category, \"default\", model);\n fs.stat(defaultPath, function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
delete all info under the playlist delete the option from select deletePlaylist(STRING); | function deletePlaylist(plname){
//incase plname include any special charactor that cannot use as key name
var pname = replaceSpecialCharactors(plname);
$("#selectPlaylist option[value='" + pname + "']").remove();
database.ref("users/" + user + "/playlists/" + pname).remove()
.then(()=>{
... | [
"function deleteSong(plname, songname, artistname){\n //incase plname, sname, aname include any special charactor that cannot use as key name\n var pname = replaceSpecialCharactors(plname);\n var sname = replaceSpecialCharactors(songname);\n var aname = replaceSpecialCharactors(artistname);\n\n datab... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates all the error values for a given set of error lines. | function calculateErrorValues(errorLines) {
const { control:controlLines, accuracy:accuracyLines } = errorLines
// Control
const { left, right } = controlLines
const control = Math.abs(left[0] - left[1]) + Math.abs(right[0] - right[1])
// Accuracy
const accuracy = accur... | [
"function mse(errors) {\n let sum = 0;\n for (let errorIdx = 0; errorIdx < errors.length; ++errorIdx) {\n sum += Math.pow(errors[errorIdx], 2);\n }\n return sum / errors.length;\n }",
"function MultiError(errors)\n\t{\n\t\tmod_assertplus.array(errors, 'list of errors');\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates a selector for headings with level inside the headingIndexLevel or with the index attribute, that do not also have the noindex attribute | static generateHeadingSelector(headingIndexingLevel) {
let headingsSelectors = ['.always-index:header', 'h1'];
for (let i = 2; i <= headingIndexingLevel; i += 1) {
headingsSelectors.push(`h${i}`);
}
headingsSelectors = headingsSelectors.map(selector => `${selector}:not(.no-index)`);
return hea... | [
"function tocSetupHeadingClasses() {\n\n\tfunction getDepth(element, currentDepth=0) {\n\t const elemParent = tocGetParent(element);\n\t if (elemParent) {\n\t\treturn getDepth(elemParent, currentDepth + 1);\n\t } else {\n\t\treturn currentDepth;\n\t }\n\t}\n\n\tfor (const elem of document.querySelectorA... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
rollForWinner() Input None Output Returns winner from array of actual entries | function rollForWinner()
{
var randomNum = Math.floor(Math.random() * raffleArray.length);
winner = raffleArray[randomNum];
return winner;
} | [
"function pickWinner () {\n let pRnd = []\n\n for (key in this.players) {\n pRnd.push(this.players[key])\n }\n\n let ticket = Math.floor((Math.random() * pRnd.length) + 1)\n return pRnd[ticket]\n\n }",
"function computeWinner() {\n let winner;\n if (YOU['score'] ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
initialize the columns on a FlexGrid | function initializeColumns(flex) {
let promises = [flexgridService.getColumns(), flexgridService.getDatas()];
$q.all(promises).then(function(values){
var cols = values[0];
var datas = values[1];
//Define Columns
angular.fo... | [
"function initializeColumns() {\n const columns = [\n //first column\n {\n title: ' Title',\n dataIndex: 'title'\n },\n //second column\n {\n title: 'Description',\n dataIndex: 'description'\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION: extGroup.queueDocEditsForDelete DESCRIPTION: This function queues the document edits that are need to delete the given server behavior. This function calls extPart to queue the edits for each participant. ARGUMENTS: groupName string the name of the group file to queue delete edits for sbObj ServerBehavior obj... | function extGroup_queueDocEditsForDelete(sbObj)
{
//walk the list of participants
var parts = sbObj.getParticipants();
for (var i=0; i < parts.length; i++)
{
//schedule each participant edit to the document
extPart.queueDocEditsForDelete(parts[i]);
}
} | [
"function ServerBehavior_queueDocEditsForDelete()\n{\n extGroup.queueDocEditsForDelete(this);\n return true;\n}",
"function extPart_queueDocEditsForDelete(partObj)\n{\n var partName = partObj.getName();\n var nodeSeg = partObj.getNodeSegment();\n var version = partObj.getVersion();\n\n var optionFlags = 0;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Closes the success dialog | function closeSuccessDialog() {
successDialog.classList.add("dialog-success__hide");
// Timeout for autohide and closing animations
setTimeout(() => {
successDialog.classList.remove("dialog__show");
successDialog.classList.remove("dialog-success__hide");
}, 200);
} | [
"function save() {\n dialogOut.dialog( \"close\" );\n }",
"function cpsh_onFinish(evt) {\n evt.preventDefault();\n finishConfirmDialog.hidden = true;\n WapPushManager.close();\n }",
"@action closeDialog() {\r\n\t\tif (this.dialog) this.dialog.opened = false;\r\n\t}",
"function submitS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================== Common preparations ============================== / Constructor : BAEnvironment constructor of 'BA' global single object. | function BAEnvironment() {
/** debug mode flag
@type Boolean */
this.debugMode = false;
/** document
@type Document @const @private */
var d = document;
/** document.implementation
@type Object @const @private */
var di = d.implementation;
/** document.documentElement
@type Node @const @pri... | [
"function setup_environment() {\n const primitive_function_names =\n map(f => head(f), primitive_functions);\n const primitive_function_values =\n map(f => make_primitive_function(head(tail(f))),\n primitive_functions);\n const primitive_constant_names =\n map(f => head(f), ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
bare_metal computed: true, optional: false, required: false | get bareMetal() {
return this.getBooleanAttribute('bare_metal');
} | [
"get metallic() {}",
"set metallic(value) {}",
"isRequired () {\n\t\tconst definition = this.definition;\n\t\treturn ('required' in definition) && definition.required === true;\n\t}",
"function Demand()\n{\n this.id = undefined;\n this.version = undefined;\n this.user = undefined;\n this.mustTags ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
before move needs to initial sumInFront and numInFront | function beforeMove(){
sumInFront = 0;
numInFront = 0;
} | [
"function sumPrevious (index, num) {\n if (num <= 1) {\n return data[index][1];\n }\n else {\n return data[index][1] + sumPrevious(index - 1, num - 1)\n }\n }",
"function sumNextQueue(nextQueue){}",
"function calculateStackState(firstS, nextS, sInx, sOff) {\n if (!statesLen) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================= Funcion para llenar la tabla auditoria_inspecciones_ascensores, trayendo del servidor los items en un archivo JSON ============================================== | function llenarTablaAscensorValoresAuditoriaAscensores(){
var cod_inspector = window.localStorage.getItem("codigo_inspector");
var parametros = {"inspector" : cod_inspector};
$.ajax({
async: true,
url: "http://www.montajesyprocesos.com/inspeccion/servidor/php/json_app_ascensor_valores_auditoria_ascensore... | [
"function obtenerCodigoInspeccionesPendientesAscensores(estado){\n $('#ascensores').show('fast');\n db.transaction(function (tx) {\n var query = \"SELECT * FROM auditoria_inspecciones_ascensores WHERE o_estado_envio = ?\";\n tx.executeSql(query, [estado], function (tx, resultSet) {\n for(var x = 0; x <... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Transform a translate3D string to an object x:pos, y:pos, z:pos; | function translate3DToObject(value) {
value = value.toString();
var pattern = /([0-9\-]+)+(?![3d]\()/gi,
positionMatched = value.match(pattern);
return {
x: parseFloat(positionMatched[0]),
y: parseFloat(positionMatched[1]),
z: parseFloat(positionMatched[2])
};
} | [
"move3d(x1, y1, z1)\n {\n this.x=x1; this.y=y1; this.z=z1;\n this.rotate();\n\n this.cx=Math.floor(this.x);\n this.cy=Math.floor(this.y);\n }",
"function gTranslate(x,y,z) {\r\n modelViewMatrix = mult(modelViewMatrix,translate([x,y,z])) ;\r\n}",
"function stringToV3(s){\n\t\ts = s.split(',');\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParsercreate_procedure_body. | visitCreate_procedure_body(ctx) {
return this.visitChildren(ctx);
} | [
"visitProcedure_body(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitProcedure_spec(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitType_procedure_spec(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitProcedure_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitCreate_fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new Aurora PostgreSQL database cluster engine. | static auroraPostgres(props) {
return new AuroraPostgresClusterEngine(props.version);
} | [
"static aurora(props) {\n return new AuroraClusterEngine(props.version);\n }",
"function connect(poolConfig) {\n return new Db(pg.Pool(poolConfig));\n}",
"function createDb() {\n pluses_db.run(\"CREATE TABLE pluses (nick text, pluses)\", function(err) {\n if (err) {\n console.log... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
drawSeriesBars(series, ctx, plotOffset, plotWidth, plotHeight, drawSymbol, getColorOrGradient) This function is used for drawing series represented as bars. In case the series has decimation function attached, before starting to draw, as an optimization the points will first be decimated. The series parameter contains ... | function drawSeriesBars(series, ctx, plotOffset, plotWidth, plotHeight, drawSymbol, getColorOrGradient) {
function plotBars(datapoints, barLeft, barRight, fillStyleCallback, axisx, axisy) {
var points = datapoints.points,
ps = datapoints.pointsize,
fil... | [
"function renderBarChart() {\n var i, j, p, a, x, y, w, h, len;\n\n if (opts.orient === \"horiz\") {\n rotate();\n }\n\n drawAxis();\n\n ctx.lineWidth = opts.stroke || 1;\n ctx.lineJoin = \"miter\";\n\n len = sets[0].length;\n\n // TODO fix right pad\n for (i = 0; i < sets.length; i+... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders form for login and renders a GridList of all users that is only visible if admin login is successfull | render(){
return(
<div>
<form id="loginForm" onSubmit={this.ifSubmit}>
<input type="text" name="name" value={this.state.input.name} onChange={this.ifChange} id="userInput" placeholder="username" />
<input type="password" name="password" value={this.state.i... | [
"function showUserPanel() {\n\tlcSendValueAndCallbackHtmlAfterErrorCheckPreserveMessage(\"/user/index\",\n\t\t\t\"#userDiv\", \"#userDiv\", null);\n}",
"updateView() {\n const isLoggedIn = login.isLoggedIn();\n this.shadowRoot.getElementById(\"notloggedin\").hidden = isLoggedIn;\n this.shadow... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parses a block instruction WAST: expr: ( block ? ) instr: block ? end ? block_sig : ( result ) | function parseBlock() {
var label = t.identifier(getUniqueName("block"));
var blockResult = null;
var instr = [];
if (token.type === _tokenizer.tokens.identifier) {
label = identifierFromToken(token);
eatToken();
} else {
label = t.withRaw(label, ""); // preserve a... | [
"function parseIf() {\n var blockResult = null;\n var label = t.identifier(getUniqueName(\"if\"));\n var testInstrs = [];\n var consequent = [];\n var alternate = [];\n\n if (token.type === _tokenizer.tokens.identifier) {\n label = identifierFromToken(token);\n eatToken()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check whether any container is currently mounted in the DOM | function isAnyContainerMounted() {
return containers.size > 0;
} | [
"areComponentsLoaded() {\n return this.vues.filter((component) => !component.isLoaded).length === 0;\n }",
"function inDOM() {\n var closestBody = $that.closest(body),\n isInDOM = !!closestBody.length;\n return isInDOM;\n }",
"inDOM() {\n\t\t\treturn $(Utils.storyElement).find(th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
warning! t.deepEqual() tests attribute order while prettyDiff() does not | function deepEqual(t, actual, expected) {
t.deepEqual(actual, expected, prettyDiff(actual, expected));
} | [
"function showShallowDiff(obj1, obj2) {\n const args=global.args||{};\n var differences=false;\n if (!args.diff) return;\n Object.keys(obj1).forEach(key => {\n if (obj1[key] && typeof obj1[key] === \"object\" && obj1[key]!==null) { // it's an object\n if(obj2[key] && typeof obj2[key]==... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
int BufTextLen; // Current text length in bytes // Readwrite | get BufTextLen() { return this.native.BufTextLen; } | [
"function processText(tmp){\n line = line + (tmp.length)/tailleMax\n if (line >= nbLineMax){\n erase_text()\n line = 0;\n }\n}",
"char_length() {\n return [...this.buf].length;\n }",
"function outputText(text) {\n var pstr = \"\";\n for (var i = 0, len = text.length; i <... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get an existing DeploymentGroup resource's state with the given name, ID, and optional extra properties used to qualify the lookup. | static get(name, id, state, opts) {
return new DeploymentGroup(name, state, Object.assign(Object.assign({}, opts), { id: id }));
} | [
"getGroup (id) {\n assert.equal(typeof id, 'number', 'id must be number')\n return this._apiRequest(`/group/${id}`)\n }",
"static get(name, id, state, opts) {\n return new ContainerPolicy(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }",
"static get(name, id, state, opts) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
XMLHTTP REQUEST (DELETE ACCOUNTING) | function deleteAccounting(accountingID) {
//alert(accountingID.toString());
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if (this.readyState === 4 && this.status === 200) {
//Asynch. Stuff
//alert("Success");
$('#' + accountingID).r... | [
"deleteRequest() {\n let operation = {\n 'api': 'DeleteBucket',\n 'method': 'DELETE',\n 'uri': '/<bucket-name>',\n 'params': {\n },\n 'headers': {\n 'Host': this.properties.zone + '.' + this.config.host,\n },\n 'elements': {\n },\n 'properties': this.prope... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a new file reference | addFileRef(user_id, file_info) {
logger.log('info', 'add file', {user_id: user_id, file_info: file_info})
return FileReference.create({
UserID: user_id,
Info: file_info,
LastUpdated: new Date(),
}).then(function (file_ref) {
logger.log('debug', 'f... | [
"function addFile(file) {\n files.set(file._template, file);\n fileView.appendChild(file.getTemplate());\n}",
"async function addFile(){\n\t\trouter.push(`/files/${filetype}/create${filetype}/${fileFolderID}`)\n\t}",
"addFile(fileName, value) {\n if (value) {\n const fo = SpigFiles.createFileObjec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funkcija za predvorbo GPS koordinat v GK | function GPS2GK(fi,lam,H)
{
fi=fi*Math.PI/180;
lam=lam*Math.PI/180;
var N=wgs84_a/(Math.sqrt(1-wgs84_e2*Math.pow(Math.sin(fi),2)));
var X=(N+H)*Math.cos(fi)*Math.cos(lam);
var Y=(N+H)*Math.cos(fi)*Math.sin(lam);
var Z=((wgs84_b2/wgs84_a2)*N+H)*Math.sin(fi);
var X1=X+M0[1]*Y+M0[2]*Z... | [
"function vgge(FI,LA) \n{//* PRETVORBA GEOGRAFSKIH KOORDINAT T(FI,LA) V RAVNINSKE\n//* GAUSS-KRUGERJEVE MODULIRANE KOORDINATE T(Y,X) NA\n//* BESSELOVEM ELIPSOIDU\n// double,longint - za pascal in fortran\nvar FI, LA,\n A1,A2,A3,A4,A5,A6,T,X,Y,XG,YG,LAM,XX,\n E2,PI,AA,E4,E6,E8,E10,A,B,C,D... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Defines a literal enum value, such as Direction.Up, specified as enumlit("Direction", "Up"). | function enumlit(name, prop) {
return new TEnumLiteral(name, prop);
} | [
"function AddEnumItem() {\n let e = d.Config.enums\n let enumName = u.ID(\"selectAdminEnum\").value;\n e[enumName].push(\"\");\n u.WriteConfig();\n}",
"function enumReference(table, colEnum, tableEnum, required = false) {\n\tconst column = table\n\t\t.specificType(colEnum, \"smallint\")\n\t\t.references... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check for message text of 'tone check' or 'harlan' | function callsHarlan(message) {
try {
return message.text.toLowerCase().indexOf('check your tone') > -1
}
catch(e) {
return console.log(e)//throw error in console for verification
}
} | [
"function onSpeak(e) {\n // console.log(e);\n const msg = e.results[0][0].transcript;\n // console.log(msg);\n writeMessage(msg);\n checkNumber(msg);\n}",
"function isLineOverlong(text) {\n\t\tvar checktext;\n\t\tif (text.indexOf(\"\\n\") != -1) { // Multi-line message\n\t\t\tvar lines = text.split(\"\\n\")... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Setter de l'attribut pseudo pseudo: nouveau pseudo | setPseudo(pseudo) {
this.pseudo = pseudo;
} | [
"function changeDecoration() {\n\tvar decoration = document.getElementById('textDecoration').value;\n\ttarget.style.textDecoration = decoration;\n}",
"function changePara() {\n\tlet x = document.getElementsByTagName('P');\n\tfor (let i = 0; i < x.length; i++) {\n\t\tx[i].style.fontFamily = \"lato\";\n\t}\n}",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
33. Write a function called upperFirst, which converts the first character of string to upper case. | function upperFirst(str){
return str[0].toUpperCase() + str.slice(-(str.length-1));
} | [
"function firstLettersToUpperCase(s) {\r\n let words = s.split(' ');\r\n let wordsUpperCased = words.map(word => word.charAt(0).toUpperCase() + word.substring(1))\r\n return wordsUpperCased.join(' ');\r\n}",
"function func8(str) {\r\n return str[0].toUpperCase() + str.slice(1);\r\n}",
"function UPPER(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to generate code for printing | function generatePrint(node)
{
// Get the node containing the value we want to print
var valueNode = node.children[0];
// Three cases:
// 1. Id - determine whether the Id's value is a static or heap value and handle appropriately
// 2. String - get the ascii values representing the string and use JustPutItT... | [
"printInfo() {\n return `Name: ${this.name}\\n Age: ${this.age}\\n Haircolor: ${this.haircolor}`\n\n }",
"function print34to41() {\n const array = []\n for(let i = 34; i < 42; i++) {\n array.push(i);\n }\n return array.map(item => `<p class=\"output\">${item}</p>`).join(\"\");\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Promotes a participant to teacher | function promoteToTeacher(id)
{
//Find the participant in the database
participant = getParticipantByID(id);
if(participant != null)
{
if(participant.status == 'Student')
{
participant.status = 'Teacher';
}
}
} | [
"function enrolParticipant(participantID, courseID)\r\n{\r\n //Find the participant and course in the database\r\n participant = getParticipantByID(participantID);\r\n course = getCourseByID(courseID);\r\n if(course == null || participant == null)\r\n return;\r\n \r\n //Enrol the participan... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gets x and y as integers from the id | function getCoordsFromId(elem_id)
{
var delimiter_pos = elem_id.indexOf('_');
var elem_y = parseInt(elem_id.substring(0, delimiter_pos), 10);
var elem_x = parseInt(elem_id.substring(delimiter_pos + 1), 10);
var coords = new Array(elem_y, elem_x);
return coords;
} | [
"function toCoordinate(id_num) {\n // Math doesnn't work properly for last cell\n if (id_num === \"256\") {\n return [15, 15];\n }\n else {\n id_num = parseInt(id_num);\n var x = Math.floor((id_num-1)/16);\n var y = id_num-(16*x);\n return [x, y-1];\n }\n}",
"func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Populate `_nativeNode` on the rendered native/text component with the given DOM node. The passed `inst` can be a composite. | function precacheNode(inst, node) {
var nativeInst = getRenderedNativeOrTextFromComponent(inst);
nativeInst._nativeNode = node;
node[internalInstanceKey] = nativeInst;
} | [
"function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node, node[internalInstanceKey] = hostInst;\n }",
"createComponent(description, parentNode) {\n const ComponentClass = description.component;\n if (Componen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Execute a web request Parameters : url : String, the request URL Return : none TODO : This should return a promise object but (ie11) | static Request(url) {
var d = Core.Defer();
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState != 4) return;
// TODO : Switched to this.response, check if it breaks anything
if (this.status == 200) d.Resolve(this.response);
else {
var error = ne... | [
"function fetchWeb(url){\n // declare url to fetch\n url = 'https://vietnam.craigslist.org/search/mca';\n console.log('fetching ', url, '...');\n request(url, function(err,res,req){\n if(err){\n console.log('did we get an error?', err);\n }\n // log response..\n console.log('what are the details... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function queries audioDB for an artist's discography and appends the art and information into the carousel | function discog(artist) {
var apiKey = "523537";
var queryURL =
"https://theaudiodb.com/api/v1/json/" +
apiKey +
"/searchalbum.php?s=" +
artist;
$.ajax({
url: queryURL,
method: "GET",
}).then(function (discResponse) {
// this for loop iterates through informatio... | [
"function onGetGenreArtist(data) {\n\tif (\"Error\" in data) {\n\t\tonError(data.Error);\n\t} else if(\"Value\" in data) {\n\t\tclearError();\n\t\t$(\"#album-table>tbody\").empty();\n\t\t$(\"#track-table>tbody\").empty();\n\t\tfor (i in data.Value) {\n\t\t\talbum = data.Value[i];\n\t\t\twriteGenreAlbumRow(album);\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the input weights manually. | setInputWeights(iWeights) {
// Including bias.
const numIn = this._inputLayer.length + 1;
// Not including bias.
const numHidden = this._hiddenLayer.length;
// Make sure the right number of weights were passed in.
if (iWeights.length !== numIn * numHidden)
... | [
"updateWeights() {\n this.setWeights();\n }",
"initializeWeights() {\n\t\t// Create weights for each node\n\t\tfor (let n = 0; n < this.numNodes; n++) {\n\t\t\tlet nodeWeights = [];\n\t\t\t// Each input gets a random weight\n\t\t\tfor (let i = 0; i < this.numInputs; i++) {\n\t\t\t\t// Add a random weight ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Associates an HTML input element with this chip grid. | registerInput(inputElement) {
this._chipInput = inputElement;
this._chipInput.setDescribedByIds(this._ariaDescribedbyIds);
} | [
"function inputElem_add_byKey(e) {\n\t\n}",
"set CustomProvidedInput(value) {}",
"function onInput() {\n\t\t\t\tif ( typeof options.input === 'function' ) {\n\t\t\t\t\toptions.input.call( $input, function( params, callback ){\n\t\t\t\t\t\tbuild( params );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}",
"function setUpI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function for retrieving patients and getting them ready to be rendered to the page | function getPatients() {
$.get("/api/patients", function(data) {
var rowsToAdd = [];
for (var i = 0; i < data.length; i++) {
rowsToAdd.push(createPatientRow(data[i]));
}
renderPatientList(rowsToAdd);
nameInput.val("");
});
} | [
"function getAllPatients() {\n return $http.get(apiUrl + 'allPatients')\n .then(resp => {\n patients = resp.data.data;\n return resp.data\n })\n .catch(err => {\n console.log(err)\n })\n }",
"function showPa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return list of Events for domain, env and app id | function listEvents(req, res, next){
var logger = log.logger;
var EventModel = models.getModels().Event;
var listReq = RequestTranslator.parseListEventsRequest(req);
if(! listReq.uid || ! listReq.env || ! listReq.domain){
return next({"error":"invalid params missing uid env or domain","code":400});
}
Ev... | [
"function getEvents() {\n\t/// \\todo add /api/events-since/{index} (and change Traffic Monitor to keep latest\n\tajax(\"/publish/EventLog\", function(r) {\n\t\tconst events = JSON.parse(r).events || [];\n\t\tfor (const event of events.slice(lastEvent+1)) {\n\t\t\tlastEvent = event.index;\n\t\t\tconst row = documen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
simple function to reset location | function resetLocation() {
settingsService.setLocation(false);
vm.place = '';
} | [
"function actionReset() {\n if (initialLocation) {\n setCurrentLocation(initialLocation.latLng, {'address' : initialLocation.address}); \n }\n return false; // suppress form submission\n}",
"_resetPosition() {\n this._monitor = this._getMonitor();\n\n this._updateSize();\n\n this._up... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
mouse click event listener for suggest list | function ACListClick(e) {
var ele = e.target;
if(ele.tagName == "STRONG") ele = ele.parentNode;
if(ele.tagName != "LI") return true;
e.stopPropagation();
changeSuggest();
curPattern = "";
completeFlag = 0;
closeACList();
} | [
"function suggestionClickListener() {\n $('li.tax-suggestion').click(function (e) {\n // Stop propagation so that this does not count as a body click (and thereby remove the list).\n //e.stopPropagation();\n $(this).parent().children().removeClass('selected');... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=============================================================================== / copied from Thank you! / =============================================================================== I proxy the $http service and merge the params and data values into the URL before creating the underlying request. | function httpProxy( config ) {
config.url = interpolateUrl( config.url, config.params, config.data );
return( $http( config ) );
} | [
"customRequest (data) {\n return http(data)\n }",
"function nnsParamsInterceptor($httpProvider) {\n $httpProvider.interceptors.push(['$q', '$injector', '$log', function ($q, $injector) {\n return {\n request: function (config) {\n var profileService = $injec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
test_RunDotCoverTask('fail cmd', false, 'fail'); | function test_RunDotCoverTask(testName, expectedResult, cmdString) {
it(testName, function (done) {
// Arrange
var extensionHelpers = new helpers_1.ExtensionHelpers();
// Act
extensionHelpers.RunDotCoverTask(cmdString, function (msg, result) {
cons... | [
"function failure() {\n process.exit(ExitCode.Failure);\n}",
"function failedTestFn() {\n throw new Error('test failed');\n }",
"function setTestRanTrue() {\n testRan = true;\n}",
"beforeCommand() { }",
"function runExample(eg) {\n eg.result = (eg.expected === eg.actual);\n eg.message = \"Expected... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParserliteral. | visitLiteral(ctx) {
return this.visitChildren(ctx);
} | [
"Literal() {\n switch (this._lookahead.type) {\n case \"NUMBER\":\n return this.NumericLiteral();\n case \"STRING\":\n return this.StringLiteral();\n case \"true\":\n case \"false\":\n return this.BooleanLiteral(this._lookahead.type);\n case \"null\":\n return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
remove class for array | function removeClass(array, target) {
if (array.length > 0) {
for (var i = 0; i < array.length; i++) {
var element = array[i];
if (element.classList.contains(target)) {
element.classList.remove(target);
}
}
}
} | [
"function removeClass(obj, cls) {\n //defining variable classNameArray for array, which created by method split\n var classNameArray = obj.className.split(\" \");\n //loop for searching cls in classNumberArray and removing those items\n for (var i = 0; i < classNameArray.length; i++) {\n //defini... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
:nodoc: new ChoicesPseudoAction(name, help) Create pseudo action for correct help text | function ChoicesPseudoAction(name, help) {
var options = {
optionStrings: [],
dest: name,
help: help
};
Action.call(this, options);
} | [
"static set helpBox(value) {}",
"function help_OnClick()\n{\n\ntry {\n\tDVDOpt.ActivateHelp();\n}\n\ncatch(e) {\n //e.description = L_ERRORHelp_TEXT;\n\t//HandleError(e);\n\treturn;\n}\n\n}",
"function ActionDescription(pAction, pValue1, pValue2) {\n\n var description = \"\";\n\n if (pAction >=... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
var tabla = document.getElementsByName("NameTablaCargaAcademica"); var trs = tabla[0].getElementsByTagName("tr"); var tds = trs[2].getElementsByTagName("td"); var valores = tds[0].childNodes[0].nodeValue; console.log(valores); | function generar(){
var tabla = document.getElementsByName("NameTablaCargaAcademica");
var trs = tabla[0].getElementsByTagName("tr");
var tds = trs[2].getElementsByTagName("td");
var divs = tds[1].getElementsByTagName("div");
console.log(divs[0].childNodes[0].nodeValue);
alert("hello world");
} | [
"function get_table_data(table) {\n rows = table.getElementsByTagName('tr');\n data = new Array(rows.length);\n for (i=1; i<rows.length; i++){\n if (rows[i].style.display == \"none\") {\n continue;\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
count cells in prop.range | static countCells(prop) {
let n = prop.range;
n = (n & 0x15555)+(n>>1 & 0x15555);
n = (n & 0x3333) +(n>>2 & 0x3333);
n = (n & 0xf0f) +(n>>4 & 0xf0f);
return (n & 0xff)+(n>>8 & 0xff);
} | [
"function getAliveCount() {\n\tvar count = 0;\n\tcells.map(function(alive) {\n\t\tif (alive) count++;\n\t});\n\treturn count;\n}",
"function monitorCount(rows, columns) {\n return rows * columns;\n}",
"function subjectPropertyPhotoCount() {\n var n = 0;\n // cover photo\n if (property.Img0 != \"\") ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
NOTE: we set hover rectangle manually rather than fully redrawing so we're not redrawing the overlay on mousemove. This is more efficient and prevents cursor flash. | @throttle(1)
_updateHoverRect(event) {
const mouseOid = oak.event._mouseOid;
const isInsideHandle = event && $(event.target).is(".ResizeHandle");
let rect;
if (mouseOid && !isInsideHandle && !oak.event.anyButtonDown) {
rect = oak.getRectForOid(mouseOid);
}
this._moveRect("hover", rect);
... | [
"function OnMouseEnter() {\n guiTexture.texture = hoverTexture;\n mouseOver = true;\n}",
"function addOverlay() {\n //the graph rectangle area\n chartRect = mainChart.append('rect')\n .attr('class', 'chartOverlay')\n .attr('width', width)\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to save input time. Uses Firebase to save date and time in a unique document under "times" collection. saves time as (Number) and date as (String). resets elements on page after saving. | function saveTime() {
firebase.auth().onAuthStateChanged(function (user) {
let d = new Date();
let showerDate = d.toDateString().slice(0, 15);
let userRef = db.collection("users").doc(user.uid);
userRef.collection("times").add({
date: showerDate,
time: currentTimer
})
document.... | [
"function to_db_time(time) {\n\n}",
"function setSchedule(hour){\n localStorage.setItem(hour, $(\"#hour\"+hour).val());\n}",
"function SaveHourInfo(hour, data){\n localStorage.setItem(hour, data);\n}",
"function saveGame(objButton){\n var fired_button = objButton.value;\n localStorage.setItem(\"dateti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is the item a child? | isItemChild(item) {
return this.composer.isItemChild(item);
} | [
"function hasChildren(item) {\n var itemChildrenCollection = item[vm.childrenPropertyName];\n if (typeof itemChildrenCollection != \"undefined\" && itemChildrenCollection != null && itemChildrenCollection.length > 0) {\n return true;\n } else {\n return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This argument is a string that contains multiple whitespace delimited numbers. Each number has a single alphabet letter somewhere within it. Example : "24z6 1x23 y369 89a 900b" As shown above, this alphabet letter can appear anywhere within the number. You have to extract the letters and sort the numbers according to t... | function doMath(s) {
s = s.split(" ");
for(i=0; i<s.length; i++) {
var el = s[i];
for(j=0; j<el.length; j++) {
if(isNaN(el[j])) {
s[i] = el[j] + String.fromCharCode(97 + i) + el.slice(0, j) + el.slice(j + 1);
}
}
}
s = s.sort().map(function(el){return parseInt(el.slice(2))});
... | [
"function calc(x){\n \n let total1= '';\n let toal2='';\n let t1 = 0;\n let t2= 0; \n //get the ASCII value in JavaScript for the characters \n for (let i=0; i < x.length; i++) {\n total1 += x.charCodeAt(i)\n }\n // replace 7 with 1\n total2 = total1.replace(/7/gi, '1')\n \n //... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |