query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Controllers Connects Commandobejcts to DOM nodes which works as UI | function TogglCommandController(command, elem) {
this.updateUI = function() {
var state = command.queryState();
elem.className = state?"active":"";
}
var self = this;
elem.unselectable = "on"; // IE, prevent focus
bindEvent(elem, "mousedown", function(evt) {
// we cancel the mousedown default to prevent th... | [
"function initiateController() {\n window.extensions.KJSLINT.Panels.Command.Controller.init();\n }",
"setCommandsController(commandsController) {\n this.rootFlow.setCommandsController( commandsController )\n }",
"createNodeFromKb(command) {\n let elementId = this.id;\n ++elemen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Disconnect RTM socket and exit node process. | disconnect() {
console.log('Disconnecting...');
// Wait a few seconds so potential messages can be sent before socket is closed
setTimeout(() => {
this.rtm.disconnect();
}, 7000);
} | [
"disconnect () {\n this.sub_sock.close()\n this.rpc_sock.close()\n }",
"disconnect () {\n this._socket && this._socket.disconnect();\n this._socket = null;\n }",
"disconnect() {\n\t\t\tthis.connected = false\n\t\t\t// Emitting event 'disconnect', 'exit' and finally 'close' to make it similar to No... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Used to send various types of assets, including js and css to the client | function getAsset(response, request) {
console.log("Request handler 'generic' was called, requesting " + request.url + ".");
var urlpath = url.parse(request.url).pathname;
//console.log("Request handler 'js' was called, requesting " + request.url + " with ext " + path.extname(urlpath));
response.writeHead(200, {'... | [
"static assetsBody(data){\n\t\tvar resources = RenderHelper.loadResources(data.assets);\n\t\tvar js_arr = resources.filter((name) => {\n\t\t\treturn rs.extname(name) == \"js\";\n\t\t});\n\t\tjs_arr = js_arr.pushIm(\"@Core.UI/es6/Drivers/RenderDriver.js\");\n\t\tjs_arr = js_arr.pushIm(\"@Core.UI/es6/Drivers/ApiBusDr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
uc3 generate daily wage of an employee based on random attendance | static generateRandomDailyWage() {
let hrs = 0;
let empCase = this.randomAttendance();
switch (empCase) {
case 0: // working parttime
hrs = parttime;
break;
case 1: // working fulltime
hrs = fulltime;
break;
default: // on leave
hrs = 0;
bre... | [
"generateRandomMonthlyWage() {\n // setting initial values\n let monthlyPay = 0, hrs;\n\n // looping for 20 days\n for (let day = 0; day < maxDays; day++) {\n let empCase = this.randomAttendance;\n this.attendance.push(empCase);\n switch (empCase) {\n case 0:\n hrs = partt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Agrega, en caso que no se tenga, el periodo a un grupo de fechas | function agregarContextoAGrupo(gruposFechas,contexto) {
var idContexto = "";
//instante
if(contexto.Periodo.Tipo == 1) {
idContexto = contexto.Periodo.FechaInstante;
}else if(contexto.Periodo.Tipo == 2) {
//duracion
idContexto = contexto.Periodo.FechaInicio + "-" + context... | [
"function camposEdicionHorarioDeGrupo(horarioId, horario) {\n var esMateria = true;\n if (horario['rol_id'] == 1) esMateria = false;\n\n // Vaciamos los elementos de la fila y añadimos las opciones\n $(\"#horario\" + horarioId + \", #dia\" + horarioId)\n .children(\"p\")\n .hide();\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Encodes an index to an operand or stack handle. | function encodeHandle(index, maxIndex = 2147483647
/* MAX_INDEX */
, maxHandle = -1
/* MAX_HANDLE */
) {
if (false
/* LOCAL_DEBUG */
) {}
if (index > maxIndex) {
throw new Error("index ".concat(index, " overflowed range 0 to ").concat(maxIndex));
} // -1 - 0 == -1
// -1 - 1073741823 == -1073741824
//... | [
"function encodeHandle(index, maxIndex = 2147483647\n /* MAX_INDEX */\n , maxHandle = -1\n /* MAX_HANDLE */\n ) {\n if (index > maxIndex) {\n throw new Error(`index ${index} overflowed range 0 to ${maxIndex}`);\n } // -1 - 0 == -1\n // -1 - 1073741823 == -1073741824\n // -1073741825 - 0 == -107... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
readPSW() reassembles the N, Z, V, and C flags back into the PSW (CPU.PSW) | function readPSW() {
"use strict";
var flags = 0;
if (testN()) {
flags |= 8;
}
if (testZ()) {
flags |= 4;
}
if (testV()) {
flags |= 2;
}
if (testC()) {
flags |= 1;
}
return (CPU.PSW = (CPU.PSW & 0xf8f0) | flags);
} | [
"function readPSW() {\n CPU.PSW = (CPU.PSW & 0xf8f0) | ((CPU.flagN >> 12) & 8) | ((CPU.flagV >> 14) & 2) | ((CPU.flagC >> 16) & 1);\n if (!(CPU.flagZ & 0xffff)) CPU.PSW |= 4;\n return CPU.PSW;\n}",
"function writePSW(newPSW) {\n var i, temp;\n CPU.flagN = newPSW << 12;\n CPU.flagZ = (~newPSW) & ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gets places from foursquare api for 'place' calls 'callback' with data/error | function getLocations(place, callback) {
var request = new XMLHttpRequest();
var baseUrl = 'https://api.foursquare.com/v2/venues/explore';
var clientId = 'YAFHOBF2NGR5UJJS4NLNWXCNZBGEMQUBCFA00SFRZLIRM5JO';
var clientSecret = 'CX2WYTMBELLDEAVQJB3BFFPDWL315NPQK1GYJKL1JZRPBBZX';
var queryParams = [];
queryPar... | [
"function retrievePlacesFoursquareAPI() {\n const client_id = 'HDUNL52NGCNNDRRSWIVAXVT2DT3FHJMIPIJQ4XHHFD32J2IL';\n const client_secret = 'QC4CKK0Z2X14QZSQ1A0IRZEWJGGZ10UE4TMSPSRAWTOA05HU';\n const api_version = '20191013';\n\n // https://developer.foursquare.com/docs/api/venues/explore\n const explo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
clears out variables for moving pieces, to ensure your selection isnt stuck on one piece. | function clearSelection(){
pieceSelected = false;
selectedPieceArray = [];
} | [
"function resetSelection(){\r\n\tvar y,x,i;\r\n\r\n\tfor (y=0;y < squares.length; y++){\r\n\t\tfor (x=0;x < squares.length; x++){\r\n\t\t\tif (squares[x][y].tile === 1 || squares[x][y].tile === 2){squares[x][y].piece = 32;}\r\n\t\t\tif (squares[x][y].tile === 3){squares[x][y].piece = 50;}\r\n\t\t}\r\n\t}\r\n\tfor (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a listing for each provider to the sidebar. | function buildLocationList(dataGeoJSON) {
var x = document.getElementById("listings");
if (x.style.display === "none") {
x.style.display = "block";
}
dataGeoJSON.features.forEach(function (dataGeoJSON, i) {
/**
* Create a shortcut for `provider.properties`,
* which will be used several times b... | [
"function loadSidePanel(response) {\n $(\"#sidebarTitle\").text(\"Restaurants/Bars\");\n $(\"#sidebarList\").empty();\n $.each(response.data, function(index, value) {\n var tagBuilder = \"<li><div class='row'><div class='col-md-6'>\";\n tagBuilder += \"<h5>\" + value.name + \"</h5>\";\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lookup a namespace identifier based on dataset name of the feature. Inputs: datasetName The name of the dataset used to create map layer. For example, in the AFD Prototype, the GNIS dataset name is 'GNIS_DC_Features_20180401'. Outputs: nsID The portion of the URI path that will identify which namespace to use to constr... | function getNsId(datasetName) {
// find dataset name and return its namespace ID
for (var ds in nsids)
if (ds == datasetName)
return nsids[ds];
// dataset not found
return null;
} | [
"static getNamespaceId(namespace) {\n const ns_id_mapping = this.NamespaceIdMapping;\n const ns_id = Object.keys(ns_id_mapping).find(ns => ns_id_mapping[ns] === namespace);\n return Number(ns_id);\n }",
"function getIdMap(data, dataset) {\n\tvar id = null;\n\tif (data.idMaps != null)\n\t\tfor ( var i = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find article from savedArticles array | function findArticleFromSaved(articleUrl){
for(let article of savedArticles){
if(article.url === articleUrl){
return article;
}
}
return null;
} | [
"function findArticles() {}",
"function findArticleInObject(articleId) {\n for (let i =0; i<articleObjects.length; i++) {\n if (articleObjects[i].id == articleId) {\n return articleObjects[i]\n }\n }\n}",
"function lookup_article() {\n\t\tvar item = app.selection[0];\n\t\t\n\t\tif... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if Bitwarden integration is configured properly by trying to obtain a valid BitwardenCLI tool path. | async checkIfConfigured () {
this.path = await this._getToolPath()
return this.path != null
} | [
"async checkIfConfigured() {\n this.path = await this._getToolPath()\n return this.path != null\n }",
"async checkIfConfigured () {\n this.path = await this._getToolPath()\n return this.path != null && (await this._checkVersion())\n }",
"async _getToolPath () {\r\n const localPath = this.getLoc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
below functions are for vertices testing // / Checks the winding direction of a set of vetices and compares the result with last winding result which is stored in the rotation variable. returns true if winding direction is acceptable for triangle_strip windings | function checkWindings(){
// console.log("checkWindings");
// check if there is less than three vertices to inspect
if (index < 2 ){
return true;
} // set initial rotation based on current winding
else if (index == 2) {
rotation = RHTwinding(vertices); // set initial rotation based ... | [
"findTriangles(surfaces) {\n\n const faces = this.faces;\n const sides = this.sides;\n\n const north = Voxels.adjacent(...this.xyz,Voxels.north);\n const northSurface = surfaces.get(Voxels.packKey(...north));\n if (northSurface) {\n if (northSurface.hasWestRamp() && !th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If the form token that was generated when the page was served has now expired, then request a refreshed token from the server, and don't submit the form until after it arrives. | function refreshTokens(event, formToken, formTokenPath, tokenExpiresSec) {
if (!window.prpcClient.constructor.isTokenExpired(tokenExpiresSec)) {
return;
}
formToSubmit = event.target;
event.preventDefault();
const message = {
token: formToken,
tokenPath: formTokenPath,
};
const refreshTokenPr... | [
"function sendTokenToForm(form){\n\tvar user = firebase.auth().currentUser;\t\t \n user.getToken(/* forceRefresh */ true).then(function(idToken) {\n\t\t \taddHidden(form, 'token', idToken);\n\t\t \tform.submit();\n\t\t}).catch(function(error) {\n\t\t\taddHidden(form, 'error', error.code);\n\t \tform.subm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize the core of our emulator (processor etc). | initCore() {
this.memory = new Memory(this);
this.cpu = new CPU(this);
this.apu = new APU(this);
this.ppu = new PPU(this);
this.loadCartridge(this.cartridge);
} | [
"function runOominit () {\n runSubProc(runOombump, 'oominit', 'oomtility/init.js'\n , '-d', 'Initial test of the oom-hub architecture'\n , '-c', '#9900ff'\n )}",
"function initialize_machine(linesize, linenumber, blocknumber) {\n HEAP = [];\n LINE_SIZE = linesize;\n NUM_OF_LINES_PER... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enter a parse tree produced by LUFileParsererrorFilterLine. | enterErrorFilterLine(ctx) {
} | [
"visitErrorFilterLine(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function caml_set_parser_trace() { return 0; }",
"error(e_parse) {\n\t\t\t\tfe_eval(e_parse);\n\t\t\t}",
"_runParser() {\n try {\n this._parser.parse(this._lexer);\n }\n catch (error) {\n this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get all nfts which stores them in state | function getAllNfts() {
fetch(`${apiUrl}/nftArt`)
.then((res) => res.json())
.then((allNfts) => setAllNfts(allNfts))
.catch((error) => console.error("FETCH ERROR:", error));
} | [
"function getSearchMatches(state) {\n return state.entities.search.matches;\n}",
"all_nots(state){\n return state.nots\n }",
"async function loadNFTs() {\n\n const provider = new ethers.providers.JsonRpcProvider(\n // \"https://matic-testnet-archive-rpc.bwarelabs.com\"\n \"https://... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle two steps payments interaction | function handleTwoStep() {
// Hide H1 and form buttons on click
if (
document.getElementById(
"payment-page-headline"
).style.display !== "non... | [
"function payment() {\r\n try {\r\n paymentMode = ['credit', 'debit'],\r\n index = readlineSync.keyInSelect(paymentMode, 'How do yoy like to pay?');\r\n payment = helper.payment(index + 1, paymentMode[index]);\r\n } catch (e) {\r\n throw e;\r\n }\r\n}",
"function Pay(){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given an array of arrays 'array_of_arrays', returns a single array containing the inner arrays backtoback. For example, [[ 1,2,3 ], [ 4,5,6 ]] becomes [ 1,2,3,4,5,6 ]. | function flatten_array_of_arrays( array_of_arrays )
{
// Every function has a .apply attribute that is itself
// a method taking a 'this' parameter and an array whose
// elements are used as the arguments.
return [].concat.apply( [], array_of_arrays );
} | [
"function flatten (arrayOfArrays) {\n\n}",
"function joinArrayOfArrays(array) {\n const joinedArr = [];\n array.forEach(innerArr => {\n innerArr.forEach(element => {\n joinedArr.push(element);\n })\n })\n return joinedArr;\n}",
"function flattenArray(arrays) {}",
"function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
figures out whether user is student or teacher, and makes the user leave with the appropriate protocol | function userLeavesClassroom(id) {
if (isTeacher(id)) {
teacherLeavesClassroom(id);
} else if (isStudent(id)) {
studentLeavesClassroom(id);
}
} | [
"async function isUserTeacher (req, res, next ) {\n var sessionRequest = req.sessionID;\n try {\n var x = await getUserType(sessionRequest);\n if(x.localeCompare('student') == 0){\n res.redirect('/user/studentdashboard'); //Students can't go to teacher urls, so redirect them back to t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
render all toy cards | function renderAllToyCards() {
toyCollectionDiv.innerHTML = ''
toysArr.forEach(toy => {
toyCollectionDiv.innerHTML += renderToyCard(toy)
})
} | [
"function renderAllCards(){\r\n tituloSecao.textContent = \"Todas as tarefas\"\r\n containerCards.innerHTML = \"\"\r\n callAPI(baseUrl + '/tasks', 'GET', renderCards)\r\n}",
"render() {\n\t\tfor (const card of this.cards) {\n\t\t\t// Create card element - card\n\t\t\tconst cardEl = document.createElement... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Methods & Helpers Finds all elements with breakpoints and watches them | query() {
const { htmlAttrBreakpoints, htmlAttrHeightBreakpoints } = this.opts
const attrs = [htmlAttrBreakpoints, htmlAttrHeightBreakpoints]
const elements = document.querySelectorAll(attrs.map(i => `[${i}]`).join(','))
for (const element of elements) {
try {
this.watch(element)
}... | [
"_registerElements() {\n const self = this;\n\n // Loop al defined breakpoints. Each time browser reaches one of them,\n // mediaQueryEvents will act and execute the new position of the\n // elements assigned to this breakpoint.\n Object.entries(this.opts.breakpoints).map(([k, v]) => {\n self.$w... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add advanced expressions to the history box | function addToHistoryAdv(){
if (!this.classList.contains("disabled")){
var newHistElt = document.createElement("div");
newHistElt.className = 'history-element';
newHistElt.innerHTML = advancedExpr;
newHistElt.addEventListener('click',function(){addHistExprToScreen(newHistElt.innerHTML)},false);
hist... | [
"function addToHistoryBasic(){\n\tvar inputScreen = document.querySelector('.screen');\n\tvar expression = inputScreen.innerHTML;\n\tvar newHistElt = document.createElement(\"div\");\n\tnewHistElt.className = 'history-element';\n newHistElt.innerHTML = expression;\n newHistElt.addEventListener('click',functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given two perimeter points, traces the shortest valid path between them (stays on perimeter). Returns a list of intermediate points on that path (if any). On further consideration, this could be redone using Dijsktra's algorithm, I believe, but this works and is, I believe, reasonably efficient. | tracePerimeter(p1, p2, includeOriginalPoints=false) {
let points
if ((p1.x === p2.x && Math.abs(p1.x) === this.sizeX) || (p1.y === p2.y && (Math.abs(p1.y) === this.sizeY))) {
// on the same line; no connecting points needed
points = []
} else {
// horizontal or vertical orientation; some ... | [
"minimizePerimeterMoves(segments) {\n let walked = []\n let current = segments.shift()\n let currentIndex\n let lastSegment\n\n if (segments.length > 0) {\n // reserve the last segment to ensure we don't draw an invalid line connecting\n // to it\n lastSegment = segments.pop()\n }\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Configuration for a data folder | function getDataFolderConfig(amdConfig, sourceFolder) {
// Where to find locale-data
amdConfig.baseUrl = JS_SOURCE_DIR + '/' + sourceFolder;
// Where to put locale-data
amdConfig.dir = path.join(global.buildDir, 'js', sourceFolder);
return amdConfig;
} | [
"createDataDirectory() {\n const dir = `./${this.config.directory}`;\n\n if (!fs.existsSync(dir)){\n fs.mkdirSync(dir);\n }\n }",
"dataPath() {\n return this.config(\"paths.data\");\n }",
"function makeDataDir() {\n if (!fs.existsSync(\"data\")) {\n fs.mkdirSync(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
END FUNCTION isDiscover() / ================================================================ FUNCTION: isEnRoute() INPUT: cc a string representing a credit card number RETURNS: true, if the credit card number is a valid enRoute card number. false, otherwise Sample number: 201400000000009 (15 digits) ===================... | function isEnRoute(cc)
{
first4digs = cc.substring(0,4);
if ((cc.length == 15) &&
((first4digs == "2014") ||
(first4digs == "2149")))
return isCreditCard(cc);
return false;
} | [
"function isDiscover(cc)\r\n{\r\n first4digs = cc.substring(0,4);\r\n if ((cc.length == 16) && (first4digs == \"6011\"))\r\n return isCreditCard(cc);\r\n return false;\r\n\r\n}",
"function isDinersClub(cc)\r\n{\r\n firstdig = cc.substring(0,1);\r\n seconddig = cc.substring(1,2);\r\n if ((cc.length == 14)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::Kendra::DataSource.ConfluencePageConfiguration` resource | function cfnDataSourceConfluencePageConfigurationPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnDataSource_ConfluencePageConfigurationPropertyValidator(properties).assertSuccess();
return {
PageFieldMappings: cdk.listMapper(cfnDataSource... | [
"function cfnDataSourceConfluenceConfigurationPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnDataSource_ConfluenceConfigurationPropertyValidator(properties).assertSuccess();\n return {\n AttachmentConfiguration: cfnDataSourceConflu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function resets options background color after you answer a question. | function resetOptionBackground() {
const options = document.getElementsByName("option");
options.forEach((option) => {
document.getElementById(option.labels[0].id).style.backgroundColor = "";
});
} | [
"function resetOptionBackground() {\n const options = document.getElementsByName(\"option\");\n options.forEach((option) => {\n document.getElementById(option.labels[0].id).style.backgroundColor = \"\";\n });\n}",
"function resetOptionBackground() {\r\n const options = document.getElementsByName('option'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If skip is greater than one, average skip samples together and write them to the downsample buffer. If numChannels is greater than one, mix the channels together as we down sample. | function downSampleInput(
samples,
position,
skip)
{
var numSamples = Math.floor(maxRequired/skip);
var samplesPerValue = numChannels*skip;
var value;
position *= numChannels;
for(var i = 0; i < numSamples; i++) {
value = 0;
... | [
"deInterleave() {\n if (this.isInterleaved) {\n /** @type {!Array<!Array<number>>} */\n let finalSamples = [];\n for (let i=0; i < this.fmt.numChannels; i++) {\n finalSamples[i] = [];\n }\n /** @type {number} */\n let len = this... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Very simple, sets the background color and calls your state machine function | function draw() {
background(192);
// will call your state machine function
drawFunction();
} | [
"function draw() {\n background(255);\n\n //call state machine function\n drawFunction();\n}",
"function draw() {\n background(255);\n\n\n // will call your state machine function\n drawFunction();\n}",
"function draw() {\n background(50,150,150);\n\n // will call your state machine function\n drawFunc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FALTA: ELE TODO :'( POST/schedules | static async addSchedule(req, res) {} | [
"function createSchedule() {\n new Request(\"POST\", \"/schedules\",\n JSON.stringify(getScheduleFields()),\n getSchedules\n );\n}",
"function submitSchedule(schedule) {\n $.post(\"/api/schedules\", schedule, function() {\n window.location.href = \"/pillbox\";\n });\n }",
"runSchedule(schedu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all categories associated with this post in a nice format for posts Return: XMLList Object with comma seperated links to each Category | function get_categories_view() {
var cats = this.get_categories().map(function(obj) {
var str = '<a href="' + obj.getURI() + '">' + obj.title + '</a>';
return str.replace(/&(?!\w+;)/g, '&')
}).join(', ');
return this.categories != null ? new XMLList(cats) : '';
} | [
"extractCategories() {\r\n return Array.from(\r\n this._page.getElementById(\"catlinks\").getElementsByTagName(\"a\")\r\n ).map( link =>\r\n new Category(link.innerHTML, link.href)\r\n )\r\n }",
"async getAllCategories() {\n return await apiService.get('categor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a path relative to an ancestor. | relative(path, ancestor) {
if (!Path.isAncestor(ancestor, path) && !Path.equals(path, ancestor)) {
throw new Error("Cannot get the relative path of [".concat(path, "] inside ancestor [").concat(ancestor, "], because it is not above or equal to the path."));
}
return path.slice(ancestor.length);
} | [
"relative(path, ancestor) {\n if (!Path.isAncestor(ancestor, path) && !Path.equals(path, ancestor)) {\n throw new Error(\"Cannot get the relative path of [\".concat(path, \"] inside ancestor [\").concat(ancestor, \"], because it is not above or equal to the path.\"));\n }\n return path.slice(ancestor.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
method to retrieve single course | returnSingleCourse(course) {
this.log(`Getting single course...`);
this.log(course.id + '-- from courses database.js');
return this.context
.retrieveSingle(`
SELECT title, Users.firstName || " " || Users.lastName As user
FROM Courses
INNER JOIN Users
ON Course... | [
"retrieveCourse(id) {\r\n return this._call('get', `course/${id}`)\r\n }",
"getCourse(courseId) {\n return http.get(`/courses/${courseId}`);\n }",
"function singleGet(req, res) {\n if (true) {\n const courseID = req.params.course;\n Course.findOne({ _id: courseID }, (error, course) => {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Push the allowed scripts as json string to cookie | setConsentScriptsToCookie(cookieConsentScriptsArray) {
if(cookieConsentScriptsArray instanceof Map){
cookieConsentScriptsArray = Array.from(cookieConsentScriptsArray);
}
const expires = this.cookieExpireDate();
const json_string = JSON.stringify(cookieConsentScriptsArray);
... | [
"setCookieConsentScriptsArray(){\n\n let title;\n const json_data = this.cookieBannerScripts;\n\n if(json_data.length > 0 ){\n for(let i = 0; i < json_data.length; i++) {\n //get all scripts and activate them\n if(this.cookieConsent === \"allow\"){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine if the current browser is Google Chrome | function isChrome() {
return (window.chrome !== undefined);
} | [
"Chrome ():boolean {\n\n\t\treturn this.chrome = this.agent.match(/Chrome/i) ? true : false;\n\t}",
"function IsInChrome() {\n\tif (/Chrome[\\/\\s](\\d+\\.\\d+)/.test(navigator.userAgent))\n\t\treturn true;\n\treturn false;\n}",
"function checkIfIsChrome() {\n privateIsChrome = uaLowerCase.match(/(ch... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Moves the language up in the list. | onMoveUpClick_() {
/** @type {!CrActionMenuElement} */ (this.$.menu.get()).close();
this.languageHelper.moveLanguage(
this.detailLanguage_.state.language.code, /*upDirection=*/ true);
settings.recordSettingChange();
} | [
"function menuLangUp(event){\n\tvar target = event.target || event.srcElement;\n\t\n\tif(!event.which && event.button){ // Firefox, Chrome, etc...\n\t\tvar button = event.button;\n\t}else{ // MSIE\n\t\tvar button = event.which;\n\t}\t\n\t\n\tif(button == 1 && (target == app.BTN_LANG_MENU || util.hasParent(target, a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
xTableIterate, Copyright 20042007 Michael Foster (CrossBrowser.com) Part of X, a CrossBrowser Javascript Library, Distributed under the terms of the GNU LGPL | function xTableIterate(sec, fnCallback, data)
{
var r, c;
sec = xGetElementById(sec);
if (!sec || !fnCallback) { return; }
for (r = 0; r < sec.rows.length; ++r) {
if (false == fnCallback(sec.rows[r], true, r, c, data)) { return; }
for (c = 0; c < sec.rows[r].cells.length; ++c) {
if (false ... | [
"function xTableIterate(sec, fnCallback, data)\n{\n var r, c;\n sec = xGetElementById(sec);\n if (!sec || !fnCallback) { return; }\n for (r = 0; r < sec.rows.length; ++r) {\n if (false == fnCallback(sec.rows[r], true, r, c, data)) { return; }\n for (c = 0; c < sec.rows[r].cells.length; ++c) {\n if (f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
To unwire events attached to the MaskedTextBox. | function unwireEvents() {
_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'keydown', maskInputKeyDownHandler);
_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'keypress', maskInputKeyPressHandler);
_syncfusion_ej2_base__WEBPACK_IM... | [
"function unwireEvents() {\n EventHandler.remove(this.element, 'keydown', maskInputKeyDownHandler);\n EventHandler.remove(this.element, 'keypress', maskInputKeyPressHandler);\n EventHandler.remove(this.element, 'keyup', maskInputKeyUpHandler);\n EventHandler.remove(this.element, 'input', maskInputHandle... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes in 's' seconds remaining and 'backup' seconds after midnight If s < 3600, convert to minutes and return as "00 min" Else, returns SecondsToClockTime (backup) | function FormatSeconds(s, backup) {
if (s < 0) {
return "Now"
} else if (s < 45) {
return "<1 min"
} else if (s < 3600) {
// Round seconds such that 90 seconds returns 1 min, 91-150 returns 2 min, ...
return ((Math.floor((s + 29.5) / 60)).toString() + " min")
} else {
... | [
"function secondsToTime(s) {\n return {\n s : zeroFill(s % 60),\n m : zeroFill(Math.floor(s / 60) % 60),\n h : zeroFill(Math.floor(s / 3600))\n };\n }",
"function timeConverter(s) {\n\n\tvar min = Math.floor(s/60);\n\tvar sec = s % 60;\n\tif (sec < 10) {\n\t\tsec = \"0\" + sec;\n\t}\n\tif (m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check whether this node should become a leader. If the node has not received a heartbeat for over the `timeout` threshold, become a candidate. | function checkPulse(){
var heartbeat = this.node.heartbeat();
var stale = Date.now() - this.timeout > heartbeat;
if (stale) this.emit('change', 'candidate');
} | [
"checkHeartbeat() {\n let delta = new Date().getTime() - this.last_hb_time;\n if (delta >= this.options.heartbeat_timeout){\n // haven't heard from the elected, force an election\n debug('leader had died. starting new election', 'delta:', delta, 'last:', this.last_hb_time)\n this.start_election... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the server status badge to either online or offline. | function set_badge(on) {
$('#server_status_badge').removeClass();
$('#server_status_badge').addClass('badge');
$('#server_status_badge').addClass('badge-pill');
if (on) {
$('#server_status_badge').addClass('badge-success');
$('#server_status_badge').text('Online');
// Now that it's online, enable t... | [
"function onOffline()\n {\n onlineStatus = '<b>offline</b>';\n }",
"setServerStatus(status) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\n this.serverStatus = status;\n this.ipcService.sendMessage(\"serverStatusUpdate\" /* SERVER_STATUS_UPDATE */, {\n status: this.serverStatus,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create array of ProjectDef objects for build locales (one object for each locale) nlsDir folder containing locale source files | function projectCreateLocaleDefs(nlsDir)
{
nlsDir = ReplaceMacros(nlsDir, cmnMacros);
if (typeof(this.arrLocales) == "undefined")
ProjectDef.prototype.arrLocales = initLocalesList(nlsDir);
var projectDefs = new Array();
for (var i = 0; i < this.arrLocales.length; ++i)
{
... | [
"function projectCreateTestLocalesDef(nlsDir)\r\n{\r\n nlsDir = ReplaceMacros(nlsDir, cmnMacros);\r\n\r\n if (typeof(this.arrLocales) == \"undefined\")\r\n ProjectDef.prototype.arrLocales = initLocalesList(nlsDir);\r\n \r\n var bindir = \"$(SolutionDir)%CONFIG%\\\\bin\";\r\n var test = \"s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Purpose: This function is used in select all scenario. Even if one of the checkbox is unchecked than the select all checkbox should also be unchecked. Parameters: obj This is the checkbox object which is used for select all facility. formName This is the name of the form which contains the select all check box. fieldNa... | function CHMtestCheckAll(obj, formName, fieldName)
{
changeStatus(formName,obj.name,obj);
if(obj.checked == false)
eval('document.'+formName+'.'+fieldName).checked=false;
return;
} | [
"function select_all_checkbox(f, objname) {\n for (i = 0; i < f.length; i++) {\n var e = f.elements[i];\n if (e.name == objname && !e.disabled) {\n f.elements[i].checked = true;\n }\n }\n return true;\n}",
"function checkAll() {\n\tvar args\t= checkAll.arguments;\n\tif (ar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get paragraph format in cell | getParagraphFormatInCell(cell) {
for (let i = 0; i < cell.childWidgets.length; i++) {
this.getParagraphFormatInBlock(cell.childWidgets[i]);
}
} | [
"function ParagraphTemplate(){\n const pTemplate = \"Lab 8 July 15\";\n return(pTemplate)\n}",
"getParagraphFormatInternalInCell(cellAdv, start, end) {\n if (end.paragraph.isInsideTable) {\n let containerCell = this.getContainerCellOf(cellAdv, end.paragraph.associatedCell);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns a subset of the label array based on the uri provided, stored in the array as 'Feature' | function selectLabels(selectval){
var matches = $.grep(alllabelsarray, function(e) {
return e.Feature.value == selectval
});
return matches;
} | [
"function findMatches(img_name, feature, nd) {\n\tvar matches = [];\n\tfor (i = 0; i < nd.length; i++) {\n\t\tif (img_name === nd[i][3] && feature !== nd[i][0]) {\n\t\t\tmatches.push(nd[i]);\n\t\t}\n\t}\n\treturn matches;\n}",
"getFeaturesByLayerStartsWith(features, startsWith) {\n let matchedFeatures = featur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
takes an index (typically the one from priority pop), a queue, and a token resolution it will go to the token left of the passed index & update the various fields of that token to match the passed one and then it removes the index & index+1 token. Efefctively replacing the operated tokens with their resolution | function resolveQueue(index, queue, resolution, prefixLength, suffixLength){
queue[index].token.id = resolution.result; //update value in the queue
queue[index].token.type = resolution.type; // update type
queue[index].priority = -1; //after any operation it should not be replaced with another operatio... | [
"function fixQueue(queue)\n {\n var workStack;\n var tok1;\n var tok2;\n\n workStack= [];\n queue.forEach(function (tokObj)\n {\n switch (tokObj.type)\n {\n case TOK_TYPE.OPERAND:\n case TOK_TYPE.TAG:\n case TOK_TYPE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to toggle the scroll map | function toggleScrollMap() {
scrollMap.canvas.style.setProperty('display', this.checked ? 'block' : 'none');
} | [
"function toggles() {\n $('#table-toggle').click(function(){\n $('tbody').toggle();\n $('.dataTables_scrollBody').toggle();\n });\n $('#map-toggle').click(function(){\n $('#map').toggle();\n // updates isTheMapVisible and re-loads the map \n if (isTheMapVisible) {\n // map i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
funcion para rotar las figuras o el texto | function rotarFigura() {
ctx.rotate(0.17);
ctx.restore(); //dibuja la figura
} | [
"function rotatingText() {\n $('#intro .rotate').textrotator({\n animation: 'fade',\n speed: 3000\n });\n}",
"function rotatingText() {\r\n\r\n $(\"#intro .rotate\").textrotator({\r\n animation: \"fade\",\r\n speed: 3000\r\n });\r\n}",
"function rotateText(start, end) {\n return (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a byte to a port, taking as many clock cycles as necessary. | writePort(address, value) {
this.incTStateCount(1);
this.hal.writePort(address, value);
this.incTStateCount(3);
} | [
"write_byte(byte) {\n this.ensure(1);\n this.buffer[this.pos++] = byte;\n }",
"writeByte(byte) {\n this.ensure(1);\n this.buffer[this.pos++] = byte;\n }",
"async function write(data){\n await _serialport.write(data);\n await _serialport.drain();\n}",
"write(b) {\n this.ensureCap... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sort all the bubbles from historical | function sortHistoricalBubblesBySize() {
for (var prop in HistoricalMap)
HistoricalMap[prop].sort(sortBubblesSize);
} | [
"function BubbleSort() {}",
"function myBubbleSort(){\n for (var i = bars.length-1; i >= 1; i--){\n\t \t/* for loop that checks if the blue value of each bar is in order\n\t\t** and swaps them if they are not */\n for (var j = 0; j < bars.length; j++){\n if (clrBlue[j] > clrBlue[j+1]){\n var temp =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render our tree menu link and attach actions | render() {
return _react.default.createElement(TreeMenuLinkStyle, _extends({}, this.props, {
selected: this.props.selected
}), this.props.children);
} | [
"function render(self) {\n var container = document.getElementById(self.node),\n leaves = [],\n click = function(e) {\n e = e || window.event;\n //var parent = (e.target || e.currentTarget || e.srcElement).p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CREATION DE L'OBJET Corps | function Corps()
{
this.body = window.document.querySelector('body');
this.corps = window.document.createElement('div');
this.corps.setAttribute('id', 'corps');
//specification de style
defineStyle.Corps(this.corps);
//ajout du crédit image
this.corps.appendChild((new PCreditImage()).getElement());
... | [
"function Ordenes(){ }",
"function crear_tren(){\n var tren = new Objeto3D(null,null,null);\n var barra_1 = crear_tren_soporte();\n barra_1.set_color([0.1,0.1,0.1]);\n var barra_2 = crear_tren_soporte();\n barra_2.set_color([0.1,0.1,0.1]);\n var base = crear_tren_base();\n base.set_color([0.1... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
import UnityEngine import System.Collections class ComponentInChildrenCall(MonoBehaviour): def Start(): someScript as ExampleScript = GetComponentInChildren[of ExampleScript]() anotherScript as AnotherExampleScript = transform.GetComponentInChildren[of AnotherExampleScript]() someScript.DoSomething() You can access scr... | function Start () {
var someScript : ExampleScript = GetComponentInChildren(ExampleScript);
var anotherScript : AnotherExampleScript = transform.GetComponentInChildren(AnotherExampleScript);
someScript.DoSomething ();
} | [
"function Start () {\n var foo : MyScript = GetComponent(MyScript);\n foo.DoSomething();\n}",
"function Awake(){\n\t// assign reference\n\t//refChemBond = objEncyclopedia.GetComponent(ChemBond);\n\t//refValenceShells = objEncyclopedia.GetComponent(zValenceShells);\n}",
"function Start(){\n\t//miss... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
BlumBlum Shub (BBS) PRNG, allow to get nth number, without rotate PRNG, and generate all previous numbers, to skip it. seed is (x0, M, lambdaM), n Nth value from PRNG, bits need to specify number of bits, to generate seed, if this was been undefined. | function BBSBigInteger(
bits, //(string, number, or BigInteger) - If need to generate random p, and q with specified bitlength
n, //(string, number, or BigInteger) - N-th number
seed //JSON-object with PRNG-seed: - {'x0': x0, 'M': M, 'lambdaM': lambdaM}
)
{ //n-th number from BBS PRNG, without calcul... | [
"function rand() {\na=1103515245;\nb=12345;\nm=Math.pow(2,32);\nseed=(a*seed+b)%m;\n}",
"function rnd() \n{\n\t\t\n rnd.seed = (rnd.seed*9301+49297) % 233280;\n return rnd.seed/(233280.0);\n}",
"function randSeed() {\n return Math.floor(65536 * Math.random());\n}",
"function randomNBit(n) {\n return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
.end of tycheesOverlay_startLongProgress Hide long progress message. | function tycheesOverlay_stopLongProgress() {
$('#console_longProgress .bg').height('100%');
$('#console_longProgress').fadeOut(300);
$('body').css('cursor', 'default');
tychees_common_longProgressState_showing = false;
} | [
"function tycheesOverlay_stopShortProgress() {\n\t$('#console_shortProgress .bg').height('100%');\n\t$('#console_shortProgress').fadeOut(300);\n\t$('body').css('cursor', 'default');\n\n\ttychees_common_overlay_shortProgress_showing = false;\n}",
"function delayed_hide_progress()\n{\n\tsetup_hide_content('progress... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return the restriction input values | function getRestrictionValues(quantDec,quantRes){
var resValues = [];
var xvalue = [];
for (let i = 1; i <= quantRes; i++ ){
xvalue = [];
for (let j = 1; j <= quantDec; j++ ) {
var input = $("input[name='X"+j+"_res"+i+"']").val();
if(input.length == 0) {
xvalue[j-1] = 0;
} else {
xvalue... | [
"function getSelectionRestrictions() {\n if (!selectionRestictions) {\n selectionRestictions = {};\n var attrArr = $attrs.restrictSelection ? $attrs.restrictSelection.split(',').map(function (item) { return item.trim(); }) : [];\n attrArr.forEach(function (key) {\n selectionRestic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Instead of using object values, entering parameters will allow you to overlap the initially created canvas with other maps and tilesets, allowing you to generate a layered image. map: 2d array of numbers, each refering to a tile in the tileset. tileset: Tileset object skip: Array of numbers. if a number from the map is... | buildImage(map, tileset, skip=[]){
for(var y=0; y<map.length; y++){
for(var x=0; x<map[y].length; x++){
if(skip.indexOf(map[y][x]) === -1){
var tile = tileset.getTile(map[y][x]);
this.ctx.drawImage(tile, x*tileset.tileW, y*tileset.tileH, tiles... | [
"function drawTiles(){\n for(var i=0;i<worldmap.length;i++){\n var row = worldmap[i];\n for(var j=0;j<row.length;j++){\n var tile = row[j],\n tilex = tile.slice(0,2),\n tiley = tile.slice(2);\n if(tile){ \n context.drawImage(\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `LabelMatchStatementProperty` | function CfnWebACL_LabelMatchStatementPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but rec... | [
"function CfnRuleGroup_LabelMatchStatementPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mostra o gerente da Unidade | function mostrarGerenteUnidade(){
var unidade = DWRUtil.getValue("comboUnidade");
FacadeAjax.getGerenteUnidade(unidade, function(tecnico){
DWRUtil.setValue("nomeGerenteUnidade",tecnico.nome);
});
} | [
"function Unidade() {\n\tthis.unidades = {}\n}",
"function cadastrarUmaUnidade(){\n\tvar unidadeSelecionadaBDTRE = DWRUtil.getValue(\"comboUnidadeTRE\"); \n\tif(unidadeSelecionadaBDTRE==null || unidadeSelecionadaBDTRE==''){\n\t\talert(\"Selecione uma unidade a ser cadastrada.\");\n\t}else{\n\t\tvar loginGerente =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
= encode base64 digit from decimal | function decimal_encode_base64(decimal){
if(decimal < 26){
return String.fromCharCode("A".charCodeAt(0) + decimal);
}
if(decimal < 52){
return String.fromCharCode("a".charCodeAt(0) + decimal - 26);
}
if(decimal < 62){
return (decimal - 52) + "";
}
if( decimal == 62){
return "+";
}
return "/";
} | [
"Base64Encode() {}",
"static tripletToBase64(num) {\r\n return (Base64._LOOKUP[(num >> 18) & 0x3f] +\r\n Base64._LOOKUP[(num >> 12) & 0x3f] +\r\n Base64._LOOKUP[(num >> 6) & 0x3f] +\r\n Base64._LOOKUP[num & 0x3f]);\r\n }",
"static tripletToBase64(nu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
used to change gevent class and add selected to task list | function g_task_selector(){
let g_event_list = cn("gevent");
for (let i = 0; i<g_event_list.length; i++){
g_event_list[i].addEventListener("click",function(){
/*add or removes gevent-click class*/
g_event_list[i].classList.toggle("gevent-click");
/* if the element no ... | [
"function addClassSelected(event) {\n const colorLegendDivTarget = event.target;\n const span = document.querySelector('span');\n const dayListItem = document.querySelectorAll('#days li');\n\n colorLegendDivTarget.classList.add('task');\n colorLegendDivTarget.classList.toggle('selected');\n span.classList.tog... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
View roles by department | async function viewRolesByDepartment() {
try {
const department_id = (await chooseDepartment("view roles in")).department.department_id;
if (!department_id) throw "There aren't any departments yet";
const roles = await connection.queryPromise("SELECT role_id AS ID, title AS Title, salary AS ... | [
"function viewRoles(){\n connection.query(\"SELECT r.title, d.department, r.salary FROM role r INNER JOIN department d ON r.department_id = d.id ORDER BY r.title;\", function(err, data){\n if(err) throw err;\n console.table(data);\n mainMenu();\n });\n}",
"async viewRoles() {\n await orm.leftJoi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Digest the scope when the window resizes. | function handleResize() {
safeDigest($scope);
} | [
"function onWindowResize() {\n updateSizes();\n }",
"onWindowResize() {\n\t\tthis.windowHeight = this.getWindowHeight();\n\t\tthis.updatePosition();\n\t}",
"function windowResized(){\r\n}",
"function broadcastWindowResizeEvent() {\n console.log(\"Sending resized event\");\n $scope.$b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The purpose of the changeColor function is to toggle the background color of the active cell between black and white. | function changeColor()
{
(this.style.backgroundColor == "black") ? this.style.backgroundColor = "white" : this.style.backgroundColor = "black";
} | [
"function changeToYellow(){\n activeCell.style.background = \"yellow\";\n}",
"function changeCellColor() {\r\n \t// get current color of clicked cell\r\n\tcurrent_color = this.style.backgroundColor; \r\n\t// assign new color value from input to variable\r\n\tnew_color = hexToRGB(document.getElementById(\"co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Basing on video width and total ad width compute width (in %) of overlay to make it responsive. offsetWidth won't work in case video container is hidden. | function getOverlayWidth(params) {
var adWidth = params.container.offsetWidth,
videoWidth = params.hideWhenPlaying.offsetWidth;
return 100 * videoWidth / adWidth + '%';
} | [
"_getOverlayWidth() {\n const refToMeasure = this._preferredOverlayOrigin instanceof _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_2__.CdkOverlayOrigin ? this._preferredOverlayOrigin.elementRef : this._preferredOverlayOrigin || this._elementRef;\n return refToMeasure.nativeElement.getBoundingClientRect().widt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Broadcasts "$stateChangePermissionAccepted" event from $rootScope | function broadcastPermissionAcceptedEvent() {
$rootScope.$broadcast(TransitionEventNames.permissionAccepted,
TransitionProperties.toState, TransitionProperties.toParams,
TransitionProperties.options);
} | [
"function broadcastPermissionAcceptedEvent() {\n $rootScope.$broadcast(TransitionEventNames.permissionAccepted,\n TransitionProperties.toState, TransitionProperties.toParams,\n TransitionProperties.options);\n }",
"function broadcastPermissionAcceptedEvent() {\n $rootScope.$broadcast(Transition... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns serialized state for readonly access only. You shouldn't modify this object because it will mess up the replay_history! | function getSerializedState() {
return ss;
} | [
"serialize() {\n const serializedState = this.controller.serialize();\n if (this.debugSerialization) { console.log(serializedState); }\n return serializedState;\n }",
"getSavedState(){\n\t\tlet rawData = cache.get('state');\n\t\tlet state = {};\n\n\t\ttry{\n\t\t\tstate = JSON.parse(rawData... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
calculate visible port to display calender | function getVisibleViewPort(elementRect, bodyRect){
var calenderHeight = 460;
var calenderWidth = 296;
var top =elementRect.top;
if(elementRect.top +calenderHeight > bodyRect.bottom){
top = elementRect.top - ((elementRect.top +calender... | [
"function getVisibleViewPort(elementRect, bodyRect) {\n var calenderHeight = 460;\n var calenderWidth = 296;\n\n var top = elementRect.top;\n if (elementRect.top + calenderHeight > bodyRect.bottom) {\n top = elementRe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate the HMACSHA1 of a key and some data (raw strings) | function rstr_hmac_sha1(key, data) {
var bkey = rstr2binb(key);
if (bkey.length > 16) bkey = binb_sha1(bkey, key.length * 8);
var ipad = Array(16),
opad = Array(16);
for (var i = 0; i < 16; i++) {
ipad[i] = bkey[i] ^ 0x36363636;
opad[i] = bkey[i] ^ 0x5C5C5C5C;
}
var hash = binb_sha1(ipad.con... | [
"function rstr_hmac_sha1(key, data) {\r\n var bkey = rstr2binb(key)\r\n if (bkey.length > 16) bkey = binb_sha1(bkey, key.length * 8)\r\n\r\n var ipad = Array(16),\r\n opad = Array(16)\r\n for (var i = 0; i < 16; i++) {\r\n ipad[i] = bkey[i] ^ 0x36363636\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function for when appt starts gets difference between the started time, which is established on the first trigger, and the end time, which is established on the second trigger. Additional functionality could, and should, be implemented, such as returning duration and using the result to store the appt duration in the d... | StartAppt(s){
if(!s){
this.started = new Date()
} else {
let duration = this.secondsToTime((new Date().getTime() - this.started.getTime()) / 1000)
console.log("HOUR: " + duration.h + " MIN: " + duration.m + " SEC: " + duration.s)
}
} | [
"function calculateDuration(){return endTime-startTime;}",
"function calculateDuration() {\nreturn endTime - startTime;\n}",
"function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}",
"function get_schedule_duration( start_time, end_time){\n // The diference between Dates are given in millis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Entry function to trigger custom Duplicate Merge process. This function will access "AX:Duplicate Merge Stage" custom record and execute scripted duplicate merge process. Status of each submitted merge can be viewed on Duplicate Resolution page (List > Mass Update > Duplicate Resolution Status | function processCustomDupMerge() {
//Search for Unprocessed Stage Records
var dflt = [new nlobjSearchFilter('isinactive', null, 'is', 'F'),
new nlobjSearchFilter('custrecord_dms_jobid', null, 'isempty','')];
var dcol = [new nlobjSearchColumn('custrecord_dms_masterid', null,'group').setSort(true... | [
"function processDuplicates() {\r\n\tnlapiLogExecution('AUDIT','FLO Start','processDuplicates');\r\n\t\r\n\tvar context = nlapiGetContext();\r\n\tvar s = nlapiLoadSearch('customrecord_flo_customization', 'customsearch_flo_duplicate_cust_script');\r\n\tvar res = s.runSearch();\r\n\tvar set=res.getResults(0,1000);\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Public: Fill in a `TextInput`compatible component with a string value. Your component should respond to the property `onChangeText`. identifier Identifier for the component. str String to fill in. Returns a promise, use await when calling this function. Promise will be rejected if the component is not found. | async fillIn(identifier, str) {
const component = await this.findComponent(identifier);
component.props.onChangeText(str);
} | [
"async enterText(value) {\n value = typeof value === 'undefined' ? await RandomUtils.generateRandomString() : value;\n await this.stringField.enterText(value);\n this.inputValue = value;\n if (this.checkYourAnswersValue === null) {\n this.checkYourAnswersValue = value;\n }\n this.label = awai... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reorders the given layers in the layer list based on their position in the array. If they're in different containing groups, reorders locally within that group. | function reorderLayers(layers) {
// rearrange in layer list
var indexesInParents = {};
layers.forEach(function (layer, index) {
var parent = layer.parentGroup();
var parentId = String(parent.objectID());
if (!(parentId in indexesInParents)) {
var siblings = arrayFromNSArray(parent.layers());
... | [
"function orderLayers() {\n\t\t$.each(groups, function(none, group) {\n\t\t\tmap.removeLayer(group);\n\t\t\tmap.addLayer(group);\n\t\t});\n }",
"function layerReordering(){\n\tif(isDown){return;}\n\t//$('#layers .layer-row').each(function(){\n var activepage = jQuery('.page-row.g-active').attr('id');\n var t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Define a function submitIt that does not accept a parameter. The function should bind a submit event to the form that alerts "Your form is going to be submitted now.". | function submitIt()
{
$('form').on("submit",function(){
window.alert('Your form is going to be submitted now.')
});
} | [
"function submitIt() {\n$(\"form\").on(\"submit\", function() {\n alert('Your form is going to be submitted now.');\n return;\n});\n}",
"Submit(func)\r\n\t{\r\n\t\tif(func !== undefined)\r\n\t\t\tthis.AddListener(\"submit\", func);\r\n\t\telse\r\n\t\t\tthis.Element().submit();\r\n\t}",
"function submitForm(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
domain = dotatom / domainliteral / obsdomain | function domain() {
return wrap('domain', function domainCheckTLD() {
var result = or(obsDomain, dotAtom, domainLiteral)();
if (opts.rejectTLD) {
if (result.semantic.indexOf('.') < 0) {
return null;
}
}
// strip ... | [
"function domain() {\n return wrap('domain', function domainCheckTLD() {\n var result = or(obsDomain, dotAtom, domainLiteral)();\n if (opts.rejectTLD) {\n if (result && result.semantic && result.semantic.indexOf('.') < 0) {\n return null;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Code // Joining a list of names and values into a JSON object containing all of the pairs by name. | function joinJSON(jsons) {
var ret = {};
for (var i = 0; i < jsons.length; i++)
ret[jsons[i].name] = jsons[i].value;
return ret;
} | [
"function encode_list(vals) {\n\n var v, vs = [];\n _.each(vals, function(v) {\n v = v.replace(/\"/g, '\\\"');\n v = v.replace(/}/g, '\\}');\n vs.push('\"'+v+'\"');\n });\n\n return \"{\"+vs.join(',')+\"}\";\n }",
"function list(names){\n var output... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
changes featured person when previous or next button is clicked | function changeOnButtonClicks() {
$("#prev-button").on("click", function() {
var personIndex = currentFeaturedPerson.findPrevPerson();
changeToPerson(personIndex);
});
$("#next-button").on("click", function() {
var personIndex = currentFeaturedPerson.findNextPerson();
changeToPerson(personIndex);
... | [
"function prevButton() {\n $('#person').fadeOut('fast');\n if(i > 0) {\n i = prev; //if/else checks if you are at the end of the carousel, and if so jumps to the other end.\n var person = data.people[i];\n stagePerson(person);\n console.log(i);\n next = i ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enable steps 2 and 3 in plus menu | function enableSteps() {
$("#plusButtons").css("opacity",1);
$("#plusSwish").css("opacity",1);
$("#step2").css("opacity",1);
$("#step3").css("opacity",1);
$("#plusButtons span.button").css("cursor","pointer");
$("swish-QR").removeAttr("src");
} | [
"function enableAddingMenuItem() {\n enablePlusBtns();\n enableSaveBtn();\n}",
"function enableDroppingByPlusBtns() {\n}",
"function disableSteps() {\n $(\"#swish-button\").removeAttr(\"href\");\n $(\"#step2\").css(\"opacity\",0.5);\n $(\"#step3\").css(\"opacity\",0.5);\n $(\"#plusButtons\").css(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
10. Create a function, `objToObj`, that takes in an object with only property values of a string type and returns another object with a single property called 'all' with a value of all input object properties values concatenated together. Please note that the order of object properties is uncertain and concatenating th... | function objToObj(obj) {
let result = "";
for (let key in obj) {
result = result + obj[key];
}
return {all: result};
} | [
"function convertAllValuesToStrings(obj) {\n let result = {};\n for (var property in obj) {\n // Only grab non-object child properties.\n if (obj.hasOwnProperty(property) && typeof obj[property] !== 'object' && obj[property] !== null) {\n let va... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Output help information and exit. Display for error situations. | _helpAndError() {
this.outputHelp();
// message: do not have all displayed text available so only passing placeholder.
this._exit(1, 'commander.help', '(outputHelp)');
} | [
"function showHelp() {\n // eslint-disable-next-line no-console\n console.log(generateOutput(parsed, opts.help));\n process.exit(0);\n }",
"function help () {\n console.log(getHelp())\n process.exit(1)\n}",
"function help () {\n console.log(getHelp())\n process.exit(0)\n}",
"function printHelp()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
convert number to "hh:mm" format, used to control endTime.Timepicker >= startTime.value (Note: 1 hour = 3600) | function toTimeFormat(num) {
const hours = Math.floor(num / 3600);
const minutes = (num % 3600) / 60;
return hours + ":" + minutes;
} | [
"function hms_string(input)\n{\n var hours = Math.floor(input / 3600);\n input = input % 3600;\n if(hours < 10)\n hours = \"0\" + hours;\n\n var minutes = Math.floor(input / 60);\n if(minutes < 10)\n minutes = \"0\" + minutes;\n input = input % 60;\n\n return hours + \":\" + minutes;\n}",
"function t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PROTECTED Allocates the current selection by setting the top, left, width and height of the rectangle. | function allocateSelection() {
document.getElementById(SELECTION).style.left = this.getOriginX();
document.getElementById(SELECTION).style.top = this.getOriginY();
document.getElementById(SELECTION).style.width = this.getFinalX();
document.getElementById(SELECTION).style.height = this.getFinalY();
} | [
"function createSelectionRect() {\r\n selectionRect = that.surface.createRect({\r\n x: that.width, y: that.height, \r\n width: 1, height: 1}).\r\n setFill(\"yellow\");\r\n }",
"function Selection(top, left, width, height) {\n this.el = document.createElement('div');\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PRIVATE: last Y coordiante of a touch add a click to the gcb_clickPointX/Y array. if nopop is specified, no timeout is set to clear the click. | function gcb_addClick ( x, y, nopop )
{
gcb_clickPointX.push (x);
gcb_clickPointY.push (y);
if (!nopop)
{
setTimeout (gcb_popClick, 5000);
}
} | [
"function gcb_popClick ()\r\n{\r\n gcb_clickPointX.splice(0,1);\r\n gcb_clickPointY.splice(0,1);\r\n}",
"function clickInPosition(x, y) {\n //putPixel(x, y);\n var newCoord = new Coordinate(x, y);\n coordinates.push(newCoord);\n clickCounter++;\n}",
"function gcb_ignoreClick (x, y, nopop, noad... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns a new QueryPreparationTimes instance that is the addition of this and the arguments. | add(...queryPreparationTimesArray) {
if (arguments == null || arguments.length === 0) {
throw new Error("arguments was null or empty");
}
let queryCompilationTime = this.queryCompilationTime;
let logicalPlanBuildTime = this.logicalPlanBuildTime;
let physicalPlanBuildT... | [
"static createFromArray(queryPreparationTimesArray) {\n if (queryPreparationTimesArray == null) {\n throw new Error(\"queryPreparationTimesArray is null or undefined item(s)\");\n }\n return QueryPreparationTimes.zero.add(...queryPreparationTimesArray);\n }",
"withTimestamps () ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
baby Zenomporph creating the function to draw the baby zenomorph | function drawBabyzenomorph(x, y) {
fill('grey')
stroke('grey')
strokeWeight(5)
ellipse(x, y, w)
ellipse(x, y - 20, w + 5, 25)
beginShape(LINES);
vertex(x, y);
vertex(x - 25, y - 25);
vertex(x - 25, y - 25);
vertex(x - 20, y - 35)
endShape();
beginShape(LINES);
verte... | [
"drawUmbilic() {\n if (this.family != null) {\n var dH = this.getY() - this.family.getMiddleY(); // <- height between this PersonFrame and Wedding. \n var vidX = this.family.getMiddleX();\n var vidY = this.family.getMiddleY();\n\n ctx.beginPath();\n ctx.lineWidth = \"1\";\n\n ctx.mo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Turns a Dynamic Sampling Object into a baggage header by prefixing all the keys on the object with "sentry". | function dynamicSamplingContextToSentryBaggageHeader(
// this also takes undefined for convenience and bundle size in other places
dynamicSamplingContext,
) {
// Prefix all DSC keys with "sentry-" and put them into a new object
const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce(
(... | [
"function dynamicSamplingContextToSentryBaggageHeader(\n // this also takes undefined for convenience and bundle size in other places\n dynamicSamplingContext,\n ) {\n // Prefix all DSC keys with \"sentry-\" and put them into a new object\n const sentryPrefixedDSC = Object.entries(dynamicSamplingContex... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets or sets the DefaultAxisMajorStroke property. The DefaultAxisMajorStroke property defines the brush which is used by the axes when no Axis.MajorStroke is set. | get defaultAxisMajorStroke() {
return brushToString(this.i.pz);
} | [
"get defaultAxisMinorStroke() {\n return brushToString(this.i.p0);\n }",
"get defaultAxisStroke() {\n return brushToString(this.i.p1);\n }",
"get zoomSliderXAxisMajorStroke() {\n return brushToString(this.i.xn);\n }",
"get minorTickStrokeThickness() {\n return this.i.b4;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is meant to be called immediately after a message or summary load is started. | onLoadStarted() {
this.messageLoading = true;
this.messageLoaded = false;
} | [
"function callUponMessageLoading() {\n FGMessageLoading(appendMessageToParent);\n nbrOfLoadingMessages++;\n }",
"onLoadCompleted() {\n window.dispatchEvent(new CustomEvent(\"MsgsLoaded\"));\n this.messageLoading = false;\n this.messageLoaded = true;\n\n // This is an echo of what is done in `On... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Causes a reconnection to the gateway. | reconnect() {
this.debug('Attemping to reconnect in 5500ms...');
/**
* Emitted whenever the client tries to reconnect to the WebSocket.
* @event Client#reconnecting
*/
this.client.emit(Constants.Events.RECONNECTING);
this.connect(this.gateway, 5500, true);
} | [
"attemptReconnection(reconnectionAttempt = 1) {\n const reconnectionAttempts = this.options.reconnectionAttempts || 3;\n const reconnectionDelay = this.options.reconnectionDelay || 4;\n if (!this.connectRequested) {\n this.logger.log(`[${this.id}] Reconnection not currently desired`)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a program that writes in the console all the multiples of 23 less than 500 and at the end writes the sum of all of them Elements : 0 23 46 69 92 115 138 161 184 207 230 253 276 299 322 345 368 391 414 437 460 483 Sum : 5313 / Way 1 | function multiplesOf23() {
var sum = 0;
var result = ''
for (var i=23; i<=500; i+=23) {
result += i + '\t'
sum += i
}
console.log('Elements: ' + result);
console.log('Sum: ' + sum);
} | [
"function Multiples() {\n\tlet sum = 0;\n\tlet outcome = '';\n\tfor (let i = 0; i < 500; i++) {\n\t\tif (i % 23 == 0){\n\t\t\tsum += i;\n\t\t\toutcome += i + ' ';\n\t\t}\n\t}\n\tconsole.log(\"Outcome : \" + outcome)\n\tconsole.log(\"Sum : \" + sum)\n}",
"function multof23() {\n var sum = 0;\n var num = 0;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
= Description Call this if you need to remove a child view from this view without destroying its element, making it in effect a view without parent. Useful, for example, for moving a view from one parent component to another. = Parameters +_viewId+:: The parentspecific view id. Actually an array index. = Returns +self+ | removeView(_viewId) {
this.app.removeView(_viewId);
return this;
} | [
"remove() {\n if (this.parent) {\n const _viewZIndex = this.parent.viewsZOrder.indexOf(this.viewId);\n const _viewParentIndex = this.parent.views.indexOf(this.viewId);\n this.parent.views.splice(_viewParentIndex, 1);\n HSystem.delView(this.viewId);\n this.parent.viewsZOrder.splice(_viewZ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is not needed by the view so is only declared using var / setActiveQuestion takes one optional argument. If no argument is passed it will set the active question in the quiz to the next question that has yet to be answered. This allows the user to skip questions and come back to them later, even by clicking the "c... | function setActiveQuestion(index){
// no argument passed, data = undefined.
if(index === undefined){
var breakOut = false;
/*
* quizLength is set to 1 less than the length of the quiz as it
* is always ref... | [
"function setActiveQuestion(index) {\n if(index === undefined){\n var breakOut = false;\n var quizLength = DataService.quizQuestionsData.length - 1;\n while(!breakOut){\n thisBind.activeQuestion = thisBind.activeQuestion < quizLength?++thisBind.activeQuestion:0;\n if(Da... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
draws all the points | function drawPoints() {
strokeWeight(0);
fill(211, 223, 242);
for (let i = 0; i < points.length; i++) {
// multiply by width/height because it is normalized
let x = points[i].x * width;
let y = points[i].y * height;
circle(x, y, pointDiameter);
}
} | [
"function drawPoints(){\n\tfor (var i=0; i<p.length; i+=1){\n\t\tp[i].pplot(1);\n\t}\n}",
"function drawPoints() {\n var context = canvas.node().getContext('2d');\n context.save();\n context.clearRect(0, 0, width, height);\n context.translate(padding.left, padding.top);\n\n // draw each point as a rectangle\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Read all the directories in `./output` synchronously | function readDirs() {
return fs.readdirSync("./output")
} | [
"function get_the_outputs(container)\n{\n\treturn new Promise(function(resolve, reject) {\n\n\t\t//\n\t\t//\t.\tSkip this section if the folder dose not exists.\n\t\t//\n\t\tif(!fs.existsSync(container.dir.outputs))\n\t\t{\n\t\t\t//\n\t\t\t//\t-> Move to the next chain\n\t\t\t//\n\t\t\treturn resolve(container);\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
remvoies movies being sent | removeMovieFromAjax() { } | [
"function sendMovies(movies, sender_psid) {\n\tfor (i = 0; i < movies.length; i++) {\n\t\tvar response = {\n\t\t\t\"text\": movies[i]\n\t\t}\n\t\tvar request_body = {\n\t\t \"recipient\": {\n\t\t \"id\": sender_psid\n\t\t },\n\t\t \"message\": response\n\t\t}\n\t\tcallSendAPI(request_body);\n\t};\n}",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a tracked peer account | addAccount(peerAddr, plugin) {
let accts = this.getAccounts();
accts[peerAddr] = plugin;
globalState.set('000-reputation-accounts', accts);
this._tryRegisterAcct(peerAddr, plugin);
} | [
"function addPeer(infohash, peer) {\n if(!trackers[infohash])\n {\n trackers[infohash] = [];\n }\n if(trackers[infohash].indexOf(peer) < 0)\n {\n trackers[infohash].push(peer);\n }\n if(users[peer].infoHash.indexOf(infohash) < 0)\n {\n users[peer].infoHash.push(infohash);\n }\n}",
"function addN... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the download URL for the given Reference. | function getDownloadURL$1(ref) {
ref = Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__["getModularInstance"])(ref);
return getDownloadURL(ref);
} | [
"function getDownloadURL(ref) {\n ref = (0, _util.getModularInstance)(ref);\n return getDownloadURL$1(ref);\n}",
"function getDownloadURL(ref) {\n ref = util.getModularInstance(ref);\n return getDownloadURL$1(ref);\n}",
"function getDownloadURL(ref) {\n ref = Object(_firebase_util__WEBPACK_IMPORTED_MOD... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
do 5 > only 104 and then call the function inside draw() line 80 this is the array > cannonball | function showCannonBalls(ball, index)
{
//do 5 and then call the function inside draw() line 85
ball.display();
//do7 and goto "CannonBall.js" for trajectory
//remove the ball once it hits the ground or out of the canvas
if(ball.body.position.x >= width ||ball.body.position.y >=height -50)
{
... | [
"function drawEnemyBigShips(){\n\t\tfor(let i=0;i<enemyArr.length; i++){\n\n\n\t\t\tif(enemyArr[i].name === 'redCarier'){\n\n\t\t\t\t\tif(enemyArr[i].topFrame === true && enemyArr[i].y <= 0){\n\t\t\t\t\t\t\t\tenemyArr[i].speedY *= -1;\n\t\t\t\t\t}\n\t\t\t\t\tif(enemyArr[i].y >= enemyArr[i].yPos ){\n\t\t\t\t\t\tenem... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |