query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Returns sites supported by The dictionary is indexed by the whatever.whatever format I use, and the values are the format that deslide recognizes. If these are different, I'll add the handler=NAME parameter when I construct the link. TODO: I think I'll have to improve my regex that extracts the whatever.whatever in ord... | function getDeslideSupportedSites() {
return {
'about.com': '*.about.com', 'accessatlanta.com': '*.accessatlanta.com', 'answers.com': '*.answers.com', 'aol.com': '*.aol.com', 'askmen.com': '*.askmen.com', 'bleacherreport.com': '*.bleacherreport.com', 'cafemom.com': '*.cafemom.com', 'cbslocal.com': '*.cbslo... | [
"function getSupportedSitesInfo() {\n var sites = {\n\n // Example URLs:\n // http://www.refinery29.com/2016/12/133127/how-to-wrap-presents\n \"refinery29.com\": {\n loadAll: function (thisInfo, fullArticleContainer, url) {\n addClassToDOMElements('.opener', 'isVisi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function to make the object have name and count keys | function remapObject(anObject)
{
return anObject.map((key) => {return {name: key, count: anObject.key}});
} | [
"function countCompsNames(list)\r\n{\r\n var obj = {};\r\n for(var i = 0; i<list.length; i++)\r\n {\r\n var name = list[i].name;\r\n if(name in obj)\r\n obj[name].total += 1;\r\n else \r\n obj[name] = {total: 1, nameIndex: 1};\r\n }\r\n return obj;\r\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CALCULATE TOUCH AND TRIGGER | function touchCalculate(e)
{
var endDate = new Date().getTime(); // current date to calculate timing
var ms = startDate - endDate; // duration of touch in milliseconds
var x = curX; // current left position
var y = curY; // current top position
var dx = x - startX; // diff of current left to... | [
"function touchCalculate(e) {\n var endDate = new Date().getTime(); \t// current date to calculate timing\n var ms = startDate - endDate; \t\t\t// duration of touch in milliseconds\n\n var ax = aCurX; \t\t\t\t\t\t\t// current left position of finger 'a'\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When the number of defenders in the box is selected (key), save the associated value | function defenders_value(ele) {
var selected = ele.value;
defenders_select = defendersInTheBox[selected]
} | [
"function passrushers_value(ele) { \n var selected = ele.value;\n passrushers_select = numberOfPassRushers[selected]\n}",
"function onChangeSelect() {\n\tif(selectMenu.selectedIndex != 0) {\n\t\tvar num=selectMenu.value;\n\t\tdocument.forms.namedItem(\"searchform\").elements.namedItem(\"pudnuggler\").value = s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update assignee including delete old records and save new ones | function updateAssignee(itemID, type) {
//Delete old records
$.ajax({
url: "Handler/UserHandler.ashx",
data: {
action: "deleteAssignee",
type: type,
itemID: itemID
},
type: "get",
success: function () {
//Save new records
... | [
"async updateEntityAssignee(id, model, assigneeId) {\n if (isNil(assigneeId)) {\n return this.deleteEntityAssignee(id, model);\n }\n\n const userExists = await getService('user', { strapi }).exists({ id: assigneeId });\n\n if (!userExists) {\n throw new ApplicationError(`Selected u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get message from queue | function getMessage(cli,q,w){
cli.brpop(q,0,function(err,reply){
if(err){
console.log(err);
}
else{
//call the worker with the queue output and add recursive callaback to the get message
w(reply[1],function(){
getMessage(cli,q,w);
});
}
});
} | [
"async getMessage() {\n const onMessage = queue.length > 0\n ? Promise.resolve()\n : new Promise((resolve) => {\n queueNonEmptyResolver = resolve;\n });\n await onMessage;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Action to take care of moving a RSS Feed from active to inactive or reverse | async function moveToInactive(feedobj, dispatch) {
if (feedobj.active === 1) {
await dispatch(feedsDeleteFeedSuccess(feedobj.feed_id));
feedobj.active = 0;
dispatch(feedsAddDataSuccess_na(feedobj));
} else {
await dispatch(feedsDeleteFeedSuccess_na(feedobj.feed_id));
feedobj.active = 1;
dispatch(feedsAdd... | [
"function update() {\n if(!feed) return;\n\n var htmlfeed;\n\n if(currentSort===0) {\n totalfeed = totalfeed.sort(function(a,b) {\n if (a.date>b.date) return -1;\n if (a.date<b.date) return 1;\n return 0;\n });\n\n htmlfeed = createSortByDateFeed();\n\n } else if(curre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Stops the preview and deactivates a display request, to allow the screen to go into power saving modes / | function stopPreview() {
isPreviewing = false;
// Cleanup the UI
var previewVidTag = document.getElementById("cameraPreview");
previewVidTag.pause();
previewVidTag.src = null;
// Allow the device screen to sleep now that the preview is stopped
oDisplayR... | [
"function deactivate() {\r\n console.log(\"Preview Extension Shutdown\");\r\n}",
"resume() {\n state.set(state.State.SUSPEND, false);\n chrome.app.window.current().show();\n this.backgroundOps_.notifyActivation();\n }",
"function stopFramerateDisplayUpdate() {\n\tdebugOn = false;\n}",
"displayDea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Format Date from FR to EN for the Datatbase | formatDate(dateP, lang) {
// console.log("Date Receive "+dateP);
let splitdat = dateP.split('-');
if (splitdat.length == 1) { //they use / instead of -
splitdat = dateP.split('/');
}
//console.log("DATE FR : " + splitdat+" TO "+lang);
let date_f = dateP;
... | [
"function dateFormatFR(date){\n let timestamp = Date.parse(date);\n let dateOrder = new Date(timestamp);\n return dateOrder.toLocaleDateString();\n}",
"function formatDate(date) {\n\t\t\t\treturn new Intl.DateTimeFormat('en-US').format(date)\n\t\t\t}",
"function changeformatt(date) {\n let currentDate... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove the hover, focus, active classes. | function classClearStandard($el, options) {
$el.removeClass(options.hoverClass + " " + options.focusClass + " " + options.activeClass);
} | [
"_unapplyClasses() {\n\t\t// unactivate all the slides\n\t\tthis._slides.forEach((slide) => {\n\t\t\tslide.removeAttribute('active');\n\t\t\tslide.removeAttribute('before-active');\n\t\t\tslide.removeAttribute('after-active');\n\t\t});\n\t\t// remove the active class on all goto\n\t\t[].forEach.call(this._refs.goTo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ack Function to issue a pubsub ack request | function ack(token, ackIds) {
// Construct url for pubsub ack:
const url = buildSubscriptionUrl() + ":acknowledge";
// Callback function for pubsub ack:
function callback (responseText) {
console.log('ack callback', JSON.stringify(JSON.parse(responseText)));
}
// Issue pubsub ack:
postRequest(url, a... | [
"ackSubscribe() {\n api.send(\n $pres({\n type: 'subscribe',\n to: this.get('jid'),\n })\n );\n }",
"function ack() {\n debug('ack delivery', data.fields.deliveryTag);\n ch.ack(data);\n }",
"ack(message) {\n const topicName = getTopicFor('ack')\n this\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Name: checkIfPreviouslyCalled Purpose: Checks the database to see if a number has previously called and if so returns the related entry Author: Paul Travis Created: 3/16/2021 Last Changed: 3/18/2021 Last Changed By: Paul Travis | async function checkIfPreviouslyCalled(str_number) {
const DDB_DOCUMENT_CLIENT = new AWS.DynamoDB.DocumentClient({region: 'us-east-1'});
const PARAMS = {
TableName: 'vanityNumbers',
Key: {
callingNumber: str_number
}
};
try {
const ARR_RETURNED_ITEM = await DDB_DOCUMENT_CLIENT.ge... | [
"function hasLaterUpdates(client, datamodel, sequenceNumber, key, callback) {\n var sqlParts = {\n select: ['count(*) > 0 as has_later_updates'],\n from: [datamodel.table + \"_history\"],\n whereClauses: [],\n orderClauses: [],\n sqlParams: []\n };\n\n crud.applyFilter(datamodel, sqlParts, key);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
new Baddies; / Baddie object with predefined movements | function Baddies() {
this.baddiePosition = [];
this.initiate = Initiate;
function Initiate() {
// reindex the baddies in the config by name
var baddies = gameConfig.graphics.baddies;
for (var i = 0; i < baddies.length; i++) {
var name = gameConfig.graphics.baddies[i].name;
gameConfig.graphics... | [
"function boat(x,y, des_speed, ox, oy, width, height, max_speed, image_index, reward_fame, mine_drop)\r\n{\r\n\tthis.x \t\t\t\t= x;//current x coordinate\r\n\tthis.y \t\t\t\t= y;//current y coordinate\r\n\tthis.vx \t\t\t= 0.0;//current x component of the velocity\r\n\tthis.vy \t\t\t= 0.0;//current y component of th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sourceUser need to be a verified user in order to set other user targetUser | setVerificationToAnUser (sourceUsername, targetUser) {
var setUserVerification = this.getUserVerificationStatus(sourceUsername).then((isVerified) =>{
return new Promise ((resolve, reject) => {
if (isVerified === true) {
resolve()
} else {
reject({err: {msg: 'It ... | [
"function tellUser(sourceUser, targetUser) {\n var interested = Math.random();\n\n /**\n * This user has already seen the concept.\n **/\n if (pastUsers.hasOwnProperty(targetUser.name)) {\n return false;\n }\n\n /**\n * Did the source user's pitch... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renderer for "PartCategory" model eslintdisablenextline nounusedvars | function renderPartCategory(name, data, parameters={}, options={}) {
var level = '- '.repeat(data.level);
var html = `<span>${level}${data.pathstring}</span>`;
if (data.description) {
html += ` - <i>${trim(data.description)}</i>`;
}
html += renderId('{% trans "Category ID" %}', data.pk, ... | [
"function renderPartCategory(name, data, parameters, options) {\n\n var level = '- '.repeat(data.level);\n\n var html = `<span>${level}${data.pathstring}</span>`;\n\n if (data.description) {\n html += ` - <i>${data.description}</i>`;\n }\n\n html += `<span class='float-right'>{% trans \"Catego... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears the extent for a brush. This hides it from view. | clear() {
this.initExtent_ = null;
var cl = '.' + this.brushClass_ + ' .brush-' + this.getId();
d3.select(cl).call(this.brush_.clear());
} | [
"function deleteThisBrush(brush){\n var brushToChange = '#' + brush + ' > .extent';\n $(brushToChange).attr('height', '0');\n $('ul.file_menu').stop(true, true).slideUp('medium'); \n\n // &+- makes the brush inactive in the back end\n isBrushActive[parseInt(brush.replace(/[^0-9\\.]/g, ''), 10)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
========================================================== Read 40 lines of trace and send to Master window ========================================================== | function readTraceMaster(item) {
if (item.window) {
for (var id = 1; id <= 3; id++) {
let port_id = "port" + id;
if (item[port_id].state === "running") {
if (fs.existsSync(item[port_id].simulator_log)) {
readLastLine
.read(item[port_id].simulator_log, 25)
.th... | [
"readTrace( trace ) {\n traceEntries = trace.toString().split(\"\\n\");\n traceEntries.forEach( function( entry ) {\n reference = entry.split( \" \" );\n this.runInstruction( reference[0], reference[1] ); \n });\n }",
"function readHistMaster(item) {\n if (item.windo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fun??o para validar a pesquisa por faixa de Localidade | function validaPesquisaFaixaLocalidade(){
var form = document.ImovelOutrosCriteriosActionForm;
retorno = true;
if((form.localidadeOrigemID.value != "" )
&& (form.localidadeOrigemID.value > form.localidadeDestinoID.value)){
alert("O c?digo da Localidade Final deve ser maior ou igual ao Inicial.");
... | [
"function validarApellidos(){\n\t\tif (esVacio(apellidos.value.trim())){\n\t\t\terrorApellidos.innerHTML = \"Los apellidos no pueden estar vacíos\";\n\t\t}\n\t\telse{\n\t\t\terrorApellidos.innerHTML = \"\";\n\t\t}\n\t}",
"function validaPaciente(paciente){\n\n //criando array de erros\n var erros = [];\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a `LazyIterator` of incrementing integers. | function iteratorFromIncrementing(start) {
var i = start;
return iteratorFromFunction(function () { return ({ value: i++, done: false }); });
} | [
"function iteratorFromIncrementing(start) {\n let i = start;\n return iteratorFromFunction(() => ({ value: i++, done: false }));\n}",
"function nextIterator(arr) {\n var i = 0;\n return {\n next: function() {\n var elem = arr[i];\n i++;\n return elem;\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create discussion post reply. | async function createDiscussionPostReply (currentUser, discussionPostId, entity) {
try {
// check if the opportunity exists.
const parent = await model._models.DiscussionPost.findById(discussionPostId)
return await models.sequelize.transaction(async (t) => {
const post = {
opportunityId: par... | [
"postReply(content, parentId, transcriptLineId) {\n this.#manager.postReply(content, parentId, transcriptLineId).then(() => {\n this.updateDiscussion();\n });\n }",
"function createReply(board, thread){\n let date = new Date();\n \n //Add Reply\n thread.replies.push({\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
printTriangle(); 2) FizzBuzz Write a program that uses console.log to print all the numbers from 1 to 100, with two exceptions. For numbers divisible by 3, print "Fizz" instead of the number, and for numbers divisible by 5 (and not 3), print "Buzz" instead. When you have that working, modify your program to print "Fizz... | function printFizzBuzz() {
for(let i = 1; i <= 100; i++) {
if(isDivBy3(i) && isDivBy5(i)) {
console.log('FizzBuzz');
} else if(isDivBy3(i)) {
console.log('Fizz');
} else if(isDivBy5(i)) {
console.log('Buzz');
} else {
console.log(i);
}
}
} | [
"function fizzBuzz(num) {\r\n if (num % 3 == 0 && num % 5 == 0) {\r\n console.log(\"FizzBuzz\");\r\n }\r\n if (num % 3 == 0) {\r\n console.log(\"Fizz\");\r\n }\r\n if (num % 5 == 0) {\r\n console.log(\"Buzz\");\r\n }\r\n}",
"function fizzBuzz(number) {\n if (number % 3 ==... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resumes the worklist activation. This happens after the views are loaded | function continueWorklistActivation() {
if (queuedQualificationCriteria) {
viewPayload({ QualificationCriteria: queuedQualificationCriteria, isAdHocSearch: true, AvailableViews: availableViews });
currentView('viewmodels/worklist');
queuedQualificationCriteria = null;
... | [
"resume() {\r\n if (this._active) {\r\n return;\r\n }\r\n this._active = true;\r\n this.update();\r\n }",
"resume() {\n state.set(state.State.SUSPEND, false);\n chrome.app.window.current().show();\n this.backgroundOps_.notifyActivation();\n }",
"function resum... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Abstract method call exception. / Optional method name. | function abstract(name) { throw Error((name || 'This') + ' is an abstract method.'); } | [
"function InvalidParentMethodCall(name) {\n StdError.apply(this, arguments);\n this.message = prefix + \"::Parent Class doesn't have the method: \" + name;\n }",
"surprise(name) {\n throw new Error('This method to be implemented by the sub-class');\n }",
"function noSuchMethodError(sel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
starting the trip for electrical boat and saving guest information and trip information and boat information. | function ElectricStartTrip(){
var actualPriceInput = $('#elActualPrice').val();
var nameInput = $('#elNameInput').val();
var idTypeInput = $('#elIdTypeInput').val();
var idNumberInput = $('#elIdNumberInput').val();
var mobileNumberInput = $('#elMobileNumberInput').val();
if (!actualPriceInput||... | [
"function startTrip() {\n var actualPriceInput = $('#actualPrice').val();\n var nameInput = $('#nameInput').val();\n var idTypeInput = $('#idTypeInput').val();\n var idNumberInput = $('#idNumberInput').val();\n var mobileNumberInput = $('#mobileNumberInput').val();\n\n if (!actualPriceInput||actu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to update all balances | function updateBalance() {
// Create a new array with just the amounts from the transactions array
const transactionAmounts = transactions.map( transaction => transaction.amount );
// Calculate total balance value
const totalBalance = transactionAmounts.reduce( (acc, amount) => ( acc += amount), 0 );
... | [
"function updateAllBalances() {\n updateBankBalanceOnPage();\n updateBankLoanBalanceOnPage();\n\n // Can be found in work.js\n updateWorkPaymentBalanceOnPage();\n}",
"function updatePayBalance(newBalance){\n payBalance = newBalance\n}",
"updateBalance() {\n this.balance -= this.totalBet;\n this.upd... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
string to print to console if the condition is false Call For Fire Function | function callForfire(){
friendlies = 4985;
enimies = 4658;
dangerClose = "U=It is not safe to fire ammunition";
repeatFire = "We have been cleared hot";
if(friendlies > enimies){
console.log(repeatFire);
} else
console.log(dangerClose);
} | [
"function false_func() {\n console.log('Welcome to');\n}",
"function fire () {\n if (blacksmith.fire) {\n blacksmith.fire = false\n return `You have put out the fire.`\n } else if (blacksmith.wood > settings.fireWood) {\n blacksmith.wood -= settings.fireWood\n blacksmith.fire = true\n return `... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Changes color and border of the node | function modifyNode(node) {
data[node].style.backgroundColor = `#fcf6f5ff`;
data[node].style.border = `2px solid #edc2d8ff`;
} | [
"set borderColor(value)\n\t{\n\t\tthis._nodeBorderColor = value;\n\t}",
"set nodeColor(value)\n\t{\n\t\tthis._nodeColor = value;\n\t}",
"function DebugNodeStyling() { }",
"function setNodeColor(){\n\t\tlinkstatenode = graph.LinkState()[\"nodes\"] ; \n\t\tfor(var i = 0, l = graph.LinkState()[\"nodes\"].length ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Animation loop on superhero | function loop0() {
$('.superhero').animate({
'right': 100+'%',
'top': 25+'%'
// Animation time in seconds
}, 30000, function() {
$(this).animate({
'right': 15+'%',
'top': '-'+width0
}, 0, 'linear', function() {
loop0();
}, 0);
});
} | [
"function animateHeroAtack(){\n let position = 100;\n const interval = 100;\n const diff = 425;//bias to enemy distance\n\n get(\"hero\").style.transform = \"translate(600px)\";// for smooth transition of atack\n intervalHeroAtack = setInterval(() => {\n get(\"hero\").style.backgroundPosition ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adjust a position to refer to the postchange position of the same text, or the end of the change if the change covers it. | function adjustForChange(pos, change) {
if (cmp(pos, change.from) < 0) { return pos }
if (cmp(pos, change.to) <= 0) { return changeEnd(change) }
var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;
if (pos.line == change.to.line) { ch += changeEnd(cha... | [
"function adjustForChange(pos,change){if(cmp(pos,change.from)<0)return pos;if(cmp(pos,change.to)<=0)return changeEnd(change);var line=pos.line+change.text.length-(change.to.line-change.from.line)-1,ch=pos.ch;if(pos.line==change.to.line)ch+=changeEnd(change).ch-change.to.ch;return Pos(line,ch);}",
"function adjust... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Further parsing the text to determine appropirate command | function parseCommand(text){
var words = text.split(" ");
for(var i=0; i < words.length; i++){
if (words[i] in commandList){
processCommand(words[i]);
break;
}
}
} | [
"function parseCommands(messagetext) {\n var args = messagetext.slice(prefix.length).trim().split(/ +/g);\n var command = \"\";\n if(args.length > 0) command = args.shift().toLowerCase();\n if(args.length > 0) command = command + \" \" + args.shift().toLowerCase();\n \n /*for (i = 0; i < initiative_list.lengt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the bidi ordering for the given line (and cache it). Returns false for lines that are fully lefttoright, and an array of BidiSpan objects otherwise. | function getOrder(line) {
var order = line.order;
if (order == null) order = line.order = bidiOrdering(line.text);
return order;
} | [
"function getOrder(line) {\n\t var order = line.order;\n\t if (order == null) order = line.order = bidiOrdering(line.text);\n\t return order;\n\t }",
"function getOrder(line) {\n var order = line.order;\n if (order == null) order = line.order = bidiOrdering(line.text);\n return order;\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ordinal and quantitative scales have different methods for setting the range. This function detects the scale type and sets the range accordingly. | function setRange(scale, scaleRange) {
if (isOrdinal(scale)) {
scale.rangePoints(scaleRange, 1);
} else {
scale.range(scaleRange);
}
} | [
"function applyScaleRange() {\n\n // x-axis goes from 0 (left) to max (right)\n // y-axis goes from max (top) to 0 (bottom)\n var rangeBounds = (self.isHorizontal()) ? [0, self.bounds[0]] : [self.bounds[1], 0];\n\n if (self.scale.rangeRoundBands) {\n\n // o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
outputs info to the log | info(...parameters)
{
console.log(this.preamble, generate_log_message(parameters))
} | [
"info() {\n var msg = util.format.apply(msg, arguments);\n this.log.info(this.namePrefix + msg);\n }",
"info(message) {\n addon.fileLog(message, 'info', this.path);\n }",
"function info() {\n\tlog(3, arguments);\n}",
"function showInfo() {Config.LogLevel = LogLevels.INFO;}",
"function logWi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets properties of any object in the DB. | function setObjectProperties(params, callback) {
var objId = params.objId;
var type = params.type;
var properties = params.properties;
if (!objId || !type || !properties || !properties.length) {
return callback("Please specify objId, type, and properties array as {path:string,value:any}");
}
... | [
"function updateProperties(db, eid, props) {\n for (let prop of Object.keys(props)) {\n db = updateProperty(db, eid, prop, props[prop]);\n }\n return db;\n}",
"setProperties(properties){\n this.properties = properties;\n }",
"function set(obj) {\n registerSetChange.call(this, obj);\n if (o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Database Setup and Server start | async function setupAndStart () {
if(await db.setup())
app.listen(3000, ::console.log('Server listening on port', 3000))
} | [
"async start () {\r\n await this.cherryServerManager.startServers()\r\n await this.ormManager.connectDatabase()\r\n }",
"function startDB() {\n\tmongoose\n\t\t.connect('mongodb://127.0.0.1/multiplemongos', { useNewUrlParser: true })\n\t\t.then(() => {\n\t\t\tconsole.log('Dev database connected succesfully!... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
extracts pixel data from canvas | function getImageData() {
imageData = cx.getImageData(0, 0, cx.canvas.width, cx.canvas.height);
pixelData = imageData.data;
console.log("Data = \n " + pixelData);
logPixelData();
} | [
"function getImgdata(canvas){\r\n\tvar context = canvas.getContext('2d');\r\n\treturn context.getImageData(0,0,canvas.width,canvas.height);\r\n}",
"function printpixeldata()\r\n{\r\n var imagedata;\r\n var canvas = document.createElement(\"canvas\");\r\n var ctx = canvas.getcontext(\"2d\");... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update currencyConversion rate: 1. get currencies 2. choose random currency from the list 3. choose random value based on the current value and change it ( by ratio of 0.15 to +0.15 ) 4. do all of this each 3 seconds | static async updateConversion(db) {
let values = Object.values(currencies);
let randomKey = values[Math.floor(Helpers.getRandomNumber(0,values.length))];
let randomValue = Helpers.generateRandomNumberByRange(0.85 ,1.15,false);
let conversion = await db.get(randomKey);
randomValue... | [
"async updateConversionRate () {\n let currentCurrency\n try {\n currentCurrency = this.getCurrentCurrency()\n const rate = await BITBOX.Price.current(currentCurrency.toLowerCase())\n this.setConversionRate(Number(rate))\n this.setConversionDate(Number(new Date()))\n } catch (err) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Marks a tab (specified by ID) as enabled, thereby allowing the user to select and interact with it. | enableTab (id) {
let tabData = this.tabs[id];
tabData.enabled = true;
tabData.DOMNode.classList.remove("disabled");
} | [
"function enable_in_tab(id)\n {\n browser.browserAction.setTitle({\n title: TITLE_WHEN_ENABLED,\n tabId: id\n });\n browser.browserAction.enable(id);\n }",
"static enable(tabId) {\n browser.browserAction.enable(tabId);\n }",
"enableTab() {\n this.set... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the right Left position for a given slide Important when resizing | function slideLeftPos( currSlide ) {
return currSlide * -slideWidth;
} | [
"function getLeft() {\n var $i = $index - 1;\n\n return hasSlide($i) ? getSlide($i) : getLast();\n }",
"function getRight() {\n var $i = $index + 1;\n\n return hasSlide($i) ? getSlide($i) : getFirst();\n }",
"function getActiveSliderBtnLeft() {\n retur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the background image padding property | set MainBackgroundImagePadding(value) {
this._backgroundImagePadding = value;
} | [
"getBackgroundImagePadding(){return this.__background.imagePadding}",
"setBackgroundImagePadding(valueNew){let t=e.ValueConverter.toObject(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"BackgroundImagePadding\"));let r=this.__objectResolvers.get(\"backgroundImagePadding\");r&&(r.watchDestroyer&&r.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$('.mainnav').show(); $('.solutions').hide(); $('.solutionscontent').hide(); //generic based on attribute..1024 to.1280 (responsive) | function mediaQuery(){
let screenWidth = $(document).width();
if(screenWidth<=768 ){
$('.resources').hide();
$('.networks').hide();
$('.main-nav').hide();
$('.solutions').show();
$('.solutions-content').hide();
}
else if(screenWidth<1280... | [
"function hideDivs(){\n $('#results').hide();\n $('#information').hide();\n $('#content').hide();\n $('#blog').hide();\n $('#oneBack').hide();\n $('#twoBack').hide();\n// if($(window).width() > 1100) {\n// $('#content').show();\n// }\n}",
"function setDisplay(mode){\n\tvar elem, i, jumbo, others;\n\tif (mode)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the opposite door (for when entering and exiting) | function oppositeDoor(door) {
const opposites = {
L: "R",
R: "L",
U: "D",
D: "U",
};
return opposites[door];
} | [
"findExitDirection(door) {\n let direction\n if (door.x >= (this.x + this.width)) {\n direction = 'EAST'\n } else if (door.x <= this.x) {\n direction = 'WEST'\n } else if (door.y <= this.y) {\n direction = 'NORTH'\n } else {\n direction = 'SOUTH'\n }\n return direction\n }"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Represents the action that occurs when the mouse's left button is released, which is setting the selected object as null, since it is no longer being picked, and enabling the rotation control | onMouseUp(event) {
//Enables rotation again
this.controls.enabled = true;
//Sets the selected slot to null (the slot stops being selected)
this.selected_slot = null;
//Sets the selected face to null (the face stops being selected)
this.selected_face = null;
//Sets the selected closet compone... | [
"releaseLeft() {\n this._leftPressed = false;\n this.direction = this._rightPressed ? 1 : 0;\n }",
"static mouseReleased() {\n UI.selected = null;\n }",
"static mouseReleased() {\n Drag.selected = null;\n }",
"function onDocumentMouseUp(event) {\n //Sets the selected sl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
IBI (Inter Beat Interval) corresponds to the value between to consecutive beats start | computeIBI () {
if (this.value > this.adaptativePulseThreshold) {
this.beat.record()
this.ibi = this.beat.ibi
} else this.beat.stop()
} | [
"get labelInterval() {\n return this.i.b0;\n }",
"get actualInterval() {\n return this.i.k8;\n }",
"function beat_start(i, j) {\n return beats[i * beats_per_bar + j][\"start\"];\n }",
"get labelInterval() {\n return this.i.bu;\n }",
"function Ibb(im) {\n\tconsole.lo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
make a relative filepath absolute, relative to CWD | function rel2abs(p) {
return path.resolve(process.cwd(), p);
} | [
"function makeAbsolute(maybeRelativePath) {\n if (_path2.default.isAbsolute(maybeRelativePath)) {\n return maybeRelativePath;\n } else {\n return _path2.default.posix.join(process.cwd(), maybeRelativePath);\n }\n}",
"function makeAbsolute(cwd, filepath) {\r\n return normalize(path.resolve(cwd, filepat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ensures that an index array for manipulating gd.data is valid. Intended for use with addTraces, deleteTraces, and moveTraces. | function assertIndexArray(gd, indices, arrayName) {
var i,
index;
for(i = 0; i < indices.length; i++) {
index = indices[i];
// validate that indices are indeed integers
if(index !== parseInt(index, 10)) {
throw new Error('all values in ' + arrayName + ' mus... | [
"function assertIndexArray(gd, indices, arrayName) {\n\t var i,\n\t index;\n\n\t for (i = 0; i < indices.length; i++) {\n\t index = indices[i];\n\n\t // validate that indices are indeed integers\n\t if (index !== parseInt(index, 10)) {\n\t throw new Error('all values in ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the time for a stop and a trip | function getStopInTripTime(stop_id, trip_id) {
return this.getTripStopTimes(stop_id).then(function getTimeForATrip(trips) {
return trips.filter(function (trip) {
return trip.trip_id == trip_id;
});
});
} | [
"function tripTime(departure, arrival) {\n var start = departure.split(\":\");\n start = new Date(2018, 0, 0, ...start);\n var end = arrival.split(\":\");\n end = new Date(2018, 0, 0, ...end);\n var diff = Math.abs(end - start);\n var hours = Math.floor(diff / (1000*60*60))\n diff = diff - hour... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Number of rows, covered by range | get rowsCount() {
return (this.endRow - this.startRow) + 1
} | [
"function rowsInRange(nA/*initial number*/, oSR /*shift range*/) {\n if (!oSR.count) { \n oSR.count = Math.max(0, (oSR.end.sno - oSR.start.sno) + 1); \n }\n return nA + oSR.count;\n }",
"function rows() {\n var lt = 0, rt = 0, lb = 0, rb = 0;\n \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Verificado el estado de cada cliente espino registrado | verificarEstado() {
espinoClients.forEach((host) => {
ping.sys.probe(host, (isAlive) => {
msg = isAlive ? 'host ' + host + ' esta conectado' : 'host ' + host + ' no esta conectado';
console.log(msg);
serverClient.publish('web/messages', msg);
... | [
"altaCliente(oCliente)\n {\n var res=false;\n \n if(this.buscarCliente(oCliente.dni)==null)\n {\n this._clientes.push(oCliente);\n res=true;\n this.actualizaComboCliente();\n }\n else if(this.buscarCliente(oCliente.dni).estado==false) //s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load Filesuserfiles page function | function loadFilesuserfilesOnline(){
var fb = new fileBrowser.Browser($("#fileSysDiv"), "online");
//fb1 = fb;
progressModalOpen("Loading file list, please wait");
$.post("/api/1/flash/getFileList")
.done(function(data) {
if (data.ok) {
fb.load(data.ok);
... | [
"function getFiles(all,thePage){\n document.getElementById('m'+thePage+'FileDiv').innerHTML = \"loading ...\"; \n CCT.index.getFiles(all,thePage,getFilesCallback); \n }",
"function showFiles() {\n\tif (!userExists) {\n\t\talert(\"No user name inserted (refr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Writes the workbook into a file | function writeBook() {
file.workbook.xlsx.writeFile(path)
.then(() => {
console.log(`[${dateNow()}] Added posts to excel file succesfully!!`);
})
.catch(console.error);
} | [
"function writeToExcelFile(){ \n if(!workbook){\n console.log(\"Workbook not defined, call createWorkbook() first\");\n return;\n }\n var fullPrintname = PRINT_FILENAME+\"_\"+PRINT_NAME+PRINT_ENDING;\n workbook.xlsx.writeFile(fullPrintname)\n .then(function() {\n console.log(\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ZACS_STYLESHEET_LITERAL(xxx) magic syntax that passes validation for use by babel plugins that transform dynamic expressions into static literals | function isZacsStylesheetLiteral(node) {
return (
t.isCallExpression(node) && t.isIdentifier(node.callee, { name: 'ZACS_STYLESHEET_LITERAL' })
)
} | [
"function isZacsStyleSheetLiteral(t, node) {\n return (\n t.isCallExpression(node) && t.isIdentifier(node.callee, { name: 'ZACS_STYLESHEET_LITERAL' })\n )\n}",
"Literal() {\n switch (this._lookahead.type) {\n case 'NUMBER':\n return this.NumericLiteral();\n case 'STRING':\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update beta test details for a specific build. | function modifyBuildBetaDetail(api, id, body) {
return api_1.PATCH(api, `/buildBetaDetails/${id}`, { body })
} | [
"function individuallyAssignBetaTesterToBuilds(api, id, body) {\n return api_1.POST(api, `/betaTesters/${id}/relationships/builds`, { body })\n}",
"function changeVersion(ptbuild) {\n\n if(ptbuild == \"preview\")\n archMap = version_map.nightly\n else\n archMap = version_map.release\n\n for (const [ar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Implement a f(x) that adds all values from an optional parameter (default: `100`) to another optional parameter (default: `4000000`); that are divisible by 3 or 5 but not both. | function optPara(startVal, endVal) {
var result = 0;
var startVal = 100;
var endVal = 4000000;
for (var count = startVal; count <= endVal; count++) {
if ((count % 3 == 0) || (count % 5 == 0)) {
if ((count % 3 == 0) && (count % 5 == 0)) {
continue;
}
... | [
"function funcFour(num1, num2, num3) {\n let addedNumbers = num1 + num2;\n return addedNumbers % num3;\n}",
"function hard (num1,num2,num3,num4) {\n let result = num1 * num2\n if(result > 100){\n result = result + num3 + num4\n } else if ( result < 100) {\n result = result - num3 - num4\n } else if (r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to add new artist to songData | function addNewArtist() {
var $artist = $("#newArtist");
var $song = $("#newSong");
var $album = $("#newAlbum");
var newObj = { "Song": $song.val(), "Artist": $artist.val(), "Album": $album.val()};
musicProgram.songData.unshift(newObj);
musicProgram.songPrint(musicProgram.songData);
addDeleteButtons();
} | [
"addArtist(artistData) {\n /* Crea un artista y lo agrega a unqfy.\n El objeto artista creado debe soportar (al menos):\n - una propiedad name (string)\n - una propiedad country (string)\n */\n const newArtist = new Artist(this.idGenerator.generateId(),artistData.name, artistData.country);\n this.che... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is the general responsehandler for the JSON response from the Brightcove server for playlist based players. The arguments to the method include the response object, as well as the playerID of the object which this response pertains to. | function handlePlaylistResponse(JSONResponse, playerID, videoTagID, strObjID) {
//obtain first playlist in Brightcove Player given corresponding to this playerID
var firstPlaylist = JSONResponse.items[0];
//obtain the first video from our first playlist
var firstVideo = firstPlaylist.videos[0];
embedHTML5Player... | [
"function handleVideoResponse(JSONResponse, playerID, videoTagID, strObjID) {\n embedHTML5PlayerForVideo(JSONResponse, playerID, videoTagID, strObjID);\n}",
"function handleGetRequestForPlayers(playerDataResponse) {\n var body = '';\n playerDataResponse.on('data', function(d) {\n body += d;\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Use i18n for translate site when window onload | _loadWithCurrentLang() {
i18n.changeLang(this.DOM.body, this.lang, this.DOM.domForTranslate, true);
} | [
"initi18n() {\n this.$i18n.locale = document.documentElement.lang;\n this.loadTranslations();\n }",
"function translateMainPage()\n{\n navigator.globalization.getLocaleName(\n function(locale)\n {\n var translation = Translation[locale.value.substring(0, 2)];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[GGTRCC_RenderBowlingSummary] Render summay of the bowling for the player | function GGTRCC_RenderBowlingSummary (aPLSO, aBowlingGraphInfo)
{
var lRet="";
lRet += "<span class='GadgetStatsHeading'>Career Bowling Summary</span>";
if (0 == aBowlingGraphInfo.length)
{
lRet += "<br>There is no Bowling record for this player<br><br>";
}
else
{
//
// Do we have enough en... | [
"function GGTRCC_RenderBowlingTotals (aPLBO)\r\n{\r\n\tvar lRet=\"\";\r\n\t\r\n\tlRet += \"<table width='100%' cellSpacing='0' cellPadding='0' border='0'>\";\r\n\tlRet += \"<thead>\";\r\n\tlRet += \"<tr class=\\\"GadgetBatsHeader\\\">\";\r\n\tlRet += \"<th> </th>\";\r\n\tlRet += \"<th align='... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a function for workspacesWorkspaceProjectsProjectKeyGet | workspacesWorkspaceProjectsProjectKeyGet(incomingOptions, cb) {
const Bitbucket = require('./dist');
let defaultClient = Bitbucket.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = incomingOptions.apiKey;
// U... | [
"function getProjectKeyValue() {\n return \"projectId=\" + getProjectID();\n}",
"function projectKey(req) {\n\tif(req && req.data && req.data._id) {\n\t\treturn ['projects', req.data._id];\n\t} else {\n\t\treturn 'projects';\n\t}\n}",
"workspacesWorkspaceProjectsProjectKeyGet(incomingOptions, cb) {\n cons... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
save competition fees discount | function regSaveCompetitionFeeDiscountAction(payload, competitionId, affiliateOrgId) {
return {
type: ApiConstants.API_POST_COMPETITION_FEE_DISCOUNT_LOAD,
payload,
competitionId,
affiliateOrgId,
};
} | [
"onAddDiscount() {\n const newDiscount = this.repository.create(this.context);\n newDiscount.promotionId = this.promotion.id;\n newDiscount.scope = DiscountScopes.CART;\n newDiscount.type = DiscountTypes.PERCENTAGE;\n newDiscount.value = 0.01;\n newD... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: DAFTAR MENU DOSEN 1. menampilkan menu Dosen | function menuDosen() {
console.log(`
===========================================================
Silahkan pilih opsi di bawah ini
[1] daftar Dosen
[2] cari Dosen
[3] tambah Dosen
[4] hapus Dosen
[5] kembali
===========================================================
`);
rl.question('masukan salah satu no. dari ops... | [
"function salirMenu() {\n if (confirm(\"¿Esta seguro de que quiere salir al menu?\")) {\n for (var mini in Game.global.control) {\n mini.haGanado = false\n }\n this.music.stop();\n Game.state.start('Menu');\n }\n }",
"function salirMenu()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create catalog table row Args: dso: Dso object date: A Date() to use on ALT/AZ calculations location: latitude and longitude to use on ALT/AZ calculations added: Whether the object is already on the watchlist, in that case the add button is disabled plot_canvas: canvas of visibilty plot add_callback(dso): Called when u... | function catalog_create_row(
dso,
date,
location,
added,
plot_canvas,
add_callback,
goto_callback,
plot_callback
) {
let tr = $("<tr>");
for (let col of catalog_columns) {
switch (col.name) {
case "id":
tr.append(create_id_cell(dso.id));
... | [
"function watchlist_create_row(\n watch_dso,\n date,\n location,\n plot_canvas,\n delete_callback,\n save_callback,\n goto_callback,\n plot_callback,\n style_change_callback,\n notes_change_callback\n) {\n let tr = $(\"<tr>\");\n for (let col of watchlist_columns) {\n swi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
milliseconds between each update increase the timer by SAMPLE_RATE milliseconds (the timer is needed to calculate the voltage of the capacitor) | function incrementTimer() {
globalTimer += SAMPLE_RATE / 1000;
graphs.update(); //measure voltages and add them to graph
} | [
"function onSamplesPerSecond(samples_per_second) {\n // no zero or negative\n if (samples_per_second < Number.MIN_VALUE) {\n m_samples_per_second = 600;\n }\n else {\n // rate is in samples/second\n m_samples_per_second = samples_per_second;\n }\n onPaint(null);0.\n }",
"function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
console.log(hippo(1)) // => [1, 0] console.log(hippo(9)) // => [1, 2] console.log(hippo(19)) // => [2, 1] UNCLEANED CODE 4 total players = index of array each player eats a certain amount of pellets need to count rounds | function hippoUncleaned(numPellets){
console.log("# of starting pellets:", numPellets, "\n")
// create arrays to show player and # of pellets they eat
let hippoEats = [3, 4, 6, 1] // array index can be the player
// create variables to store current round
let round = 0
// create array to hold winning playe... | [
"function nOP(){\n var ans=0;\n for(let player of game.players){\n ans++;\n }\n return ans;\n }",
"function underPokemonLeague(numOfPokemon){\n for(let i = 0; i < numOfPokemon; i++){\n console.log('Pikachu, I choose you!')\n }\n}",
"function points(games) {\n let total = 0\n gam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
121 Write a function exp that evaluates simple array expressions. | function exp(value) { // takes first array and takes next 2 as arguments
return (Array.isArray(value)) ? value[0](value[1], value[2]) : value;
} | [
"function ArrayExpression() {\n}",
"function ArrayLiteralExpression() {\n}",
"function ast_ArrayExpression(arrNode, retArr, funcParam) {\n\t\t// console.log(arrNode);\n\t\tvar arrLen = arrNode.elements.length;\n\n\t\tretArr.push(\"float[\"+arrLen+\"](\");\n\t\tfor(var i=0; i<arrLen; ++i) {\n\t\t\tif(i > 0) {\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called on load of the page and fills up the table with the latest values | function fillUpTable() {
getInstantValues();
} | [
"function fillTableOnPage(initialData) {\n document.getElementById('main-table-body').innerHTML = buildTable(initialData);\n}",
"function populatePage(){\n clearRecordTables();\n forEachMember(tables, function(table, tip){\n serverData[tip].forEach(displayRecord, tip); //'tip' will be accessible as ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets needToConferm to false when the session has timed out. | function SessionTimeOut()
{
needToConfirm = false;
} | [
"function setClientRequestNoDelay(conf) {\n globalNoDelayFlag = !!conf.socket_no_delay;\n}",
"function resetSessionTimeout() {\n\n\t\tclearTimeout(userSessionTimeout);\n\t\tstartSessionTimeout();\n\n\t}",
"function sessionPeriodicTimeoutCheck(timedoutCallbackFn)\n{\n sessionCheck(timedoutCallbackFn, false... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prints a polynomial in human readable form | function printPolynomial(polynomial) {
let output = '';
for (let i = 0; i < polynomial.length; i++) {
output += polynomial[i] + 'x^' + i;
if (i !== polynomial.length - 1) output += ' + ';
}
console.log('Random Polynomial: ' + output);
} | [
"printPoly() {\n var format = \"\";\n var expon = this.arr.length - 1;\n for (var i =0; i< this.arr.length; i++) {\n if( expon === 0) {\n format += this.arr[i];\n }\n else {\n format += this.arr[i] + \"x^\" + expon + \" + \"; \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if the string is a UUID (version 3, 4 or 5). If given value is not a string, then it returns false. | function isUUID(value, version) {
return typeof value === 'string' && validator_lib_isUUID__WEBPACK_IMPORTED_MODULE_1___default()(value, version);
} | [
"function isUUID (str, version) {\n\tif (!isString(str))\n\t\treturn false;\n\n\tvar uuidPattern = uuid[version ? version : 'all'];\n \n return (uuidPattern && uuidPattern.test(str));\n}",
"function isUUID(value, version) {\n return typeof value === \"string\" && validator.isUUID(value, version);\n}"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When the components mount, load the employee table | componentDidMount() {
this.loadEmployee();
} | [
"function loadEmployees() {\n API.fetchEmployees()\n .then((res) => {\n return setEmployee({\n employees: res.data.results,\n });\n })\n .catch((err) => console.log(err));\n }",
"function loadEmployeeList() {\n\tlet xhr = new XMLHttpRequest();\n\txhr.onreadystatechange = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sort twits by text AZ if switchPosition = "normal" ZA if switchPosition = "reversed". | sortTwitsByText( ) {
this.twits.sort( (a, b) => {
if (this.switchPosition == "normal");
if (a.text > b.text) {
return 1;
}
if (a.text < b.text) {
return -1;
}
if (this.switchPosition == "reversed"){
... | [
"sortTwitsByAuthor( ) {\n this.twits.sort( (a, b) => {\n \n if (this.switchPosition == \"normal\");\n if (a.user.name > b.user.name) {\n return 1;\n }\n if (a.user.name < b.user.name) {\n return -1;\n }\n if (this.swi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that returns true if a filter has been applied for a specific feature and false if not // TODO: there might be minor bugs here regarding default filters | isFilterApplied(feature) {
const tmp = this.filters.filter((elem) => {
return elem.name === feature;
});
// Nothing found by the name
if (tmp.length === 0) return false;
const thisFilter = tmp[0];
// Return true if the filter is NOT applied
return !this.isDefaultFilter(thisFilter);
... | [
"function checkFilter(fn)\n\t{\n\t\tvar name = fn.name;\n\t\tif (!g.includePrototype && name.indexOf('.prototype.') != -1) return false;\n\t\tif (name.indexOf('anonymous') != -1) \n\t\t{\n\t\t\tif (!g.includeAnonymous) return false;\n\t\t}\n\t\telse if (!g.extractNested && fn.level > 0) return false;\n\t\t\n\t\tif ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes a new instance of the ScenePlayr class. | function ScenePlayr(settings) {
if (settings === void 0) { settings = {}; }
this.cutscenes = settings.cutscenes || {};
this.cutsceneArguments = settings.cutsceneArguments || [];
} | [
"constructor() {\n this._curScene = new _EmptyScene();\n }",
"constructor() {\r\n // \"playGame\" is the identifier for this scene\r\n super (\"play_game\");\r\n }",
"initializeScene(){}",
"_createScene() {\n this._scene = new BABYLON.Scene(this._engine);\n Object.assign(thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A Container represents a collection of display objects. It is the base class of all display objects that act as a container for other objects. ```js var container = new PIXI.Container(); container.addChild(sprite); ``` | function Container()
{
DisplayObject.call(this);
/**
* The array of children of this container.
*
* @member {PIXI.DisplayObject[]}
* @readonly
*/
this.children = [];
} | [
"function Container()\n\t{\n\t DisplayObject.call(this);\n\t\n\t /**\n\t * The array of children of this container.\n\t *\n\t * @member {PIXI.DisplayObject[]}\n\t * @readonly\n\t */\n\t this.children = [];\n\t}",
"function initContainer () {\n container = new PIXI.Container()\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to get previous day timestamp | function getPreviousDayTimeStamp() {
var prevDay = moment().utc().add(-1, 'days');
var prevDayTimestamp = moment(prevDay).utc().startOf('day');
return Number(prevDayTimestamp);
} | [
"function previousDay(day) {\n return toStr(new Date(toDate(day).getTime() - 24 * 60 * 60000));\n}",
"static previousDay(day) {\n var nn = TimeUtil.isoTimeToArray(day);\n nn[2] = nn[2] - 1;\n TimeUtil.normalizeTime(nn);\n return sprintf(\"%04d-%02d-%02dZ\",nn[0], nn[1], nn[2]);\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ENDE berechnenGesamtEinnahmen Funktion anzeigenKontostand nimmt alle als Kontostand deglarierten Daten entgegen | function anzeigenKontostand(gefilterterKontostand){
console.log("anzeigenKontostand()");
console.log("KONTOSTAND");
console.log("Anzahl: " + gefilterterKontostand.length);
console.log(gefilterterKontostand);
//es soll nur der zuletzt angegebene Kontostand beruecksichtigt werden
var laengeKonto... | [
"function controlaDerrota(){\r\n\t\t\t\t\t\t\tif(escudosDestruidos==true||oxigenoAgotado==true){\r\n\t\t\t\t\t\t\t\tDerrota=true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}",
"function bepaalAdres() {\n for (var i = 0; i < vm.bedrijf.adreskoppelingen.length; i++) {\n if (vm.bedrijf.adreskoppeli... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lanjutkan code untuk menjalankan function readBooksPromise | function buku(){
readBooksPromise(10000,books[0])
.then(readBooksPromise(setTimeout, books[1]))
.then(readBooksPromise(setTimeout, books[2]))
} | [
"function readBooks() {\n readBooksPromise(10000, books[0]).then(function (sisaWaktu) {\n console.log(sisaWaktu)\n if (sisaWaktu > 0)\n readBooksPromise(sisaWaktu, books[1]).then(function (sisaWaktu) {\n console.log(sisaWaktu)\n if (sisaWaktu > 0) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate content an kernel message on the iopub channel. | function validateIOPubContent(msg) {
if (msg.channel === 'iopub') {
var fields = IOPUB_CONTENT_FIELDS[msg.header.msg_type];
// Check for unknown message type.
if (fields === void 0) {
return;
}
var names = Object.keys(fields);
var content = msg.content;
... | [
"function validateIOPubKernelMessageContent(msg) {\n if (msg.channel === 'iopub') {\n var fields = IOPUB_CONTENT_FIELDS[msg.header.msg_type];\n if (fields === void 0) {\n throw Error(\"Invalid Kernel message: iopub message type \" + msg.header.msg_type + \" not recognized\");\n }\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function performs search related functionality when worklist search is fired | function fnPerformWorklistSearch(oEvent) {
fnFetchAndSaveWorklistSearchField();
fnCheckSearchOnTableAction();
oState.oSmartTable.data("searchString", oEvent.getSource().getValue());
fnWorklistRebindTableOnSearch(oEvent);
} | [
"handleSearchOperation() {\n this.dispatchEvent(new CustomEvent('accountsearch', { detail: this.value }));\n fireEvent(this.pageRef, 'refreshldsdetail', '');\n }",
"function fnFetchAndSaveWorklistSearchField() {\n\t\t\tvar oSmartTable = oState.oSmartTable;\n\t\t\tvar aTableToolbarContent = oSmart... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Apply function to all slots in frame. | apply(func) {
let slots = this.slots;
if (slots) {
for (let n = 0; n < slots.length; n += 2) {
let ret = func(slots[n], slots[n + 1]);
if (ret) {
slots[n] = ret[0];
slots[n + 1] = ret[1];
}
}
}
} | [
"function operarSlots(slots, funcion) {\r\n\tfor(var i = 0; i < slots.length; i++){\r\n\t\tfuncion(slots, i);\r\n\t}\r\n}",
"invokeAll(slotName, ...args) {\n for (let slots of widgetSlots.values()) {\n for (let slot of slots) {\n if (slot.slotName === slotName) {\n slot.fn.apply(un... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets property value by path. | function setPropertyByPath(obj, path, value, throwErr) {
if (throwErr === void 0) { throwErr = true; }
var objPath = getObjectPath(path);
var obj = getPropertyByPath(obj, objPath, throwErr);
var propName = getPropertyName(path);
// TODO: Allow adding propertie... | [
"function setValueByPropPath(propPath,obj,val) {\n\t\tvar props = propPath.split('.');\n\t\tprops.forEach(function(prop, idx) {\n\t\t\tif (!obj) return\n\t\t\tif (idx==props.length-1) {\n\t\t\t\tobj[prop] = val;\n\t\t\t} else {\n\t\t\t\tobj = obj[prop];\n\t\t\t}\n\t\t});\n\t}",
"function setPropFromPath(obj, path... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wait until the new version is deployed, printing any events happening during the wait... | function waitForDeployment(application, environmentName, versionLabel, start, waitForRecoverySeconds) {
let counter = 0;
let degraded = false;
let healThreshold;
let deploymentFailed = false;
const SECOND = 1000;
const MINUTE = 60 * SECOND;
let waitPeriod = 10 * SECOND; //Start at ten seco... | [
"function waitForFinRuntime(readyCallback) {\r\n var callback = function(ready) {\r\n if (ready === true) {\r\n readyCallback();\r\n } else {\r\n client.sleep(1000, function() {\r\n waitForFinRuntime(readyCallback);\r\n });... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create `db.js` file in config folder | createDbFile() {
// check if `db.js` file exists already in config folder
if (!fs.existsSync(`${this.config}/db.js`)) {
const file = path.join(__dirname, '../files/db.js');
fs.readFile(file, "utf-8", (err, data) => {
if (err) {
console.log(err);
return;
}
... | [
"createDatabase(name) {\n let root = path_1.default.dirname(this.env.extensionRoot);\n let filepath = path_1.default.join(root, name + '.json');\n return new db_1.default(filepath);\n }",
"function createDb() {\n console.log(\"createDb chain\");\n db = new sqlite3.Dat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
endregion Game_Event endregion Game objects region Sprite objects region Sprite_Icon A sprite that displays a single icon. | function Sprite_Icon() { this.initialize(...arguments); } | [
"function icon(){}",
"function GenIcon() {\n}",
"function returnIcon(icon) {\n\n} // close returnIcon function",
"get icon(){ return this.__image ? this.__image.render.texture : ''; }",
"function createSprite() {\n return src(iconSRC)\n .pipe(svgSprite(config))\n .pipe(dest(iconURL));\n}",
"functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check a single word item conforms to the required schema | _itemConformsToSchema(item, schema) {
for(let prop in schema) {
if (!item.hasOwnProperty(prop)) {
return false;
}
if(typeof schema[prop] === 'object') {
return this._itemConformsToSchema(item[prop], schema[prop]);
} else {
if (typeof item[prop] !== schema[prop]) {
... | [
"function isSchemaItem(item) {\n if (item.search(g_schemaPrefix) == 0) {\n return true;\n }\n else {\n return false;\n }\n}",
"validateAnItem(item) {\n let errors = [];\n if (_.find(this.state.items, {sequenceName: item.sequenceName})) {\n errors.push(\"There's a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the content of the first in a cell from the clicked column of the supplied row. If there's no , returns the raw text of the cell. | function getFirstTextFromCell(tableRow, clickedColumnIndex) {
var $cell = $(tableRow).find('td').eq(clickedColumnIndex);
var $p = $cell.find('p');
return $p.length ? $p.text() : $cell.text();
} | [
"function getCellValue(row, index){ return $(row).children('td').eq(index).text() }",
"function getCellValue(e){\r\n var clickedCell= $(e.target).closest(\"td\");\r\n return(clickedCell.text());\r\n}",
"function clickedCell(cellID) {\n return document.getElementById(cellID).innerText;\n }",
"f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
In AICC the result can be the following strings: correct, wrong, unanticipated, neutral In SCORM the possible values can be: correct, incorrect, unanticipated, neutral Map these to the corresponding constants in the RUSTICI SCORM driver "incorrect" in SCORM is mapped to the contant INTERACTION_RESULT_WRONG | function ConvertToInteractionResultConstant(token_str) {
var c = token_str.toLowerCase();
var interactionResult;
switch (c) {
case "correct":
interactionResult = INTERACTION_RESULT_CORRECT;
break;
case "wrong":
interactionResult = INTERACTION_RESULT_WRONG;
break;
... | [
"function ConvertToInteractionResultConstant(token_str)\n{\n\t\t\n\t\n\tvar c = token_str.toLowerCase();\n\tvar interactionResult;\n\tswitch(c)\n\t{\n\t\tcase \"correct\": \n\t\t\tinteractionResult = INTERACTION_RESULT_CORRECT;\n\t\t\tbreak;\n\t\t\t\n\t\tcase \"wrong\": \n\t\t\tinteractionResult = INTERACTION_RESUL... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Internal function that reads the translation parts and generates a set of instructions for each template. See `i18nMapping()` for more details. | function generateMappingInstructions(tmplIndex, partIndex, translationParts, instructions, elements, expressions, templateRoots, lastChildIndex) {
var tmplInstructions = [];
var phVisited = [];
var openedTagCount = 0;
var maxIndex = 0;
var currentElements = elements && elements[tmplIndex] ? elements... | [
"function i18nExpMapping(translation, placeholders) {\n var staticText = translation.split(i18nTagRegex);\n // odd indexes are placeholders\n for (var i = 1; i < staticText.length; i += 2) {\n staticText[i] = placeholders[staticText[i]];\n }\n return staticText;\n}",
"function i18nApply(star... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate the base 10 exponent from the base 1e7 exponent. | function getBase10Exponent(digits, e) {
var w = digits[0];
// Add the number of digits of the first word of the digits array.
for ( e *= LOG_BASE; w >= 10; w /= 10) e++;
return e;
} | [
"function exponent(expo, base){\n var result = base;\n while (expo > 1) {\n result = result * base;\n expo--;\n }\n return result;\n }",
"function exponent(base, expo) {\n var result = 1;\n while (expo > 0) {\n result *= base;\n expo--;\n }\n return result;\n}",
"function expone... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return true if the index of a winery in the result list is already in the itinerary | function inItinerary(index){
for(var i=0;i<itinerary.length;i++){
if(itinerary[i]==index){
return true;
}
}
return false;
} | [
"tileIsOccupied(workerList, posn) {\n return workerList.some(function (iw) {\n return iw.x === posn.x && iw.y === posn.y;\n });\n }",
"function haveTheyWon(arr) {\n for (var j in winningPositions) {\n var check = arr.indexOf(winningPositions[j][0]) != '-1' &&\n arr.indexOf(winningPosi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Functions for each Custom Font | function customFont1() {
ExtensionUtils.addEmbeddedStyleSheet(".CodeMirror{text-rendering: optimizeLegibility;font-family: 'SourceCodePro-Medium' ,MS ゴシック !important;}");
} | [
"get font() {}",
"function IncrementalFont() {\n}",
"function FontViewer() {}",
"function on_font_changed() {}",
"function SimpleFontRenderer() {}",
"get fontNames() {}",
"registerFonts() {\n registerFont(this.options.textOptions.font.path, {\n family: this.options.textOptions.font.family\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setActiveState Sets the main navigation active state | setActiveState(){
let self = this;
// Remove .active class
[...document.querySelectorAll('.control-nav a')].forEach(el => el.classList.remove('active'));
// Set active item, if not search
if(!this.is_search){
let active = document.querySelector(`.control-nav li a.${this.orderby}`);
active... | [
"function setNavActive(){\n props.updateSection('nav')\n setNavState(true)\n }",
"setActiveState(active) {\n // If (cast) active value has changed:\n if (!!this._isActive !== active) {\n // Update to the new value.\n this._isActive = active;\n // Fir... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if we should create an issue with that text message.If it returns true, we send the appropriate message. | async function createIssue(context) {
// check if text is not empty and not on the blacklist
const cleanString = await formatString(context.state.whatWasTyped);
if (cleanString && cleanString.length > 0 && !blacklist.includes(cleanString)) {
const issueResponse = await chatbotAPI.postIssue(context.state.politician... | [
"async function createIssue(context) {\n\t// check if text is not empty and not on the blacklist\n\tconst cleanString = await formatString(context.state.whatWasTyped);\n\tif (cleanString && cleanString.length > 0 && !blacklist.includes(cleanString)) {\n\t\tconst issueResponse = await chatbotAPI.postIssue(context.st... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generateChain builds a chain of words in the desired direction, and returns them as an array (the caller may want to reverse it if the direction is backwards), The chain is terminated if the ngrams dictate the end of a sentence, or when max_len words are generated. | function generateChain (ngrams, word, direction, max_len) {
var chain = []
var nextWord = word
var nextEntry = ngrams[word]
var counter = 0
while (nextWord != '.' && counter < max_len) {
counter ++
chain.push(nextWord)
if (emptyObj(nextEntry[direction]))
nextEntr... | [
"function generate(chain){\n\tlet words = [\"<START>\",\"<START>\"];\n\tlet next_word = get_next_word(chain, words);\n\twhile(typeof(next_word)===\"string\"){\n\t\twords.push(next_word);\n\t\tnext_word = get_next_word(chain, words);\n\t}\n\t// Remove the two start tokens.\n\twords.shift();\n\twords.shift();\n\tif(w... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if command is a channel owner only command first | function checkChannelOwnerCommands ( tags, command ) {
if ( tags.username === channelName && ( [pauseVideos,resumeVideos,pauseSounds,resumeSounds].includes(command) ) ) {
if ( pauseVideos === command ) {
videoQ.stop();
}
if ( resumeVideos === command ) {
videoQ.start();
}
if ( pauseSounds === comma... | [
"function isByBotAdmin(message) {\n\t\t// Check if it's the owner's ID.\n\t\treturn message.author.id === config.owner_id ? true : false;\n\t}",
"function isByBotAdmin(message) {\n\t// Check if it's the owner's ID.\n\treturn message.author.id === config.owner_id ? true : false;\n}",
"isOwner() {\n if (Meteor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find raw special characters and report as errors. | findRawChars(node, text, location, regexp) {
let match;
do {
match = regexp.exec(text);
if (match) {
const char = match[0];
/* In relaxed mode & only needs to be encoded if it is ambiguous,
* however this rule will only match eithe... | [
"checkSpecialCharacter() {\n this.report.checkSpecialCharacter = /[#?!@$%^&*-]/.test(this.input);\n }",
"checkExceptSpecialCharacter() {\n const exceptRule =\n '[' + _.join(this.setting.except.specialCharacter, '') + ']';\n this.report.noExceptSpecialCharacter =\n !(new RegExp(exceptRule).test... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get API Entries and return html table as result | function getAPIEntries(route, searchText) {
if (searchText.length == 0) {
document.getElementById("count").innerHTML = ""
document.getElementById("results").innerHTML = ""
} else {
app.get('/'+ route +'?id='+ searchText+'&like=true',undefined, function(s,r) {
if (s == 404) {
document.getEl... | [
"function getEntries() {\n fetch('http://localhost:3000/api/v1/journal_entries')\n .then(response => response.json())\n .then(entries => {\n entries.data.forEach(entry => {\n let newEntry = new JournalEntry(entry, entry.attributes);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Goes over active connections and checks whether they alive. If not removes them. | cleanZombies(){
let zombies = new CuteSet();
for(let conn of this.connections){
if (!this.connectionManager.isAlive(conn)){
zombies.add(conn);
}
}
if (zombies.length > 0){
Logger.debug(`Found zombie connecions: ${JSON.stringify(zombies.... | [
"function checkAliveConnections() {\n\tdeleteDisconnected();\n\tping();\n}",
"function cleanupConnections(connections) {\n ArrayExt.removeAllWhere(connections, isDeadConnection);\n }",
"emptyFreeConnections() {\n if (!this._client) {\n return;\n }\n if (is_mysql2) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the select options for the current checkout property name | function getCustomCheckoutPropDropdown(settingKeyName)
{
var MainArray;
$.each(viewModel.product().Product.CheckoutPropertyList(), function (i, mainElement)
{
if (mainElement.Name() == settingKeyName)
{
MainArray = mainElement.Values();
//since using jquery loop we ... | [
"function getSelectList() {\n return selectList;\n}",
"function selectOptions() {\n\n let options = [];\n\n if (props.smallSearch) {\n availiableTokens.forEach((token, i) => {\n let symbol = token['symbol'];\n let address = token['address'];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
replaces text userGuess from HTML to "your guess so far: key pressed" | function userText() {
document.querySelector("#userGuess").innerHTML = "Your Guesses So Far: " + letterPressed;
} | [
"function correctGuess(userGuess) {\n hiddenLetters = '';\n if (hidden.toString() !== secretWordLetters.toString()) {\n for (\n var i = 0;\n i < getGuessedLetterPositions(secretWordLetters, userGuess).length;\n i++\n ) {\n hidden[\n getGuessedLetterPositions(secretWordLetters, use... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |