query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Loops through media and creates tag menu.
function setupTagMenu() { var tagArray = []; var tagString = ''; $('.media_block').each(function() { var tagList = String(unescape($(this).attr('data-tags'))); if(tagList != 'None' && tagList != 'null') { tagList.split(', ').join(','); var tempTagArray = tagList.split(','); for(var i = 0; i < t...
[ "function generateSocialMediaMenu() {\r\n\t\t\tvar markup = null;\r\n\t\t\t// facebook\r\n\t\t\tif (self.options.social.facebookUrl !== undefined) {\r\n\t\t\t\tmarkup = '<li><a href=\"' + encodeURI(self.options.social.facebookUrl) + '\" target=\"_blank\" class=\"jp-facebook-social\"><i class=\"icon-facebook icon-2x...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Decrement a 16bit register Needs a separate instruction as F is untouched on 16bit DEC BC
decReg16(register) { register[0]--; return 4; }
[ "decReg(register) {\n register[0]--;\n // Set the zero flag if 0, half-carry if decremented to 0b00001111, and\n // the subtract flag to true\n regF[0] = (register[0] ? 0 : F_ZERO) |\n (((register[0] & 0xF) === 0xF) ? F_HCARRY : 0) |\n F_OP;\n return 4;\n }", "function dec (cpu, n) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
delete a specific contactEmailAddress using its emailAddressId
static delete(emailAddressId) { return __awaiter(this, void 0, void 0, function* () { try { const contactEmailAddress = (yield db_1.db.delete.table('ContactEmailAddresses').where('emailAddressId', '=', emailAddressId).delete()).rowCount; return (contactEmailAddress ==...
[ "function elm_deleteEmailAddress(id)\n{\t\t\n sendBackendRequest(\"Back_End/DeleteEmailAddress.php\",\"SID=\"+getSID()+\"&ID=\"+id);\n main_loadLog(); //refresh the log\n \n return;\n}", "async deleteEmailRecord(email) {\n await this.connection.manager\n .getRepository(EmailRecordDBO_1.Email...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
+ Define a function `testTrueLooseNonEqualityComparison` that does not take any parameters. In this function, define two variables, one storing `0` and one storing `1`. The return value of the function should be the evaluation of a loose nonequality comparison (`!=`) of the two variables. The return value should be `tr...
function testTrueLooseNonEqualityComparison(){ var zero = 0; var one = 1; return zero !== one; }
[ "function testFalseLooseEqualityComparison(){\n var zero = 0;\n var one = 1;\n\n return zero == one;\n}", "function testFalseStrictEqualityComparison(){\n var strOne = \"1\";\n var numOne = 1;\n\n return strOne === numOne;\n}", "function StrictDoesNotEqualOperator(x, y) {\n if (StrictEqualityComparison(x...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Share to social networks by tassoman
function social_share(network) { var intent; switch (network) { case 'diaspora': intent = 'https://sharetodiaspora.github.io/?title=Look%20at%20this%20OpenBeerMap!&url='; break; case 'twitter': intent = 'https://twitter.com/intent/tweet?text=Look%20at%20th...
[ "share (network) {\n this.openSharer(network, this.createSharingUrl(network));\n\n this.$root.$emit('social_shares_open', network, this.url);\n this.$emit('open', network, this.url);\n }", "function shareToFacebook(){\n var url = window.location.host + vm.url;\n fb_publish(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Restore videos from local storage
function restore() { let soundboard = JSON.parse(window.localStorage.getItem("soundboard")); if(soundboard) { soundboard.forEach(item => create(item.id, item.start)); } }
[ "function resetAllVideo() {\n localStorage.view1 = undefined;\n localStorage.view2 = undefined;\n localStorage.view3 = undefined;\n gVideoCounter = 1;\n\n // Stop all streams to unlock the cameras.\n for (var id in gStreams) {\n gStreams[id].getVideoTracks()[0].stop();\n }\n // Reset the video tags to av...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
REMOVE PERSON / Gets the id of the table entry which had its remove button clicked as a parameter. Then removes the person from the JSON and it is no longer rendered on the table. If the person was the last one on the page, change the page to the one on the left (current pagenumber 1). Otherwise render table normally o...
function remove_person(id) { persons.splice(id, 1); localStorage.setItem('person', JSON.stringify(persons)); if (document.getElementById('insert-to-table').childNodes.length === 1 && persons.length !== 0) { change_page(pagenumber - 1); } else { render_entries(pagenumber); } init...
[ "function delete_person(data) {\n\t\t$('#' + data['old_id']).remove();\n\t}", "handlePersonRemove ( person ) {\n\t\t//Starting value for index\n\t\tvar index = -1;\n\t\t//Get the array length for loop\n\t\tvar list_length = this.state.peoplelist.length;\n\t\t//Go through the array\n\t\tfor( var i = 0; i < list_le...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Extract value from oauth formatted hash fragment.
function extractFromHash(name, hash) { var match = hash.match(new RegExp(name + "=([^&]+)")); return !!match && match[1]; }
[ "function extractFromHash(name, hash) {\n var match = hash.match(new RegExp(name + \"=([^&]+)\"));\n return !!match && match[1];\n }", "function extractFromHash(name, hash) {\n\t\tvar match = hash.match(new RegExp(name + \"=([^&]+)\"));\n\t\treturn !!match && match[1];\n\t}", "function ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the default value of a prop.
function getPropDefaultValue (vm, prop, key) { // no default, return undefined if (!hasOwn(prop, 'default')) { return undefined } var def = prop.default; // warn against non-factory defaults for Object & Array if (isObject(def)) { warn( 'Invalid default value for prop "' + ke...
[ "function getPropDefaultValue (vm, prop, key) {\n // no default, return undefined\n if (!hasOwn(prop, 'default')) {\n return undefined\n }\n var def = prop.default;\n // the raw prop value was also undefined from previous render,\n // return previous default value to avoid unnecessary watcher...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
days without hours don't have font, day of week missing after checkKernzeitEingriffe()
function addDayOfWeekToMissedDays() { $("tr td[colspan=4]:not(.grey)").each(function(){ var dateField = this.previousSibling.previousSibling; if(isInt($(dateField).text()[0])) { setupDay(dateField, null); } }); }
[ "function sendCultureMessageIfWeekday() {\n // Ignoring timezone issues in this fxn for now, as UTC's day of week\n // will always be the same as Pacific's when this is run ~10am.\n // TODO(kamens): handle timezone issues.\n var now = new Date(),\n day = now.getUTCDay(); // 0...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add stat data modal daterange initialization
function cb_stat(start, end) { stat_dt_start = start.format('YYYY-MM-DD') + ' ' + String(moment().hour())+':00', stat_dt_end = end.format('YYYY-MM-DD') + ' ' + String(moment().hour()+1)+':00'; if (moment(stat_dt_start).hour() == 0) { stat_dt_start = start.format('YYYY-MM-DD') + ' ' + '00:00'; }...
[ "function init_timeslider(data){\r\n\t\tconsole.log(\"init_timeslider\");\r\n\t\tvar minDatum = data[0][selectedOptions.dateField];\r\n\t\tvar maxDatum = data[data.length-1][selectedOptions.dateField];\r\n\t\tdocument.getElementById(\"time_slider\").setAttribute(\"max\", data.length-1);\r\n\t}", "function initDat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if `object` has a specific `key`.
function hasKey(object, key) { return {}.hasOwnProperty.call(object, key); }
[ "function hasKey(object, key) {\n return {}.hasOwnProperty.call(object, key);\n }", "function hasKey(object, key) {\n return {}.hasOwnProperty.call(object, key);\n}", "function hasKey(object, key) {\r\n return {}.hasOwnProperty.call(object, key);\r\n}", "function checkIfPropertyExists(object, key)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if a point is the end point of a location.
isEnd(editor, point, at) { var end = Editor.end(editor, at); return Point.equals(point, end); }
[ "isEnd(editor, point, at) {\n var end2 = Editor.end(editor, at);\n return Point.equals(point, end2);\n }", "function isStartOrEnd(x, y) {\n\tif (x == currSX && y == currSY) {\n\t\treturn true\n\t} else if (x == currEX && y == currEY) {\n\t\treturn true\n\t} else {\n\t\treturn false\n\t}\n}", "function ra...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create an empty Container at the given URL. Throws an error if creating the Container failed, e.g. because the current user does not have permissions to, or because the Container already exists. Note that a Solid server will automatically create the necessary Containers when storing a Resource; i.e. there is no need to...
async function createContainerAt(url, options = internal_defaultFetchOptions) { url = internal_toIriString(url); url = url.endsWith("/") ? url : url + "/"; const config = Object.assign(Object.assign({}, internal_defaultFetchOptions), options); const response = await config.fetch(url, { method: "...
[ "async function createContainerAt(url, options = internal_defaultFetchOptions) {\r\n url = internal_toIriString(url);\r\n url = url.endsWith(\"/\") ? url : url + \"/\";\r\n const config = Object.assign(Object.assign({}, internal_defaultFetchOptions), options);\r\n const response = await config.f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function index 5 query to database for all manager data (for display the table for user)
viewAllManager() { const query = ` select s1.manager_id, s2.first_name, s2.last_name, staffrole.title,staffrole.salary, department.name as department, count(s1.manager_id) as staff_managing, (CONCAT(s2.first_name, ' ', s2.last_name)) AS manager_full_name from employee as S1 Right join employee as s2 ...
[ "function viewManagers() {\n var query = `SELECT CONCAT (e.first_name, ' ', e.last_name) AS Manager, r.title, r.salary \n FROM employee e \n LEFT JOIN role r\n ON e.role_id = r.id\n LEFT JOIN department d\n ON d.id = r.department_id\n LEFT JOIN employee m\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if the command would perform a write to redis TODO: use the command queue version of this instead
function is_write_command(command) { return /(pop)|(set)|(del)/i.test(command); }
[ "function check_queue_write() {\n\tif (intf.intf.queue_write.length < 1) {\n\t\tintf.intf.writing = false;\n\t\treturn false;\n\t}\n\n\tintf.intf.writing = true;\n\treturn true;\n}", "function isReadWriteCommand(command) {\n switch (getCommandType(command)) {\n case CommandType.TYPE_II:\n case Co...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
redimensionne les bagues selon l'orientation de l'appareil
function change_bague_size(){ if (orientation_value == "paysage"){ // récupert la hauteur de la fenêtre var windows_height = $(window).height(); // définit la taille (hauteur = largeur) des bagues var magic360size = 240; // si la fenêtre n'est pas assez grande, on réduit la taille des bagues ...
[ "function dessinerEchellesBarres() {\n objC2D.save();\n\n if (tabDispo != null) {\n for (var i = 0; i < tabDispo.length; i++) {\n var ligneDispo = tabDispo[i];\n for (var k = 0; k < ligneDispo.length; k++) {\n if (tabDispo[i][k] == \"2\") {\n objC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a sorted array of positive integers. Your task is to rearrange the array elements alternatively i.e first element should be max value, second should be min value, third should be second max, fourth should be second min and so on. Expected Time Complexity: O(N). Expected Auxiliary Space: O(1). Constraints: 1 <= N ...
function rearrangeArrayAlternately(arr) { for (let i = 0; i < arr.length; i = i + 2) { let max = arr.pop(); let min = arr.splice(i, 1); if (min.length > 0) { arr.splice(i, 0, max, min[0]); } else { arr.push(max); } } return arr; }
[ "function reversSort(arr) {\n //defining variable temp for exchanging items\n var temp;\n //loop for decreasing part of array, which is checked\n for (var i = 0; i < arr.length; i++) {\n //loop for comparison items. Every loop iteration pushes max item to end of array\n //new iteration use...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Invoke a `value` (generally from the chart options) with the given arguments. Static values are returned directly.
tryInvoke(value, ...args) { if (value === null) { return null; } else if (value === UNDEF) { throw new MonteOptionError('Value not initialized.'); } try { return isFunc(value) ? value.call(this, ...args) : value; } catch (e) { if (console && console.error) { console....
[ "function invoke(name, values, object) {\n return object[name].apply(object, values);\n}", "function callByValue(varOne, varTwo) {\n console.log(\"Inside Call by Value Method\");\n varOne = 100;\n varTwo = 200;\n console.log(\"varOne =\" + varOne, \"varTwo =\" + varTwo);\n}", "function getVal(val...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
`_makeFlat` is a helper function that returns a onelevel or fully recursive function based on the flag passed in.
function _makeFlat(recursive) { return function flatt(list) { var value, jlen, j; var result = []; var idx = 0; var ilen = list.length; while (idx < ilen) { if (_isArrayLike(list[idx])) { value = recursive ? flatt(list[idx]) : list[idx]; j...
[ "function _makeFlat(recursive) {\n return function flatt(list) {\n var value, result = [], idx = -1, j, ilen = list.length, jlen;\n while (++idx < ilen) {\n if (isArrayLike(list[idx])) {\n value = (recursive) ? flatt(list[idx]) : list[idx];\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates an aircraft and emits an event
generateAircraft() { this.emit('aircraft', {}); }
[ "buildAircraft() {\n if (this.moved === true) {\n alert(this.name + \" has already moved!\");\n return;\n }\n \n this.aircraft += Math.floor(Math.random() * (5 - 3) + 3 );\n this.moved = true;\n\n game.turnCheck(); // check on each player action\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
24h Returns a new `RedHatService` instance for a Visual Studio Code extension. For telemetry, the following is performed: A preference listener enables/disables telemetry based on changes to `redhat.telemetry.enabled` If `redhat.telemetry.enabled` is not set, a popup requesting telemetry optin will be displayed when th...
function getRedHatService(context) { return __awaiter(this, void 0, void 0, function* () { const extensionInfo = getExtension(context); const extensionId = extensionInfo.id; const packageJson = getPackageJson(extensionInfo); const settings = new settings_1.VSCodeSettings(); c...
[ "static get instance() {\n if (this._instance === undefined) {\n let constants = this._constants;\n let config = new extConfig_1.default(constants.extensionConfigSectionName);\n _channel = vscode_1.window.createOutputChannel(constants.serviceInitializingOutputChannelName);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove the hover tip.
clearTip() { if (this.tip) { this.tip.remove(); } }
[ "function removeHoverTooltip() {\n if (ref.hoverTooltip) {\n ref.hoverTooltip.destroy();\n }\n }", "function clearTooltip(){\n if (tooltip.getContent()){\n tooltip.getContent().remove();\n }\n if (hoverTime...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Policy Lock Timer Handler
function policyLockTimeoutHandler() { var policyNo = getObjectValue("policyNo"); var policyTermHistoryId = getObjectValue("policyTermHistoryId"); var policyViewMode = getObjectValue("policyViewMode"); // Invoke Ajax call to refresh the Policy Lock var url = getAppPath() + "/policymgr/lockmgr/...
[ "function initializePolicyLockTimer() {\r\n // Create timer object\r\n objPolicyLockTimer = new policyLockTimerObj();\r\n objPolicyLockTimer.timeoutInMilliSeconds = policyLockDuration * 60 * 1000;\r\n objPolicyLockTimer.timeoutHandler = \"policyLockTimeoutHandler()\";\r\n\r\n // Start the timer\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
============================================== WOOCOMMERCE REVIEWS SCROLL ==============================================
function oceanwpWooReviewsScroll() { "use strict" $j( '.woocommerce div.product .woocommerce-review-link' ).click( function( event ) { $j( '.woocommerce-tabs .description_tab' ).removeClass( 'active' ); $j( '.woocommerce-tabs .reviews_tab' ).addClass( 'active' ); $j( '.woocommerce-tabs #tab-description' )...
[ "function wooReviewsScroll() {\n\t\"use strict\"\n\n\t$j( '.woocommerce div.product .woocommerce-review-link' ).click( function( event ) {\n\t\t$j( '.woocommerce-tabs .description_tab' ).removeClass( 'active' );\n \t$j( '.woocommerce-tabs .reviews_tab' ).addClass( 'active' );\n\t\t$j( '.woocommerce-tabs #tab-d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prints ObjectExpression, prints properties.
function ObjectExpression(node, print) { var props = node.properties; this.push("{"); print.printInnerComments(); if (props.length) { this.space(); print.list(props, { indent: true }); this.space(); } this.push("}"); }
[ "function ObjectExpression(node, print) {\n var props = node.properties;\n\n this.push(\"{\");\n print.printInnerComments();\n\n if (props.length) {\n this.space();\n print.list(props, { indent: true });\n this.space();\n }\n\n this.push(\"}\");\n}", "function printObjectProperties (obj) {\n\tvar p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get default fallback data for this Merlin Park
get FallbackData() { return this[sFallbackData]; }
[ "getDefaultData() {\n // prepare URL\n var url = this.url\n if (this.storage.checkData()) {\n let cords = this.storage.getData()\n url += \"&lat=\" + cords.saved_lat\n url += \"&lon=\" + cords.saved_lng\n }\n else {\n url += \"&lat=\" + DEFAULT_LAT\n url += \"&lon=\" + DEFAUL...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Takes a subject Id as input Returns one subject
function getSingleSubject(subjectId) { return SubjectCollection.findById(subjectId) }
[ "static async getSubjectById(dbController, id) {\n const subjectData = await dbController.select(SUBJECT_TABLE, SUBJECT_DATA_COLUMNS, mysql.format('subject_id=?', id));\n return await Subject.subjectFromData(subjectData, dbController);\n }", "async getSubject({ commit, dispatch }, subjectId) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this func called when the button register is clicked compare between the password and make validation, register the new user and login the new user
function register() { if (validInput()) { var str1 = $("#password").val(); var str2 = $("#passwordVeri").val(); if (validPassword(str1, str2)) { $("#loader").show(); document.getElementById("demo").innerHTML = ""; var userName = $("#userName").val(); ...
[ "function register() {\r\n\tvar val = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\r\n\temail = document.getElementById('registerEmail').value;\r\n\tpassword1 = document.getElementById...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Takes any s3arn and return only the bucket s3arn (no folders)
function normalizeBucketArn(s3Arn) { const parsed = parseS3Arn(s3Arn); if (_.isEmpty(parsed)) return s3Arn; const { awsPartition, bucket } = parsed; return `arn:${awsPartition}:s3:::${bucket}`; }
[ "function parseS3Arn(arn = '') {\n // arn:aws:s3:::123456789012-study/studies/Organization/org-study-a1/*\n let trimmed = _.trim(arn);\n if (_.isEmpty(arn)) return;\n\n if (!_.startsWith(trimmed, 'arn:')) return;\n\n // Remove the 'arn:' part\n trimmed = trimmed.substring('arn:'.length);\n\n // Get the parti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This sample demonstrates how to Create or update an Azure Cosmos DB Gremlin graph
async function cosmosDbGremlinGraphCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; const accountName = "ddb1"; const databaseName = "databaseName"; const graphName = "graphName"; const crea...
[ "async addRelations(){\n var driver = neo4j.driver(\n 'bolt://localhost:7687',\n neo4j.auth.basic('neo4j', 'bookmarks') \n )\n var session = driver.session()\n try { \n const result = await session.writeTransaction(tx =>\n tx.run('match (n)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
given card number, add card to scrap and scrap modal
function addCardToScrap(card) { // add to modal and scrap array //console.log(card); $('#scrapModalCards').append('<img src="/assets/images/cards/' + card + '.png" class="gamecard">'); scrap.push(card); // set onclick for modal card $('#scrapModalCards .gamecard:last').click(function() { //clicking on ...
[ "function addcard(number) {\n\tlet card;\n\tif (number ===1) {\n\t\tcard = $(\"<li class ='card one' onclick = 'clickOnCard(this)'><div class='w3-card-4'><header class='w3-container-w3-blue'><h1 id='cardtitle'>Card</h1></header><div class='w3-container'><p id = 'star'><img src='https://img.clipartfest.com/c1754dbc3...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is a function for repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildKeyGet / Returns the specified build status for a commit.
repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildKeyGet( incomingOptions, cb ) { const Bitbucket = require('./dist'); let defaultClient = Bitbucket.ApiClient.instance; // Configure API key authorization: api_key let api_key = defaultClient.authentications['api_key']; api_key.apiKey = in...
[ "async function getBuildStatus () {\n const keys = await redisUtils.scanKeys(redis, 0, 'MATCH', '*-STATUS')\n if (keys.length === 0) {\n return []\n }\n\n const statuses = await Promise.all(keys.map(key => redis.hgetall(key)))\n\n return keys.map((key, index) => {\n const id = key.replace('-STATUS', '')\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function viewconditioncodes() triggers a popup displaying a list of condition code options.
function viewconditioncodes() { document.getElementById('conditionselection').style.visibility = "visible"; }
[ "function termsConditionPopup(){\n\t\tmyPopupWindowOpen('#termsCondition','#maska');\n\t}", "function addCodeConditions(){\r\n\ttry{\r\n\t\tcodeCond = null;\r\n\t\tif (typeof(VIOLATIONS) == \"object\") {\r\n\t\t\tfor (eachrow in VIOLATIONS) {\r\n\t\t\t\t//branch(\"ES_ADD_CODE_CONDITIONS_LOOP\")\r\n\t\t\t\tvioRow ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handler for intent teasetteaalarm (teaalarm). Params : entities (Object)
function handleTeaIntent({ entities: { 'tea-type': teatype = {}}, data }) { return new Promise((resolve, reject) => { /* >>> YOUR CODE HERE <<< resolve the handler with a formatted message object. */ return resolve({ message: { title: "Not implemented", text: "This functi...
[ "function onTaunt(entity, entity2) {}", "function setAlarms(data, onstart) {\n if (data.Config != null && data.Config.hwUpdate != null && !isNaN(data.Config.hwUpdate)) {\n chrome.alarms.create(\"updateData\", {periodInMinutes: (data.Config.hwUpdate * 60)});\n }\n else\n console.log(\"data.C...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register custom events for event delegation.
function registerEvents() { var mouseEventMap = { mouseenter: 'mouseover', mouseleave: 'mouseout', pointerenter: 'pointerover', pointerleave: 'pointerout' }; Object.keys(mouseEventMap).forEach(function (eventName) { (0, _dom.registerCustomEvent)(eventName, { delegate: true, handler: function handler(...
[ "function registerEvents() {\n\tconst mouseEventMap = {\n\t\tmouseenter: 'mouseover',\n\t\tmouseleave: 'mouseout',\n\t\tpointerenter: 'pointerover',\n\t\tpointerleave: 'pointerout',\n\t};\n\tObject.keys(mouseEventMap).forEach(function(eventName) {\n\t\tregisterCustomEvent(eventName, {\n\t\t\tdelegate: true,\n\t\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ALL CK Console Requests Defined Collects the data for a single dataset. When a dataset is fully loaded from the server the inputParser method is run. The inputParser method should be used to build the serice list and should also be used to filter out unwanted datasets.
function DataSetCollector(blob){ this.simpleDataName = blob.simpleDataName; this.dataName = blob.dataName; this.categories = blob.categories; /* * This is what is run for each dataset that is collected */ this.inputParser = function(input){ console.log(blob.dataName); console.log(input); ...
[ "function getDataset(aDataSetCollector, nextFunction){\n\t\t\tif(aDataSetCollector.doAnyArgumentsMatch(tagsArray)){\n\t\t\t\tckConsole.getGroup(aDataSetCollector.dataName).then(function(inputData){\n\t\t\t\t\tconsole.log('Loading: ' + aDataSetCollector.dataName);\n\t\t\t\t\tconsole.log(inputData);\n\t\t\t\t\taDataS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get query string from selected checkboxes
function getQueryStringFromCheckboxes() { // Get data var pluginData = getElasticSearchData($nodeReference), // Get checked checkboxes within wrapper checked = $(pluginData.settings.filterCbTarget).filter(":checked"), // Return facets as a string qs = ""; ...
[ "function checkBoxEventHandler(){\n let incomingFilterData = document.querySelectorAll(\"input[type='checkbox']\");\n let queryObj = {}\n incomingFilterData.forEach(input => {\n if(input.checked){\n if(input.name in queryObj){\n queryObj[input.name].push(input.id);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Iterates over all playfield and checks if full row contains only "2" (taken cell). If yes deletes row and adds new, full of zeros. After that, adds points according to current level
function removeFullLines() { let canRemoveLine = true, filledLines = 0 for (let y = 0; y < playField.length; y++) { for (let x = 0; x < playField[y].length; x++) { if (playField[y][x] !== 2) { canRemoveLine = false break } } if (canRemoveLine) { playField.splice(y, 1) playField.splice(0, 0...
[ "checkRows() {\n let linesRemoved = 0;\n for (let i = this.board.length - 1; i >= 0; i--) {\n let numberOfBlocks = 0;\n let removed = false;\n\n for (let j = 0; j < this.board[i].length; j++) {\n let sign = this.board[i][j];\n\n // The row is not full; don't remove it\n if ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION: tweakSelectionIfInsideOfEmptyTableCell DESCRIPTION: If " " is manually selected in table cell, than tweaks the selection so that the selection is an insertion point at the beginning of the table cell ARGUMENTS: none RETURNS: nothing
function tweakSelectionIfInsideOfEmptyTableCell() { var dom = dw.getDocumentDOM(); var offsets = dom.getSelection(true); // gets pairs of offsets if multiple selections var selNode = dom.offsetsToNode(offsets[0],offsets[1]); if (selNode.tagName && (selNode.tagName == "TD" || selNode.tagName == "TH")) { v...
[ "function dwscripts_adjustCursorForEmptyTableCell(dom)\n{\n var retVal = false;\n \n dom = (dom != null) ? dom : dw.getDocumentDOM();\n\n if (dom)\n {\n var offsets = dom.getSelection(true); // gets pairs of offsets if multiple selections\n if( !offsets || offsets.length <= 1 ) {\n\t return retVal;\n \...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
AJAX Class Set url, divID, and queryString to use. Call with httpRequest.
function AjaxCall() { this.req = null; this.url = null; this.divID = null; this.method = 'POST'; this.async = true; this.queryString = null; this.visible= false; this.initReq = function (){ var self = this; this.req.open(this.method,this.url,this.async); this.req.onreadystatechange= function() { var ...
[ "function URLget(thisURL, elementId) {\n if (thisURL !== undefined && thisURL !== '') {\n if (arguments.length !== 0) {\n XMLHttpRequestObject = Update__GetHTTPObject(); // Get a new XMLHttpRequest().\n XMLHttpRequestObject.open(\"GET\", thisURL); // GET thisURL asynchronously.\n XMLHttpRequestOb...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Revision retention policy definiation migrations
function RevisionRetentionPolicy(parentMigrator, current, proposed) { this.db = parentMigrator.db; this.current = current; this.proposed = proposed; }
[ "pushDB(releases = true, history = true) {\n let sql = ''\n , hist = this.hist\n//console.log(\"Hist push:\", hist.prev)\n if (releases) hist.releases.forEach((el,ix) => {\n let cdate = Number.isInteger(el) ? 'null' : Format.literal(el)\n sql += `insert into wm.releases (release, committed) val...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clear all choices added to the store.
_clearChoices() { this.store.dispatch( clearChoices(), ); }
[ "function resetChoices() {\n choicesContainer.innerHTML = \"\";\n}", "function clearAll() {\r\n\t\t$('#listelem').empty();\r\n\t\t$('#listelem').buttonset();\r\n\t\tselected_index = undefined;\r\n\t\tsirikata.event(\"clearAll\");\r\n\t}", "function clearMenu() {\n $(\".combo-content\").each(function () ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If the argument is an array returns it as is. Otherwise puts it in an array (`[arg]`) and returns the result
function makeArray(arg) { if (Array.isArray(arg)) { return arg; } return [arg]; }
[ "function castAsArray(arg) {\n if (!Array.isArray(arg)) {\n arg = [arg];\n }\n\n return arg;\n}", "function asArray (arg) {\n return (arg === 'undefined') ? [] : Array.isArray(arg) ? arg : [arg]\n}", "function array(value, arg, index) {\n return Array.isArray(value) ? value : [value];\n}", "function a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When the browser window's hash changes, a new tab was selected. Update both the active tab control, and the section of the profile displayed
function onHashChange() { updateActiveTab(); updateActiveSection(); }
[ "onHashChange() {\n const hash = window.location.hash\n const tabWithHash = this.getTab(hash)\n if (!tabWithHash) {\n return\n }\n\n if (this.changingHash) {\n this.changingHash = false\n return\n }\n\n var previousTab = this.getCurre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
It check the flag sentToServer stored in localstore of browser.
isTokenSentToServer() { return window.localStorage.getItem('sentToServer') === '1'; }
[ "sendLocalStorageToServer () {\n const item = window.localStorage.getItem(0)\n if (item === undefined) {\n this.removeSendTimer()\n return false\n }\n\n this.sendToServer(item)\n shiftLocalStorage(1)\n }", "setTokenSentToServer(sent) {\n window.localStorage.setItem('sentToServer',...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an array containing all selected/checked values for a form element.
function getValues(objElement) { var i; var objGroup; var vals = new Array(); var eType = objElement.type; if ((objElement.type == "checkbox") || (objElement.type == "radio")) { objGroup = getFormElements(objElement.form, objElement.name); for (i = 0, j = 0; i < objGroup.length; i++) { if (eType ==...
[ "getCheckedValues() {\n var checkedValues = $('input[name=' + this.props.inputProps.name + ']:checked').map(function (index, domElement) {\n return $(domElement).val();\n });\n return $.map(checkedValues, function (value, index) {\n return [value];\n }).join();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Carga el slot en el indice dado con el item marcado O con uno aleatorio si no se pasa el argumento
function cargarSlot(slots, indice, slotItem){ slots[indice] = slotItem || getSlotItem(slotItems); //Usado para notificar cambio de Slot if(cambioDeSlot) cambioDeSlot(slots, indice); }
[ "addItem(...args) {\n const [_index, label, hash, props, quantity, slot] = args;\n let items = [...this.state.items];\n\n if (!label) {\n items[_index] = null;\n } else {\n items[_index] = {\n label,\n hash,\n props,\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set effect to frame component
effect (prm) { try { return this.frame().effect(prm); } catch (e) { console.error(e.stack); throw e; } }
[ "flash(){\n\t\tvar e = new effect(this.pos);\n\t\te.size = this.size;\n\t\te.color = [160, 160, 255]; //light blue\n\t\te.add();\n\t}", "function OverlayEffect() {\n }", "function setCompFrameBlending( c )\n{\n c.frameBlending = true;\n}", "set effect(effect) {\n this.assertNotFrozen('effect');\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check that the clicking the field shows the editor when the block has more than one field.
function test_twoFieldBlock_fieldClickShowsEditor() { svgTest_setUp(); try { var block = svgTest_newTwoFieldBlock(); var showEditorCalled = false; block.getField('FIELD').showEditor_ = function() { showEditorCalled = true; }; block.getField('FIELD').getSvgRoot().dispatchEvent(new Event(...
[ "function test_oneFieldBlock_blockClickShowsEditor() {\n svgTest_setUp();\n\n try {\n var block = svgTest_newOneFieldBlock();\n\n var showEditorCalled = false;\n block.getField('FIELD').showEditor_ = function() {\n showEditorCalled = true;\n };\n\n block.getSvgRoot().dispatchEvent(new Event('m...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function to get the Date the user last accessed the given module
function getDateLastAccessed(pageLog, modName) { /* New pageLog item added each time a user opens a page. pageLog: [new Schema({ time: Date, subdirectory1: String, subdirectory2: String })] */ let lastAccessed = 0; for (const page of pageLog) { if (page.subdirectory...
[ "function getRefreshDate() {\r\n\t\treturn this.PRIVATES(PRIVATES).refreshDate;\r\n\t}", "get lastAccessedTime() {\n return this.getStringAttribute('last_accessed_time');\n }", "function lastSeenCalc(user) {\n var date = new Date();\n var hours = date.getHours() + 5;\n console.log(hours);\n consol...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
grabs the quads from _BOARD
function getQuad(board, quadNum) { //creates an array of all the elements in the same quadant let inQuad = [] //cycles through every row for (let row2 in board) { //cycles through every column for (let col in board[row2]) { if (_QUADS[row2][col] == quadNum) { ...
[ "function drawQuadsBG() {\r\n //reset arrays\r\n quadsBG.length = 0;\r\n quadsInitBG.length = 0;\r\n //reset starters\r\n var x = 0;\r\n var y = 0; \r\n var w = 100; \r\n var h = 1000;\r\n\r\n for (i = 0; i < numbQuadsBG; i++) {\r\n\r\n quadsBG.push({\r\n //left top\r\n x: x,\r\n //right ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Event handler to jump to the preceding slide. / \param ev the event that triggered the action / / The event handler is attached to a button. It calls activate() / to make the element before the current element the new current / element (unless the current element is / already the first element). It then repositions the...
function prev_slide(ev) { ev.preventDefault(); if (current == 0) return; // Already at first element activate(current - 1); // Move the "active" class //console.log("prev: current = "+current+" t -> "+timecodes[current]); seek_video(); }
[ "function next_slide(ev)\n {\n ev.preventDefault();\n if (current == sync_elts.length - 1) return; // No next element\n activate(current + 1); // Move the \"active\" class\n //console.log(\"next: current = \"+current+\" t -> \"+timecodes[current]);\n seek_video();\n }", "function slideShowPrev (...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to write the scores list
function writeScores() { //reset the scores list $scoresList.empty(); //sort the current scores highScores = sortScores(highScores); //loop through the sorted array and add them to scores list for (var i = 0; i < highScores.length; i++) { var newScore = $("<li>"); newScore.append(`<s...
[ "function writeOutScores() {\n\t endGameWindow.querySelector('h1').innerText = 'Top scores: ';\n\t for (var i = 0; i < 5; i++) {\n\t if (highScores[i]) {\n\t ranks[i].innerText = i + 1 + \". \" + highScores[i];\n\t } else {\n\t ranks[i].innerText = i + 1 + \". 0\";\n\t ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
stuff for the modal ws window
function display_ws_modal() { var id = '#dialog'; //transition effect $('#mask').fadeIn(500); $('#mask').fadeTo("slow",0.8); //Get the window height and width ...
[ "function addModalWindowToPage(){\n\t\taddProfileView();\n\t\taddModalWindowClose();\n\t\taddShare();\n\t}", "createModalWindowDesktop() {\n this.addClass('wrs_modal_desktop');\n this.stack();\n }", "function openMotivationWindow(windowName, group) {\r\n\t$ES('.mousepopup').each(function(el){el.setStyle(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds the intervals excluding discontinuity points
function buildIntervals(startPoint, endPoint, discontinuityPoints) { const result = []; let currentStart = startPoint; if (discontinuityPoints) { /* Sorting discontinuity points if they exist */ let discArr = discontinuityPoints.slice().sort(); /* Pushing discontinuities if within...
[ "function createIntervals(data) {\n var newArr = [];\n var start = Math.min(...data);\n var end = 0;\n var max = Math.max(...data);\n var i = start;\n while (i <= max) {\n //find end of interval\n while ( data.includes(i + 1) && i <= max) {\n i++;\n }\n end ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Refresh the clicks counter.
refreshClicks() { if (this._game.isRun()) { this._view.setValue("clicks", this._game.clicks); } }
[ "function updateClicks () {\r\n total_clicks += 1 ;\r\n $(\"#total_clicks\").text(total_clicks);\r\n }", "@action incrementClicks() {\n this.clicks++;\n }", "function updateClickCount() {\r\n\tvar counter = 0\r\n\tcounter += 1;\r\n\t// do something with the counter\r\n}", "function increa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create an array of 20 randomly generated integers. Calculate the sum of the elements in the array. your code...
function randomArr(){ let arr = [] for(let i = 0; i <= 20; i++){ arr.push(Math.floor(Math.random() * Math.floor(1000))) } return arr.reduce((acc, curr) => acc + curr ) }
[ "function randInt() {\n const maxLen = 20\n const randomArray = []\n let sum = 0;\n for(let i = 0; i < maxLen; i++) {\n randomArray.push(Math.floor(Math.random()))\n }\n for (j = 0; j < randomArray.length; j++) {\n sum =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Marks a entity property as a parent of the tree. "Tree parent" indicates who owns (is a parent) of this entity in tree structure.
function TreeParent() { return function (object, propertyName) { // now try to determine it its lazy relation var reflectedType = Reflect && Reflect.getMetadata ? Reflect.getMetadata("design:type", object, propertyName) : undefined; var isLazy = (reflectedType && typeof reflectedType.name ==...
[ "set parent(parent) {\n this._parent = parent;\n\n if (parent) {\n parent.addChild(this);\n }\n }", "set parent(parent) {\n this._parent = parent;\n if (parent) {\n parent.addChild(this);\n }\n }", "set parent(parent) {\n this._parent = parent;\n if (parent)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Saves the request in the localStorage
saveRequest(url) { this.recent_requests.push(url) let self = this; localStorage.setItem("recent_aviweather_requests", JSON.stringify(self.recent_requests)); }
[ "function save() {\n localStorage && localStorage.setItem(key, Y.JSON.stringify(data));\n }", "save() {\n\t\tvar json = JSON.stringify(this);\n\t\tlocalStorage.setItem(this.keyname, json);\n\t}", "save() { localStorage.setItem(this.constructor.localStorageName, JSON.stringify(this)); }", "saveInLoca...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
makes sense to run some simple reality checks on the number. The numbers are a good length and it's common to make minor transcription errors when the card is not scanned directly. The first check people often do is to validate that the card matches a known pattern from one of the accepted card providers. Here's how to...
function isValid(ccnum){ let ccArray = []; for (let i = 0; i < ccnum.length; i++){ if (ccnum.charAt(i) != " ") { ccArray.push(ccnum.charAt(i)); } } for (let j = 0; j < ccArray.length; j += 2){ ccArray[j] *= 2; } return (ccArray.reduce((a,b) => a + b, 0) % 10 === 0); }
[ "function checkCC(num) {\n\tnum = num.toString().split('').map(function(a){return parseInt(a)});\n\tvar sumArray = [];\n\tfor (var i = 0; i < num.length; i++) {\n\t\tif (i % 2 == 1) {\n\t\t\tsumArray.push(num[i]);\n\t\t} else {\n\t\t\tvar doubledDigit = num[i] * 2;\n\t\t\tif (doubledDigit > 9) {\n\t\t\t\tsumArray.p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If the user hangups the connection with the initiator, the function will inform the server to remove the user from the conference room itself. If the user hangups another member in the room, then the function stops that particular peer connection only
function hangupUser(hangupUser) { console.log('Hanging up user '+hangupUser); if(isInitiator || admin=== 'true' ){ socket.emit('remove from room',hangupUser); } else{ socket.emit('hangup',hangupUser); stop(hangupUser); } }
[ "function stop(hangupUser) {\n\tconsole.log('closing peer connection of :'+hangupUser);\n\tconnectedUsers[hangupUser].close();\n\n\t$media.removeChild(document.getElementById('panels'+hangupUser));\n\tuserID--;\n\tconsole.log('deleting the user from connected users array');\n\tdelete connectedUsers[hangupUser];\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Functions to supplement jQGrid: activateTitleBar on a table will make clicking on the caption the same as click on the collapse icon. It also adds a second click handler to the collapse icon in order to expand/collapse the edit panel as well.
function activateTitleBar(table) { var v = jQuery(table).closest('.ui-jqgrid-view'); v.find('.ui-jqgrid-titlebar').click(function() { jQuery(this).find('.ui-jqgrid-titlebar-close').trigger('click'); }); v.find('.ui-jqgrid-titlebar-close').click(function() { if (jQuery(table).getGridParam('gridstate') == 'vi...
[ "function onTitlebarClick() {\n // NOTE: event arg doesn't seem to work for me\n var $item = $(this).parent();\n debug(\"onTitlebarClick: \" + $item.attr('id'));\n\n toggleItemFolded($item);\n}", "function initQrateSortByClickHandlers($thead_cell, primary_class, secondary_class) {\n\n $thead_cell.c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A frontend to convertCSV. makeConvertCSV is called with arguments to enable a .csv file to be converted to a sqlite3 .db file. It produces an anonymous async function with closure over the parameters given to makeConvertCSV. convertCSV needs to participate in a promise chain. However, convertCSV needs 4 parameters, and...
async function makeConvertCSV(csvFile,dbFile,dbTable,cwd) { console.log("makeConvertCSV:start"); console.log("makeConvertCSV:csvFile="+csvFile); console.log("makeConvertCSV:dbFile="+dbFile); return async function(priorResult){ console.log("anonymous function:start"); let retConvert = awa...
[ "function makeConvertCSV(csvFile,dbFile,dbTable,cwd) {\n debug(\"makeConvertCSV:start\");\n debug(\"makeConvertCSV:csvFile=\"+csvFile);\n debug(\"makeConvertCSV:dbFile=\"+dbFile);\n debug(\"makeConvertCSV:dbTable=\"+dbTable);\n debug(\"makeConvertCSV:cwd=\"+cwd);\n let argUndefined = (typeof csvFi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
of :: Applicative f => (TypeRep f, a) > f a . . Function wrapper for [`fantasyland/of`][]. . . `fantasyland/of` implementations are provided for the following . builtin types: Array and Function. . . ```javascript . > of(Array, 42) . [42] . . > of(Function, 42)(null) . 42 . . > of(List, 42) . Cons(42, Nil) . ```
function of(typeRep, x) { return Applicative.methods.of(typeRep)(x); }
[ "function of(typeRep, x) {\n return Applicative.methods.of (typeRep) (x);\n }", "function of(typeRep) {\n return function(x) {\n return Z.of (typeRep, x);\n };\n }", "function oneof() {\n assert(arguments.length !== 0, \"oneof: at least one parameter expected\");\n\n // TODO: write this in mor...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Render the cards after the array is sorted
function sort() { renderContent(numArray.sort()); }
[ "function sort(){\n\n //Calls to display the sorted cards\n showTwoCards();\n showThreeCards();\n\n}", "function renderSortedItems() {\n $('section').remove();\n for (let x = 0; x < allInfo.length; x++) {\n renderCreatures(allInfo[x], \"#creatures-template\", \".creaturesClass\");\n }\n}", "displ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check if it's less than 30
function isLessThanThirty(num) { return num < 30 ? true : false; }
[ "function isLessThan30(num) {\n if(num < 30){\n return true;\n }\n return false;\n}", "function isLessThan30(num) {\n // your code here\n return num < 30 ? true : false;\n }", "function isLessThan30(num) {\n return num > 30\n}", "function isLessThan30(num) {\n if (num < 30) {\n return true...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the impedance (adjecancy) matrix for the nodes in this circuit as a list of complex numbers Requires a specific angular frequency as input!
get_graph(w) { let matrix = [...Array(this.nodes.length)].map(e => Array(this.nodes.length).fill(Z_open())); for(let e of this.edges) { matrix[e.i][e.j] = e.get_impedance(w); matrix[e.j][e.i] = matrix[e.i][e.j]; } return matrix; }
[ "function assemble_matrix(circuit){\n // extract number of nodes and independent voltage sources (n, m)\n let nodes = [];\n let resistors = [];\n let n = 0; // number of nodes (exclude reference node)\n let m = 0; // number of independent voltage sources\n\n // separate resistors and sources\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
console.log(JSON.stringify($scope.items)); $scope.items = getItems(); GET ITEMS FROM SERVER
function getItems() { var newItems = get('get-items.php?startDate='+$scope.startDate+';duration='+$scope.duration); console.log(newItems); }
[ "function init(){\n \tGetDataService.getItems().then(function(response){\n\t\t\t$scope.items = response.data.items;\n\t\t\t//console.log($scope.items);\n\t\t});\n\t}", "function getItems(){\n return items;\n}", "function getItems(){\n return items\n }", "function loadItems() {\n API.getItems()\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Let's play this game! loadImages(); setupKeyboardListeners(); main();
function startgame() { loadImages(); setupKeyboardListeners(); main(); }
[ "function startGame(){\n loadImages();\n window.addEventListener('keydown', handleKeyDown, true);\n window.addEventListener('keyup', handleKeyUp, true);\n runGame();\n}", "function startGame() {\n\tsetup();\n\tmainLoop();\n}", "function main() {\n initGame();\n}", "function init() {\n \n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the pixel value
getPixel () { return this.pixelArray[0] }
[ "function getPixelValue(_data, _x, _y, _c) {\n\treturn _data.data[(_y * _data.width + _x) * 4 + _c];\n}", "function getPixelValue(element, value, useYAxis) {\n\t\t\t// Remember the original values\n\t\t\tvar axisPos = useYAxis ? \"top\" : \"left\",\n\t\t\t\taxisPosUpper = useYAxis ? \"Top\" : \"Left\",\n\t\t\t\te...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add plugins to the config mutates config.
function addPlugins(config, plugins) { config.plugins = config.plugins ? config.plugins.slice() : []; plugins.forEach(plugin => config.plugins.push(plugin)); return config; }
[ "addConfig(config) {\n this.pluginConfig.push(config);\n }", "addPlugins(...plugins) {\n InstancePlugin.initPlugins(this, ...plugins);\n }", "function _registerPlugins(config, plugins) {\n\tif (typeof config.plugins === 'undefined' || !config.hasOwnProperty(\"plugins\") || ! config.plugins) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
I cannot for the life of me figure out how to install openalpr so heres a shell command takes a filename string and a single variable callback function
function parse(filename, callback) { //run the command exec('alpr -j -c us '+ filename, function(error, stdout, stderr) { // if null, bad things if(error != null) { // if error, bad things console.log('oh no'); } output = JSON.parse(stdout); ...
[ "function nativefy(appName, url, savePath) {\n\n\tconst command = `nativefier -n ${appName} ${url} ${savePath}`;\n\tfs.appendFileSync(\n\t\tpath.join(__dirname, 'logs', 'nativefyrunlog.log'),\n\t\t`[${moment().format('DD-MMM-YYYY : HH:mm:ss')}] - ` + command + '\\n\\n', 'utf8'\n\t)\n\tconsole.log(`\n\t\t#----------...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Performs dynamic hover class rewriting to work around the IE6 :hover bug (needs CSS changes as well)
function rewriteHover() { var gbl = document.getElementById("hover-global"); if(gbl == null) return; var nodes = getElementsByClass("hoverable", gbl); for (var i = 0; i < nodes.length; i++) { nodes[i].onmouseover = function() { this.className += " over"; } nodes[i].onmouseout = function() { this.cl...
[ "function ie6_hover() {\n\t$('.ie6-hover').hover(function() {\n\t\t$(this).toggleClass('ie6_hover');\n\t});\t\n}", "function rewriteHover() {\n\tvar gbl = document.getElementById(\"hover-global\");\n \n\tif(gbl == null)\n\t\treturn;\n \n\tvar nodes = getElementsByClass(\"hoverable\", gbl);\n \n\tfor (var i = 0; i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Edit MemberHospital Success Function
function EditMemberHospitalSuccess() { if ($("#updateTargetId").html() == "True") { //now we can close the dialog $('#editMemberHospitalDialog').dialog('close'); //JQDialogAlert mass, status JQDialogAlert("Hospital updated successfully.", "dialogSuccess"); memberHospitalOb...
[ "function editAdmit() {\n var testAdmit = {\n KEYID: $scope.currentAdmitKEYID,\n PATSTATUS: 'A',\n SOCDATE: $scope.M0030_START_CARE_DT\n };\n dataService.edit('admission', testAdmit).then(function(response){\n console.log(response);\n });\n //edit patient table to udpate PATSTAT...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[1][placeholder] uu.format("? dogs and ?", 101, "cats") > "101 dogs and cats" uu.format placeholder( "?" ) replacement
function uuformat(format) { // @param String: formatted string with "?" placeholder // @return String: "formatted string" var i = 0, args = arguments; return format.replace(uuformat._PLACEHOLDER, function() { return args[++i]; }); }
[ "function stringFormat(){\n var i,\n len,\n placeholder,\n args = arguments,\n result = args[0];\n\n //console.log(args);\n //we take value on position 0\n for(i = 1, len = args.length; i < len; i += 1){\n placeholder ='{' + (i - 1) + '}';\n while(result.indexOf...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Displays IAM Managed Policy
function showIAMManagedPolicy(policyId) { if (getFormat() === resultFormats.json) { var data = runResults['services']['iam']['policies'][policyId] } else if (getFormat() === resultFormats.sqlite) { console.log('TODO (SQLite) 6') } data['policy_id'] = policyId showIAMPolicy(data) }
[ "function showIAMInlinePolicy(iamEntityType, iamEntityName, policyId) {\n if (getFormat() === resultFormats.json) {\n var data = runResults['services']['iam'][iamEntityType][iamEntityName]['inline_policies'][policyId]\n } else if (getFormat() === resultFormats.sqlite) {\n console.log('TODO (SQLi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a thunk, basically a function that returns another function a) first returned function takes arguments that are cached within the closure b) second returned function takes a cb as only argument and calls the "thunkified" function with concated cached args and cb
function thunkify(thunkFn) { return (...args) => { return (cb) => { thunkFn.apply(this, [...args, cb]); }; }; }
[ "function thunkify(fn) {\n return function() {\n var args = Array.prototype.slice.call(arguments);\n var ctx = this;\n\n return function(cb) {\n args.push(cb);\n fn.apply(ctx, args);\n };\n };\n}", "function thunkify1(fn) {\n\treturn function () {\n\t\tvar args = [].slice.call(arguments);\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function randomly generates promotional codes TODO: Change product to lowest price of brand before calculating savings
function generatePromotionalCodes(products) { var promotionalCodesMax = 20 var maxQuantity = 3 var maxSavings = .5 var tempPromotionalCodes = { } var productKeys = Object.keys(products) var brandProducts = [ ] for (let count = 0; count < promotionalCodesMax; count++) { var productKey = productKeys[Mat...
[ "function generateClubSavings(products) {\n var clubSavingsProportion = .2\n var maxSavings = .3\n var tempClubSavings = { }\n for (product in products) {\n if(Math.random() < clubSavingsProportion) {\n var clubSavings = Math.floor(products[product].price * (Math.random() * maxSavings) * 10) / 10\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
' Name : checkForProcessAsImmediate ' Return type : Boolean ' Input Parameter(s) : jsonType ' Purpose : This method is used to check the request as process as immediate. ' History Header : Version Date Developer Name ' Added By : 1.0 19 Feb 2014 UmamaheswaraRao '
function checkForProcessAsImmediate(jsonType) { var cvvRequiredStatus = null; if(!parseBoolean(localStorage.getItem("registerUser"))) { /* Checking for Guest user */ return true; } else if($('#mainPaymentOptionsContainer').is(":hidden")) { /* Checking if Credits cover all the amount due */ return true; } else i...
[ "hasHandlingProcess() {\n return (this.handlingProcess) ? true : false\n }", "function IsExist(AppProcess)\n{\n if(AppProcess!=null)\n {\n var Application=Sys.WaitProcess(AppProcess)\n if (Application.Exists)\n {\n Log.Message(\"Application is running\")\n return true \n }\n else\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Here you have an fabulus action to dispatch the main shredding task, accept the text from the caller as the only param The main purpose for this action is to be call On the onClick event on of the 'ShreddIt' Button.
static sendTextToShredder (text) { AppDispatcher.dispatch({'action': ActionTypes.TEXT_TO_SHREDD, 'text': text}); }
[ "function runAction() {\n id = document.getElementById('action_id_field').value;\n CommonContainer.actions.runAction(id, CommonContainer.selection.getSelection());\n}", "onClick() {\n\t\tthis.props.mainAction({\n\t\t\tname: this.props.workspace.name\n\t\t});\n\t}", "function actionButton() {\n\n\t\tif ( deb...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set cookie on response.
function setcookie(res, name, val, secret, options) { // name var name = opts.name || opts.key || 'connect.sid' by default // val is req.sessionID // secret is secret[0] // options = req.session.cookie.data // signature = require('cookie-signature') var signed = 's:' + signature.sign(val, secret); // ma...
[ "function SetResponseCookie(cookie)\n{\n // Save the cookies, expiring tomorrow\n var expDate = new Date();\n expDate.setTime(expDate.getTime() + (1 * 24 * 3600 * 1000));\n SetCookie(response_name, cookie, expDate, \"/\", null, false);\n}", "async _addCookieToResponse (h) {\n h.cookie(this.cookieName, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handler for onConnect event: check origin check if tab already connected check if another tab is already connected otherwise connect the port
function onConnectListener(port) { if (port.name != "googlemusic") throw "invalid port: " + port.name; console.debug("cs connects"); if (isConnectedTab(port)) { port.postMessage({ type: "alreadyConnected" }); } else { if (googlemusicport) { parkedPorts.push(port); port.onDis...
[ "function connectPort() {\n port = chrome.runtime.connect({\n name: 'proxy',\n });\n\n window.addEventListener('message', handleMessageFromPage);\n\n port.onMessage.addListener(handleMessageFromDevtools);\n port.onDisconnect.addListener(handleDisconnect);\n}", "function connectPort(port) {\n googlemusi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
recursive function to convert from hex to chars
function rawChars (hexData) { var output = "", i, k; for (i=0;i<hexData.length;i++) { if (typeof hexData[i]=="object"&&typeof hexData[i].push=="function") { output += rawChars(hexData[i]); } else { if (typeof hexData=="string") { output += String.fromCharCode(parseInt(hexData[i]+hexData[i+1], 16)...
[ "function hex_ascii(hex_string){\n\treturn split_text(2,hex_string).reduce(function(string, ele){\n\t\treturn string + String.fromCharCode(parseInt(ele, 16))\n\t},\"\")\n\n}", "function translator(hex) {\n var arr = hex.match(/../g);\n var response = '';\n for (i = 0; i < arr.length; i++) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handles the transaction data you have entered
function handleTransaction(event){ event.preventDefault(); var formData = new FormData(event.target); var transactionObject = new TransactionObject(formData.get('title'), formData.get('amount'), formData....
[ "function handleTransaction (data) {\n var last = transactions[0];\n var price = data.value[2];\n\n var trade = {\n time : moment.unix(data.value[7]),\n amount : valueFilter(data.value[0], 8),\n price : valueFilter(price, 5),\n type : data.value[3] === data.value[5] ? 'buy' : 'sell...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Commits from rebased PRs do not have messages that tie them to a PR Instead we have to find all PRs since the last release and try to match their merge commit SHAs.
getPRForRebasedCommits(commit, pullRequests) { const matchPr = pullRequests.find((pr) => pr.merge_commit_sha === commit.hash); if (!commit.pullRequest && matchPr) { const labels = matchPr.labels.map((label) => label.name) || []; commit.labels = [...new Set([...labels, ...commit.l...
[ "getPRForRebasedCommits(commit, pullRequests) {\n const matchPr = pullRequests.find(pr => pr.merge_commit_sha === commit.hash);\n if (!commit.pullRequest && matchPr) {\n const labels = matchPr.labels.map(label => label.name) || [];\n commit.labels = [...new Set([...labels, ...com...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the Fragment in the main Navigation that is capable if displaying employees of a chair and apply to the chair or accept applications.
renderEmployeeFragment() { // Rechte aus Rollen ableiten const personCanEditEmployees = this.props.personIsChairAdmin || this.props.personIsSuperAdmin, personCanManageChairAdmins = this.props.personIsChairAdmin || this.props.personIsSuperAdmin, personCanApplyToChair = !this....
[ "function DisplayNav() {\n switch (userInfo.accountType) {\n case 'E':\n return (<EmpNav />)\n\n case 'U':\n return (<UserNav />)\n\n default:\n return (<VisitNav />)\n }\n }", "onRender () {\n let Navigation = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register routes related to accounts
registerRoutes() { this.router.get(`/`, this.getAllAccounts.bind(this)); }
[ "register(){\n this.userIsOnline();\n this.getAllUsers();\n this.getAllUsersWithOutBan();\n this.getUserName();\n this.getUserChats();\n this.deleteUser();\n this.updateUser();\n this.updateRankUser();\n this.updatePassword();\n \n this.Ap...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete weblas pipeline tensor
deleteWeblasTensor () { if (this.weblasTensor) { this.weblasTensor.delete() delete this.weblasTensor } }
[ "createWeblasTensor () {\n if (this.weblasTensor) {\n this.weblasTensor.delete()\n }\n if (this.weblasTensorsSplit) {\n this.weblasTensorsSplit.forEach(t => t.delete())\n }\n\n if (this.tensor.shape.length === 1) {\n const len = this.tensor.shape[0]\n if (len > MAX_TEXTURE_SIZE) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
displays a game page to the user
function displayGame(req, res, game){ var release = getReleaseDate(game.release_date); var banner = getBanner(game.screenshots); var rating = getRating(game.rating); return res.render('game', { title: game.display_name, layout: 'primary', file: 'game', user : req.user, ...
[ "function loadGamePage() {\n $(\"#landing\").addClass(\"hide\");\n $(\"#hof\").addClass(\"hide\");\n $(\"nav\").removeClass(\"hide\");\n $(\"#game\").removeClass(\"hide\");\n\n setGame();\n $(\"#timer\").text(timer);\n $(\"#score\").text(score)\n }", "function r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check the lastest component from localStorage or passed by sub header and updated the current component params: string component, fn changeComponent
function checkComponent(component, props = null) { switch (component) { case 'Inbox': changeCurrentComponent(goTo(Inbox)); break; case 'Contacts': changeCurrentComponent(goTo(Contacts)); break; case 'NewContact': changeCurrentComponent(goTo(NewContact, props)); break; case 'Setting...
[ "function updateRecentlyEditedComponents() {\n\n }", "linkComponentToStoreItem(component) {\n // get components data-param-dec-id (can come from token from db)\n let decId = DynamicContentService.getDataParamDecid(component);\n\n if (decId > 0) {\n this.logger.debug('DC: Already wired up', {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initializes the dns tracer. process.env.EPSAGON_DNS_INSTRUMENTATION=true is requird.
init() { if ((process.env.EPSAGON_DNS_INSTRUMENTATION || '').toUpperCase() === 'TRUE') { const dnsExportedFunctions = Object.keys(dns); Object.keys(rrtypesMethods).forEach((functionToTrace) => { if (dnsExportedFunctions.includes(functionToTrace)) { mod...
[ "init() {\n if ((process.env.EPSAGON_DNS_INSTRUMENTATION || '').toUpperCase() === 'TRUE') {\n const dnsExportedFunctions = Object.keys(dns);\n Object.keys(rrtypesMethods).forEach((functionToTrace) => {\n if (dnsExportedFunctions.includes(functionToTrace)) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return the 2D point intersection between two lines defined by one 2D point and a slope each.
function lineIntersection(point1, slope1, point2, slope2) { // s1/s2 = slope in degrees var m1 = tan(slope1 * radians), m2 = tan(slope2 * radians), p = [0, 0]; p[0] = (m1 * point1[0] - m2 * point2[0] - point1[1] + point2[1]) / (m1 - m2); p[1] = m1 * (p[0] - point1[0]) + point1[1]; ...
[ "function lineIntersection(line1, line2){\n let x = (line1.yIntersect - line2.yIntersect)/(line2.slope - line1.slope)\n let y = line1.f(x)\n\n // return a point with x and y ROUNDED to 2 decimals\n return new simplePoint(Math.round(x*100)/100, Math.round(y*100)/100)\n}", "static intersectionPoint( line1, line...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Destroys the Networking instance, transitioning it into the Closed state.
destroy() { this.state = { code: NetworkingStatusCode.Closed, }; }
[ "function destroy() {\n if (network !== null) {\n network.destroy();\n network = null;\n }\n}", "destroy() {\n\t\tthis.stopMonitoring();\n\t\tthis.socket.close();\n\t}", "destroy () {\n this._socket.close()\n this._rtc.close()\n this._removeEventListeners()\n }", "_destroy() {\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
desc : lock the dropbox operation while there is no token available call : initialDropboxService(), initialize the dropbox service tab
function controlDropboxService(options) { switch(options) { case "lock": for(var i = 0 ; i < $('#service-dropbox li .dropboxOperation').length ; i++) { $($('#service-dropbox li .dropboxOperation')[i]).attr('data-toggle', 'none'); $($('#service-dropbox li .dropboxOperation')[i]).addC...
[ "function initialDropboxService() {\r\n // parse URL to check whether Dropbox authorization is set\r\n var params = window.location.href.slice(window.location.href.indexOf('#') + 1).split('&');\r\n if(params.length > 0)\r\n {\r\n var access_token = $.getUrlVarsByChar('#',\"access_token\");\r\n var token_t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get all texts from an article and split into words
function getSentences(tag) { for (i = 0; i < tag.length; i++) { var text = tag[i].textContent if (text.indexOf(" ") !== 1) { if (text !== "") { allTexts.push(text); } } } for (i = 0; i < allTexts.length; i+...
[ "function getSentences(tag) {\n for (i = 0; i < tag.length; i++) {\n var text = tag[i].textContent\n if (text.indexOf(\" \") !== 1) {\n if (text !== \"\") {\n allTexts.push(text);\n }\n }\n }\n\n\n\n for (i = 0; ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reset cards if they are not a match Times out the board Sets a timeout for removing the classes off visible
function resetCards() { timeOutBoard = true; setTimeout(function () { firstCard.classList.remove('visible'); secondCard.classList.remove('visible'); resetGame(); }, 1000); }
[ "function cardsUnMatch() {\n disableAllCards();\n for (const openedCard of openedCards) {\n openedCard.classList.add('unmatched');\n };\n setTimeout(function () {\n for (const openedCard of openedCards) {\n openedCard.classList.remove('show', 'open', 'unmatched');\n };\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
determines if a time difference is a deviation (default is > +30 minutes) devTime is in minutes
function isDev(actualTime, schedTime, devTime) { if (devTime === undefined) { devTime = 30; } if (typeof actualTime !== 'undefined' && typeof schedTime !== 'undefined') { //get the difference in minutes, then round down to the nearest minute if (Math.floor(Math.abs((actualTime - sche...
[ "function lessThanAMinute(t1,t2)\n{\n \n const t1Date = new Date(t1.time);\n const t2Date = new Date(t2.time); \n const difference = Math.abs(t1Date - t2Date);\n\n return ((Math.round(difference/1000))<= 60) ;\n\n}", "function timeDiff(startTime, endTime) {\n const hrDiff = parseInt(endTime.substring(0, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register default block packages with this runtime.
_registerBlockPackages () { for (const packageName in defaultBlockPackages) { if (defaultBlockPackages.hasOwnProperty(packageName)) { // @todo pass a different runtime depending on package privilege? const packageObject = new (defaultBlockPackages[packageName])(this);...
[ "_registerBlockPackages() {\n for (const packageName in defaultBlockPackages) {\n if (defaultBlockPackages.hasOwnProperty(packageName)) {\n // @todo pass a different runtime depending on package privilege?\n const packageObject = new defaultBlockPackages[packageName](this); // Collect primitiv...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Next 20 Leap Years
function leapYears() { var yearsPrinted = 0; var currentYear = 2021; while (yearsPrinted < 20) { if ((currentYear % 4 === 0) && (!((currentYear % 100===0) && (currentYear % 400 !== 0)))) { document.write(currentYear+"<br>") yearsPrinted++; currentYear++; ...
[ "function leapYear() {\r\n var currentYear = 2021;\r\n var l = 0;\r\n while (l <= 20) {\r\n if (\r\n (currentYear % 4 == 0 && currentYear % 100 != 0) ||\r\n currentYear % 400 == 0\r\n ) {\r\n document.write(currentYear + \"<br>\");\r\n l++;\r\n }\r\n currentYear++;\r\n }\r\n}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }