query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
suggestion() function to create a full sentence by picking entries from a number of arrays, speak the entry, and enter it as text in the textbox | function suggestion() {
let randomAdjective = findRandomEntry(adjectives);
let randomAgent = findRandomEntry(agents);
let randomVerb = findRandomEntry(verbs);
let randomPreposition = findRandomEntry(prepositions);
let randomEnding = findRandomEntry(endings);
currentSuggestion = (randomAdjective + " " + rand... | [
"function Suggestion(){\n this.mainTextParts = [];\n this.secondaryText = \"\";\n}",
"function authorSetup(){\r\n\t sentenceString=prompt(\"Input a sentence for a Madlib.\");\r\n\t sentence=sentenceString.split(\" \");\r\n\t toReplace=prompt(\"Number of words to replace?\");\r\n\t for(i=0; i<toRepla... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create New Conversation (1) Get conversation queries by calling createConversationQueries function. (2) Create new conversation object to send to server. (3) Make request to server: (Success) push new conversation onto local conversation array (vm.conversations). (Failure) log out error message. | function createConversation(sender, recipients, message){
var conversationQueries = createConversationQueries(sender, recipients);
var conversationObj = {
"sender": sender._id,
"conversationQueries": conversationQueries,
"message": {
"name": sender.na... | [
"function newConversation() {\n setVars = true;\n\n var originPage = getFirstUrlParameter();\n var params = {\n dialog_id: dialogId,\n client_id: clientId,\n personalDetails: personalDetails,\n originPage: originPage\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the breeze predicate of the predicate. This is an internal interface. | function getBreezePredicate() {
} | [
"getRelatedPredicate(quad) {\n return quad.predicate.value;\n }",
"findPredicate(predicate) {\n return this.cache.find(r => predicate(r));\n }",
"function Predicate(t) { return Fn (t) (Boolean_); }",
"getProperty(predicate) {\n if (predicate in this._assertions)\n return this._assertions... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the device id from cookies. If none exists, then we generate and store one. | function getDeviceId() {
var uniqueId = cookie.get(COOKIE_DEVICE_ID_KEY);
if (uniqueId) {
return uniqueId;
}
uniqueId = generateID();
cookie.set(COOKIE_DEVICE_ID_KEY, uniqueId, {
expires: 10*365, // 10 years
domain: '.' + window.location.host.split('.').slice(-2).join('.')... | [
"function getDeviceId() {\n var cookieKey = \"scandit-device-id\";\n var storedDeviceId = getCookieValue(cookieKey);\n if (storedDeviceId !== \"\") {\n return storedDeviceId;\n }\n var hexCharacters = \"0123456789abcdef\";\n var randomDeviceId = \"\";\n fo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Executes a MySQL query to fetch all comments by a specified post, based on on the post's ID. Returns a Promise that resolves to an array containing the requested posts. This array could be empty if the specified post does not have any posts. This function does not verify that the specified post ID corresponds to a vali... | async function getCommentsByPostId(id) {
const [ results ] = await mysqlPool.query(
'SELECT * FROM comments WHERE postId = ?',
[ id ]
);
return results;
} | [
"getAllCommentsByPostId(postId) {\n return fetch(`${POST_API_URL}/${postId}/comment/`, {\n headers: {\n 'Content-Type': 'application/json'\n },\n method: 'GET'\n });\n }",
"function findCommentsByPostId(postId) {\n\t\tvar deferred = q.defer();\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CheckConstraint: Used to check constraints to see if a corner is acceptable | function CheckConstraint (iRuleNum, iConstraintCornerList, iCurrCornerNum, iPrevCornerList)
{
// The return value (or retValue) is true for the selected point is valid according to
// the selected constraint; or false for the selected point is not valid since it
// violates some type of constraint
var r... | [
"function checkConstraints() {\n return specifCheck.checkConstraints(specif)\n }",
"function checkForConstraints() {\n if (constraint && constraint < totalTime) {\n return false;\n }\n\n return true;\n}",
"function check_compound_constraint(constraint_id){\n\n var rev... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
reduceFunctions(fa: ((p: Pixel) => Pixel)[] ): ((x: Pixel) => Pixel) | function reduceFunctions(f){
function helper(p, func) {
return func(p);
}
return p => f.reduce(helper, p);
} | [
"function reduce (array, func, initialValue) {\n}",
"function myReduceFunc() {\n \n\n\n}",
"function reduce(arr, a, fn) {\n if(fn===multiplicacion){\n var sum=1 \n for(var i=0; i<arr.length;i++){ \n sum= sum*arr[i]; \n }\n return fn(a,sum)\n }\n var sum = 0;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gamepad Functions go here! Turn on controller support | function controllerOn() {
if (gamePadActive == 0) {
$('#cont-area').removeClass('d-none');
resetInfo();
joypad.set({ axisMovementThreshold: 0.2 });
joypad.on('connect', e => updateInfo(e));
joypad.on('disconnect', e => resetInfo(e));
joypad.on('axis_move', e => {
console.log(e.detail);
return moveAxi... | [
"registerGamepad() {\r\n this.input.gamepad.pad1.on('down', (pad) => {\r\n if (pad === 3) {\r\n this.toggleInfoBox();\r\n }\r\n });\r\n }",
"function initGamepad() {\r\n\t\tgame.keypad = {\r\n\t\t\t_pressed: {}\r\n\t\t}\r\n\t\twindow.addEventListener(\"gamepad... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fast Fourier Transform 1DFFT/IFFT, 2DFFT/IFFT (radix2) | function FFT$1(){var _n=0,// order
_bitrev=null,// bit reversal table
_cstb=null;// sin/cos table
var _tre,_tim;this.init=function(n){if(n!==0&&(n&n-1)===0){_n=n;_setVariables();_makeBitReversal();_makeCosSinTable();}else{throw new Error('init: radix-2 required');}};// 1D-FFT
this.fft1d=function(re,im){fft(re,im,1);};/... | [
"function FFT$1() {\n\n\tvar _n = 0, // order\n\t\t_bitrev = null, // bit reversal table\n\t\t_cstb = null; // sin/cos table\n\tvar _tre, _tim;\n\n\tthis.init = function (n) {\n\t\tif(n !== 0 && (n & (n - 1)) === 0) {\n\t\t\t_n = n;\n\t\t\t_setVariables();\n\t\t\t_makeBitReversal();\n\t\t\t_makeCosSinT... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is used to draw lines across the terminal | function drawLine() {
var i = term.width;
while(i--) {
term.blue("-");
}
term.blue("\n");
} | [
"function drawLines() {\n let underline = screenWidth / 40;\n let spacing = screenWidth / 30;\n \n for(let i = 0; i < secretWord.word.length; i += 1){\n ctx.beginPath();\n ctx.lineWidth = 2;\n ctx.moveTo(screenWidth - screenWidth / 3.7 + spacing * i, 2*screen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Invalidate editor when grid renders rows. | onGridBeforeRenderRows() {
// grid rows are being rerendered, meaning the underlying data might be changed.
// the editor probably won't be over the same record, so cancel
if (this.editorContext && this.editorContext.editor.isVisible) {
this.cancelEditing();
}
} | [
"invalidate() {\n\t\tthis.updateRowCount();\n\t\tthis.invalidateAllRows();\n\t\tthis.render();\n\t}",
"invalidateAllRows() {\n\t\tif (this._currentEditor) {\n\t\t\tthis._makeActiveCellNormal();\n\t\t}\n\n\t\tfor (let row in this._rowsCache) {\n\t\t\tthis._removeRowFromCache(row);\n\t\t}\n\t}",
"_commitRowEdits ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate the height ratio of the current pfolio itmes | function changePfolioHeight(){
pfolioRatio = $this.outerWidth() / pfCurrScr;
pfolioRatio = pfolioRatio
} | [
"function changePfolioHeight(){\n pfolioRatio = $this.outerWidth() / pfCurrScr;\n pfolioRatio = pfolioRatio\n }",
"function getPercentageHeight(){\n var displayHeight = $(window).height();\n var percentageHeight = displayHeight / baseHeight;\n\n \n return pe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
API test for 'SetHubExtOptions', Set hub extended options | function Test_SetHubExtOptions() {
return __awaiter(this, void 0, void 0, function () {
var in_rpc_admin_option, out_rpc_admin_option;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
console.log("Begin: Test_SetHubExtOptions");
... | [
"function Test_GetHubExtOptions() {\n return __awaiter(this, void 0, void 0, function () {\n var in_rpc_admin_option, out_rpc_admin_option;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_GetHubExtOp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
compares new unit against each stored units identifies based on similarity to each return "circle" or whatever || or could return a normalized confidence | function identify(new_unit, possible_shapes){
var differences = {};
var min_diff = 1;
var prediction = "";
for (var shape in possible_shapes){
var diff = compare(possible_shapes[shape], new_unit);
differences[shape] = diff;
if (diff < min_diff){
prediction = shape;
min_diff = diff;
}
}
return predic... | [
"function unitCheck(unit1, unit2) {\n\tgroupKg = [\"kg\",\"g\",\"mg\",\"lbs\"]\n\tgroupL = [\"L\",\"mL\",\"oz\"]\n\tunit1Group = groupL;\n\tunit2Group = groupL;\n\tfor (let i = 0; i< groupKg.length;i++){\n\t\tif (unit1 === groupKg[i]){\n\t\t\tunit1Group = groupKg;\n\t\t\tbreak;\n\t\t\t\n\t\t} \n\t\telse {}\n\t\t\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process keywords. Returns nodes. | function processKeywords() {
var nodes = []
var lastIndex
var keyword
var node
var submatch
if (!top.keywords) {
return addText(modeBuffer, nodes)
}
lastIndex = 0
top.lexemesRe.lastIndex = 0
keyword = top.lexemesRe.exec(modeBuffer)
while (keyword) {
addText(m... | [
"function processKeywords() {\n var nodes = [];\n var lastIndex;\n var keyword;\n var node;\n var submatch;\n\n if (!top.keywords) {\n return addText(modeBuffer, nodes);\n }\n\n lastIndex = 0;\n\n top.lexemesRe.lastIndex = 0;\n\n keyword = top.lexemesRe.exec(modeBuffer);\n\n wh... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send the currently active app to the background | backgroundApp(seconds) {
return __awaiter(this, void 0, void 0, function* () {
utils_1.logInfo("Sending the currently active app to the background ...");
this._args.testReporterLog("Sending the currently active app to the background ...");
yield this._driver.backgroundApp(sec... | [
"function wakeApplication() {\n var useThisId = appId;\n if (chrome.runtime.id == 'aeclbbagepggnfbapgnfomjckapheodb') {\n useThisId = 'gmbajgdpbmbigbkpebjaoekajcidjlng';\n }\n chrome.runtime.sendMessage(appId, 'sup', {}, function(){});\n}",
"function onAppBackground() {\n appscore.print.start();\n ap... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
EG Create funtion eg showName | function showName() {
console.log(this.name);
} | [
"function createName (){\nreturn firstName + \" \" + lastName\n}",
"function printName(name) {// hint.. add a parameter on this line :)\n console.log(name);\n}",
"function PrintName(name){\n console.log(name);\n}",
"function name (name ){\n return \"Hi ,my name is \"+ name +\".\";\n }",
"function myName... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
12.15 The debugger statement | function je(){return G("debugger"),H(),pt.createDebuggerStatement()} | [
"function vt(e){return ne(\"debugger\"),ae(),e.finishDebuggerStatement()}",
"function DebuggerStatement() {\n}",
"function d() {\n debugger;\n}",
"function ForDebug() {}",
"debug() {}",
"function debug() {\n \n}",
"function triggerDebug() {\n debugger;\n return null;\n}",
"function JavaDeb... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Facilitate loading Snappy optionally | function retrieveSnappy() {
var snappy = null;
try {
snappy = require_optional('snappy');
} catch (error) {} // eslint-disable-line
if (!snappy) {
snappy = {
compress: noSnappyWarning,
uncompress: noSnappyWarning,
compressSync: noSnappyWarning,
uncompressSync: noSnappyWarning
... | [
"startSnappy() {\n const {SnappyStream, UnsnappyStream} = require('snappystream')\n this.startCompression(new UnsnappyStream(), new SnappyStream())\n }",
"function retrieveSnappy() {\n let snappy = require_optional('snappy');\n if (!snappy) {\n snappy = {\n compress: noSnappyWarning,\n uncom... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sets a custom log function to support the function attribution in Typescript. | setLog(log) {
module.exports.log = typeof log === 'function' ? log : null;
} | [
"function setLogFunc(newLogFunc) { myLogFunc = newLogFunc; }",
"function logging() {}",
"function log() {}",
"function setDefaultLogFunctions() {\n _(['trace', 'debug', 'info', 'warning', 'error']).forEach((name, index) => {\n addLogLevel.call(this, index, name);\n });\n this.setLevel('debug');\n}",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks pitted and (if not) hook one to process.exit. | function checkPitted() {
if (!pitted) {
process.on('exit', function() {
pitchain.forEach(function(fn) {
fn(marks, expects);
});
});
pitted = true;
}
} | [
"function processExitHook(fn) {\n // @ts-ignore\n process.on('exit', fn);\n return () => {\n // @ts-ignore\n process.off('exit', fn);\n };\n}",
"exitIfNotExists(ctx) {\n\t}",
"function exit() {\n\twantsToExit = true;\n}",
"function kill() {\n require('async-each')(kill.hooks, functi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
verify session, clear session if false | async function verifySession() {
let token = sessionStorage.getItem('token');
if (token) {
try {
let tokenObj = JSON.parse(token);
if (tokenObj.session) {
const verify = await post('./server/user/verifySession.php', token);
if (verify) {
... | [
"async verifySession() {\n try {\n await this.get('/api/v2/user/session');\n return true;\n }\n catch (err) {\n return false;\n }\n }",
"function verifySession(req, res, next) {\n\tvar sid = req.sid;\n\tvar sess = Sessions.findBySid(sid);\n\tif(!sess... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds login elements to the DOM | function addLoginButtons() {
document.getElementById(TOP_ID).innerHTML = TOP_INFO_STR;
const dashElement = $(getLoginHtml());
$('#' + DASH_ID).append(dashElement);
} | [
"function printLoginScreen() {\n var template;\n var node;\n\n template = document.querySelector(\"#instaChatLoginTemplate\");\n node = document.importNode(template.content, true);\n container.appendChild(node);\n }",
"function createElementsLoginPage() {\n\n document.getE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Functions that removes the cellXFlash CSS classes to make the cells flash on and off upon player click or computer's random choice | function flashCell1() {
$("#cell-1").removeClass("cell1Flash");
} | [
"function freezeBoard(){\n cells.forEach(cell => cell.style.pointerEvents = 'none' );\n}",
"function giveKillCell() {\n if (cell.classList.contains(\"alive\")) {\n cell.setAttribute(\"class\", \"dead\");\n firstgrid[i][j] = 0;\n } else {\n cell.setAttribute(\"class\", \"alive\");\n firstgrid[i][j]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
25.4.1.6 IsPromise ( x ) | function IsPromise(x) {
if (Type(x) !== 'object') return false;
if (!('[[PromiseState]]' in x)) return false;
if (x['[[PromiseState]]'] === undefined) return false;
return true;
} | [
"function isPromise(x){\n if (typeof x == 'undefined')\n return false;\n \n if (x.promise && !isDeferred(x))\n return true;\n return false;\n }",
"function IsPromise ( x ) {\n if ( Type(x) !== 'object' ) {\n return false;\n }\n if ( Type(x['[[Prom... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION AJAX Write Stored Favorites (u = uid, a = activities) | function writeStoredFavorites(u,a) {
$.ajax({
url: $base + 'includes/write_user_favorites.ajax.php',
async: true,
type: "POST",
data: {
uid: u,
act: a
}
});
return;
} | [
"function writeStoredActivities(u,a) {\n $.ajax({\n url: $base + 'includes/write_user_activities.ajax.php',\n async: true,\n type: \"POST\",\n data: {\n uid: u,\n act: a\n }\n });\n return;\n \n}",
"function add_MarketFavs(villageid,koords,dorfn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
END stopFollowing START checkWhichNavigationToDisplay [checkWhichNavigationToDisplay If one clicks on "Status Updates" different navigation points have to be displayed.] | function checkWhichNavigationToDisplay() {
var nonStatusUpdates$ = jContainer.find(".ASWidgetActionDropdown li:not(.ASWidgetStatusUpdatesNaviPoint)"),
statusUpdates$ = jContainer.find(".ASWidgetActionDropdown li.ASWidgetStatusUpdatesNaviPoint");
if (jContainer.find(".ASWidgetstatusUpdates.active").length) {
... | [
"function checkNav() {\n\t\t\t\tif (o.navHidden) {\n\t\t\t\t\tif (point == 0) {\n\t\t\t\t\t\tprev.addClass(\"vcButton_hidden\").attr(\"aria-hidden\", \"true\");\n\t\t\t\t\t} else if (point == \"-\"+ pEnd) {\n\t\t\t\t\t\tnext.addClass(\"vcButton_hidden\").attr(\"aria-hidden\", \"true\"); \n\t\t\t\t\t\tprev.removeCl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: move label where mouse moves | function moveLabel() {
//Determine width of label
var labelWidth = d3.select('.infolabel')
//Use node() to get the first element in this selection
.node()
//Return an object containing the sie of the label
.getBoundingClientRect()
//Examine width to determine how much to ... | [
"function moveLabel(){\n //use coordinates of mousemove event to set label coordinates\n var x = d3.event.clientX + 10,\n y = d3.event.clientY - 75;\n \n d3.select(\".infolabel\")\n .style(\"left\", x + \"px\")\n .style(\"top\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send out ship types to all users (really uneccesary) | function emitAllShipTypes(id){
// TODO: Tweak/Add to data?
io.sockets.emit('shiptypes', ships.shipTypesGet());
} | [
"function placeShip() {\r\n for(index of finalShipArray) {\r\n boardObj.message[index].ship = shipType;\r\n }\r\n}",
"function sendShips() {\n let shipsList = [];\n //create a list with all you ships\n $(\".occupied\").each(function () {\n shipsList.push($(this).attr('id'));\n });\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
idx stepH + start + circleSize = val val circleSize start / stepH = idx identifies a space's index for usage with the spaces object given a set of coords | function getSpaceIndex(posX,posY){
var remX = Math.floor((posX - Math.floor(0.5*start))/stepW);
var remY = Math.floor((posY - Math.floor(0.5*start))/stepH);
var index = COLS*remX + remY;
return index;
} | [
"function distFromCircleCenter(cursorX, cursorY,idx){\n\t\t\tvar x_diff = (cursorX - spaces[idx].pos_x)**2;\n\t\t\tvar y_diff = (cursorY - spaces[idx].pos_y)**2;\n\t\t\treturn ( Math.ceil(Math.sqrt(x_diff + y_diff)) );\n\n\t\t}",
"function getSpaceIndex(){\n return (COORDS[1]*PUZZLE.numRows) + COORDS[0];\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a sample from a uniform [a, b) distribution. | function randUniform(a, b) {
var r = Math.random();
return (b * r) + (1 - r) * a;
} | [
"function randUniform(a, b) {\n const r = Math.random();\n return b * r + (1 - r) * a;\n}",
"function randUniform(a, b) {\n const r = Math.random();\n return (b * r) + (1 - r) * a;\n}",
"function randRange(a, b) {\n return lerp(a, b, rand());\n }",
"function rng(a, b) {\n return Math.rand... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates the pause length based on the wpm speed selected by the user. Solution taken from | function calculatePauseLength(speed){
var wordsPerSecond = Math.round(speed / 60);
var pause = Math.round(1000 / wordsPerSecond);
return pause;
} | [
"function calculate_wpm(time_start, time_end, chars_typed_ok) {\n if(!time_start || !time_end || !chars_typed_ok) return 0;\n\n var time_taken = time_end - time_start;\n var mins = time_taken/60000;\n\n /* adjust for jittering in\n * pause/resume */\n if(mins < 0.1) mins = 0.1;\n\n var words =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
interval example 5 outputs with 2 seconds interval | function interval_example() {
var start_time = new Date();
sys.puts('\nStarting 2 seconds interval, stop after 5th tick');
var count = 1;
var interval = setInterval(function() {
if (count == 5) {
clearInterval(this);
}
var end_time = new Date();
var difference = end_time.getTime() - start_time.getTime();... | [
"function interval_example() {\r\n var start_time = new Date();\r\n sys.puts(\"\\nStarting 2 second interval, stopped after 5th tick\");\r\n var count = 1;\r\n var interval = setInterval(function() {\r\n if (count == 5) clearInterval(this);\r\n var end_time = new Date();\r\n var difference = end_time.g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process previous recording. Encrypt, upload, remove. | async function processRecording(outputFile, key, vid) {
let outputPath = path.join(Config.recordings, path.basename(outputFile, ".h264"));
console.log(`Wrapping previous recording: ${outputFile}`);
let mp4Path = outputPath + ".mp4";
let thumbPath = outputPath + ".jpg";
let encryptedVidPath = outputPath + ".enc";... | [
"function _finishRecording() {\n if (_recordedSequenceCallback) {\n _normalizeSequence(_recordedSequence);\n _recordedSequenceCallback(_recordedSequence);\n }\n\n // reset all recorded state\n _recordedSequence = [];\n _recordedSequenceCallback = null;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a hash representing a particular edge as a child of the given parent. | function hash(parent, edge) {
if (parent.type === 9 /* Synthetic */) {
return edge.to.name;
}
else {
return edge.indexOrName;
}
} | [
"constructor(parent, edges, value, hash){\n\n super(parent, edges, value);\n\n if (hash === undefined)\n hash = {sha256: new Buffer(32)}\n this.hash = hash;\n\n }",
"function getParentChildEdge(model, logger, parentVertex, childVertexConfig, edgeName) {\n\tlet edge;\n\tif (!mode... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Builds the security section of the DESCRIPTION node, which contains the information about wallet location, server DN, encryption and checksum options. | buildSecurityInfo(protocol) {
const securityInfo = new Array();
if (protocol != null && protocol.toLowerCase() == "tcps") {
// In EZConnect format if the DN match is not specified the enable it
// by default for TCPS protocol.
const serverDNMatch = this.urlProps.get("SSL_SERVER_DN_MATCH");
... | [
"buildDescriptionParams() {\n if (this.urlProps.size === 0)\n return '';\n const builder = new Array();\n this.urlProps.forEach(function(v, k) {\n if (DESCRIPTION_PARAMS.includes(k)) // Add only if it is a DESCRIPTION node parameter\n builder.push(`(${k}=${v})`);\n });\n return build... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check the agentId belongs to app | async appAgentRequired(ctx, next) {
const { service: { agentmanager } } = ctx;
const appId = ctx.query.appId || ctx.request.body.appId;
const agentId = ctx.query.agentId || ctx.request.body.agentId;
const agents = await agentmanager.getInstances(appId);
if (agents.some(agent => agentId ===... | [
"async agentAccessibleRequired(ctx, next) {\n if (!ctx.checkPossibleParams(['appId', 'agentId'])) {\n return;\n }\n\n const { service: { manager } } = ctx;\n\n // check is app member\n const { userId } = ctx.user;\n const appId = ctx.query.appId || ctx.request.body.appId;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stops the controller instance (and the adapter if it is running) | async stopController() {
if (!this.isControllerRunning())
return;
if (!this.didAdapterStop()) {
debug("Stopping adapter instance...");
// Give the adapter time to stop (as long as configured in the io-package.json)
let stopTimeout;
try {
... | [
"stop() {\n if(!this.controller) {\n return;\n }\n this._sendRemoteControlEvent(this.controller, {\n type: EVENT_TYPES.stop\n });\n this._stop();\n }",
"stopPollingController() {\n this.hasController = false;\n }",
"stop() {\n if (this._thre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates all uservisible widgets. | function updateAllWidgets() {
duplicateRemovedEvents = removeDuplicateEvents(allEvents);
updateMarkers(duplicateRemovedEvents);
updateScroller(duplicateRemovedEvents);
} | [
"function updateWidgets() {\n\t\n\t// get all the active widgets on the current page.\n\tvar widgets = $.map($(\".w_container\"), function(widget) {\n\t\t\t\t\t\treturn { \"elementId\": widget.id, \"widgetTypeId\" : $(widget).data(\"widgetTypeId\") };\n\t\t\t\t\t});\n\t\n\tfor(var i = 0; i < widgets.length; i++) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
converts a unix time stamp to ... | function convUnix(t) {
var date = new Date(parseInt(t) * 1000);
return date;
} | [
"function timeConverter(UNIX_timestamp){\n let a = new Date(UNIX_timestamp * 1000);\n let year = a.getFullYear();\n let month = a.getMonth()+1;\n let date = a.getDate();\n //this changes the time stamp to a date form at (MM/DD/YYYY)\n let time = \"(\" + month + '/' + date+ '/' + year + \")\";\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the solidity compiler instance from a module path. | function getSolcJSFromPath(modulePath) {
return require(modulePath);
} | [
"function loadCompiler(name) {\n const compiler = require.resolve(name || 'typescript', { paths: [cwd, __dirname] });\n const ts = require(compiler);\n return { compiler, ts };\n }",
"function compile() {\n var moduleMeta = this;\n // Evaluate module meta source and return module ins... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add location data and comments from another node | withLocationDataAndCommentsFrom(node) {
var comments;
this.withLocationDataFrom(node);
({comments} = node);
if (comments != null ? comments.length : void 0) {
this.comments = comments;
}
return this;
} | [
"function addComments(type,comments){if(!comments)return;var node=this.node;if(!node)return;var key=type + \"Comments\";if(node[key]){node[key] = node[key].concat(comments);}else {node[key] = comments;}}",
"function addNodeOnto(x,y,name){\n var index = node_dataOnto.length;\n node_dataOnto.push({x:x,y:y,name:na... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PART 2: Odd or Even String Length? | function oddOrEvenString(string){
if(string.length % 2 ===0){
console.log("This string length is TOTALLY even!");
}else if(string.length % 2 > 0 ){
console.log("This string's length is odd..");
}
} | [
"function lengthIsEven(str1) {\n var strLength = str1.length;\n var ressEven = strLength % 2 === 0;\n console.log(strLength, ressEven);\n}",
"function oddOrEvenString(s) {\n if (s.length % 2 != 0) {\n return \"his string's length is odd\";\n } else if (s.length % 2 == 0) {\n return \"This string le... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bind search suggestions events. | function bindSearchSuggestionEvents() {
var highlightedLink, trigger, searchType, parentUL;
$('.search-results').on('mouseenter', 'li', function() {
$('.search-results span').removeClass('highlight');
$(this).find('span').addClass('highlight');
});
$('.search-res... | [
"function bindSearchBoxEvents() {\n var trigger, searchType, searchBoxValueFromSuggestions;\n bindSearchWidgetEvents();\n\n $('.search-close').click(function() {\n\n resetSearchBox();\n });\n\n $('.search-options a').click(function() {\n\n var type = (type = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
assign node to TAZ number for TAZ construction and propogate change upward | changeTAZassociated(e) {
const newTAZassociated = Number(e.target.value);
// the colorscale created by d3-scale-chromatic should be deterministic
this.props.layer.setStyle({
fillColor: (newTAZassociated === -1) ? ('gray') : (
scaleSequential(interpolateRainbow)... | [
"function setCurrentTreeNode(){\n\tabOndemandPlaningboardController.currentTreeNode = View.panels.get(\"treeProbWrTask\").lastNodeClicked;\n}",
"function SetNewTetramino()\n {\n //Set the new current tetramino\n Progress.CurrentTetramino = (Progress.NextTetramino !== null && Progress.NextTetramin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
5 test if string for slug is invalid | function isSlugInvalid(slugstring) {
//(only a-z, A-Z, 0-9 and "_" are allowed as characters!)
var forbiddenCharRegex = /^\w+$/;
if (!forbiddenCharRegex.test(slugstring)) {return 1;}
else {return 0;}
} | [
"static slug(value) {\n if (value.endsWith(\"-\") === true) {\n return {\n valid: false,\n message: \"Slug can not end with a hyphen.\"\n }\n } else if ((new RegExp(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)).test(value) !== true) {\n return {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the image source of the image we are trying to replace in the img uplaod dialog | function getProductImagePreviewSource()
{
var index = viewModel.productImageDialog();
var imageSource = "";
if (index == -1)
{
imageSource = viewModel.product().Product.MainImage.ImagePath();
}
else
{
imageSource = viewModel.product().Product.AdditionalImages()[index - 1].I... | [
"function cleanUpImageSrc(pEditor) {\n try {\n var div = $(\"<div></div>\");\n div[0].innerHTML = pEditor.getData();\n div.find('img[alt*=\"aih#\"]').attr(\"src\", \"aih\");\n return div[0].innerHTML;\n } catch (e) {\n apex.debug.error({\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load the tokens the user owns | static loadTokensList() {
const { availableTokens, network, walletAddress } = store.getState();
if (network !== 'mainnet') return Promise.resolve();
const availableTokensAddresses = availableTokens
.filter(token => token.symbol !== 'ETH')
.map(token => token.contractAddress);
return fetch... | [
"async loadTokens() {\n this.APIClient._authentication._tokensFile = '.tokens.json';\n try {\n const data = await this.readFileAsync(this.name, 'tokens.json');\n // @ts-expect-error\n this.APIClient._authentication._tokens.oauth = JSON.parse(data.file);\n th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Form upload node config Import external labs | function printFormUploadNodeConfig(path) {
var html = '<form id="form-upload-node-config" class="form-horizontal form-upload-node-config">' +
'<div class="form-group">' +
'<label class="col-md-3 control-label">' + MESSAGES[2] + '</label>' +
'<div... | [
"function entityreference_autocreate_form_alter(&$form, &$form_state, $form_id) {\n if (isset($form['type']) && $form['type']['#value'] . '_node_settings' == $form_id) {\n $form['workflow']['upload_' . $form['type']['#value']] = array(\n '#type' => 'radios',\n '#title' => t('Attachments'),\n '#de... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inputs the JWT from encode then to decode it using parsing and buffer using b64 algorithm then moves it toString form | function decode(jwt) {
const [headerB64, payloadB64] = jwt.split('.');
// These supports parsing the URL safe variant of Base64 as well.
const headerStr = new Buffer(headerB64, 'base64').toString();
const payloadStr = new Buffer(payloadB64, 'base64').toString();
return {
header: JSON.parse(h... | [
"jwt(token, deligate) {\n var base64Url = token.split('.')[1];\n var base64 = base64Url.replace('-', '+').replace('_', '/');\n\n const jwtPayload = JSON.parse(this._$window.atob(base64));\n\n for (const key of Object.keys(jwtPayload)) {\n if (key !== undefined) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CN Combine two given tiles into new tile, return reference to new tile | function combineTiles(tileA, tileB){
var newTile = new Tile((tileA.value*2), tileA.col, tileA.row)
updateScore(newTile.value);
tileA.removeTile();
tileB.removeTile();
return newTile;
} | [
"function prepareTileMerging(from,to) {\n tiles[from].merged = true\n tiles[from].merged_cell = tiles[to]\n tiles[from].merged_cell.z = 1\n tiles[from].value += tiles[from].value\n}",
"mergeTiles(a, b) {\n this.gameState.board[b] = this.gameState.board[b] * 2;\n this.gameState.bo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates a given phosphor blend based on the colors provided. This is used when the palette is being set. | function calculatePhosphorColor(aColorComponentA, aColorComponentB, aPhosphorBlend) {
var zDifference = Math.abs(aColorComponentA - aColorComponentB);
var zBlendFactor = aPhosphorBlend / 100.0;
var zPhosp = Math.floor(Math.min(aColorComponentA, aColorComponentB) + Math.floor((zBlendFactor * zDif... | [
"function blendColors(c0, c1, p) {\n var f=parseInt(c0.slice(1),16),\n t=parseInt(c1.slice(1),16),\n R1=f>>16,\n G1=f>>8&0x00FF,\n B1=f&0x0000FF,\n R2=t>>16,\n G2=t>>8&0x00FF,\n B2=t&0x0000FF;\n return \"#\"+(0x1000000+(Math.round((R2-R1)*p)+R1)*0x10000\n +(Math.round((G2-G1)*p)+G1)*0x... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Looping through hand value | function getHandValue(){
for (var i = 0; i < cards.length; i++) {
handValue(i);
}
} | [
"getValueOfHand() {\n this.valueOfHand = 0;\n this.hand.forEach(card => {\n this.valueOfHand += card.value;\n })\n return this.valueOfHand;\n }",
"addhandvalues(hand){\n this.handvals = hand;\n console.log(\"HAND: \" + hand);\n }",
"handValue(hand) {\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
funciones para mostrar mis gifos en la pagina | function buscarMisGifos() {
let pantallaMisGifosVacio = document.getElementById('misgifos-vacio');
if (misGifosString == null || misGifosString == "[]") {
//1. si no tengo gif creados, muestro la pantalla mis gifos vacia
pantallaMisGifosVacio.style.display = "block";
pantallaMisGifos.st... | [
"function displayGifs() {}",
"function displayGif() {\n var imageSrc = pokemon[round].gifFile;\n document.getElementById(\"silImage\").innerHTML = '<img src=' + imageSrc + '>';\n }",
"function misGuifos (){\n let buscador = document.getElementById('buscador');\n let recomendaciones = docu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
_stopHTML5Audio() Stops channel [id] Returns AQ.DONE or AQ.ERROR | function _stopHTML5Audio ( id )
{
var i, channel, status;
for ( i = 0; i < _channelCnt; i += 1 )
{
channel = _channels[ i ];
if ( channel.id === id )
{
channel.params.autoplay = false; // prevents autoplay if still loading
status = channel.status;
if ( ( status === _CHANNEL_PLAYING ) || ( ... | [
"function _pauseHTML5Audio ( id )\n\t{\n\t\tvar i, channel;\n\n\t\tfor ( i = 0; i < _channelCnt; i += 1 )\n\t\t{\n\t\t\tchannel = _channels[ i ];\n\t\t\tif ( channel.id === id )\n\t\t\t{\n\t\t\t\tif ( channel.status === _CHANNEL_PAUSED )\n\t\t\t\t{\n\t\t\t\t\t_playHTML5Channel( channel );\n\t\t\t\t}\n\n\t\t\t\telse... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns buffer object with stringified JSON object. The buffer object prevents Express.js to add 'charset=utf8', which is against JSON spec. | function toJSON(obj) {
return new Buffer(JSON.stringify(obj, null, 2));
} | [
"static toBuffer(json) {\n return Buffer.from(JsonEncoder.toString(json))\n }",
"function jsonToBuffer(value) {\n return Buffer.from(JSON.stringify(value));\n}",
"function objToBuffer(obj){\n\treturn new Buffer(JSON.stringify(obj));\n}",
"buildJSONBody(req, res, next) {\n if (!req._buffer.length) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
we need to find the lowest decimal number that should be added to the given input (secret key) so that when we MD5 hash it we get a hash starting with 5 zeroes for part 1 and 6 zeroes for part 2 the decimal_finder function takes a secret_key that when concatenated with a certain decimal and hashed using MD5 hashing, pr... | function decimal_finder(secret_key, hash_start){
let decimal;
for(i = 0; i < Infinity; i++){
if(md5(secret_key.concat(i)).slice(0, hash_start.length) === hash_start){
decimal = i;
break;
}
}
return decimal;
} | [
"hash(key) {\n key = '' + key;\n var stringArray = key.split('');\n var num = stringArray.reduce((acc,val) => {\n return acc + val.charCodeAt(0);\n }, 0 );\n // console.log({num});\n num = (num * 599) % this.size;\n // console.log({num});\n return num;\n }",
"hashFunction(key){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Shows the alarms modal to change alarms and other options. | showAlarmsModal() {
this.modal = new ModalAlarmClass();
this.modal.showAlarmsModal( () => { this.modal = null; } );
} | [
"function showAlarmSettings()\n{\n\texitFullScreen();\n\tif( timeformat == \"12Hr\")\n\t\tdocument.getElementById('alarm_am_pm').style.display = \"block\";\n\telse\n\t\tdocument.getElementById('alarm_am_pm').style.display = \"none\";\n\n\tdocument.getElementById('alarm_settings').style.display = \"block\";\n}",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
opens the game store | function openStore() {
IN_STORE = true;
$('#levelScreen').hide();
gwhStore.show();
gwhStoreItems.show();
} | [
"function open(storeName, options) {\n options = options || {};\n\n extend(options, {\n name: storeName\n });\n\n return hoodieRemoteStore(hoodie, options);\n }",
"function open(storeName, options) {\n options = options || {};\n\n $.extend(options, {\n name: storeName\n });\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Move all the cells to the left of the grid. Returns true if cells were moved. | function moveAllToLeft() {
var moved = false;
for (var r = 0; r < 4 ; r++ ) {
var s = 0;
for (var c = 0; c < 4 ; c++ ) {
if (!isCellEmpty(r, c)) {
if (c != s) {
moved = true;
setGridNumRC(r, s, grid[r][c]);
setEmptyCell(r, c);
}
s++;
}
}
}
return moved;
} | [
"function moveTilesLeft() {\n var moved = false\n var captured = false\n for (var row = 0; row < grid_size; row++) {\n for (var column = 0; column < grid_size; column++) {\n if (column > 0) {\n var ind = index(row,column)\n if (tiles[ind] != null) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a dummy payload when there's no other response so that the webhook works in dialogflowfulfillment:0.6.1. | function addDummyPayload(agent) {
agent.add('');
} | [
"function generateEmptyPayload(){\n\tvar payload = {\n\t\t\"user\": null,\n \t\t\"dog\": {\n \t\t\t\"name\": null,\n \t\t\"sex\": null,\n \t\t\"age\": null,\n \t\t\"breed\": null,\n \t\t\"city\": null,\n \t\t\"state\": null,\n \t\t\"zipcode\": null,\n \t\t\"bio\": null\n \t\t},\n \t\t\"phys... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
uses trainLanguage to train each single supported language | trainLanguages() {
let self=this;
return Q.all(this.languages.map((language)=>{
return self.trainLanguage(language);
}));
} | [
"async function train_model() {\n const container = await containerBootstrap();\n container.use(Nlp);\n container.use(LangDe);\n const nlp = container.get(\"nlp\");\n nlp.settings.autoSave = false;\n nlp.addLanguage(\"de\");\n // Adds the utterances and intents for the NLP\n // intent Temperatur\n nlp.addD... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is used to set the state of an object in MisterHouse. If we are setting the system mode (mode_occupied), then refresh the header icon for it after setting it. I am using an HTTP GET request as MH returns log information that we don't want displayed, but we can possibly parse it for errors returned | function MhSet(obj, state) {
var url='./set;Referrer?$' + obj + '=' + state;
$.get(url, function (data) {
//alert(data);
if (obj == "mode_occupied") {
GetMhMode("page");
}
});
} | [
"function MhSet(obj, state) {\n var url='./set?$' + obj + '=' + state;\n $.get(url, function (data) {\n //alert(data);\n if (obj == \"mode_occupied\") {\n GetMhMode(\"page\");\n }\n\t});\n}",
"function GetMhMode(ph) {\n var url = './sub?json(objects=mode_occupied)';\n\n //Get the current MH mode... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write code above this line | function isLess(a, b){
if (a<b){
return true;
// Write code below this line
// Write code above this line
} else{
// Write code below this line
// Write code above this line
return false;
}
// Write code below this line
// Write code above this line
} | [
"get preUglyCode () {\n // Always wrap this in a function\n return \"const ASS_Entry=\" + (this.useFunctionParam ? this.rawCode : `(()=>{${ this.rawCode }})`) + \";ASS_Entry()\";\n }",
"function addAbove() {\n addAboveTask(getCursor());\n }",
"appendIndentCR_THIS_FUNCTION(str=\"\",cr_after=... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that initialize the personal message (the userName) | function PersonalMessage(userName , messageContainer) {
this.username = userName;
this.messageContainer = messageContainer;
this.show = function() {
this.messageContainer.textContent = this.username;
}
} | [
"addSelfMessage() {\n // Add message to the screen\n this.addMessage(this.username, this.message);\n\n // Clear the input\n this.message = '';\n }",
"function getDefaultWelcomeMessage() {\n var message = \"\";\n var username = {'username': USER_NAME... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
for receiving backgroundcolor values from the current tab. | function getBgColors (tab) {
// But for now, let's just make sure what we have so
// far is working as expected.
alert('The browser action was clicked! Yay!');
} | [
"function getBgColors (tab) {\n // But for now, let's just make sure what we have so\n // far is working as expected.\n alert('Selected text: ' + tab);\n}",
"static processBackgroundColor(element,valueNew){return TcHmi.System.Services.styleManager.processBackground(element,{color:valueNew})}",
"get_bac... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Duplicate an existing build order. | function duplicateBuildOrder(build_id, options={}) {
inventreeGet(`{% url "api-build-list" %}${build_id}/`, {}, {
success: function(data) {
// Clear out data we do not want to be duplicated
delete data['pk'];
delete data['issued_by'];
delete data['reference']... | [
"static newOrder(order) {\n const orderID = UniqueID.generateOrderID(this.getDayOrderIds());\n order.id = orderID;\n const orders = this.getAllOrders();\n\n //add new order to old order list\n orders.push(order);\n\n //save order to storage\n this.saveOrder(orders);\n }",
"function duplicate... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ques.5(c): //grouping employee by age | function employee_grouping_by_age() {
var emp=
[
{
name:"Amarjeet malik",
age:22,
salary:8000,
DOB:"04/08/1996"
},
{
name:"Dolly",
age:21,
salary:10000,
... | [
"function groupByAges(data) {\n var groupedData = [];\n var i = 1;\n var c = 0;\n var count = data.length - 1;\n var sum = 0;\n var index = -1;\n data.forEach(function (element) {\n sum += getData(element);\n if (i == 10 || count == 0) {\n var elem = [];\n i ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setDateToToday Preset the fields in the request form to today's date. | function setDateToToday()
{
var today = new Date();
/* The following idiocy is due to bizarre incompatibilities
in the behaviour of getYear() between Netscrape and
Exploder. The ideal solution is to use getFullYear(),
which returns the actual year number, but that would
break this code on v... | [
"function setToday () {\n var year = today.getUTCFullYear().toString();\n var day = today.getUTCDate().toString();\n var month = today.getUTCMonth() + 1;\n var defaultDateValue = '';\n month = month.toString();\n defaultDateValue = year + '-' + month + '-' + day;\n today = defaultDateValue;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Dirty calculation to fix the priorities of a mandateeGroup. This should be done in the backend using queries. | setCalculatedGroupPriorities(agendaitems) {
return Promise.all(
agendaitems.map(async (item) => {
const mandatees = await item.get('mandatees');
if (item.isApproval) {
return;
}
if (mandatees.length == 0) {
item.set('groupPriority', 20000000);
retu... | [
"function reprioritise(priorityList, newPriority, oldPriority, priorityProp) {\n var delta, el, i;\n \n delta = newPriority - oldPriority;\n \n if (delta > 0) {\n // If we're moving to a higher number priority\n for (i = oldPriority + 1; i <= newPriority; i++) {\n el = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the latest stables version of React Native > current version | async function latest(projectRoot) {
try {
const currentVersion = getReactNativeVersion(projectRoot);
if (!currentVersion) {
return;
}
const {
name
} = require(_path().default.join(projectRoot, 'package.json'));
const latestRelease = await (0, _getLatestRelease.default)(name, curre... | [
"async function findCurrentReleaseVersion() {\n const rootPkgPath = path.resolve(rootDir, 'package.json');\n const pkg = await fs.readJson(rootPkgPath);\n\n if (!semver.prerelease(pkg.version)) {\n return pkg.version;\n }\n\n const { stdout: revListStr } = await execFile('git', [\n 'rev-list',\n 'HEAD... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ensures all required environment variables are set in the context of a local run. | function prepareLocalRunEnvironment() {
if (!util_1.isLocalRun()) {
return;
}
core.debug("Action is running locally.");
if (!process.env.GITHUB_JOB) {
core.exportVariable("GITHUB_JOB", "UNKNOWN-JOB");
}
if (!process.env.CODEQL_ACTION_ANALYSIS_KEY) {
core.exportVariable("C... | [
"function validateRequiredEnvVars (){\n\tvar environmentReady = true;\n\tif (!process.env.REDIS_HOST){\n\t\tconsole.error(\"Redis host is missing!\");\n\t\tenvironmentReady = false;\n\t}\n\tif (!process.env.REDIS_PORT){\n console.error(\"Redis port is missing!\");\n\t\tenvironmentReady = false;\n\t}\n\tif (!... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the Atom's Particle's State 2 | function create_atom_particle_state_2() {
// Creates the Geometry of the Sphere representing
// the Atom's Particle #2
atom_particle_geometry_2 = new THREE.SphereGeometry(0.22, 40, 40);
// Creates the Material of the Sphere representing
// the Atom's Particle #2
atom_particle_material_2 = new ... | [
"function create_atom_particle_state_1() {\n\n // Creates the Geometry of the Sphere representing\n // the Atom's Particle #1\n atom_particle_geometry_1 = new THREE.SphereGeometry(0.22, 40, 40);\n\n // Creates the Material of the Sphere representing\n // the Atom's Particle #1\n atom_particle_mate... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
2. Insert last node | insertLast(data) {
let node = new Node(data);
let current;
this.size++;
//If empty, make a head
if (!this.head) {
this.head = node;
} else {
current = this.head;
while (current.next) {
current = current.next;
}
current.next = node;
}
this.size++;
... | [
"addLast(node) {\n\n }",
"function insertLast(parent, node) \r\n{\r\n parent.insertBefore(node, null);\r\n}",
"insertLast(data) {\n var last = this.getLast();\n\n if(last) {\n last.next = new Node(data);\n } else {\n this.head = new Node(data, this.head);\n }\n }",
"insertLast(data){... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns the required byte range of the given file range is the raw value of the 'range' http header the returned object contains the data, and the value for the 'contentrange' response header | function readRange (file, range) {
const [unit, value] = range.split('=')
if (unit !== 'bytes') { return null }
const [start, end] = value.split('-')
const offset = parseInt(start)
const size = parseInt(end) - offset
const data = Buffer.alloc(size)
const fd = fs.openSync(file, 'r')
fs.readSync(fd, data... | [
"async function fetchByteRange(file, rangeStart, rangeEnd) {\n const headers = { Range: `bytes=${rangeStart}-${rangeEnd}` };\n const response = await fetch(file, { headers });\n\n const buf = await response.arrayBuffer();\n let byteOffset = 0;\n let length = rangeEnd - rangeStart + 1;\n\n // If th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
request the push server to send a notification, passing the id | function sendNotification() {
http.get(`/subscription/${subscritionId}`);
} | [
"static async send(eventID, notification) {\n if (!eventID) {\n console.error(\"You didn't pass an eventID into NotificationsAPI.send\");\n }\n return await this.request.post(\n `${eventsURL}/${eventID}/notifications`,\n notification\n );\n }",
"function sendPushNotification(data){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
when given an array and a value, returns the index of the last time the value occurs in the array if the value never occurs, the functino should return 1 | function lastIndexOf(array, value){
var answer;
var match;
for (var i = array.length; i >=0; i--){
if(value === array[i]){
answer = i;
match = true;
break;
}
}
if (match){
return answer
}
else{
return -1
}
} | [
"function lastIndexOf(array, value) {\n let output = -1;\n for (let i = 0; i <= array.length-1; i++) {\n if (array[i] === value) {\n output = i;\n }\n \n }\n return output;\n}",
"function findLastIndex(array, value) {\n for (let index = array.length - 1; index >= 0; index--) {\n if (ar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads restaurant ids from the excluded cookie and adds them to $excludeList | function loadExcludeList() {
if ($LOGGED_IN){
// load from firebase
getFirebaseData("Exclude");
}
else{
// load from cookies
var exclude = document.cookie;
exclude = exclude.substring(9, exclude.length);
if (exclude.length != 0) {
var excludeArr = exclude.split('|'); //exclude list ... | [
"function loadExcludeList() {\n\tvar exclude = document.cookie;\n\tif (exclude.length != 0) {\n\t\texclude = exclude.split(';'); //exclude list as one long string\n\t\tvar excludeArr = exclude[0].split(' '); //split ids\n\t\tfor(var i = 0; i < excludeArr.length; i++) {\n\t\t\t$excludeList.push(excludeArr[i]);\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the app information for a specific build. | function readAppInformationForBuild(api, id, query) {
return api_1.GET(api, `/builds/${id}/app`, { query })
} | [
"function getAppBuildInformation(manifest) {\n // Double entries for Java metrics with an associated node one in case\n // unknown system monitoring tools are looking for the magic Java strings.\n var buildInfo = {},\n cronus = loadCronusProp();\n\n if (manifest && manifest.version) {\n bu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call this method to switch to jsonp like loading. | useJsonpLoading() {
if (!this._enableJsonpLoading) {
this._enableJsonpLoading = true;
window[JSONP_HANDLER_NAME] = (icon) => {
this._jsonpIconLoad$.next(icon);
};
}
else {
warn('You are already using jsonp loading.');
}
... | [
"function loadData() {\n system.isLoading = true;\n\n $.ajax({\n url: system.apiURL,\n dataType: 'jsonp',\n success: onLoadData\n });\n\n }",
"function jsonp_cb() { return '0' }",
"function jsonpCallbackFunction(json) {\n\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the total of all subtotals of selected tickets and merchandise items and saved it in a cookie | function get_totals(){
var v_int;
var p_int;
var b_int;
var pr_int;
var s_int;
var bn_int;
var tt_int;
var wb_int;
var ts_int;
var v_total = getCookie("vip_subt");
var p_total = getCookie("pro_subt");
var b_total = getCookie("basic_subt");
var pr_total = getCookie("post_subt");
var st_tot... | [
"function sumaSubtotales(){\n\n\tvar subtotales = $(\".subtotales span\");\n\tvar arraySumaSubtotales = [];\n\t\n\tfor(var i = 0; i < subtotales.length; i++){\n\n\t\tvar subtotalesArray = $(subtotales[i]).html();\n\t\tarraySumaSubtotales.push(Number(subtotalesArray));\n\t\t\n\t}\n\n\t\n\tfunction sumaArraySubtotale... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
OpenClose Switcher after restaurant's schedule | function open_close(){
// from Monday to Thursday
if (dayOfWeek > 0 && dayOfWeek < 5){
// Open from 10 to 19
if (h >= 10 && h < 19){
document.getElementById('open-close-switcher').innerHTML = 'Open';
document.getElementById('open-close-switcher').style.color = 'green';
... | [
"function _MAIN_viewOnOpen() {\n view.setInterval(MAIN_planetCycle, UI_NEW_PLANET_INTERVAL);\n view.setInterval(MAIN_dateUpdate, 1000);\n MAIN_dateUpdate();\n \n // Start retrieving RSS feeds\n RSS_start();\n}",
"function checkOpen() {\n date = new Date();\n weekDay = date.getDay() + 1;\n now = dat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gets the sorted list of walls to exclude based on mazeGen | wallsToExclude(rows, cols, scale) {
const visited = [];
for (let i = 0; i < rows; i++) {
visited[i] = [];
for (let j = 0; j < cols; j++) {
visited[i].push(false);
}
}
let startx = Math.min(Math.floor(Math.random() * rows), rows - 1);
... | [
"addMazeInnerWalls(level, gridSize, gridScale) {\n const toExclude = this.wallsToExclude(gridSize + 1, gridSize + 1, gridScale);\n let ex = 0;\n for(let i = 0; i < gridSize - 1; i++) {\n let x = i * gridScale;\n while (ex < toExclude.length && toExclude[ex].x < x) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
shows popup for selection of photos | function showpopupimageselection(){
$('#imageselectionpopupmenu').popup('open');
} | [
"function handlePictureSelect() {\n searchElement(\"modal-file\").click();\n }",
"function openSelectImage(){\n $('#selectImage').modal('show');\n}",
"function showDownloadPopup() {\n if (selectedPhotos().length < 1) { return; }\n if ((isios || isipados) && selectedPhotos().length > 1) { return; }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CellTooltip feature handles special config cases, where user can supply a function to use as tooltipRenderer instead of a normal config object | processConfig(config) {
if (typeof config === 'function') {
return {
tooltipRenderer: config
};
}
return config;
} | [
"function on_tooltip_custom_paint(gr) {}",
"function createdTooltipText(cell, cellData, rowData, rowIndex, colIndex) {\n\n var jqueryObj = $(cell);\n\n //Create a tooltip for the cell text...\n //Source: http://chadkuehn.com/show-tooltip-over-truncated-text/\n //Setting tooltip width...\n //Source:... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to display the table header Disease Funds, Treatments Covered, status, Maximum Award Level | renderTableHeader() {
return (
<tr>
<th>#</th>
<th>Disease Funds</th>
<th>Status</th>
<th>Maximum Award Level</th>
<th>Treatments Covered</th>
</tr>
);
} | [
"function generateTableHeader()\n{\n return `\n <tr>\n <th rowspan=\"2\">Level</th>\n <th rowspan=\"2\">Cumulative Experience</th>\n <th colspan=\"3\">Experience to Next Level</th>\n </tr>\n <tr style=\"border-bottom: 4px solid black;\">\n <th>Experience to Next Level</th>\n <th>%... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
draw blocks in rows [r] and columns [c] | function drawBlocks() {
for (let c = 0; c < blockColumnCount; c++) {
for (let r = 0; r < blockRowCount; r++) {
if (blocks[c][r].show == 1) {
let blockX = (c * (blockWidth + blockPadding)) + blockOffsetLeft
let blockY = (r * (blockHeight + blockPadding)) + blockOff... | [
"function drawBlock(rowCounter, blockCounter){\n ctx.fillStyle = getBlockColor(rowCounter, blockCounter);\n ctx.fillRect(rowCounter * blockSize, blockCounter * blockSize, blockSize, blockSize);\n ctx.stroke();\n}",
"function drawBlocks() {\n\tcanvas.width = canvas.width;\n\tcontext.fillStyle = colorFg;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
calculates worldTransform vertices for a non texture with a trim. store it in vertexTrimmedData This is used to ensure that the true width and height of a trimmed texture is respected | calculateTrimmedVertices()
{
if (!this.vertexTrimmedData)
{
this.vertexTrimmedData = new Float32Array(8);
}
// lets do some special trim code!
const texture = this._texture;
const vertexData = this.vertexTrimmedData;
const orig = texture.orig;
... | [
"calculateTrimmedVertices() {\n if (!this.vertexTrimmedData) {\n this.vertexTrimmedData = new Float32Array(8);\n }\n else if (this._transformTrimmedID === this.transform._worldID && this._textureTrimmedID === this._texture._updateID) {\n return;\n }\n this._t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Scales a solution from venn.venn or venn.greedyLayout such that it fits in a rectangle of width/height with padding around the borders. also centers the diagram in the available space at the same time | function scaleSolution(solution, width, height, padding) {
var circles = [], setids = [];
for (var setid in solution) {
if (solution.hasOwnProperty(setid)) {
setids.push(setid);
circles.push(solution[setid]);
}
}
width -= 2*padding;
height -= 2*padding;
... | [
"function border( options ) {\r\n layoutSolution = {};\r\n var packedSize = {}, // Size without paddings.\r\n autoResizing = true;\r\n packedSize.width = spec.size.width - padding[1] - padding[3];\r\n packedSize.height = spec.size.height - padding[0] - padding[2];\r\n \r\n // ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add the access token to the storage | async setAccessToken(accessToken) {
/*console.log('set accessToken: ', accessToken);*/
await AsyncStorage.setItem(
`${this.namespace}:${storegeKey}`,
JSON.stringify(accessToken),
);
} | [
"static set(access_token, dontUpdateStorage) {\n AccessToken._accessToken = access_token;\n\n return new Promise((resolve, reject) => {\n if (! dontUpdateStorage) {\n localStorage.setItem(Config.Storage.ACCESS_TOKEN, access_token);\n // cookie used to authenticate on server-side\n Ut... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cycle through subModes and display onscreen | function cycleSubMode() {
if (M32.isSubMode < (M32.modeName[M32.isMode].length - 1)) {
M32.isSubMode++;
} else {
M32.isSubMode = 1;
}
host.showPopupNotification(M32.modeName[M32.isMode][0] + " sub-mode: " + M32.modeName[M32.isMode][M32.isSubMode]);
} | [
"function cycleMode() {\n if (M32.isMode < (M32.modeName.length - 1)) {\n M32.isMode++;\n } else {\n M32.isMode = 0;\n }\n M32.isSubMode = 1; // Reset isSubMode\n // Change panel layout\n if (M32.modeName[M32.isMode] == MIXER) {\n application.setPanelLayout(\"MIX\");\n }\n if (M32.modeName[M32.isMo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Participants Summary Diberikan data dalam bentuk array multidimensi yang berisi orangorang yang akan ikut dalam Hackathon yang diselenggarakan bulan depan. Implementasikan function `participantsSummary` untuk mengeluarkan laporan negara mana saja yang mengikuti, ada berapa orang yang mewakili negara tersebut dan nama p... | function participantsSummary(data) {
var country = [];
var check = false;
var i = 1;
var JSON = {};
for (let a = 0; a < data.length; a++) {
if (country == []) {
country.push(data[a][i]);
}
for (let j = 0; j < country.length; j++) {
if (data[a][i] == country[j]) {
check = true;
... | [
"getParticipantsString(participants) {\n var ret = \"\";\n if (participants.length > 0) {\n var count = participants.length;\n ret = count.toString();\n ret += (count === 1) \n ? \" participant\"\n : \" participants\";\n }\n return ret;\n }",
"function g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Transaction Message Collector Wrap merge.functions adding optionOverrides that will suspend transaction broadcast. | function trMessageCollector(trCallback) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var merges = arguments[2];
assert.equal('function', typeof trCallback === 'undefined' ? 'undefined' : (0, _typeof3.default)(trCallback), 'trCallback');
assert.equal('object', ... | [
"function trMessageCollector(trCallback){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var merges=arguments[2];assert.equal(\"function\",typeof trCallback===\"undefined\"?\"undefined\":_typeof(trCallback),\"trCallback\");assert.equal(\"object\",typeof options===\"undefined\"?\"undefined\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get an existing DefaultNetworkAcl 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 DefaultNetworkAcl(name, state, Object.assign(Object.assign({}, opts), { id: id }));
} | [
"static get(name, id, state, opts) {\n return new NetworkAcl(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }",
"static get(name, id, state, opts) {\n return new NetworkAclRule(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }",
"static get(name, id, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function takes a title of a book, searches the localStorage for it and deletes it if found | removeBooks(title) {
//Good Morning ^^
let store = this.getbooks();
//Bye Bye ;P
localStorage.setItem("books", JSON.stringify(store));
} | [
"static remove(bookTitle) {\n const books = Store.getBooks();\n\n books.forEach((book, index) => {\n if (book.title === bookTitle) {\n books.splice(index, 1);\n }\n });\n localStorage.setItem(\"books\", JSON.stringify(books));\n }",
"deleteBookFromStorage(title) {\n let books ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Link compile query and load it as Node module | static loadQuery(schema,queryName,compiledQuery) {
try {
const inheritance = schema && schema.inheritance ? schema.inheritance : [];
const inheritanceString = `const inheritance = ${stringified(inheritance)};`;
const QcertRuntimeString = getRuntime();
const linkedQuery =
inherita... | [
"function compile() {\n var moduleMeta = this;\n // Evaluate module meta source and return module instance\n return new loader.Module({code: evaluate(moduleMeta)});\n }",
"function loadQuery(next) {\n log('info', 'Loading query from: ' + options['load-query']);\n fs.readFile(options['load-query'],... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return an existing TeleStreamElement or create one for this device | get stream(){
var val
for( var i= this.children.length; i>= 0; --i){
var child= this.children[ i]
if( child instanceof TeleStreamElement){
// we assume only one child
return child
}
}
if( !val&& this.deviceId){
// eat zalgo
var opts= { deviceID: this.deviceId, ...this.constraints}
if( ... | [
"function createStreamNode(stream) {\n var previewImage = stream.preview.template.replace(/{width}/, 160).replace(/{height}/, 90);\n\n var streamNode = createNode('div', '', 'class', 'stream');\n var imageNode = createNode('a', '', 'href', stream.channel.url);\n var infoNode = createNode('div', '', 'cla... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Populate the simulation filter with the active Simulations | function populateSimulationFilter(){
$.ajax('index.php/rest/simulations/running').done(function(simulations){
var length = simulations.length || 0;
var select = document.getElementById('simulationsFilter');
for(var i = 0; i < length; i++) {
var opt = document.createElement('option');
opt.value = (simulati... | [
"resetFilter() {\n this._domainsFiltered = this._domains.slice();\n this._chromosomesFiltered = this._chromosomes.slice();\n this.emitUpdate();\n }",
"function speciesFilter(){\n var bySpecies;\n if (filter2.checked){\n species.disabled = false;\n bySpecies = true;\n }\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get tile given a piece | getPieceTile(piece) {
for(var key in this.tiles) {
if(this.tiles[key].getPiece() == piece)
return this.tiles[key];
}
} | [
"getTileWithPiece(piece){\n for(let key in this.tiles){\n if (this.tiles[key].getPiece() == piece)\n return this.tiles[key];\n }\n }",
"function getTileFromPiece(piece) {\n\treturn $(chess.tileId(parseInt(piece.getAttribute(\"data-row\")), parseInt(piece.getAttribute(\"data... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Affiche le resume de l'ouvrage dans le champ de meme nom | function afficherResume(ouvrage)
{
var resume = "RESUME :" + "\n" +
ouvrage[indiceReference] + "\n" +
ouvrage[indiceTitre] + "\n" +
ouvrage[indiceAuteurs] + "\n" +
//completer
ouvrage[indiceEditeur] + "\n" +
ouvrage[indiceEdition] + "\n" +
ouvrage[indiceAnnee] + "\n" +
ouvrage[indiceIsbn] +... | [
"get resume() {\n return this.args.student.resumes.objectAt(0);\n }",
"function onResume() {\n \n // Increment the resumed counter.\n\tresumed_count++;\n \n // Update the display. \n\tupdateDisplay();\n\t \n\talert(\"resume\");\n }",
"function displayResume() {\n bio.displ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |