Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Returns width of widest column label
_getMaxColumnLabelHeight() { let maxColLabelHeight = 0; this._elements.svg.selectAll('.column').select('.label').each(function() { const height = this.getBBox().width; if (height > maxColLabelHeight) maxColLabelHeight = height; }); return maxColLabelHeight; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "lineupGetColumnWidth (name, col, fixed) {\n let width = col.width || 0;\n let colname = col.column || col.type;\n /* Get the column scaling based on the user settings, if available */\n if (this.lineupColumns && this.lineupColumns[name] && this.lineupColumns[name][colname]) {\n width = this.lineup...
[ "0.7133659", "0.69669634", "0.6758254", "0.6752992", "0.67023104", "0.6675387", "0.6675387", "0.6675387", "0.6675387", "0.6675387", "0.6669408", "0.66578215", "0.6650247", "0.6644212", "0.6605588", "0.6571385", "0.6502318", "0.64909506", "0.6481607", "0.6481339", "0.6477443",...
0.6691911
5
Updates the scales after the labels (row/col) were drawn and updates cells/rows to respect width/height of the labels. Resets height of the SVG to match its contents.
_updatePositionsAndSizes() { const self = this; const maxRowLabelWidth = this._getMaxRowLabelWidth() , maxColLabelHeight = this._getMaxColumnLabelHeight(); const bandWidth = this._columnScale.bandwidth() , step =this._columnScale.step(); console.log('ResistencyMatrix / _updatePositionsAndSize...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawScale() {\n //Define scale dimensions\n var margin = 30, scaleHeight = 20;\n var x = margin;\n var y = mapHeight - margin - scaleHeight;\n\n //Add rectangles to display legend colors\n mapsvg.append(\"g\").attr(\"id\", \"scaleg\")\n for (var i = 0; i < 200; i += 2) {\n mapsvg.select(\"#scale...
[ "0.63437647", "0.62385654", "0.6236024", "0.62124074", "0.61430323", "0.61279476", "0.61242527", "0.61225784", "0.6069597", "0.60415065", "0.602591", "0.60178506", "0.6016954", "0.5999235", "0.5939693", "0.59278995", "0.5901365", "0.586861", "0.58673525", "0.583936", "0.58381...
0.6922233
0
Aligns a single cell
_alignCell(cell, dimensions, number, offset = 0, lineWeight = 1) { d3.select(cell) // + number: Space 1 px between cells .attr('transform', `translate(${ offset + number * dimensions + number * lineWeight },0)`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function alignedCell(row,col,alignDirection){\n let cell = \"\";\n switch (alignDirection) {\n case RIGHT:\n cell = alignRight(row * col,COLUMN_WIDTH);\n break;\n case LEFT:\n cell = alignLeft(row * col,COLUMN_WIDTH);\n break;\n case CENTER:\n ...
[ "0.71410656", "0.6412232", "0.63284487", "0.5883169", "0.5812434", "0.5783608", "0.57130873", "0.56944203", "0.5694386", "0.5691457", "0.5612801", "0.556128", "0.5499561", "0.54434353", "0.5440171", "0.5417897", "0.54077184", "0.540246", "0.53686386", "0.53622663", "0.5361405...
0.78180337
0
Resizes a single cell
_resizeCell(cell, dimensions) { d3.select(cell) .attr('height', dimensions) .attr('width', dimensions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update_cell_size(cell, width, height) {\n const update_size = (constraints, offset, size) => {\n if (!constraints.has(offset)) {\n constraints.set(offset, new Map());\n }\n constraints.get(offset).set(cell, size);\n };\n\n update_size(this.cell_w...
[ "0.74230564", "0.68357456", "0.6741469", "0.6593407", "0.65838593", "0.6559066", "0.6501264", "0.6489038", "0.64481163", "0.6428561", "0.6380622", "0.63601506", "0.62774694", "0.62319386", "0.62305665", "0.6210801", "0.62096673", "0.61991245", "0.61974853", "0.61905456", "0.6...
0.793465
0
Draws the column heads, then returns the created elements
_drawColumnHeads() { // Get headers from data (keys of first array item) const headers = this._data[0].antibiotics.map((col) => col.antibiotic); console.log('ResistencyMatrix / _drawColumnHeads: Headers are %o', headers); // <g> and transform const colHeads = this._elements.svg .selectAll('.column'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawColHdrs(){\n\tconsole.log(`draw col headers`);\n\t\n\tvar obj = gridSize();\n\tvar canvas = document.getElementById('col_hdrs');\n\t\n\t\n\t//Adjust the workspace so that both canvases can fit into it\n\tvar body = document.getElementById('body');\n\tvar workSpace = document.getElementById('work_space...
[ "0.666554", "0.6466978", "0.6438052", "0.64149", "0.6188436", "0.61820287", "0.61535347", "0.6135232", "0.6101451", "0.6077826", "0.60687435", "0.6048142", "0.6047348", "0.60291564", "0.6010023", "0.6009928", "0.60095996", "0.5980747", "0.5973097", "0.5967296", "0.58760893", ...
0.7437994
0
Draws a single resistency cell
_drawCell(rowElement, rowData, dimensions) { //console.log( 'ResistencyMatrix / _drawCell: row %o, data %o, dimensions %o', rowElement, rowData, dimensions ); const self = this; // Remove 'name' property on row object const filteredData = rowData.antibiotics; //console.error('drawCell: %o', filteredDat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "drawCell(p, x, y, cellX, cellY, cellW, cellH) {\n\n\n\t\tif (this.selectedCell && this.selectedCell[0] === x && this.selectedCell[1] === y) {\n\t\t\tp.strokeWeight(2)\n\t\t\tp.stroke(\"red\")\n\t\t}\n\t\telse {\n\t\t\tp.strokeWeight(1)\n\t\t\tp.stroke(0, 0, 0, .2)\n\t\t}\n\n\t\tlet val = this.gameOfLifeGrid.get(x...
[ "0.68168575", "0.68144965", "0.67777467", "0.67730504", "0.67377573", "0.6675195", "0.66127074", "0.6587079", "0.65684456", "0.6544897", "0.6524357", "0.6496661", "0.6468077", "0.6445445", "0.6434086", "0.64140344", "0.63875246", "0.63859004", "0.6332892", "0.6308299", "0.626...
0.6484984
12
Returns the first parent of element that matches selector
_getParentElement(element, selector) { let match; while(element.nodeName.toLowerCase() !== 'svg') { if (element.matches(selector)) { match = element; break; } element = element.parentNode; } return match; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "firstParent(selector) {\n let parent = this.parent();\n while (parent.isPresent()) {\n if (parent.matchesSelector(selector)) {\n return parent;\n }\n parent = parent.parent();\n }\n return DomQuery.absent;\n }", "firstParent(selector)...
[ "0.86436546", "0.86436546", "0.7819074", "0.7712058", "0.7712058", "0.7564548", "0.722934", "0.7170839", "0.69951177", "0.69215226", "0.6917007", "0.67962646", "0.6794599", "0.6780395", "0.6775289", "0.6775289", "0.6775289", "0.6775289", "0.6759885", "0.6752342", "0.6715225",...
0.7145078
8
Returns index of current child that matches selector in its parent
_getChildNodeIndex(child, selector) { let index = 0; while(child.previousSibling) { if (child.previousSibling.matches(selector)) index++; child = child.previousSibling; } return index; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getChildIndexOf(child){\n\treturn [].indexOf.call(child.parentNode.children, child);\n}", "function childIndex(child) {\n var elem = parentNode(child);\n var children = elem.childNodes;\n var len = children.length;\n for (var i = 0; i < len; i++) {\n if (children[i] === child) {\n return i;\...
[ "0.68321145", "0.6789425", "0.67821604", "0.66689956", "0.6533243", "0.6433741", "0.64337087", "0.64337087", "0.64337087", "0.64337087", "0.64060473", "0.6399689", "0.63829136", "0.6358232", "0.6358232", "0.6358232", "0.6358232", "0.6358232", "0.6358232", "0.6243986", "0.6211...
0.7967228
0
Handles mouseenter on a cell
_mouseOverHandler(element, data) { // Data not available: Cell has no value. There's no // hover effect for empty cells. if (!data.value) return; // Map svg's DOM element to svg let svg; this._elements.svg.each(function() { svg = this; }); const y = element.getBoundingClientRect().top - svg.g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnMouseEnter (event)\n{\n if (event.target != currSelCell && event.target.getAttribute ('CellState') != 'error')\n {\n event.target.style.backgroundColor = preselectedColour;\n }\n}", "function updateShipsMouseenter(cellName, cellNb, row, rowNb){\n if (isHorizontal===false) {\n ...
[ "0.7494407", "0.71272725", "0.7075719", "0.70050216", "0.69776356", "0.6960956", "0.696089", "0.69593894", "0.69574225", "0.69401044", "0.68549436", "0.68315446", "0.6814929", "0.6737597", "0.67313313", "0.671804", "0.6639438", "0.66240543", "0.6605954", "0.65999895", "0.6597...
0.6696601
16
Here you pay some money to use vending What that can be implemented here: take different money give back fakes pay with credit card count change amount take money fore several goods
function CoinBox({ status, onPayClick }) { return ( <div> <button className="vending__button coin-box" disabled={isDisabled(NAME, status)} onClick={onPayClick} >5c </button> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeAmount(){\n updateCurrentCost();\n updateAmortization();\n updateTotalCookPerSecChain();\n}", "function buy50() {\n const credit = 6000;\n addCredit(credit);\n return credit;\n}", "function gainMoney(amount) {\n money += amount;\n earned += amount;\n totalEarned += amo...
[ "0.69360954", "0.6885486", "0.68392026", "0.6830983", "0.68207335", "0.6809385", "0.6804891", "0.6787875", "0.6732424", "0.6712888", "0.6712166", "0.6677659", "0.66758776", "0.6646417", "0.6642196", "0.6637393", "0.6616363", "0.66115606", "0.660336", "0.66000366", "0.6569006"...
0.0
-1
This function is used to generate a random ID when a new user registers in TinyApp
function generateRandomString() { var text = ""; var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; for(let i = 0; i < 6; i++) { text += possible.charAt(Math.floor(Math.random() * possible.length)); } return text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "generateUserID() {\n\t\treturn (Math.random() * 999).toString();\n\t}", "generateID() {\n return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15)\n }", "generateId () {\n return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substr...
[ "0.8296698", "0.79492617", "0.7919624", "0.788631", "0.7876394", "0.7843528", "0.7814211", "0.7797719", "0.7746637", "0.77261204", "0.7712369", "0.76833564", "0.7679093", "0.767626", "0.76744336", "0.76731014", "0.7636364", "0.7629645", "0.76281744", "0.7625459", "0.75992334"...
0.0
-1
A simple error handler to be used throughout this demo.
function errorHandler(error) { var message = ""; switch (error.code) { case FileError.SECURITY_ERR: message = "Security Error"; break; case FileError.NOT_FOUND_ERR: message = "Not Found Error"; break; case FileError.QUOTA_EXCEEDED_ERR: message = "Quota Exceeded Error"; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ErrorHandler() {}", "error_handler(err) {\n console.log(`Problem encountered. Detail:${err.message}`);\n }", "errorHandler(error) {\n console.log(error);\n }", "function errorHandler(error) { console.log('Error: ' + error.message); }", "function dummy_error_handler(error)\n{\n\talert...
[ "0.8269794", "0.8115455", "0.7588617", "0.75847614", "0.7437762", "0.74267066", "0.7404939", "0.73298496", "0.7314514", "0.73029524", "0.7223383", "0.7219059", "0.7219059", "0.71858066", "0.71746194", "0.71650696", "0.71218765", "0.7106658", "0.7074996", "0.70674306", "0.7022...
0.0
-1
Request a FileSystem and set the filesystem variable.
function initFileSystem() { navigator.webkitPersistentStorage.requestQuota( 1024 * 1024 * 5, function (grantedSize) { // Request a file system with the new size. window.requestFileSystem( window.PERSISTENT, grantedSize, function (fs) { // Set the filesystem variab...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initFileSystem() {\n\tif (applicationDirectory != undefined) {\n\t\tconsole.warn(\"Attempting to initialize file system twice.\");\n\t\treturn;\n\t}\n\t\n\twindow.requestFileSystem(LocalFileSystem.TEMPORARY, 0, openFileSystem, failFS);\n}", "function FileSystem() {\n (0, _classCallCheck3.default)(thi...
[ "0.659076", "0.6532094", "0.6340464", "0.62544984", "0.6075516", "0.6032906", "0.5991605", "0.5944565", "0.56552756", "0.5527582", "0.5483004", "0.54567796", "0.53446275", "0.5343252", "0.5209506", "0.52080524", "0.51529866", "0.51312894", "0.50584924", "0.50506526", "0.50118...
0.64959896
2
Save a file in the FileSystem.
function saveFile(filename, content) { filesystem.root.getFile( filename, { create: true }, function (fileEntry) { fileEntry.createWriter(function (fileWriter) { fileWriter.onwriteend = function (e) { // Update the file browser. listFiles(); // Clean out the fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async save( path ) {}", "function saveFile(fileName, data) {\n\tvar fd = FS.openSync(fileName, \"w\");\n\tFS.writeSync(fd, data);\n\tFS.closeSync(fd);\n} // saveFile", "function saveFile() {\n if(!loadedfs) {\n dialog.showSaveDialog({ filters: [\n { name: 'txt', extensions: ['txt'] }\n ...
[ "0.69061154", "0.68254983", "0.67609835", "0.6582613", "0.6539663", "0.6382869", "0.62579936", "0.62561893", "0.6255787", "0.6195898", "0.6183506", "0.6177889", "0.611544", "0.6055943", "0.6014163", "0.6012608", "0.59315497", "0.59203035", "0.5897302", "0.58688277", "0.585139...
0.65628797
4
Add event listeners on the form.
function setupFormEventListener() { form.addEventListener("submit", function (e) { e.preventDefault(); // Get the form data. var filename = filenameInput.value; var content = contentTextArea.value; // Save the file. saveFile(filename, content); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addEventListeners() {\n $('#add-form .add-btn').click(function() {\n createDiscussionObject();\n clearFields();\n });\n\n $('.close-form').on('click', function() {\n closeFormButton();\n });\n\n $('.show-form-btn').on('click', function() {\n showFormButton();\n ...
[ "0.77746505", "0.7365701", "0.7325699", "0.7325699", "0.7182211", "0.7135237", "0.7099094", "0.7051686", "0.6976056", "0.6957651", "0.6887021", "0.6859266", "0.68557364", "0.685409", "0.6852111", "0.6848066", "0.68314815", "0.6790902", "0.6788707", "0.6785058", "0.67798173", ...
0.65575516
43
This component is no longer used
function Arrow(props) { return <div className={`slide-arrow${props.direction}`} onClick={props.clickFunction}> {props.glyph} </div> }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Component() { }", "function PratoDoDiaComponent() {\n }", "function EmptyComponent() { return null; }", "function EmptyComponent() { return null; }", "function EmptyComponent() { return null; }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n ...
[ "0.6851823", "0.6783415", "0.6243634", "0.6243634", "0.6243634", "0.6224334", "0.6224334", "0.6224334", "0.6224334", "0.6224334", "0.6224334", "0.6224334", "0.6224334", "0.6224334", "0.6224334", "0.6224334", "0.6224334", "0.6224334", "0.6224334", "0.6224334", "0.6224334", "...
0.0
-1
myaudio.play(); This will play the music.
play() { this.audio.play(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function play() {\r\n audio.play();\r\n}", "function play() {\n\t\tthis.audio.play();\n\t}", "function playMusic() {\n if (!audio.play()) {\n audio.play();\n }\n}", "function playAudio() { \naudio.play(); \n}", "function playAudio(song) { \n song.play(); \n }", "function playAudio() {\n\t...
[ "0.87175417", "0.86157036", "0.85587925", "0.850415", "0.8461492", "0.8427727", "0.83146244", "0.83124703", "0.82268214", "0.82104886", "0.81678253", "0.81639844", "0.8156465", "0.8104764", "0.8058387", "0.8056764", "0.80195856", "0.7978817", "0.7978548", "0.79731727", "0.796...
0.8461517
4
myaudio.pause(); This will pause the music.
pause() { this.audio.pause(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pauseAmbientAudio() {\n if (ambientMusicPlaying) {\n ambientMusic.pause();\n ambientMusicPlaying = false;\n }\n\n}", "function pauseBackgroundMusic() {\n backgroundMusic.pause();\n}", "function pause(){\n activeSong.pause();\n}", "pause() {\n this._audio.pause();\n ...
[ "0.85368276", "0.8395725", "0.83805937", "0.81995636", "0.8129957", "0.8073505", "0.8068332", "0.8068219", "0.8064411", "0.8051691", "0.7942278", "0.79160047", "0.7911153", "0.78468335", "0.78420395", "0.7795338", "0.77865976", "0.77788705", "0.775889", "0.7719144", "0.770113...
0.8556914
0
myaudio.currentTime = 0; This will rewind the audio to the beginning.
stop() { this.audio.pause(); this.audio.currentTime = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rewindAudio(){\n var oAudio = document.getElementById('myaudio');\n oAudio.currentTime -= 3.0;\n}", "resetAudio() {\n this.audio.pause();\n this.audio.currentTime = 0;\n this.audio.volume = 1;\n }", "function replay(audio) {\n document.getElementById(audio).currentTime = 0\n document...
[ "0.8892462", "0.78518987", "0.784514", "0.74438125", "0.7366514", "0.7343906", "0.7341658", "0.73122674", "0.7288902", "0.7232757", "0.7203703", "0.72026175", "0.7198793", "0.7198736", "0.7119196", "0.7094147", "0.70910937", "0.69883806", "0.69431394", "0.6942082", "0.6931381...
0.6925852
21
Used for setting an app value from a dynamic property. Called from applicationable.js
applicationProperty() { return this.right ? 'right' : 'left'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setKnownProperty(appId, k, v, cb){\n common.readApp(appId, function(err, cfg){\n if (err) return cb(err);\n\n // the config object returned from readApp is not the expected format for app/update :-(\n var payload = { \"payload\": {\n \"app\": cfg.app.guid,\n \"inst\": appId,\n ...
[ "0.71214217", "0.70783204", "0.6523696", "0.6339186", "0.6069352", "0.59373707", "0.5922548", "0.5891513", "0.58708054", "0.58675754", "0.5789306", "0.574889", "0.5743672", "0.5723847", "0.55957603", "0.559313", "0.5578265", "0.5544426", "0.55386657", "0.5522376", "0.54995584...
0.0
-1
When mobile changes, adjust the active state only when there has been a previous value
isMobile(val, prev) { !val && this.isActive && !this.temporary && this.removeOverlay(); if (prev == null || !this.reactsToResize || !this.reactsToMobile) return; this.isActive = !val; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setMobileActive(active) {\n this.setAppDataItem(\"mobileActive\", active);\n }", "setActive(to) {\n this.setState({ active: Number(to) });\n }", "_activeAppChanged(newValue, oldValue) {\n if (typeof oldValue !== typeof undefined && newValue != null) {\n this.hasActive = true;\n } else {\n ...
[ "0.6689443", "0.63789296", "0.6281334", "0.6212194", "0.61691207", "0.6105482", "0.6024534", "0.60089225", "0.596775", "0.59579974", "0.5856447", "0.5844991", "0.582255", "0.5780115", "0.5775367", "0.57694864", "0.5736664", "0.57328254", "0.5725159", "0.5713339", "0.57069576"...
0.6796983
1
Update the application layout
updateApplication() { if (!this.isActive || this.isMobile || this.temporary || !this.$el) return 0; const width = Number(this.computedWidth); return isNaN(width) ? this.$el.clientWidth : width; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refreshLayout() {\n\tconsole.log(\"Refreshing layout...\");\n\t$thumbsPackery.packery();\n\t$unusedPackery.packery();\n}", "updateLayout() {\n this._updateColumnSizes();\n this._updateCollapseButtonPos();\n }", "updateLayoutAutomatically() {\n if ( this._enabled ) {\n this.upd...
[ "0.6997012", "0.6784727", "0.67333174", "0.66556656", "0.6644881", "0.65973336", "0.6537897", "0.6510787", "0.6487134", "0.6347472", "0.6309086", "0.62926453", "0.61246264", "0.6085277", "0.6067336", "0.6044241", "0.60080993", "0.5994503", "0.599115", "0.5923305", "0.5863424"...
0.0
-1
If previous value was app reset the provided prop
app(x, prev) { prev ? this.removeApplication(true) : this.callUpdate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reset(prop, e) {\n var newState = {};\n newState[prop] = '';\n this.setState(newState);\n }", "reset(valueToo) {\n this.target = this.defaultValue;\n if(valueToo) this.o[this.pn] = this.defaultValue;\n }", "reset() {\r\n return this.config.initial = 'normal'\r\n }", "function reset...
[ "0.68543", "0.6701062", "0.6609193", "0.65755796", "0.6319201", "0.63028204", "0.6266786", "0.6264025", "0.6237367", "0.6174907", "0.6155824", "0.614526", "0.6143018", "0.61151487", "0.6077462", "0.6003102", "0.5976478", "0.593453", "0.5929673", "0.5908254", "0.5892518", "0...
0.0
-1
removeOverlay(false) will not restore the scollbar afterwards
removeOverlay(showScroll = true) { if (this.overlay) { Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["addOnceEventListener"])(this.overlay.$el, 'transitionend', () => { if (!this.overlay || !this.overlay.$el || !this.overlay.$el.parentNode || this.overlay.value) return; this.overla...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeOverlay() {\n if (!getCurrentOpen()) {\n removeClass(overlay, fadeClass);\n overlay.remove();\n resetScrollbar();\n }\n}", "removeOverlay(showScroll = true) {\n if (this.overlay) {\n addOnceEventListener(this.overlay.$el, 'transitionend', () => {\n if (!this.overlay...
[ "0.7437121", "0.72504926", "0.7219527", "0.711511", "0.68257725", "0.65133876", "0.6508157", "0.6451198", "0.63197815", "0.6290818", "0.6246981", "0.61873597", "0.61607283", "0.6144499", "0.6135566", "0.6130497", "0.6119193", "0.609957", "0.6095702", "0.60824925", "0.6078761"...
0.7156466
3
A computed property that returns whether scrolling features are enabled or disabled
canScroll() { return typeof window !== 'undefined'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get scrolledIntoView() {\n return (this.updated & UPDATED_SCROLL) > 0;\n }", "get scrollMode() {\n\t\treturn this.nativeElement ? this.nativeElement.scrollMode : undefined;\n\t}", "_checkScrollingControls() {\n if (this.disablePagination) {\n this._disableScrollAfter = this._disableScroll...
[ "0.69875914", "0.680906", "0.67512876", "0.6731974", "0.66034687", "0.63731956", "0.63731956", "0.63731956", "0.63731956", "0.63731956", "0.6351912", "0.63402414", "0.6326875", "0.6326875", "0.63243437", "0.6310971", "0.6299182", "0.6293177", "0.6286782", "0.62706953", "0.623...
0.65990293
6
The threshold that must be met before thresholdMet function is invoked
computedScrollThreshold() { return this.scrollThreshold ? Number(this.scrollThreshold) : 300; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "thresholdMet() {}", "thresholdMet() {}", "function regulateThreshold(value){ //THRESHOLD\n if(value<=250 && value>=50){\n var thresholdValue= (((value-50)/2)-100); //-1db je 1er Schritt, 0 bis -100db\n compressor.threshold.value=thresholdValue;\n console.log(\"tresholdValue: \"+compr...
[ "0.8170196", "0.8170196", "0.6670459", "0.6633021", "0.6610348", "0.65962", "0.656729", "0.64213485", "0.64105153", "0.63854575", "0.6275879", "0.6244579", "0.6225674", "0.6213898", "0.5980369", "0.5980369", "0.59673786", "0.5880031", "0.5857996", "0.5852274", "0.5841803", ...
0.5456857
70
The method invoked when scrolling in any direction has exceeded the threshold
thresholdMet() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function throttledScrollEvents() {\n\n }", "enable() {\n if (this._scrollSubscription) {\n return;\n }\n const stream = this._scrollDispatcher.scrolled(0);\n if (this._config && this._config.threshold && this._config.threshold > 1) {\n this._initialScrollPosit...
[ "0.6993495", "0.68223494", "0.676864", "0.6663429", "0.66548294", "0.66190934", "0.6609053", "0.65817595", "0.64304835", "0.6420797", "0.64202565", "0.641564", "0.6394712", "0.6376545", "0.63423526", "0.6342077", "0.6337896", "0.63361", "0.6332178", "0.6326625", "0.63168734",...
0.0
-1
Sort by Name this is not efficient I would use lodash library. Referred to online resources due to time constraints
sortByName(e) { // create a copy of customer data let sortedData = [...this.state.customerData]; // using the compare function to sort by name const sorted = sortedData.sort((a, b) => { switch (e) { case 'asc': if (a.name.toLowerCase() < b.name.toLowerCase()) { ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortByName(data) {\n // take isolated copy keep the reference safe\n let sortedByName = data.slice();\n\n return sortedByName.sort(function (a, b) {\n //make case insensitive compare\n if (a.name.toLowerCase() < b.name.toLowerCase()) {\n return -1;\n } else {\n return 1;\n }\n })...
[ "0.7842464", "0.775635", "0.76415604", "0.75168645", "0.7391989", "0.7301331", "0.7207099", "0.71515316", "0.7107964", "0.7103806", "0.7101948", "0.70700955", "0.70190126", "0.70041215", "0.6938614", "0.6935501", "0.68997824", "0.6885172", "0.6873295", "0.6843499", "0.6832341...
0.6994139
14
Form submission I would try and use controlled forms next time with states for each input. I've used this approach due to time constraints. Also I've used built in HTML5 validation instead of something more custom
handleSubmit(e) { e.preventDefault(); // get form data const name = document.getElementById('name'); const surname = document.getElementById('surname'); const email = document.getElementById('email'); const age = document.getElementById('age'); const city = document.getElementById('city');...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkFormInputs() {\n var nameInputField = document.querySelector('#name');\n var emailInputField = document.querySelector('#mail');\n var numberInputField = document.querySelector('#number');\n var cityInputField = document.querySelector('#city');\n var stateSelect = document.querySelector('#state')...
[ "0.66348076", "0.6552295", "0.649339", "0.64464813", "0.6417089", "0.6300804", "0.62998796", "0.6227398", "0.62258667", "0.62065727", "0.61912495", "0.61669236", "0.61633813", "0.6163122", "0.6155932", "0.6128777", "0.60992604", "0.60781693", "0.60755825", "0.6071116", "0.604...
0.0
-1
Displays icon in address bar when script is active
function showPageAction( tabId, changeInfo, tab ) { if(tab.url == "https://banprodssb.sierracollege.edu:8810/PROD/pw_sigsched.p_process"){ chrome.pageAction.show(tabId); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayIcon()\n\t{\n\t\tif( lastUrl != document.location.href )\n\t\t\tchrome.extension.sendMessage(\"displayIcon\");\n\n\t\tlastUrl = document.location.href;\n\n\t\tsetTimeout( displayIcon, 1000 );\n\t}", "function showIcon (color = 'red') {\n browser.pageAction.show(currentTab.id)\n updateIcon(true,...
[ "0.71125376", "0.710071", "0.6738983", "0.6676638", "0.6501862", "0.64379865", "0.6353285", "0.6299926", "0.624322", "0.6241682", "0.62087077", "0.6163345", "0.6100325", "0.6094783", "0.607282", "0.6044928", "0.5998128", "0.5993854", "0.5975064", "0.5972798", "0.5940183", "...
0.0
-1
Adds elements in the diagrams of each design
function drawDiagram(Variables, id){ var result_div=document.getElementById(id) if(result_div==null) result_div=id; removeAllChildren(result_div); var L=Variables.L; var K=Variables.K; var Z=Variables.Z; var T=Variables.T; var Y=Variables.Y; var max_button_size=120; if (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init_architectures_diagrams () {\r\n // console.log('count to '+nbr_total_architectures);\r\n\r\n diagram_array = new Array();\r\n\r\n for (i = 1; i <= nbr_total_architectures; i++) {\r\n \r\n myDiagram = \r\n $$(go.Diagram, 'architecture'+i, // create a ...
[ "0.6478786", "0.62170196", "0.6049803", "0.6045873", "0.59014004", "0.5805262", "0.5763111", "0.57531005", "0.5720896", "0.5678428", "0.56198454", "0.55918556", "0.5591375", "0.55887717", "0.557108", "0.5568578", "0.5555154", "0.5546528", "0.55440634", "0.55146486", "0.551113...
0.51338774
75
vueclasscomponent v7.0.2 (c) 2015present Evan You
function r(t){return t&&"object"===typeof t&&"default"in t?t["default"]:t}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n this.vue = new Vue();\n }", "created () {\n this.classNames = this.getDefaultClassName(this.$options.name)\n }", "function Component() { }", "mounted() {\n }", "function vue_class_component_esm_typeof(e){return vue_class_component_esm_typeof=\"function\"===typeof Symbol&&...
[ "0.6776108", "0.6406286", "0.6265241", "0.622096", "0.61893106", "0.61726564", "0.6172277", "0.609121", "0.605287", "0.6043864", "0.6043864", "0.60290647", "0.5996503", "0.5960493", "0.5949597", "0.5948766", "0.5934029", "0.5934029", "0.592843", "0.5905307", "0.58840823", "...
0.0
-1
! Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at THIS CODE IS PROVIDED ON AN AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITH...
function tt(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getClientVersion() { return '0.14.4'; }", "function version(){ return \"0.13.0\" }", "getHeader() {\n return `/**\n * IN2 Logic Tree File\n *\n * This file has been generated by an IN2 compiler.\n */\\n/*eslint-disable-line*/function run(isDryRun){\\n/* global player, core, engine */\nc...
[ "0.5724486", "0.5636172", "0.52317286", "0.51552874", "0.5121027", "0.49185362", "0.48665679", "0.48513728", "0.48461056", "0.48200512", "0.47940663", "0.47921214", "0.47753912", "0.47753912", "0.47753912", "0.47753912", "0.47753912", "0.47753912", "0.47710216", "0.47682998", ...
0.0
-1
action related utility functions
function actionCreator(type) { return Object.assign((payload) => ({ type, payload }), { type }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "action() {}", "function ACTION() {}", "function Action() { }", "handleActions(action){\n\t\tswitch(action.type){\n\t\t\tcase \"VIEW_ACTION\":\n\t\t\t\tconsole.log(this.data);\n\t\t\t\tbreak;\n\t\t\tcase \"FILTER_SEARCH\":\n\t\t\t\tthis.bugSearch(action.searchParameters);\n\t\t\t\tbreak;\n\t\t\tcase \"UPDATE_...
[ "0.74756056", "0.74497765", "0.67250866", "0.67025197", "0.66504717", "0.6482042", "0.64817774", "0.644706", "0.6400104", "0.6374734", "0.63556874", "0.6345453", "0.6335847", "0.63303244", "0.63177097", "0.6310127", "0.6256965", "0.62474024", "0.62379664", "0.6231127", "0.620...
0.0
-1
Pull rdf/xml file and parse to triples with rdfQuery
function fetchTriples(uri, qry, fn) { // Store that we've fetched this URI1 topinfo['done'].push(uri); // Check if we need to go through echo service if (uri.indexOf('http') == 0 && uri.indexOf('www.shared-canvas.org/') == -1) { furi = 'http://www.shared-canvas.org/services/echo/?uri='+uri; } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processor(input) {\n var parser = new XmlStream(input);\n var prefixes = '@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> . @prefix edm: <http://www.europeana.eu/schemas/edm/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix owl:...
[ "0.56342083", "0.5617928", "0.5608382", "0.5523559", "0.5508234", "0.5423545", "0.5259547", "0.52440506", "0.52440506", "0.52440506", "0.52440506", "0.52440506", "0.51769984", "0.50195706", "0.49787936", "0.49721617", "0.4910903", "0.48086622", "0.48086622", "0.47930193", "0....
0.59727234
0
Take top of RDF list and convert to javascript array Allow callback for per item processing in this loop
function rdf_to_list(qry, uri) { // Approach 2: Get ALL first/rests and then step through by hand // in one function. Means fewer queries, = faster var l = []; var firsts = {}; var rests = {}; qry.where('?what rdf:first ?frst') .where('?what rdf:rest ?rst') .each(function() { firsts[this.what.value...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stitchCollection(head) {\n var aslist = [];\n\n while (head && head.rdf__first) {\n aslist.push(head.rdf__first);\n head = head.rdf__rest;\n }\n return aslist;\n }", "extractLists() {\n let {\n remove = false,\n ...
[ "0.65696", "0.5896969", "0.5767063", "0.57351947", "0.57351947", "0.5685045", "0.5667828", "0.56289935", "0.5621849", "0.54665965", "0.54165417", "0.5364584", "0.5364584", "0.5317492", "0.53130215", "0.5308728", "0.53045213", "0.52771026", "0.5234613", "0.52082515", "0.518566...
0.5741014
3
Straight up found this way to prevent users from using the Enter key... ...so this code forces the Submit to be clicked
function stopRKey(evt) { var evt = (evt) ? evt : ((event) ? event : null); var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if ((evt.keyCode == 13) && (node.type == "text")) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function textinput_enter_submit(e, submit) {\n var keyCode = e.which || e.keyCode;\n if (keyCode == 13) {\n if (submit) {\n var button = document.getElementById(submit);\n if (button)\n button.click();\n }\n if (e.preventDefault) e.preventDefault();\n...
[ "0.8118075", "0.78661925", "0.7834959", "0.7781192", "0.77544403", "0.7695251", "0.7693777", "0.7689616", "0.762279", "0.7613667", "0.7596747", "0.7572208", "0.75611603", "0.75310165", "0.74672914", "0.7463039", "0.7400122", "0.7381715", "0.73689896", "0.7361754", "0.73539495...
0.0
-1
Updates the cookies control radio toggle to represent the current cookie state.
async updateCookiesControls_() { const controlMode = this.getPref('profile.cookie_controls_mode'); const blockThirdParty = this.getPref('profile.block_third_party_cookies'); const contentSetting = await this.browserProxy_.getDefaultValueForContentType( settings.ContentSettingsTypes.COOKI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleSetCookie() {\n if (Cookies.get(cookieName) === \"hide\") {\n sidebarCookie(\"show\");\n } else {\n sidebarCookie(\"hide\");\n }\n}", "function wireframeToggleCookie(){\n\t\t\tif ($.cookie('jn-hud-wireframe-toggle') === \"0\" )\n\t\t\t{\n\t\t\t\t$.cookie('jn-hud-wireframe-toggle', '1');\n...
[ "0.6159463", "0.58464843", "0.5678991", "0.56029046", "0.55855", "0.55343956", "0.54676867", "0.54549515", "0.544444", "0.5437658", "0.5412017", "0.5407733", "0.54013675", "0.5364161", "0.53383875", "0.5334069", "0.5320616", "0.5273476", "0.52593863", "0.52405894", "0.5229391...
0.71717
0
Records changes made to the network prediction setting for logging, the logic of actually changing the setting is taken care of by the net.network_prediction_options pref.
onNetworkPredictionChange_() { this.metricsBrowserProxy_.recordSettingsPageHistogram( settings.PrivacyElementInteractions.NETWORK_PREDICTION); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _logPredictionData() {\n // Record the time spent in the UI, since we only log this data once the UI is closed.\n if (uiStartTime !== null) {\n const uiEndTime = new Date().getTime();\n currLabelLogs.uiTime = uiEndTime - uiStartTime;\n }\n\n // Record ever...
[ "0.5718206", "0.52031267", "0.5102307", "0.5078154", "0.4802637", "0.4801409", "0.47514483", "0.47270426", "0.4631513", "0.4625775", "0.46025136", "0.46018863", "0.45708928", "0.4541393", "0.45182377", "0.4497233", "0.44903386", "0.44771615", "0.44708452", "0.44442627", "0.44...
0.66898876
0
=> should console.log('hello'); CHALLENGE 2
function createFunctionPrinter(input) { return () => console.log(input); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ok(test, desc) { expect(test).toBe(true); }", "function test01(){\n console.log(\"Test 01: Game is Initiallized: \");\n if(game)\n console.log(\"Passed.\");\n else\n console.log(\"failed.\");\n}", "function okTest1() {\n assert(true, \"assert true\")\n}", "function writeTest(action...
[ "0.62765115", "0.60408914", "0.6003247", "0.5999658", "0.59694695", "0.59312046", "0.587552", "0.5868205", "0.57923865", "0.57164186", "0.5713534", "0.57113725", "0.57066214", "0.5688896", "0.56751233", "0.5675103", "0.5634756", "0.56037134", "0.55871713", "0.55807155", "0.55...
0.0
-1
=> should console.log('hello'); CHALLENGE 3
function outer() { let counter = 0; // this variable is outside incrementCounter's scope function incrementCounter() { counter++; console.log("counter", counter); } return incrementCounter; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ok(test, desc) { expect(test).toBe(true); }", "function writeTest(actions){\n actions.forEach(function (action) {\n console.log('expect(actions).to.contain(\"' + action + '\");');\n });\n console.log('expect(actions.length).to.equal(' + actions.length + ');');\n}", "function test01(){\n conso...
[ "0.6167522", "0.6093388", "0.6049323", "0.59472764", "0.59051424", "0.5891961", "0.58241093", "0.5813703", "0.5725765", "0.5681015", "0.56741834", "0.5663746", "0.56599015", "0.56592077", "0.5639963", "0.56320256", "0.56265455", "0.56215376", "0.55853546", "0.55826783", "0.55...
0.0
-1
this variable is outside incrementCounter's scope
function incrementCounter() { counter++; console.log("counter", counter); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function incrementCounter() {\n return counterValue += 1;\n }", "function counter() {\n return counter.count++; // counter++;\n }", "function incrementCounter () {\r\n counter ++;\r\n console.log('counter', counter);\r\n }", "function incrementCounter() {\n setCounter(counter + 1);\n }...
[ "0.78015906", "0.76960903", "0.76805484", "0.7678706", "0.7579859", "0.7579859", "0.7579859", "0.75297695", "0.75172037", "0.7424575", "0.738892", "0.73108596", "0.7292651", "0.72310364", "0.72030395", "0.71899384", "0.7168501", "0.71623814", "0.7157317", "0.7146183", "0.7123...
0.7509725
9
=> should return 9 CHALLENGE 4
function once(func) { let called = false; let value; return (x) => { if (!called) { called = true; value = func(x); return value; } else { return value; } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function challenge3() {\n\n}", "function challenge2() {\n\n}", "function challenge1() {\n\n}", "function challenge1() {\n\n}", "unlocked(){return hasChallenge(\"燃料\",11)}", "unlocked(){return hasChallenge(\"燃料\",11)}", "function findSolutions(challenge) {\n return [];\n}", "function currentChallen...
[ "0.68775946", "0.6860566", "0.677148", "0.677148", "0.656375", "0.656375", "0.645671", "0.6445929", "0.63510686", "0.6205392", "0.6097601", "0.60077107", "0.5986351", "0.59721166", "0.587688", "0.5869875", "0.5792017", "0.5772676", "0.575549", "0.5709592", "0.56988794", "0....
0.0
-1
=> should log 6 CHALLENGE 5
function after(count, func) { return () => { --count; if (count === 0) { return func(); } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function challenge5() {\n // write here with console.log, no need to return\n}", "function challenge(num) {\n for(let i=1; i<=num; i++) {\n if (i % 3 === 0 && i % 5 === 0) {\n console.log(\"Bob Ross\");\n } else if (i % 3 === 0) {\n console.log(\"Bob\");\n } else ...
[ "0.6569504", "0.62907356", "0.6205672", "0.6114172", "0.6114172", "0.60689986", "0.58276397", "0.57651085", "0.57651085", "0.5659859", "0.5608766", "0.5608634", "0.5581377", "0.5572789", "0.5513633", "0.55027115", "0.5497805", "0.5458292", "0.54549164", "0.5453253", "0.544108...
0.0
-1
=> nothing is printed CHALLENGE 6
function delay(func, wait) { return () => { return setTimeout(func, wait); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function challenge3() {\n\n}", "function challenge2() {\n\n}", "function challenge1() {\n\n}", "function challenge1() {\n\n}", "function challenge5() {\n // write here with console.log, no need to return\n}", "unlocked(){return hasChallenge(\"燃料\",11)}", "unlocked(){return hasChallenge(\"燃料\",11)}",...
[ "0.6758492", "0.6740175", "0.6682947", "0.6682947", "0.6611741", "0.6602163", "0.6602163", "0.6302952", "0.62758374", "0.61442554", "0.5881699", "0.5842158", "0.5607271", "0.5577194", "0.5547644", "0.55442345", "0.55336946", "0.5523473", "0.5481832", "0.54706246", "0.54630196...
0.0
-1
=> should log 'Everyone accounted for' CHALLENGE 8 CHALLENGE 8
function saveOutput(func, magicWord) { let data = {}; let magic = magicWord; return (arg) => { if (typeof arg === "string" && arg === magic) { return data; } let value = func(arg); data[arg] = value; return value; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function currentChallenge() {\n if(document.cookie != \"\") {\n CURRENT_CHALLENGE = parseInt(document.cookie.split(\"=\")[1]);\n } else {\n CURRENT_CHALLENGE = 1;\n }\n}", "function challenge1() {\n\n}", "function challenge1() {\n\n}", "function challenge3() {\n\n}", "function challenge2() {\n\n}"...
[ "0.6296543", "0.6220857", "0.6220857", "0.6193613", "0.6165665", "0.5957261", "0.5957261", "0.59320384", "0.584558", "0.57652384", "0.5580308", "0.5568921", "0.556093", "0.55076957", "0.5488657", "0.54300183", "0.5422155", "0.540333", "0.5381098", "0.5356288", "0.5348321", ...
0.0
-1
=> should log 'Fri'
function dateStamp(func) { const data = {}; return (...args) => { const result = func(...args); const date = new Date().getTime(); data["date"] = date; data["output"] = result; return data; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function day() {\n return \"friday\";\n}", "function dayLight(){\n let day = moment().dayOfYear();\n if (day < 71 || day > 309){\n return(chalk.green(\"is not\"));\n // console.log(\"It\" + chalk.green(\"is not\") + \" daylight savings\")\n }\n else{\n return(chalk.green(\"is\"));\n // console...
[ "0.6801786", "0.6102895", "0.6092198", "0.6051082", "0.6045358", "0.58656484", "0.5837675", "0.5813531", "0.57495075", "0.5746147", "0.57411623", "0.57312316", "0.56963766", "0.5646785", "0.56418455", "0.5628867", "0.5585393", "0.55719197", "0.5570329", "0.5556787", "0.554615...
0.0
-1
=> should log 'The slow, brown fox jumps over the lazy cats.'
function createSecretHolder(secret) { let _data = secret; return { getSecret: () => _data, setSecret: (arg) => (_data = arg), }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testLog(...args) {\n const rendered = args.map(arg =>\n typeof arg === 'string' ? arg : JSON.stringify(arg, abbreviateReplacer),\n );\n ephemeral.log.push(rendered.join(''));\n }", "function log(pass, actual, expected, text) {\n\t\ttotal++; pass && passed++;\n\t\tpass ? !silent && console...
[ "0.6092656", "0.6017461", "0.58959407", "0.58765775", "0.5850873", "0.5833166", "0.5793753", "0.5675666", "0.5670299", "0.5666589", "0.564172", "0.56164837", "0.5600036", "0.557253", "0.55694526", "0.5535121", "0.55043745", "0.5502607", "0.54713833", "0.54597956", "0.54590255...
0.0
-1
=> should log 'reload to play again'
function average() { let nums = 0; let count = 0; return (arg) => { if (arg) { count++; nums += arg; return nums / count; } else { return nums ? nums / count : 0; } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function replay() {\n reload = location.reload();\n }", "function playAgain(){\n\t\tlocation.reload()\n\t}", "function playAgain() {\n location.reload()\n}", "function playAgain() {\n location.reload();\n}", "function playAgain()\n {\n \n window.location.reload();\n }", "function playAgai...
[ "0.69618016", "0.68987125", "0.6787443", "0.6781921", "0.671986", "0.66363", "0.6624943", "0.6547154", "0.63601744", "0.63563985", "0.6272603", "0.6240082", "0.619836", "0.61891717", "0.61864996", "0.6170287", "0.6161926", "0.61613846", "0.6149837", "0.61240286", "0.61194307"...
0.0
-1
=========================== Add stripes ===========================
function stripes() { var trs = document.getElementsByTagName("li"), count = 0; for (var i = 0; i < trs.length; i++) { if (!trs[i].classList.contains("hidden") && (count++) % 2 === 0) { trs[i].style.background = "$dark-brand"; } else if (!trs[i].classList.contains("hidden")) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addStripePaymentButton($amount){\n removeStripeScript();\n\n var $amountForStripe = $amount*100,\n $container = $(\"<div>\").attr(\"id\", \"stripeBtnScript\"),\n $stripeScript = $(\"<script>\").addClass(\"stripe-button\");\n\n $stripeScript.attr(\"src\", \"https:...
[ "0.6033025", "0.59756815", "0.5861446", "0.5828576", "0.58128273", "0.5770979", "0.5670366", "0.5430234", "0.5423094", "0.54046476", "0.53790545", "0.5306861", "0.5229228", "0.52042997", "0.51815754", "0.5180358", "0.5163704", "0.5163658", "0.5149931", "0.51490754", "0.513515...
0.5287915
12
Set the beat in Hz, the new fundamental frequency, and the new intervals (integer multiples)
function set(newb, newf, newintervals){ b = newb intervals = newintervals //bottom_freq = new_bottom_freq //smallest_interval = Math.min.apply(null, newintervals); //f = bottom_freq / smallest_interval f = newf console.log("Fundamental", f, "hz") console.log("Beat", b, "hz") for(let i=0; i<oscillators.length...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tempoChange(newTempo) {\n tempo = parseInt(newTempo);\n beatInterval = 60/tempo;\n}", "function updateFFT() {\n if (analyser == null) return;\n updateAudio(); \n analizerdata = analyser.getFrequencyData();\n for (var p = 0; p < fftSize-fftsizeCute; p++) {\n particles[p].position.y = (bgsta...
[ "0.6350169", "0.60217315", "0.597586", "0.5945588", "0.58622384", "0.5825713", "0.5772285", "0.5712895", "0.565731", "0.5615167", "0.55383945", "0.5520029", "0.5516492", "0.55080855", "0.5480947", "0.5479442", "0.546763", "0.5403829", "0.5389046", "0.53523546", "0.53472155", ...
0.79522437
0
displays manager menu options and lets user choose from them
function displayMenu() { inquirer.prompt([ { type: "list", name: "action", message: "Select action", choices: [ "View Products for Sale", "View Low Inventory", "Add to Inventory", "Add New Product...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function managerMenu(){\n\tinquirer.prompt([{\n\t\ttype: \"list\",\n\t\tname: \"mainSelection\",\n\t\tmessage: \"Please make a selection: \",\n\t\tchoices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\"]\n\t}]).then(function(selection){\n\n\t\t// Call a particular fu...
[ "0.77162033", "0.7352701", "0.7285145", "0.7131004", "0.7007999", "0.6982429", "0.69340146", "0.6927816", "0.69031686", "0.68373495", "0.6825244", "0.6813432", "0.67842335", "0.6771903", "0.6742758", "0.66795784", "0.66366374", "0.6610544", "0.65765053", "0.65115374", "0.6507...
0.6039227
57
lists all items and their ids, names, prices, and quantities
function viewProducts() { connection.query("SELECT item_id, product_name, price, stock_quantity FROM products", function (err, res) { //error occurs if (err) { throw err; } console.table("\nInventory", res); returnToMenu(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showAllItems() {\n connection.connect(function(err) {\n if(err) throw err;\n\n connection.query(\"SELECT * FROM products\", function(err, response) {\n if(err) throw err;\n response.map(function(item) {\n console.log(`Item Id: ${item.item_id} | Product...
[ "0.7449081", "0.72048223", "0.7165819", "0.7074803", "0.70013595", "0.699757", "0.6907571", "0.69054073", "0.68739533", "0.68600684", "0.68539363", "0.68534184", "0.68419826", "0.68192387", "0.67848045", "0.67438155", "0.6735934", "0.670566", "0.6704939", "0.66903424", "0.667...
0.640498
55
lists all items with less than 5 in stock
function viewLowInventory() { var query = "SELECT item_id, product_name, price, stock_quantity FROM products WHERE stock_quantity < 5"; connection.query(query, function (err, res) { //error occurs if (err) { throw err; } console.table("\nLow Inventory", res); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function viewLowInventory() {\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\t// console.log(res)\n\t\tif(err) {\n\t\t\tthrow err\n\t\t};\n\t\t\n\t\tvar enoughStocked = true;\n\n\t\tfor (var j = 0; j < res.length; j++) {\n\t\t\tif (res[j].stock_quantity < 5) {\n\t\t\t\tenoughStocked = fal...
[ "0.7169677", "0.7116336", "0.70564306", "0.69977576", "0.6915967", "0.69038886", "0.6870697", "0.6860019", "0.6852231", "0.68486017", "0.6826214", "0.6824166", "0.67092097", "0.6697312", "0.6689071", "0.6672475", "0.6634737", "0.6617293", "0.6600345", "0.65789896", "0.6566025...
0.61881435
47
prompts user to restock an item
function addToInventory() { inquirer.prompt([ { type: "input", name: "id", message: "Input ID of item to restock:", validate: function (input) { if (Number.isInteger(parseFloat(input)) && 1 <= input && input <= numProducts) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function askUser() {\n inquirer.prompt(\n {\n name: \"action\",\n message: \"WHAT WOULD YOU LIKE TO DO?\",\n type: \"list\",\n choices: [\"BROWSE ITEMS\", \"EXIT\"]\n }\n ).then(function (answer) {\n switch (answer.action) {\n case \...
[ "0.72912693", "0.7168098", "0.71311206", "0.6950952", "0.69434357", "0.6899947", "0.687141", "0.6856661", "0.68536067", "0.68354636", "0.6830894", "0.68202966", "0.68193376", "0.68168855", "0.68136525", "0.6802062", "0.67895967", "0.67660177", "0.67312104", "0.67108506", "0.6...
0.63737285
72
purchases additional quantities of a specific item
function restock(id, numExtraItems) { //obtaining current quantity of item var query1 = "SELECT product_name, stock_quantity FROM products WHERE item_id=?"; connection.query(query1, id, function (err, res) { //error occurs if (err) { throw err; } //console.log(re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchase(itemId, neededQuant) {\n connection.query(`SELECT * FROM products WHERE id = ${itemId}`, function (err...
[ "0.73160917", "0.73160917", "0.73160917", "0.73160917", "0.73160917", "0.73160917", "0.67670053", "0.6733802", "0.6560817", "0.6505334", "0.64754045", "0.6395087", "0.63560754", "0.63443935", "0.6318668", "0.63047767", "0.63042593", "0.62840605", "0.62681836", "0.6259344", "0...
0.0
-1
prompts user to add an entirely new product to inventory
function addNewProduct() { inquirer.prompt([ { type: "input", name: "name", message: "Product Name:" }, { type: "input", name: "department", message: "Department:" }, { type: "input", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addNewInventoryPrompt() {\n\tprompt.get(\n\t\t{\n\t\t\tproperties: {\n\t\t\t\tnewProductName: {\n\t\t\t\t\tmessage: '\\nPlease type the name of the product you would like to add to inventory'\n\t\t\t\t},\n\t\t\t\tnewProductDepartmentName: {\n\t\t\t\t\tmessage: '\\nWhat department does this product belong ...
[ "0.8380248", "0.80824184", "0.8043936", "0.8035701", "0.80118096", "0.8009686", "0.7939711", "0.79364073", "0.7918445", "0.789075", "0.78781104", "0.78511506", "0.7848068", "0.7841379", "0.7818861", "0.7786186", "0.77819663", "0.77802485", "0.77566946", "0.7722868", "0.769507...
0.72308457
71
asks user if they wish to return to menu. Otherwise quits app.
function returnToMenu() { inquirer.prompt([ { type: "confirm", name: "return", message: "Return to menu?" } ]).then(function (answers) { if (answers.return) { console.log(""); displayMenu(); } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function returnToMenu() {\n\tinquirer.prompt({\n\t\tname: \"choice\",\n\t\ttype: \"confirm\",\n\t\tmessage: \"Would you like to return to the menu?\"\n\n\t}).then(function(input) {\n\t\tif (input.choice === true) {\n\t\t\tmenu();\n\t\t} else {\n\t\t\tconnection.end();\n\t\t}\n\t})\n}", "function quit() {\n in...
[ "0.786222", "0.7554817", "0.7446592", "0.7194654", "0.71817446", "0.6754014", "0.6721024", "0.658218", "0.65782166", "0.6570881", "0.6554696", "0.6529437", "0.65225756", "0.65118533", "0.64947814", "0.64709973", "0.6447357", "0.6407538", "0.63782674", "0.63712645", "0.6369977...
0.75221425
2
Makes the API call to create a new quiz from the currently signed in user
async function newQuiz () { const data = { name: 'New Empty Quiz' } const options = { method: 'POST', headers: { 'Content-Type': 'application/JSON', Authorization: `Bearer ${localStorage.getItem('token')}` }, body: JSON.stringify(data) } await fetch(`${api}admin/quiz/new`, op...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createQuiz(body) {\n this.setMethod('POST');\n this.setBody(body);\n this.setAuth();\n return this.getApiResult(`${Config.QUIZ_API}/new`);\n }", "function createQuiz() {\n audioTest();\n quizStart();\n nextQuestion();\n}", "startQuiz(id) {\n this.setMethod('POST');\n this.setAuth();\n ...
[ "0.7708351", "0.669749", "0.66790795", "0.6613949", "0.64310825", "0.6293409", "0.62125826", "0.6204565", "0.6130536", "0.61243516", "0.6119366", "0.61173964", "0.6041928", "0.60227704", "0.6022666", "0.59850675", "0.59625924", "0.59580773", "0.59506404", "0.5947287", "0.5921...
0.74430025
1
Makes the API call to get the quizzes from the signed in user
async function getQuizzes () { const options = { method: 'GET', headers: { 'Content-Type': 'application/JSON', Authorization: `Bearer ${localStorage.getItem('token')}` } } let r = await fetch(`${api}admin/quiz`, options) const ret = await r.json() const quizzes = [] // For each quiz...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getQuizzes() {\n const url = `${API_URL}/api/QuizApp/`;\n return axios.get(url).then(response => response.data);\n }", "getAdminQuizzes() {\n this.setMethod('GET');\n this.setAuth();\n delete this.options.body;\n return this.getApiResult(Config.QUIZ_API);\n }", "getQuizzes(...
[ "0.7919698", "0.7898689", "0.7168252", "0.68122536", "0.6810499", "0.67033565", "0.6607745", "0.64493996", "0.6433095", "0.6296146", "0.6257913", "0.62336135", "0.611753", "0.60860556", "0.59761477", "0.5952943", "0.58410174", "0.58088595", "0.5793552", "0.57854843", "0.57604...
0.73124635
2
Functional component containing a list of all quizes belonging to the current user
function Quizzes () { const context = React.useContext(QuizContext) const classes = useStyles() const [quizzes, setQuizzes] = context.quizzes // Stores all quizzes const [quizCount, setQuizCount] = context.quizCount // Stores the number of quizzes const [modalOpen, setModalOpen] = context.modalOpen // Stores ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function fetchUsersQuizes() {\n const loggedUserId = await AsyncStorage.getItem('loggedUserId');\n if (loggedUserId) {\n console.log(\"user is\",loggedUserId);\n const quizesDbRef = firebase.app().database().ref('assignmentquizes/');\n quizesDbRef\n ....
[ "0.6548016", "0.64929163", "0.60035795", "0.56947154", "0.5659705", "0.5430131", "0.5407669", "0.536013", "0.5256528", "0.52322114", "0.5207851", "0.519228", "0.5175768", "0.5162994", "0.5117868", "0.5114145", "0.51099455", "0.50964737", "0.5016878", "0.5002541", "0.5002411",...
0.0
-1
Displays dashboard of a signed in admin user or redirects to login if not signed in
function Dashboard () { const history = useHistory() const context = React.useContext(QuizContext) const [quizCount, setQuizCount] = context.quizCount console.log(history) if (!localStorage.getItem('token')) { history.push('/login') } return ( <> <br/> <Card> <CardContent> ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function directAfterLogin(user) {\n\n isLoggedIn = true;\n if (user.isAdmin == \"true\") {\n window.location.href=\"admin.html\";\n } else {\n document.getElementById(\"user_div\").style.display = \"block\";\n document.getElementById(\"login_form\").style.display = \"none\";\n }\n\n}", "function che...
[ "0.7132738", "0.6903201", "0.6902936", "0.6857511", "0.6786882", "0.6764649", "0.66929203", "0.6684039", "0.66775393", "0.66691965", "0.661147", "0.65848565", "0.6549834", "0.65461737", "0.64850605", "0.64245045", "0.64136237", "0.63603246", "0.6352428", "0.634243", "0.634178...
0.0
-1
Function creates buttons for each category in the array
function renderButtons() { $(".nav").empty(); $(".nav").append('<li class="heading"><h5>Popular Characters</h5></li>'); // Create the buttons for the categories topics.forEach(function(str) { var buttonText = capitalizeStr(str); var newItem = $("<li>"); var newBtn = $("<button>"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addCategoryButtons() {\n const filteredCategoriesNamesOnly = filteredCategoriesArray();\n filteredCategoriesNamesOnly.forEach(drinkObj => {\n const categoryBtnTemplateClone = categoryBtnTemplate.cloneNode(true);\n categoryBtnTemplateClone.querySelector(\"button\").textContent = drinkObj;\n docu...
[ "0.793844", "0.7672816", "0.75236493", "0.75004196", "0.7470848", "0.7438495", "0.74200684", "0.7412777", "0.73584336", "0.73567134", "0.7343548", "0.7325634", "0.73232496", "0.7275017", "0.72717917", "0.7257594", "0.7237706", "0.723064", "0.7219708", "0.72109205", "0.7205192...
0.71934986
21
Function to capitalize the first letter of each category
function capitalizeStr(str) { var strArray = str.split(" "); var newStr = ""; strArray.forEach(function(item) { newStr += item.charAt(0).toUpperCase() + item.slice(1)+ " "; }); return newStr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function titleCases(arg){\n return arg.charAt(0).toUpperCase() + arg.substring(1);\n }", "function capitalizeFirstLetter(item) {\n return item.charAt(0).toUpperCase() + item.slice(1);\n}", "function toTitle(c){\r\n return c.toUpperCase();\r\n}", "function capitalize(a) {\n retu...
[ "0.75213045", "0.75019217", "0.7495579", "0.7340712", "0.7336355", "0.7335776", "0.7331864", "0.7306166", "0.73054427", "0.72895706", "0.72852194", "0.72813314", "0.72708255", "0.7256144", "0.72480583", "0.7231956", "0.72284263", "0.72150105", "0.72067434", "0.71985203", "0.7...
0.0
-1
Have it create an empty array and then push a string into the array as many times as the input number Name the function "finalFunction"
function finalFunction(num) { let arr = []; for (let i = 0; i < num; i++) { // for (intializer; exit-condition; final expression) {} arr.push('string'); } return arr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function finalFunction(num) {\n var finalArray = [];\n for (var i=0; i<num; i++) {\n finalArray.push('string');\n }\n return finalArray;\n}", "function finalFunction(number){\n let myArray = [];\n while (myArray.length < number){\n myArray.push(\"string\");\n }\n return myAr...
[ "0.797574", "0.7881085", "0.73705786", "0.73635346", "0.66192657", "0.6509268", "0.6500813", "0.64895606", "0.64442325", "0.63659424", "0.6344968", "0.626911", "0.6262822", "0.6242394", "0.6207229", "0.6204704", "0.6200961", "0.61980474", "0.61845124", "0.6178272", "0.6157447...
0.7104001
4
Decode the String var decodedString = Base64.decode(encodedString);
function fetchWalletId(){ var url = "https://api.bitcoindollar.io/UserAccess.svc/GetWalletId"; // console.log($scope.userData); var s = String($scope.userData.UserID); var postObj = "" + s; // var postObj = "17"; // console.log(postObj) $http.post(url,postObj).then(success,error); function success(res)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static base64Decode(base64Str) {\n return Buffer.from(base64Str, \"base64\").toString(\"utf8\");\n }", "function base64urldecode(encodedString) {\n encodedString = encodedString.replace(/-/g, '+').replace(/_/g, '/');\n encodedString += ['', '', '==', '='][encodedString.length % 4];\n return new Buff...
[ "0.8458291", "0.8332309", "0.81713367", "0.8141908", "0.8094963", "0.8094456", "0.8077873", "0.80629593", "0.8043988", "0.8012391", "0.80073565", "0.8001362", "0.7972534", "0.7950897", "0.793263", "0.7905777", "0.79018706", "0.78353715", "0.7824439", "0.78154886", "0.78154886...
0.0
-1
Helper functions to check video nodes
function checkNewNode(node) { //If it is a video element if (node.nodeName.match(/video/i)) // Observe changes in the video element return VideoRenderer.handle(node); //Look in childs for (var j = 0; j < node.childNodes.length; j++) checkNewNode(nod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function canPlayNode(node) {\n return true;\n }", "function supports_video() {\n return !!document.createElement('video').canPlayType;\n}", "function checkReady() {\n const intElAll = document.querySelectorAll('.element-interactive[data-canonical-url*=\"looping-video\"]');\n if (intElAll.length ...
[ "0.6303595", "0.611156", "0.60997003", "0.60547185", "0.6053907", "0.6034996", "0.60135067", "0.5964455", "0.59377927", "0.5908403", "0.59017026", "0.58053994", "0.5796121", "0.5778873", "0.577644", "0.57503605", "0.5693687", "0.5689398", "0.567718", "0.56514496", "0.5629271"...
0.71545327
0
Helper method, iterate through the passed array and create new items for the table
renderUserList() { return _.map(this.props.userList, (user, index) => { return <UserListItem key={user.id} userListItem={user} deleteUser={this.props.deleteUser.bind(this)} edditUser={this.props.edditUser.bind(this)} /> }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createItemTable(arr) {\n var output = \"\";\n var tableDataCount = 0;\n output += \"<table>\";\n for (var i = 0; i < arr.length; i++) {\n if (tableDataCount == 0) {\n // create a new row\n output += \"<tr>\";\n }\n output += \"<td style='vertical-alig...
[ "0.69210607", "0.66938394", "0.6662544", "0.66265047", "0.65814024", "0.65156704", "0.6472321", "0.6422555", "0.6382516", "0.63633794", "0.6341914", "0.6316769", "0.62581265", "0.6255496", "0.6249539", "0.6229623", "0.61971056", "0.6183651", "0.61568904", "0.6141324", "0.6125...
0.0
-1
and checks to see if there are duplicates among the arguments passed in
function areThereDuplicates(...args) { let argsObj = {}; for(let i = 0; i < args.length; i++) { argsObj[args[i]] = (argsObj[args[i]] || 0) + 1; if(argsObj[args[i]] > 1) return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkDuplicates2(args) {\n return new Set(args).size !== args.length\n}", "function areThereDuplicates2(){\n return new Set(arguments).size !== arguments.length\n}", "function areThereDuplicates() {\n return new Set(arguments).size !== arguments.length;\n }", "function areThereDuplicates() {...
[ "0.86158836", "0.8504116", "0.83985174", "0.83985174", "0.8266095", "0.8266095", "0.8266095", "0.8266095", "0.8266095", "0.8261995", "0.8227013", "0.8205769", "0.81766325", "0.817369", "0.81509024", "0.8147829", "0.79983795", "0.7998163", "0.7986363", "0.7983062", "0.79784805...
0.8005328
16
overriding `onerror` is much faster that using try/catch
function catchErr (ctx, handler) { return function (e) { if (!e) { return handler(e) } ctx.log.error({ res: ctx.res, err: { type: e.constructor.name, message: e.message, stack: e.stack }, responseTime: ctx.res.responseTime }, 'request errored') return ha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onerror() {}", "onerror() {}", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err...
[ "0.800548", "0.800548", "0.7745937", "0.7697038", "0.7697038", "0.757221", "0.74711025", "0.72819525", "0.70425224", "0.6798172", "0.65991396", "0.6579994", "0.65726286", "0.6566456", "0.6547911", "0.65337086", "0.65337086", "0.65074575", "0.64446294", "0.64446294", "0.639343...
0.0
-1
MigrationPlan is a set of migrations to be run It's dumb, it just runs migrations and updates the migration status table
function MigrationPlan(migrationTracker) { this._migrations = [] this._tracker = migrationTracker }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async up() {\n\n this.check()\n const migrations = this.migrations;\n\n let idx = 0;\n let curStep = await this.getCurentIndex();\n this.logger.info(`latest migration run is @${curStep}`)\n\n for (let el of migrations) {\n let loopStep = ++idx;\n\n this.logger.info(\"\")\n this.log...
[ "0.6004162", "0.58880967", "0.5808194", "0.5646706", "0.5580393", "0.55215", "0.5470205", "0.54441774", "0.5343755", "0.53131247", "0.52651066", "0.5228198", "0.5182196", "0.51233816", "0.51150984", "0.50990254", "0.50878054", "0.5010091", "0.50082", "0.49922436", "0.49818382...
0.73103684
0
3. Crear funcion PROPIA que se llamo en el punto 2
function capturarDatos(){ //4. Capturar los valores del formulario // creo tantas variables como valores del formulario let productoelegido=document.getElementById("productos").value; seleccionarproducto(productoelegido); let cantidad=document.getElementById("cantidad").value; let pildor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion (){}", "function fuctionPanier(){\n\n}", "function heredaDe(prototipoHijo, prototipoPadre) { // Esta es una funcion que recibe funciones\n var fn = function () {} // Creamos una funcion vacia\n fn.proto...
[ "0.65727055", "0.65727055", "0.65727055", "0.65433246", "0.6470861", "0.6358605", "0.63359517", "0.6195341", "0.61641455", "0.61282563", "0.6103353", "0.60667753", "0.60522854", "0.59630394", "0.59515506", "0.59030426", "0.5881181", "0.5855827", "0.5813433", "0.5726761", "0.5...
0.0
-1
the Sprocket League Game Engine Step.
step(isReenact, t, dt, physicsOnly) { super.step(isReenact, t, dt, physicsOnly); // car physics this.world.forEachObject((id, o) => { if (o.class === Car) { o.adjustCarMovement(); } }); // check if a goal has been made if (this.ba...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gameStep (input){\n var command = interpret (input);\n var result = execute (command);\n report (result);\n}", "function startGame() {\n incrementGameStep({ gameId, gameData });\n }", "step() {\n }", "step() { }", "function gameStep(input) {\n var cmd = interpret(input); // parse ...
[ "0.6979086", "0.6952935", "0.69525766", "0.6919505", "0.68634003", "0.6779532", "0.668962", "0.65854144", "0.6512794", "0.6489393", "0.64760226", "0.6452486", "0.6404051", "0.6393753", "0.6381328", "0.63625073", "0.63509846", "0.63321924", "0.6316307", "0.6300091", "0.6298482...
0.0
-1
serverside function to add a new player
makeCar(playerId, team) { console.log(`adding car of player`, playerId); let existingCar = this.world.queryObject({ playerId }); if (existingCar) { // this.log.push(`player[${playerId}] already has car[${existingCar.id}]`); return existingCar; } // creat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addPlayer(player) {\n ws.send(JSON.stringify({\n type: \"addPlayer\",\n player: player\n }));\n\n view.clearPlayer();\n }", "async onPlayerAdded(player) {}", "function addPlayer(player) {\n ws.send(JSON.stringify({\n ...
[ "0.8145635", "0.7988628", "0.7983221", "0.76842475", "0.76382214", "0.74354255", "0.7374376", "0.7369474", "0.7360582", "0.73591876", "0.73432916", "0.7334688", "0.72571594", "0.72464055", "0.7186047", "0.718521", "0.71666425", "0.71653664", "0.7152117", "0.71412456", "0.7124...
0.0
-1
Asynchronously starts decrypting the active wallet.
decryptWallet(password) { return Blockchain.Mining.setPrivateKeyAddressForMiningAddress(password) .then(() => console.info('Done unlocking password protected wallet.')) .catch(err => console.error(`Failed to unlock password protected wallet. ${err}`)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function decrypt() {\n var result = null;\n\n // check the length of the input\n if ((0 < document.getElementById(\"secret\").innerHTML.length) &&\n (0 < document.getElementById(\"password\").value.length)) {\n result = await decrypt_v00(document.getElementById(\"secret\").innerHTML,\n ...
[ "0.5843564", "0.55912817", "0.54519284", "0.53478336", "0.5250786", "0.52058685", "0.51809174", "0.51782733", "0.5115842", "0.5095402", "0.5067511", "0.5053109", "0.49909306", "0.4967288", "0.4967288", "0.4942277", "0.49332002", "0.4930842", "0.49307603", "0.4924737", "0.4918...
0.47831327
35
Read the password from a file and then decrypt the active wallet with it.
decryptWalletFromFile(filename) { console.warn(`Reading password from ${filename}`) const password = FileSystem.readFileSync(filename, 'utf8'); return this.decryptWallet(password.trim().split(' ')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPassword(passwordFile) {\n try {\n var encryptionUtils = new EncryptionUtils();\n var file = new File(passwordFile);\n return encryptionUtils.decrypt(file);\n } catch (e) {\n return \"\";\n }\n}", "function decryptFile() {\n var preview = document.getElementById('encrypt-display');\...
[ "0.63111943", "0.6110044", "0.610306", "0.5736976", "0.5714928", "0.57043874", "0.566566", "0.55796623", "0.5574569", "0.5571926", "0.5560584", "0.54717696", "0.5448359", "0.54481757", "0.54347265", "0.5422443", "0.53460795", "0.53395635", "0.53376096", "0.5320373", "0.531796...
0.80139995
0
while deleting linking the child nodes with parents
_leave_kids_to_gramps(me, child) { if (child == null) { me = null; } else { child.parent = me.parent; Object.assign(me, child); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clearChildren() {\n this.children.forEach(c => {\n c.parent = undefined;\n });\n this.children = [];\n }", "function removeParentRefs(data) {\n\n\tif(data.parent)\n\t\tdata.parent = null;\n\n\tfor(var i in data.children) {\n\t removeParentRefs(data.children[i]);\n\t}\n}", ...
[ "0.70582074", "0.70090336", "0.69545156", "0.6920504", "0.6769448", "0.6769448", "0.66935253", "0.66838986", "0.6650463", "0.6650463", "0.6643935", "0.6557506", "0.6501744", "0.64993286", "0.6473304", "0.6464515", "0.64536744", "0.64468193", "0.64466417", "0.64381975", "0.642...
0.0
-1
getting to the node position through value
_detect_node(value, node) { if (node) { if (node.value < value) { return this._detect_node(value, node.right) } else if (node.value > value) { return this._detect_node(value, node.left) } else if (node.value == value) { return n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get_position(value) {\n let current_node = this.root;\n var position;\n while (1) {\n if (current_node.value > value && current_node.left) {\n current_node = current_node.left;\n } else if (current_node.value < value && current_node.right || current_node.va...
[ "0.68976176", "0.6726712", "0.67148256", "0.66647494", "0.66647494", "0.66647494", "0.66647494", "0.66647494", "0.66005343", "0.6493151", "0.6476481", "0.6240345", "0.6228605", "0.61841345", "0.6065953", "0.60512483", "0.60505605", "0.6017717", "0.5971425", "0.5942012", "0.59...
0.5495931
73
finding the minimum value in subtree
find_min(node) { if (node.left) { return this.find_min(node.left) } else { return node; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "min() {\n let currentNode = this.root;\n // continue traversing left until no more children\n while(currentNode.left) {\n currentNode = currentNode.left;\n }\n return currentNode.value;\n }", "min() {\n let currentNode = this.root;\n // Case for no root\n if(!currentNode) {\n t...
[ "0.8452208", "0.8308837", "0.8238183", "0.79959226", "0.7832088", "0.7674652", "0.7671563", "0.75503165", "0.7492046", "0.7487892", "0.7474915", "0.7459788", "0.74447244", "0.74370015", "0.7428161", "0.7397582", "0.7331222", "0.7312446", "0.7285301", "0.72136545", "0.7207851"...
0.75094163
8
finding the maximum value in subtree
find_max(node) { if (node.right) { return this.find_max(node.right) } else { return node; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findMaxValue() {\n\n let current = this.root;\n\n const findMax = (node) => {\n if (node === null) {\n return;\n }\n\n let actualMax = node.value;\n let leftSideMax = findMax(node.left);\n let rightSideMax = findMax(node.right);\n\n if (leftSideMax > actualMax) {\n ...
[ "0.8413505", "0.8392455", "0.824903", "0.82224935", "0.8150872", "0.8116572", "0.80740327", "0.79457194", "0.79121363", "0.7733112", "0.771277", "0.7643687", "0.7492124", "0.7464804", "0.7442787", "0.7367436", "0.7300957", "0.7295094", "0.7280865", "0.7192096", "0.7171027", ...
0.7386518
15
finding the right node to insert new value
get_position(value) { let current_node = this.root; var position; while (1) { if (current_node.value > value && current_node.left) { current_node = current_node.left; } else if (current_node.value < value && current_node.right || current_node.value == valu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "insertAfter(value, itemToInsert){ \n //find the item after which you want to insert\n //create node\n //keep track of node after it\n //new node tracker will point to that\n if(!this.head){\n return null;\n }\n let currNode = this.head;\n while((c...
[ "0.7015707", "0.67403483", "0.66912764", "0.6664605", "0.6651691", "0.66487646", "0.6592409", "0.6587414", "0.6567756", "0.6541014", "0.65237486", "0.64674896", "0.6458331", "0.6454159", "0.64532787", "0.64501566", "0.6442392", "0.6431509", "0.64238566", "0.64043075", "0.6394...
0.0
-1
event triggered when text boxes of forms, values are changed
handleChange(e) { const name = e.target.name; const value = e.target.value; this.setState({ [name]: value }); this.setState({ [e.target.name]: e.target.value }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "formChanged() {}", "function v(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger(\"change\")}}", "function updateField(event) {\n const val = event.target.value;\n changeAct(val);\n }", "setTextboxValue(value) {\n v...
[ "0.6910382", "0.68065", "0.67553145", "0.670224", "0.66719985", "0.6650628", "0.6650628", "0.65973157", "0.65973157", "0.65576106", "0.6539019", "0.6536468", "0.65327144", "0.65088075", "0.6492919", "0.6492919", "0.6492919", "0.6492919", "0.6492919", "0.6492919", "0.6492919",...
0.0
-1
event triggered when form is submitted
snapshotToArray(snapshot) { var returnArr = []; snapshot.forEach(function(childSnapshot) { var item = childSnapshot.val(); item.key = childSnapshot.key; returnArr.push(item); }); return returnArr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formSubmitted(e) {\n\n var action = e.target.getAttribute('action');\n\n if (action[0] === '#') {\n e.preventDefault();\n trigger('POST', action, e, serialize(e.target));\n }\n }", "onSubmit() {\n console.log(\"submit form\");\n }", "function onFormSubmit(formEvent) {\n\tsaveRe...
[ "0.7871844", "0.745303", "0.7329824", "0.7301951", "0.72183573", "0.71747744", "0.71699166", "0.7166027", "0.71370083", "0.708286", "0.70458996", "0.7045405", "0.69960964", "0.699256", "0.6970827", "0.6965508", "0.69517386", "0.69106853", "0.6907528", "0.68795204", "0.6871645...
0.0
-1
Copies the data into the display data
getDataCopy() { return [].concat(this.data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_data(data) {\n this.displayData = data;\n }", "function setDataDisplay() {\n var display = createElement(\"table\", {\n id: \"data_display\",\n className: \"display\",\n style: {\n width: (gamescreen.right + 14) + \"px\"\n }}),\n elems = [\"scor...
[ "0.6957373", "0.66541976", "0.6385888", "0.62956846", "0.6198068", "0.61642045", "0.6117092", "0.610453", "0.60978407", "0.60631853", "0.604932", "0.59950566", "0.5963853", "0.5962055", "0.59239185", "0.58916944", "0.58889455", "0.5882967", "0.58777404", "0.58236474", "0.5817...
0.0
-1
Applies all the plugins to the display data
applyPlugins() { if (!this.isAttached || !this.data) { return; } let localData = this.getDataCopy(); if (this.hasFilter()) { localData = this.doFilter(localData); } if (this.sortKey && this.sortOrder !== 0) { this.doSort(localData, t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function invokeDataProcessors() {\n plugins.forEach(function(plugin) {\n try {\n plugin.moduleInstance.process();\n }\n catch(e) {\n console.log(\"Error processing analytics data for\", plugin.manifest.name, \":\", e);\n }\n });\n}", "function handlePlugins...
[ "0.59977186", "0.57904595", "0.57904595", "0.57904595", "0.5737144", "0.5722974", "0.5705591", "0.5705591", "0.567647", "0.5644067", "0.56289756", "0.5588402", "0.55722725", "0.55075425", "0.54806", "0.5476694", "0.54635084", "0.5439315", "0.5435824", "0.5430038", "0.5430038"...
0.7373253
0
Sets the map on all markers in the array.
function setAllMap(map) { for (var i = 0; i < markers.length; i++) { markers[i].setMap(map); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setMapOnAll(map) {\n for (var i = 0; i < markersArray.length; i++) {\n markersArray[i].setMap(map);\n }\n}", "function setMapOnAll(map) {\r\n for (var i = 0; i < markers.length; i++) {\r\n markers[i].setMap(map);\r\n }\r\n }", "function setMapOnAll(map){\n ...
[ "0.86419475", "0.8592096", "0.85918146", "0.8581791", "0.8581473", "0.85735416", "0.85723966", "0.857033", "0.857033", "0.85633993", "0.85626596", "0.8554875", "0.8554875", "0.8554875", "0.8554875", "0.85501784", "0.85501784", "0.8547008", "0.85301447", "0.8528565", "0.852266...
0.8481903
62
Removes the markers from the map, but keeps them in the array.
function clearMarkers() { setAllMap(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearMarkers() {\n markers.forEach(function(marker) {\n marker.removeFrom(mymap);\n });\n markers = [];\n}", "function remMarkerSez(){\n for (var x in markerArray){\n\t\t\tmarkerArray[x].setMap(null);\n\t\t }\n}", "function removeMarkers() {\n for (i = 0; i < markers.length; i++) ...
[ "0.83621305", "0.8337797", "0.8328767", "0.8328767", "0.83012456", "0.8278075", "0.8271155", "0.8251427", "0.82458436", "0.82373023", "0.8226915", "0.8213556", "0.81894845", "0.8163733", "0.81610394", "0.8157397", "0.81572795", "0.8154773", "0.8143219", "0.813279", "0.8116382...
0.0
-1
Deletes all markers in the array by removing references to them.
function deleteMarkers() { clearMarkers(); markers = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteMarkers() {\n clearMarkers();\n markers = [];\n // remove bounds values from boundsArray\n boundsArray = [];\n}", "function deleteMarkers() {\n clearMarkers()\n markerArr = []\n}", "function deleteAllMarkers() {\r\n if (_markersArray) {\r\n for (i in _markersArray) {\r\n ...
[ "0.79807633", "0.79240143", "0.7880661", "0.77787656", "0.77312356", "0.7722471", "0.77152866", "0.76681226", "0.76642114", "0.76642114", "0.76642114", "0.766018", "0.7659618", "0.764948", "0.764948", "0.764948", "0.764948", "0.764948", "0.764948", "0.764948", "0.764948", "...
0.7600516
52
setting item contained on localStorage showing bedroomlivingdiningliving2 rooms
function setSrc(url){ if (typeof(Storage) !== "undefined") { window.localStorage.setItem("img_url",url[0]); window.localStorage.setItem("img_url_living",url[1]); window.localStorage.setItem("img_url_dining",url[2]); window.localStorage.setItem("img_url_living_2",url[3]); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveRooms() {\n localStorage.setItem(\"rooms\", JSON.stringify(rooms));\n}", "function updateStorage(roomNumber){\n const stringInventory = JSON.stringify(currentInventory);\n localStorage.setItem('inventory', stringInventory);\n const stringObjects = JSON.stringify(roomObjects);\n localStorage.s...
[ "0.7251758", "0.7085692", "0.7004953", "0.6866672", "0.6827561", "0.6745066", "0.6617352", "0.6615239", "0.66049993", "0.6581635", "0.65692794", "0.6552872", "0.6509722", "0.6495224", "0.64920497", "0.6486748", "0.6451715", "0.6408167", "0.63888067", "0.63837785", "0.63782316...
0.0
-1
check if the text submitted is an email
function validateEmail(id_email) { var email = id_email; var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; if (!filter.test(email.value)) { alert('Please provide a valid email address'); email.focus; return false; }else{ return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isEmail(text) {\n\n var words = text.toLowerCase();\n var urlRegex = /(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))/;\n var match;\n\n if(match = urlRegex.exec(word...
[ "0.7552117", "0.7357496", "0.73103684", "0.7259761", "0.7171278", "0.71460664", "0.7144964", "0.7138159", "0.70864296", "0.7037773", "0.70080036", "0.7002745", "0.6976147", "0.6975268", "0.6972631", "0.6967737", "0.69575244", "0.6945498", "0.69411755", "0.69405806", "0.692961...
0.0
-1
if the email submitted match so the email is send
function sendMessage(id_email){ if(validateEmail(id_email)){ alert("Message sent succesfully"); }else{ alert("Message not sent. Be sure to have typed an email address"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emailSubmit(email) {\n var re = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n return re.test(email);\n}", "function checkEmail() {}", "function testEmail (even...
[ "0.70906854", "0.69757515", "0.67589504", "0.66848135", "0.6636527", "0.662799", "0.661176", "0.65958667", "0.6559729", "0.64887786", "0.6474679", "0.6454656", "0.64505655", "0.64479524", "0.6444053", "0.64346254", "0.64183503", "0.6410686", "0.6366107", "0.63510996", "0.6348...
0.62965363
28
Toggle between adding and removing the "responsive" class to topnav when the user clicks on the icon
function myFunction() { var x = document.getElementById("myTopnav"); if (x.className === "topnav") { x.className += " responsive"; } else { x.className = "topnav"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function smallMenuButton() {\n var x = document.querySelector(\"topnav\");\n if (x.className === \"topnav\") {\n x.className += \" responsive\";\n } else {\n x.className = \"topnav\";\n }\n}", "function responsiveIcon() {\n const nav = document.getElementById(\"myTopnav\");\n if (nav.className === \"...
[ "0.7938682", "0.78949445", "0.78662485", "0.7842895", "0.77476466", "0.7687371", "0.76848096", "0.76649946", "0.76649743", "0.7567779", "0.7449295", "0.7433309", "0.7430032", "0.7410372", "0.74010175", "0.74009365", "0.7396538", "0.73507935", "0.7342783", "0.73410213", "0.733...
0.7299905
38
check if the date submitted is like DD/MM/YY
function validateDate(input){ var reg = /(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d/; if (input.match(reg)) { return true; }else { alert("Please enter dd/mm/yyyy"); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function debtCheckFormatDate(dataCheck){\n var re = /^\\d{1,2}\\/\\d{1,2}\\/\\d{4}$/;\n if(dataCheck == '' || dataCheck == 'dd/mm/yyyy'){\n return true;\n }else{\n if(!dataCheck.match(re)){\n return false;\n }else{\n return true;\n }\n }\n}", "function dateValidator() {\n var dateFor...
[ "0.7808512", "0.73748803", "0.7365624", "0.7360941", "0.73228544", "0.73067117", "0.7231291", "0.7198765", "0.71782005", "0.71695226", "0.7166486", "0.7095033", "0.70703846", "0.69875383", "0.6986713", "0.6961565", "0.6953386", "0.6941761", "0.6904367", "0.690263", "0.6896255...
0.7288761
6
Script to open and close sidebar when on tablets and phones
function w3_open() { document.getElementById("mySidebar").style.display = "block"; document.getElementById("myOverlay").style.display = "block"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleSidebarOnDesktop() {\n $target.toggleClass('sidebar--closed');\n }", "function toggleSidebar() {\n // Note: The remove and add classes are important to make sure this works when you change from small to large\n // screen and vice versa after clicking the sidebar.\n i...
[ "0.75874954", "0.7410937", "0.7153891", "0.7086479", "0.703454", "0.7020155", "0.69968164", "0.6981227", "0.6974884", "0.6891078", "0.6811264", "0.67830664", "0.67686534", "0.6766401", "0.6760455", "0.6756653", "0.674077", "0.67158306", "0.6711486", "0.66992", "0.665983", "...
0.64210427
73
check if the date submitted is like MM/YY
function validDate(dValue) { var result = false; dValue = dValue.split('/'); var pattern = /^\d{2}$/; if (dValue[0] < 1 || dValue[0] > 12) result = true; if (!pattern.test(dValue[0]) || !pattern.test(dValue[1])) result = true; if (dValue[2]) result = true; if (res...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function debtCheckFormatDate(dataCheck){\n var re = /^\\d{1,2}\\/\\d{1,2}\\/\\d{4}$/;\n if(dataCheck == '' || dataCheck == 'dd/mm/yyyy'){\n return true;\n }else{\n if(!dataCheck.match(re)){\n return false;\n }else{\n return true;\n }\n }\n}", "function dateValidator() {\n var dateFor...
[ "0.74229574", "0.7137953", "0.70098156", "0.69773424", "0.6972822", "0.69160354", "0.68937624", "0.6892102", "0.6857402", "0.6844244", "0.68204314", "0.6787566", "0.67832434", "0.67825943", "0.6782566", "0.674392", "0.6736408", "0.6710942", "0.6678465", "0.6664626", "0.664133...
0.72131824
1
========================================================== SECCION DE FUNCIONES DE ANIMACION ========================================================== Animacion para la intro (Uso anime.js)
function animateIntro() { // Declarando las constantes para seleccion en el dom los elementos (La forma especifica de declarar es por la libreria, se declara con selectores de CSS) // Primera fila const boxTop = '.box-top .box'; // Segunda fila const boxMiddle = '.box-middle .box'; // Tercera fila const ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Animation (){\n var animation = anime.timeline();\n \n animation.add({\n targets:'.animat',\n height:['100%',0],\n easing:'easeInOutCirc',\n delay:1200\n });\n \n \n }", "function...
[ "0.70998544", "0.69488853", "0.69468445", "0.69325805", "0.6590666", "0.6578038", "0.6572518", "0.6558608", "0.6530214", "0.64710826", "0.6429337", "0.6421359", "0.63884246", "0.6348634", "0.6347796", "0.63332754", "0.6330182", "0.63183546", "0.6301032", "0.6297684", "0.62749...
0.77078736
0
Funcion para animar contenedores
function animateContenedor(target){ anime({ targets: target, opacity: 1, easing: 'easeInOutQuad', delay: 80, autoplay: true }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function animcompleted() {\n\t\t\t\t\t\t}", "function animate(){\r\n\t\t\t\r\n\t\t\tif (t == dur){\r\n\t\t\t\tif(cb) cb();\r\n\t\t\t\treturn;\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tel.style.opacity = Tween.easeInOutQuad(t,start,change,dur);\r\n\t\t\tt++;\r\n\t\t\t\r\n\t\t\tt = t % (dur*2);\r\n\t\t\t\r\n\t\t\tsetTimeout(...
[ "0.71263903", "0.68448406", "0.6809072", "0.67478174", "0.66782093", "0.6639746", "0.66317785", "0.65701455", "0.65490323", "0.6524214", "0.65162474", "0.6456947", "0.6447481", "0.64423317", "0.64348865", "0.6430085", "0.64164066", "0.63645107", "0.6362919", "0.63608533", "0....
0.67110914
4
Funcion para esconder una seccion y mostrar otra
function hideAndShow(item1, item2) { let show = document.querySelector(item1); var hide = document.querySelector(item2); hide.style.display = 'none'; show.style.display = 'flex'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mostrar() {}", "function mostrar() {}", "esconder(){\n console.log(`${this._nombre} corre a ${this._velocidad}m/s y da un salto de ${this._salto}m y se esconde`)\n }", "function mostrarEstDocente(){ // Cuando toque el boton \"estadisticas\" voy a ver la seccion (ver estadisticas)\r\n li...
[ "0.7230455", "0.7230455", "0.65533304", "0.65401673", "0.6511708", "0.6495792", "0.64038795", "0.631367", "0.629677", "0.624484", "0.62364995", "0.6211164", "0.6183584", "0.61555237", "0.614624", "0.61394596", "0.61347264", "0.61261016", "0.6080249", "0.6061646", "0.6039933",...
0.0
-1
Funcion que actualiza la variable con el numero de movimiento restantess
function actualizarCantidadMovimientos() { limiteMovimientos -= 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ponerNumero(numero){\r\n if(num2 == 0 && num2 !== '0.')\r\n num2 = numero;\r\n else\r\n num2+= numero;\r\n actualizarValor2();\r\n}", "function mover_cero(t, ya_realizados, mov_ant, direccion = null) { //mov_ant = Movimientos ya realizados en ese nivel de profunddida + movimiento ...
[ "0.65151227", "0.6488584", "0.6348752", "0.6249557", "0.61472106", "0.60859483", "0.6084112", "0.60720485", "0.5936831", "0.58644027", "0.5839499", "0.58365756", "0.58365196", "0.5830214", "0.5810794", "0.5803431", "0.5792549", "0.57925045", "0.5772676", "0.57643306", "0.5746...
0.67633003
0
Funcion que muestra el numero de movimientos en pantalla tanto los ya hechos como los restantes
function mostrarMovimientosEnPantalla() { let cartel = document.getElementById('movimientos'); let limite = document.getElementById('movimientos-restantes'); cartel.innerText = movimientos.length; limite.innerText = `Movimientos restantes: ${limiteMovimientos}`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mover_cero(t, ya_realizados, mov_ant, direccion = null) { //mov_ant = Movimientos ya realizados en ese nivel de profunddida + movimiento del que vengo\n\n var index = t.indexOf(\"0\");\n var mov_restantes = calcular_mov_restantes(index, ya_realizados, mov_ant);\n\n if (direccion === null) {\n ...
[ "0.72510266", "0.62059075", "0.6205187", "0.6150853", "0.60675704", "0.60032374", "0.5977062", "0.5886002", "0.5853334", "0.5827256", "0.5817829", "0.5801997", "0.57695657", "0.5749181", "0.57081467", "0.5699978", "0.5699888", "0.5692267", "0.56858486", "0.5682944", "0.568192...
0.60191864
5