query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Stash current state, check out the named branch, and sync with google/blockly. | function syncBranch(branchName) {
return function(done) {
execSync('git stash save -m "Stash for sync"', { stdio: 'inherit' });
execSync('git checkout ' + branchName, { stdio: 'inherit' });
execSync('git pull ' + upstream_url + ' ' + branchName,
{ stdio: 'inherit' });
execSync('git push origin... | [
"function syncBranch(branchName) {\n return function(done) {\n execSync('git stash save -m \"Stash for sync\"', { stdio: 'inherit' });\n checkoutBranch(branchName);\n execSync(`git pull ${UPSTREAM_URL} ${branchName}`, { stdio: 'inherit' });\n execSync(`git push origin ${branchName}`, { stdio: 'inherit'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Disposes all of the currently active charts. | function disposeAllCharts() {
while (_Registry__WEBPACK_IMPORTED_MODULE_1__["registry"].baseSprites.length !== 0) {
_Registry__WEBPACK_IMPORTED_MODULE_1__["registry"].baseSprites.pop().dispose();
}
} | [
"function disposeAllCharts() {\n while (_Registry__WEBPACK_IMPORTED_MODULE_1__[\"registry\"].baseSprites.length !== 0) {\n _Registry__WEBPACK_IMPORTED_MODULE_1__[\"registry\"].baseSprites.pop().dispose();\n }\n }",
"clearCharts() {\n Promise.all(this._chartsPromises).then(function (char... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render the items Clear todo list content Check for items Append items | function render(){
todoListContent.innerHTML = "";
if(items.length <= 0){
todoListContent.innerHTML = "No items in this list";
return;
}
//todoListContent.append(`${items.length} items`)
items.forEach((item, index) => {
const wrapper = document.createElement('template');
... | [
"function renderAllTodoItems() {\n renderTodoItems(todoList)\n }",
"function renderList() {\n if(!data.todo.length && !data.completed.length) return;\n\n for(let i = 0; i < data.todo.length; i++) {\n let value = data.todo[i];\n addItemTodo(value);\n }\n\n for(let j = 0;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates table with specified rows and columns. | createTable(rows, columns) {
let startPara = this.selection.start.paragraph;
let table = new TableWidget();
table.tableFormat = new WTableFormat(table);
table.tableFormat.preferredWidthType = 'Auto';
table.tableFormat.initializeTableBorders();
let index = 0;
while... | [
"function create_table(cols) {\r\n var table = { head: [], rows: [], row_attrs: [], row_names: undefined};\r\n if (cols instanceof Array) {\r\n table.head = cols;\r\n } else if (cols instanceof Object) {\r\n var i = 0;\r\n table.row_names = {};\r\n for (var key in cols) {\r\n table.head.push(col... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
called every once in a while to refresh the navbar variables | function refreshNavbar (app, callback) {
async.parallel([
db.getNavbarBrands,
db.getAllCategories
],
function refreshNavbarCb (err, result) {
if (err) return console.log('Error while updating navbar');
app.locals.brands = result[0];
app.locals.categories = result[1];
console.lo... | [
"function refreshNavBar() {\n refreshSidebar();\n}",
"function refreshNavbar (app) {\n async.parallel([\n db.getNavbarBrands,\n db.getAllCategories\n ],\n function refreshNavbarCb (err, result) {\n if (err) return console.log('Error while updating navbar');\n app.locals.brands = result[0];... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrives the project enums, called on document ready | function getProjectEnums()
{
$.ajax({
type: 'POST',
url: 'Project',
dataType: 'json',
data:
{
'domain': 'project',
'action': 'getQueryEnums',
},
success: function(data)
{
fillDropdown(data);
getUsers();
}
});
} | [
"function getProjectEnums_PERMIT()\n{\n\t$.ajax({\n\t\ttype: 'POST',\n\t\turl: 'Project', \n\t\tdata: \n\t\t{\n\t\t\t'domain': 'project',\n\t\t\t'action': 'getSpecificObjects',\t\n\t\t\t'permitstage': true ,\n\t\t\t'inspectionstatus' : true\n\t\t},\n\t\tsuccess: function(data)\n\t\t{\n\t\t\tfillDropdowns_PERMIT(dat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mutate each of the new individuals in the new population if their random chance is less than mutationRate | mutate(newPopulation)
{
for(let i = 0; i < this.popSize; i++)
{
for (let j = 0; j < this.indSize; j++)
{
if (random() < this.mutationRate)
{
newPopulation[i].gens[j] = int(random(2));
}
}
... | [
"mutate() {\n for (var i = 0; i < this.len; i++) {\n if (random(1) < this.mRate) {\n this.genes[i].set(random(-1, 1), random(-1, 1));\n }\n }\n }",
"function mutate(chromosomes, mutationRate) {\r\n for (var i = 0; i < totalVertices; i++) {\r\n if (random(1) < mutationRate) {\r\n v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stringifies the request parameter for error reporting | function stringifyReq(request) {
if(request==null) return "<null>";
if($.isPlainObject(request)) return JSON.stringify(request);
return ("" + request);
} | [
"function buildRequestString(requestObj) {\n // Declare request string with initial value equal to the request type\n let request = requestObj.type;\n\n // If the requestObj has a params property, begin to format the string...\n if ('params' in requestObj) {\n request += '?'; // Follow the type w... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change the sign of the previous entry if it was numeric or a float stored as a string. | function handleSignClick() {
const calcLength = calculationArr.length;
const lastEntry = calculationArr[calcLength - 1];
if (isOperator(lastEntry) || lastEntry === '(' || lastEntry === ')') {
return;
} else if (lastEntry === '.') {
const secondLastEntry = ca... | [
"changeSign() {\n const NEGATIVE = -1;\n const token = this.getToken();\n if (isNumber(token)) {\n this.token = (NEGATIVE * parseFloat(token)).toString();\n }\n }",
"reverseSign() {\n if (parseFloat(this.currentOperand) > 0) {\n this.currentOperand = parseFloat(this.currentOperand) * -1;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sorts teams by favorite status and then by name. | function sortTeams() {
var sortedTeams = $('.team').sort(function (a, b) {
var $teamA = $(a);
var $teamB = $(b);
var favoriteOrder = $teamB.data('is-favorite') - $teamA.data('is-favorite');
var nameOrder = $teamA.data('team-name') > $teamB.data('team-name') ? 1 : -1;
if (favoriteOrder) {
r... | [
"function teamSort(type, teams) {\n if (type === 'rank') {\n teams.sort(utils.compareRank);\n } else if (type === 'pf') {\n teams.sort(utils.comparePF);\n } else if (type === 'pa') {\n teams.sort(utils.comparePA);\n } else {\n teams.sort();\n }\n return teams;\n}",
"f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Purpose: This function handles the whether user wants bidirectionality in algorithm or not Called: This function is called whenever we clicks the bidirectional button on the grid route | function biDirection() {
/* isBidrectional is a boolean variable which denotes if true then user wants bi-directionality otherwise not */
isBirectional = !isBirectional; /* Each time we click the button this variable is switch from on to off or vice versa */
if (isBirectional) { /* if true then change the button... | [
"function checkRouteSimulationButtonEnabledState() {\n if (routeShape.length == 0) {\n document.getElementById(\"simulateRouteButton\").disabled = true;\n }\n else {\n document.getElementById(\"simulateRouteButton\").disabled = false;\n }\n}",
"function checkRouteSimulationButtonEnabledS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Saves new component to stack with modal transition in animation. | pushModal(component) {
this._pushComponent(component, TransitionConstants.MODAL_IN);
} | [
"static push(modal) {\n\t\tthis.instance.setState({ stack: [...this.instance.state.stack, modal] });\n\t}",
"function saveAnimation(){\n $scope.component.ui.savingStatus = 'saving'\n var animation = editorAnimationToProjectAnimation($scope.component.animation);\n\n AnimationService.updateAnim... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show toaster msg send msg type , title and message as a parameter | function showMessage(valpriority, valTitle, valMessage) {
$.toaster({ priority: valpriority, title: valTitle, message: valMessage }); // success , info , warning , danger
} | [
"function showMessage(valpriority, valTitle, valMessage) {\n $.toaster({ priority: valpriority, title: valTitle, message: valMessage }); // success , info , warning , danger\n}",
"function showMessage(type, title, body) {\n $('#message-alert').removeClass(function (index, css) {\n return (css.match(/... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
kaXmlLinestring Construct a linestring | function kaXmlLinestring( point )
{
kaXmlFeature.apply(this, [point]);
if ( _BrowserIdent_hasCanvasSupport())
kaXmlLinestring.prototype['draw'] = kaXmlLinestring.prototype['draw_canvas'];
else
kaXmlLinestring.prototype['draw'] = function() {};
for (var p in kaXmlFeature.prototype) {... | [
"function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView)\n lineView.text = lineView.node = built.pre\n if (built.bgClass) { lineView.bgClass = built.bgClass }\n if (built.textClass) { lineView.textClass = built.textClass }\n\n updateLineClasses(cm, lineView)\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
xSplitter, Copyright 20062007 Michael Foster (CrossBrowser.com) Part of X, a CrossBrowser Javascript Library, Distributed under the terms of the GNU LGPL | function xSplitter(sSplId, uSplX, uSplY, uSplW, uSplH, bHorizontal, uBarW, uBarPos, uBarLimit, bBarEnabled, uSplBorderW, oSplChild1, oSplChild2)
{
// Private
var pane1, pane2, splW, splH;
var splEle, barPos, barLim, barEle;
function barOnDrag(ele, dx, dy)
{
var bp;
if (bHorizontal)
{
... | [
"function Splitter() {\n this.LastX = 0;\n\tthis.OrigX = null;\t\t// default width of LeftEl\n\tthis.EventRef1 = null;// Stores reference for event removal in EndDrag method\n\tthis.LeftEl = null;\t\t// element left of resize handle\n\tthis.RightEl = null;\t// element right of resize handle\n\tthis.Open = true;\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sanitization checks to see if database has coursecode | function sanitizeCourseCode(ins){
const chkr = datab.find(p => p.catalog_nbr == ins);
//if exists in database
if (chkr) {
return true;
}
else{
return false;
}
} | [
"function sanitizeSubjectCode(ins){\n const chkr = datab.find(p => p.subject === ins);\n \n //if exists in database\n if (chkr) {\n return true;\n }\n else{\n return false;\n }\n}",
"function sanitizeCourseComponent(ins){\n if (ins === \"LAB\" || ins === \"TUT\" || ins === \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Statically verify that the given node is one of the given types. | function staticallyVerifyType(node, types) {
if (isNodeNully(node)) {
return types.indexOf("null") > -1 || types.indexOf("undefined") > -1 ? TYPE_VALID : TYPE_INVALID;
} else if (node.type === "Literal") {
if (node.regex) {
return types.indexOf("object") > -1 || types.some(identifierMatcher(... | [
"function matchesNode( node, type ) {\n if ( !_.isObject( node )) return false;\n return node.type === type || node.node === type;\n}",
"function hasType(node, type){\n if (node.type === undefined) {\n return false;\n }\n\n if (typeof type === \"string\"){\n type = [type];\n }\n\n var test = node.typ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enables or disables debugmasks from string Format: +NET +WARNING ACTION | function DebugModMasksFromString( aString ) {
var tsRet = DebugEnableMasks(String2Array(aString));
Debug("Modified the following masks: " + tsRet, "DEBUG");
return tsRet;
} | [
"function debug(str){if(false){}}/* eslint-enable */ // -----------------------------------------------------------------------",
"function warning(value, warning) {\n if (value == \"YES\") {\n return \" -W\" + warning;\n } else if (value == \"YES_ERROR\") {\n return \" -Werror=\" + warning;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
deletes a characterBlock div while also removing it from initiativeArray | function removeDiv(characterDiv){
initiativeArray.splice(initiativeArray.indexOf(characterDiv), 1);
characterDiv.parentElement.removeChild(characterDiv);
} | [
"function clearCharacters() {\n $(\".character\").remove();\n}",
"function destroyBlock(){\r\n document.getElementById(\"last-selected\").remove();\r\n}",
"function removeAll(){\n$(\"#characters\").children().each(function(index) {\n\t$(this).unbind();\n\tif(index != 0 )\n\t{\n\t\t//if(isCompatible() == tru... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
playGame() function starts the Memory Game: Uses event delegation to handle event listener when a Card is clicked. This has so much better response, easy to troubleshoot and timer function respond better than adding an event listener for individual cards. When a Card is clicked: if this is the first click of the card i... | function playGame(){
let cardDeck = document.getElementById("cardDeck");
cardDeck.addEventListener("click", function(event){
let activeCard = event.target;
if (event.target && event.target.classList.contains("card")){
console.log("Card was clicked!");
openCardCtr++;
if(openCardCtr==1){
start... | [
"function startGame() {\n\tlet cardList = document.querySelectorAll('.card');\n\tlet timerTrigger = 0;\n\n\tcardList.forEach(card => {\n\t\tcard.addEventListener('click', e => {\n\t\t\tlet clicked = e.target;\n\t\t\tcompareCards(clicked);\n\n\t\t\tif(timerTrigger < 1) {\n\t\t\t\ttimer();\n\t\t\t\ttimerTrigger++;\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a function which accepts two arguments; the first is a bill amount and the second is service quality; either 'poor', 'good', or 'great'. | function tipRecommender(bill, service) {
let tip = 0;
if (service === 'poor') {
tip = bill * 0.16
tip = tip.toFixed(2);
} else if (service === 'good') {
tip = bill * 0.22
tip = tip.toFixed(2);
} else {
tip = bill * 0.26
tip = tip.toFixed(2);
}
re... | [
"function tipAmount(bill, service) {\n if (service == 'good') {\n return \"$\" + (bill * 20) / 100;\n } else if (service == 'fair') {\n return \"$\" + (bill * 15) / 100;\n } else if (service == 'bad') {\n return \"$\" + (bill * 10) / 100;\n } else {\n return \"I don't understand the service le... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A Playlist has a `name`, has many tracks | function Playlist(name) {
this.name = name;
this.tracks = [];
} | [
"function playlist (name) {\n this.name = name,\n this.tracks = []\n}",
"addPlaylist(playlist)\n {\n if(this.name === null) {\n this.name = playlist.name;\n }\n for (let song of playlist.songs) {\n let newSong = new Song('', '', song);\n this.songs.push(newSong);\n }\n }",
"functi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Class to represent a data row of values and corresponding switches(EPS regulators) | function TableDataSwitch(name, description, value, unit, valueA, unitA, valueB,
unitB, onOffA, onOffB) {
var self = this;
self.name = name;
self.description = description;
self.value = value;
self.unit = unit;
self.valueA = valueA;
self.unitA = unitA;
self.valueB = valueB;
se... | [
"function IntervalData() {\n this.interpolationAlgorithm = LinearApproximation;\n this.numberOfPoints = LinearApproximation.getRequiredDataPoints(1);\n this.interpolationDegree = 1;\n this.times = undefined;\n this.values = undefined;\n this.isSampled = false;\n this... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function loads the quiz according to inputed questions and responses (stored in browser) | function loadQuiz() {
// Gets questions and responses
// To save user time / data, sees if questions are cached, uses DB if not
try {
questions = JSON.parse(sessionStorage.getItem('questions'));
}
catch {
questions = makeSampleQuestions()
sessionStorage.setItem(JSON.stringify(questions))
}
... | [
"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"
]
]
}
} |
If a webcam or camera is detected, it is initialized with the specified width and height and the function returns a successful promise. | async function setupWebcam() {
if (navigator.mediaDevices.getUserMedia) {
const stream = await navigator.mediaDevices.getUserMedia({
"audio": false,
"video": {
width: {
min: 640,
max: 640
},
height: {
min: 480,
max: 480
}
}
... | [
"function onStreamDimensionsAvailable () {\n\n if (webcam.videoWidth === 0) {\n setTimeout(onStreamDimensionsAvailable, 100);\n } else {\n waitForSDK();\n }\n }",
"function onStreamDimensionsAvailable () {\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function determines how many connected components in graph | getNumOfConnectedComponents() {
let numOfConnectedComponents = 0;
const notVisited = new Set(this.nodes);
while (notVisited.size) {
const notVisitedArr = Array.from(notVisited);
const source = notVisitedArr[0];
const toVisitStack = [source];
notVisited.delete(source);
while (t... | [
"getNumOfEdges() {\n let numOfRelations = 0;\n for (let node of this.nodes) {\n numOfRelations += node.adjacent.size;\n }\n return numOfRelations / 2;\n }",
"getConnectedComponents() {\n // !!! IMPLEMENT ME\n\n for (let vert of this.vertexes) {\n if (!vert.visited) {\n this.bfs... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is the requested resource in the ResourceGroup this authorizer manages? | verifyResource() {
let match = false;
if (this.event) {
const requestedApiId = this.event.methodArn
.split(':')[5]
.split('/')[0];
const apiIds = this.resourceGroup.apiIds;
apiIds.forEach((apiId) => {
if (apiId.api_name === requestedApiId) {
match = true;
... | [
"has_resource(arg_name) { return this.root.hasIn( ['resources', 'by_name', arg_name] ) }",
"static isResource(_object) {\n return (Reflect.has(_object, \"idResource\"));\n }",
"authorizedToViewAnyResources() {\n return (\n this.resources.length > 0 &&\n Boolean(find(this.re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new graph runtime. | createGraphRuntime(graphJson, lib, ctx) {
const fcreate = this.getGlobalFunc("tvm.graph_runtime.create");
const module = fcreate(graphJson, lib, this.scalar(ctx.deviceType, "int32"), this.scalar(ctx.deviceId, "int32"));
return new GraphRuntime(module);
} | [
"createGraphRuntime(graphJson, lib, ctx) {\n\t const fcreate = this.getGlobalFunc(\"tvm.graph_runtime.create\");\n\t const module = fcreate(graphJson, lib, this.scalar(ctx.deviceType, \"int32\"), this.scalar(ctx.deviceId, \"int32\"));\n\t return new GraphRuntime(module);\n\t }",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
reads the package name out of the Android Manifest file | function androidPackageName(project_dir) {
var mDoc = xml_helpers.parseElementtreeSync(path.resolve(project_dir, 'AndroidManifest.xml'));
return mDoc._root.attrib['package'];
} | [
"function androidPackageName(project_dir) {\n var mDoc = xml_helpers.parseElementtreeSync(\n path.resolve(project_dir, 'AndroidManifest.xml'));\n\n return mDoc._root.attrib['package'];\n}",
"parsePackageName(manifestContents) {\n // first we remove all the comments from the file\n l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTIONS ===================================================================================== compare user's scores with each existing friend & find total difference in scores for each | function compareScores(user) {
var friendInfo = {
friendProfiles: [],
friendResults: []
}
for (var i = 0; i < friends.length; i++) {
var totalDifference = 0;
for (var j = 0; j < user.scores.length; j++) {
totalDifference += Math.abs(user.scores[j] - friends[i].s... | [
"function getDifference (userScores, friendScores){\n\t\tvar difference = 0;\n\t\tfor (var i=0; i<userScores.length; i++) {\n\t\t\tdifference += Math.abs(userScores[i]-friendScores[i]);\n\t\t}\n\t\treturn difference;\n\t}",
"function totalDifference(userScore,friends){\n//a loop going through just the scores of t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the index of the rule by looking for the corresponding breakpoint. | function _getRulePositionByBreakpoint( rules, breakpoint ) {
if ( typeof rules === "undefined" ) {
rules = _settings.rules;
}
for ( var i = 0; i < rules.length; i++ ) {
if ( rules[ i ].breakpoint === breakpoint || $.inArray( breakpoint, rules[ i ].breakpoint ) > -1 ) {
return i;
}
}
retu... | [
"returnIndexOfClosestBreakpoint(idx) {\n\n\t\t// make closest index's value to -1 as \"no breakpoint found\"\n\t\tvar closestIndex = -1, optionalBreakPoint = \"\";\n\n\t\t// iterate the chars in the string until a breakpoint if found\n\t\t// the algorithm is combine from end to idx and look for a breakpoint, it not... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called before any/every command is executed, so we must filter on command ID | function preExecute(commandId, event) {} | [
"function initializeCommands(){\n\n}",
"postinit() {\n this._loadCommands();\n }",
"command(command) {}",
"startCommandQueueObservation(){\n let queue = CommandQueues.getForMachine(this.machineObj.machineId);\n this.queueHandler = CommandQueues.find({ machineId: this.machineObj.machineId }, {}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When called from componentDidMount the method will put initial data from response to state and calls setStats which handles the data even further. After that "loaded" becomes true, which sends removes the loadingmessage from view | setInitialStats(response) {
this.setState({ gameSessions: response.data, gameSessionsFiltered: response.data })
this.setStats(response.data)
this.setState({ loaded: true })
} | [
"componentDidMount() {\n this.setStats(this.getStats())\n }",
"componentDidMount() {\n const UDID = lib.getUDID()\n api.fetch(UDID, (response, err) => {\n if (err) {\n console.log(\"Error loading data: \", err)\n } else if (lib.isEmptyObject(response)) {\n this.prepareRenderData(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
15. Create a function that takes an array parameter, that returns all favorites | function myFavoriteMovie(array) {
let favorites = array.filter(item => item.favorite === true);
return favorites;
} | [
"static getAllFavorites() {\n this.allCountries = this.getAllCountries();\n const favorites = this.allCountries.filter(\n (country) => country.favorite === true\n );\n return favorites;\n }",
"function getFavorites(){\n return favorites;\n}",
"async getFavArtworks() {\r\n let favorites... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find target country record indicated by the request route.param() with :countryId | function autoFindTarget (req, res, next, countryId) {
let targetCountryId = countryId.toLowerCase()
return db.Countries
.scope({ method: ['flagOnly'] })
.findById(targetCountryId)
.then(targetCountry => {
req.targetCountryId = targetCountryId
req.targetCountry = targetCountry
next()
... | [
"getCountryById(countryId) {\n\t\t\treturn h({\n\t\t\t url: `${this.basePath}getCountryById?countryId=${countryId}`,\n\t\t\t\tmethod: 'get',\n\t\t\t});\n\t\t}",
"function getCountryByID() {\n return (req, res, next) => {\n const { id } = req.params;\n Country.getByID(id)\n .then((car) => {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Chapter 10 Sidney and Jennifer Revenge Click | function C010_Revenge_SidneyJennifer_Click() {
// Regular interactions
ClickInteraction(C010_Revenge_SidneyJennifer_CurrentStage);
// The player can click on herself
var ClickInv = GetClickedInventory();
if (ClickInv == "Player") {
C010_Revenge_SidneyJennifer_IntroText = OverridenIntroText;
C010_Revenge_Si... | [
"function C007_LunchBreak_Sidney_Click() {\t\n\n\t// Regular and inventory interactions\n\tClickInteraction(C007_LunchBreak_Sidney_CurrentStage);\n\tvar ClickInv = GetClickedInventory();\n\tif (ClickInv == \"Player\") {\n\t\tC007_LunchBreak_Sidney_IntroText = OveridenIntroText;\n\t\tC007_LunchBreak_Sidney_LeaveIcon... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For each row in `inputButtons`, create a row View and add create an InputButton for each input in the row. | _renderInputButtons() {
let views = [];
let input;
for (var r = 0; r < inputButtons.length; r++){
const row = inputButtons[r];
const inputRow = [];
for (var i = 0; i < row.length; i++) {
input = row[i];
inputRow.push(
<InputButton
value={input}
... | [
"_renderInputButtons() {\n let views = [];\n\n for (var r = 0; r < inputButtons.length; r++) {\n let row = inputButtons[r];\n\n let inputRow = [];\n for (var i = 0; i < row.length; i++) {\n let input = row[i];\n\n inputRow.push(\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checkEmail (TEXTFIELD theField [, BOOLEAN emptyOK==false]) Check that string theField.value is a valid Email. For explanation of optional argument emptyOK, see comments of function isInteger. | function checkEmail (theField, emptyOK)
{ if (checkEmail.arguments.length == 1) emptyOK = defaultEmptyOK;
if ((emptyOK == true) && (isEmpty(theField.value))) return true;
else if (!isEmail(theField.value, false))
return warnInvalid (theField, iEmail);
else return true;
} | [
"function checkEmail (theField, emptyOK)\r\n{ if (checkEmail.arguments.length == 1) emptyOK = defaultEmptyOK;\r\n if ((emptyOK == true) && (isEmpty(theField.value))) return true;\r\n else if (!isEmail(theField.value, false)) {\r\n return warnInvalid (theField, iEmail);\r\n }\r\n else return tru... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a selection change, gets the values from the checkboxes/radios etc. and stores the checks in the menu next to the previous selected text field. | function saveCheckToMenu(newChk) {
var curFieldNum,isReqd,thingToAddToMenu;
curFieldNum = document.theForm.fieldMenu.selectedIndex; //get index to swap
if (curFieldNum != null) //if something selected
if (document.theForm.fieldMenu.options[curFieldNum].text) { //if there's a menu item
isReqd = (docume... | [
"__onModelSelectionChange(evt) {\n let checked = [];\n let selected = {};\n this.getModelSelection().forEach(\n itemModel => (selected[itemModel.toHashCode()] = itemModel)\n );\n\n this.getChildren().forEach(item => {\n let itemModel = item.getModel();\n if (selected[it... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete Friend From Group | function deleteFriendFromGroup(room) {
Comm.deleteFriendFromGroup(room).then(()=> {
});
} | [
"function deleteGroup(groupName){\r\n\t\tif(groupName == \"friend\"){\r\n\t\t\talert(\"Sorry, you can't delete friend's group\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tgrp = document.getElementById(\"id_\" + groupName);\r\n\t\tgrpList = document.getElementById(\"gl_\" + groupName);\r\n\t\tif(grp){\r\n\t\t\tvar par = grp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enable or disable mod antics | set enableAntics(val) {
if (val) {
this.setValue("EnableForce", true);
$("#cbForce").check();
} else {
this.setValue("EnableForce", false);
$("#cbForce").uncheck();
}
} | [
"function enableBattleActions() {\r\n $('#attack, #skill, #magic, #item').removeAttr('disabled');\r\n}",
"enable() {\n this.enabled = true;\n }",
"get enableAntics() {\n /* This is now disabled. */\n return false;\n /*return this.getValue(\"EnableForce\") && $(\"#cbForce\").is(\":checked\");... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
students Lists all the endpoints owned by the students associated endpoints | function getStudentEndpoints() {
return function (req, res) {
res.send({
GetStudentByID: "/students/id/:userid",
GetStudentCourses: "/students/id/:userid/courses",
GetAllStudents: "/students/all",
GetAllStudentsByUni: "/students/all/:university",
});
};
} | [
"list(req, res) {\n studentDAO.getStudents(db)\n .then(students => {\n res.status(200).json(students)\n })\n .catch(err => {\n console.error(err)\n res.sendStatus(404)\n })\n }",
"static async getTutorialStudents(req: Request, res: Response): Promise<void> {\n l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
min max from youtube Complete the miniMaxSum function below. | function miniMaxSum(arr) {
let newArr = [...arr].sort()
let sum = 0;
for (let i = 0; i < newArr.length; i++) {
sum += newArr[i]
}
let minValue = sum - newArr[newArr.length - 1]
let maxValue = sum - newArr[0]
console.log(minValue, maxValue)
} | [
"function miniMaxSum(arr) {\n \n var min=0,max=0;\n var sum=0;\n for(var i=0;i<arr.length;i++)\n {\n sum=sum+arr[i]; \n }\n \n min=sum;\n for(var i=0;i<arr.length;i++)\n {\n var temp=sum;\n \n temp=temp-arr[i];\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Shows values after dividing by Zero and Negative Zero | function dividePositiveZero(input) {
return input / 0;
} | [
"function zeroDivide() {\n if (count.text() == \"Infinity\" || isNaN(count.text()) ||\n subCount.text().endsWith(\"Infinity\")) {\n clear(\"Error divide to zero\");\n return false;\n }\n return true;\n }",
"function caml_raise_zero_divide () {\n caml_raise... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets path for child, returns from `pathCache` if it is a hit in order not to rerender child component due to reference change its path. | getPathForChild(key) {
if (!this.pathCache[key] || this.pathCache[key][this.path.length - 1] !== this.path[this.path.length - 1]) {
this.pathCache[key] = this.path.concat(key);
}
return this.pathCache[key];
} | [
"function _path() {\n return this.__cache__._path = this.__cache__._path ||\n (this.superstate ? _path.call(this.superstate).concat(this) : [this]);\n }",
"getParentResourcePath( path, cache ) {\n let filename = Path.basename( path );\n if( filename.startsWith('index.') ) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PrefixStream, requiered to make prefixes in container logs | function PrefixStream (prefix) {
if ( ! (this instanceof PrefixStream)) {
return new PrefixStream(prefix);
}
prefix = prefix || '';
this.inStream = new PassThrough();
this.outStream = new PassThrough();
var tr = through(function(line){
line = util.format('%s%s\n', prefix, line);
this.queue... | [
"createLogStream(prefixName) {\n const self = this;\n return es.pipe(es.split(), es.through(function (data) {\n if (data == '')\n return;\n this.emit('data', self.formatWithPrefix(prefixName, data));\n }));\n }",
"function prefix(stream, c){\n if(c){\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Private functions. This function attaches booking members to the booking objects. Two attribute will be attached for display purpose: booker and members. "booker" is the booker of reservation. "members" is a string display all members in the reservation. | function attachBookingMembers(bookingResource) {
var bookingDeferred = $q.defer();
// Look up all members of the booking by BookingMember resource,
// and map them into a deferred promise that can be resolved
// after all AJAX calls done.
var bookings = $.map(bookingResource.objects, func... | [
"function addMembers() {\n\n // add team members\n for ( var member in team.members ) addMember( team.members[ member ] );\n\n // is there a maximum number of team members? => add free member slots\n for ( var i = 0; i < max_members - Object.keys( team.mem... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a new member to the database | function addMember(newmember){
members.create(newmember);
} | [
"function addNewMember(self) {\n loadNewTeamMemberDatasheet(self);\n hide2ListsMembersContainer(self);\n self.setCurrentPage('new-member');\n }",
"add(member) {\r\n this.members.push(member);\r\n }",
"addMember(userUID=null){\n if(userUID && this.org.uid){\n /* add ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Part 1 Find the total age of male coders under 25 | function maleCodersUnderTwentyFive(arr) {
let filtered = arr.filter(n => n.gender === "m")
return filtered.map( n => n.age).reduce((n, acc) => n+ acc, 0)
} | [
"function calculateDogAge() {}",
"function catAge (humanYears) {\n switch (humanYears) {\n case 1: return 15;\n case 2: return 15 + 9;\n default: return 15 + 9 + ((humanYears - 2) * 4) \n }\n}",
"function calculateAge(birthyear)\n{\n\tvar currentYear = new Date().getFullYear();\n\tvar age = currentYe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return true if we have the source content for every source in the source map, false otherwise. | hasContentsOfAllSources() {
return this._sections.every(function (s) {
return s.consumer.hasContentsOfAllSources()
})
} | [
"hasContentsOfAllSources() {\n if (!this.sourcesContent) {\n return false;\n }\n\n return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function (sc) {\n return sc == null;\n });\n }",
"hasContentsOfAllSources() {\n if (!this.sourcesContent) {\n ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
COMPARISONS WITH THE LOGICAL And OPERATOR | function testLogicalAnd(val) {
if (val <= 50 && val >= 25) {
//&& = AND
return "yes";
}
return "NO";
} | [
"function and(a, b) {\n if(a === true && b === true){\n return true;\n }else{\n return false;\n }\n}",
"function and(a, b) {\n if (a && b == true) {\n return true;\n }\n return false;\n}",
"function and(a, b) {\n return a && b\n}",
"function and(value1, value2){... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns presence of "optedout of personalization" cookie | function __hasOptedOutOfPersonalization() {
return window.localStorage.getItem(CONCERT_NO_PERSONALIZATION_KEY) === 'true';
} | [
"function hasOptedOutOfPersonalization() {\n const CONCERT_NO_PERSONALIZATION_KEY = 'c_nap';\n\n return storage.getDataFromLocalStorage(CONCERT_NO_PERSONALIZATION_KEY) === 'true';\n}",
"function __gaTrackerIsOptedOut() {\nreturn document.cookie.indexOf(disableStr + '=true') > -1;\n}",
"function hideAlreadyAcc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Scoreboarding loop function runScoreboard() This function reads the parameters to get the clock cycles required for each Functional Unit, then parses the code in order to use it to build the scoreboard and display it in a table. | function runScoreboard(){
// Setup
fpRegFile = Array(32).fill(0.0);
intRegFile = Array(32).fill(0);
dataMem = [45, 12, 0, 0, 10, 135, 254, 127, 18, 4,
55, 8, 2, 98, 13, 5, 233, 158, 167];
IC = 0;
var clk = 1;
var instList = document.getElementById('instruction_input').valu... | [
"function init_scoreboard() {\n\tvar tbody = document.getElementsByTagName('tbody')[0];\n\tvar str = '';\n\t\n\t// create rows \n\tfor (var i = 0; i < rows.length; i++) {\n\t\tvar row = rows[i];\n\t\tvar team = row[1];\n\t\tvar name = team[1];\n\t\tif(team.length >= 3){\n\t\t\tname = team[2] + ' ( ' + name + ' )';\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
file workers find all openapi_x_x_x.ts as ['x.x.x', ...] | function getIstalledVersionsOpenTS() {
if (!fs.existsSync(openapisPath)) {
fs.mkdirSync(openapisPath);
}
var filesNames = fs.readdirSync(openapisPath);
return filesNames
.filter((fn) => fn != '.gitkeep' && fn != currentFileName)
.map((fn) => fn.match(reVersion).groups.version.replaceAll('_', '.'));
... | [
"getFileModtimes (cb) {\n const ret = []\n parallelLimit(this.files.map((file, index) => cb => {\n const filePath = this.addUID ? path.join(this.name + ' - ' + this.infoHash.slice(0, 8)) : path.join(this.path, file.path)\n fs.stat(filePath, (err, stat) => {\n if (err && err.code !== 'ENOENT')... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get an existing LocalGatewayRouteTableVpcAssociation 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 LocalGatewayRouteTableVpcAssociation(name, state, Object.assign(Object.assign({}, opts), { id: id }));
} | [
"function LocalGatewayRouteTableVpcAssociation() {\n _classCallCheck(this, LocalGatewayRouteTableVpcAssociation);\n\n LocalGatewayRouteTableVpcAssociation.initialize(this);\n }",
"constructor(scope, id, props) {\n super(scope, id, { type: CfnLocalGatewayRouteTableVPCAssociation.CFN_RESOURCE_TYPE_NAM... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For the filed that represent country, it has datacountry contains country id, take it an set text to element with country id | function setCountryNameInstadeOfId() {
$("*[data-country]").each(function () {
var id = $(this).data("country");
$(this).text(countryMap[id]);
})
} | [
"function getCityCountry (data)\n{\n var city = data [\"city\"] [\"name\"];\n var country = data [\"city\"] [\"country\"];\n var element = document.getElementById (\"city\");\n if (element != null)\n element.innerHTML = city + \",\" + country;\n \n}",
"function update_selected_country_text() {\n\t\t\t\tif... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a forecast sentiment (cold, warm, hot) and absolute min and max | function getTemperatureSummary(forecastSummary) {
let max = 0;
let min = forecastSummary[Object.keys(forecastSummary)[0]].averageTemp;
let sentiment = null;
let minMaxObj = {};
// Loop over every day getting the absolute min and max values
forecastSummary.forEach(async function(dateEntry) {
minMaxObj ... | [
"checkSentiment(input) {\n const threshold = 0.5; //sentiment ranked scale +-5\n var Sentiment = require('sentiment');\n var sentiment = new Sentiment();\n var analysis = sentiment.analyze(input);\n \n if(analysis.comparative < -threshold) {\n ret = \"negative\";\n } else if(analysis.comparati... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The main game loop. Calls playRound() up to five times, keeping track of the player and cpu's score as well as ties. Stops early if the player or the computer get to 3 (since it's best of 3) Calls getCurrentScore between rounds to show the player the score calls getOutcome at the end of the (up to) 5 rounds | function game()
{
let playerScore = 0;
let computerScore = 0;
let ties = 0;
const MAX_ROUNDS = 5;
for(let i = 0; i < MAX_ROUNDS; i++)
{
if(!(playerScore === 3 || computerScore === 3))
{
let outcome = playRound();
if(outcome === "win")
{
playerScore++;
}
else if(outcome === ... | [
"function playRound() {\n while (computerScore<5 && userScore<5) { // removed logic of playing 5 rounds\n console.log('\\n ROUND ' + roundCounter);\n console.log(\"Computer score: \" + computerScore);\n console.log(\"User's score: \" + userScore);\n \n console.log('Player selection= ' + playerSelect... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reduce the expert info into projectSpecificExperts before patch/update Remove all attributes of experts list except expertId Attribute to be moved: statusInProject experience addedBy notes history country partnerRef Reduce the consultation info into just ids before patch/update | function reduceData () {
// reduce expert info
var reduceExperts = [];
for (var i = 0; i < $scope.project.experts.length; i++) {
var id = $scope.project.experts[i].objectId;
reduceExperts.push(id);
var index = mapExperts(id);
if( index > -1) {
if($scope.projec... | [
"function reduceExpert() {\n var tempArr = [];\n // reduce contact\n for(var i = 0; i < $scope.expert.contacts.length; i++){\n tempArr.push($scope.expert.contacts[i].objectId);\n }\n $scope.expert.contacts = tempArr;\n // reduce Project\n for(var i = 0; i < $scope.expert.pr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pseudocode for a function that takes an array of integers, and returns a new array with every other element Given an array of numbers Create new array Append every other element to new array return new array Formal Pseudocode START Given an array of numbers called 'numbers' SET everyOtherNumbers = [] SET i = 0 WHILE i ... | function everyOther(numbers) {
let everyOtherNumbers = [];
for (let i = 0; i < numbers.length; i += 2) {
everyOtherNumbers.push(numbers[i]);
}
return everyOtherNumbers;
} | [
"function evenNumbers(array, number) {\n var answer = [];\n let i = array.length-1\n while((answer.length != number) && ( i != -1)){\n if (array[i] % 2 == 0){answer.unshift(array[i])};\n i -= 1\n }\n return answer\n}",
"function evenNumbers(array) {\n var newArray = [];\n for (var index = 0; index < ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Displays a single chat message | function displayChatMessage (message) {
//console.log('TODO: displayChatMessage : ');
/*
// Make the new chat message element
var msg = document.createElement("span");
msg.appendChild(document.createTextNode(message));
msg.appendChild(document.createElement("br"));
// Append the new message to th... | [
"function displayMsg(data){\n\t\t\t\t\t $chat.append('<span class = \"msg badge badge-pill badge-secondary animated rotateInUpLeft\"><b>' + data.nick + ': </b>' + data.msg + \"</span><br/>\");\n\t\t\t\t }",
"function displayPrivateChat(name,msg){\n \tvar html = \"<span class='pMsg'><strong>\" + name + \":</s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the most recently retrieved REST allowance data. | getAllowance() {
if (this.lastAllowance) {
return this.lastAllowance;
}
else {
throw new Error('You must make a request before getting your allowance data.');
}
} | [
"function getRecentlyAccessed(){\n\t\tif (__token) {\n\t\t\treturn $http(__host+'/recentlyaccessedbyme')\n\t\t\t\t.get();\n\t\t} else {\n\t\t\tthrow __noTokenIsSetError;\n\t\t}\n\t}",
"function getNewestRequest() {\n return $filter('orderBy')(self.list, '-timestamp')[0];\n }",
"getLastList() {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the function is for creating a remove query post request input: guid of what to remove output: none | function removeQuery(guid) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
location.reload();
}
};
xhttp.open("POST", "removeQuery.php", true);
xhttp.setRequestHeader("Content-type", "applica... | [
"deleteQuery(query) {}",
"function remove_url_post_params(event) {\n event.preventDefault();\n var id = $(this).data('id');\n var selectors = JSON.parse($('#url_post_params_hidden').val());\n var key = $('#publisher_url_post_params_key_' + id).val();\n var value = $('#publisher_url_post_params_value_' + id).... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Your task is to write a function maskify, which changes all but the last four characters into ''. Examples maskify("4556364607935616") == "5616" maskify( "64607935616") == "5616" maskify( "1") == "1" maskify( "") == "" // "What was the name of your first pet?" maskify("Skippy") == "ippy" maskify("Nanananananananananana... | function maskify (str) {
if(str.length > 4){
let newStr = str.substring(str.length - 4);
let maskedChars = "#";
return maskedChars.repeat(str.length - 4) + newStr;
}
else { return str;}
} | [
"function maskify(string) {\n if (string.length < 5) {\n return string;\n }\n var array = string.split(\"\");\n for (var i = 0; i < array.length - 4; i++) {\n array[i] = \"#\";\n }\n string = array.join(\"\");\n return string;\n}",
"function maskify(cc) {\n if(cc.length === 0) {\n return \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks for overlaps in memory table | function overlapsCheck(table){
if(table.length==1){
return false;
}else{
for(var k=1; k<table.length;i=k++){
var start=table[k][1];
var end=table[k][2];
for(var j=k-1;j>=0; j--){
if((table[j][1]<=start&&start<=table[j][2]) || (table[j][1]<=end&&end<=table[j][2])){
... | [
"function overlapsCheck(table){\r\n if(table.length==1){\r\n return false;\r\n // console.log(\"yes\");\r\n }else{\r\n for(var k=1; k<table.length;k++){\r\n var start=table[k][1];\r\n var end=table[k][2];\r\n for(var j=k-1;j>=0; j--){\r\n if((table[j][1]<=start&&start<=table[j][2]) |... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DEAL CARD TO DEALER | dealDealerCard() {
let randDealerNum = this.randomDealerCard();
this.dealerHand.push(this.cardsInDeck[randDealerNum]);
this.cardsInDeck.splice(randDealerNum, 1);
} | [
"function dealToDealer() {\n dealerCard = dealCard(deck);\n showCard(dealerCard, \"dealer-hand\");\n dealerHand.push(dealerCard);\n}",
"deplete(depleteAmount){\n if(!this.subtract(depleteAmount)){\n this.amount = 0;\n }\n this.updateCard();\n }",
"deal() {\n le... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
LINK HANDLING FNCS FUNCTION: stringCanBeLink DESCRIPTION: Determines if the given string can be reasonably become a link. Some problems happen if things like form elements and tables are wrapped in A tags. ARGUMENTS: selStr the string to check for link worthiness RETURNS: boolean | function stringCanBeLink(selStr) {
var illegalLinkTags = " TABLE INPUT FORM LAYER ILAYER ";
var i, rootNode, node, tagName;
var retVal = true;
var tempFileDom, tempFilePath = dw.getConfigurationPath()+"/Shared/MM/Cache/empty.htm";
if (DWfile.exists(tempFilePath)) {
tempFileDom = dw.getDocumentDOM(tempFi... | [
"function stringCanBeLink(selStr) {\r\n var illegalLinkTags = \" TABLE INPUT FORM LAYER ILAYER DIV TR TD A P \";\r\n var i, rootNode, node, tagName;\r\n var retVal = true;\r\n var tempFileDom, tempFilePath = dw.getConfigurationPath()+\"/Shared/MM/Cache/empty.htm\";\r\n\r\n if (DWfile.exists(tempFilePath)) {\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attribute value (unquoted) state | [ATTRIBUTE_VALUE_UNQUOTED_STATE](cp) {
if (isWhitespace(cp)) {
this._leaveAttrValue(BEFORE_ATTRIBUTE_NAME_STATE);
} else if (cp === $$5.AMPERSAND) {
this.returnState = ATTRIBUTE_VALUE_UNQUOTED_STATE;
this.state = CHARACTER_REFERENCE_STATE;
} else if (cp === $$... | [
"attributeValueUnquotedState() {\n\t\tthis._currentIndex++;\n\t\tthis._currentEnd = this._currentIndex;\n\n\t\twhile (this._currentIndex < this._source.length) {\n\t\t\t// character reference in attribute value state is not supported\n\t\t\tconst next = this._source[this._currentIndex];\n\n\t\t\tif (WHITESPACE_TEST... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns index for image audio in data array | function getImageAudio_DataIndex() {
return 4;
} | [
"function getImageAudioFileType_DataIndex() {\n\treturn 5; \n}",
"function find_index(x){\n for(let i = 0; i < sounds.length; i++){\n if(x == sounds[i].name){\n return i;\n }\n }\n}",
"function getPictureIndex(album,picture){\n\tvar posAlbum = getAlbumIndex(album);\n\tvar albumAux = albums[posAlbum... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Metodo que vai contar o total de areas selecionadas | function totalSelectAreas() {
const selectAreas = document.getElementById("campo_selectArea");
var options = selectAreas && selectAreas.options;
var areaSelect = 0;
for (var i = 0; i < options.length; i++) {
if (options[i].selected) {
areaSelect++;
}
}
return areaSele... | [
"function calculateTotalArea(e) {\r\n var currentRoomDiv = $(this).parent().parent();\r\n calculateRowArea(currentRoomDiv.data(\"index\"));\r\n}",
"function calculateTotalApartmentSize() {\r\n let totalArea = 0.0;\r\n dataArray.forEach((item, i) => {\r\n let area = (item.width * item.height) || 0;\r\n t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Uncomment liquid tags and HTML that are specific to Jekyll (and hidden from GitHub). | uncommentJekyllSpecifics_(contents) {
// Note that [^] matches any character including newlines, whereas "."
// does not. For anyone who's wondering, [^] the negation of the empty
// set.
return contents.replace(/<!--([{<][^]*?[>}])-->/g, '$1');
} | [
"function stripMarkdown (original) {\n var text = original\n\n do {\n text = text\n // code\n .replace(/`([^`]+)`/g, '$1')\n // bold/italic\n .replace(/\\*\\*([^\\*]+)\\*\\*/g, '$1')\n .replace(/\\*([^\\*]+)\\*/g, '$1')\n .replace(/\\*([^\\*]+)\\*/g, '$1')\n .replace(/(?:^|\\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function: sets thumbnail image height based on a percentage of its width | function setThumbanilTopviewsHeight() {
var newHeight = parseInt($(".thumbnail").css("width")) * 0.7;
console.log("height: " + newHeight);
$(".thumbnail").css("height", newHeight);
} | [
"function setImageHeight (heightPercentage, element) {\n\n\t\tvar containerWidth = element.css('width');\n\t\tvar containerHeight = parseInt(containerWidth) * heightPercentage;\n\n\t\treturn containerHeight;\n}",
"function setImageHeight (heightPercentage, element) {\n\n\t\tvar containerWidth = element.css('width... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
transforme l'imagedata des plateformes en tableau, pour etre lu par l'objet Player rapidement. | function imgDataToTable(imgData){
var val = 0;
var t = imgData.length
var currentLine = [];
var outputTable =[];
for (i=0;i < t ;i++){
val = val + imgData[i];
//chaque 4 cases faire le test de si noir ou blanc
if(((i+1)%4) == 0 ){
//et ajouter le résultat a la colonne currentLine
... | [
"procesa() {\n let tempData = this.data.slice(); //Copia del arreglo de datos.\n let offsetY = Math.floor(this.malla.length / 2); //El extra de la malla\n let offsetX = Math.floor(this.malla[0].length / 2);\n\n for (let j = 0; j < this.imgHeight; j++) //Recorre imagen\n for (l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Document down handler closes menu and/or editor on click outside of the element | _documentDownHandler(event) {
const that = this,
target = that.shadowRoot || that.isInShadowDOM ? event.originalEvent.composedPath()[0] : event.originalEvent.target;
if ((target.shadowParent && target.shadowParent.closest('.jqx-input-drop-down-menu')) || target.closest('.jqx-input-drop-down... | [
"_onDocumentClick(e) {\n if (e.target.matches('.dropdown-trigger')) {\n return;\n }\n\n if (this.isAnimated || !this.isActive) {\n return;\n }\n\n this.close();\n }",
"onMouseDownOutside() {\n this.closeMenu();\n }",
"function _onDocumentClick() {\n if ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Unwraps the given blob of data (wrappedSk), as long as args.origin is allowed to use the key (as specified in the key's policy), the key is not expired, and the given privileges are allowed by the policy. keyUsage is optional: the usage policy won't be checked if keyUsage isn't given. Returns false if there is a policy... | function tryUnwrapKey(pk, blob, origin, keyUsage) {
var pt = tryDecryptKey(pk, blob), policy, genOrigin;
if (!pt) {
return false;
}
policy = policyFromVerifiedBlob(blob);
// first verify the dates of validity
if (checkPolicyValidity(policy)) {
// If the key is not expired, then ver... | [
"function checkCachedKeyPolicy(unwrappedBlob, origin, policy) {\n var skBits = unwrappedBlob.sk;\n\n if (checkPolicyValidity(unwrappedBlob.policy)) {\n if (origin !== unwrappedBlob.policy.origin ||\n !(unwrappedBlob.policy.keyUsage & policy)) {\n skBits = false;\n }\n } else {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if the page link consist of more than 1 word | function containPageNameMoreThan1Word(pageLink){
let splitPageLink = pageLink.split("_");
for(let i = 0; i < splitPageLink.length; i++){
if(splitPageLink[i].length < 4){
splitPageLink[i] = splitPageLink[i] = splitPageLink[i].toUpperCase();
}
if(splitPageLink[i].length >= 4){
splitPageLink[i] = splitPageLin... | [
"function wordCheck(word, url) {\n word = word.replace(/\\s/g, \"\");\n let short_article = word.slice(0, 2).toLowerCase();\n let long_article = word.slice(0, 3).toLowerCase();\n\n if (long_article === \"los\" || long_article === \"las\") {\n word = word.slice(3)\n if (word.slice(word.leng... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update an arbitrary tile element from tile (used for inventory and world) | function updateImage(tileElem, tile) {
tileElem.style.visibility = (tile === Tile.Empty) ? "hidden" : "visible";
var image = tileToImage[tile.name] || "Rock";
tileElem.src = "resources/"+image+".png";
} | [
"updateTile(tile, tilePosition) {\n\n var translationPosition = this.getTileTranslation(tilePosition);\n var x = translationPosition.getX();\n var y = translationPosition.getY();\n\n jQuery(tile).css({\n 'height': this.getTileSize() + 'px',\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to put people you want to Credit into a github link | function giveCredit(creditNames){
if (creditNames==true){
return "https://github.com/"+creditNames;
}else{ return '';
}
} | [
"function createGithubURL(data) {\n var url = 'not found...';\n if (data['user'] != '' && data['repo'] != '') {\n url = \"https://github.com/\" + data['user'] + \"/\" + data['repo'] \n url += \"/blob/master/\" + createGithubPath(data);\n } else if (data['name'] != '') {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
helper functions is a function that will check if the hash and the password are equivalent password = is the plain text password that you are trying to check, hash = hashed password callback = function that will take in two arguments (err, response) where err = to any error that may occur, response is a true or false i... | function comparePassword(password, hash, callback){
console.log("going to compare the password: ", password, " and hash: ", hash);
bcrypt.compare(password, hash, function(err, res){
console.log("err: ", err, " result: ", res);
callback(err, res);
});
} | [
"function checkPassword (hash, password) {\n return hashPassword(password) == hash;\n}",
"function verify(password, hash, salt, callback) {\n //hashpasword\n hashPassword(password, salt, (err, hashedPassword) => {\n if (err) {\n return callback(err);\n }\n\n if (hashedPassword === hash) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Detects whether an element's content has vertical overflow | function hasVerticalOverflow(element) {
return element.clientHeight < element.scrollHeight;
} | [
"function hasVerticalOverflow(element) {\n return element.clientHeight < element.scrollHeight;\n}",
"function hasVerticalOverflow(element) {\n return element.clientHeight < element.scrollHeight;\n}",
"function isOverflown(element) {\r\n return element.scrollHeight > element.clientHeight || element.scroll... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end of listPersons / persons_init reads in scenario and starts | function persons_init(canvas, people){
/* You can define People explicitly */
//people[0] = new Person(0, 'Matt', 'M', '31', new Vitals('80/60', 140, 28, 'PEARL, Lung Sounds clear bilateral'), 20,200);
//people[1] = new Person(1, 'Cindy','M', '29', new Vitals('120/80', 88, 16, 'PEARL, Lung Sounds clear bilateral'),... | [
"function initializePeople() {\n if (readPeople().people.length == 0) {\n let movies = loadMovies();\n for (let i = 0; i < movies.length; i++) {\n let actors = movies[i].Actors.split(\", \");\n for (let j = 0; j < actors.length; j++) {\n if (!hasName(actors[j]))... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
retrieve user's chosen item from localStorage | function getChosenItem(){
$("#spinlabel").html(localStorage.getItem("chosenItem"));
} | [
"function get_selected_option() {\n options = JSON.parse(localStorage.getItem('booking_options'));\n selected_option = localStorage.getItem('selected_option');\n }",
"function getLocalStorageItem(item){\n //this returns the function with an empty string if the item isn't in local storage\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Start a new terminal session. | function startNew(options) {
return default_1.DefaultTerminalSession.startNew(options);
} | [
"async startNew(options) {\n const session = await terminal_1.TerminalSession.startNew(this._getOptions(options));\n this._onStarted(session);\n return session;\n }",
"startNew(options) {\n return terminal_1.TerminalSession.startNew(this._getOptions(options)).then(session => {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new comment | function NewComment() {
} | [
"function hc_documentcreatecomment() {\n var success;\n if(checkInitialization(builder, \"hc_documentcreatecomment\") != null) return;\n var doc;\n var newCommentNode;\n var newCommentValue;\n var newCommentName;\n var newCommentType;\n \n var docRef = null;\n if (typeof(t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a submit button, append it to the form, and return it. | appendSubmitButton() {
let button = document.createElement("button");
button.setAttribute("type", "submit")
button.setAttribute("id", "submit-button");
button.innerText = "SUBMIT";
button.classList.add("upload-button");
this.form.appendChild(button);
return but... | [
"function createSubmitButton() {\n var submitInstance = document.createElement(\"input\");\n var formEl = document.getElementById(\"form\");\n submitInstance.id = \"submitInstance\";\n submitInstance.type = \"button\";\n submitInstance.value = \"Preview Widget\";\n submitInstance.classList.add(\"submitInstanc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
submit a new post | function submitPost(e){
e.preventDefault();
var title = e.target.title.value;
var description = e.target.description.value;
// form must be complete
if (!title.length || !description.length){
return false;
}
Posts.insert({
title: title,
description: description,
creationDate: new Dat... | [
"function submitPost() {\n\tconst title = ui.titleInput.value;\n\tconst body = ui.bodyInput.value;\n\tconst id = ui.idInput.value;\n\n\tif (title === '' || body === '') {\n\t\tui.showAlert(\n\t\t\t'One or more fields empty. Please check your input values!',\n\t\t\t'alert alert-danger'\n\t\t);\n\t} else {\n\t\tconst... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gets channel mask settings, returns custom object | function getChannelMaskSettings(){
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var desc = executeActionGet(ref);
var channelMask = {};
// density should be percent. it is 0-255 instead. so convert because percent is need to set... | [
"function getVectorMaskSettings(){\r\n\tvar ref = new ActionReference();\r\n\tref.putEnumerated( charIDToTypeID(\"Lyr \"), charIDToTypeID(\"Ordn\"), charIDToTypeID(\"Trgt\") ); \r\n\tvar desc = executeActionGet(ref);\r\n\tvar vectorMask = {};\r\n\tvectorMask.density = Math.round((desc.getInteger( stringIDToTypeID( ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrive url of articles by URL volume. | async function getArticlesByUrlVolume(url) {
try {
const html = await rp(url);
const $ = cheerio.load(html);
const articles = $('.tocArticle').map(function (i, el) {
return {
urlHtml: $('.tocGalleys a', el).attr('href'),
title: $('.tocTitle a', el).text(),
authors: $('.tocAut... | [
"function getArticleUrls(a) {\n\treturn a.url;\t\n}",
"function getFromWebtoons(url){\n \n}",
"function getVolume(volume) {\n var req = esriRequest({\n \"url\": volume.value.url,\n \"handleAs\": \"text\"\n });\n req.then(requestSucceeded, requestFailed);\n }",
"a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
when a region is selected:, filteredWines needs to be recalculated, currentWine needs to be reset | setCurrentRegion(region) {
this.setState({
currentRegion: region,
filteredWines: _.filter(this.props.wines, (wine) => (
wine.appelation === region
)),
currentWine: null
});
} | [
"updateFilter() {\n if (this.filterActive) {\n let cutoff = map(mouseX, 0, width, 40, 1000);\n this.triDel.process(this.triOsc, 0.8, 0.9, cutoff);\n }\n }",
"function filter(){\n\t//Define last action\n\tlastAction='filter';\n\t//remove search input\n\tdocument.getElementById('inputSearch').value... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets all the answers in storage. | function getAll() {
surveyStorage.getAll();
} | [
"function getAnswers() {\n\t\treturn answers;\n\t}",
"function getAnswers() {\n let questionAnswers = document.querySelectorAll('.answer');\n for (let i = 0; i < questionAnswers.length; i++) {\n answerSelection(questionAnswers[i]);\n }\n localStorage.setItem(\"userAnswers\", JSON.stringify(masterProfileO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete all the user_musics instances in the database | async deleteAll() {
try {
await this.connection('user_musics').delete();
} catch (error) {
throw error;
}
} | [
"function deleteAllAnimeFromUserList() {\n db.transaction((tx) => {\n tx.executeSql(\"delete from userlist\", [], () => {\n console.log(\"useDB: Deleted all anime from userlist in database!\");\n });\n });\n dispatch(clearUserData());\n }",
"deleteAll() {\n realm.write(() => {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Video BG and HUD Control | function videoStarter() {
$('#stream-boy').vide({
mp4:'video/streamboy-clip.mp4',
ogv:'video/streamboy-clip.ogv',
webm:'video/streamboy-clip.webm',
poster:'img/space-poster.jpg',
}, {
loop: true,
muted: true,
autoplay: true,
posterType: "jpg",
className: "stream-boy"
});
$('#spac... | [
"updateVideoDisplay () {\n this.setVideoTransparency({\n TRANSPARENCY: this.globalVideoTransparency\n });\n this.videoToggle({\n VIDEO_STATE: this.globalVideoState\n });\n }",
"updateVideoDisplay() {\n this.setVideoTransparency({\n TRANSPARENCY: this.gl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funcion que muestra las estadisticas del alumno que el docente seleccione del desplegable | function mostrarEstAlumnosParaDocente(){
let contadorEjXNivel = 0;//variable para contar cuantos ejercicios planteo el docente para el nivel del alumno
let contadorEntXNivel = 0;//variable para contar cuantos ejercicios de su nivel entrego el alumno
let alumnoSeleccionado = document.querySelector("#selEs... | [
"function generarEstadisticasAlumno(){\r\n let posicionUsuarioEnArray = buscarPosicionDelUsuario();\r\n let contadorEjParaNivel = 0;//para contar cuantos ejercicios hay planteados para el nivel del alumno\r\n let docenteDelAlumno = usuarios[posicionUsuarioEnArray].Docente.nombreUsuario;\r\n let nivelDel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if x is inside threshold area extents | function pointIsWithinThreshold(dx, x) {
return dx > x - THRESHOLD && dx < x + THRESHOLD;
} | [
"function hit(x, y) {\n return (x0 > x - 25 && x0 < x + 25 &&\n y0 > y - 25 && y0 < y + 25);\n }",
"inside(x, y) {\n let box = this.bbox();\n return x > box.x && y > box.y && x < box.x + box.width && y < box.y + box.height;\n }",
"boundsCheck(xM, yM, x, y, w, h){ \n if(xM > x && xM ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ControlSlider(options, containerId) A class that contains the html elements for the control panel and subgroups. Initialize with an options object and an html container id to place the panel in. Parameters: options...........(Object) from a configurations json containerId.......(String) div id factorSelections..(Array)... | function ControlPanel(options, containerId, factorSelections, multiSelect, theme){
this.selected = [];
this.panels = {};
this.container = containerId;
this.controls = options.Options;
this.misc = [options.DateCreated, options.ManagerID, options.ID, options.Name, options.Tickers, options.ProfileName];
... | [
"function SliderControls(slider){\r\n this.initialize(slider);\r\n}",
"function ControlSlider(name, group, weight, locked, flipped, topLevel, theme){\r\n if (group === undefined){\r\n group = false;\r\n };\r\n if (weight === undefined){\r\n weight = 0;\r\n };\r\n if (locked === undefined){\r\n lo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Applies row detail template. | _applyRowDetailTemplate(rowObject) {
const that = this,
dataFields = that.dataSource.dataFields;
let content = that.rowDetailTemplate;
for (let i = 0; i < dataFields.length; i++) {
const dataField = dataFields[i].name,
regex = new RegExp(`{{${dataF... | [
"get detailRow() { return this._detailRow; }",
"function row_detail(str, data, detail_dt) {\n var row_respon = detail_dt;\n if (row_respon.detail_row_respon != undefined) {\n return '<div class=\"slider-detail text-center\" data-search=\"'+row_respon.id_row+'\" style=\"display:none;margin: 10px 0 10px ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `ClearTimerProperty` | function CfnDetectorModel_ClearTimerPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but recei... | [
"function CfnDetectorModel_ResetTimerPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Expose a method for transforming tokens into the path function. | function tokensToFunction (tokens) {
// Compile all the tokens into regexps.
var matches = new Array(tokens.length)
// Compile all the patterns before compilation.
for (var i = 0; i < tokens.length; i++) {
if (typeof tokens[i] === 'object') {
matches[i] = new RegExp('^' + tokens[i].patt... | [
"function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n const matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (let i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create and cache the DOM nodes. Update its data too. This method creates a single row with updated data and returns the same. The data being referred and assigned via currencyPair data model. | getNode() {
if (this._trNode) {
this._tdName.textContent = this.CurrencypairData.name
this._tdBestBid.textContent = this.CurrencypairData.bestBid
this._tdBestAsk.textContent = this.CurrencypairData.bestAsk
this._tdLastChangeBestBid.textContent = this.CurrencypairData.lastChangeBid
this... | [
"function createMoneyTable() {\n const data = {\n userId: userID,\n day: dayNum\n };\n // Send the GET request\n $.get(\"/api/money\", data, function(data) {\n const numMoney = data.length;\n if(numMoney > 0) { // If data already exists\n data.forEach(item => { // Create rows ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to format and download the missing translations. | function exportMissing(translatePhrases, lang){
var toExport = {};
var file = "";
if(Object.keys(currMissing).length === 0){
showToast("There is nothing to export.", "R");
return;
}
else if(translatePhrases.options.length === 0){
showToast("Please load before trying to export.", "R");
return;... | [
"async getTranslationUrls() {\n const digest = this.state.api.asset_digest;\n const assets = [];\n let cached;\n const general = _.find(digest, d => d.bundle_name === 'i18n_general');\n cached = this.cache[this.withoutVersion(general.asset_id)];\n if (!cached || +cached !==... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |