query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Controller that renders a page for creating new events.
function newEvent(request, response){ var contextData = {}; response.render('create-event.html', contextData); }
[ "function createEvent(req, res, next){\n //Take the request body... parse it and add the event to the db\n //Once done---> return next();\n}", "function createEvent(event){\n\n\t// Event Object: Type, Subtype, Description, StartTimeDate, Freshness, Status, NumberOfNotification, Reliability\t \n\tvar ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
1) objects PickupLocation constructor should create a new PickupLocation with two properties: PickupLocation with address and city properties
function PickupLocation (address, city ) { this.address = address; this.city = city; this.PickupLocationdata = function() { console.log(` ${this.adress} ${this.city} `); }; }
[ "function createValidLocation(){\n return createLocation(VALID_LOCATION_PROPERTIES.LATITUDE,VALID_LOCATION_PROPERTIES.LONGITUDE);\n}", "constructor(props){\n super(props)\n this.state = {\n currentLocation: {\n latitude: null,\n longitude: null\n }\n };\n this.getLocation = this.getLocation...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
2. Generate a .torrent file for OUTDIR/stage3.zip > OUTDIR/stage3.zip.torrent Returns a promise for the magnet link
function buildStage3Torrent(inf, outf) { return new Promise(function(accept, reject) { createTorrent(inf, function(err, torrent) { if (err) { reject(err); return; } fs.writeFile(outf, torrent, function(err) { if (err) { ...
[ "function buildStage1(stage2_hash, stage2_uris, magnet, outf) {\n var gen = require(\"./stage1/generate_stage1.js\");\n\n return new Promise(function(accept, reject) {\n var uri = gen.generateStage1(stage2_uris, stage2_hash, magnet, 'base64');\n var output1 = fs.createWriteStream(outf);\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
errorcode is altijd een cijfer tussen de 0 en de 4 en heeft respectievelijk de volgende betekenis: 0: "Geen watertoevoer" 1: "Temperatuur te laag" 2: "Koffiebonen op" 3: "Afvalbak vol" 4: "Geen druk" Verwachtte uitkomsten: errorCode = 0 geeft "Geen watertoevoer" errorCode = 4 geeft "Geen druk"
function checkError(errorCode) { switch(errorCode) { case 0: return 'Geen watertoevoer'; case 1: return 'Temperatuur te laag'; case 2: return 'Koffiebonen op'; case 3: return 'Afvalbak vol'; case 4: return 'Geen druk'; default: return 'Onbekende foutcode'; ...
[ "function getErrorMessage(errorId) {\n switch (errorId) {\n case ID_ERR_VERSIONE:\n if (BAN_EXPM_VERSION) {\n return \"L'estensione richiede come versione minima Banana Contabilità Plus \" + BAN_VERSION + \".\" + BAN_EXPM_VERSION;\n }\n else {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add a new type to the type list
function addType() { var args = extract( { name: 'name', test: function(o) { return typeof o === 'string'; } }, { name: 'type', parse: function(o) { return (o instanceof Type) ? o : new Type(this.name || o.name, o); } } ).from(arguments); typeList.push(args.type); }
[ "addTypes(types) {\n for (const [key, value] of Object.entries(types)) {\n this.addType(key, value);\n }\n return this;\n }", "function AddElementType (type)\n{\n\treturn (doActionEx('MPEA_ADD_ELEMENT', 'ElementID', 'ElementType', type));\n}", "static registerType(type) { Shar...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
updates which characters are shown and which are hidden
function updateHiddenCharacters(){ var hiddenCharacters = []; var shownCharacters = []; $('.character_circle').each(function(i, obj) { shownCharacters.push(obj); for(var j =0; j< hiddenInputs.length; j++){ var numInputs = $(obj).attr(hiddenInputs[j]); if(numInputs > 0){ show...
[ "function chooseCharSubset(s) {\n\tvar l = document.getElementById('editpage-specialchars').getElementsByTagName('p');\n\tfor (var i = 0; i < l.length ; i++) {\n\t\tl[i].style.display = i == s ? 'inline' : 'none';\n\t\tl[i].style.visibility = i == s ? 'visible' : 'hidden';\n\t}\n}", "function virtual_keyboard_tog...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
showCompilations(myUId, mySet) calls the Compilation list for User: myUId if mySet is 0 then it will show them all.
function showCompilations(myUId, mySet) { clearDiv("recordView"); var myURL = "CompilationsLister.php?U=" + myUId + "&S=" + mySet; processAjax (myURL, "recordView"); setBlockVis("recordView", "block"); return true; }
[ "function showUserCompilations(myUId) {\r\n clearDiv(\"recordView\");\r\n var myURL = \"UserCompilationsLister.php?U=\" + myUId;\r\n processAjax (myURL, \"recordView\");\r\n setBlockVis(\"recordView\", \"block\");\r\n return true;\r\n}", "function showCompEntry(myCId, mySet) {\r\n if (myCId === null) { \r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Leibniz function for 2x2 matrices
function Matrix_leibniz_determinant( AA ) { if (AA.numRows != 2 || AA.numColumns != 2) throw "Invalid matrix input!" const a = AA[[0,0]] const b = AA[[0,1]] const c = AA[[1,0]] const d = AA[[1,1]] const precision = 1e-2 return Math.round((a * d - b * c)/precision)*precision }
[ "function LUDecomp(k) {\n\t\t// Assuming k is square matrix in Yale format\n\t\t// k = [A,IA,JA]\n\t\t// U =k;\n\t\tvar N = k[1].length-1;\n\t\t/**var U_A = k[0];\n\t\tvar U_IA = k[1];\n\t\tvar U_JA = k[2];**/\n\t\tvar upper = k;\n\t\t//alert(\"N = \"+N);\n\t\t//set first 1 in place\n\t\tvar L_A = new Array();\n\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This getter allows reusing Hacker News API axios instance somewhere else in the code.
get axios() { return this._axios }
[ "get axios() {\n return this._axios;\n }", "constructAxiosRequestConfig() {\n const input = this._getInput(this.edge);\n const config = {\n url: this._getUrl(this.edge, input),\n params: this._getParams(this.edge, input),\n data: this._getRequestBody(this.e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show marker grocery store chains
function show_grocery_store_chains() { markers_site[S_GROCERY_STORE_CHAINS] = show_place_markers_1(14 , 8 , data_site[S_GROCERY_STORE_CHAINS], 'img/store_chain.png', S_GROCERY_STORE_CHAINS); }
[ "changeMarker() {\n\t\t_.forEach(this.markers, (a) => a.style.display = this.saved ? 'inline' : '');\n\t}", "function showStations() {\n\n Object.keys(Hubway.stations).forEach(function(id) {\n \n var row = Hubway.stations[id];\n \n var description = '['+ id + '] ' + row.name + ', ' + ro...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Mark outgoing messages for queueing.
_queueOutgoing() { if (!this._inactiveSendQueue) { this._inactiveSendQueue = []; } }
[ "queueStanza(iq) {\n this.otherStanzas.push(iq);\n }", "sendQueued(otherClient) {\n if (this.id === otherClient.id || !otherClient.ws) {\n throw Error(\"Invalid client\");\n }\n for (var m of this.msgs) sendServerMsg(otherClient.ws, m);\n this.msgs = [];\n debug(\"Sent queued messages from...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
IMGUI_API void ListBoxFooter(); // terminate the scrolling region
function ListBoxFooter() { bind.ListBoxFooter(); }
[ "function end() {\n this.pos = this.listSize - 1;\n }", "function killFooter() {\r\n var footer = storeSalesTable.lastChild;\r\n footer.remove();\r\n}", "function revealEnd() {\n this.index = this.items.length;\n for (var i=0; i<this.items.length; i++) {\n var para = this.items[i];\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Language: QML Requires: javascript.js, xml.js
function qml(hljs) { const KEYWORDS = { keyword: 'in of on if for while finally var new function do return void else break catch ' + 'instanceof with throw case default try this switch continue typeof delete ' + 'let yield const export super debugger as async await import', literal: 't...
[ "function initQuizmeLanguage() {\n if (DEBUG) console.log(\"RAM: initQuizmeLanguage \");\n \n var whitelist = [];\n whitelist = whitelist.concat(MATH_BLOCKS).concat(LOGIC_BLOCKS).concat(VARIABLES_BLOCKS).concat(PROCEDURES_BLOCKS);\n whitelist = whitelist.concat(CONTROLS_BLOCKS).concat(LISTS_BLOCKS).concat(TEXT_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generer le code html du tableau en prenant en parametre le nombre de lignes, le nombre de colonnes et l'image
function _tableElement(nbLignes,nbColonnes,image) { var table = "<table>"; // extraire la hauteur et la largeur de l'image var hauteur = image.naturalHeight; var largeur = image.naturalWidth; // générer les attributs "height" et "width" des canvas var attributeHeight = _heightAttr...
[ "function createTable() {\n $(\"#main\").append(\"<table id='field'>\");\n for (var r = 0; r < dim_max; r++) {\n $(\"#field\").append(\"<tr id='r\" + r + \"'>\");\n for (var c = 0; c < dim_max; c++) {\n //row\n $(\"#r\" + r).append(\"<td id='\" + r + \"-\" + c + \"' align='center'>\");\n //4 ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
One iteration of the persistence loop. Emits a 'loop' event, that all active persistent tools can detect.
loop() { clearTimeout(this.persistentLoop); // emit loop event to any active persistent tool EventBus.$emit("loop", this.loopCount); // redraw canvas if (this.file && this.file.selectionCanvas) this.onRedrawCanvas(); // increase loop iteration ++this.loopCount; // re-run persistence l...
[ "startLoop() {\n clearTimeout(this.persistentLoop);\n this.persistentLoop = setTimeout(() => this.loop(), 25);\n }", "function loop() {\n\n game_step_settings()\n\n road_loop_settings();\n\n cloud_loop_settings();\n\n cactus_loop_settings();\n\n collision_settings();\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check remote content in a compose window.
function checkComposeWindow(replyType) { let errMsg = ""; let replyWindow = null; switch (replyType) { case 0: replyWindow = composeHelper.open_compose_new_mail(); errMsg = "new mail"; break; case 1: replyWindow = composeHelper.open_compose_with_reply(); errMsg = "reply"; break; case...
[ "function isDialogOpened(){\n return (ipc.sendSync('isDialogOpenedRequest'));\n}", "function checkContents() {\n\n var content = document.getElementById(\"content\");\n\n if (typeof(content) !== 'undefined' && content !== null) {\n return checkContent = true;\n }\n else {\n return che...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Bundles and returns referenced swagger object.
_bundle (schema){ return SwaggerParser.bundle(schema, this.options); }
[ "merge (){\n const validatePromise = this._validate(this.swaggerInput);\n const bundlePromise = this._bundle(this.swaggerInput);\n const promiseArray = [validatePromise, bundlePromise];\n const that = this;\n\n // Merging referenced and dereferenced swagger object to have ref links and the dereferenc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
LogOff. REST response erases keyCookie and change keyCookie on server if LogOff from all devices
function logOff(all) { removeJwtToken(); document.location.assign("/login") }
[ "function logout() {\n // clear the token\n AuthToken.setToken();\n }", "function deleteJwtCookie(response) {\n response.unstate(_appConfig.settings.get('/JWT/COOKIE/NAME'), {\n ttl: 0, // In milliseconds\n path: _appConfig.settings.get('/JWT/COOKIE/PATH'),\n d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Populate agents on page (does not handle ordering!)
function populateAgents() { asyncRequest("GET", "agents", "", undefined, function(responseText){ let json = JSON.parse(responseText); // Ensure response packet isn't malformed if (!("results" in json)) { reportIssue("ERROR populateAgents: Malformed response for agent list refresh callback!"); return; } ...
[ "function generateAgents(numHum, propZomb,x,y){\r\n\t//if(gameState){\r\n\t\tfor (var i = 0; i < numHum; i++){\r\n\t\t\tconst human = new Agents('Human',2,traitSelector(),'Blue',initialLocation(x,y));\r\n\t\t\tactiveAgents.push(human);\r\n\t\t}\r\n\t\tfor (var j = 0; j < (numHum*propZomb); j++){\r\n\t\t\tconst zomb...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine whether the given properties match those of a `CfnUserProps`
function CfnUserPropsValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); errors.collect(cdk.propertyValidator('groups', cdk.listValidator(cdk.validateString))(properties.groups)); errors.collect(cdk.propertyV...
[ "function CfnUser_LoginProfilePropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n errors.collect(cdk.propertyValidator('password', cdk.requiredValidator)(properties.password));\n errors.collec...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Public Interface Validates a model of the deserialized YAML
static validate(objectModel, outputFormat, yaml, opts) { const version = _.get(objectModel, 'version'); return Validator._getValidator(version).validate(objectModel, outputFormat, yaml, opts); }
[ "async function validate(model, body) {\n\tconst validationRes = swaggerModel.validateModel(model, body, true, true);\n\tif (validationRes.valid) return;\n\n\tthrow new ValidationError({\n\t\terrors: validationRes.GetErrorMessages(),\n\t});\n}", "_validate (schema){\n return SwaggerParser.validate(schema, this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
IMGUI_API bool BeginMenu(const char label, bool enabled = true); // create a submenu entry. only call EndMenu() if this returns true!
function BeginMenu(label, enabled = true) { return bind.BeginMenu(label, enabled); }
[ "function AddCustomMenuItems(menu) {\r\n menu.AddItem(strHelp, 0, OnMenuClicked);\r\n}", "function bbedit_components_draw_menu() {}", "BuildMenuButton(){\n // Menu bar Translucide\n NanoXSetMenuBarTranslucide(true)\n // clear menu button left\n NanoXClearMenuButtonLeft()\n //...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a new detail box Info [] Detail boxes are the main elements of the map controls, any information or menu within the controls will be within a detail box. They're the element that slides in and out with different content. [] With the exception of the base detail box, all detail boxes are created with JS. Notes [1...
function newDetailBox(options){ s.controls.maxZ+=10;/*[1]*/ var box = $('<div/>',{class:'wc-mc-detail-box ' + WcFun.emptyIfNull(options.customClass)}) .css({'z-index':s.controls.maxZ}) .data('boxOptions',options); /*[2]*/ box.appendTo(s.controls.slideTrack); var headerbox, headerContentMarkup; /***...
[ "function displayDetailedInfo(info) {\n $('#info-title').html(info[0]);\n $('#infobox-detailed-content').html(info[1]);\n $('#infobox-detailed').show();\n}", "function showInfoBox(e) {\n if (e.targetType == 'pushpin') {\n if (currInfobox) {\n currInfobox.setOptions({ visible: true });\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts an HTTP response's error status to the equivalent error code.
function mapCodeFromHttpResponseErrorStatus(status) { var serverError = status.toLowerCase().replace('_', '-'); return Object.values(Code).indexOf(serverError) >= 0 ? serverError : Code.UNKNOWN; }
[ "function getValidHttpErrorCode (err) {\n var errorCode\n if (err.code && String(err.code).match(/[1-5][0-5][0-9]$/)) {\n errorCode = parseInt(err.code)\n } else {\n errorCode = 500\n }\n return errorCode\n}", "function readResponseCode(int) {\n const codes = {\n 0: [`Success! Returned results succ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is the directive for the points controller. Use: to embed to controller in the html file.
function clientTeamPointsController(){ return { restrict: 'E', scope: {}, templateUrl: 'app/client/clientTeamPoints/client-team-points.html', controller: 'initTeamPointsController', controllerAs: 'teamPointsCtrl' }; }
[ "function currentSpotDirective() {\n return {\n restrict: 'E',\n templateUrl: '/app/main/currentSpotTemplate.html',\n controller: CurrentSpotController,\n };\n }", "function currentSpotMarkerDirective(currentSpot) {\n return {\n restrict: 'A',\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Object Oriented Programming: Use a Constructor to Create Objects Here's the Bird constructor from the previous challenge:
function Bird() { this.name = "Albert"; this.color = "blue"; this.numLegs = 2; // "this" inside the constructor always refers to the object being created }
[ "constructor(size) {\r\n this.birds = [];\r\n this.size = size;\r\n this.actualBird = 0; //kind of an index for the population\r\n for (let i = 0; i < size; i++) {\r\n this.birds.push(new bird());\r\n }\r\n this.generation = 0;\r\n this.melhor = this.birds...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handles with the closing of the notification
function handleClose () { setNotificationInfo({ openNotification: false }) }
[ "close(notification) {\n notification.cancel();\n }", "function cpsh_onClose(evt) {\n if (processed) {\n WapPushManager.close();\n return;\n }\n quitAppConfirmDialog.hidden = false;\n }", "function receive_close() {\n set_ui_state(UI_STATES.FUNDS_DEPLETED);\n set_channel_state(CHANNE...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fonction pour creer un nouveau morceau de Snake lors des tests SANS bouffer de fourmi
function CreerMorceauSnakeInit (x, y, width, height, dx, dy, TailleTableauSnake, color) { window['Tab'+ TailleTableauSnake] = []; console.log("valeur de la taille du tableau envoyee: ", TailleTableauSnake); //On instancie un nouveau morceau de snake console.log("nom de la valiable dynamique: "...
[ "function CreerMorceauSnake (x, y, width, height, dx, dy, historique, color) {\n \n Compteur = Compteur +1;\n \n //On prepare un tableau vide pour etre passe en parametre de la creation de morceau. Ce tableau contiendra plus tard les objets historiques\n window['Tab'+ Compteur] = [];\n \n //On ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all of the checked options
function getCheckedOptions() { curChecked = []; curChecked.push($('#allCheckbox').is(':checked')); curChecked.push($('#medicalCheckbox').is(':checked')); curChecked.push($('#trafficCheckbox').is(':checked')); curChecked.push($('#fireCheckbox').is(':checked')); curChecked.push($('#alarmCheckbox'...
[ "get checkedOptions() {\n var _a;\n return (_a = this.options) === null || _a === void 0 ? void 0 : _a.filter(o => o.checked);\n }", "function getCheckedCheckboxes (singleSelectLatestAnswer) {\n const checkBoxes = document.getElementsByTagName('input')\n let answerGiven = []\n\n for (let...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Build the Vue project.
buildVue() { return new Promise((resolve, reject) => { const args = ['build']; if (this.config.vueOptions) { const userArgs = this.config.vueOptions.split(' '); args = args.push(userArgs); } const cli = spawn('vue-cli-service', args...
[ "async function build() {\n try {\n const configurations = [\n createFileConfiguration(\n `${COMPONENTS}/index.js`,\n 'umd',\n 'dist/ninja-ui.umd.js',\n pkg.name,\n ),\n // Build CJS\n createFileConfiguration(\n `${COMPONENTS}/index.js...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Examine the body and attempt to infer an appropriate MIME type for it. If no such type can be inferred, this method will return `null`.
detectContentTypeHeader() { // An empty body has no content type. if (this.body === null) { return null; } // FormData bodies rely on the browser's content type assignment. if (isFormData(this.body)) { return null; } // Blobs usually have t...
[ "function getContentTypeById(formated_id) {\n\tif (formated_id.match(IMAGE) != null) {\n\t\treturn IMAGE;\n\t} else if (formated_id.match(VIDEO) != null) {\n\t\treturn VIDEO;\n\t} else if (formated_id.match(IMAGE_TEXT) != null) {I\n\t\treturn IMAGE_TEXT;\n\t} else if (formated_id.match(TEXT) != null) {\n\t\treturn ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Progression 7 Filter players that won ______ award and belong to ______ country
function filterByAwardxCountry(awardwon, countryname) { let list = []; players.filter(details => { details.awards.forEach(val => { if (val.name === awardwon && details.country === countryname) { list.push(details); } }); }); return list; }
[ "function SortByNamexAwardxTimes(awardName, noOfTimes, country) {\n let choosenPlayers = []\n for (const i of players) {\n if (i.country == country) {\n let count = 0\n for (const j of i.awards) {\n if (awardName = j.name) {\n count++\n }\n }\n\n if (count) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a job to the global job list (this does not modify the HTML table)
function addJob(jobid, userid, status, desc) { globalJobList.push({ "Ownerid" : userid, "SubmitAddr" : "-", "Desc" : desc, "Taskid" : jobid, "Status" : status, "Age" : 0...
[ "function addJobRow(data)\n{\n var node = document.getElementById(\"jobs-table-body\");\n addJobRowAt(node,data);\n}", "handleAddJobClick(job) {\n // console.log('handleAddJobClick job: '+JSON.stringify(job))\n let newState = this.state.jobs.concat(job);\n this.setState({ jobs: newState })\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add occupant to shelter unit name and size must be passed so they can be appended to response object that updates state
addOccupant(id, name, unitName, unitSize) { const personName = name; const unitId = id; const theShelter = this.state.currentShelter; const occupant = { shelters: { shelterName: theShelter.shelterName }, organizations: { orgName: theShelter.organizationName }, occupancy: { name: person...
[ "addUnits(e) {\n const unit = { shelterUnit: { unitSize: e.shelterUnit.unitSize, unitName: e.shelterUnit.unitName },\n shelters: { shelterName: e.shelters.shelterName },\n organizations: { orgName: e.organizations.orgName } };\n\n ManagerActions.addUnits(unit);\n }", "function add_shirt()\n{\n\tvar s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Private Method: contest searches for biased BGR values
function contest(b, g, r) { /* finds closest neuron (min dist) and updates freq finds best neuron (min dist-bias) and returns position for frequently chosen neurons, freq[i] is high and bias[i] is negative bias[i] = gamma * ((1 / netsize) - freq[i]) */ var bestd = ~(1 << 31); va...
[ "detectRegion(stage, regionToFind) {\n if (!stage.srcCtx) {\n return null;\n }\n\n const srcData = stage.srcCtx.getImageData(0, 0, stage.srcSize.w, stage.srcSize.h);\n\n let x, y;\n\n // First find optical bounds\n // This works by taking an alpha value histogram and finding two maxima to det...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method shuffles the string passed in
shuffle(string) { var characters = string.split(''); var length = characters.length; for (var i = length - 1; i > 0; i--) { var j = Math.floor(Math.random() * (i + 1)); var temp = characters[i]; characters[i] = characters[j]; characters[j] = temp; } var result = characters.jo...
[ "shuffleSpells() {\n this.spellDeck.shuffle();\n }", "function scrambleWord(word) {\n var scrambledWord = '';\n\n // if it's a small word or ~randomness~, don't scramble it\n if (word.length < 3 || Math.random() > 1 / 10) {\n return word;\n }\n\n var a = getRandomInt(1, word.length -...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Produces an OpenRTBImpression from a slot config.
function impression(slot) { return { id: slot.bidId, banner: banner(slot), 'native': nativeImpression(slot), tagid: slot.params.ct.toString(), video: video(slot), bidfloor: slot.params.bidfloor, ext: ext(slot) }; }
[ "function banner(slot) {\n var size = adSize(slot);\n return slot.nativeParams || slot.params.video ? null : {\n w: size[0],\n h: size[1],\n battr: slot.params.battr\n };\n}", "function fillBidResponse(tag, bidResponseTemplate) {\n bidResponseTemplate.uuid = tag.uuid;\n bidResponseTemplate.tag_i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a string indicating which of the standard methods for configuring PostCSS applies to the current theme, if any. Otherwise, returns `false`.
function getPostCSSRC() { const themeConfig = lfrThemeConfig.getConfig(true); return ( (themeConfig.hasOwnProperty('postcss') && 'package.json "postcss"') || exists('.postcssrc') || exists('.postcssrc.js') || exists('.postcssrc.json') || exists('.postcssrc.yml') || exists('postcss.config.js') ); }
[ "getCurrentTheme() {\n return this.isDarkTheme ? 'dark' : 'light';\n }", "function isTransformSupported() {\n return isCssSupported(['transformProperty', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform']);\n }", "function lookupThemeName() {\n // As a few components (dia...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return a unique int for use in a map for a stop and round
function stopRoundHash (round, stop) { // assume less than 64 rounds return (stop << 5) + round }
[ "function stopNameToId(name) {\n\t// \tIf the stop is one with duplicate names\n\t// \twe use the number after it to find it's ID \n\t// \teg. Newry Stop 2 would be the 3rd ID associated with Newry\n\tvar splits = name.split(\"Stop\");\n\tif (splits.length == 2) {\n\t\tbaseName = splits[0].trim();\n\t\tnum = parseI...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Attach a getter to a given property of the global object
function attachToGlobal(property, getter) { const global_ = typeof globalThis !== 'undefined' ? globalThis : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : null; if (global_ === null) ...
[ "get(target, property, receiver) {\n return trap.get(target, property, receiver);\n }", "createProperty(obj, name, value, post = null, priority = 0, transform = null, isPoly = false) {\n obj['__' + name] = {\n value,\n isProperty: true,\n sequencers: [],\n tidals: [],\n mods: [...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
const ladoCuadrado = 5; console.log("Los lados del cuadrado miden: " + ladoCuadrado + "cm");
function perimetroCuadrado(lado){ return lado * 4; }
[ "function printMetinisPajamuDydis() {\n\n console.log(\"Metinis atlyginiams \" + atlyginimas * 12);\n}", "function halo(){\n return \"Halo Sanbers!\";\n}", "function ConstantFunction()\r\n{\r\n const Pi=3.142;\r\n //Pi=5; // we cannot update the values in const variables\r\n console.log(Pi);\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
POST request to skyscanner to get session key
function getSessionKey(originplace, destinationplace, outbounddate, inbounddate) { let options = { method: 'POST', uri: 'http://partners.api.skyscanner.net/apiservices/pricing/v1.0', transform: (body, response, resolveWithFullResponse) => { return response.headers.location.split("/").slice(-1)[0]; ...
[ "function getClientKey() {\n\n }", "static generateKey(){\n\t\tlet kparams = {};\n\t\treturn new kaltura.RequestBuilder('playready_playreadydrm', 'generateKey', kparams);\n\t}", "function signin(){\n var payload = {\n \"username\": username.value,\n \"password\": password.value\n };\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
============================================= Funcion para llenar la tabla ascensor_valores_elementos, trayendo del servidor los items en un archivo JSON ==============================================
function llenarTablaAscensorValoresElementos(){ var cod_inspector = window.localStorage.getItem("codigo_inspector"); var parametros = {"inspector" : cod_inspector}; $.ajax({ async: true, url: "http://www.montajesyprocesos.com/inspeccion/servidor/php/json_app_ascensor_valores_elementos.php", data: par...
[ "function llenarTablaAscensorValoresIniciales(){\n var cod_inspector = window.localStorage.getItem(\"codigo_inspector\");\n var parametros = {\"inspector\" : cod_inspector};\n $.ajax({\n async: true,\n url: \"http://www.montajesyprocesos.com/inspeccion/servidor/php/json_app_ascensor_valores_iniciales.php\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if summarizeBySortOrder exists
function hasSummarizeBySortOrder(tgrp){ /* var tabsFrame = View.getView('parent').panels.get('tabsFrame'); if(tabsFrame == null){ tabsFrame = View.getView('parent').getView('parent').panels.get('tabsFrame'); } view = tabsFrame.newView; */ // var bSummarizeBySortOrder = false; if (tgrp.hasOwnProperty('pagi...
[ "function hasGroupByDate(curTgrp){\n var sortFields = curTgrp.sortFields;\n if ((sortFields) && (sortFields.length > 0)) {\n \tfor(var i=0; i<sortFields.length; i++){\n \t\tvar sortField = sortFields[i];\n var groupByDate = sortFields[i].groupByDate;\n if ((groupByDate != '')) {\n \...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Round a value to the closest 'to'.
function closest ( value, to ) { return Math.round(value / to) * to; }
[ "function roundTowardsZero(x) {\r\n var a;\r\n if (x < 0) {\r\n a = Math.ceil(x);\r\n } else {\r\n a = Math.floor(x);\r\n }\r\n return a;\r\n}", "function roundDistance(distance) {\n return Math.round(distance * 100) / 100\n}", "function truncate(_value)\n{\n if (_value < 0) r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Advance the testQueue to the next test to process. Call done() if testQueue completes.
function advanceTestQueue() { if (!config.blocking && !config.queue.length && config.depth === 0) { done(); return; } var testTasks = config.queue.shift(); addToTaskQueue(testTasks()); if (priorityCount > 0) { priorityCount--; } advance(); }
[ "function runTests(){\n var len = testsQueue.length;\n while(testsQueueIndex < len && !testIsRunning){\n currentTestHash = testsQueue[testsQueueIndex];\n currentTestStep = 0;\n testIsRunning = true;\n runTest();\n }\n if(testsQueueIndex === le...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GenerateSegments takes a string, breaks it into '/' separated segments, and removes potential blank first and last segments.
GenerateSegments(argument) { var result = argument.split("/"); if (result.length > 0) { if (result[0] == "") { result.shift(); } } if (result.length > 0) { if (result[result.length - 1] == "") { result.pop(); ...
[ "function segmentize(url) {\n\t\treturn strip(url).split('/');\n\t}", "function tokensToParser(segments, extraOptions) {\r\n const options = assign({}, BASE_PATH_PARSER_OPTIONS, extraOptions);\r\n // the amount of scores is the same as the length of segments except for the root segment \"/\"\r\n const sc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts a rectangle to an SVG path.
function rectToPath(rect, ccw) { var c = ","; var L = " L"; if (ccw) { return "M" + rect.x + c + rect.y + L + rect.x + c + (rect.y + rect.height) + L + (rect.x + rect.width) + c + (rect.y + rect.height) + L + (rect.x + rect.width) + c + rect.y + L + rect.x + c + rect.y; } else { ...
[ "createSvgRectElement(x,y,w,h){const rect=document.createElementNS(svgNs$1,'rect');rect.setAttribute('x',x.toString());rect.setAttribute('y',y.toString());rect.setAttribute('height',w.toString());rect.setAttribute('width',h.toString());rect.setAttribute('fill','#000000');return rect;}", "path(x, y) {\n stroke(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
valid names are nonempty
function validName(input) { return input.length > 0 }
[ "function name_check() {\r\n name_warn();\r\n final_validate();\r\n}", "function checkNames(game) {\n var names = [];\n var forbiddenNames = [\"roundScore\", \"accumulatedScore\", \"collectiveRoundScore\", \"accumulatedCollectiveScore\"];\n for (var variableName in game.inputVariables) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
load the marketo form
function loadMarketoForm() { MktoForms2.loadForm( _self.defaultOptions.marketoAPIUrl, _self.defaultOptions.munchkinId, _self.defaultOptions.formid, function(form) { // create form function _self.form = form; // load all the select options if needed for (var i = 0; i < _self.defa...
[ "function loadMarketo() {\r\n\r\n\t\tif(_self.defaultOptions.marketoLibUrl) {\r\n\t\t\tloadScript(_self.defaultOptions.marketoLibUrl, function(){\r\n\t\t\t\tloadMarketoForm();\r\n\t\t\t});\r\n\t\t}\r\n\t\telse\r\n\t\t\tloadMarketoForm(); \r\n\t}", "function addQuizForm() {\n $('main').find('fieldset').html(load...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
draw some nested squares
function nestedSquares(count) { clear(); goto(0,0); hideturtle(); for (s=1; s<count*4; s=s+4) { penup(); // move down and back 2 spaces left(90); forward(2); left(90); forward(2); left(180); pendown(); color (random(16)); square (s); } }
[ "function drawSquareSideHouse() {\n moveForward(50);\n turnRight(90);\n}", "function makeSquares() {\n squareSize = sizeArray[j];\n //squareSize = sizeArray[j];\n for (let x = 0; x < width; x += squareSize) {\n for (let y = 0; y < height; y += squareSize) {\n fill(int(random(200, 255)), 0, int(random...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
wrap the currently selection with given head and tail (if nothing selected, uses defaultText)
function wrapText(textArea, head, tail, defaultText) { updateSelection(textArea); if(ie_range) { // internet explorer if(ie_range.text) { ie_range.text=head+ie_range.text+tail; // leaves us behind the new addition which is what we want } else { ie_range.text=head+defaultText+tail; // select...
[ "function wrappSelection(before,after,caret,line){\n\n\t\tvar selection = $.editor.getSelection();\n\t\tvar cursor = $.editor.getCursor();\n\t\t$.editor.replaceSelection(before+selection+after);\n\t\t$.editor.focus();\n\n\t\t/* setCursor after wrapped content */\n\t\tif(line)\n\t\t\tcursor.line = cursor.line+line;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Obtain global rank of a particular url from API call.
function getGlobalRank(url) { // Request for global rank (Global and Country Rank) var startDate="2018-10"; var endDate="2018-10"; var mainDomain=false; // Requesting Website var reqApiUrl="https://api.similarweb.com/v1/website/"+url+"/global-rank/global-rank?api_key="+pageStatsApiKey+"&start_date="+startDate+"...
[ "function compareGlobalRank(requestingUrl, possibleOriginalUrl)\n{\n\tisGlobalRankLegit = [0, \"No Global Rank!\"];\n\t\n\t// Requesting URL\n\tvar requestingUrlGlobalRank = getGlobalRank(requestingUrl);\n\t\n\t// Original URL\n\tvar possibleOriginalUrlGlobalRank = getGlobalRank(possibleOriginalUrl);\n\t\n\t// Veri...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to generate applied filter dictionary required for backend purpose
function generate_filter_dict() { var fb = $('.applied_filter_block .inner_filter_block'); var filter_dict = {}; if( !fb.length) { return {} } fb.each(function() { filter_dict[$(this).data('name')] = $(this).data('value') }); return filter_dict; }
[ "getFilters(key, appliedFilters) {\n let filters = [];\n //let appliedFilters = Object.assign({}, this.state.appliedFilters);\n return Object.keys(appliedFilters).map(k => { \n let next = appliedFilters[k];\n if (next && next.willFilter && next.willFilter.length > 0 ) {\n let will = next.w...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create edges linking rooms to people based on the SMAS data
function findSmasRoomPersonEdges ( roomCollection, personCollection, roomPersonEdges, smasData ) { return Promise.each(smasData, function (row, i) { let smasRoom = { name: row['Bldg'] + ' ' + row['Room'] } let smasPersons = parsePersonsFromSmasDescription(row['Description']) return Promise.each(sm...
[ "function buildGraph(edges) {\r\n let graph = Object.create(null); // graph is created as a null Object\r\n function addEdge(from, to) {\r\n if(graph[from] == null) { // if there is no key named graph[from]\r\n graph[from] = [to]; // create a new key/...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function setting the width of the sections
function setSectionWidth(deviceWidth) { // querying all the elements with class section var sections = document.querySelectorAll("div.section"); // querying all the elements with class tool-div var toolDivs = document.querySelectorAll("div.tool-div"); var node; if (deviceWidth >= 1000) { ...
[ "set requestedWidth(value) {}", "function reassignWidth() {\n return data[accountGlobal.id].news[storyGlobal.id - 1].width;\n}", "function setSummarizeByWidth(sectionId,p_sectionId,p_paddingRight)\r\n{\r\n\tchildObj = document.getElementById(p_sectionId);\r\n\tchildObj.parentNode.style.paddingRight=p_padding...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
scans 255 ip addresses 1.2.3.X
function scan_iprange(ip) { ip=$("#ip").val(); var myRegexp = /([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/g; var match = myRegexp.exec(ip); targetIPs=[]; for(i =0;i<255;i++) { targetip=match[1]+"."+match[2]+"."+match[3]+"."+i; targetIPs.push(targetip); } //async json pull $.each( targetIPs, functi...
[ "function convertIPv4FromString (ipIn) {\r\n\tvar res = ipIn.split(\".\");\r\n\tvar len = res.length;\r\n\tif (len!=4){\r\n\t\twindow.alert(\"Bad format in one IP Address\");\r\n\t\treturn null;\r\n\t}\r\n\tvar ipOut = new Array();\r\n\tfor (var i = 0; i < len; i++){\r\n\t\tipOut[i] = parseInt(res[i]);\r\n\t\tif (i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Twilio SMS adapter does not support updateActivity.
updateActivity(context, activity) { return __awaiter(this, void 0, void 0, function* () { debug('Twilio SMS does not support updating activities.'); }); }
[ "function defaultActivity()\n{\n client.user.setActivity('?sd help', { type: 'Listening' });\n}", "updatePhoneCard(stepId, action, key, value) {\n var data = {};\n data['update_type'] = 'card_item';\n data['type'] = 'phone-card';\n data['_id'] = stepId;\n data['action'] = act...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper fn to parse duration labels ex: Duration: 2:27, Kesto: 1.07.54
function _parseDuration(timestampText) { var a = timestampText.split(/\s+/); var lastword = a[a.length - 1]; // ex: Duration: 2:27, Kesto: 1.07.54 // replace all non :, non digits and non . var timestamp = lastword.replace(/[^:.\d]/g, ''); if (!timestamp) return { toString: function toString() { re...
[ "function duration_from_task_dictionary(item) {\n item_name = item.content\n item_has_time = item_name.indexOf(\"|\") != -1 && item_name.indexOf(\"[\") != -1 && item_name.indexOf(\"]\") != -1\n if (item_has_time) {\n var duration = parseInt(item_name.substring(item_name.lastIndexOf(\"|\") + 1, item_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This will search for clients by id_nbr value. It will show a maximum of 5 values
function searchClientByID() { hideAllOptions(); //Show the resources loading view $scope.loadingResources = true; //get user input from form var clientId = $scope.clientID; //if they don't chose a client, start over if (clientId === ...
[ "function getClient(id) {\n for (var i = 0; i < clients.length; i++) {\n if (clients[i].clientID == id) {\n return clients[i].clientName;\n }\n }\n}", "function getClientById(id){\n var count = users.length;\n var client = null;\n for(var i=0;i<count;i++){\n \n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.Rule` resource
function cfnBucketRulePropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnBucket_RulePropertyValidator(properties).assertSuccess(); return { AbortIncompleteMultipartUpload: cfnBucketAbortIncompleteMultipartUploadPropertyToCloudFormation(prope...
[ "function cfnStorageLensS3BucketDestinationPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnStorageLens_S3BucketDestinationPropertyValidator(properties).assertSuccess();\n return {\n AccountId: cdk.stringToCloudFormation(properties.a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieve the information of a person group, including its name and userData. This API returns person group information only, use Person List Persons in a Person Group instead to retrieve person information under the person group. Http Method GET
personGroupGetAPersonGroupGet(queryParams, headerParams, pathParams) { const queryParamsMapped = {}; const headerParamsMapped = {}; const pathParamsMapped = {}; Object.assign(queryParamsMapped, convertParamsToRealParams(queryParams, PersonGroupGetAPersonGroupGetQueryParametersNameMap)); ...
[ "personListPersonsInAPersonGroupGet(queryParams, headerParams, pathParams) {\n const queryParamsMapped = {};\n const headerParamsMapped = {};\n const pathParamsMapped = {};\n Object.assign(queryParamsMapped, convertParamsToRealParams(queryParams, PersonListPersonsInAPersonGroupGetQueryPa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCION PARA ASIGNAR EL EVENTO DE FINALIZACION DE LA PISTA DE AUDIO PARA CONTINUAR LA REPRODUCCION CON LA PROXIMA CANCION
function evento_siguiente_cancion(canciones, i){ audio.addEventListener('ended', function () { //ESTABLECER EL NUEVO VALOR DE i CUANDO CULMINE LA PISTA. i = ++i < canciones.length ? i : 0; reproducir_cancion(canciones[i]); }, true); }
[ "processPocketAudio(introFile, articleFile, article_id, locale) {\n return new Promise(resolve => {\n polly_tts\n .concatAudio([introFile, articleFile], uuidgen.generate())\n .then(function(audio_file) {\n return polly_tts.uploadFile(audio_file);\n })\n .then(function(au...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates the HTML for one alert item in the dropdown alert menu
function generateAlertHTML(alert, type) { //Construct alert content var content; if (type === "sub alert") content = `<strong>${alert.Name}</strong> ${Resources.IsNowTrending}` else if (type === "user alert") content = `<strong>${alert.Name}</strong> ${Resources.IsNowAvailable}` //Construct alert m...
[ "function makeSkillsAlert(){\n var sk = document.getElementsByName(\"skills\");\n var skills = sk[0];\n skills.onchange = function(){\n var index = skills.selectedIndex;\n var message;\n switch (index){\n case 0:\n message = \"Python is better\";\n break;\n case 1:\n messa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Keeps track of which boxes the user has clicked. If the user has clicked two boxes consecutively, it calls the compareUserGuess() function to check whether the elements in the two boxes match.
function userGuess() { if (makeGuess && guessesMade < 2) { let xPos = floor(mouseX / cellSize); let yPos = floor(mouseY / cellSize); if (mouseIsPressed) { if (mouseX < cellSize * rows && mouseY < cellSize * cols) { grid[xPos][yPos][1] = 1; guessesMade += 1; mouseIsPressed = ...
[ "function checkBoxes() {\n\t\tvar box1 = check[0][0];\n\t\tvar box2 = check[1][0];\n\t\t// This is the main logic. Executes if the boxes are the same.\n\t\tif (check.length == 2) {\n\t\t\t// This is the tricky part which solves the problem when the same box is clicked twice. It is solved by using the ids as identif...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Processes module search box input
function searchInput() { var i, item, searchText = moduleSearch.value.toLowerCase(), listItems = dropDownList.children; for (i = 0; i < listItems.length; i++) { item = listItems[i]; if (!searchText || item.textContent.toLowerCase().indexOf(searchText) > -1) { ite...
[ "function searchFunction () {\n activateSearch($searchInput, 'input');\n activateSearch($submit, 'click');\n}", "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if (query && query.length) {\n if (selected_token) {\n deselect_tok...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Walk the job table and set an indicator for each row whether it is filtered out or not
function refilterJobTable() { var node = document.getElementById("jobs-table-body"); for (var i = 0, n = node.firstElementChild; n != null; ++i, n = n.nextElementSibling) { if (jobFltr(i)) $(n).removeClass("filtered-out"); else $(n).addClass("filtered-out"); } }
[ "function tableFiltering(){\n\t\tlet filterTableRows=sortTableRows.filter(function(item, index, array){\n\t\t\tif (filterTableName){\n\t\t\t\tif(!item.name.includes(filterTableName)) return false;\n\t\t\t}\n\t\t\tif (filterTableChars){\n\t\t\t\tif(!item.chars.includes(filterTableChars)) return false;\n\t\t\t}\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
switch video from local area to widget area on members participlation
function switchVideo(video1, video2 , h , w){ if(!video1) video1=document.getElementById("localVideo"); if(video2==undefined){ if(document.getElementById("remotes").getElementsByTagName("video")[0]!=undefined) video2=document.getElementById("remotes").getElementsByTagName("video")[0]; else ...
[ "function startVideo() {\n mini_peer.setLocalStreamToElement({ video: true, audio: true }, localVideo);\n}", "function onTimeupdate(){\n //if the video has finished\n if ( this.currentTime >= this.duration ){\n //if we are offering e-mail sharing\n if (configHandler.get('showLocalShare')){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates index pattern in the format expected by the kuery bar/kuery autocomplete provider Field objects required fields: name, type, aggregatable, searchable
async getIndexPattern(selectedJobs) { const { indexPattern } = this.state; const influencers = getInfluencers(selectedJobs); indexPattern.fields = influencers.map((influencer) => ({ name: influencer, type: 'string', aggregatable: true, searchable: true })); ...
[ "function createSearchIndex(items){\n const builder = new lunr.Builder();\n let fields = null;\n if (CFG.search_fields){\n fields = CFG.search_fields.slice();\n } else {\n for (const [id, item] of Object.entries(items)) {\n const cur = Object.keys(item);\n if (fields ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
List medias in a corpuUid
list(state, { medias, corpuUid }) { Vue.set(state.lists, corpuUid, medias) }
[ "function getMediaList( err ) {\n if( err ) {\n Y.log( 'error in deleting attachments', 'error', NAME );\n callback( err );\n return;\n }\n\n Y.doccirrus.mongodb.runDb( {\n 'migrate': true,\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create the CLI argument template
function createYargsTemplate(yargs) { return yargs .help() .option('number', { alias: 'n', type: 'number', default: 1, description: 'The number of generated data' }).option('model', { alias: 'm', type: 'string', coerce: it => it ? path.resolve(it) : undefined, describe: 'The file...
[ "function flagGen(args) {\n var flags = '';\n for (var a in args) {\n if (args.hasOwnProperty(a)) {\n if (typeof(pyArgs[a]) == 'string'){\n flags += \" --\" + a + ' ' + pyArgs[a];\n }\n else {\n if (pyArgs[a] == true)\n flags += ' --' + a;\n }\n }\n }\n return fl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
test code addr2pksh('ALjSnMZidJqd18iQaoCgFun6iqWRm2cVtj'); console.log(""); pksh2addr("0x0b193415c6f098b02e81a3b14d0e3b08e9c3f79a"); console.log(""); pk2addr("02bf055764de0320c8221920d856d3d9b93dfc1dcbc759a560fd42553aa025ba5c"); console.log(""); test_4(); console.log(""); test_5(); console.log(""); test_6(); console.lo...
function addr2pksh(addr) { // console.log("Cryptography"); // var addr = "ALjSnMZidJqd18iQaoCgFun6iqWRm2cVtj"; var uint8 = ThinNeo.Helper.GetPublicKeyScriptHash_FromAddress(addr); var hexstr = uint8.reverse().toHexString(); console.log("addr=" + addr); console.log("hex=" + hexstr); return '0...
[ "async function genSegWitAddr() {\n\n\tconst mnemonics = mnemonic.generateMnemonic(); //generates string\n const seed = await bip39.mnemonicToSeed(mnemonics);\n const root = hdkey.fromMasterSeed(seed);\n\n\tconst masterPrivateKey = root.privateKey.toString('hex');\n\tconst masterPublicKey = root.publicKey.to...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete a question remotely and locally. Return a promise for the response.
deleteQuestion(id) { const promise = this._ajaxDeleteQuestion(id); promise.then((response) => { const status = response.status; if (status >= 200 && status < 300) { this._localDeleteQuestion(id); } else { throw Error(`Unexpected DELETE response: ${status}`); } }); ...
[ "static deleteByQuestion(id_question) {\n return db.result(`\n DELETE FROM results WHERE id_question = $1`,\n [id_question]\n );\n }", "delete ({ commit, getters }, { processId, portId, id }) {\n return new Promise( (resolve, reject) => {\n // Try to send dat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if current job is indeed this job.
checkIfCurrentJob() { return (this.jobId === DiffDrawer.currentJobId); }
[ "function checkCurrentJob() {\n if (isCurrentJobApplied()) {\n let params = getURLParams()\n let currentJobId = params.get('currentJobId')\n\n let newAppliedJobs = getAppliedJobs()\n if (!newAppliedJobs.includes(currentJobId)) {\n console.info(`[Helper] Adding new job ${cur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
luckyNumbers is an array of numbers which besides the lucky numbers contains 13, exactly once. find and remove 13 from the array. requirements: use .indexOf(), slice() and .splice(), _DO NOT_ modify the array passed as the parameter
function removeUnlucky(luckyNumbers) { var array = luckyNumbers.slice(); var index = array.indexOf(13); array.splice(index, 1); return array; }
[ "function unlucky13(nums) {\n return nums.filter(num => num % 13);\n}", "function luckySevens(num) {\n\n let newArr = [];\n \n for (let i = 1; i < num; i++){\n if (i % 7 === 0) {\n newArr.push(i)\n }\n }\n return newArr;\n }", "function findUniques(nums) {\n var newNums = []...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deny a sale Parameters : int id, int partner_id, HTMLElement element Return : none
function denySell(id, partner_id, element) { if(jQuery('#confirmation-popup').children().length == 1) { jQuery('#confirmation-popup').remove(); location.reload(true); } else { jQuery(element).parents('.confirmation').remove(); } jQuery.post( swapchic_ajax....
[ "function denySwap(id, partner_post_id, partner_id, element) {\r\r\n if(jQuery('#confirmation-popup').children().length == 1) {\r\r\n jQuery('#confirmation-popup').remove();\r\r\n //location.reload(true);\r\r\n } else {\r\r\n jQuery(element).parents('.confirmation').remove();\r\r\n }\r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
On window resize, update placeholder height to be equal to footer height
function onResize() { updateHeight() // change .footer-height text updateText() }
[ "function extendHeight() {\n\t\n\tdivContainer.style.height = \"\";\n\t\n\tdivFooter = document.getElementById(\"Footer\");\n\t\n\tremoveClassName ( divFooter, \"bottom\");\n\t\n\tvar containerHeight = divContainer.offsetHeight;\n\t\n\tvar browserHeight = window.innerHeight;\n\t\n\tif ( containerHeight < browserHei...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a predicate function for testing sub extensions
function has_sub_extension(e) { //if(process.env.DEBUG_MVC) { // debug.log('has_sub_extension(', e, ')'); //} debug.assert(e).is('string'); return function has_sub_extension_2(p) { var name = PATH.basename(p, PATH.extname(p)); return PATH.extname(name) === e; }; }
[ "function has_extension(e) {\n\t//if(process.env.DEBUG_MVC) {\n\t//\tdebug.log('has_extension(', e, ')');\n\t//}\n\tdebug.assert(e).is('string');\n\treturn function has_extension_2(p) {\n\t\treturn PATH.extname(p) === e;\n\t};\n}", "visitPartition_extension_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Simply piping from an input stream to a Kafka producer stream does not flush the messages before the output stream closes due to the input stream being exhausted.
function pipe() { const messages = getMessages(); const msgStream = new stream.Readable({ objectMode: true }); messages.forEach(m => msgStream.push(new Buffer(m))); msgStream.push(null); let processed = 0; const countStream = new stream.Transform({ objectMode: true, transform: (chunk, encoding,...
[ "pipe(out) { return reduce(((x, y) => x.pipe(y)), this.streams[0], this.streams.slice(1)).pipe(out); }", "function pipeStdIn() {\n\n process.stdin.resume();\n process.stdin.on('data', function ( chunk ) {\n\n var s = chunk.toString('utf8');\n\n // Find the relevant child process by its stdin prefix.\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initiates the AJAX request and handles the response Calculates the resource to request from the movie image name, reviews must be in a file with the same name as the image file: xyz.jpg > xyz.xml
function showReviews() { var xmlSource = $(this).parent().find("img").attr('src').replace("images", "reviews").replace(".jpg", ".xml"); var target = $(this).parent().find(".review")[0]; $(target).empty(); $.ajax({ type: "GET", url: xmlSource, ...
[ "function postShowRequest () \n{\n resetShow();\n\n\n // Parameters\n var paramFile = \"\";\n var imgFile = \"\";\n var outputFile = \"\";\n\n if (document.getElementById('ebba').checked) {\n paramFile = \"/var/www/vhost/ds.lib.ucdavis.edu/htdocs/archv/jetty/ballad_param\";\n }\n if (document.getElementB...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Based on the supplied properties, creates bound logic encapsulating common caching configuration sharable across implementations to more easily provide consistent behavior across behaviors
function bindCachingCore(url, init, props) { var _a, _b; const { store, keyFactory, expireFunc } = { store: "local", keyFactory: (url) => getHashCode(url.toLowerCase()).toString(), expireFunc: () => dateAdd(new Date(), "minute", 5), ...props, }; const s = store === "sessi...
[ "function PropertySupport(args) {\n var propertyTypes = args && args.types && property_support_copy(args.types) || [],\n propertyInformation = {},\n cachedPropertiesObjects = {\n all: undefined,\n byType: {}\n },\n cachingIsEnabled = true,\n notificationsAreBatched = false,\n dispat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Confirm: Delete a specific picture from an entry.
function del_entrypic( entry_id, pic_id ) { forward_func = del_entrypic_confirmed.bind( null, entry_id, pic_id ); $( '#hv_alert_wrapper' ).hv_alert( 'show_alert', { 'message': c['sure_to_delete'] ,'ok_btn': forward_func }); }
[ "function showPictureToDelete()\n{\n\tif (document.forms[1].deletePics.value == \"\")\n\t{\n\t\t$('#showPicture').empty();\n\t}\n\telse\n\t{\n\t\t$('#showPicture').empty();\n\t\tvar picture = document.forms[1].deletePics.value;\n\t\tvar pictureScript = '<p><img src=\"../mainPictures/' + picture + '\"width=\"50\" he...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds the closest injector that might have a certain directive. Each directive corresponds to a bit in an injector's bloom filter. Given the bloom bit to check and a starting injector, this function traverses up injectors until it finds an injector that contains a 1 for that bit in its bloom filter. A 1 indicates that ...
function bloomFindPossibleInjector(startInjector, bloomBit) { // Create a mask that targets the specific bit associated with the directive we're looking for. // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding // to bit positions 0 - 31 in a 32 bit integer. var...
[ "function countOrbits (part, mapStr) {\n\n const map = mapStr.split('\\n');\n\n // COMMON: CREATE CHILDREN HASH MAP OF {CENTER: [...ORBITERS]} AND PARENTS HASH MAP OF {ORBITER: CENTER}\n const children = {};\n const parents = {}; // for part 2\n for (const orbit of map) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sorts an array of numbers from least to greatest. Requires the getSmallestNumber Function.
function sort(arr){ var sorted_array = []; while(arr.length) { smallest_num = getSmallestNumber(arr); sorted_array.push(smallest_num); index = arr.indexOf(smallest_num); arr.splice(index,1); } return sorted_array; }
[ "function sumTwoSmallestNumbers(numbers) { \n let arrayNumFour = [55, 87, 2, 4, 22]\n //set the order of the array, either < , >, or vice versa\n arrayNumFour.sort()\n console.log(arrayNumFour)\n //write a line of code to find the lowest values\n \n // return sum of lowest values \n }", "fu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
LOAD WALL FUNCTION load message wall from user on browse or home view email is the email of the destination user
function loadWall(email) { var token = localStorage.getItem("token"); var to_email; var data; var destination_div; // browse or home // if function is called from home view, email = 0 // this gives to_email = from_email in server if(email === 0) { destination_div = "wall"; to_email = ...
[ "function updateHomeWall() {\n\n\tresult = serverstub.getUserMessagesByToken(localStorage.token);\n\t\n\tdocument.getElementById('messageboard').innerHTML=\"\";\n\t\n\thtml = \"\";\n\t\n\tfor ( i=0; i<result.data.length; i++) {\t\t\n\t\n\t\thtml+= \" <table class='tablemessage' border='1'> <tr> <td> Email: </td> <t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function will display any of the kml polygons, depending on which type of hazard the user chooses.
function displayKml(doc){ var numberOfPolys = doc[0].gpolygons.length; var numberOfPolys1= doc[1].gpolygons.length; var numberOfPolys2= doc[2].gpolygons.length; for(var i = 0; i < numberOfPolys; i++) { doc[0].gpolygons[i].setMap(null); } for(var i = 0; i < numberOfPolys1; i++) { doc[1].gpolygons[i].setMap(null); } for(...
[ "function drawShapes()\r\n{\r\n\tvar viewLayers = map.getLayers();\r\n\t\r\n\tif( viewLayers != undefined )\r\n\t{\r\n\t\tviewLayers = viewLayers.getArray();\r\n\t\r\n\t\tvar viewLayer;\r\n\t\tvar mapLayer;\r\n\t\tvar mapShapes;\r\n\t\tvar layerSource;\r\n\t\tvar mapShape;\r\n\t\t\r\n\t\tfor( var i = 0; i < viewLay...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets genome using a module with the module args
setGenome(modName, args) { this.ready['setGenome'] = true; let initMan = new Init.ModuleManager(); let mod = initMan.getModule(modName); this.genome = mod(args); }
[ "load(genome) {\n this.genes = [];\n this.mutationRates = genome.getMutationRates()\n\n genome.genes.forEach((gene) => {\n this.genes.push(gene.clone());\n });\n this.initializeNeurons();\n this.maxNeuron = genome.maxNeuron;\n }", "function mutate(chromo){\r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
parentHashes() parses `str` as a commit and returns the hashes of its parents.
parentHashes(str) { if (Objects.type(str) === 'commit') { return str.split('\n') .filter(line => line.match(/^parent/)) .map(line => line.split(' ')[1]); } }
[ "treeHash(str) {\n if (Objects.type(str) === 'commit') {\n return str.split(/\\s/)[1];\n }\n }", "ancestors(commitHash) {\n const parents = Objects.parentHashes(Objects.read(commitHash));\n return Util.flatten(parents.concat(parents.map(Objects.ancestors)));\n }", "function git_commit_hash ()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a row to a CSV file based on the current values of sensors
function writeRow(sensors, sensorValues) { // Get a list of the values in the correct order var values = [] sensors.forEach(function (sensor) { values.push(sensorValues[sensor.sensorID]); }); // Make our new CSV format row // NB: date must be in quotes as it contains a comma! var newrow = "\"" + (new Date())....
[ "function writeRow(rowData) {\n \n var dollarFields = ['fy17CN', 'fy17CX', 'fy17F', 'fy17S', 'fy17P']\n\n var total = 0\n dollarFields.map(function(field) {\n if(typeof(rowData[field]) == 'number') total += rowData[field]\n })\n \n\n var rowDataArray = [\n rowData.boro,\n rowData.budgetLine,\n ro...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Toggle the graphs Interpolation settings Done!
function toggleInterpolation(element) { var mainSectionId = $(element).parent().parent().parent().attr("id").substring(12); var isChecked = $(element)[0].checked; for(var i = 0; i < activeGraphs.length; i++) { if(activeGraphs[i].id == mainSectionId) { activeGraphs[i].interpolation = isChecked; break; ...
[ "toggleChart() {\n this.pie.type = (this.pie.type == 'pie') ? 'polarArea' : 'pie';\n }", "function toggle_resolution (i, resolution)\r\n{\r\n\r\n\tif (resolution == -1) {\r\n\r\n\t\t// do not show resolution indicator\r\n\t\t$(\"#dac-low-resolution-plot-\" + (i+1)).hide();\r\n\t\t$(\"#dac-full-resolution-plot...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns 'true' if we don't have a current server
needCurrentServer() { return isEmpty(this.getCurrentServer()); }
[ "isOnServer() {\n return !(typeof window !== 'undefined' && window.document);\n }", "function isLocalhost(){\n return window.location.origin.includes(\"localhost:8088\");\n}", "function checkServer(callback){\n\tps.lookup({command:config.webserverExecCmd},(err,result)=>{\n\t\tconsole.log(result)\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
reply to a data download request, send requested length of meaningless data
function reply_download(req, res, info) { var downloadLength = parseInt(info.downloadLength); if (isNaN(downloadLength) || downloadLength < 1) { info.error = '400 Invalid length for download'; return reply_400(req, res, info); // null return but will invoke res.end() } var datastream = new DataStream...
[ "data(source, sourceSize = 0, timeout = 0) {\r\n const sizeLimit = this.getDataSizeLimit();\r\n if (sourceSize > sizeLimit) {\r\n throw new Error(`Message size exceeds the allowable limit (${sizeLimit} bytes)`);\r\n }\r\n let lines = [];\r\n const handler = (line) => li...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
REQUETES UTILSATEUR : Onglet : Famille de profil TAPEZ ICI LE CODE DE LA REQUETE D'INSERTION
function User_Insert_Famille_de_profil_Famille_de_profil0(Compo_Maitre) { /* ***** INFOS ****** Nbr d'esclaves = 3 Id dans le tab: 42; simple Nbr Jointure: PAS DE JOINTURE; Id dans le tab: 43; simple Nbr Jointure: PAS DE JOINTURE; Id dans le tab: 44; simple Nbr Jointure: PAS DE JOINTURE; ****************** */ v...
[ "function User_Insert_Application_de_profil_Lot_s__5(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 2\n\nId dans le tab: 15;\nsimple\nNbr Jointure: 1;\n Joint n° 0 = article,lo_article,ar_numero\n\nId dans le tab: 16;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\n******************\n*/\n\n var Table...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if browser uses Webkit
get isWebkit() { return navigator.userAgent.toLowerCase().indexOf("webkit") > -1; }
[ "function isGecko() {\n\t\tconst w = window\n\t\t// Based on research in September 2020\n\t\treturn (\n\t\t\tcountTruthy([\n\t\t\t\t'buildID' in navigator,\n\t\t\t\t'MozAppearance' in (document.documentElement?.style ?? {}),\n\t\t\t\t'onmozfullscreenchange' in w,\n\t\t\t\t'mozInnerScreenX' in w,\n\t\t\t\t'CSSMozDoc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
To end the call: Fetch response to route path "/end" with ID as a parameter Redirect to the path the server responds with
function hangUp(){ socket.emit("end", ID, self); fetch("/end", { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ ID: ID }) }).then(response => { response.redirected; window.loc...
[ "end(response, status = 200) {\n let entiry;\n let headers = {};\n if (typeof response === 'string') {\n entiry = response;\n }\n else {\n entiry = response.entiry;\n headers = response.headers;\n status = response.status;\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the width of the side navigation to 0 and the right margin of the page content to 0
function closeSideNav() { document.getElementById("sidenav").style.width = "0"; document.getElementById("page-container").style.marginRight = "0"; }
[ "function clearSidebar() {\n toggleSidebar();\n pageImage.empty();\n pageTitle.empty();\n pageExtract.empty();\n}", "function shutdownSideNavProjMenu() {\n if (document.getElementById(\"mySidenav\").style.width != \"\") {\n \t//document.getElementsByClassName(\"sidenav-icon\")[0].classList.toggle(\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Construct exponent vector for n over the given factor base. We include an extra dimension for the sign.
function exponentVector(n, base) { let vector = [ n < 0 ? Z2.one() : Z2.zero() ]; n = n < 0 ? -n : n; for (let i = 0; i < base.length; i++) { let exponent = 0; while(n%base[i] == 0) { n /= base[i]; exponent++; } vector.push(new Z2(exponent)); } ...
[ "function myPow(base, exp) {\n var num = 1;\n for (var i = 0; i < exp; i++) {\n num *= base;\n }\n return num;\n}", "function ExponentialEase(/** Defines the exponent of the function */exponent){if(exponent===void 0){exponent=2;}var _this=_super.call(this)||this;_this.exponent=exponent;return _...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the resolution of a media item
function getResolution($item) { return Number($item.attr('width') || 0) * Number($item.attr('height') || 0); }
[ "function get_item_size() {\n var sz = 220;\n return sz;\n}", "function f_getQuality() {\n var el = document.getElementById(\"id_resolution\");\n var wh = (el.options[el.selectedIndex].value).split(\"x\");\n l_maxWidth = wh[0];\n l_maxHeight = wh[1];\n}", "get width() {\n this._logService.debug...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Uppercases the current value for the control with the given id
function uppercaseValue(controlId) { jQuery("#" + controlId).css('text-transform', 'uppercase'); jQuery("#" + controlId).change(function () { this.value = this.value.toUpperCase(); }); }
[ "function setTextCase(field, toupper) {\r\n if (toupper) {\r\n field.value = field.value.toUpperCase();\r\n } else {\r\n field.value = field.value.toLowerCase();\r\n }\r\n}", "function allCapsTitleTrimmed(originalText) {\n\tvar text = originalText.trim();\n\ttext = text.toUpperCase();\n\tdo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to hide and show instructions
function Insfunc() { var x = document.getElementById("instructions"); // if the is no style display assign to block i.e put the text there if (x.style.display === "none") { x.style.display = "block"; } // if block or anything else assign to none else { x.style.display = "none" } ...
[ "function showhidehelp() {\n\tif (showhelp == false) {\n\t\tshowhelp = true;\n\t\tdocument.getElementById('helpinfo').style.display = 'block';\n\t} else {\n\t\tshowhelp = false;\n\t\tdocument.getElementById('helpinfo').style.display = 'none';\n\t}\n}", "function showInstrPrograms() {\n\tif(document.getElementById...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }