query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
The start page functions. / Function for monitoring the start page button and updating the quizStarted value once it's pressed, then triggers a rerender of the page. This function is run as a callback in the 'main' function.
function quizStartPageStartButton() { $('.js-main').on('click', '.js-start-page-submit', (evt) => { evt.preventDefault(); STORE.quizStarted = true; render(); }); }
[ "function handleStartQuiz() {\n\t$(\"main\").on(\"click\", \".startButton\", function(e) {\n\t\tcurScore = 0;\n\t\tcurQuestion = 0;\n\t\tupdateScore();\n\t\trenderQuestion();\n\t});\n}", "function main() {\n render();\n quizStartPageStartButton();\n questionSubmitButton();\n resultsResetButton();\n nextQuest...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
AUTO ZOOM / "HOME" FUNCTIONS... function locates the center point of a cluster of predicates and the size of the bounding box
function findBoundingBox() { //first locate center-of-mass, as starting location for boundary box sides... COMx = 0 COMy = 0 totalPredicates = 0 biggestRadius = 0 //If no predicates are selected find bound box for all predicates... if(selectedPredicates.length==0){ for(i=0;i<myPredicates.length;i++){ ...
[ "centreOn() {\r\n let mx, my;\r\n if (typeof arguments[0] === \"number\" && typeof arguments[1] === \"number\") {\r\n mx = constrain(arguments[0], 0, this.SIZE - 1);\r\n my = constrain(arguments[1], 0, this.SIZE - 1);;\r\n } else if (typeof arguments[0] === \"string\") {\r\n if ((arguments[0...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
defaults for crud list
static getCrudDefaults() { return { sortField: "creationDate", sortDir: "desc", }; }
[ "static get defaultParameters () {\n return {\n paginate: true,\n limit: 10,\n offset: 0,\n orderDirection: 'ASC',\n multipleOrderColumns: false\n };\n }", "function buildList() {\n $log.debug(\"Building list...\");\n vm.list = O...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
MiddleWare para validar la existencia del usuario en la base de datos
async function validateExistence(req, res, next){ try{ const { username, email } = req.body; const [user_database] = await sequelize.query( `SELECT * FROM user_database`, { raw: true }, ); const user = user_database.find( item => item.username == user...
[ "static checkUserExists(req, res, next) {\n User.getUserByEmail(req.body.email)\n .then(newUser =>{\n if (newUser.rows[0]) return errHandle(409, 'user already exists', res);\n return next();\n })\n }", "function validateUser(req, res, next) {\n if (!req.body) {\n res.status(400).json({ m...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
initialize the biome parameters
_InitBiomes(params) { params.guiParams.biomes = { octaves: 2, persistence: 0.5, lacunarity: 2.0, exponentiation: 3.9, scale: 2048.0, noiseType: 'perlin', seed: 2, exponentiation: 1, height: 1 }; const onNoiseChanged = () => { for (let k in this._c...
[ "_initAudioParams() {\n this.inputGain = this.audioComponents.inputGain.gain;\n this.outputGain = this.audioComponents.outputGain.gain;\n this.pan = this.audioComponents.panner.pan;\n }", "inicializa(){\n globais.flappyBird = criarFlappyBird();\n globais.canos = criarCanos();\n globais.ch...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use one ParserHandle per entire CSV file or string
function ParserHandle(_config) { // One goal is to minimize the use of regular expressions... var FLOAT = /^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i; var self = this; var _input; // The input being parsed var _parser; // The core parser being used var _paused = false...
[ "function csvParser(options) {\n var csvOptHeaders, csvHeaders, csvHeaderDataTypes, allHeadersString = false;\n this.onEachRecord = function onEachRecord(recData, cb) { // The parser function\n var payload, json = {};\n if (!csvHeaders) {\n if (options.csvHeaders) { // if csvHeaders were supplied i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTIONS function createShirtThemeOption() Create and append an option to the color selection menu that acts as an alert to the user to select a theme
function createShirtThemeOption() { const tempOption = document.createElement('option'); tempOption.innerText = 'Please select a T-shirt theme'; tempOption.setAttribute('selected', 'selected'); tempOption.setAttribute('id', 'selectShirtThemeOption'); const firstColorOption = shirtColorOptions[0]; shirtColor...
[ "function Create_Llama_Settings () {\n var option_box = document.getElementById(\"LlamaOptions_Box\")\n var theme_menu = document.createElement(\"div\")\n theme_menu.className = \"shadow-sm\"\n theme_menu.setAttribute(\"id\", \"llama_settings\")\n theme_menu.innerHTML = `\n<div id=\"\" style=\"width:100%; font...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to get elements of .mug and .landscape and change opacity
function changeImageOpacity(opacity){ chrome.tabs.executeScript(null,{ code:"var all = document.getElementsByClassName('landscape');for (var i = 0; i < all.length; i++) {all[i].style.opacity = "+opacity+";}" }); chrome.tabs.executeScript(null,{ code:"var all = document.getElementsByClassName('mug');for (v...
[ "function Opacity() {\n let box = document.getElementsByClassName('box');\n let indomap = document.getElementsByClassName(\"indomap\");\n console.log(window.scrollY);\n if (window.scrollY >= 550 && window.scrollY <= 980) {\n for (let i = 0; i < box.length; i++) {\n let transparency = N...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds a theme by id.
function find(id) { return models.Theme.findByPk(id); }
[ "function destroy(id) {\n return models.Theme\n .destroy({\n where: { id }\n });\n}", "findTheme(search) {\n if (typeof search== \"string\") search={id: search};\n if (!search) {\n return this.treeMum.getChild();\n }\n function innerFind(search, myTree) {\n if (!myTree) return;\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a list of all channels for the given group that a user has the correct permissions to view.
function getGroupChannelsForUser(username, groupname){ var ret = []; var user = getUserByName(name); var group = getGroupByName(groupname); for(ch in group.channelList){ var isValid = false; for(u in ch.users){ if(u.name == username){ isValid = true; } } if(user.perms >= 1 ||...
[ "async getAccountChannel(){\n await fetch('/rest/accountchannels/accountid/' + this.currentAccount.id )\n .then( loggedInAccountChannels => loggedInAccountChannels.json() )\n .then( loggedInAccountChannels => this.loggedInAccountChannels = loggedInAccountChannels );\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an object that describes a keyboard layout. The objects prototype will give it accessors for 'default' and 'enabled' that will read or change the proper setting from currentSettings.
function KeyboardLayout(options) { for (var key in options) { this[key] = options[key]; } }
[ "function getLayoutDetails(layoutName, layoutFile) {\n // The keyboard layout files are JavaScript files that add properties\n // to the Keybords object. They are not clean JSON, so we have to use\n // use the scriptloader to load them. That also gives stacktraces for\n // errors inside the keyboard fil...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reset the row width. Takes in to account group depth.
[resetRowWidth]() { const self = this; self.width(self[CURRENT_AVAILABLE_WIDTH] - self[INDENT_WIDTH]); }
[ "set width( w ) {\n if ( !this.el ) return;\n\n if ( w === 'default' ) {\n this.parent.style.width = this.opts.cols * this.charWidth + 'px';\n return;\n }\n\n this.parent.style.width = w + 'px';\n }", "updateWidth() {\n if (this.setupComplete) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
nums: list of numbers 1..[max_num]; exactly one digit will be missing. max_num: Largest potential number in list >>> missing_number([7, 3, 2, 4, 5, 6, 1, 9, 10], 10) 8
function missingNumber(nums, maxNum) { let numsObj = new Object(); for ( i = 1; i <= maxNum; i++){ numsObj[i] = false; } for ( i = 0; i < nums.length; i++){ let index = nums[i]; numsObj[index] = true; } for (key in numsObj) { if (numsObj[key] === false) { ...
[ "function missingNum(arr) {\n\tfor (let number=1; number<=10; number++) {\n\t\tif (! arr.includes(number)) return number;\n\t}\n}", "function findMissingNumber(str) {\n let array = str.split(' ').map(Number);\n let largest = array.length + 1;\n let sum = 0;\n for (let i = 0; i < array.length; i++) {\n sum ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Traverses the concepts' descendants, setting isOpen = false as it goes.
function closeDescendants(concept) { concept.isOpen = false; concept.items.forEach(child => { if (child.items) { closeDescendants(child); } }); }
[ "closeChildren() {\n var children = this.children || {};\n _.each(children, child => this.closeChildView(child));\n }", "function toggleChildrenVisibility() {\n toggleVisibility($(this));\n const children = $(this).children();\n children.each(function () {\n toggleVisibility...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checks if stats logging (or debug mode) is enabled
function isStatsLogEnabled () { return flags.DEBUG || flags.LOG_STATS }
[ "function isLogEnabled () {\n return flags.DEBUG || flags.LOG_ENABLED\n }", "function debugEnabled(){\n let debug = false\n for (const arg of process.argv.slice(2)) {\n if ( arg === 'debug') {\n debug = true;\n break;\n }\n }\n return debug;\n}", "level() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
B button converts 5 A's into 1 B
function click_b() { "use strict"; convert(Harvester.config.cost.b, {"b": 1}); }
[ "function generateAbcBtns() {\n let html = '';\n for (const letter of alphabet) {\n html += `<button class=\"my-btn btn-abc btn btn-primary m-1 col-1 p-1\" id=\"btn-${letter}\">${letter}</button>`;\n }\n document.getElementById('abc-btns').innerHTML = html;\n addAbcList...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if num is an acceptable value for the given row
function isRowOk(grid, row, num) { for (var col = 0; col < 9; col++) if (grid[row][col].value == num) return false; return true; }
[ "function isColOk(grid, col, num) {\n for (var row = 0; row < 9; row++)\n if (grid[row][col].value == num)\n return false;\n\n return true;\n }", "function checkNotInRow(mat,num,row){\r\nfor (let col = 0 ; col < 9 ;col++ ){\r\n if ( mat [row] [col] == num){\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handles the state when we're currently in the "local part" of an email address (as opposed to the "domain part")
function stateEmailLocalPart(stateMachine, char) { if (char === '.') { stateMachine.state = 23 /* EmailLocalPartDot */; } else if (char === '@') { stateMachine.state = 24 /* EmailAtSign */; } else if (isEmailLocalPartChar(char))...
[ "function check_email(email) {\n\t\t\t\t\tif(email === null) { \n\t\t\t\t\t\treturn false; \n\t\t\t\t\t}\n\t\t\t\t\telse if(email.domain === \"mumail.\") {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} \n\t\t\t\t\telse return false;\n\t\t\t\t}", "function isEmailLocalPartChar(char) {\n return emailLocalPartCharRe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
MM_FlashDetectedSelf() recall whether Flash Player has detected itself Synopsis: MM_FlashDetectedSelf() Returns: true if a cookie signifying that Flash Player has detected itself is set; false otherwise. Description: This function is only meant to be called internally.
function MM_FlashDetectedSelf() { return (document.cookie.indexOf("MM_FlashDetectedSelf") != -1); }
[ "function MM_FlashRememberIfDetectedSelf(count, units)\r\n{\r\n // the sniffer appends an empty search string to the URL\r\n // to indicate that it is the referrer\r\n\r\n if (document.location.search.indexOf(\"?\") != -1)\r\n {\r\n\tif (!count) count = 60;\r\n\tif (!units) units = \"days\";\r\n\r\n\tva...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if module version is loaded
function isLoaded(ns, version) { const namespace = moduleCache[ns] || (moduleCache[ns] = Object.create(null)); version = version || null; if (namespace[version]) return true; if (version == null && namespace.length > 0) return true; return false; }
[ "function checkIfVersionExists(modulename, version) {\n var moduleObject = require(modulename);\n var classname = \"v\" + version;\n if (moduleObject[classname]) {\n return true;\n }\n else {\n return false;\n }\n}", "function checkPlugin()\n{\n\tvar dllVer = getRequestParameter('d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The Public Key returned is obtained from the Private Key. First, yeu get the Public/Private key pair from the Private Key String. Then, you get the Public Key (x, y) coordinate from the Key Pair object. When obtaining a Public Key string from the Key pair object... You take the "x" coordinate value of the Public Key an...
function getPublicKeyFromPrivateKey(privateKeyString) { let keyPair = ec.keyFromPrivate(privateKeyString); // Below is the Public Key with it's X and Y ccordinate. let keyPairPublic = keyPair.getPublic(); // Get the below X and Y ccordinate values for the Public Key. // They will be in JavaScript BN (BigNumber) ...
[ "getPrivKey() {\n var output = PrivKeyAsn1.encode({\n d: this.key.priv.toString(10),\n }, \"der\")\n return output.toString('hex')\n }", "async _publicKeyFromCertificate (crtPath) {\n let output = '';\n await this.opensslCommand(\n ['x509', '-noout', '-in', crtPath, '...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
functions // iterate through classNamesArray grab dom elements associated w/ each class return an array of dom elements
function getElements() { // logic var domEls = []; for (var i = 0; i < classNamesArray.length; i++) { domEls.push(document.getElementsByClassName(classNamesArray[i])); } return domEls; }
[ "function getElementsByClassName(node, classname) {\n\t\t var a = [];\n\t\t var re = new RegExp('(^| )'+classname+'( |$)');\n\t\t var els = node.getElementsByTagName(\"*\");\n\t\t for(var i=0,j=els.length; i<j; i++)\n\t\t if(re.test(els[i].className))a.push(els[i]);\n\t\t return a;\n\t\t}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates a site script with new values. In the REST call, all parameters are optional except the site script Id.
updateSiteScript(updateInfo, content) { if (content) { updateInfo.Content = JSON.stringify(content); } return SiteScriptsCloneFactory(this, "UpdateSiteScript").run({ updateInfo }); }
[ "function updateGlobalScript(axios$$1, identifier, scriptId, versionId, request) {\n return restAuthPost(axios$$1, 'instance/microservice/' + identifier + 'scripting/scripts/' + identifier + '/' + scriptId + '/versions/' + versionId, request);\n }", "function updateTenantScript(axios$$1, identifier, tenantTok...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draw sparklines based on the JSON code from the Sparkline HTML element
function drawSparklines() { var $data = $('sparkline'), sparkline, obj; for (var i = 0; i < $data.length; i += 1) { sparkline = $($data[i]); obj = sparkline.data('sparkline'); // Obtain the JSON code obj.tooltip.positioner = tooltipPos; // Correctly position the tooltip sparklin...
[ "function sparkline_charts() {\r\n\t\t\t$('.sparklines').sparkline('html');\r\n\t\t}", "function initSparkline(el, values, opts) {\r\n el.sparkline(values, $.extend(sparkOpts, el.data()));\r\n }", "function sparklineChartCtrl() {\n\n /**\n * Inline chart\n */\n var inlineData = [34, 43, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
authorize the user against the patient, and then against all medications specified in medications_id additionally, only allow clinicians to access clinician notes
function authorize(access) { return function (req, res, next) { // first authorize read access against the patient auth.authorize(access)(req, res, function (err) { if (err) return next(err); // find journal entry from ID // TODO: we're making duplicate find call...
[ "function checkReviewer(req, res, next) {\n // Find the user in charge of course\n Course.findById(req.params.courseId)\n .exec(function(err, course) {\n if(err) return next(err);\n // Check that the current authenticated user is not the same as the user\n // in c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
dynamically change the virtual camera offset
function changeVirtualOffset(newValue, dir) { // change the right and left camera at the same time if (dir == 'x') { cameraProjection.cameraF1.setViewOffset( frame.frame_fisheye.width, frame.frame_fisheye.height, 0, 0, newValue, frame.frame_fisheye.offset.y ); imgMaterial1.uniforms.offsetVirtual.value.x = ...
[ "function changeVirtualFocal(newValue)\n{\n\t// change the right and left camera at the same time\n\n\timgMaterial1.uniforms.focalVirtual.value.x = newValue;\n\timgMaterial1.uniforms.focalVirtual.value.y = newValue;\n\n\timgMaterial2.uniforms.focalVirtual.value.x = newValue;\n\timgMaterial2.uniforms.focalVirtual.va...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Each meter view model
function MeterViewModel(id) { var self = this; self.id = "EM "+id; self.energies = ko.observableArray([]); $.get('/meters/'+id+'/energy', function(data) { $.each(data.energy, function(i, v) { self.energies.push(new MeterLinesViewModel(i, v)); }); }); self.ct = ko.observable(); self.vt =...
[ "function CombinedFilamendSpeedViewModel (parameters) {\n var self = this\n self.measured = parameters[0]\n self.calculated = parameters[1]\n\n // Chart configuration starts here\n self.index = 90\n self.chartElementSelectors = [\n { selector: '#model-filament-speed', chart: null }\n ]\n self.chartData =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determines if a given frame is a video key frame or not. This returns an array of booleans for each layer, since in the KWZ format, keyframe encoding is done on a perlayer basis.
getIsKeyFrame(frameIndex) { const flag = this.isKeyFrame(frameIndex) === 1; return [flag, flag]; }
[ "getIsKeyFrame(frameIndex) {\r\n const flag = this.getFrameDiffingFlag(frameIndex);\r\n return [\r\n (flag & 0x1) === 0,\r\n (flag & 0x2) === 0,\r\n (flag & 0x4) === 0,\r\n ];\r\n }", "getFrameCameraFlags(frameIndex) {\r\n this.seek(t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
takes an array of [lat,long] and returns the first 10 pts if less than 10 exist in full_path, returns the remaining as long as 2 remain if only 1 would remain, returns 9
function reduce_path(full_path){ let partial_path = []; if(full_path.length === 11){ partial_path = full_path.slice(0,9); }else{ partial_path = full_path.slice(0,10); }; return partial_path; }
[ "function findSnappedLocation(lineLocation){\n\tvar finalLocation=lineLocation;\n\tvar listSize=globalPlList.size;\n\tfor(var i=1;i<=listSize;i++){\n\t\tvar line = globalPlList.get(i.toString());\n\t\tif(line!=undefined){\n\t\t\tvar startPath=line.getPath().getAt(0);\n\t\t\tvar endPath=line.getPath().getAt(1);\n\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Visit a parse tree produced by PlSqlParseron_range_partitioned_table.
visitOn_range_partitioned_table(ctx) { return this.visitChildren(ctx); }
[ "visitSubpartition_by_range(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "visitComposite_range_partitions(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "visitRange_partition_desc(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "visitOn_list_partitioned_table(ctx) {\n\t return this.visitChildren...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
cubic helper formula at percent distance
function CubicN(percent, a, b, c, d) { const t2 = percent * percent; const t3 = t2 * percent; return a + (-a * 3 + percent * (3 * a - a * percent)) * percent + (3 * b + percent * (-6 * b + b * 3 * percent)) * percent + (c * 3 - c * 3 * percent) * t2 + d * t3; }
[ "function slider_equation(val)\n{\n return (4.5 * Math.pow(val,2) - (0.75 * val) + 0.25);\n}", "function charge(d) {\n return -Math.pow(d.radius, 2.0) / 8;\n }", "function cubic_interp_1d(p0, p1, p2, p3, x) {\n\t// Horner-scheme like separation of coefficients to save multiplication...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
constructor of TimerController class Just init model and view register Observer(View) call Subscribe to events
constructor() { this.model = new TimerModel(); this.view = new TimerView(this.model); this.model.registerObserver(this.view); this.subsribeToEvents(); }
[ "init() {\n this.#elemetn = this.getElement(this.UiSelectors.timer);\n }", "initialize() {\n\t\tconst weekTR = {ends:{value:7,unit:'days'},starts:{value:60,unit:'minutes'}};\n\t\tconst monthTR = {ends:{value:1,unit:'months'},starts:{value:60,unit:'minutes'}};\n\t\t\n\t\tthis.models['UserElectricityNowMo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GregorianCalendar class. no arguments: Constructs a default GregorianCalendar using the current time in the default time zone with the default locale. one argument locale: Constructs a GregorianCalendar based on the current time in the default time zone with the given locale.
function GregorianCalendar(loc) { var locale = loc || defaultLocale; this.locale = locale; this.fields = []; /* * The currently set time for this date. * @protected * @type Number|undefined */ this.time = undefined; /* * The timezoneOffset in minutes used by this date. * ...
[ "function getDefaultLocale() {\n return _defaultLocale;\n }", "static today() {\n return NepaliDate.fromgregorian(new Date());\n }", "function getDefaultHourSymbolFromLocale(locale) {\n var hourCycle = locale.hourCycle;\n if (hourCycle === undefined &&\n // @ts-i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
END getParentCategories() / set parent category id after selecteing from autocomplete
function selectedParentCategory(parent) { if(parent) { if (typeof parent.originalObject === 'object') { vm.skillForm.parentCategoryId = parent.originalObject.id; //getSubCategories(vm.skillForm.parentCategoryId); } else{ ...
[ "function selectCategory(event)\n{\n var category = jQuery(this).attr('ref');\n if (null != categoryTreeCash[category])\n {\n _updateSubCategoryPad(category, categoryTreeCash[category]);\n }\n else\n {\n jQuery.ajax({\n url: '/cash-register/index/get-categories/category/' ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GetAssetsByRange performs a range query based on the start and end keys provided. Readonly function results are not typically submitted to ordering. If the readonly results are submitted to ordering, or if the query is used in an update transaction and submitted to ordering, then the committing peers will reexecute to ...
async GetAssetsByRange(ctx, startKey, endKey) { let resultsIterator = await ctx.stub.getStateByRange(startKey, endKey); let results = await this.GetAllResults(resultsIterator, false); return JSON.stringify(results); }
[ "async GetAssetsByRangeWithPagination(ctx, startKey, endKey, pageSize, bookmark) {\n\n const {iterator, metadata} = await ctx.stub.getStateByRangeWithPagination(startKey, endKey, pageSize, bookmark);\n const results = await this.GetAllResults(iterator, false);\n\n results.ResponseMetadata = {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load app configurations, and merge into config object.
function configApp(appConfig) { for (var i in appConfig) { if (appConfig.hasOwnProperty(i)) { config[i] = appConfig[i]; } } }
[ "updateConfig(application) {\n const updatedConfig = { };\n const configs = Array.prototype.slice.call(arguments, 1);\n\n return this.getConfig(application).then(existingConfig => {\n ld.assign.apply(this, [updatedConfig, existingConfig].concat(configs));\n return this.set...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an array of objects representing the site regex strings where the extension is usable
function getRegexSiteMap() { var urlRegexString = "^(?:https?\:\/\/)?(?:www\.)?"; return [ {siteURL: "debug", urlRegex: "localhost"}, {siteURL: "youtube", urlRegex: urlRegexString + "youtube\.com\/watch.*"}, {siteURL: "pandora", urlRegex: urlRegexString + "pandora\.com.*"} ] }
[ "function gather(regex, replacement) {\n\ttext = String(this);\n\tmatches = [ ];\n\twhile ((match = regex.exec(text)) !== null) {\n\t\ttext = text.substring(0, match.index) + replacement + text.substring(match.index + match[0].length);\n\t\tmatches.push(match.slice(1).filter(x => x != undefined)[0]);\n\t}\n\treturn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
txt.js forked from Jack Rugile's text renderer in Radius Raid: o is an array of options with the following structure: / 0: text 1: x 2: y 3: hspacing 4: vspacing 5: halign 6: valign 7: scale 8: color options 911 are for animating the text percharacter. just sin motion 9: per character offset 10: delay, higher is slower...
function textLine(o) { //o 9,10,11 are 6,7,8 here if(!o[7])o[7]=1 if(!o[8])o[8]=1 var textLength = o[0].length, size = 5; for (var i = 0; i < textLength; i++) { var letter = []; letter = getCharacter( o[0].charAt(i) ); for (var y = 0; y < size; y++) { for (var x = 0; x < size; x++) { ...
[ "text(...args) {\n let opts = args[args.length - 1];\n\n if (typeof opts !== 'object') {\n opts = {};\n }\n\n if (!opts.lineGap) {\n opts.lineGap = lineGap;\n }\n\n if (opts.font) {\n this.doc.font(opts.font);\n } else {\n this.doc.font(lightFont);\n }\n\n if (opts.col...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
define a function "consoleSum" that takes in two numbers as arguments and console logs the sum of those two numbers
function consoleSum(x, y) { var sum = x + y; console.log(sum); }
[ "function addSum(a,b){\n var answer = a + b;\n//4. Create a function that returns the difference of two numbers that are arguments. Then console.log the function with the variables from step two as your two arguments.\n\n console.log (answer);\n}", "function add(num1, num2){\n     console.log(\"Summing N...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get 15 action films
function getActionFilms(){ var result = []; var FilmsRef = firebase.database().ref().child("FilmsList").child("Type").child("Action"); FilmsRef.orderByPriority().limitToLast(15).on("child_added",function(snapshot){ result.push(snapshot.val()); }); return result; }
[ "function getGenreAction(response){\r\n \r\n var i = 0;\r\n\r\n for(var x = 0; x < data.length; x++){\r\n\r\n if(data[x].gross >= 20000000 && data[x].genre === \"Action\"){\r\n\r\n response.write(\"<br>\" + data[x].movie + \"<br>\");\r\n \r\n }\r\n\r\n }\r\n \r\n\r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
a converter function for converting response to data for chart
function dataForChart(response) { var chartData = []; $.each( response.data, function( index, value ) { json_data = { date: new Date(value['ts']), value: value['value'].toFixed(2) }; chartData.push(json_data); }); return chartData; }
[ "function dataForTable(response) {\n return response;\n }", "generatePieChart(res) {\n const inputs = res.queryInput;\n const characteristicGroups = res.results[0].values;\n // const indicator = Utility.getStringById(inputs.indicators[0][\"label.id\"]);\n const dataPoints = res.results;\n const...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
run target is toughest monster to run away from based on run_fac curr_agility
function findRunTarget (groups) { var run_score = -1; var match; _.each(groups, function (group) { if (group.active) { _.each(group.members, function (member) { if (battleHelpers.isTargetable(member)) { if (run_score < member.run_score()) { ...
[ "evaluate(){\n let fastest = lifespan;\n for(let i = 0; i < this.popsize; i++){\n this.rockets[i].calcFitness();\n if(this.rockets[i].framesToFinish < fastest){\n fastest = this.rockets[i].framesToFinish\n }\n console.log(fastest)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Device List table PARAMS: params.user Optional CanopyUser object params.onCreateDeviceRequest params.autoRefreshInterval default 20000 METHODS: setDeviceQuery(dq)
function DmDeviceList(params) { cuiInitNode(this); var self = this; var autoRefreshInterval = (params.autoRefreshInterval ? params.autoRefreshInterval : 20000); var navBar; var canvas; var selectedDevice = null; var deviceQuery; var _deviceQuery; var devices; var interval; ...
[ "function renderUserWatchlist() {\n var dbPath = appUser.getWatchPath();\n\n // empty out stock-ticker content\n $(\"#stock-ticker-content\").empty();\n\n console.log(\"in renderUserWatchList() appUser.getWatchPath: \" + appUser.getWatchPath());\n\n database.ref(dbPath).once(\"value\", (snapshot) => ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns the url that shows the user's state
function getUserUrl(id) { var maxTime=dbStates({userid:id,time:{lte:selectedTime}}).max("time"); //if there are no entries for the user return default if(maxTime==null) { return "default_state.html"; } var state=dbStates({userid:id,time:maxTime}).first(); var url=state.url; ...
[ "function get_url(){\n return this.state.api_url;\n}", "function sendUserToStatePageOnSelectClick( element ) {\n var urlToSendUserTo = element.attr('data-state-url');\n window.location.href = urlToSendUserTo;\n }", "urlForLeaving() {\n return `/settings/${Spark.teamsPrefix}/${this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
IMGUI_API void TextWrapped(const char fmt, ...) IM_FMTARGS(1); // shortcut for PushTextWrapPos(0.0f); Text(fmt, ...); PopTextWrapPos();. Note that this won't work on an autoresizing window if there's no other widgets to extend the window width, yoy may need to set a size using SetNextWindowSize(). IMGUI_API void TextWr...
function TextWrapped(fmt /*, ...args: any[]*/) { bind.TextWrapped(fmt /*, ...args*/); }
[ "function wrapText(game, text, x, y, maxWidth, lineHeight) {\n var cars = text.split(\"\\n\");\n game.ctx.font = \"bold 80pt Helvetica\";\n game.ctx.textAlign = 'center';\n game.ctx.fillStyle = 'black';\n\n for (var ii = 0; ii < cars.length; ii++) {\n\n var line = \"\";\n var words = cars[ii].split(\" \"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets a CustomerModel object wrapping the current customer. Gets a profile form and handles the confirm action. confirm validates the profile by checking that the email and password fields: match the emailconfirm and passwordconfirm fields are not duplicates of existing username and password fields for the profile If th...
function registrationForm() { app.getForm('profile').handleAction({ confirm: function () { var email, profileValidation, password, passwordConfirmation, existingCustomer, Customer, target, customerExist; Customer = app.getModel('Customer'); email = app.getForm('profile.c...
[ "function editForm() {\n app.getForm('profile').handleAction({\n cancel: function () {\n app.getForm('profile').clear();\n response.redirect(URLUtils.https('Account-Show'));\n },\n confirm: function () {\n var isProfileUpdateValid = true;\n var has...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
fetchSong will first need an auth token, so we will first generateToken() and then take the user's search input to hit the WEB API for song results
async function fetchSong(searchTerm) { try { let token = await generateToken(); // In options, we build the query string with the searchTerm const options = { url: 'https://api.spotify.com/v1/search', headers: { Authorization: 'Bearer ' + token }, qs: { q: searchTerm, type:...
[ "async function searchSong() {\n let response = await fetch('https://yt-music-api.herokuapp.com/api/yt/songs/' + input)\n let result = await response.json()\n setSongs(result.content)\n context.inputSongs = result.content\n }", "function songSearch() {\n var spotify = new Spotify({ id: keys.apiKeys....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ejemplo Servicio a traves de una Clase Clase Rectangulo
function Rectangulo() { this.ancho=0; this.alto=0; this.setAncho=function(ancho) { this.ancho=ancho; } this.setAlto=function(alto) { this.alto=alto; } this.getArea=function() { return this.ancho * this.alto; } }
[ "function Rectangulo(x, y, ancho, alto)\n{\n\n this.x = x;\n this.y = y;\n this.ancho = ancho;\n this.alto = alto;\n\n}", "function caja(imagen,vector,x,y,tipo,alto,ancho){\n\tthis.imagen = imagen;\n\tthis.vector = vector;\n\tthis.x = x;\n\tthis.y = y;\n\tthis.tipo = tipo;\n\tthis.alto = alto;\n\tthis...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Language: SQL More (mix of MySQL, Oracle, etc)
function sql_more(hljs) { var COMMENT_MODE = hljs.COMMENT('--', '$'); return { name: 'SQL (more)', aliases: ["mysql", "oracle"], disableAutodetect: true, case_insensitive: true, illegal: /[<>{}*]/, contains: [ { beginKeywords: 'begin end start commit rollback savepoin...
[ "function selectStatement3( machine )\n {\n order = machine.popToken();\n machine.checkToken(\"by\");\n machine.checkToken(\"order\");\n tables = machine.popToken();\n machine.checkToken(\"from\");\n columns = machine.popToken()\n machine.checkToken(\"select\");\n machin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the set union of two matchplaceholders or null if there is a conflict.
function mergeMatch(match1, match2) { var res = {placeholders:{}}; // Some matches may not have placeholders; this is OK if (!match1.placeholders && !match2.placeholders) { return res; } else if (!match1.placeholders) { return match2; } else if (!match2.placeholders) { ret...
[ "function findOverlap(word1, word2) {\n\t\t\tif(!canMatchBegin(word1, word2) || !canMatchEnd(word1, word2) || !canMatchLength(word1, word2)) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tlet [word1Pattern, word2Pattern] = [wordPattern(word1), wordPattern(word2)]; \n\t\t\tfor(let i = 0, wordMatch; i < word1Pattern.length;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
All event properties are stored in a property bag; some number of these are "promoted" to toplevel accessor attributes. For example, "SUMMARY" is promoted to the toplevel "title" attribute. If you use the has/get/set/deleteProperty methods, property names are caseinsensitive. For purposes of ICS serialization, all prop...
get propertyEnumerator() { this.getProperty("DESCRIPTION"); // To preload. this.getProperty("LOCATION"); // To preload. this.getProperty("TRANSP"); // To preload. this.getProperty("STATUS"); // To preload. this.getProperty("X-MOZ-SEND-INVITATIONS"); // To preload. return this._calEvent.propertyEnumerator; ...
[ "visitPhysical_properties(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "visitObject_properties(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "function PropertyTransition() {\n this.isFinished = false;\n this._duration = 0;\n this._easeFunc = d3.ease(\"cubic-in-out\"); // also default in d3\n\n th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A factory function that allows the creation of a pizza with at least 1 topping, and at most 2 toppings
function pizzaFactory() { let randomSizeIdx = Math.floor(Math.random() * 3) let randomAmtOfToppings = Math.floor(Math.random() * 2) + 1 let toppings = [] if(randomAmtOfToppings === 1) { let randomToppingIdx = Math.floor(Math.random() * 4) toppings.push(toppingAndMutiplier[randomToppingIdx]) } else { ...
[ "function Pizza(toppings, size){\n this.toppings = [];\n this.size = size;\n}", "function makePizza(crust,size,numberOfSlice,ingredient){\n return{\n ing :ingredient,\n nos : numberOfSlice , \n addIngredients:function(ingredient){\n return ing++;\n },\n displayIngredients:function(){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This renders the main cryptogram puzzle on screen. It starts by splitting the cryptogram to an array of words, then for each word, it creates a span ('wordSpan') which holds two (2) divs inside of it. When the function splits the word to an array of chars and iterates through them (line 99100) it creates a form input f...
renderMainForm() { this.cryptoArray = this.cryptogram.split(" ") this.mainCryptoDiv = document.createElement('div') this.mainCryptoDiv.id = "main-crypto-div" this.cryptoArray.forEach(word => { this.wordSpan = document.createElement('span') this.wordSpan.className...
[ "function start(){\n\tvar div = \"\";\n\tfor ( i = 0; i < 25; i++) {\n\t\tvar element = \"let\" + i;\n\t\tdiv = div + '<div class = \"letter\" onclick = \"check('+i+')\" id=\"'+element+'\">'+letters[i]+'</div>';\n\t\tif ((i + 1) % 7 == 0) div = div + '<div style = \"clear:both;\"></div>';\n\t}\n\tdocument.getElemen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
abort anything that is currently doing on with the SegmentLoader and reset to a default state
abort() { if (this.state !== 'WAITING') { if (this.pendingSegment_) { this.pendingSegment_ = null; } return; } this.abort_(); // don't wait for buffer check timeouts to begin fetching the // next segment if (!this.paused()) { this.state = 'READY'; this.fi...
[ "abort() { \n this.reset = true;\n }", "resetEverything() {\n this.resetLoader();\n this.remove(0, Infinity);\n }", "function stopLoadingSpinner(spinnerObject) {\n $('#sb-site').removeClass('load-overlay');\n spinnerObject.spin(false);\n }", "function abortServerRequest()\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
update year totals array after refund
function updateYears() { var tgtYear = order.outIndex; var diff = yearTotals[tgtYear] - refund; if(diff > 0.0) { yearTotals[tgtYear] = +diff.toFixed(2); chrome.storage.local.set({'allYearTotals': yearTotals}); } else { yearTotals[tgtYear] = 0.0; chrome.storag...
[ "function updateMonths() {\r\n var tgtMonth = -1;\r\n var i;\r\n //find the index of the month for which order is being refunded\r\n for(i = 0; i < months.length; i++) {\r\n if(orderDate.includes(months[i])) {\r\n tgtMonth = i;\r\n break;\r\n }\r\n }\r\n var dif...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function: process Returns a Promise that resolves if there are no linting errors, else rejects
process() { return new Promise((resolve, reject)=> { if (this.lint()) { resolve(true); } else { reject(false); } }); }
[ "async function commitlint(context) {\n\t// 1. Extract necessary info\n\tconst pull = context.issue();\n\tconst { sha } = context.payload.pull_request.head;\n\tconst repo = context.repo();\n\n\t// GH API\n\tconst { paginate, issues, repos, pullRequests } = context.github;\n\n\t// Hold this PR info\n\tconst statusIn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
pay close attention to the examples hint: try looping backwards Get every third character starting from the end of the string to get a word
function getEveryThird(str) { let result = ''; for (let i = str.length - 1; i >= 0; i -= 3) { if (i === str.length - 1) { result += str[i]; } else { result += str[i]; } } return result; }
[ "function printsEveryThirdCharV2 (str) {\n let intermediateNum = 2\n while (intermediateNum<=str.length) {\n console.log(str[intermediateNum]);\n intermediateNum = intermediateNum + 3;\n }\n}", "function printsEveryThirdCharV1 (str) {\n let letters = str.split ('');\n let i = 2;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function: remove NaNs in the "table" of arrays x and y
static remove_nans(x,y) { /* identify NaN or non-numeric rows for exclusion */ var bad_rows = new Set(); var tempx=[], tempy=[], i; for(i=0; i<x.length; i++) { if (!(isNaN(x[i]) || isNaN(y[i]))) { tempx.push(x[i]); tempy.push(y[i]); } } return [tempx, tempy]; }
[ "function filterOutNulls(response) {\n let dataTable = response.getDataTable();\n\n let filtered = [];\n for (const i in dataTable.wg) {\n // remove nulls and objects with null as their value\n filtered[i] = dataTable.wg[i].c.filter(function (value, index, arr) {\n const kept = value !== null && value...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Invokes Amazon backend scraping
async function initiateAmazonScrape(search_text){ let data = await fetch(BASEURL + "/amazon?term=" + search_text); try { data = await data.json(); } catch (e) { return {"Vendor":"Amazon", "Price":"~", "Link":"~"}; } return reformatData(data, "Amazon"); }
[ "function runBamazon() {\n displayInventory();\n}", "async function sellCat(){\n $(`#onSaleCats`).addClass(\"hidden\");\n var price=$(\"#catPrice\").val()\n var amount=web3.utils.toWei(price, \"ether\")\n try{\n await initMarketplace();\n await marketplaceInstance.methods.setOffer(amount, idForSa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add toggle show themes random state button handler
function addToggleShowThemesRandomStateButtonHandler() { $(".random-themes-display-label").each(function () { var $el = $(this); $el.attr("data-toggle", "tooltip"); $el.attr("data-placement", "bottom"); $("#random-themes-display-label-flixel").attr("data-placement", "right"); ...
[ "function hideThemesDisableDial() {\r\n $('.available-themes-block').addClass('hide-first-av-content');\r\n}", "function ready_content() {\n app.param.generate.addClass('ready');\n $('.generate-container .thumb').html('<i class=\"fa fa-check fa-2x\" aria-hidden=\"true\"></i>');\n (!app.param.che...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if the given object is an instance of DisasterRecoveryConfig. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === DisasterRecoveryConfig.__pulumiType; }
[ "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Backup.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create style property from dom node
function createStyleProperty(el) { var style = el.style; var output = {}; for (var i = 0; i < style.length; ++i) { var item = style.item(i); output[item] = String(style[item]); // hack to workaround browser inconsistency with url() if (output[item].indexOf('url') > -1) { output[item] = output[item...
[ "adapt_style(elem){\n var elem_type = 'node';\n if(elem.isEdge()){\n elem_type = 'edge';\n }\n var elem_style = this.STYLE[elem_type][elem._private.data.type];\n elem.style(elem_style);\n return elem_style;\n }", "function css(ele,style_obj){\n if(ele === null || style_obj === null){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
it seems terribly awkward to have to define trivial functions such as pi_term and pi_next just so we can use them as arguments to our higher order function.Rather than define pi_next and pi_term, it would be more convenient to have a way to directly specify the function that returns its input incremented by 4 and the f...
function piSum3(a, b) { return sum( x => 1.0 / (x * (x + 2)), //piTerm a, x => x + 4, //piNext b ); }
[ "function complicatedMath(n1,n2,n3,n4){\n return (n1+n2) % (n3-n4)\n}", "function acc(func, initial) {\n \n}", "function enterPi() {\n currentInput = Math.PI;\n displayCurrentInput();\n}", "function product(a) {\n return function (b) {\n return a * b;\n };\n}", "function newComputePi(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called by express.static. Deliver response as XHTML.
function deliverXHTML(res, path, stat) { // if (path.endsWith(".html")) { // res.header("Content-Type", "application/xhtml+xml"); // } }
[ "function render_response_page( res, path ){\n\tvar path_parts = path.split('/');\n\tif( path_parts[0] == '' ){\n\t\tpath_parts.shift();\n\t}\n\tif( path_parts.length && path_parts[ path_parts.length - 1 ] == '' ){\n\t\tpath_parts.pop();\n\t}\n\tvar page_spec = {\n\t\tpath_parts : path_parts,\n\t\tactual_path : con...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Buy a Lootbox and get associated random reward
function lootboxbuy(chest) { var costmode, costemoji; //Decides which balance to add the rewarded amount to if (chest.type == "cash") { costmode = master.imp.bal; costemoji = "💵"; } else if (chest.type == "gems") { costmode = master.imp.gem; costemoji = "💎"; } if (chest.cost <= costmode) {...
[ "function buy_potions()\n{\n\tvar potionTypes = [\"hpot0\", \"mpot0\"];\n\tvar purchaseAmount = 50;\n\n\tif(empty_slots() > 0)\n\t{\n\t\tfor(typeID in potionTypes)\n\t\t{\n\t\t\tvar type = potionTypes[typeID];\n\t\t\t\n\t\t\tvar item_def = parent.G.items[type];\n\t\t\t\n\t\t\tif(item_def != null)\n\t\t\t{\n\t\t\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Question 6: Write a function unequal that checks 3 values for strict inequality. The function should return true if all three parameters are strict unequal. Otherwise false. Example: unequal(1, 2, 3) should return true and unequal(1, 1, 2) should return false. xxxxxxxxxxxxxxxxxxxx...
function unequal(a, b, c) { //return a !== b && ... return a !== b && a !== c && b !== c // if(a !== b && a !== c && b !== c){ // return "true"; // } else { // return "false"; // } }
[ "function NE(a, b) {\n return !EQ(a, b);\n}", "function triple_equal_false(){\n document.getElementById(\"triple_equal_false\").innerHTML = (3===3)+ \" - \" + (3 === \"A\")+\" - \" + (3 === \"3\") + \" - \" + (\"A\" === \"B\");\n}", "function strictEqualSign(c) {\r\n if (c === 3) {\r\n return \"c is str...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setter method to change value of dog attitude
set attitude(val){ this._loyal = val; }
[ "set age(value) {\n if (value >= 0) {\n this.#age = value;\n } else {\n console.error('Person.age must not be negative!');\n }\n }", "_setDamagePercentage(percentage) {\n this.primaryWeapon.setDamagePercentage(percentage)\n this.secondaryWeapon.setDamage...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CONCATENATED MODULE: ./node_modules/underscore/modules/wrap.js Returns the first function passed as an argument to the second, allowing you to adjust arguments, run code before and after, and conditionally execute the original function.
function wrap(func, wrapper) { return modules_partial(wrapper, func); }
[ "function wrap (fn) {\n return function () { return fn.apply(this, arguments) }\n}", "function mixin(obj) {\n each(functions(obj), function(name) {\n var func = underscore[name] = obj[name];\n underscore.prototype[name] = function() {\n var args = [this._wrapped];\n _setup.push.apply(a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get respondents of one survey by id
getRespondents(surveyId){ let respondents = 0; this.respondents.forEach(element => { if(element.surveyId === surveyId){ respondents = element.completedCounter; } }); return respondents; }
[ "async getRespondentsOfAllSurveys(){\n\n const cookies = new Cookies();\n var token = cookies.get('token');\n\n for(let i = 0 ; i < this.state.surveys.length ; ++i){\n const response = await fetch('https://localhost:44309/Answer/getReport/' + this.state.surveys[i].surveyId, {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Build frame to warn participants of difficult content coming up
build_content_warning_frame() { let frame = {}; frame.template = CW_FRAME_TEMPLATE; frame.title = CW_TITLE; frame.instruction = CW_TEXT; frame.questions = []; frame.response_name = RESPONSE_GENERIC; let ret = new FormFrame(frame, this.logger); return ret; ...
[ "build_mood_induction_frames() {\n let short_answer_frame = {};\n short_answer_frame.template = SHORT_ANSWER_TEMPLATE;\n short_answer_frame.response_name = RESPONSE_INDUCTION;\n short_answer_frame.title = INDUCTION_TITLE;\n short_answer_frame.questions = [\n [INDUCTION_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Plots the battery graph for an user
function plotBattery(options) { var $mycontainer = $(".template-chart").clone(); $mycontainer.removeAttr("style"); $mycontainer.removeClass("template-chart"); options.outerElement.append($mycontainer); var chart = new Highcharts.Chart({ chart: { renderTo: $mycontainer[0], type: 'area...
[ "function chart_user(activity_data) {\n const labels = []\n const data_count = []\n for ( var i in activity_data ) {\n labels.push(activity_data[i]._id)\n data_count.push(activity_data[i].total)\n }\n const data = {\n labels: labels,\n datasets: [{\n label: 'Top...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION: recordsetDialog.canDialogDisplayRecordset DESCRIPTION: Determines if the recordset command dialog can accept the recordset server behavior. Check if the function 'canDisplayRecordset()' is defined in the command dialog. If it is defined, invoke it to determine if the command can accept the recordset. If it is...
function recordsetDialog_canDialogDisplayRecordset(cmdFilename, sbRecordset) { var bCanDisplayRecordset = false; var domCommand = null; var windowCommand = null; if (cmdFilename) { domCommand = dw.getDocumentDOM(dw.getConfigurationPath() + "/Commands/" + cmdFilename); if (domCommand) ...
[ "function recordsetDialog_display(priorSBRecordset) {\r\n // Last action in command dialog prior to return\r\n var uiAction = recordsetDialog.UI_ACTION_SWITCH;\r\n\r\n // Command filename of recordset dialog currently displayed.\r\n var cmdFilename = recordsetDialog.getCommandDialogPref(MM.rsTypes[0].command);\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set the propertys to select from
function setSelectorFields() { // Clear existing selectors removeChildren(visualSelector); removeChildren(propertySelector); let propertyOpts = propertyOptions(); propertyOpts.forEach(function (element) { var optK = document.createElement("option") optK.value = element; optK...
[ "function loadPropertySelectData() {\n \"use strict\";\n var i;\n //depend on how many select tap.\n for (i = 0; i < getSelectID.length; i++) {\n createP_Option(getSelectID[i]);\n }\n}", "function populateProperties () {\n var tableHTML = '';\n var selectedObj = S9.selectedObje...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update HTML for wallets
function updateWalletHtml(viewModel) { jQuery("#wallets").empty(); var walletCount = 0; jQuery.each(viewModel.wallets, function(index, element) { walletCount++; var walletHtml = genWalletHtml(viewModel, index, element); jQuery("#wallets").append(walletHtml); // Add the edi...
[ "function genWalletHtml(viewModel, index, wallet) {\n var walletHtml = jQuery([\n '<div id=\"wallet-' + index + '\" class=\"col-sm-12 col-md-6 col-lg-6 col-xl-4\">',\n '<div class=\"card text-light\">',\n '<div class=\"card-header bg-flat-color-5\">',\n '<div ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
the EOF has been received, and no more bytes are coming. if the writable side has ended already, then clean everything up.
function onSocketEnd() { // XXX Should not have to do as much crap in this function. // ended should already be true, since this is called *after* // the EOF errno and onread has eof'ed this._readableState.ended = true; if (this._readableState.endEmitted) { this.readable = false; maybeDestroy(this); ...
[ "destroyStreamData(){\n\t\tthis.buffer = this.buffer.slice(1,this.buffer.length);\n\t}", "isEOF() {\n return this._index >= this.input.length;\n }", "async flush() {\n if (this.err !== null)\n throw this.err;\n if (this.n === 0)\n return;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Connect to the WebSocket endpoint and set the appropriate callbacks;
function connect() { socket = new WebSocket('wss://' + get('server') + '/api/connect'); socket.onopen = onopen; socket.onmessage = onmessage; socket.onerror = onerror; socket.onclose = onclose; }
[ "_connect () {\n if (this._reconnectionInterval) {\n this._reconnectionInterval = clearInterval(this._reconnectionInterval)\n }\n\n if (this._connection && this.isConnected) {\n return\n }\n\n this._connection = new WebSocket(\n this._host + this._createQueryString()\n )\n\n this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load Issue Data From Web API in Table
function loadTableData() { // Prepare AJAX request for collecting data of Book Issue $.ajax({ type: "GET", url: 'api/Issues', cache: false, success: function (data) { const tableBody = $("#tableBody"); // Clear Previous Content of Table Body $...
[ "function dataForTable(response) {\n return response;\n }", "function loadRecords() {\n \n \n \n var promiseGet = manageAgencyRepository.getAllagency()\n\n promiseGet.then(function (pl) { $scope.AllAgency = pl.data },\n function (errorPl) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create an instance of the poller. log: The logger to be sent to the poller. vistaIdValue: The vistaId that the poller is running under. config: The configuration settings envrionment: The environment settings start: True if the poller should come up in start mode meaning start polling the site. multiplePollerMode: True...
function createPoller(log, vistaIdValue, config, environment, start, multiplePollerMode) { var poller = new Poller(log, vistaIdValue, config, environment, start, multiplePollerMode); return poller; }
[ "startTale(tale) {\n const self = this;\n if (tale.instance && (tale.instance.status === 1 || tale.instance.status === 0)) {\n // Instance already exists, noop and return instance to watch status\n return new Promise(resolve => resolve(tale.instance));\n } else if (tale.instance && ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
============================================================================ The CSSRule class ============================================================================ Constructor
function CSSRule(raw_sel, raw_prop) { this._selectors = new Array(); var list = raw_sel.split(','); for (var i=0; i<list.length; i++) { // take only element (not its parent, ancestor or sibling) sel = stripString(list[i]); var last_sel = sel.split(/(\s|>|\+)+/); if (last_sel.length > 0) this._selec...
[ "function CSSAnalyzer(fileAttr, session)\n{\n this._doc = fileAttr; \n this._session = session;\n this._initialized = false;\n this._blocks = null;\n}", "function Stylesheet(ss) {\n if (typeof ss == \"number\") ss = document.styleSheets[ss];\n this.ss = ss;\n}", "function Selector() {\n\t\tt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a single guild's roster by its name and realm.
getGuildRoster(realmSlug, guildName) { return __awaiter(this, void 0, void 0, function* () { return yield this._handleApiCall(`/data/wow/guild/${realmSlug}/${guildName}/roster`, 'Error fetching guild roster.'); }); }
[ "function getPlayer(lobby, role) {\n return players.find(player => player.lobby === lobby && player.role === role);\n}", "function getLobbyWithName(name)\n{\n const found = lobbies.find(lobby => lobby.name == name);\n\n if (found)\n return found;\n else\n throw 'There is no lobby with that...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
IE/Edge do not support `transform` styles for SVG elements. Instead, `transform` attribute can be animated with some restrictions. See etc. The same problem is exhibited by preChrome Android browsers (ICS). Unfortunately, there's no easy way to featuredetect it.
function updateSvgTransformAttr(window, element) { if (!element.namespaceURI || element.namespaceURI.indexOf('/svg') == -1) { return false; } if (!(SVG_TRANSFORM_PROP in window)) { window[SVG_TRANSFORM_PROP] = /Trident|MSIE|IEMobile|Edge|Android 4/i.test(window.navigator.userAgent); ...
[ "function svgSetTransform(elSvg, objSvgProperties) {\n var bolUseStringMethod = true;\n\n if (bolUseStringMethod) {\n /* String method */\n // var strTransformValue='translate('+objSvgProperties['translatex']+', '+objSvgProperties['translatey']+') scale('+objSvgProperties['scale']+')';\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Class By Learner Id
function getClassByLearnerId(id) { return db("class_learners as cl") .join("classes as c", "cl.classId", "c.id") .join("teachers as t", "c.teacherId", "t.id") .where("cl.learnerId", id) .select("c.className", "c.subject", "t.prefix", "t.teacherLastName"); }
[ "function getRatingByLearnerParnetId() {\n return db(\"ratings\").where(\"ratings.learnParentId\", id);\n}", "getTrainerById(id) {\n logger.debug(`get trainer by id: ${id}`);\n return this.store.findOneBy(this.collection, {\n id: id\n });\n }", "function getClassFromId( startId ) {\n console....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Evaluates whether the previous reading is blank
static evalIsPreviousReadingEmpty(dict) { return libVal.evalIsEmpty(dict.PrevReadingValue); }
[ "static evalIsPreviousReadingNotEmptyAndReadingEqualsPrevious(context, dict) {\n if (!libThis.evalIsPreviousReadingEmpty(dict)) {\n return libThis.evalPreviousReadingEqualsReading(context, dict);\n } else {\n return false;\n }\n }", "isFull() {\r\n\t\treturn (this.emp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Genernate "select" , the value is number include start and end
function CreateSelectNumber(name, start, end, gap, init) { DW(GetSelectNumberHtml(name, start, end, gap, init)); }
[ "getSelectedRange() {\n let range;\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(this.startValue) && !Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(this.endValue)) {\n range = (Math.round(Math.abs((this.removeTimeV...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GetField will be skipped if the base or offset is not wrapped (SymbolicObject or isSymbolic)
getField(iid, base, offset, val, isComputed, isOpAssign, isMethodCall) { this.state.coverage.touch(iid); Log.logHigh('Get field ' + ObjectHelper.asString(base) + '.' + ObjectHelper.asString(offset) + ' at ' + this._location(iid)); //If dealing with a SymbolicObject then concretize the offset an...
[ "static getVirtualFieldInfo(field_name){\n\t\treturn null;\n\t}", "static getFieldInfoByName(field_name){\n\t}", "async getField(z) {\n assert(typeof z === 'string');\n assert(isAbsolute(z));\n assert(this.field);\n\n const x = join(z, 'package.json');\n const j = await readJSON(x);\n\n if (!i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert the BTC input value to USD
function btcConvertUsd(btcValue){ var btcCurrentRate; console.log("BTC Input: " + btcValue); // Get the latest exchange rate from the selected bitcoin exchange $.getJSON(url4, function(jsonObj) { console.log(jsonObj); // Choose the bitcoin exchange rate based on the exchange rate selection console.log(...
[ "function USDconversion(bitcoinAmount) {\n var response = UrlFetchApp.fetch('https://api.bitcoinaverage.com/ticker/global/USD/last');\n return response * bitcoinAmount;\n}", "function usdConvertBtc(usdValue){\n\t\tvar btcCurrentRate;\n\t\tconsole.log(\"USD Input: \" + usdValue);\n\t\t// Get the latest exchange ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
_selectionFromOptions Return a texty selection object of the container node and the offset index opts: texty object to use as options scope: dom element to look in atStart: direction (start/end) to look from
function _selectionFromOptions(opts, scope, atStart) { // clone: an element of the same node type // rand: a random id // anchorHtml: an anchor's HTML // dir: direction (start/end) to look from // content: HTML of the selection var clone = doc.createElement(scope.nodeName), rand = _randId(), anchorHtm...
[ "function findSelectionIn(doc, node, pos, index, dir, text) {\n\t if (node.isTextblock) return new TextSelection(doc.resolve(pos));\n\t for (var i = index - (dir > 0 ? 0 : 1); dir > 0 ? i < node.childCount : i >= 0; i += dir) {\n\t var child = node.child(i);\n\t if (!child.type.isLeaf) {\n\t var inner ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
intialize the balls' true radius to be proportional to their mass
function initializeRadius() { for (let i = 0; i < INITIAL_NUMBER_OF_BALLS; i++) { let ball = ballArray[i]; ball.radius = ball.mass / (5 / 3) + 1; //size the radius proportionally to its mass (between 1 and 4) } }
[ "function massOfObjBChange(scope) {\n mass_ball_b = scope.mass_of_b;\n getChild(\"ball_b\").scaleX = 0.5 + (scope.mass_of_b - 1) / 20;\n getChild(\"ball_b\").scaleY = 0.5 + (scope.mass_of_b - 1) / 20;\n ball_b_radius = (getChild(\"ball_b\").image.height * getChild(\"ball_b\").scaleY) / 2;\n}", "function massOfObj...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
_______________________________________________________ startServer attempts to start the dash server, executing the Dash Server business layer script. Return Value void ___________________________________________________________
function startServer(){ if(isDev()){ var options = { scriptPath: path.join(__dirname, '../../../engine/'), args: [TEMP_PATH], pythonPath: 'python' }; PythonShell.run('dash_server.py', options, function (err, results) { if(err){ ...
[ "function initStartServer(){\n startServer();\n checkServerStatus(1);\n}", "async start () {\n if (this.status !== ServerStatus.OFFLINE) {\n throw new ServerException('The server is already running!');\n }\n \n this.logger.info('The server is now starting.');\n this.updateStatus(ServerSt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
toggle submit btn value
function toggleSubmitBtn(isSubmitting){ isSubmitting ? submitBtn.textContent = 'submiting...' : submitBtn.textContent = 'submit' }
[ "function submitOnClick (objSubmitBtn) {\n objSubmitBtn.disabled = true;\n objSubmitBtn.value = 'Adding...';\n saveMembers();\n}", "_submitState() {\n let objFields = Object.values(Object.values(this.testObj));\n let stateArr = objFields.map(f => f.state); // Creates array from test object ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the term sets associated with this tenant
get sets() { return TermSets(this); }
[ "get sets() {\n return TermSets(this, \"sets\");\n }", "static getAllTenants() {\n return HttpClient.get(`${IDENTITY_GATEWAY_ENDPOINT}tenants/all`).map(toTenantModel);\n }", "getAllAdmins() {\n return this.getUserSets('ADMIN');\n }", "get groups() {\n return TermGroups(this);\n }",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
=============================================================== If the host is https and url is http then check for mixed content can be prompted ===============================================================
function isMixedContent(url){ if(typeof url === 'undefined' || url === null) return false; var urlObj = getURLObject(url); if (urlObj['protocol'] === 'http:' && window.location.protocol === 'https:') return true; return false; }
[ "vaidateProtocol(host){\n let protocols = ['https://', 'http://'];\n if (protocols.map(protocol => host.includes(protocol)).includes(true)) return host\n throw new Error('Host String must include http:// or https://')\n }", "function checkHasHttps(site) {\n\tvar supports = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Call Object.freeze on obj and all of it's Own properties (recursively). The excludes argument specifies a list of Own property names to skip
function deep_freeze(obj,excludes) { if (obj === undefined || typeof obj !== 'object') return; freeze(obj); each( props(obj), function(n) { if (!contains(excludes,n)) deep_freeze(obj[n]); } ); }
[ "function deepFreeze(object) {\n Object.keys(object).forEach(function freezeNestedObjects(name){\n const value = object[name];\n if(typeof value === \"object\") {\n deepFreeze(value);\n }\n });\n return Object.freeze(object);\n}", "static #cloneObjectExceptKeys(src = {}, e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
StartMediaSignage does what it's name implies, it starts MediaSignage play lists.
function StartMediaSignage() { if (! signageProgramObject) { signageProgramObject = new Program(); } }
[ "addMedia() {\n\n this.mediaFrame.open();\n }", "start() {\n\n this.isPlaying = true; // set the 'playing' boolean to true\n\n this.playing = 0; // reset to the beginning\n this.playCurrent(); // start playing the current track\n }", "function...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
buttonsGo function that makes the button's position go crazy
function buttonsGo(){ self = this; setTimeout(function(){ const btnPosition = self.getBoundingClientRect(); const topOffset = Math.abs((Math.random() * global.innerHeight) - btnPosition.height); const leftOffset = Math.abs((Math.random() * global.innerWidth) - b...
[ "function displayButtons() {\n //If the player hasn't gone show the direction and go buttons\n if(!player.go) {\n goButton.display();\n frontButton.display();\n backButton.display();\n reverseButton.display();\n inwardButton.display();\n }\n\n else {\n //When the diver goes, show the tuck butt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called when the pledge request has been successful
function onPostPledgeSuccess(data, textStatus, jqXHR) { toastr.success('Thanks for your pledge!'); clearPledgeForm(); $('nav a[href="#map"]').trigger('click'); }
[ "acceptPledge() {\n this.setPledgeModalToggle();\n this.startPledgeModalToggle();\n this.state.pledge.footprintReduction = Math.round(this.state.pledge.weight * this.state.slider * 10)/10;\n this.props.addPledge(this.state.pledge);\n }", "function onPostPledgeError(jqXHR, textStatus...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieve the geolocation field from the selected SharePoint list.
function getGelolocationFieldFromList() { var clientContext = new SP.ClientContext.get_current(); var parentCtx = new SP.AppContextSite(clientContext, appData.AppHostUrl); var parentWeb = parentCtx.get_web(); var targetList = parentWeb.get_lists().getByTitle(appData.ImageLibraryDisplayTitle); this.l...
[ "function setGeolocationFieldValue() {\n var value = \"POINT (\" + pictureData.Longitude + \" \" + pictureData.Latitude + \")\";\n var geoid = appData.GeolocationFieldName;\n var fileurl = \"/\" + appData.AppHostRelativeUrl.trimStart(\"/\").trimEnd(\"/\") + \"/\" + appData.ImageLibraryFullPath.trimStart(\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a starting directory, find the root of a git repository. In this case, the root is defined as the first directory that contains a directory named ".git" Returns a string if found, otherwise undefined
function findGitRoot(start) { start = start || Path.dirname(findParent(module).filename); var root; if (isDir(Path.join(start, '.git'))) { root = start; } else if (Path.dirname(start) !== start) { root = exports.findGitRoot(Path.dirname(start)); } return root; }
[ "function discoverProjectRoot(startdir) {\n var flist = fslib.readdirSync(startdir);\n if (flist.indexOf('sc_config') > -1) {\n var c = fslib.readFileSync(pathlib.join(startdir, 'sc_config')).toString();\n if (c.indexOf(\"BT.serverConfig\") > -1) {\n return startdir;\n }\n }\n if (pathlib.parse(st...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add logo to the center of all menu item list
function addLogoToMenu(logoContent){ var menu_item_number = jQuery(".menu-with-logo > .main-menu > li").length; var middle = Math.round(menu_item_number / 2); jQuery(".menu-with-logo > .main-menu > li:nth-child(" + middle + ")").after(jQuery('<li class="menu-logo">'+logoContent+'</li>')); if (typeof...
[ "function ELEMENT_LOGO_BOX$static_(){FavoritesToolbar.ELEMENT_LOGO_BOX=( FavoritesToolbar.BLOCK.createElement(\"logo-box\"));}", "function logoArt() {\n console.log(\n logo({\n name: \"Employee DB\",\n font: \"Speed\",\n lineChars: 10,\n padding: 2,\n margin: 3,\n borderColor: \"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Using frontmattermarkdownloader here to parse md files
extend(config, ctx) { config.module.rules.push( { test: /\.md$/, loader: "frontmatter-markdown-loader", include: path.resolve(__dirname, "content"), options: { markdownIt: { html: true, } } }) }
[ "function fetchMarkdown() {\n var di = diNotify('Fetching Markdown...');\n return $http.post('factory/fetch_markdown', {\n name: documentsService.getCurrentDocumentTitle(),\n unmd: documentsService.getCurrentDocumentBody()\n }).success(function(response) {\n if (di.$scope !== null) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }