query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
convert the board array to a string. only for debug purpose
boardToString(board){ var str = ""; for(let i=0;i<board.length;i++){ if(board[i] === null) str += ". " else str += board[i][0] + "" + board[i][1] if((i+1)%8 === 0) str+= "\n" else str += " " } return str; }
[ "function boardToString() {\n\tvar str_board = \"\";\n\tfor(var i = 0; i < 3; i++) {\n\t\tfor(var j = 0; j < 3; j++) {\n\t\t\tstr_board += BOARD[i][j];\n\t\t}\n\t}\n\treturn str_board;\n}", "boardToString() {\n let str = \"\";\n for (const row of this.board) {\n for (const val of row) {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the listeners for the "type" section (type, color, size)
function setSelectListeners() { for (let i = 0; i < typeSelects.length; i++) { document .getElementById(typeSelects[i] + "_select") .addEventListener("change", function() { store.set(typeSelects[i], this.value); //even though the typeSelects are all uniquely names, they are all placed...
[ "addListenerForType(type, listener) {\n this.listenersByType[type] = listener;\n }", "on(type, listener) {\n this.registered.push({\n type: type,\n listener: listener\n });\n }", "set_type(event_type)\n\t{\n\t\tthis.type = event_type;\n\t}", "setAlertType(type) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes antimeridian crossings from an array of polygon rings TODO: handle edge case: segment is collinear with antimeridian TODO: handle edge case: path coordinates exceed the standard latlong range rings: array of rings of [x,y] points. Returns array of splitapart rings
function removePolygonCrosses(rings) { var rings2 = []; var splitRings = []; var ring; for (var i=0; i<rings.length; i++) { ring = rings[i]; if (!isClosedPath(ring)) { error('Received an open path'); } if (countCrosses(ring) === 0) { rings2.push(ring); } els...
[ "function classifyRings(rings) {\n var len = rings.length;\n\n if (len <= 1) return [rings];\n\n var polygons = [],\n polygon,\n ccw;\n\n for (var i = 0; i < len; i++) {\n var area = signedArea(rings[i]);\n if (area === 0) continue;\n\n if (ccw === undefined) ccw = are...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transform an option name to a "key" that is used as the field on the `opts` object returned from `.parse()`. Transformations: '' > '_': This allow one to use hyphen in option names (common) but not have to do silly things like `opt["dryrun"]` to access the parsed results.
function optionKeyFromName(name) { return name.replace(/-/g, '_'); }
[ "function normalizeOptionKey (options) {\n var result = {};\n for (var i in options) {\n if (options.hasOwnProperty(i)) {\n result[camelCase(i)] = options[i];\n }\n }\n return result;\n }", "putOption(arg){\n let c2 = arg.charAt(1);\n if(arg.length == 2)\n th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
NOR (Not OR) Write a function nor that takes two Boolean values. If both values are false, the result should be true. In the other cases the return should be false. I.e.: The call nor(false, false) should return true. The calls nor(true, false), nor(false, true) and nor(true, true) should return false.
function nor(blo1, blo2) { let and =blo1 || blo2 return !and }
[ "function nor(bool1, bool2) {\n\tif (bool1 === false && bool2 === false) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function logical_Nor(a, b) {\n if (a != b) {\n return false;\n } else {\n return true;\n }\n}", "function nor_(b1,b2){\n return !b1 && !b2;\n}", "fun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end of code Code for Triangle Area
function areaTriangle(base, height){ return -1; }
[ "function areaOfTriangle(){\n\tconst tri1 = new Vertex([1,0,2]);\n\tconst tri2 = new Vertex([1,0,1]);\n\tconst tri3 = new Vertex([-1,0,1]);\n\tconsole.log(getTriangleArea(tri1,tri2,tri3));\n}", "function areaOfTriangle(side1,side2,side3)\r\n{\r\n let s = (side1 + side2 + side3)/2;\r\n let area = Math.sqrt(s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Toll cost object (country)
function CountryTce() { this.name = ""; this.adminAdmissionCost = []; // CostTce array this.roadSectionCost = []; // CostTce array this.tollSystemsNames = []; // TollSystem array this.usageFeeRequiredLinks = null; }
[ "function CostObject(taxCA, taxME, shipping, price_liveAmerican, price_tailAmerican, price_liveRock, price_tailRock) {\n this.shipping = shipping;\n this.taxCA = taxCA;\n this.taxME = taxME;\n this.price_liveAmerican = price_liveAmerican;\n this.price_tailAmerican = price_tailAmerican;\n this.pric...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The homepage for visiting this repository. If the corresponding preference is not defined, defaults to about:blank.
get homepageURL() { let url = this._formatURLPref(PREF_GETADDONS_BROWSEADDONS, {}); return (url != null) ? url : "about:blank"; }
[ "function getDefaultHomepage() {\n var preferences = prefs.preferences;\n\n var prefValue = preferences.getPref(\"browser.startup.homepage\", \"\",\n true, Ci.nsIPrefLocalizedString);\n return prefValue.data;\n}", "get aboutpage() {\n return getPref(\"extensions.cehomepa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The playback rate of the part
get playbackRate() { return this._playbackRate; }
[ "get playbackRate() {\n return this._event.playbackRate;\n }", "getPlaybackRate() {\n return this._client.send(\"Animation.getPlaybackRate\");\n }", "getPlaybackRate() {\n return this.player.getPlaybackRate();\n }", "get speed() {\n return Number(this.media.playbackRate);\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Statements are either a function call: functionname(3,3) a function call with assignation: a, b = functionname(3,3) Maybe in the future: an expression with assignation a = 33 + 4 sin(x);
function parse_statement(){ var end = i; var stmt = { type: "", args: [], assigns: [] }; if(toks[i][0] == "eof"){ return null; } // Find end while(toks[end][0] != "semicolon"){ if(toks[...
[ "function statement() {\n\n}", "function ExpressionStatement() {\n}", "function CallExpression() {\n}", "function toFunctionCallStatement(t, functionName, args) {\n return t.expressionStatement(toFunctionCall(t, functionName, args));\n}", "function AssignmentExpression() {\n}", "function functionCall(str...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Animation of DeSelected and venue hiding
function deSelectedAnimation(e){ //Raise opacity of surrounding options $('.option').not($(e)).not($(this).siblings()).each(function(e){ $(this).removeClass('not-selected-option'); }); //add selected's sibling option from DOM $(e).closest('.option').siblings().removeClass('hidden'); // de...
[ "hideUnselected() {}", "_hide() {\n $.setDataset(this._target, { uiAnimating: 'out' });\n\n $.fadeOut(this._target, {\n duration: this._options.duration,\n }).then((_) => {\n $.removeClass(this._target, 'active');\n $.removeClass(this._node, 'active');\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validate the entity against the validator.
validate(entity) { if (entity == null) { throw new nullargumenterror_1.NullArgumentError('entity'); } let result = new validatorresult_1.ValidatorResult(); for (let i = 0; i < this.rules.length; i++) { let ruleResult = this.rules[i].validate(entity); i...
[ "static async validate (fieldValue, message, resolve, reject, args) {\n let entity = fieldValue\n let entityType = entity.constructor.name\n\n if (Array.isArray(args) && entityType !== args[0]) {\n reject(\"this entity type doesn't exists\")\n return\n }\n try {\n await entity.isValid(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
change le type de configurateur
function change_type_configurateur(val){ // si le type de configurateur a été changé via le chargement d'une sauvegarde de bague, on sélectionne le bon élément dans la liste déroulante if ($("select[name='type_configurateur']").val() != val){ $("select[name='type_configurateur']").val(val); } var options ...
[ "function setOption(name, value, type) {\r\n if (typeof value !== type) {\r\n throw new TypeError(\"'\"+ name +\"' must be of type '\"+ type + \"'\");\r\n } \r\n ioConfig[name] = value;\r\n }", "function changeType(type){\r\n\ttypeOscillator=type;\r\n\tif(oscillator){\r\n\t\toscillator.type=typ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
sends the bounds of the block range ready for evaluation
setBlockRange(nextRange) { if (nextRange) { if (nextRange.length > 1) { if (nextRange[0] === nextRange[1]) { throw Error('cannot set block range of equivalent heights'); } } } // if a block range should be evaluated on disk report it to the controller if (this._bloc...
[ "requestBlockRange(start, end, handler){\n\t\tfor(let i=start; i<=end; i++) {\n\t\t\tthis.requestBlock(i, handler);\n\t\t}\n\t}", "function suppliedBounds(start, end, step) {\n\n}", "function rangeBuffer () {\n\n}", "_calculateBounds() {\n this.calculateVertices();\n this._bounds.addVertexData(t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checks if a particular url is contained in user's savedUrlsArr
function isSavedBefore (url, arr) { if (arr === undefined) { return false; } for (var i = 0; i < arr.length; i++) { if (url === arr[i].url) { return true; } } return false; }
[ "function ownUrl(userID) {\n for (let i = 0; i < matchingUrls.length; i++) {\n if (matchingUrls[i] === userID)\n return true; //check to see if user matches cookie\n }\n return false;\n}", "function hasBeenChecked(url,checkedUrls){\n \n var hasBeenChecked = false;\n if(checkedUrls.indexOf(url)!=-1)\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Setup the Hub Manager module, must be called after the constructor and the callback setters
setup() { // create the settings object var settings = { port: this.mqttPort, backend: { type: 'mongo', url: 'mongodb://localhost:' + this.mongodbPort + '/mqtt', pubsubCollection: this.mongoPersistanceName, mongo: {...
[ "setup() {\n this.setupHandlers();\n this.setupPeer();\n }", "function init() {\r\n getFullState(\r\n // on success give the hub back\r\n function() {\r\n success(hub);\r\n },\r\n // fail just return the err...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
testForUnHandledException(); This function depicts how Logging of Message is affected, by setting LOGLEVEL to error
function testForErrorOnlyLogging() { let loggerConfig = { "log-level": customLogger.LOG_LEVEL.error } customLogger.setConfig(loggerConfig); let txnID = shortid.generate(); customLogger.logMessage("This is ERROR message 1 for same transaction", customLogger.LOG_LEVEL.error, "some-business-t...
[ "function testForUnHandledException() {\n let loggerConfig = {\n \"log-level\": customLogger.LOG_LEVEL.verbose\n }\n\n customLogger.setConfig(loggerConfig);\n customLogger.logMessage(\"tion\", customLogger.LOG_LEVEL.error, \"some-business-tag\", txnID);\n\n}", "_logError() {\n console.log(\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
define the classe myGeneral with default values for General information:
function myGeneral () { this['Project Name'] = ''; this['Species'] = ''; this['Use Ensembl Map'] = "Yes"; this['Ensembl Dataset'] = ""; this['Max Number of SNPs'] = 5000; this['number-simulations'] = 1; this['number-simulations-parallel'] = 1; this['number-simulations-core'] = 1; this['Number of Chromosomes']...
[ "function crear_ancestro_general(){\n definir_propiedades(dom_propiedades,ancestro_general);\n definir_propiedades(css_propiedades,ancestro_general);\n\n\n}", "static makeDefault() {\n return new Config(ModelType.MODEL3, BasicLevel.LEVEL2, CGChip.LOWER_CASE, RamSize.RAM_48_KB, Phosphor.WHITE, Background....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
inet_aton and inet_ntoa shamelessly "stolen" from:
function inet_aton(ip){ var a = ip.split('.'); var buffer = new Buffer(4); buffer.fill(0); for(var i = 0; i < 4; i++) { buffer.writeUInt8(parseInt(a[i]), i); } var intIp = buffer.readUInt32LE(0); console.log('0x' + intIp.toString(16)); return intIp; }
[ "function inet_addr(str){\r\n var ip_list = str.split(\".\").reverse();\r\n var a1 = parseInt(ip_list[0]);\r\n var a2 = parseInt(ip_list[1]);\r\n var a3 = parseInt(ip_list[2]);\r\n var a4 = parseInt(ip_list[3]);\r\n\r\n var addr = ((a1 << 24) | (a2 << 16) | (a3 << 8) | a4) >>> 0;\r\n return add...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the QValue for the given key
getQValue(key, callback) { this.get(key, function (err, value) { // if (err) winston.error(err); callback(parseFloat(err || isNaN(value) ? INITIAL_QVALUE : value)); }); }
[ "function getValue(key){\n var o = getKV();\n return o[key] ? o[key] : undefined;\n}", "function getValue(key) {\n var hash = getHash();\n var params = hash.split('&');\n for (var i = 0; i < params.length; i++) {\n var paramPair = params[i].split('=');\n if (d(paramPai...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FY210502:[Sprinklr Chat Bot] If customer wants to talk to an agent after sprinklr chat bot is opened.[END] FY210502:[Sprinklr Chat Bot] If sprinklr successfully ended the chat.[START]
function sprinklerChatEnded() { snapinChatInitiatedState(false);//Dont Initiate SnapIn Chat var originalPrechatDOM = document.querySelector(".modalContainer .dockableContainer .sidebarBody .activeFeature .featureBody .embeddedServiceSidebarState .prechatUI"); var closeOriginalPrechatDOM = document.querySel...
[ "function replySucceeded(){self.status=C.STATUS_WAITING_FOR_ACK;setInvite2xxTimer.call(self,request,desc);setACKTimer.call(self);accepted.call(self,'local');}// run for reply failure callback", "function triggerSnapinPostSprinkler(sprinklrChatBotObject) { \n snapInObject = sendGlobalSnapinObjToJson();\n sn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Connects an [ESLint]( linter to CodeMirror's [lint]( integration. `eslint` should be an instance of the [`Linter`]( class, and `config` an optional ESLint configuration. The return value of this function can be passed to [`linter`]( to create a JavaScript linting extension. Note that ESLint targets node, and is tricky ...
function esLint(eslint, config) { if (!config) { config = { parserOptions: { ecmaVersion: 2019, sourceType: "module" }, env: { browser: true, node: true, es6: true, es2015: true, es2017: true, es2020: true }, rules: {} }; eslint.getRules().forEach((desc, n...
[ "function esLint(eslint, config) {\n if (!config) {\n config = {\n parserOptions: { ecmaVersion: 2019, sourceType: \"module\" },\n env: { browser: true, node: true, es6: true, es2015: true, es2017: true, es2020: true },\n rules: {}\n };\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns the color the page is, based on the set cookie returns white if no cookie exists (because "bw" is the default)
function color_pick () { if (current_profile() == null) return ("#ffffff"); else if (current_profile() == "bw") return ("#ffffff"); else if (current_profile() == "antique") return ("#f4ecd9"); else if (current_profile() == "blue") return ("#eeeeff"); else if (current_profile() == "gray") return ("#eeeeee...
[ "function getBackgroundColor() {\r\n var backColor = getCookie('izendaDashboardBackgroundColor');\r\n return backColor ? backColor : '#1c8fd6';\r\n }", "function changeSiteColor(color){\n var whichStylesheet = document.getElementById(\"color_stylesheet\");\n if (color == \"cmyk\"){\n whi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Click event for removing a participant.
function participantRemoveClick(chatId, regId) { // Remove the menu since it was clicked. var menu = $("#participantsPane").find("#messageDropdown"); if (menu.length) { menu.remove(); } // Remove the participant. messenger.participantRemove(chatId, regId); }
[ "function removeParticipant(participant) {\n const participantDiv = document.getElementById(participant.sid);\n participantDiv.parentNode.removeChild(participantDiv);\n}", "function deleteParticipant(event) {\n event.target.parentNode.remove();\n let nameString = event.target.parentNode.firstChild.firstChild....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
to store input numbers into an array
function storeNumbers(inputNum){ arrayNumberOpt.push(inputNum); }
[ "function arrayinput(){\r\n\r\n pharr.push(ph);\r\n charr.push(ch);\r\n maarr.push(ma);\r\n avgarr.push(avg);\r\n totarr.push(tot);\r\n nmarr.push(nm);\r\n gradearr.push(grade);\r\n ns = pharr.length;\r\n }", "function addNumbers(value){\n var myNumbers = [...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Evaluates, or attempts to evaluate, a BindingName, based on an initializer
function evaluateBindingName({ node, environment, evaluate, statementTraversalStack, reporting, typescript, logger }, rightHandValue) { var _a; // If the declaration binds a simple identifier, bind that text to the environment if (typescript.isIdentifier(node) || ((_a = typescript.isPrivateIdentifier) === n...
[ "function evaluateBindingElement({ environment, node, evaluate, logger, reporting, typescript, statementTraversalStack }, rightHandValue) {\n var _a, _b, _c, _d;\n // Compute the initializer value of the BindingElement, if it has any, that is\n const bindingElementInitializer = node.initializer == null ? u...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the wrapped inner object. XXX: this is a workaround so that we can pass this object through an observer without having to explicitly declare an interface for it. See:
get wrappedJSObject() { return this; }
[ "get innerRef() {\n return this.#innerRef\n }", "get() {\n return this._object;\n }", "function unwrap(f) {\r\n\treturn f instanceof Wrapper ? f.get() : f;\r\n}", "function getInner(o) {\n\t\t\treturn o.contentDocument.body.childNodes[0].innerHTML;\n\t\t}", "function unwrapProto() { return this.self...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
convert nodelist to array
getArrayFromNodeList(nodeList) { return [].slice.call(nodeList); }
[ "function toAr(nodelist){\n\t\treturn Array.prototype.slice.call(nodelist)\n\t}", "function nodedListToArray(nodeList){\r\n\t\tvar Arr = [], i=0, el\r\n\t\twhile (el = nodeList[i++])\r\n\t\t\tif (el.nodeType == 1) Arr.push(el)\r\n\t\treturn Arr\r\n\t}", "function array(nodeList) {\n\t\treturn Array.prototype.sl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
XPATH FOR MEETING CARD ALL Race List Tab Xpath for Meeting Card All Race List Tab Race No
get meetingRaceList_RaceNo() {return browser.element("//android.view.ViewGroup/android.view.ViewGroup[2]/android.view.ViewGroup/android.view.ViewGroup[1]");}
[ "get raceListTab() {return browser.element(\"~Race List\");}", "get horseCard_Race_No() {return browser.element(\"//android.widget.ScrollView/android.view.ViewGroup/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup/android.widget.TextView[1]\");}", "get meetingRac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function matches the user's first name to the appropriate person ID INNER FUNCTION CALLS: removeParam()
function matchUsernameToPerson(userFirstName) { if (!PERSONS) return '3'; console.log('PEOPLE', PERSONS, userFirstName); for (var i = 0; i < PERSONS.length; i++) { if (PERSONS[i].name.toLowerCase() == userFirstName.toLowerCase()) { return PERSONS[i].id; } } return '3'; }
[ "function matchUsernameToPersonID(userFirstName, paramNum) {\n if (!PERSONS) return '3';\n\n console.log('PEOPLE', PERSONS, userFirstName);\n for (var i = 0; i < PERSONS.length; i++) {\n if (PERSONS[i].name.toLowerCase() == userFirstName.toLowerCase()) {\n console.log(PERSONS[i].name, PERSONS[i].id);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clears all the messages in the main message view
function clearMessages() { $('#message-list').empty(); }
[ "function clearMessages() {\n clearNotificationMessage();\n clearErrorMessage();\n }", "function clearMessages()\n {\n \t$('#chat-log .messages-list').empty();\n }", "function removeMessages() {\n message_list.empty();\n }", "function clearMessages() {\n cons...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this is a helper method used to reset the fields on the Create Account / Login forms.
function resetCreateAccount() { //reset all fields to empty $("#validationDefault01").val(""); $("#validationDefault02").val(""); $("#validationDefaultEmail").val(""); $("#validationDefault05").val(""); $("#validationDefault03").val(""); $("#validationDefault04").val(""); $("#inputPasswo...
[ "function reset_fields() {\n setPasswordEntered('');\n setPassBoxVisibility('none');\n setUseridCheckResult(Userid_Check);\n setUseridCheck(true);\n setResult('');\n setGoHome(false);\n setViewPassword(Hide_Pass);\n }", "function resetNewUserField() {\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
updateMap highlights the userselected trail in green on the map and unhighlights the previous trail chosen by the user. If the user reselects the same trail, nothing happens arguments: select: the DOM select box to choose which trail is shown
function updateMap() { id = trail_select.value; console.log(id); var newlayer = layer.getLayer(id); newlayer.removeFrom(map); newlayer.setStyle({ weight: 5, color: '#00ff00', opacity: 1.0 }); newlayer.addTo(map) var prevlayer = layer.getLayer(previd); if (previd !== id) { p...
[ "function updateSelected() {\n var geom = d3.selectAll(\".geom\");\n geom.classed(\"d3-select\", function(d) { return _.contains(model.selected, $(this).attr(\"data-id\")); });\n // bring selected geog to front if browser not crap\n if (!L.Browser.ie) {\n d3Layer.eachLayer(function (layer) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the eventTitle, eventDate, and eventTime values on the confirmation_page.
function setConfirmationPageValues(resp) { var title = resp.summary || 'idk' var location = resp.location || 'u didnt put location' var start = new Date(resp.start.dateTime) || 'nostart' var end = new Date(resp.end.dateTime) || 'noend' document.getElementById('eventTitle').value = title document.getElement...
[ "function setParameters(e) {\n setModalTitle($(e.currentTarget));\n var articleId = ($(e.currentTarget).attr('data-article-id')) ? $(e.currentTarget).attr('data-article-id') : false;\n var articleScheduled = ($(e.currentTarget).attr('data-scheduled')) ? $(e.currentTarget).attr('data-scheduled')...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Controller for the submitnewpatient THis method does a post on the back end to create a new patient
submitNewPatient() { var self = this; var value= document.getElementById('value'); console.log(this.get('l_Name')); var val = value.options[value.selectedIndex].text; let ajaxPost = this.get('ajax').request('/api/patients', { method: 'POST', type: 'application/json', data: { pat...
[ "function createNewPatient() {\n $.ajax({\n url: `${proxyurl + baseUrl}/auth/register`,\n type: 'POST',\n dataType: 'application/json', // added data type,\n data: getNewPatientData(),\n\n success: function(res) {\n console.log(res);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When the user sees the clones, we need to reset the position, and cancel the animation so that it creates the infinite effects. The if else statement here is based on the getClones method. Because it decides how many items we are cloning.
function checkClonesPosition(_ref2, childrenArr, props) { var currentSlide = _ref2.currentSlide, slidesToShow = _ref2.slidesToShow, itemWidth = _ref2.itemWidth, totalItems = _ref2.totalItems; // the one is here for pre-swtiching the position just right before we are one more slide away from the en...
[ "function whenEnteredClones(_a, childrenArr, props) {\n var currentSlide = _a.currentSlide, slidesToShow = _a.slidesToShow, itemWidth = _a.itemWidth, totalItems = _a.totalItems;\n var nextSlide = 0;\n var nextPosition = 0;\n var hasEnterClonedAfter;\n var hasEnterClonedBefore = currentSlide === 0;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loads the 'Rhino Logo.3dm' model and computes meshes for each of breps in the model.
function getRhinoLogoMeshes() { if( RHINOLOGO.doc!=null ) { alert("Model already loaded"); return; } req = new XMLHttpRequest(); req.open("GET", "https://files.mcneel.com/rhino3dm/models/RhinoLogo.3dm"); req.responseType = "arraybuffer"; req.addEventListener("loadend", loadEnd); ...
[ "function getRhinoLogoMeshes() {\n if( RHINOLOGO.doc!=null ) {\n alert(\"Model already loaded\");\n return;\n }\n const req = new XMLHttpRequest();\n req.open(\"GET\", \"https://files.mcneel.com/rhino3dm/models/RhinoLogo.3dm\");\n req.responseType = \"arraybuffer\";\n req.addEventListener(\"loadend\", l...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
log guess into player pl for later rechecks /plplayer id sussuspect wepweapon romroom
function logGuess(pl,sus,wep,rom) { console.log("log guess " + sus + " " + wep + " " + rom + " for player " + pl); var guess = { suspect:sus, weapon:wep, room:rom }; players[pl].guesses.push(guess); // push guess object into player guesses array updateGuessTables(); }
[ "function on_passtrump(data)\n {\n update_current_player(data.newplayer);\n }", "function playerGuess(room, suspect, weapon){\r\n\tvar message = \"\";\r\n\tif (room != winningRoom){\r\n\t\tmessage = \"Sorry, \"+room+\" is not correct.\";\r\n\t\treturn message;\r\n\t} else if (suspect != winningSuspec...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Buttons for exporting recipients to CSV and XLS.
function handleRecipientExport() { if ($('form#posts-filter').length) { var buttons = [ '<a class="add-new-h2 gwapi-recipient-export-button" data-format="csv">CSV</a>', '<a class="add-new-h2 gwapi-recipient-export-button" data-format="xlsx">XLSX</a>' ]; $('<...
[ "function handleRecipientExport() {\n if ($('form#posts-filter').length) {\n var buttons = [\n '<a class=\"add-new-h2 gwapi-recipient-export-button\" data-format=\"csv\">CSV</a>',\n '<a class=\"add-new-h2 gwapi-recipient-export-button\" data-format=\"xlsx\">XLSX</a>'\n ];\n $('<span>...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
createMarkingsFinalized creates a finalized marking, it uses the parameters to create each marking category with the same value `finalMark`.
function createMarkingsFinalized(markingForm, version, finalMark) { const markings = {}; markings.adjustment = 0; markings.generalComments = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'; // eslint-disable-line max-len markings.marks = {}; for (let i=0...
[ "function final(){\n let finalMark = examMark + courseWorkMark;\n return finalMark;\n }", "_createMarks() {\n const rects = getMarksRects(this.elems, this.cachedElemRects);\n this.marks = new Array(rects.length);\n\n this.opts.beforeCreation(this.wrapper);\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if a Container exists, and, if it doesn't, creates it. This will make a read operation based on the id in the `body`, then if it is not found, a create operation. You should confirm that the output matches the body you passed in for nondefault properties (i.e. indexing policy/etc.) A container is a named logical...
createIfNotExists(body, options) { return tslib_1.__awaiter(this, void 0, void 0, function* () { if (!body || body.id === null || body.id === undefined) { throw new Error("body parameter must be an object with an id property"); } /* 1. Attempt to...
[ "function createContainerIfNotExists(data) {\n \n //Check to see if our reference to the azure service exists\n if (data.hasOwnProperty('containerName')) {\n if (typeof blobSvc === 'undefined') {\n blobSvc = azure.createBlobService();\n }\n\n blobSvc.createContainerIfNotExists(data.containerName, f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if value is hex RGB between '000000' and 'FFFFFF'
function hexRgb (value) { return low.string(value) && rgb.test(value) }
[ "function hexRgb(value) {\n\t return check.string(value) &&\n\t rgb.test(value);\n\t }", "function hexRgb(value) {\n return check.string(value) &&\n rgb.test(value);\n }", "function isHexColor(input) {\n return colorRegex.test(input);\n}", "function isColorStringHexRGB(raw) {\n return ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle email on submit
function handleEmail(e) { e.preventDefault(); const emailSent = e.target.elements[0].value; if (emailIsValid(emailSent)) { alert('Thanks for your subscription! :D'); } else { alert('Your e-mail is incorrect. Try again :('); } }
[ "function submitEmail() {\n\n //make email lowercase\n email = el.val().toLowerCase();\n\n //only when its an email\n if (verify(email)) {\n //unbind event and clear interval to prevent false status\n el.unbind('keyup');\n\t\t\t\t//disable th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Attach a JS script to a document, and run a function after the loading is completed
function attachAndLoadScript(documentToAttach, scriptName, functionToRun) { var head = documentToAttach.getElementsByTagName('head')[0]; var script = documentToAttach.createElement('script'); script.type = 'text/javascript'; script.src = scriptName; script.onload = functionToRun; head.appendCh...
[ "setScript() {\n if (document.getElementById(this.id)) {\n // TODO wrap onerror callback for cases where the script was loaded elsewhere\n this.callback();\n return;\n }\n\n const url = this.createUrl();\n const script = document.createElement(\"script\");\n script.id = this.id;\n s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Obtenemos los resultados de la competencia seleccionada
function obtenerResultados(req, res) { var id = req.params.id; var peticionSql = leerSql("obtenerResultados.sql") + id + ` GROUP BY pelicula.id ORDER BY votos DESC LIMIT 0,3;` conexionBaseDeDatos.query(peticionSql, function(error, resultado, campos) { if(error) { con...
[ "function getDatosSelect() {\n getCompetenciasAndComportamientos(getGestores);\n}", "function aplicarFiltros(results) {\r\n //Si trae un numero tiene que ir =n ,, si no !=0\r\n //Pongo todos los filtros en =!0 -- Nos va a traer todos los resultados. \r\n var genero, actor, direct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Private. Determine the group menus. Uses the current index groupTree filtered by search, tag, new...
setSelectorGroup(currentPathSet) { let allowGroupCreate = window.user.isEditor; html(this.host, ""); currentPathSet.split("¬").forEach((currentPath) => { let parent = c(null, "DIV", this.host); let pathSplit = currentPath.split("/"); let tree = index.groupTree...
[ "function initGroupContextMenu() { \r\n var option;\r\n var $items;\r\n\r\n option = getContextMenuGroupItems(false);\r\n $items = $(\".sidebar-group-item\").not(\".group-is-default, .group-is-popular\");\r\n $items.contextmenu(option);\r\n option['eventName'] = \"click\";\r\n if($items)\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check to see if the user has entered a query into the given search form. Returns true if a query is present, false otherwise
function gotAQuery( searchFormType, basicType, advancedType ) { var gotone = false; var value; if( searchFormType == basicType ) { value = $( ".basicField" ).val(); if( value && value.match(/\S/) ) { gotone = true; } } else if( searchFormType == advancedType ) { $( ".advField" ).each( f...
[ "function checkQuery() {\n var typedQuery = controls.$searchQuery.val();\n if (typedQuery !== query) {\n query = typedQuery;\n navigating = true;\n doSearch();\n }\n }", "function checkQueryString() {\n\tif (jobListing.queryFlag)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a new instance of Pagination.
function Pagination(props) { var _this = _super.call(this, props) || this; _this.state = { pages: _this.calculatePagination() }; return _this; }
[ "constructor() { \n \n Pagination.initialize(this);\n }", "constructor() { \n \n ListPagination.initialize(this);\n }", "function PaginationFactory() {\n\n\n // Container object we will return\n var Factory = {};\n\n \n /*\n * @param {HTTPResponse} httpResponse Th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
load all exisitng matches that are active currently (potentially specified by namespace) NOTE this funciton is intended to be run after adding listeners that haven't YET been called on existing open tabs
function _execute_existing_tab_load_matches( namespace ){ chrome.tabs.query( {}, tabs => { tabs.forEach( tab => { if(!tab.url) return; _execute_content_script_matching_loads_on_tab( tab, namespace ); }); }); }
[ "async function getMatches(query) {\n const queryParts = query.toLowerCase().split(' ');\n const [\n tabs,\n tabGroups,\n ] = await Promise.all([\n chrome.tabs.query({}),\n chrome.tabGroups.query({}),\n ]);\n const tabGroupsById = tabGroups.reduce((acc, tabGroup) => {\n acc[tabGroup.id] = tabGro...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Subscribe any provided AnimationControls to the component's VisualElement
mount() { this.updateAnimationControlsSubscription(); }
[ "mount() {\n this.updateAnimationControlsSubscription();\n }", "function animate() {\n window.requestAnimationFrame(animate);\n that.controls.update();\n }", "function useAnimationGroupSubscription(animation, controls) {\r\n var unsubscribe = Object(react__WEBPACK_IMPORTED_MODULE_1__[\"u...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A function that easily shows the bone weights
createBoneWeightMap(skinnedMesh) { const geometry = skinnedMesh.geometry const vertices = geometry.vertices const weights = geometry.skinWeights const indicies = geometry.skinIndices const bones = skinnedMesh.skeleton.bones return vertices.map((v, i) => { con...
[ "get boneWeights() {}", "GetBoneWeights() {}", "get weights() { return this.w; }", "function getWeights() {\n return weights;\n }", "getWeights() {\n return this.weights;\n }", "function drawWeights(weights) {\n ctx.font = '20px Arial';\n ctx.fillStyle = myBrown;\n ctx.fillT...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the direction of the mouse
dir() { if (TouchInput.isPressed() && Input.isPressed('control')) { //if ($.editor.wedit = 'point' && !Input.isPressed('ctrl')) return; // RIGHT if (Haya.Mouse.x > this.mouse.x) { return 'right' } // LEFT...
[ "_GetMouseDirection() {\n // Get screen coordinates (bottom-left based) for the mouse\n const screen_mouse_pos = this._GetMousePos()\n // Get screen coordinates (bottom-left based) for the weapon holster\n const screen_holster_pos = new Vec2D(\n this.graphic.parent.worldTransform.tx,\n window....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Disable the inputs and set a datal10nid on the menulist. This can be reverted with `enableWithMessageId()`.
disableWithMessageId(messageId) { this.menulist.setAttribute("data-l10n-id", messageId); this.menulist.setAttribute( "image", "chrome://global/skin/icons/loading.png" ); this.menulist.disabled = true; this.button.disabled = true; }
[ "enableWithMessageId(messageId) {\n this.menulist.setAttribute(\"data-l10n-id\", messageId);\n this.menulist.removeAttribute(\"image\");\n this.menulist.disabled = this.menulist.itemCount == 0;\n this.button.disabled = !this.menulist.selectedItem;\n }", "disable() {\n\t\tMenu.disableItem(this.handle)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
year of birth validation
function validateBirthYear(year_of_birth) { if (year_of_birth < 1950 || year_of_birth > 2020) { alert("year invalid"); } else { year_of_birth = year_of_birth; return year_of_birth; } }
[ "function isBirthYearValid(birthyear) {\n\t\"use strict\";\n\tvar date, currentYear, regExp;\n\tregExp = /^[0-9]*$/;\n\tif (!regExp.test(birthyear)) {\n\t\tdocument.getElementById('errorfieldforyear').innerHTML = \"invalid year\";\n\t\treturn false;\n\t}\n\tif (birthyear <= 1870) {\n\t\tdocument.getElementById('err...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this makes the route header text for the map
function makeRouteHeader(mapNumber){ var headerText = ""; var binaryStringForNumber = binaryStrings[mapNumber]; var stopInputTextField; var stopNumber; if(mapNumber == 0){ return "No Added Waypoints"; } else{ for(charIndex = 0; charIndex < binaryStringForNumber.length; charIndex++){ if(binaryStr...
[ "getHeaderContent() {\n return (\n <span>\n Configuration\n <span className=\"title-separator\">/</span>\n {this.props.routes[this.props.routes.length - 1].name}\n </span>\n );\n }", "function printRoute (){\n for (i = 0; i < segmentKind.length; i++) {\n $('#routeTe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
wrapFunctionCond :: (TypeVarMap, Integer, a) > a
function wrapFunctionCond(_typeVarMap, index, value) { var expType = typeInfo.types[index]; if (expType.type !== FUNCTION) return value; // checkValue :: (TypeVarMap, Integer, String, a) -> Either (() -> Error) TypeVarMap function checkValue(typeVarMap, index, k, x) { var propPath = [k...
[ "function wrapFunctionCond(_typeVarMap, index, value) {\n if (typeInfo.types[index].type !== FUNCTION) return value;\n\n var expType = typeInfo.types[index];\n\n // checkValue :: (TypeVarMap, Integer, String, a) -> Either (() -> Error) TypeVarMap\n function checkValue(typeVarMap, index, k, x) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
request for hostBlankingOrdered service, calls 'callback' function
function requestGetBlanking_CompletedOrdered(query, callback) { // var url = hostBlanking + format.queryToURLForm(slotValue_name, slotValue_country, slotValue_region, slotValue_content, slotValue_date, slotValue_solution); // var url = hostBlanking_Ordered + format.queryToURLForm(slotValue_name, slotValue_country,...
[ "function requestGetBlanking_Ordered(query, callback) {\n\n // var url = hostBlanking + format.queryToURLForm(slotValue_name, slotValue_country, slotValue_region, slotValue_content, slotValue_date, slotValue_solution); \n\n // var url = hostBlanking_Ordered + format.queryToURLForm(slotValue_name, slotValue_co...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
detets an item from the column if the item is stacked (i.e. its price attribute is greater than the item price) then the function decrements the price by the item price until the base price remains if the image is not stacked the function removes the image, decrements the category index, and updates the tabIndex for ea...
function deleteItem(obj, category, price) { var idx = obj.tabIndex; var div = document.getElementById(category); var nodes = div.childNodes; var itemP = parseFloat(nodes[idx].getAttribute("price")).toFixed(2); if (itemP > price) { nodes[idx].setAttribute("price", itemP - price); var count = nodes[idx...
[ "function decrementtable(item, currInv, compItems, itemimages, baseitemimages) {\n const currentItemCount = currInv[item];\n if (currentItemCount === 1) {\n setAllUncraftable(baseitemimages[item]);\n }\n for (let i = 0; i < item; i++) {\n const pairCount = compItems[item][i];\n const pair = itemimages[...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
OSM import is 2nd step after GTFS stop/station import read all existing stations from ES into a hashtable for deduping
async function createDeduper() { const client = new elasticsearch.Client({ host: 'localhost:9200', apiVersion: '7.6', }); function addHash(hit) { const doc = hit._source; const name = doc.name.default; const postal = doc.parent.postalcode; if(name && postal) { const pos = doc.cent...
[ "function importBulkOsm (bbox, cb) {\n wipeDb(osmOrgDb, osmOrgDbPath, (err) => {\n if (err) {\n done(err)\n } else {\n getOsmStream(bbox, function (err, stream) {\n if (err) return done(err)\n\n // Write local OSM.org XML data to disk\n let xmlFilePath = path.join(dbRootDir, 'c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ajout de la barre de ressources
function add_resource() { add_log(3,"add_resource() > Début."); if(var_divers['position_resource'] == 1) var div_res_bar = $id('side_info'); else { if(var_divers['allianz']) var div_res_bar = $class('sideInfoAlly')[0]; else var div_res_bar = $class('sideInfoPlayer')[0]; } var cadre_re...
[ "addResource(value) {\n const props = this.props.model.props;\n this.getWebSocketResourceInfo().forEach((resource) => {\n if (resource.resourceName === value) {\n let serviceDef = props.model;\n let thisNodeIndex;\n if (TreeUtil.isResource(props....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Print1To255() Print all the integers from 1 to 255.
function Print1To255(){ }
[ "function Print1to255() {\n for (var i = 1; i <= 255; i++) {\n console.log(i);\n }\n}", "function Print1To255(){\n\tfor(var x=1; x<=255; x++){\n\t\tconsole.log(x);\n\t}\n}", "function print1To255() {\r\n for (var i = 1; i <= 255; i++) {\r\n console.log(i);\r\n }\r\n}", "function print1To255() {\n f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
animation ready to close
animationReadyToClose() { if (this.animationEnabled()) { // set default view visible before content transition for close runs if (this.getDefaultTabElement()) { const eleC = this.getDefaultTabElement() ? this.getDefaultTabElement().querySelector(ANIMATION_CLASS) : ...
[ "_closePreview () {\n this._triggerAnimation(width, width, width/2, CIRCLE_DIMENSIONS, CIRCLE_DIMENSIONS, CIRCLE_DIMENSIONS/2)\n }", "close() {\n // start animation => look at the css\n this.show = false;\n setTimeout(() => {\n // end animation\n this.start = false;\n // deactivate the...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an instance of the sequelize class, configured for the Postgres database defined in the config object.
initSequelize () { return new Sequelize('vmail', config.postgresUser, config.postgresPass, { host: config.postgresHost, dialect: 'postgres', pool: { max: 5, min: 0, acquire: 30000, idle: 10000 }, // http://docs.sequelizejs.com/manual/tutorial/querying....
[ "function getSquelize(exchangeId) {\n sequelize = sequelize || new Sequelize(process.env.PG_CONNECTION_STRING || 'postgresql://postgres:ameen*3n@localhost:5432/trading_bot');\n debugger;\n return sequelize;\n}", "getDatabaseInstance() {\n return this.sequelize\n }", "function getSequelizeInst...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a lifecycle rule to the bucket
addLifecycleRule(rule) { if ((rule.noncurrentVersionExpirationInDays !== undefined || (rule.noncurrentVersionTransitions && rule.noncurrentVersionTransitions.length > 0)) && !this.versioned) { throw new Error("Cannot use 'noncurrent' rules on a nonversioned bucket"); ...
[ "addLifecycleRule(rule) {\n if ((rule.noncurrentVersionExpiration !== undefined\n || (rule.noncurrentVersionTransitions && rule.noncurrentVersionTransitions.length > 0))\n && !this.versioned) {\n throw new Error(\"Cannot use 'noncurrent' rules on a nonversioned bucket\");\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
endregion region function GetPreferredRegion() Get the user's preferred regional language from the web browser based upon
function GetPreferredRegion() { var regionalLanguage = "en-US"; if (navigator.languages && navigator.languages.length) { regionalLanguage = navigator.languages[0]; } else { regionalLanguage = navigator.userLanguage || navigator.language || navigator.browserLanguage || 'en'; } return ...
[ "function determinePreferredLanguage() {\n var listLang = new Array('fr');\n\n var currentLang = navigator.language.substr(0,2);\n\n if (listLang.indexOf(currentLang) > -1) {\n return currentLang;\n } else {\n return 'fr';\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add nomination to user list and update saved nominations show completion banner if it was the 5th nomination show error banner if they try to add more than 5
function addNomination (idNominated){ if(nominationState.nominations.length < 5){ for(let i = 0; i < searchState.searchResults.length; i++){ if(searchState.searchResults[i].id === idNominated){ let newSearchState = searchState.searchResults; newSearchState[i].nominated = true; ...
[ "function addMoreUsers() {\n inquirer\n .prompt([\n {\n type: 'list',\n name: \"addMoreUsers\",\n message: \"Add another team member?\",\n choices: ['Yes', 'No']\n },\n ])\n .then(function (yesNo) {\n if(yesNo.addMoreUsers === 'Yes'){\n startPrompt();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine and return the syncing mechanism strategy to follow
async _determineSyncMechanism(receivedBlock) { // Loop through to find first mechanism which return true for isValidFor(receivedBlock) // eslint-disable-next-line no-restricted-syntax for await (const mechanism of this.mechanisms) { if (await mechanism.isValidFor(receivedBlock)) { return mechanism; } ...
[ "_enterFirstCompatibleMode(strategies) {\n return async (ftp) => {\n ftp.log(\"Trying to find optimal transfer strategy...\");\n let lastError = undefined;\n for (const strategy of strategies) {\n try {\n const res = await strategy(ftp);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Encodes a single segment of a resource path into the given result
function encodeSegment(segment, resultBuf) { var result = resultBuf; var length = segment.length; for (var i = 0; i < length; i++) { var c = segment.charAt(i); switch (c) { case '\0': result += escapeChar + encodedNul; break; c...
[ "function encodeResourcePath(path) {\n var result = '';\n for (var i = 0; i < path.length; i++) {\n if (result.length > 0) {\n result = encodeSeparator(result);\n }\n result = encodeSegment(path.get(i), result);\n }\n return encodeSeparator(result);\n}", "function encod...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
extract company credits from ORnD
function pullCompanyCredits(array) { var companyIdArr = array; var monthlyCredit = []; var yesterdayDate = new Date(); yesterdayDate.setDate(today.getDate() - 1); var yesterday = yesterdayDate.getDate() for (var i = 0 ; i < companyIdArr.length ; i++){ var post_response_credits = UrlFetchApp.fetch('h...
[ "function getCompanyData() {\n var company_details = { name: '', total_count: 0, core_contributions: 0, projects: {}};\n\n // Fetch the company name.\n company_details.name = casper.fetchText('#page-subtitle');\n casper.echo('Crawling ' + company_details.name + ' contributions.');\n\n // Check the contribution...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert response to project
function convertResponseToProject(response,callback){ var projects = []; //Reformat the file array if (typeof response[0] !='undefined'){ for (var i=0;i<response.length;i++){ var thisProject = response[i]; //Attributes var project = { id : thisProject.id , title : thisProject.title , size :...
[ "function convertResponseToProjectsOverviewModel(response,callback){\n\tvar file;\n\tvar thisFile = response;\n\n\t//Attributes\n\tfile = {\n\t\t\tid : thisFile.id\n\t\t\t, title : thisFile.title\n\t\t\t, size : thisFile.quotaBytesUsed\n\t\t\t, permission : thisFile.userPermission\n\t\t\t, createdDate:thisFile.crea...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display air quality description
function displayQualityDescription() { return airQualityElement.innerHTML === '1' ? airQualityDescription.innerHTML = '&nbsp;Good' : airQualityElement.innerHTML === '2' ? airQualityDescription.innerHTML = '&nbsp;Fair' : airQualityElement.innerHTML === '3' ? airQualityDescription.innerHTML = '&nb...
[ "function displayAirQuality() {\n airQualityElement.innerHTML = `${airQuality.rating}`;\n}", "function getDescription(){\n\t\tvar str = \"Layout \" + layoutIndex + \" containing \" + furniture.length + \" pieces of furniture.\";\n\n\t\treturn str;\n\t}", "function deductibleDescription() { \n return gapP...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Opens the LinkedIn scraper modal
function initLinkedIn() { $('#linkedin-dialog')[0].open(); $('#linkedin-submit-button') .text('Submit') .attr('onclick', 'processLinkedIn()'); }
[ "function open_insta() {\n window.open('https://www.instagram.com/doringoofficial/', '_blank');\n}", "_showGitHubPage() {\n window.open('https://github.com/chromeos/pwa-play-billing', '_blank');\n }", "function github() {\n window.open(githubLink);\n}", "function objectClickHandler1() {\n win...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update timer bar and trigger refetch of codes by time remaining
refreshTimerProgress() { const secondsLeft = this.timeLeft() this.timeLeftPerc = secondsLeft / this.minPeriod * 100 if (secondsLeft < 3 && !this.preFetch && this.signedIn) { // Do a pre-fetch to provide a seamless experience this.fetchCodes(secondsLeft < 0 ? iterationCurrent : iterati...
[ "update_countdown() {\n // prevent late updates\n if (this.countdown == null) return;\n\n // stop the counter\n if (this.countdown.endTime < 0) {\n var callback_f = this.countdown.callback_f;\n this.reset_countdown();\n callbac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generates a new stylesheet and injects all of the styles into the page. This operation is expensive and should be called infrequently only if state required to load css changes. As with Poseidon's API any state should be bound to this method to automatically trigger a reinjection when the styles change
regenerateStyleSheet() { const rules = []; const name = this.constructor.name; //get the JSON object of CSS rules const userJSONStyles = this.styles(); initStyleSheet(userJSONStyles, name, rules); injectStyles(rules); }
[ "function injectCSS() {\n var styleElement = document.createElement('style')\n , cssString = \"\"\n , styles = this.getStyles();\n\n styleElement.className = this.id + '-injected-style injected-style'\n styleElement.type = 'text/css';\n\n for(var className in styles) {\n //We are setting ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts the given data to a new HTML Response
function toHTMLResponse(data) { const init = { headers: { 'content-type': 'text/html;charset=UTF-8' }, } const body = data return new Response(body, init) }
[ "function jsonToHTML (data) {\n \n var html;\n \n \n \n return html;\n}", "function normalizeDataForHtmlWrite(data) {\n\t\t\treturn normalizeDataForNativeWrite(data)\n\t\t\t\t.then(function(nativeData) {\n\t\t\t\t\t// Html API doesn't support writing strings directly,\n\t\t\t\t\t// so we have to...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
finds the real selector from the selectorText.
function getSelectorWithcontainText(selectorText){ var split = selectorText.split(":") var selector = split[0]; var containsText = split[1]; containsText = containsText.split("contains(\"")[1]; containsText = containsText.split("\"\)")[0]; var selectors = document.querySelectorAll(selector); selectors.forEach( f...
[ "function getSelector(selectorText){\n\n\tvar selectorObj;\n\t//check if the selectorTex is a real selector or not\n\tif(includesContains(selectorText)) {\n\t\t//parse and find the selector in the document\n\t\tselectorObj = getSelectorWithcontainText(selectorText);\n\t} else {\n\t\t//find selector in document\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Receive the channel open message from seller
function receive_channel_open() { fullyUsedUp = false; if (!payment_update_timer) { var date = new Date(); var now = date.getTime()/1000.0; last_payment_update_time = now; payment_update_timer = setInterval(update_payment, 100); } else { console.error("Cannot open one c...
[ "function handleReceiveChannelStateChange() {\n var readyState = receiveChannel.readyState;\n trace('Receive channel state is: ' + readyState);\n\n // If channel ready, enable user's input\n if (readyState == \"open\") {\n\t dataChannelSend.disabled = false;\n\t dataChannelSend.focus();\n\t dataChannel...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
show the summernote edit box wrapped around the statblock text
function editBlock() { $('.btn-save').show(); $('.btn-edit').hide(); $('.btn-image').hide(); $('.btn-print').hide(); $('#overEdit').css({'margin-left': '0em', 'margin-right': '0em'}); $('.summernoteEdit').summernote({ focus: true, toolbar: [ // [groupName, [list of button]] ['style', ['b...
[ "function setupDescriptionEditor(){\n\t$('#input_BodyHTML').summernote({\n\t\t height: 250, // set editor height\n\t\t minHeight: 200, // set minimum height of editor\n\t\t maxHeight: 500, // set maximum height of editor\n\t\t focus: false // set focus to...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
We are going to use this function to firebase object keys The function will return the Firebase Object key of a feature Function assumes field in the database Have a check for null
function firebaseOjectKey(user_type, type, indexID){ let featureIdJson; // We use ids if (type.search("_ids") > 0){ // If item in string 1 , -1 not in string featureIdJson = loadfeatureIDs(user_type) } else { // We use the other the base load features featureIdJson = loadFeatures(user_type) ...
[ "function geoFirestoreGetKey(snapshot) {\r\n var id;\r\n if (typeof snapshot.id === 'string' || snapshot.id === null) {\r\n id = snapshot.id;\r\n }\r\n return id;\r\n}", "getKey(refOrSnapshot) {\n return refOrSnapshot.key();\n }", "function geoFireGetKey(snapshot) {\r\n var key;\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Rebuild the full BNList from a BN tree BNList: the list (Object) to reconstruct BN: source BN tree to build from Returns: true if no null encountered while completing the BNList (= no error)
function rebuildBNList (BNList, BN) { let rc = recurRebuildBNList(BNList, BN); BNList[0] = BN; return(rc); }
[ "function recurRebuildBNList (BNList, BN) {\r\n let rc;\r\n if (BN == null) { // Error case, corruption from last jsonified save\r\n\trc = false;\r\n }\r\n else {\r\n\trc = true;\r\n\tBNList[BN.id] = BN;\r\n\tif (BN.type == \"folder\") {\r\n\t let children = BN.children;\r\n\t if (children != undefined) {\r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an instance of FiscalYear representing the one after the current
next() { return new FiscalYear(this.fiscalYear + 1, this.fiscalMonth); }
[ "previous() {\n return new FiscalYear(this.fiscalYear - 1, this.fiscalMonth);\n }", "function getCurrentFiscalYear() {\n const now = new Date();\n\n if(now.getMonth() < 6) {\n return parseInt(now.getFullYear().toString().substr(-2));\n } else {\n return parseInt((now.getFullYear()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given two arrays of integers, find the pair of values with the smallest difference and return that difference. If both arrays are empty, return 1. If one array is empty, return the smallest value from the nonempty array.
function smallestDiff(arr1, arr2) { let min = +Infinity; if(!arr1.length && !arr2.length) return -1; if(!arr1.length || !arr2.length) return Math.min(...arr1.concat(arr2)); for(let i = 0; i < arr1.length; i++){ for(let j = 0; j < arr2.length; j++){ let dif = Math.abs(arr2[j] - arr1[...
[ "function smallestDifference(arrayOne, arrayTwo) {\n \n\t// sort arrays in place increasing order\n\tarrayOne.sort((a,b) => a - b);\n\tarrayTwo.sort((a,b) => a - b);\n\t\n\tlet pair = [];\n\t\n\t// use two pointers starting at begin of both arrays\n\tlet l = 0;\n\tlet r = 0;\n\t\n\t// create var to track smallestD...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Move monsters that are moving intelligently, using the proximity ripple. Attempt to move to a position in the proximity ripple that is closer to the player. Parameters: the X,Y position of the monster to be moved.
function move_smart(i, j) { var x, y, z; /* check for a half-speed monster, and check if not to move. Could be done in the monster list build. */ var monster = monsterAt(i, j); switch (monster.arg) { case TROGLODYTE: case HOBGOBLIN: case METAMORPH: case XVART: case STALKER: cas...
[ "function smart_move(x, y) {\n let monster = monsterAt(x, y);\n if (!monster) {\n console.log(`smart_move(): no monster at ${x},${y}`);\n return;\n }\n\n if (DEBUG_PROXIMITY) {\n screen = initGrid(MAXX, MAXY);\n }\n\n /* get the screen region to check for monster movement */\n let xl = vx(move_xl - ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Iteration 1: All directors? Get the array of all directors. _Bonus_: It seems some of the directors had directed multiple movies so they will pop up multiple times in the array of directors. How could you "clean" a bit this array and make it unified (without duplicates)?
function getAllDirectors(movies) { const directors = movies.map(function(movie){ return movie.director }) const copy = [...directors] for (let i = copy.length - 1; i >= 0; i--) { if (copy.indexOf(copy[i]) !== i) { copy.splice(i, 1) } } return copy }
[ "function directorsUnique(arr) {\n let directors= [];\n const cleanDirectors = arr.map (function(movie){\n if (!directors.includes(movie.director)) {\n directors.push(movie.director)\n }\n });\n return directors;\n}", "function getAllDirectors(arr) {\n var directorsArr = arr....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
sort the links by source, then target
function sortLinks() { data.links.sort(function(a,b) { if (a.source > b.source) { return 1; } else if (a.source < b.source) { return -1; } else { ...
[ "function sortLinks()\n { \n data.links.sort(function(a,b) {\n if (a.source > b.source) \n {\n return 1;\n }\n else if (a.source < b.source) \n {\n return -1;\n }\n else \n {\n if (a.target > b.target) \n {\n return 1;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine the full path to the ios platform
function iosFolder(context) { return context.opts.cordova.project ? context.opts.cordova.project.root : path.join(context.opts.projectRoot, 'platforms/ios/'); }
[ "function getPlatformPath (projectPath, platform) {\n if (!PLATFORMS[platform]) {\n throw new Error(`unknown / unsupported platform: \"${platform}\"`)\n }\n return path.join(projectPath, PLATFORMS[platform])\n}", "function getCurrentPlatform() {\n\n // The supported platforms are defined in\n // suite/loc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculate link station's power with the following formula: power = (reach device's distance from linkstation)^2 and if distance > reach, then power = 0
function get_power(device, link_station) { distance = get_distance(device, link_station) if (distance > link_station[2]) { return 0; } else { return (link_station[2] - distance)**2 } }
[ "function calculatePower(linkStation, device) {\n var power = 0;\n var distance = calculateDistance(linkStation, device);\n\n if (distance <= linkStation.reach) {\n power = Math.pow(linkStation.reach - distance, 2);\n } else {\n power = 0;\n }\n return power;\n}", "function station...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
clientinput is a subclass of netobject used to store input from the client for transmission to the server.
function clientinput(props) { props = props || {}; props.timestamp = netprop.u32; netobject.call(this, props); this.inputID = -1; }
[ "function client_net(sender, input_type) {\n function sender_send(data) {\n sender.send(data);\n }\n this.netconn = new netconn();\n // Last time reported by the server.\n this.serverTime = 0;\n // If set, the thing that represents this client's avatar.\n this.self = null;\n // The loc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Disables the reference line tool for the given element
function disable (element) { $(element).off('CornerstoneToolsMouseDown', mouseDownCallback); }
[ "function disable(element) {\n _externalModules.external.$(element).off('CornerstoneToolsMouseDown', mouseDownCallback);\n}", "function disable(element) {\n $(element).off('CornerstoneToolsMouseDown', mouseDownCallback);\n }", "function disable(element) {\n\t $(element).off('CornerstoneToolsMo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
//////// EDITOR ////////////// ////////////////////////////////////////////////////////////////////////////// /// EDITOR NEW IMAGE SETUP
function editImage(selImg) { initEditor(selImg); }
[ "function ModifyImage(image)\r\n{\r\n console.log(image);\r\n //Hiding the texteditor\r\n $(\"#imageEditor\").css({'bottom':\"-\"+$(\"#imageEditor\")[0].clientHeight+\"px\"});\r\n\r\n //Finding the index of the id\r\n console.log($(\"#imageEditor\").contents().find(\"#id_holder\")[0].value);\r\n var index = G...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
custom print funtion to print Roll20 Object names. Useful for testing purposes.
function customPrintNames(array) { var stringtoPrint = " "; for(var i = 0; i < array.length; i++) { stringtoPrint = stringtoPrint + array[i].get("name") + " "; } //log("Final object order" + stringtoPrint); }
[ "print(obj) {\n if (obj == null) {\n this.write(\"nil\");\n } else if (obj instanceof Frame) {\n this.print_frame(obj);\n } else if (typeof obj === 'string') {\n this.write(JSON.stringify(obj));\n } else if (Array.isArray(obj)) {\n this.print_array(obj);\n } else if (obj instanceo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Request and display hourly data
function getHourData() { var hourPeriod = new scada.HourPeriod(); hourPeriod.date = new Date(); // current date hourPeriod.startHour = 0; hourPeriod.endHour = 23; var cnlFilter = new scada.CnlFilter(); cnlFilter.cnlNums = [CNL_NUM]; cnlFilter.viewIDs = [VIEW_ID]; var selectMode = false...
[ "function displayHours(){\n setFormatLocal();\n getDataFromServer();\n}", "function hourlyLister(cb_args) {\n\tvar hrly_data = cb_args.hrly_data,\n\t\tinput_params = cb_args.input_params,\n\t\tstnName = cb_args.stnName,\n\t\tstnid = input_params.sid.split(\" \"),\n\t\tymd = input_params.edate.split(\"-\"),\n//\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
DISPLAY CONTACTS ARRAY IN THE DOM
function displayContacts(){ section.innerHTML =''; arrayOfContacts.sort(sortArrayOfContacts); for (contactItem of arrayOfContacts){ let contactContainer = createElement(section, 'div', '', 'class', 'contact-container'); let contactLogo = createElement(contactContainer, 'div', '<img src="./person-logo.png">', '...
[ "function displayContacts(el) {\n\t\t\tvar formattedMobile = HTMLmobile.replace('%data%', bio.contacts.mobile);\n\t\t\tvar formattedEmail = HTMLemail.replace('%data%', bio.contacts.email);\n\t\t\tvar formattedTwitter = HTMLtwitter.replace('%data%', bio.contacts.twitter);\n\t\t\tvar formattedGithub = HTMLgithub.repl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
===================================================================================================== Adds an item to a set, only if the item is not already there. The set is modelled using an array.
addToSet(set, item) { if (!set.includes(item)) { set.push(item); } return set; }
[ "function addToSet(set, item) {\n if (!set.includes(item)) {\n set.push(item);\n }\n return set;\n}", "function addItem(array, item) {\n if (!array.contains(item))\n array.push(item);\n }", "function add(array, item){\n if(!contains(array, item)){\n array.push(item);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine wrap pixel count. Either specified or by experimental fudge factor. Note that experimental factor will never be correct for variable width fonts.
function computeWidth (wrapPixels, wrapCount, widthFactor) { return wrapPixels || ((0.5 + wrapCount) * widthFactor); }
[ "function computeWidth (wrapPixels, wrapCount, widthFactor) {\n return wrapPixels || ((0.5 + wrapCount) * widthFactor);\n}", "adjustWrapLimit() {\n var availableWidth = this.$size.scrollerWidth - this.$padding * 2;\n var limit = Math.floor(availableWidth / this.characterWidth);\n return this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getHistogram use d3's histogram layout to generate histogram bins for our word data
function getHistogram(data) { // only get words from the first 30 minutes var thirtyMins = data.filter(function (d) { return d.min < 30; }); // bin data into 2 minutes chuncks // from 0 - 31 minutes // @v4 The d3.histogram() produces a significantly different // data structure then the old d3.la...
[ "createHistogramData() {\n // Create the numBins bins for the horizontal axis of histogram\n let binScale = d3.scale.linear().domain([0, this.numBins]).range([this.minValue, this.maxValue]);\n this.tickArray = d3.range(this.numBins + 1).map(binScale);\n\n // Generate a histogram using uniformly-spaced b...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
adding my html in a function within the return Creating a function called About using p tags wrapped in a container, i will then export the function for use in App.js file set Id and Class names for style.css use
function About() { return ( <div className="page-section" id="about"> <div className="container" id="aboutMe"> <h2 className="aboutMeStyle font-weight-bold">About Me</h2> <p className="pStyle font-weight-bold"> A dynamic technology professional who is motivated to bette...
[ "function drawTemplateAboutUs(page) {\n console.log(page);\n let content = `\n <div class=\"menu-title\">\n <h2>${page.title}</h2>\n </div>\n\n <div class=\"about-us\"> \n ${page.description}\n </div>\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this function kills a set of connected cells
function killAdjacentCells(row, col){ var cellValue = getGridCellDev(updatePlayerGridDev, row, col); // killing a key reduces the number of keys if(cellValue === KEY_CELL_DEV){ numKeysDev--; if (numKeysDev === 0 && currentMutedState() !== true && unlockAudioPlayed !== true) { ...
[ "function kill(){\n\tfor (var i = chunks.length - 1; i >= 0; i--) {\n\t\tfor (var y = chunks[i].cells.length - 1; y >= 0; y--) {\n\t\t\tfor (var z = chunks[i].cells[y].length - 1; z >= 0; z--) {\n\t\t\t\tcell = chunks[i].cells[y][z];\n\t\t\t\tif (cell.k == 0){\n\t\t\t\t\tcell.a = 0;\n\t\t\t\t}\n\t\t\t\telse if(cell...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject if errors occur during the database open operation.
function validateIndexedDBOpenable() { return new Promise((resolve, reject) => { try { let preExist = true; const DB_CHECK_NAME = 'validate-browser-context-for-indexeddb-analytics-module'; const request = self.indexedDB.open(DB_CHECK_NAME); request.onsuc...
[ "function validateIndexedDBOpenable() {\r\n return new Promise(function (resolve, reject) {\r\n try {\r\n var preExist_1 = true;\r\n var DB_CHECK_NAME_1 = 'validate-browser-context-for-indexeddb-analytics-module';\r\n var request_1 = self.indexedDB.open...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
region Auxiliary functions for name constraints checking
function compare_dNSName(name, constraint) { /// <summary>Compare two dNSName values</summary> /// <param name="name" type="String">DNS from name</param> /// <param name="constraint" type="String">Constraint for DNS from name</param> ...
[ "function isNameValid () {\n return $name.val().length > 0;\n }", "function isValidName(interventionName) {\n return interventionName.length > 0;\n}", "function nameValidation () {\n const nameRequirement = /^\\w+/;\n return nameRequirement.test(nameInput.value);\n }", "function assertVa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }