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
Initialise the color editor used to change the main color
function initColorEditor() { const keyword = "coloroverride" const keyhistory = [] document.addEventListener("keyup", evt => { keyhistory.push(evt.key.toLowerCase()) // See if the user entered the secret keyword let valid = true for(let i = keyword.length; i > 0; i--) { if(keyhistory[keyhistory.length - i] !== keyword[keyword.length - i]) { valid = false } } if(valid) { alert("Color override editor is now shown in the top right") document.querySelector(".color-editor").classList.remove("hidden") } }); // Get the color picker const wrapper = document.querySelector(".color-editor") // Method to convert hex string (from input's value) to rgb array function hexToRgb(hex) { const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); return result ? [ parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16) ] : null; } wrapper.querySelector("input").addEventListener("input", evt => { const rgb = hexToRgb(evt.currentTarget.value) wrapper.querySelector("p").innerText = rgb.join(', ') if(rgb) setBackgroundColor(rgb) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initialize () {\n // Dynamically set default color value and preview.\n var palette = Array.prototype.slice.apply(document.querySelectorAll('.custom-color'));\n\n palette.forEach(function(customOption) {\n var color = colors[$(customOption).data('target')],\n defaultColor = $(customOp...
[ "0.7226462", "0.6910648", "0.6772753", "0.6743187", "0.6701363", "0.66706365", "0.6508841", "0.6464322", "0.6459971", "0.6444418", "0.64343137", "0.63924754", "0.6390817", "0.638868", "0.6370697", "0.6367619", "0.6322547", "0.62874156", "0.6269315", "0.6259995", "0.6228138", ...
0.7463424
0
Method to convert hex string (from input's value) to rgb array
function hexToRgb(hex) { const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); return result ? [ parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16) ] : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@autobind\n hexToRgb(hex) {\n console.log(\"hexToRgb\");\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n hex = hex.replace(shorthandRegex, function(m, r, g, b) {\n return r + r + g + g + b + b;\n });\n\n...
[ "0.7845003", "0.77312917", "0.77218074", "0.76931614", "0.7691661", "0.76538444", "0.7651057", "0.7648551", "0.7617549", "0.76046914", "0.75895077", "0.75861865", "0.75617576", "0.7559461", "0.75558597", "0.7543058", "0.75375456", "0.7536097", "0.7536097", "0.7536097", "0.753...
0.72718436
44
Compile Sass to CSS, Embed Source Map in Development
async compile(config) { return new Promise((resolve, reject) => { if (!isProd) { config.sourceMap = true config.sourceMapEmbed = true config.outputStyle = 'expanded' } return sass.render(config, (err, result) => { if (err) { return reject(err) } resolve(result.css.toString()) }) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cssDev(){\n\treturn src('./src/sass/main.sass')\n\t\t.pipe(sourcemaps.init({largeFile: true}))\n\t\t.pipe(sass().on('error', sass.logError))\n\t\t.pipe(autoprefixer({\n\t\t\tbrowsers: [\n\t\t\t\t'Android 2.3',\n\t\t\t\t'Android >= 4',\n\t\t\t\t'Chrome >= 20',\n\t\t\t\t'Firefox >= 24', // Firefox 24 is the...
[ "0.77264106", "0.7585183", "0.75212884", "0.7462039", "0.7377429", "0.7357436", "0.733218", "0.7308293", "0.7302244", "0.7297472", "0.72970974", "0.72890645", "0.7282065", "0.72634524", "0.7263284", "0.72411805", "0.72392064", "0.7228728", "0.7218675", "0.72063565", "0.720150...
0.71601975
24
Minify & Optimize with CleanCSS in Production
async minify(css) { return new Promise((resolve, reject) => { if (!isProd) { resolve(css) } const minified = new CleanCSS().minify(css) if (!minified.styles) { return reject(minified.error) } resolve(minified.styles) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function minify(){\n let minify = gulp.src(config.dev + \"/css/*.css\");\n if( process.env.NODE_ENV == \"production\" ){\n minify = gulp.src(config.dev + \"/css/*.css\")\n .pipe(cleanCSS())\n .pipe(gulp.dest(config.dev + \"/css\"))\n }\n\n return minify;\n}", "function prodcss() {\n return src(...
[ "0.7908697", "0.74718785", "0.74689233", "0.7414659", "0.74015915", "0.7376908", "0.73444664", "0.723997", "0.7231879", "0.7213696", "0.7136727", "0.7123864", "0.7103397", "0.7025357", "0.70233846", "0.7003923", "0.69819486", "0.6957991", "0.6934078", "0.691753", "0.6905753",...
0.7469411
2
render the CSS file
async render({ entryPath }) { try { const css = await this.compile({ file: entryPath }) const result = await this.minify(css) return result; } catch (err) { // if things go wrong if (isProd) { // throw and abort in production throw new Error(err) } else { console.error(err) } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function styles(request, response) {\n var rootFolder = path.dirname(require.main.filename);\n var fileName = path.join(rootFolder, \"www/styles/styles.css\");\n fs.readFile(fileName, function (err, data) {\n if (err) {\n response.writeHead(404, {\n \"Content-Type\": \"tex...
[ "0.71482533", "0.70699674", "0.70213526", "0.7010176", "0.6785818", "0.66566014", "0.6359353", "0.62424195", "0.6239406", "0.6219371", "0.62172544", "0.6203648", "0.6195959", "0.61401886", "0.61144817", "0.6096984", "0.6062708", "0.60361624", "0.6034927", "0.6033276", "0.6029...
0.617109
13
Snap Elements: this._rect, this._nrTxt, this._btns.topright, this._btns.top, this._btns.bottomright, this._btns.bottom Foreign Elements: this._txt, this._check, (only as blocktype.definition: this._name, this._alt )
draw(editable, group){ this._editable = editable; this._g = group; this._height = 0; let cornerRadius = this._roundedCornerRadius; // draw rect this._rect = this._s.rect( 0, 0, this._width, this._height, cornerRadius ); group.add(this._rect); // draw nr if(editable) { this._nrTxt = this._s.text(20, 20, this._nr); group.add(this._nrTxt); } if(this._type == blocktype.definition) this._height = this.drawDefElements(group, editable); // draw text let cleantext = (!editable) ? this.textWithoutBrInMath() : this._text; this._txt = this.createForeignText(cleantext, editable); this._height += parseInt(this._txt.getAttribute("height"))+45; group.node.appendChild(this._txt); // foreignObject // draw checkbox for conclusion if(editable && this._type != blocktype.premise && this._type != blocktype.definition) { this._check = this.createConclCheckbox(); group.node.appendChild(this._check); // foreignObject } // adjust rect height this._rect.attr({ fill: "#4e5d6c", stroke: "#000", height : this._height, }); if(this._type == blocktype.proof) this._rect.addClass("rect-proof"); // manage style e.g. stroke-width, hover // draw buttons if(editable && this._type != blocktype.definition) { if(this._type != blocktype.premise) { // premise has no top or topright button this._btns.topright = this.createAddButton(buttonpos.topright); this._btns.top = this.createAddButton(buttonpos.top); group.add(this._btns.topright, this._btns.top); } this._btns.bottomright = this.createAddButton(buttonpos.bottomright); this._btns.bottom = this.createAddButton(buttonpos.bottom); group.add(this._btns.bottomright, this._btns.bottom); } // trigger positioning of blocks objects this.x = 0; this.y = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateBlocks() {\n \n //Hide all \"ofBookmark\" blocks first\n let shapesInCanvas = canvas.getObjects();\n for (let i = 0; i < shapesInCanvas.length; i++) {\n if (shapesInCanvas[i].type == \"ofBookmark\") {\n shapesInCanvas[i].visible = false;\n }\n }\n \n //S...
[ "0.5565884", "0.5502996", "0.54520917", "0.53433204", "0.5341646", "0.533016", "0.5264438", "0.5259604", "0.52548414", "0.5243613", "0.5235779", "0.52287257", "0.52131337", "0.52106184", "0.5202586", "0.520198", "0.51878464", "0.5176747", "0.51706", "0.51617706", "0.5155396",...
0.5959678
0
creates editable text element and adds it in foreign container to SVG
createForeignText(text, editable){ var myforeign = document.createElementNS('http://www.w3.org/2000/svg', 'foreignObject') myforeign.setAttribute("width", "350"); myforeign.classList.add("foreign"); //to make div fit text var textdiv = document.createElement("div"); textdiv.classList.add("divinforeign"); //to make div fit text var textpar = document.createElement("p"); textpar.innerHTML = text; textpar.className = "text-white"; if(editable) textpar.setAttribute("contentEditable", "true"); textpar.addEventListener("input", (ev) => this.onTextChange(ev.target, ev.data)); // ev.target is textpar textpar.addEventListener("tribute-replaced", (ev) => this.onTextChange(ev.target)); myforeign.textpar = textpar; // append everything textdiv.appendChild(textpar); myforeign.appendChild(textdiv); document.getElementById("drawsvg").appendChild(myforeign); myforeign.setAttribute("height", textpar.offsetHeight); return myforeign; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function text(){\n var att=['x', 'y', 'text'];\n var object = shape('text', att);\n\n // Override the function copy_shape mantaining the most part of\n // his code\n object.parent_copy_shape = object.copy_shape;\n object.copy_shape = function(target){\n this.parent_copy_shape(target);\n ...
[ "0.6952405", "0.66341835", "0.66031826", "0.6577088", "0.6465521", "0.64469", "0.64155585", "0.6400974", "0.6380137", "0.6374758", "0.63710266", "0.6344246", "0.6307608", "0.6289739", "0.6289739", "0.6266213", "0.62391365", "0.6223653", "0.6220332", "0.61983484", "0.617812", ...
0.81736207
0
fn(hdif) Parameters: block (obj) block who is rescaled hdif (number) height change in pixel
onRescale(fn) { this.onRescaleFn = fn }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SizeDependHeight() {\n hImageCur = va.hRuby;\n wImageCur = M.R(hImageCur * rateImage);\n }", "function height(param) {\n if (param) {\n return param.h;\n } else {\n return 0;\n }\n }", "function adjustVizHeight(){\n viz.style(\"height\", fu...
[ "0.6170123", "0.61641544", "0.6026879", "0.5851804", "0.58301896", "0.58087075", "0.5797593", "0.5789551", "0.57616484", "0.5736356", "0.570691", "0.57056236", "0.5701173", "0.56964505", "0.5692151", "0.56545985", "0.5648779", "0.5630481", "0.56152964", "0.5597911", "0.559635...
0.0
-1
fn(relativePos) Parameters: block (obj) block whose button was clicked relativePos (buttonpos) position of button (14)
onAddButtonClick(fn) { this.onAddButtonClickFn = fn }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cb_beforeClick(cb, pos) { }", "mouseClick(button) {\r\n //check if mouse pointer is locked\r\n if (BOX.Engine.noa.container.hasPointerLock) {\r\n if (this.parent && this.parent.isDeveloper) {\r\n let devComponent = this.parent.components['DeveloperMode']; //need to fix this !!!\r\n ...
[ "0.70069075", "0.6390816", "0.6178574", "0.61248124", "0.6052308", "0.59823453", "0.58458877", "0.576432", "0.57399786", "0.57159585", "0.570172", "0.5666817", "0.56515926", "0.56508595", "0.5580216", "0.55685747", "0.55512786", "0.55323565", "0.5532082", "0.5505736", "0.5497...
0.0
-1
fn(p) Parameters: p (obj) paragraph element in which text is written
onSpecialLetter(letter, fn) { this._specialLetters.push(letter); this._specialLetterFns.push(fn); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function paraWithText(t) {\n let tn = document.createTextNode(t);\n let ptag = document.createElement(\"p\");\n ptag.appendChild(tn);\n return ptag;\n}", "function para(args) {\n var p;\n \n p = node(\"p\");\n p.className = args.className||\"\";\n p.innerHTML = args.text||\"\";\n\n ...
[ "0.68790555", "0.66615236", "0.65699625", "0.65561515", "0.65346223", "0.63981396", "0.6343784", "0.6320454", "0.631141", "0.63092947", "0.6303548", "0.62509185", "0.6245516", "0.6163874", "0.61385554", "0.6136865", "0.61234", "0.61076856", "0.60620725", "0.60594153", "0.6014...
0.0
-1
could make another helper function that will do the math and returns the values
function addTwoNumbershelper(ll1,ll2) { if (!ll1.next && !ll2.next) { let carryOver = Math.floor((ll1.val + ll2.val)/10); ll2.val = (ll1.val + ll2.val) % 10; return carryOver; } let returnVal = addTwoNumbershelper(ll1.next,ll2.next) let carryOver = Math.floor((ll1.val + ll2.val + returnVal)/10); ll2.val = (ll1.val + ll2.val) % 10; return carryOver; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculation(value1, value2) {\r\n let totalSum = value1 + value2 + value1*value2;\r\n let totalSum2 = value1 / value2;\r\n return [totalSum, totalSum2];\r\n}//return multiple values, using array", "function getValue(v1, v2, v3, h, l, e) {\r\n\r\n\tvar vsum = v1+v2+v3;\r\n\r\n\tvar sum = h+l+e;\...
[ "0.69347334", "0.6865171", "0.67737347", "0.6578917", "0.64733905", "0.6374314", "0.6285968", "0.6276899", "0.627248", "0.62392217", "0.6205157", "0.6161034", "0.6138364", "0.6108401", "0.60773736", "0.60757315", "0.6068575", "0.60634595", "0.6063118", "0.6054659", "0.6038279...
0.0
-1
Test if a URL is valid
function isValidUrl(url) { // Try and create a URL object // If it TypeErrors we know it's invalid try { new URL(url); return true; } catch (e) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static valid_url(value) {\n if (!value) return false;\n\n // check for illegal characters\n if (/[^a-z0-9:/?#[\\]@!$&'()*+,;=.\\-_~%]/i.test(value)) return false;\n\n // check for hex escapes that aren't complete\n if (/%[^0-9a-f]/i.test(value)) return false;\n if (/%[0-9a-f](:?[^0-9a-f]|$)/i.tes...
[ "0.8212457", "0.81672513", "0.81602883", "0.8061537", "0.7998464", "0.79887223", "0.79749054", "0.79209757", "0.78805083", "0.7863487", "0.78495777", "0.7833165", "0.7812309", "0.78092265", "0.779994", "0.77716887", "0.77540344", "0.7736699", "0.77102196", "0.7686806", "0.768...
0.82583463
0
helper functions for connectedCallback
initPhysProps(attr) { if (this.hasAttribute(attr) && this.getAttribute(attr) == 'true') { this[attr] = 'true'; this.button.classList.add(attr); } else { this[attr] = 'false'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "connectedCallback(){}", "connectedCallback()\n\t{\n\n\t}", "connectedCallback () {\n\n }", "connectedCallback() {\n //\n }", "connectedCallback() {\n \n }", "connectedCallback() {\n }", "connectedCallback(){\r\n }", "connectedCallback(){\r\n }", "connecte...
[ "0.84261596", "0.8314686", "0.81911165", "0.8189821", "0.8189266", "0.81177", "0.8093153", "0.8093153", "0.80819744", "0.80819744", "0.80140436", "0.7949497", "0.7862404", "0.7635698", "0.75514764", "0.75514764", "0.75514764", "0.75514764", "0.75514764", "0.75514764", "0.7551...
0.0
-1
Helper function for attributeChangedCallback
classNameSwitch(attr, value) { if (value == "false") { this.button.classList.remove(attr); } else { this.button.classList.add(attr); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "attributeChangedCallback() { }", "attributeChangedCallback(name, old, value) {}", "attributeChangedCallback(name, old, value) {}", "attributeChangedCallback(/*attr, oldValue, newValue, namespace*/) {\n\t}", "attributeChangedCallback(attrName, oldVal, newVal) {\n }", "attributeChangedCallba...
[ "0.9073653", "0.88553005", "0.88553005", "0.85720354", "0.85351837", "0.8505681", "0.85036683", "0.85036683", "0.85036683", "0.85036683", "0.846776", "0.8230596", "0.8113971", "0.8096207", "0.8074251", "0.80715334", "0.8002767", "0.8002767", "0.7990789", "0.79661644", "0.7940...
0.0
-1
Toggle click on menu
function menu(){ menuNav.classList.toggle("show"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function togglemenu(){\n this.isopen = !this.isopen;\n }", "Click(){\n\t\tthis.setState({ showMenu: !this.state.showMenu})\n\t}", "function menuToggleClickHandler() {\n setSideMenuIsOpen(!sideMenuIsOpen);\n }", "function toggleMenu(menu) {\n menu.toggleClass('show');\n}", "function toggleOnMenuC...
[ "0.78393286", "0.73902136", "0.7362316", "0.7337262", "0.73360604", "0.73011404", "0.728817", "0.72384167", "0.722282", "0.71938086", "0.71899277", "0.71560705", "0.7154729", "0.7115897", "0.70938075", "0.70915407", "0.70818263", "0.7080277", "0.70679224", "0.7065622", "0.704...
0.0
-1
i = 1 sss i = 2 ss i = 3 s i = 4
function staircase(n) { let hashes = '' let result = '' for (let i = 1; i <= n; i++) { hashes += '#' // concat n - i amount of spaces let spaces = " ".repeat(n - i) // add another line of correct amount of spaces and hashes result += spaces + hashes + "\n" } console.log(result) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function s(t,e,n,i,r){return r?(r[0]=t,r[1]=e,r[2]=n,r[3]=i,r):[t,e,n,i]}", "function sumConsecutives(s) {\n \n}", "function solution(s) {\n\n}", "function marsExploration(s) {\n let count = 0;\n s = s.split('');\n\n for (let i = 0; i < s.length; i += 3) {\n let newArr = s.slice(i, i + 3);...
[ "0.67079896", "0.63269496", "0.59213847", "0.5896417", "0.58526134", "0.583644", "0.5830061", "0.5802946", "0.5802124", "0.57975495", "0.572009", "0.572009", "0.5715825", "0.56932217", "0.5657332", "0.5652202", "0.5650859", "0.5647468", "0.56297094", "0.5618851", "0.5602054",...
0.0
-1
function that well, deletes an entry
function deleteData(tableId, id){ var deleteItem = "delete" + id; //will match assigned hidden ID's var table = document.getElementById("exerciseTable"); var numRows = table.rows.length; for(var i = 1; i < numRows; i++){ var row = table.rows[i]; var findData = row.getElementsByTagName("td"); var erase = findData[findData.length -1]; if(erase.children[1].id === deleteItem){ //matches delete ID with row table.deleteRow(i); i = numRows; } } var req = new XMLHttpRequest(); req.open("GET", "/delete?id=" + id, true); req.addEventListener("load",function(){ if(req.status >= 200 && req.status < 400){ console.log('success'); } else { console.log('error'); } }); req.send("/delete?id=" + id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteEntry(ENTRY){\n ENTRY_LIST.splice(ENTRY.id,1)\n updateUI()\n}", "function deleteEntry(entry){\n ENTRY_LIST.splice(entry.id, 1);\n// after we call the deleteEntry funciton we need to update the Total values again\n updateUI();\n }", "function deleteEntry(id) {\n API.deleteEntr...
[ "0.79990464", "0.7729666", "0.7536845", "0.72609234", "0.7095049", "0.708659", "0.70797235", "0.7009879", "0.6986784", "0.6915469", "0.68576914", "0.6851584", "0.68260324", "0.6789809", "0.67314297", "0.6681159", "0.66657573", "0.6641444", "0.66402435", "0.6638916", "0.662817...
0.0
-1
Variables applied to each of our instances go here, we've provided one for you to get started
constructor() { // The image for the sprite this.sprite = 'images/enemy-bug.png'; this.x = xStartPosEnemy; this.speed = speeds[Math.floor(Math.random() * 5)]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initInstance() {\n this.instance = {};\n this.instance.epiHiperSchema = '';\n this.instance.diseaseModel = {};\n this.instance.sets = [];\n this.instance.variables = [];\n this.instance.initializations = [];\n this.instance.triggers = [];\n this.instance.interventions = [];\n this.instan...
[ "0.680135", "0.6550668", "0.646188", "0.6198976", "0.616119", "0.6151368", "0.61162347", "0.6062928", "0.58999926", "0.58256704", "0.5797813", "0.5791412", "0.57866913", "0.57830083", "0.5770955", "0.5769084", "0.57578593", "0.57387656", "0.5737451", "0.5708502", "0.56754524"...
0.0
-1
Draw the enemy on the screen
render() { ctx.drawImage(Resources.get(this.sprite), this.x, this.y); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawEnemy(EnemyX,EnemyY){\n image(Enemy,EnemyX,EnemyY,50,50);\n}", "draw() {\n ctx.fillStyle = this.color\n ctx.shadowColor = this.color\n ctx.shadowBlur = 30\n ctx.fillRect(this.pos.x, this.pos.y, this.size.w, this.size.h)\n\n if (this.color === this.hitColor) {\n setTimeout(() => ...
[ "0.7651879", "0.7623985", "0.7455392", "0.73705465", "0.73646516", "0.7218339", "0.7204746", "0.70851266", "0.7044181", "0.7024406", "0.70161104", "0.70125526", "0.6978179", "0.69721955", "0.69200844", "0.6911573", "0.68684286", "0.6850782", "0.679081", "0.6760563", "0.675931...
0.0
-1
Update the enemy's position
update(dt) { // multiply any movement by the dt parameter // which will ensure the game runs at the same speed for // all computers. this.x += this.speed * 75 * dt; //return Enemy to start when leaves screen if (this.x >= 500) { this.x = xStartPosEnemy; this.y = yPositions[Math.floor(Math.random() * 4)]; this.speed = speeds[Math.floor(Math.random() * 5)]; } else { this.x = this.x; } //check collision of Enemy by avaluating x y positions if (this.x < player.x + 55 && this.x > player.x - 55 && this.y < player.y + 45 && this.y > player.y - 45) { window.setTimeout(player.loseLife(), 50); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "move() {\r\n this.y = this.y + Enemy.v;\r\n }", "updatePos() {\n if (this.x != this.player.x || this.y != this.player.y) {\n this.x = this.player.x;\n this.y = this.player.y;\n }\n }", "update(dt) {\n this.x += (level * enemySpeed) * dt;\n\n // When the en...
[ "0.77730143", "0.7441007", "0.738478", "0.7367606", "0.7335268", "0.73146313", "0.7285591", "0.72396815", "0.72209585", "0.71981657", "0.7150394", "0.71449536", "0.71444535", "0.7141222", "0.71345526", "0.71333396", "0.71151084", "0.7114613", "0.710047", "0.7059871", "0.70461...
0.6939115
31
============================================================================= = Collision detection = =============================================================================
function detectAndHandleCollisions(entities) { for (var i = 1; i < entities.length; i++) { var e1 = entities[i]; for (var j = 0; j < i; j++) { var e2 = entities[j]; if (e1.newVersion._id === e2.newVersion._id) { return; } var dx = e2.newVersion.x - e1.newVersion.x; var dy = e2.newVersion.y - e1.newVersion.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance < TILE_SIZE_PX) { handleCollision(e1, e2); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "collision () {\n }", "function collision (px,py,pw,ph,ex,ey,ew,eh){\nreturn (Math.abs(px - ex) *2 < pw + ew) && (Math.abs(py - ey) * 2 < ph + eh);\n \n}", "function detectCollision() {\n ballCollision();\n brickCollision();\n}", "function collisionDetection(body1, body2){\n if(body1.x+body1.width ...
[ "0.79601616", "0.7761483", "0.7626001", "0.7596909", "0.75479376", "0.75325406", "0.74924725", "0.7473791", "0.74710584", "0.74698704", "0.74529004", "0.7451849", "0.74218374", "0.74144226", "0.74054915", "0.73947346", "0.7383686", "0.736965", "0.7369272", "0.73381203", "0.73...
0.0
-1
============================================================================= = Utilities = =============================================================================
function clamp(min, value, max) { if (value < min) { return min; } else if (value > max) { return max; } else { return value; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Utils() {}", "function Utils() {}", "function Utils(){}", "function _____SHARED_functions_____(){}", "function Utils() {\n}", "private public function m246() {}", "function AeUtil() {}", "private internal function m248() {}", "function DWRUtil() { }", "function Util() {}", "protected i...
[ "0.68743795", "0.68743795", "0.67178273", "0.66578364", "0.6465029", "0.6405977", "0.6396039", "0.6394972", "0.6375918", "0.6302335", "0.5982519", "0.5956346", "0.5817863", "0.58121413", "0.5796301", "0.5770792", "0.5764798", "0.5740645", "0.5740645", "0.5712539", "0.57079804...
0.0
-1
much of the code for this section originated at and is used here in a modified form with Peter Wooley's consent
function FavIcon(gPlusIcon) { var self = this; this.self = this; this.src = gPlusIcon; this.foreground = "#2c3323"; this.background = "#fef4ac"; this.borderColor = "#fef4ac"; this.construct = function() { this.head = document.getElementsByTagName('head')[0]; this.pixelMaps = { numbers: [ [ [0,1,1,0], [1,0,0,1], [1,0,0,1], [1,0,0,1], [0,1,1,0] ], [ [0,1,0], [1,1,0], [0,1,0], [0,1,0], [1,1,1] ], [ [1,1,1,0], [0,0,0,1], [0,1,1,0], [1,0,0,0], [1,1,1,1] ], [ [1,1,1,0], [0,0,0,1], [0,1,1,0], [0,0,0,1], [1,1,1,0] ], [ [0,0,1,0], [0,1,1,0], [1,0,1,0], [1,1,1,1], [0,0,1,0] ], [ [1,1,1,1], [1,0,0,0], [1,1,1,0], [0,0,0,1], [1,1,1,0] ], [ [0,1,1,0], [1,0,0,0], [1,1,1,0], [1,0,0,1], [0,1,1,0] ], [ [1,1,1,1], [0,0,0,1], [0,0,1,0], [0,1,0,0], [0,1,0,0] ], [ [0,1,1,0], [1,0,0,1], [0,1,1,0], [1,0,0,1], [0,1,1,0] ], [ [0,1,1,0], [1,0,0,1], [0,1,1,1], [0,0,0,1], [0,1,1,0] ], ] }; return true; }; this.getIconCanvas = function(callback) { if(!self.iconCanvas) { self.iconCanvas = document.createElement('canvas'); self.iconCanvas.height = self.iconCanvas.width = 16; var image = new Image(); $(image).load(function() { // fill the canvas with the background favicon's data var ctx = self.iconCanvas.getContext('2d'); ctx.drawImage(image, 0, 2, 14, 14); callback(self.iconCanvas); }); image.src = self.src; } else { callback(self.iconCanvas); } }; this.getBadgedIcon = function(unread, callback) { if(!self.textedCanvas) { self.textedCanvas = []; } if(!self.textedCanvas[unread]) { self.getIconCanvas(function(iconCanvas) { var textedCanvas = document.createElement('canvas'); textedCanvas.height = textedCanvas.width = iconCanvas.width; var ctx = textedCanvas.getContext('2d'); ctx.drawImage(iconCanvas, 0, 0); ctx.fillStyle = self.background; ctx.strokeStyle = self.border ? self.border : '#000000'; ctx.strokeWidth = 1; var count = unread.length; var bgHeight = self.pixelMaps.numbers[0].length; var bgWidth = 0; var padding = count > 2 ? 0 : 1; for(var index = 0; index < count; index++) { bgWidth += self.pixelMaps.numbers[unread[index]][0].length; if(index < count-1) { bgWidth += padding; } } bgWidth = bgWidth > textedCanvas.width-4 ? textedCanvas.width-4 : bgWidth; ctx.fillRect(textedCanvas.width-bgWidth-4,1,bgWidth+4,bgHeight+4); var digit; var digitsWidth = bgWidth; for(var index = 0; index < count; index++) { digit = unread[index]; if (self.pixelMaps.numbers[digit]) { var map = self.pixelMaps.numbers[digit]; var height = map.length; var width = map[0].length; ctx.fillStyle = self.foreground; for (var y = 0; y < height; y++) { for (var x = 0; x < width; x++) { if(map[y][x]) { ctx.fillRect(14- digitsWidth + x, y+3, 1, 1); } } } digitsWidth -= width + padding; } } if(self.border) { ctx.strokeRect(textedCanvas.width-bgWidth-3.5,1.5,bgWidth+3,bgHeight+3); } self.textedCanvas[unread] = textedCanvas; callback(self.textedCanvas[unread].toDataURL('image/png')); }); } else { callback(self.textedCanvas[unread].toDataURL('image/png')); } }; this.setIcon = function(icon) { var links = self.head.getElementsByTagName("link"); for (var i = 0; i < links.length; i++) if ((links[i].rel == "shortcut icon" || links[i].rel=="icon") && links[i].href != icon) self.head.removeChild(links[i]); else if(links[i].href == icon) return; var newIcon = document.createElement("link"); newIcon.type = "image/png"; newIcon.rel = "shortcut icon"; newIcon.href = icon; self.head.appendChild(newIcon); var shim = document.createElement('iframe'); shim.width = shim.height = 0; document.body.appendChild(shim); shim.src = "icon"; document.body.removeChild(shim); }; this.set = function(num) { if(typeof(num) == 'undefined' || (!num && num.toString() != '0')) num = ''; if(num != '') { self.getBadgedIcon(num.toString(), function(src) { self.setIcon(src); }); } else { self.setIcon(this.src); } }; this.toString = function() { return '[object FavIconAlerts]'; }; return this.construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected internal function m252() {}", "private internal function m248() {}", "transient final protected internal function m174() {}", "private public function m246() {}", "transient protected internal function m189() {}", "transient final private protected internal function m167() {}", "transient pri...
[ "0.6349964", "0.6185175", "0.5989746", "0.59572685", "0.5880583", "0.5861998", "0.58168954", "0.58015215", "0.56318897", "0.55347526", "0.5459655", "0.54007316", "0.5370882", "0.53627515", "0.53622305", "0.5313386", "0.5300119", "0.52952796", "0.5285075", "0.52832043", "0.526...
0.0
-1
showing computer pattern with color changes
async function showPattern(show) { if(show == 0){ green(); } else if (show == 1){ red(); } else if (show == 2) { yellow(); } else if (show == 3) { blue(); } setTimeout(() => { originalColors(); }, light); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newRound() {\n //Animate color pattern for computer sequence\n\n playPattern();\n update();\n}", "function updatePattern(pat){ // call the pattern currently being created\n switch(pat) {\n case 0:\n rainbow();\n break;\n case 1:\n rainbowCycle();\n break;\n case ...
[ "0.693385", "0.6793875", "0.67468446", "0.6554551", "0.6440635", "0.6407863", "0.63974303", "0.63740563", "0.636017", "0.63284665", "0.63004667", "0.62996966", "0.6280428", "0.62638503", "0.6257317", "0.6242988", "0.6210111", "0.6164323", "0.6159133", "0.6138771", "0.6089295"...
0.6547947
4
Select User Test Function
function test(){ let newSpace = userPattern.length - 1; if(userPattern.length === compPattern.length && userPattern[newSpace] == compPattern[newSpace]){ userPattern = []; setTimeout(playback,500); } else if(userPattern[newSpace] == compPattern[newSpace]){ return; } else { loser(); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectUser ( user ) {\n self.selected = angular.isNumber(user) ? $scope.users[user] : user;\n }", "function selectUser() {\n var userSel = document.getElementById(\"user-sel\");\n if (userSel.value == \"null\") {\n searchMemberKey = null;\n } else {\n searchMemberKey = use...
[ "0.664821", "0.6561464", "0.6459968", "0.6440342", "0.6261245", "0.62408775", "0.6204785", "0.616787", "0.61523175", "0.6140822", "0.61264426", "0.6086654", "0.6073826", "0.60517275", "0.6049714", "0.60218436", "0.59815454", "0.5966207", "0.59552735", "0.5947072", "0.593239",...
0.0
-1
Function to change display property to block.
function show(Id){ document.getElementById(Id).style.display = "block"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ShowBlockElement(el, show) {\n el.style.display = show ? \"block\" : \"none\";\n}", "function showBlock(aid){\n\tvar el = document.getElementById(aid);\n\tsetStyle(el, 'display', 'block');\n}", "get displayMode() {\n return this.__displayMode || 'block';\n }", "function BlockBtnDisplay (idEleme...
[ "0.7203623", "0.71264344", "0.6980471", "0.6881702", "0.6839586", "0.67749333", "0.67154014", "0.6683998", "0.6664107", "0.651713", "0.64427143", "0.643328", "0.64257276", "0.6403037", "0.63494706", "0.6311873", "0.62488437", "0.62474126", "0.6219702", "0.6182031", "0.6139023...
0.5807244
59
Function to change display property to none.
function hide(Id){ document.getElementById(Id).style.display = "none"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unhideDisplay() {\n let displayBox = document.getElementById('display-box');\n if (displayBox.classList.contains('hidden')) {\n displayBox.classList.remove('hidden');\n displayBox.classList.add('visible');\n }\n}", "function changeDisplay(){\n magicElement.style.display = \"none\...
[ "0.76511157", "0.76501465", "0.7542399", "0.7436947", "0.74233377", "0.7393006", "0.7328397", "0.73199", "0.7318435", "0.7304065", "0.7285749", "0.7276396", "0.7251577", "0.7237432", "0.72302514", "0.7226134", "0.71338814", "0.709168", "0.7089854", "0.7067657", "0.70622826", ...
0.68724287
39
TODO: merged with shared/utility
function getUrlBaseByWiki(wiki) { let wikiToLang = { 'enwiki': 'en', 'frwiki': 'fr', 'ruwiki': 'ru' }; return `https://${wikiToLang[wiki]}.wikipedia.org`; // Require HTTPS to conduct the write edits }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "function Util() {}", "function Utils() {}", "function Utils() {}", "static private internal function m121() {}", "function DWRUtil() { }", "function AeUtil() {}", "function Utils()...
[ "0.62332857", "0.6130339", "0.60473686", "0.5988378", "0.59165514", "0.59165514", "0.5818622", "0.5816386", "0.5751232", "0.57047033", "0.5669725", "0.5547224", "0.5542425", "0.54218125", "0.54182494", "0.5330503", "0.531148", "0.52895176", "0.5258833", "0.5253092", "0.522547...
0.0
-1
function to create list elements from the photo array
createPhotoComps(photos) { let photoComps = []; for (let i=0; i<photos.length-1; i++) { photoComps.push( <Photo url={photos[i]} key={i} />) ; } if (photoComps.length>0) { return(photoComps) } else { return(['noRes']) } ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createListItemsWithImagesDOM() {\n\n // Takes the images Array and creates DOM elements\n for (var i = 0; i < images.length; i++) {\n var newList = document.createElement('li');\n var newImg = document.createElement('img');\n newImg.src = images[i];\n newList.appendChild(newImg);\n\n gall...
[ "0.655408", "0.65129954", "0.64465785", "0.63018495", "0.6256874", "0.6227358", "0.6163854", "0.61119634", "0.6093127", "0.60898715", "0.60893166", "0.6088709", "0.60832536", "0.6081336", "0.6042026", "0.60323524", "0.60293305", "0.6027766", "0.6027238", "0.6026111", "0.60202...
0.6066612
14
fetch images using fetch api. Generates li of photos and saves to state
createPhotos(searchTopic2) { if(this.state.prevSearchTopic !== searchTopic2) { this.setState({ loading: true }) const url=`https://www.flickr.com/services/rest/?method=flickr.photos.search&api_key=${apiKey}&text=${searchTopic2}&per_page=24&format=json&nojsoncallback=1` fetch(url) .then(response => response.json()) .then(data => data.photos.photo) .then(data => data.map(x => `https://live.staticflickr.com/${x.server}/${x.id}_${x.secret}_w.gif`)) .then(data => this.createPhotoComps(data)) .then(data => this.setState({ photoComps: data, searchTopic: searchTopic2 , prevSearchTopic: searchTopic2, loading: false }, () => { console.log(`App: createPhotos setState with new searchTopic: ${this.state.searchTopic}`); } )) .catch(error => { console.log('Error in createPhotos in App.js', error); }); }}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchImgs() {\n const imgUrl = \"https://dog.ceo/api/breeds/image/random/4\";\n fetch(imgUrl)\n .then(resp => resp.json())\n .then(results => insertImgs(results)) \n}", "async GetImages(fetchParams) {\n if (this.state.lastCursor) {\n fetchParams.after = this.state.lastCursor;\n ...
[ "0.77297944", "0.7561833", "0.7464669", "0.74505633", "0.7434848", "0.7382563", "0.736727", "0.73121357", "0.72514975", "0.72221726", "0.71728706", "0.7157647", "0.71489865", "0.7117547", "0.7053838", "0.704792", "0.70380694", "0.7037564", "0.7029955", "0.70074815", "0.699859...
0.6621467
63
used to make the object available to the private methods PRIVATE METHODS
function _getlinks () { return links; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "privateMethod() {\n\t}", "function priv () {\n\t\t\t\n\t\t}", "function _privateFn(){}", "_privateFunction() {}", "obtain(){}", "function __Object__() {\n }", "function privateMethodOne() {\n\t\t\tvar c = this;\n\n\t\t}", "_private_method() {\n console.log('private hey');\n }", "_initP...
[ "0.7237648", "0.69850814", "0.6927589", "0.6791102", "0.657036", "0.6493528", "0.6441262", "0.6427114", "0.64189297", "0.6333867", "0.6295223", "0.6293476", "0.6270686", "0.6270686", "0.61470866", "0.61328083", "0.61270475", "0.612138", "0.61105853", "0.6101497", "0.60562634"...
0.0
-1
Get the web token (jwt) if the user has it. If not, each of the components that are rendered will redirect the user back to the Login component (except for the Register component)
componentDidMount() { //Get JWT from cookie const jwt = getCookieJwt(); if (!jwt) { console.log("No Jwt") } else { API.getUser() .then(userData => { console.log('User data: ', userData) this.setState({ email: userData.data.email, accountType: parseInt(userData.data.accountType), jwt, loggedIn: true }); }) //Console log errors and remove the Jwt from the cookie .catch(err => { console.log(err); removeCookieJwt(); }) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "userLogin() {\n if (!localStorage.token) {\n return (\n <Redirect to={{ pathname: '/login', state: this.props.location }} />\n );\n }\n }", "componentDidMount() {\n\n let currentUser = TokenService.getUserId();\n console.log(currentUser)\n\n //if the user is not logged in, send h...
[ "0.6652037", "0.6604996", "0.6453364", "0.64010936", "0.6375936", "0.63688314", "0.6337005", "0.62815845", "0.6267824", "0.6255168", "0.6232642", "0.6211497", "0.62057716", "0.62007815", "0.6187793", "0.6183601", "0.61798525", "0.61376476", "0.61180794", "0.60907257", "0.6089...
0.0
-1
helper function to calculate zoom step
getZoomStep(currentZoomLevel) { if (currentZoomLevel > 3) { return 1.2; } else { return currentZoomLevel / 4; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zoomFactor(){\n\tvar percentOffFloor = (transform.position.y - zoomFloor)/zoomCeiling;\n\treturn percentOffFloor + 1;\n}", "function zoom(value) {\n return value * zoomLevel;\n}", "function zoom () {\r\n if (zoomAllowed) {\r\n d3.event.preventDefault()\r\n var dy = +d3.event.wheelDeltaY\...
[ "0.6887877", "0.6567673", "0.65666026", "0.65600044", "0.63644785", "0.63644785", "0.6340326", "0.62715423", "0.62563574", "0.6237917", "0.6233597", "0.6233597", "0.6204101", "0.6177413", "0.61689407", "0.61249894", "0.61089003", "0.6100329", "0.6091082", "0.6087894", "0.6074...
0.73594874
0
Convert a NodeForge type distingished name object to the DistinigishedName object
static getFromNodeForgeDistingishedName(forgeAttributes) { var distingishedName = new DistingishedName(); for (var attribute of forgeAttributes) { if (!('type' in attribute)) throw new Error('node-forge produced an attribute without a valid type for a certificate distingished name'); if (!('value' in attribute)) throw new Error('node-forge produced an attribute without a valid value for a certificate distingished name'); if (attribute['valueTagClass'] != 19) throw new Error('node-forge produced an attribute without a valid tag type for a certificate distingished name'); var attributeType = attribute['type']; var attributeKey = DistingishedName.forgeTypeToAttributeKeyMap.has(attributeType) ? DistingishedName.forgeTypeToAttributeKeyMap.get(attributeType) : attributeType; distingishedName.addAttribute(attributeKey, attribute['value']); } distingishedName.updateIdentityString(); distingishedName.updateLookupString(); return distingishedName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static convertTLSDistingishedName(distingishedName) {\n return {\n 'commonName': distingishedName['CN'],\n 'givenName': distingishedName['GN'],\n 'surname': distingishedName['SN'],\n 'initials': distingishedName['initials'],\n 'localityName': distingish...
[ "0.62638706", "0.5417477", "0.50152504", "0.4912157", "0.4820243", "0.48173767", "0.48173767", "0.4803079", "0.47787532", "0.47638088", "0.4730757", "0.46950424", "0.46944845", "0.46709007", "0.46613783", "0.46613783", "0.46492112", "0.4627388", "0.4623463", "0.4623463", "0.4...
0.687117
0
Convert the list of attributes to a simple to use lookup string
updateLookupString() { this.lookupString = this.attributesToString(DistingishedName.lookupAttributeKeys); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "attributesToString(attributeKeys) {\n var result = null;\n for (var attributeKey of attributeKeys) {\n if (!this.attributes.has(attributeKey)) {\n throw new Error(Util.format(\"distinighed name missing attribute '%s'\", attributeKey));\n }\n if (result ...
[ "0.6247813", "0.6208343", "0.60990256", "0.6040961", "0.5885408", "0.57853425", "0.5724533", "0.56705606", "0.5641991", "0.55810255", "0.55810255", "0.55810255", "0.55810255", "0.55787355", "0.55787355", "0.55787355", "0.5563431", "0.5554823", "0.55394626", "0.55169815", "0.5...
0.64476913
0
Convert the list of attributes to a simple to use identity string
updateIdentityString() { this.identityString = this.attributesToString(DistingishedName.identityAttributeKeys); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function make_attributes (attr) {\n\t\tvar attr_str = '';\n\t\tfor (var k in attr) {\n\t\t\tif (k && attr[k] != null) attr_str += ' '+ k +'='+ '\"'+ attr[k] +'\"';\n\t\t}\n\t\treturn attr_str;\n\t}", "function _getAsAttributeList(attrs) {\n\t\tvar s = '';\n\t\tfor (var name in attrs) {\n\t\t\ts += ' ' + name + '...
[ "0.6765786", "0.64373475", "0.6316487", "0.6217544", "0.61595184", "0.6099874", "0.60874957", "0.59805536", "0.5862916", "0.586259", "0.586259", "0.586259", "0.586259", "0.58526134", "0.5843435", "0.58401835", "0.58401835", "0.58401835", "0.5839162", "0.5832626", "0.5829996",...
0.64497566
1
The convert the current attribute map into a string given the attribute keys to use
attributesToString(attributeKeys) { var result = null; for (var attributeKey of attributeKeys) { if (!this.attributes.has(attributeKey)) { throw new Error(Util.format("distinighed name missing attribute '%s'", attributeKey)); } if (result == null) result = ""; else result += DistingishedName.attributeSeparator; result += attributeKey + DistingishedName.keyValueSeparator + this.attributes.get(attributeKey); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function make_attributes (attr) {\n\t\tvar attr_str = '';\n\t\tfor (var k in attr) {\n\t\t\tif (k && attr[k] != null) attr_str += ' '+ k +'='+ '\"'+ attr[k] +'\"';\n\t\t}\n\t\treturn attr_str;\n\t}", "function attrsToStr(attrs){var parts=[];$.each(attrs,function(name,val){if(val!=null){parts.push(name+'=\"'+html...
[ "0.6694932", "0.64469504", "0.6341036", "0.6306847", "0.63060904", "0.63060904", "0.62814486", "0.62814486", "0.62814486", "0.62704647", "0.62667257", "0.62106633", "0.6205157", "0.6205157", "0.6205157", "0.6205157", "0.61934173", "0.6192872", "0.6189862", "0.617363", "0.6169...
0.7032027
0
Convert the TLS formatted distingished name object to the x509 libaray object
static convertTLSDistingishedName(distingishedName) { return { 'commonName': distingishedName['CN'], 'givenName': distingishedName['GN'], 'surname': distingishedName['SN'], 'initials': distingishedName['initials'], 'localityName': distingishedName['L'], 'stateOrProvinceName': distingishedName['ST'], 'countryName': distingishedName['C'], 'organizationName': distingishedName['O'], 'organizationalUnitName': distingishedName['OU'] }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSubjectString(cert, whose, extended) {\n if (typeof extended === 'undefined') {\n extended = false;\n }\n var c = Certificate.decode(new Buffer(cert), 'der');\n var fields;\n if (whose === 'issuer') {\n fields = c.tbsCertificate.issuer.value;\n } else if (whose === 'own') {\n fields = c....
[ "0.5783547", "0.5614888", "0.5449339", "0.5449339", "0.5410501", "0.5138633", "0.5123641", "0.5098004", "0.49852043", "0.4980931", "0.49252653", "0.49252653", "0.49252653", "0.49252653", "0.4915836", "0.49119663", "0.48569724", "0.4850773", "0.4844865", "0.48207843", "0.48207...
0.56652105
1
Function for outputting array
function arrayOutput(a) { for (var i=0; i<a.length; i++) { document.writeln(a[i]+'<br>'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function outputArray(arr){\n for(i=0; i<arr.length; i++)\n console.log(arr[i]);\n}", "function outputArray( heading, theArray, output )\n{\n output.innerHTML = heading + theArray.join( \" \" ); \n} // end function outputArray", "function arrayOutput(ar){\n\tvar s = \"\";\n\tar.map((el)=>{\n\t\ts += J...
[ "0.7625371", "0.7390827", "0.73558474", "0.7337655", "0.72103214", "0.7100164", "0.7075473", "0.68633175", "0.68230885", "0.6666615", "0.66453016", "0.6614072", "0.6504439", "0.6481119", "0.6422144", "0.6419136", "0.6419136", "0.63970864", "0.6395362", "0.63842034", "0.635013...
0.75947565
1
This takes care of all updating values.
render() { return React.createElement("span", { class: "col", style: { padding: '10px', color: 'white', fontWeight: 'bold', fontSize: '12px' } }, " ", this.props.indexName, " : ", this.props.indexPrice, " "); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\n\t this.value = this.originalInputValue;\n\t }", "function update() {\n // ... no implementation required\n }", "valuesUpdate() {\n this.updateHistory()\n\n this.Volume = this.getVolume()\n this.Shuffle = this.getShuffle()\n this.Loop = this.getLoop()\n this.isPlayi...
[ "0.7015165", "0.7004861", "0.699352", "0.6926447", "0.6907531", "0.68462944", "0.6832741", "0.68247026", "0.68210346", "0.68210346", "0.68210346", "0.68210346", "0.68210346", "0.68210346", "0.68210346", "0.68210346", "0.68210346", "0.6817754", "0.6817754", "0.6817754", "0.676...
0.0
-1
this needs a bunch of boxes
constructor(props) { super(props); this.forexList = ['EUR/USD', 'USD/CAD', 'USD/JPY', 'GBP/USD', 'AUD/USD']; this.url = "https://financialmodelingprep.com/api/v3/forex"; this.oneArray = []; $.ajax({ url: this.url, success: data => { console.log("Setting initial values for forex."); let x = data['forexList']; this.state = { valDict: { 'EUR/USD': x[0]['bid'], 'USD/CAD': x[7]['bid'], 'USD/JPY': x[1]['bid'], 'GBP/USD': x[2]['bid'], 'AUD/USD': x[8]['bid'] } }; this.oneArray = []; this.forexList.forEach(name => { this.oneArray.push(React.createElement(IndexBox, { indexName: name, indexPrice: this.state.valDict[name] })); }); }, async: false }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mkBoxes() {\n boxes.forEach(function(val){\n ctx.drawImage(boxImg, val[0] * boxSize, val[1] * boxSize, boxSize, boxSize);\n })\n}", "function boxes() {\n rectMode(CORNER);\n\n //array of different colored boxes\n for (var i = 0; i <= width - 20; i += 20) {\n for (var j = 0; j <= height - 20...
[ "0.7293549", "0.7145911", "0.7104569", "0.70254874", "0.6969243", "0.6845548", "0.67716", "0.67625123", "0.6760329", "0.6727716", "0.6718983", "0.67084146", "0.6697506", "0.66629213", "0.662379", "0.6620975", "0.6605176", "0.65965575", "0.658183", "0.65773433", "0.6566983", ...
0.0
-1
this needs a bunch of boxes
constructor(props) { super(props); this.cryptoList = ['BTC', 'ETH', 'XRP', 'BCH', 'EOS']; this.url = "https://financialmodelingprep.com/api/v3/cryptocurrencies"; //this.oneArray = [ ] $.ajax({ url: this.url, success: data => { console.log("Setting initial values."); let x = data['cryptocurrenciesList']; this.state = { valDict: { 'BTC': x[0]['price'], 'ETH': x[1]['price'], 'XRP': x[2]['price'], 'BCH': x[3]['price'], 'EOS': x[4]['price'] } }; this.oneArray = []; this.cryptoList.forEach(name => { this.oneArray.push(React.createElement(IndexBox, { indexName: name, indexPrice: this.state.valDict[name] })); }); }, async: false }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mkBoxes() {\n boxes.forEach(function(val){\n ctx.drawImage(boxImg, val[0] * boxSize, val[1] * boxSize, boxSize, boxSize);\n })\n}", "function boxes() {\n rectMode(CORNER);\n\n //array of different colored boxes\n for (var i = 0; i <= width - 20; i += 20) {\n for (var j = 0; j <= height - 20...
[ "0.7293549", "0.7145911", "0.7104569", "0.70254874", "0.6969243", "0.6845548", "0.67716", "0.67625123", "0.6760329", "0.6727716", "0.6718983", "0.67084146", "0.6697506", "0.66629213", "0.662379", "0.6620975", "0.6605176", "0.65965575", "0.658183", "0.65773433", "0.6566983", ...
0.0
-1
this needs a bunch of boxes
constructor(props) { super(props); this.marketList = ['DJIA', 'S&P', 'NASDAQ', 'RUSSELL', 'PHX G/S']; this.url = 'https://financialmodelingprep.com/api/v3/majors-indexes'; //this.oneArray = [ ] $.ajax({ url: this.url, success: data => { console.log("Setting initial values for the market."); let x = data['majorIndexesList']; this.state = { valDict: { 'DJIA': x[0]['price'], 'S&P': x[1]['price'], 'NASDAQ': x[2]['price'], 'RUSSELL': x[4]['price'], 'PHX G/S': x[14]['price'] } }; this.oneArray = []; this.marketList.forEach(name => { this.oneArray.push(React.createElement(IndexBox, { indexName: name, indexPrice: this.state.valDict[name] })); }); }, async: false }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mkBoxes() {\n boxes.forEach(function(val){\n ctx.drawImage(boxImg, val[0] * boxSize, val[1] * boxSize, boxSize, boxSize);\n })\n}", "function boxes() {\n rectMode(CORNER);\n\n //array of different colored boxes\n for (var i = 0; i <= width - 20; i += 20) {\n for (var j = 0; j <= height - 20...
[ "0.7293411", "0.71446043", "0.7104251", "0.7024517", "0.69693756", "0.6845289", "0.67703927", "0.676199", "0.6760461", "0.67263126", "0.67184913", "0.67070764", "0.66976845", "0.66616493", "0.662293", "0.66206086", "0.6604009", "0.65959376", "0.6581031", "0.6576488", "0.65666...
0.0
-1
this.props.whichActive will tell indexContainer which to display
constructor(props) { super(props); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isActive(index) {\n return this.indexStart === index ? \"active\" : \"\";\n }", "_isActive(index,active){return index===active}", "isActive(index){\n if(this.currentIndex === index) {\n return \"active\"\n } return \" \";\n //scritta in ternario...
[ "0.7032529", "0.6807644", "0.65913194", "0.6589763", "0.6555256", "0.6506908", "0.63807774", "0.63807774", "0.63807774", "0.63489145", "0.6299889", "0.6295473", "0.62571865", "0.62223935", "0.6155405", "0.60720724", "0.6071895", "0.6049608", "0.6026485", "0.60120606", "0.6011...
0.0
-1
APP DASHBOARDS Facebook: Google: GitHub:
loginCallback(err) { if(err) { console.log(err); alert(err.message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function social_share(network)\n{\n var intent;\n switch (network)\n {\n case 'diaspora':\n intent = 'https://sharetodiaspora.github.io/?title=Look%20at%20this%20OpenBeerMap!&url=';\n break;\n case 'twitter':\n intent = 'https://twitter.com/intent/tweet?text=...
[ "0.5522433", "0.53849095", "0.5373598", "0.5370209", "0.52420473", "0.5171384", "0.51689017", "0.5166397", "0.5165559", "0.51281446", "0.5105208", "0.5081464", "0.5073163", "0.5071567", "0.50082743", "0.50032276", "0.4986905", "0.4982798", "0.49758306", "0.49696445", "0.49667...
0.0
-1
region responsive code begin you can remove responsive code if you don't want the slider scales while window resizing
function ScaleSlider() { var parentWidth = jssor_slider1.$Elmt.parentNode.clientWidth; if (parentWidth) jssor_slider1.$ScaleWidth(Math.min(parentWidth, 720)); else $Jssor$.$Delay(ScaleSlider, 30); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function responsive(){\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\n var heightLimit = options.responsiveHeight;\n\n //only calculating what we need. Remember its called on the resize event.\n var isBreakingPointWidth = widt...
[ "0.74970555", "0.72891724", "0.721348", "0.7196995", "0.7188501", "0.7188501", "0.71750337", "0.71448797", "0.71295065", "0.71295065", "0.7125741", "0.7125117", "0.71169466", "0.71169466", "0.71169466", "0.71135604", "0.7103749", "0.71029866", "0.7100784", "0.70974845", "0.70...
0.7040623
30
applies the necessary transform value to scale the item up
function applyTransforms(el, nobodyscale) { // zoomer area and scale value var zoomerArea = el.querySelector('.zoomer__area'), zoomerAreaSize = {width: zoomerArea.offsetWidth, height: zoomerArea.offsetHeight}, zoomerOffset = zoomerArea.getBoundingClientRect(), scaleVal = zoomerAreaSize.width/zoomerAreaSize.height < win.width/win.height ? win.width/zoomerAreaSize.width : win.height/zoomerAreaSize.height; if( bodyScale && !nobodyscale ) { scaleVal /= bodyScale; } // apply transform el.style.WebkitTransform = 'translate3d(' + Number(win.width/2 - (zoomerOffset.left+zoomerAreaSize.width/2)) + 'px,' + Number(win.height/2 - (zoomerOffset.top+zoomerAreaSize.height/2)) + 'px,0) scale3d(' + scaleVal + ',' + scaleVal + ',1)'; el.style.transform = 'translate3d(' + Number(win.width/2 - (zoomerOffset.left+zoomerAreaSize.width/2)) + 'px,' + Number(win.height/2 - (zoomerOffset.top+zoomerAreaSize.height/2)) + 'px,0) scale3d(' + scaleVal + ',' + scaleVal + ',1)'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function upScaleLabel(i){\n\tvar currentScale = $(\"#size_group_\" + i).attr(\"size_scale\");\n\tvar currentX = $(\"#size_group_\" + i).attr(\"translate_x\");\n\tvar currentY = $(\"#size_group_\" + i).attr(\"translate_y\");\n\t\n\tvar newScale = parseFloat(currentScale) + filterScale;\n\tvar newX = parseFloat(curr...
[ "0.7050058", "0.67608386", "0.67524034", "0.673005", "0.6546912", "0.65293264", "0.65057826", "0.6440724", "0.63353074", "0.6333923", "0.6257631", "0.62325096", "0.6229856", "0.62294656", "0.6219475", "0.621456", "0.62137073", "0.6204079", "0.619404", "0.61829716", "0.6146527...
0.57161057
69
disallow scrolling (on the scrollContainer)
function noscroll() { if(!lockScroll) { lockScroll = true; xscroll = scrollContainer.scrollLeft; yscroll = scrollContainer.scrollTop; } scrollContainer.scrollTop = yscroll; scrollContainer.scrollLeft = xscroll; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preventScrollEvents(e){\n e.stopPropagation();\n }", "function preventScrollEvents(e){\n e.stopPropagation();\n }", "disable() {\n if (this._scrollSubscription) {\n this._scrollSubscription.unsubscribe();\n this._scrollSubscription = null;\n }\n ...
[ "0.7802953", "0.7802953", "0.7754712", "0.7754712", "0.76643085", "0.76616085", "0.76412237", "0.76412237", "0.75906134", "0.75863", "0.7559726", "0.75518143", "0.751002", "0.74728215", "0.73956966", "0.7394975", "0.7326676", "0.7179368", "0.717164", "0.71296954", "0.71157813...
0.7503821
13
function for totaling IN OUT TOT and appending them
function addUpTotals(mycourse, teeIndex) { for(let i = 0; i < mycourse.length; i++) { if (i <= 8) { totalYardsIn += Number(mycourse[i].teeBoxes[teeIndex].yards); totalParIn += Number(mycourse[i].teeBoxes[teeIndex].par); totalHCPIn += Number(mycourse[i].teeBoxes[teeIndex].hcp); } if (i < mycourse.length && i >= 9) { totalYardsOut += Number(mycourse[i].teeBoxes[teeIndex].yards); totalParOut += Number(mycourse[i].teeBoxes[teeIndex].par); totalHCPOut += Number(mycourse[i].teeBoxes[teeIndex].hcp); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getStakeOutsTotal() {\n let val = new bn_js_1.default(0);\n for (let i = 0; i < this.stakeOuts.length; i++) {\n val = val.add(this.stakeOuts[i].getOutput().getAmount());\n }\n return val;\n }", "function callTotal() {\n var totRow = document.getElementById('timeTot');\n...
[ "0.66749525", "0.6452147", "0.6450019", "0.62815714", "0.616598", "0.6152829", "0.6144821", "0.61362773", "0.6134568", "0.61029917", "0.60827905", "0.6063323", "0.6061634", "0.60530865", "0.6047418", "0.60448325", "0.6022704", "0.6019805", "0.6019039", "0.60104346", "0.600547...
0.62893486
3
function for totaling IN OUT TOT and appending them
function buildCard() { for(let p = 1; p <= numplayers; p++){ $('.playerMain').append( '<div id="playerRow'+ p +'" class="playerLabel player'+ p +'">' + '<span class="playersName" contenteditable="true">Player '+ p +'</span>' + '<span onclick="removePlayer(this)" class="fa fa-trash player'+ p +'"></span>' + '</div>'); $('#totalIn').append('<div class="scoreBox">'+'<div id="player'+ p +'scoreIn"></div>'+'</div>'); $('#totalOut').append('<div class="scoreBox">'+'<div id="player'+ p +'scoreOut"></div>'+'</div>'); $('#totalScore').append('<div class="scoreBox">'+'<div id="player'+ p +'totalScore"></div>'+'</div>'); for(let h = 0; h < selcourse.data.holes.length; h++){ $('#c'+h).append('<input type="number" class="holeInput player'+p+'" id="p'+p+'h'+h+'" type="text">'); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getStakeOutsTotal() {\n let val = new bn_js_1.default(0);\n for (let i = 0; i < this.stakeOuts.length; i++) {\n val = val.add(this.stakeOuts[i].getOutput().getAmount());\n }\n return val;\n }", "function callTotal() {\n var totRow = document.getElementById('timeTot');\n...
[ "0.66742927", "0.6452115", "0.6450663", "0.6289431", "0.62810147", "0.616575", "0.6152211", "0.6145989", "0.6137838", "0.61357325", "0.610488", "0.60837257", "0.60645", "0.606052", "0.60527915", "0.6047831", "0.6043698", "0.6020418", "0.60203606", "0.60196894", "0.60102344", ...
0.0
-1
20, 60, 40 Async/Await based solution
async function logNumbersAsync(number) { const a = await promise(number + 10); const b = await promise(a * 3); await promise(b - 20); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function executeHardAsync() {\n const r1 = await fetchUrlData(apis[0]);\n const r2 = await fetchUrlData(apis[1]);\n}", "async function n(s,n,a){n=l$2.from(n);const u=r$1(s);return r(u,n,a).then((r=>{const e=r.data,o={};return Object.keys(e).forEach((r=>o[r]=g.fromJSON(e[r]))),o}))}", "function demoOfAs...
[ "0.66094905", "0.6364746", "0.6345022", "0.6199559", "0.6169969", "0.6146855", "0.6121415", "0.6108973", "0.5994871", "0.59879506", "0.5977297", "0.5973999", "0.59664935", "0.59648675", "0.5942859", "0.5909766", "0.5903028", "0.58957124", "0.588065", "0.5860696", "0.58464515"...
0.5434246
86
When size is submitted by the user, call makeGrid()
function makeGrid(height, width) { for (let r = 0; r < height; r++) { let row = shape.insertRow(r); for (let c = 0; c < width; c++) { let cell = row.insertCell(c); cell.addEventListener('click', (event) => { cell.style.backgroundColor = chooseColor.value; }); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gridSize() {\n size = prompt(\"What size do you want the grid?\");\n createGrid(size, size);\n\n}", "function resizeGrid() {\n do {\n size = prompt(\"Enter a number from 1-125\");\n if (size === null || isNaN(size)) {\n return;\n }\n } while (size > 125);\n container.innerHTML = \...
[ "0.7693881", "0.755239", "0.7506424", "0.7471815", "0.7240095", "0.72139996", "0.71550363", "0.71260715", "0.7101283", "0.7093287", "0.708926", "0.70476127", "0.7043265", "0.7038942", "0.6989011", "0.698573", "0.69554275", "0.69309515", "0.6888674", "0.6860019", "0.68562645",...
0.0
-1
Lock chuc nang trong phan cong do an
function setLock(button, number){ for(i = 0; i < 8; i++){ if(i==number-1) continue; document.getElementsByClassName("btn-lock")[i].classList.remove("btn-success"); document.getElementsByClassName("btn-lock")[i].classList.add("btn-danger"); document.getElementsByClassName("btn-lock")[i].value = "1"; document.getElementById("input-action").value = 0; document.getElementsByClassName("btn-lock")[i].innerHTML = "Khóa 🔒"; } if(button.value == "1"){ document.getElementsByClassName("btn-lock")[number-1].classList.remove("btn-danger"); document.getElementsByClassName("btn-lock")[number-1].classList.add("btn-success"); document.getElementsByClassName("btn-lock")[number-1].value = "0"; document.getElementsByClassName("btn-lock")[number-1].innerHTML = "Mở 🔓"; document.getElementById("input-action").value = number; } else{ document.getElementsByClassName("btn-lock")[number-1].classList.remove("btn-success"); document.getElementsByClassName("btn-lock")[number-1].classList.add("btn-danger"); document.getElementsByClassName("btn-lock")[number-1].value = "1"; document.getElementsByClassName("btn-lock")[number-1].innerHTML = "Khóa 🔒"; document.getElementById("input-action").value = 0; } document.getElementById("btn-confirm").disabled = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async lock() {\n\t\tif (this.lock_status_id === 3) {\n\t\t\treturn;\n\t\t}\n\t\tawait this.send_command(0);\n\t\tawait this.await_event('status:LOCKED');\n\t}", "function setLock(locked)\r\n{\r\n lock = locked;\r\n}", "lock(currentPlayer, consequence, channel){\n if(currentPlayer.passes.includes(conseque...
[ "0.6148335", "0.6116379", "0.6093374", "0.6045592", "0.5962768", "0.5948659", "0.5932255", "0.58839214", "0.5872413", "0.5822139", "0.5818234", "0.5809906", "0.57952315", "0.5785979", "0.575604", "0.575604", "0.5735589", "0.57319343", "0.57257193", "0.5716986", "0.5676301", ...
0.5750079
16
Cong bo ket qua bao ve do an nam xxxx Kiem tra xem co the cong bo duoc chua (dieu kien: toan bo chuc nang phai duoc khoa)
function checkOpenRelease(){ var finished = document.getElementById("input-event-finish").checked; if(finished == false){ document.getElementById("p-message").innerHTML = "Kỳ bảo vệ cần được hoàn thành trước khi công bố kết quả!"; document.getElementById("p-message").style.color = "red"; document.getElementById("p-message").hidden = false; } else{ document.getElementById("p-message").hidden = true; openRelease(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makespeakable(phrase) {\n phrase = phrase.replace(/['\"]/g, \"\");\n phrase = phrase.replace(/[-+]/g, \" \");\n phrase = phrase.replace(/([A-Z])(?=[A-Z])/g, \"$1 \"); //split apart capitals\n phrase = phrase.replace(/([A-Za-z])([0-9])/g, \"$1 $2\"); // split letter-number\n phrase = phrase.replace...
[ "0.6406276", "0.63711166", "0.6283341", "0.62722623", "0.62353146", "0.61643136", "0.616315", "0.61528623", "0.61244655", "0.610988", "0.60867757", "0.60842997", "0.60559535", "0.6049792", "0.60306925", "0.6026636", "0.6022585", "0.6002819", "0.5985346", "0.59784126", "0.5958...
0.0
-1
Callback called each time the browser wants us to draw another frame
function render(time) { // Clear color and depth buffers gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); // Place Camera mat4.identity(Matrices.view); mat4.lookAt(vec3.create([ camX, camY, camZ ]), vec3.create([ lookAtX, lookAtY, lookAtZ ]), vec3.create([ 0, 1, 0 ]), Matrices.view); // Clear model matrix mat4.identity(Matrices.model); // set phong to be the active program gl.useProgram(phongProgram); // compute all derived matrices (normal, viewModel, PVM) Matrices.compDerived(); // set matrices gl.uniformMatrix4fv(phongProgram.uniforms["uMat4ViewModel"], false, Matrices.getVM()); gl.uniformMatrix3fv(phongProgram.uniforms["uMat3Normal"], false, Matrices .getN()); gl.uniformMatrix4fv(phongProgram.uniforms["uMat4PVM"], false, Matrices .getPVM()); // set the light direction uniform var uVec3LightDir = [ 1.0, 0.5, 1.0, 0.0 ]; var res2 = vec3.create(); mat4.multiplyVec4(Matrices.getVM(), uVec3LightDir, res2); vec3.normalize(res2); gl.uniform3fv(phongProgram.uniforms["uVec3LightDir"], res2); myAxis.render(); // set the textured phong program as active gl.useProgram(phongTexProgram); // set the matrices gl.uniformMatrix4fv(phongTexProgram.uniforms["uMat4PVM"], false, Matrices .getPVM()); gl.uniformMatrix4fv(phongTexProgram.uniforms["uMat4ViewModel"], false, Matrices.getVM()); gl.uniformMatrix3fv(phongTexProgram.uniforms["uMat3Normal"], false, Matrices.getN()); // set the light dir gl.uniform3fv(phongTexProgram.uniforms["uVec3LightDir"], res2); // render the loaded model // note: if the model has no texture use phongProgram instead myModel.render(); // set the color program as active gl.useProgram(colorProgram); // set the matrix gl.uniformMatrix4fv(colorProgram.uniforms["uMat4PVM"], false, Matrices .getPVM()); // render the grid myGrid.render(); updateLookAtMdl(); pipes.render(); // just checking checkError(); // Send the commands to WebGL gl.flush(); // Request another frame window.requestAnimFrame(render, canvas); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawFrame() {\n\tif (drawNext) {\n\t\trenderFrame();\n\t\tdrawNext = false;\n\t}\n}", "updateFrame() {\n this._drawFrame();\n }", "function drawNextFrame() {\n\tdrawNext = true;\n}", "function do_frame() {\n\t\t\tupdate_stats();\n\t\t\tif(!call_user_callbacks()) {\n\t\t\t\treturn;\n\t\t\t}\n\...
[ "0.7760109", "0.7580041", "0.73641723", "0.73209244", "0.71848786", "0.689565", "0.68348217", "0.6790965", "0.67500705", "0.672943", "0.67133456", "0.67086744", "0.67030495", "0.6702168", "0.66678876", "0.66149336", "0.6596732", "0.65841633", "0.6573341", "0.65676135", "0.652...
0.0
-1
Init GL settings, programs and models Called when we have the context
function init() { // init cam variables; spherical2Cartesian(); // set the viewport to be the whole canvas gl.viewport(0, 0, gl.desiredWidth, gl.desiredHeight); // projection matrix. mat4.perspective(45, gl.desiredWidth / gl.desiredHeight, 0.1, 1000, Matrices.proj); // Set the background clear color to gray. gl.clearColor(0.8, 0.8, 0.8, 1.0); // general gl settings gl.enable(gl.CULL_FACE); gl.enable(gl.DEPTH_TEST); // create the shader programs phongProgram = createProgram("phong_vs", "phong_fs", [ "aVec4Position", "aVec3Normal" ], [ "uMat4PVM", "uMat3Normal", "uMat4ViewModel", "uVec3LightDir", "uVec4Diffuse", "uVec4Specular", "uFloatShininess" ]); colorProgram = createProgram("color_vs", "color_fs", [ "aVec4Position" ], [ "uMat4PVM", "uVec4Diffuse" ]); phongTexProgram = createProgram("phong_texture_vs", "phong_texture_fs", [ "aVec4Position", "aVec3Normal", "aVec2TexCoord" ], [ "uMat4PVM", "uMat3Normal", "uMat4ViewModel", "uSamp2DTexID", "uVec3LightDir", "uVec4Diffuse", "uVec4Specular", "uFloatShininess" ]); // init the matrices Matrices.init(); // init the models for rendering var myGridMat = new Material(); myGridMat.diffuse = new Float32Array([ 1.0, 1.0, 1.0, 1.0 ]); myGrid = createGrid(1, 3, 12); myGrid.setMaterial(myGridMat); myAxis = createAxis(3); // just in case checkError(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpBuffers();\n setupWorldCoordinates();\n gl.clearColor(0.1, 0.1, 0.1, 1);\n startLoop();\n}", "function initGL() {\n ctx...
[ "0.7592956", "0.7577131", "0.7577131", "0.7565573", "0.7540968", "0.74683285", "0.7447045", "0.74324614", "0.73960924", "0.73248386", "0.7213346", "0.7185595", "0.7144392", "0.7142932", "0.7096134", "0.7069807", "0.7034127", "0.7034127", "0.7004918", "0.69941723", "0.6988512"...
0.7195072
11
end password validate ///////////// confirm password function start from here
function AdminConfirmPassword() { var password = $("#admin_password").val() var confirm_pas = $("#confirm_password_reset").val() if (confirm_pas.length == null || confirm_pas.length == "") { $("#conf_password_reset_label").show(); $("#confirm_password_reset").addClass("has-error"); $("#conf_password_reset_label").text("This Field is required"); return false; } else { if(confirm_pas != password) { $("#confirm_password_reset").addClass("has-error"); $("#conf_password_reset_label").show(); $("#conf_password_reset_label").text("Password is not match"); return false; } else { $("#confirm_password_reset").removeClass("has-error"); $("#conf_password_reset_label").hide(); $("#conf_password_reset_label").text(""); return true; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validatePassword() {\n\n // empty array for the final if statement to check\n var errors = [];\n\n if (confirmLowerCase === true) {\n if (finalPass.search(/[a-z]/) < 0) {\n errors.push(\"lower\");\n }\n }\n if (confirmUpperCase === true) {\n if (finalPass.search(/[A-Z]...
[ "0.8182297", "0.78593343", "0.7684648", "0.761468", "0.75360185", "0.7532019", "0.74890745", "0.74773026", "0.74473083", "0.74390036", "0.7432216", "0.7415758", "0.74024063", "0.7398931", "0.7370108", "0.73603064", "0.7356757", "0.7356095", "0.7355932", "0.7350093", "0.734679...
0.7003874
79
confirm password function end here / otp function start here
function OtpPassword(){ var otp_time_check=$("#reset_otp").val(); if(otp_time_check.length == '' || otp_time_check.length == null) { $("#reset_otp").removeClass("has-success"); $("#reset_otp").addClass("has-error"); $("#otp_label_reset").show(); $("#otp_label_reset").text("This Field is required"); return false; } else{ $("#reset_otp").addClass("has-success"); $("#otp_label_reset").show(); $("#otp_label_reset").text(""); return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function confirmPassword(p1, p2 ){ if (p1.value && p1.value !== p2.value) {\n password2Ok = 0;\n showError(p2, \"Both passwords must match.\")\n} else if (p1.value && p1.value === p2.value) {\n password2Ok = 1;\n showSuccess(p2)\n}\n}", "function otp(req,res,next){\n var path =req.headers.host...
[ "0.7312526", "0.6973784", "0.68829584", "0.6659727", "0.6648917", "0.664669", "0.6637327", "0.6629239", "0.6607576", "0.6603103", "0.65824306", "0.6557363", "0.6551785", "0.65378016", "0.65300786", "0.65195787", "0.6519339", "0.6488281", "0.6485705", "0.64831656", "0.64605963...
0.6535129
14
otp function end here
function Numbervalidate(evt) { var theEvent = evt || window.event; // Handle paste if (theEvent.type === 'paste') { key = event.clipboardData.getData('text/plain'); } else { // Handle key press var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode(key); } var regex = /[0-9]|\./; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getServerOTP() {\n var authnData = {\n \"authId\": AUTH_ID,\n \"hint\": \"GET_SERVER_OTP\" //dont change this value.\n };\n authenticate(authnData);\n}", "function generateOTP() {\n var randomNumberSet = '123456789';\n var rnd = crypto.randomBytes(4);\n var value = new Ar...
[ "0.7334976", "0.71057284", "0.7046794", "0.66859984", "0.66538775", "0.657352", "0.6444346", "0.64223653", "0.63699335", "0.6279851", "0.62428623", "0.608486", "0.6059466", "0.6052856", "0.60084623", "0.5995488", "0.5934292", "0.5872588", "0.58327603", "0.58327085", "0.578794...
0.0
-1
============Stand Alone Functions============ ============begginning of ramy code============
function generateDucks(minimumTime,difficultyReward,speed){ //creating a 2 black/white/gold ducks every 5 seconds on a random time over 60 seconds if(minimumTime<0){return} for(var i=0;i<2;i++){ new BlackDuck(difficultyReward).delay((Math.random()*5000)+minimumTime).animate({left:"3000px"},7000-speed) new GBird(difficultyReward).delay((Math.random()*5000)+minimumTime).animate({left:"3000px"},7000-speed) new WhiteDuck(difficultyReward).delay((Math.random()*5000)+minimumTime).animate({left:"3000px"},7000-speed) } generateDucks((minimumTime-5000),difficultyReward,speed) //spreading the call every 5 secs to make sure there is always a duck on the screen }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static private internal function m121() {}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "functio...
[ "0.6613741", "0.6530533", "0.6530533", "0.6530533", "0.6530533", "0.6530533", "0.6530533", "0.6530533", "0.6530533", "0.6530533", "0.6530533", "0.6530533", "0.6530533", "0.6530533", "0.6527843", "0.6441156", "0.64016134", "0.6369766", "0.62951815", "0.62894344", "0.6233661", ...
0.0
-1
============ending of ramy code============ ============begginning of haidy code============
function gunSound(){//making gun sound on click var audio = document.createElement("audio"); audio.src = "sounds/gun_fire.mp3"; audio.play(); audio.addEventListener("ended", function(e){ }, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "static private internal function m121() {}", "protected internal function m252() {}", "private public function m246() {}", "transient protected internal function m189() {}", "function Ha(){}", "function hc(){}", "static private protected public internal function...
[ "0.6581308", "0.6292318", "0.6272198", "0.62314415", "0.61911076", "0.6164116", "0.595461", "0.59427375", "0.5860949", "0.5843845", "0.5804503", "0.5798797", "0.5789264", "0.57772416", "0.57722646", "0.5750122", "0.5736277", "0.57264006", "0.5720054", "0.571996", "0.571411", ...
0.0
-1
Constructor function, the naming convention is to use Uppercase, and we use this keyword the define properties
function Circle(radius) { this.radius = radius; this.draw = function () { console.log('drawing'); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "consructor() {\n }", "constructor (){}", "function MyConstructor(){\n\t\tthis.prop1 = \"Maxsuel\";\n\t\tthis.prop2 = \"Storch\";\n\t}", "constructor() {\n\t\t// ...\n\t}", "constructur() {}", "function _construct()\n\t\t{;\n\t\t}", "function Ctor() {\r\n }", "function Constructor() {}", "function...
[ "0.7914862", "0.7744676", "0.7728477", "0.77063656", "0.76918775", "0.76879716", "0.76708484", "0.76384073", "0.76384073", "0.76384073", "0.7607498", "0.757849", "0.757849", "0.757849", "0.757849", "0.757849", "0.757849", "0.757849", "0.7504787", "0.7494999", "0.74870425", ...
0.0
-1
This function allow save a message into the database, with the datetime of submit.
function saveMessage(message) { db .collection('messages') //In which collection the message will be saved .add({ //Method add() create a new document into the collection message, timestamp: firebase.firestore.Timestamp.now() }) .then(function() { // .then() is when the promise is resolved console.log("Mensaje agregado a la DB") messageInput.value = '' // Clear input after the message is saved in the DB }) .catch(function(error) { // If the promise fails (rejected) console.log("Algo falló al guardar mensaje") console.log("Error", error) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveMessage() {\r\n var messageText=document.querySelector('#messages').value;\r\n // Add a new message entry to the database.\r\n return firebase.firestore().collection('messages').add({\r\n name: getUserName(),\r\n text: messageText,\r\n timestamp: firebase.firestore.FieldValue.serverTimesta...
[ "0.6733934", "0.662166", "0.6495439", "0.6400428", "0.6385696", "0.63745075", "0.63645226", "0.6342867", "0.6319282", "0.6280721", "0.62644607", "0.6247478", "0.6232485", "0.6200354", "0.61870265", "0.6154529", "0.6116404", "0.60997707", "0.60560155", "0.6051118", "0.6018941"...
0.64417624
3
This function determines which browser we're using to return an element
function getElement(strID) { if( document.getElementById ) // this is the way the standards work elem = document.getElementById( strID ); else if( document.all ) // this is the way old msie versions work elem = document.all[strID]; else if( document.layers ) // this is the way nn4 works elem = document.layers[strID]; return elem; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function css_browser_selector(e){var r=e.toLowerCase(),i=function(e){return r.indexOf(e)>-1},t=\"gecko\",o=\"webkit\",a=\"safari\",n=\"chrome\",s=\"opera\",d=\"mobile\",c=0,l=window.devicePixelRatio?(window.devicePixelRatio+\"\").replace(\".\",\"_\"):\"1\",w=[!/opera|webtv/.test(r)&&/msie\\s(\\d+)/.test(r)&&(c=1*R...
[ "0.682229", "0.6810615", "0.6802035", "0.6741857", "0.6722031", "0.6676667", "0.6676667", "0.6676667", "0.6676667", "0.6676667", "0.6676667", "0.65737", "0.65662515", "0.6542284", "0.6531858", "0.651296", "0.65059215", "0.64988446", "0.64570963", "0.6447598", "0.6441816", "...
0.0
-1
Creates the menu inside the menu DIV tag in the template
function CreateMenu() { var strMenu; strMenu = '<nav class="navbar navbar-expand-lg">\n' strMenu += '<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">\n' strMenu += ' <span class="navbar-toggler-icon"></span>\n' strMenu += '</button>\n' strMenu += '<div class="collapse navbar-collapse" id="navbarNav">\n' strMenu += ' <ul class="navbar-nav">\n' strMenu += ' <li class="nav-item"><a class="nav-link" id="l_Index" href="index.html">Welcome</a></li>\n' strMenu += ' <li class="nav-item dropdown">\n' strMenu += ' <a class="nav-link dropdown-toggle" id="HomeDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Club Information</a>\n' strMenu += ' <div class="dropdown-menu" aria-labelledby="HomeDropdownMenuLink">\n' strMenu += ' <a class="dropdown-item" id="l_history" href="history.htm">Club history</a>\n' strMenu += ' <a class="dropdown-item" id="l_location" href="location.htm">Location</a>\n' strMenu += ' <a class="dropdown-item" id="l_schedule" href="schedule.htm">Schedule</a>\n' strMenu += ' <a class="dropdown-item" id="l_faq" href="faq.htm">FAQ </a>\n' strMenu += ' <a class="dropdown-item" id="l_rules" href="rules.htm">Range safety</a>\n' strMenu += ' </div>\n' strMenu += ' </li>\n' strMenu += ' <li class="nav-item dropdown">\n' strMenu += ' <a class="nav-link dropdown-toggle" id="MembershipDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Membership</a>\n' strMenu += ' <div class="dropdown-menu" aria-labelledby="MembershipDropdownMenuLink">\n' strMenu += ' <a class="dropdown-item" id="l_membership" href="membership.htm">Info</a>\n' strMenu += ' <a class="dropdown-item" id="l_forms" href="forms.htm">Forms</a>\n' strMenu += ' </div>\n' strMenu += ' </li>\n' strMenu += ' <li class="nav-item dropdown">\n' strMenu += ' <a class="nav-link dropdown-toggle" id="MembershipDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Links</a>\n' strMenu += ' <div class="dropdown-menu" aria-labelledby="MembershipDropdownMenuLink">\n' strMenu += ' <a class="dropdown-item" id="l_shows" href="shows.htm">Shows & Auctions </a>\n' strMenu += ' <a class="dropdown-item" id="l_links" href="links.htm">Shooting links</a>\n' strMenu += ' </div>\n' strMenu += ' </li>\n' strMenu += ' <li class="nav-item"><a class=" nav-link" id="l_events" href="calendar.htm">CALENDAR</a></li>\n' strMenu += ' <li class="nav-item"><a class=" nav-link" id="l_news" href="news.htm">News</a></li>\n' strMenu += ' <li class="nav-item dropdown">\n' strMenu += ' <a class="nav-link dropdown-toggle" id="FacilitiesDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Facilities</a>\n' strMenu += ' <div class="dropdown-menu" aria-labelledby="FacilitiesDropdownMenuLink">\n' strMenu += ' <a class="dropdown-item" id="l_indoors" href="indoors.htm">Indoors </a>\n' strMenu += ' <a class="dropdown-item" id="l_outdoors" href="outdoors.htm">Outdoor </a>\n' strMenu += ' <a class="dropdown-item" id="l_courses" href="courses.htm">Courses </a>\n' strMenu += ' <a class="dropdown-item" id="l_property" href="propertymap.htm">Property map </a>\n' strMenu += ' </div>\n' strMenu += ' </li>\n' strMenu += ' <li class="nav-item dropdown">\n' strMenu += ' <a class="nav-link dropdown-toggle" id="SectionsDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Sections</a>\n' strMenu += ' <div class="dropdown-menu" aria-labelledby="SectionsDropdownMenuLink">\n' strMenu += ' <a class="dropdown-item" id="l_junior" href="junior.htm">Junior program </a>\n' strMenu += ' <a class="dropdown-item" id="l_archery" href="archery.htm">Archery </a>\n' strMenu += ' <a class="dropdown-item" id="l_smallbore" href="smallbore.htm">Smallbore rifles </a>\n' strMenu += ' <a class="dropdown-item" id="l_handgun" href="handgun.htm">Handguns </a>\n' strMenu += ' </div>\n' strMenu += ' </li>\n' strMenu += ' <li class="nav-item"><a class="nav-link" href="board/index.php" target="new">Message Board</a></li>\n' strMenu += ' <li class="nav-item"><a class="nav-link" id="l_contact" href="contact.htm">Contact us </a></li>\n' strMenu += ' </ul>\n' strMenu += '</div>\n' strMenu += '</nav>\n' // Add the menu to the DOM $("#menu").append(strMenu); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateMenu() {\n var menu = document.createElement(\"div\");\n menu.id = \"menu\";\n document.body.appendChild(menu);\n generatePalette();\n generateDropdown(canvassize);\n generateDropdown(brushsize);\n generateDropdown(bordertype);\n generateDropdown(fillClear);\n generateTe...
[ "0.7167672", "0.71373665", "0.6924547", "0.68868846", "0.6880381", "0.6853097", "0.6847263", "0.6817325", "0.68069917", "0.66916764", "0.6687472", "0.6681733", "0.6654736", "0.66506773", "0.66501856", "0.66487765", "0.664683", "0.66046715", "0.6602675", "0.660057", "0.660057"...
0.61204463
68
get first block with greater than or equal time to targetDate
async function getLeftmostBlock(left, right, targetDate) { if (left >= right) return right; let m = (left + right) >> 1; let block = await web3.eth.getBlock(m); // convert to ms first let date = new Date(block.timestamp * 1000); //console.log('LEFT: ', left, ' RIGHT: ', right, ' MID: ', m, ' DATE: ', date, ' TARGET: ', targetDate); if (date < targetDate) { return getLeftmostBlock(m + 1, right, targetDate); } else { return getLeftmostBlock(left, m, targetDate); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findFirstValidHold (currentAudioTime) {\n\n let listActiveHolds = this.activeHolds.asList() ;\n for ( var i = 0 ; i < listActiveHolds.length ; i++) {\n\n let step = listActiveHolds[i] ;\n\n if ( step !== null && step.beginHoldTimeStamp <= currentAudioTime) {\n r...
[ "0.58645713", "0.550507", "0.5480811", "0.54645824", "0.5345906", "0.5241293", "0.52398133", "0.5222808", "0.51976556", "0.5076727", "0.5051302", "0.4966554", "0.4961413", "0.49602956", "0.49491388", "0.49074468", "0.48900807", "0.48770028", "0.48598707", "0.4837624", "0.4836...
0.6291921
0
ajax request POST User authorization through SmartDoor
function user_request(payload) { $.ajax({ method: 'POST', // Add URL from API endpoint url: ' https://ccg20ezekb.execute-api.us-west-2.amazonaws.com/Prod/gain_access', dataType: 'json', contentType: 'application/json', data: JSON.stringify(payload), success: function (res) { var user_name = null; if (res) { message = 'The user was granted access through SmartDoor!'; console.log("res ====", res) // Override username value from API response - username user_name = res["user_name"]; console.log(user_name); } console.log(res); window.location.href = "../html/door.html?user_name=" + user_name; }, error: function (err) { let message_obj = JSON.parse(err.responseText); let message = message_obj.message.content; $('#answer').html('Error:' + message).css("color", "red"); console.log(err); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function login() {\n $.ajax({\n type: \"POST\",\n contentType: \"application/json\",\n url: \"http://localhost:8181/fabric/security/token\",\n dataType: \"json\",\n data: '{\"username\":\"' + getElementByIdValue(\"username\") + '\", \"password\":\"' + g...
[ "0.6590064", "0.652824", "0.6383094", "0.6260846", "0.6256753", "0.62122446", "0.6158254", "0.6145183", "0.6140794", "0.61346704", "0.6130776", "0.61147183", "0.6108653", "0.6082099", "0.6079462", "0.60789156", "0.6070891", "0.6060411", "0.60395044", "0.60038716", "0.598237",...
0.63398474
3
Renders an error message
function showError(msg) { const html = `<li><p class="error">${msg}</p></li>`; document.querySelector('#results').innerHTML = html; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _renderError(message) {\r\n el.email_input.addClass('error');\r\n el.email_error.text(message);\r\n }", "function renderErrorMessage() {\n return (\n <ErrorMessage message=\"The data couldn't be loaded!\" />\n );\n }", "_renderErrorText() {\n\t\treturn (\n\...
[ "0.7736125", "0.76653004", "0.7605062", "0.7235866", "0.71673214", "0.7074343", "0.7071793", "0.7070685", "0.70644355", "0.7006818", "0.7004977", "0.7003859", "0.6997686", "0.69584775", "0.6952036", "0.69118434", "0.69039357", "0.6850194", "0.68473405", "0.68387437", "0.68339...
0.670692
31
Searches for books and returns a promise that resolves a JSON list
function searchForBooks() { let search = document.querySelector('#search-bar').value; // save value of search bar const URL = 'https://www.googleapis.com/books/v1/volumes/?q='; // URL to search const maxResults = '&maxResults=10'; let searchGBooks = `${URL}${search}${maxResults}`; // google books api + search value // set up JSON request let request = new XMLHttpRequest(); request.open('GET', searchGBooks, true); request.onload = function() { if (request.status >= 200 && request.status < 400) { let data = JSON.parse(request.responseText); // Success! here is the JSON data render(data); } else { showError('No matches meet your search. Please try again'); // reached the server but it returned an error } }; request.onerror = function() { // There was a connection error of some sort }; request.send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static fetchBooksFromGoogle(searchInput){ //searchInput from Content.js\n return fetch(`https://www.googleapis.com/books/v1/volumes?q=${searchInput}`)\n .then(response => response.json())\n .then(json => {\n return json.items.map(item => this.createBook(item)) //returns an array of objects created fr...
[ "0.75175136", "0.7494004", "0.7488836", "0.73757017", "0.7338291", "0.72797626", "0.7185815", "0.7152663", "0.7123591", "0.7060718", "0.69794357", "0.6972407", "0.695269", "0.69059235", "0.6902264", "0.68974143", "0.68718773", "0.68557054", "0.6849961", "0.68407655", "0.67908...
0.70438933
10
}); checks if the checkbox is checked
function checkUser(user) { user.checked = !user.checked; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verificaCheckboxes(checkbox){\n\treturn checkbox == true;\n}", "function checkboxChecked(input) {\n if (input.checked){\n return true;\n } return false;\n}", "function isChecked($chkbx) {\n return $chkbx.is(':checked');\n}", "function checkRegisterForActivities() {\n\n const checkBoxes = $(...
[ "0.7582328", "0.7393126", "0.7355029", "0.7231854", "0.72032493", "0.71553993", "0.7020631", "0.7011731", "0.69948685", "0.6987756", "0.69863343", "0.6958427", "0.6926474", "0.6907392", "0.6819139", "0.6793804", "0.6745936", "0.6745936", "0.67210746", "0.66970086", "0.6690196...
0.64635587
51
checks if the home is checked
function checkHome(user) { user.home = !user.home; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pols_is_home(){\r\n\treturn (this.is_home || this.door_uid == 'home_interior' || this.door_uid == 'home_exterior') ? true : false;\r\n}", "function returnHomeDetection(){\n if (state === 'piano' || state === 'guitar'){\n if(mouseIsPressed){\n if (mouseX > 25 && mouseX < 75 &&\n mouseY > 25 &...
[ "0.7579653", "0.7010302", "0.69425005", "0.6913471", "0.6874251", "0.6720546", "0.6662882", "0.6454105", "0.6404019", "0.63230604", "0.63128626", "0.63128626", "0.63128626", "0.6297328", "0.6294323", "0.62893623", "0.6123589", "0.6112723", "0.6093868", "0.604046", "0.600343",...
0.75523907
1
checks if all fields are filled in correct and adds a shift
function addShifts() { var data = { selectedDates: [], shifts: [] }; vm.message = null; data.selectedDates = vm.selectedDates; if (data.selectedDates.length == 0) { vm.message = { 'title': 'No dates selected', 'content': 'Please select at least one date.', 'icon': 'fa-exclamation', 'type': 'alert-danger' } } else { for (var i = 0; i < vm.users.length; i++) { if (vm.users[i].checked) { data.shifts.push({ userId: vm.users[i].id, shiftId: vm.users[i].newShift, home: (vm.users[i].home == undefined) ? 0 : vm.users[i].home, description: vm.users[i].description }); } } if (data.shifts.length == 0) { vm.message = { 'title': 'No users selected', 'content': 'Please select at least one user.', 'icon': 'fa-exclamation', 'type': 'alert-danger' } } else { vm.dataLoading = true; Api.shifts.add(data).then(function () { vm.message = { 'title': 'Selected users are planned', 'content': 'The selected users are planned for the selected dates.', 'icon': 'fa-check', 'type': 'alert-success' }; for (var i = 0; i < vm.users.length; i++) { vm.users[i].checked = false; vm.users[i].newShift = null; vm.users[i].home = null; vm.users[i].description = null; } // Dirty hax, destroys datepicker and build it up again instead of clearing. datepicker.datepicker('destroy'); datepicker.datepicker({ multidate: true, todayHighlight: true, startDate: startDate }); }).finally(function () { vm.dataLoading = false; }); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "validate() {\n let posOfSpace = this.ins.indexOf(\" \");\n let operandRS = \"\";\n let operandRT = \"\";\n let operandRD = \"\";\n let SHAMT = \"\";\n if (this.operator == \"jr\") {\n operandRS = this.ins.substring(posOfSpace + 1, this.ins.length);\n }\n ...
[ "0.5441441", "0.53938884", "0.5322467", "0.5271386", "0.5195142", "0.51111794", "0.51102453", "0.5105889", "0.5055036", "0.50256604", "0.50220543", "0.49944246", "0.4986251", "0.4978929", "0.4972423", "0.4956473", "0.4892646", "0.4843977", "0.48373464", "0.48100588", "0.47943...
0.0
-1
Need to change days counter to hr,min,ss
render() { return !this.props.showPollStatsLoader && !this.props.showWrongAddressModal ? ( <Grid> <div className="pollstats-grid"> <Row> <Col xs={12} sm={12} md={12} lg={12}> <div className="poll-started-text">Poll started at</div> </Col> </Row> <Row> <Col xs={12} sm={6} md={8} lg={8}> <div className="voter-logic">{this.props.voterBaseLogic}</div> </Col> <Col xs={12} sm={6} md={4} lg={4}> <div className="poll-start-time">{new Date(parseInt(this.props.startTime) * 1000).toDateString()}</div> </Col> </Row> <Row> <Col lg={6}> <Popup hoverable on={["hover", "click"]} style={style} trigger={ <div onClick={this.handleAllActivities} className="poll-name"> {this.props.pollName} </div> } content={<h1 className="large">View Activiy Log</h1>} position="top center" /> </Col> <Col lg={6} /> </Row> <Row className="poll-type-end"> <Col xs={12} sm={6} md={6} lg={6}> <div className="poll-type">{this.props.pollType}</div> </Col> <Col xs={12} sm={6} md={6} lg={6}> <div className="poll-end"> {new Date().getTime() > new Date(parseInt(this.props.endTime) * 1000).getTime() ? ( <div>Ended on {new Date(parseInt(this.props.endTime) * 1000).toDateString()}</div> ) : ( <div className="poll-ends-in"> Poll ends in: {Math.ceil((new Date(parseInt(this.props.endTime) * 1000).getTime() - new Date().getTime()) / (1000 * 3600 * 24))}{" "} days </div> )} </div> </Col> </Row> <div className="proposals">{this.populateProposals()}</div> <Row> <Col lg={9} /> <Col lg={3}> <div> <Popup hoverable on={["hover", "click"]} style={style} position="top center" trigger={ <div onClick={this.handleAllDetailedVoters} className="total-voters"> Total Voters: {this.props.totalVoteCast} </div> } content={<h1 className="large">View All Voters</h1>} /> </div> </Col> </Row> {this.props.proposals.length > 1 ? ( <div> <Row> <Col xs={12} sm={12} md={12} lg={12}> <div className="poll-leader-text">Poll Leader</div> </Col> </Row> <Row> <Col xs={12} sm={12} md={12} lg={12}> <div className="poll-leader-vote-share"> <div className="poll-leader-name">{this.props.pollLeader.name}</div> <div className="vote-share">({this.props.pollLeader.percent}% Vote Share)</div> </div> </Col> </Row> </div> ) : ( <div> <Row> <Col xs={12} sm={12} md={12} lg={12}> <div className="poll-leader-text">Status</div> </Col> </Row> <Row> <Col xs={12} sm={12} md={12} lg={12}> <div className="poll-leader-vote-share"> <div className="poll-leader-name"> Consensus in favour of {this.props.pollLeader.name} is {this.props.pollLeader.percent}% </div> </div> </Col> </Row> </div> )} </div> </Grid> ) : ( <Loader active={this.props.showPollStatsLoader} /> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setCounter() {\n\n\t\tvar h = 0, m = 0, s = 0, d = 0, day = 0, ct = (new Date().getTime()/1000)|0;\n\n\t\tif (ut > ct) d = ut - ct;\n\t\telse d = ct - ut;\n\t\t\n\t\tday = Math.floor(d / 86400);\n\t\td -= day * 86400;\n\t\th = Math.floor(d / 3600);\n\t\td -= h * 3600;\n\t\tm = Math.floor(d / 60);\n\t\td -...
[ "0.74514526", "0.7045619", "0.69533354", "0.668919", "0.66706455", "0.6627813", "0.65582544", "0.6508881", "0.6508864", "0.6498927", "0.64893025", "0.64841175", "0.64326555", "0.63925225", "0.63925225", "0.63925225", "0.63925225", "0.6379587", "0.636687", "0.6353825", "0.6353...
0.0
-1
In practice, most of the dynamically generated GLSL code is generated in an arbitrary order, so check only that they have the same set of lines.
function expectEqualUnordered(array1, array2) { // slice in case other tests do expect lines in a particular order. expect(array1.slice().sort()).toEqual(array2.slice().sort()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "is_shader_generated() { return this.shader_generated }", "validate() {\n if (gl.getParameter(gl.CURRENT_PROGRAM) != this.shader_loc) {\n console.log(this.constructor.name +\n '.validate(): shader program at this.shader_loc not in use! ' + this.index);\n return false;\n }\n if (gl.getPar...
[ "0.62029237", "0.6187638", "0.60084486", "0.5905522", "0.57601327", "0.56836784", "0.56501", "0.5631212", "0.55574083", "0.55152416", "0.55132776", "0.55132776", "0.5507565", "0.5507565", "0.55067325", "0.5463627", "0.5441186", "0.54226273", "0.54219776", "0.5414715", "0.5402...
0.0
-1
Very similar to "hmacsignverify.html".
function testHmac() { var importAlgorithm = {name: 'HMAC', hash: {name: "SHA-256"}}; var algorithm = {name: 'HMAC'}; var key = null; var testCase = { hash: "SHA-256", key: "9779d9120642797f1747025d5b22b7ac607cab08e1758f2f3a46c8be1e25c53b8c6a8f58ffefa176", message: "b1689c2591eaf3c9e66070f8a77954ffb81749f1b00346f9dfe0b2ee905dcc288baf4a92de3f4001dd9f44c468c3d07d6c6ee82faceafc97c2fc0fc0601719d2dcd0aa2aec92d1b0ae933c65eb06a03c9c935c2bad0459810241347ab87e9f11adb30415424c6c7f5f22a003b8ab8de54f6ded0e3ab9245fa79568451dfa258e", mac: "769f00d3e6a6cc1fb426a14a4f76c6462e6149726e0dee0ec0cf97a16605ac8b" }; var keyData = hexStringToUint8Array(testCase.key); var usages = ['sign', 'verify']; var extractable = true; // (1) Import the key return crypto.subtle.importKey('raw', keyData, importAlgorithm, extractable, usages).then(function(result) { key = result; // shouldBe() can only resolve variables in global context. tmpKey = key; shouldEvaluateAsSilent("tmpKey.type", "secret"); shouldEvaluateAsSilent("tmpKey.extractable", true); shouldEvaluateAsSilent("tmpKey.algorithm.name", "HMAC"); shouldEvaluateAsSilent("tmpKey.algorithm.hash.name", testCase.hash); shouldEvaluateAsSilent("tmpKey.algorithm.length", keyData.length * 8); shouldEvaluateAsSilent("tmpKey.usages.join(',')", "sign,verify"); // (2) Sign. var signPromise = crypto.subtle.sign(algorithm, key, hexStringToUint8Array(testCase.message)); // (3) Verify var verifyPromise = crypto.subtle.verify(algorithm, key, hexStringToUint8Array(testCase.mac), hexStringToUint8Array(testCase.message)); // (4) Verify truncated mac (by stripping 1 byte off of it). var expectedMac = hexStringToUint8Array(testCase.mac); var verifyTruncatedPromise = crypto.subtle.verify(algorithm, key, expectedMac.subarray(0, expectedMac.byteLength - 1), hexStringToUint8Array(testCase.message)); var exportKeyPromise = crypto.subtle.exportKey('raw', key); return Promise.all([signPromise, verifyPromise, verifyTruncatedPromise, exportKeyPromise]); }).then(function(result) { // signPromise mac = result[0]; shouldEvaluateAsSilent("bytesToHexString(mac)", testCase.mac); // verifyPromise verifyResult = result[1]; shouldEvaluateAsSilent("verifyResult", true); // verifyTruncatedPromise verifyResult = result[2]; shouldEvaluateAsSilent("verifyResult", false); // exportKeyPromise exportedKeyData = result[3]; shouldEvaluateAsSilent("bytesToHexString(exportedKeyData)", testCase.key); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_verify(req) {\n const { query } = url.parse(req.url, true);\n const { signature, timestamp, nonce, echostr } = query;\n const $token = this.options.secret;\n let $tmpArr = [$token, timestamp, nonce];\n $tmpArr.sort();\n return sha1($tmpArr.join('')) === signature ? echostr : false;\n }", "fun...
[ "0.6751597", "0.647543", "0.6430366", "0.63804924", "0.63329715", "0.6276386", "0.6275959", "0.6228531", "0.6183792", "0.6110873", "0.61022156", "0.6099994", "0.60733587", "0.60629773", "0.6057935", "0.6057832", "0.6057832", "0.6057832", "0.6057832", "0.6057832", "0.6057832",...
0.55532944
52
Very similar to aesgcmencryptdecrypt.hml
function testAesGcm() { var testCase = { "key": "e03548984a7ec8eaf0870637df0ac6bc17f7159315d0ae26a764fd224e483810", "iv": "f4feb26b846be4cd224dbc5133a5ae13814ebe19d3032acdd3a006463fdb71e83a9d5d96679f26cc1719dd6b4feb3bab5b4b7993d0c0681f36d105ad3002fb66b201538e2b7479838ab83402b0d816cd6e0fe5857e6f4adf92de8ee72b122ba1ac81795024943b7d0151bbf84ce87c8911f512c397d14112296da7ecdd0da52a", "cipherText": "fda718aa1ec163487e21afc34f5a3a34795a9ee71dd3e7ee9a18fdb24181dc982b29c6ec723294a130ca2234952bb0ef68c0f3", "additionalData": "aab26eb3e7acd09a034a9e2651636ab3868e51281590ecc948355e457da42b7ad1391c7be0d9e82895e506173a81857c3226829fbd6dfb3f9657a71a2934445d7c05fa9401cddd5109016ba32c3856afaadc48de80b8a01b57cb", "authenticationTag": "4795fbe0", "plainText": "69fd0c9da10b56ec6786333f8d76d4b74f8a434195f2f241f088b2520fb5fa29455df9893164fb1638abe6617915d9497a8fe2" } var key = null; var keyData = hexStringToUint8Array(testCase.key); var iv = hexStringToUint8Array(testCase.iv); var additionalData = hexStringToUint8Array(testCase.additionalData); var tag = hexStringToUint8Array(testCase.authenticationTag); var usages = ['encrypt', 'decrypt']; var extractable = false; var tagLengthBits = tag.byteLength * 8; var algorithm = {name: 'aes-gcm', iv: iv, additionalData: additionalData, tagLength: tagLengthBits}; // (1) Import the key return crypto.subtle.importKey('raw', keyData, algorithm, extractable, usages).then(function(result) { key = result; // shouldBe() can only resolve variables in global context. tmpKey = key; shouldEvaluateAsSilent("tmpKey.type", "secret"); shouldEvaluateAsSilent("tmpKey.extractable", false); shouldEvaluateAsSilent("tmpKey.algorithm.name", "AES-GCM"); shouldEvaluateAsSilent("tmpKey.usages.join(',')", "encrypt,decrypt"); // (2) Encrypt var encryptPromise1 = crypto.subtle.encrypt(algorithm, key, hexStringToUint8Array(testCase.plainText)); var encryptPromise2 = crypto.subtle.encrypt(algorithm, key, hexStringToUint8Array(testCase.plainText)); // (3) Decrypt var decryptPromise1 = crypto.subtle.decrypt(algorithm, key, hexStringToUint8Array(testCase.cipherText + testCase.authenticationTag)); var decryptPromise2 = crypto.subtle.decrypt(algorithm, key, hexStringToUint8Array(testCase.cipherText + testCase.authenticationTag)); return Promise.all([encryptPromise1, encryptPromise2, decryptPromise1, decryptPromise2]); }).then(function(result) { // encryptPromise1, encryptPromise2 for (var i = 0; i < 2; ++i) { cipherText = result[i]; shouldEvaluateAsSilent("bytesToHexString(cipherText)", testCase.cipherText + testCase.authenticationTag); } // decryptPromise1, decryptPromise2 for (var i = 0; i < 2; ++i) { plainText = result[2 + i]; shouldEvaluateAsSilent("bytesToHexString(plainText)", testCase.plainText); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "decrypt(str, settings){}", "function decryptGCM(symmetricKey, ivCiphertextAndTag) {\n const nonce = ivCiphertextAndTag.slice(0, NONCE_LENGTH)\n const ciphertext = ivCiphertextAndTag.slice(NONCE_LENGTH, ivCiphertextAndTag.byteLength - TAG_LENGTH)\n const tag = ivCiphertextAndTag.slice(ivCiphertextA...
[ "0.6879715", "0.6825039", "0.67894393", "0.6679698", "0.6546314", "0.6526534", "0.6523418", "0.6516161", "0.64955986", "0.64946127", "0.6479674", "0.644804", "0.641649", "0.64088565", "0.6405323", "0.63804", "0.63498306", "0.63202995", "0.6318309", "0.6291316", "0.62765753", ...
0.63590515
16
creating Markers on Map
function createMarkers (urlArray) { let geoData // loop array with url's for (let i = 0; i < urlArray.length; i++) { let url = urlArray[i] // get data $.get(url, function (data) { // check if not empty if (data) { geoData = JSON.parse(data) } }).done(function () { let feature = new ol.Feature({ service_url: geoData.http.service_url, geo: geoData.http.geo, ip4: geoData.http.ip4, country: geoData.http.geo.country_name, geometry: new ol.geom.Point(ol.proj.transform([geoData.http.geo.longitude, geoData.http.geo.latitude], 'EPSG:4326', 'EPSG:3857')) }) // append Marker on map feature.setStyle(styleMk) sourceFeatures.addFeature(feature) }) } // cleare Marker layers sourceFeatures.clear() startChain(2) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createMarkers (map) {\n\n var businessTypes = Object.keys(hayward);\n \n businessTypes.forEach (function (businessType) {\n\n var names = Object.keys(hayward[businessType]);\n \n names.forEach (function (businessName) {\n var business = hayward[businessType][busine...
[ "0.7381819", "0.7243617", "0.6929383", "0.6908849", "0.6898605", "0.68026686", "0.6795299", "0.6765364", "0.67398953", "0.67398953", "0.67217696", "0.6693958", "0.6691036", "0.6678731", "0.6665427", "0.66634905", "0.6658071", "0.6655073", "0.6654939", "0.66483444", "0.6608947...
0.0
-1
show modal on click
function showModal (evt) { let feature = map.forEachFeatureAtPixel(evt.pixel, function (feature) { return feature }) if (feature) { $('#peer-list, #peer-list-cdn').empty(); let info = feature.N.geo.city + ', ' + feature.N.geo.country_name $('#service_url').val(feature.N.service_url) $('#modal-network').find('.ntw-country').text(info) $('#modal-network').find('.ntw-ip').text(feature.N.ip4).attr('data-ip',) let peerList = feature.N.service_url + '/api/v1/dht/peers' console.log(peerList) let peerData $.get(peerList, function (data) { // check if not empty if (data) { peerData = JSON.parse(data) } }).done(function () { for ( var i = 0; i < peerData.length; i++ ) { var img_src var block console.log(peerData[i]['profile'].is_cdn); if (!peerData[i]['profile'].is_cdn) { img_src = 'http://' + feature.N.ip4 + ':5678/api/cdn/v1/resource?hkey=' + peerData[i]['profile'].profilePicture + '&thumb=1' var firstName = 'DD';//peerData[i]['profile'].name.first; var lastName = 'SS';//peerData[i]['profile'].name.last; block = `<div class="icon-box"><img src="${img_src}"/>${firstName} ${lastName}</div>` $('#peer-list').append(block) } else { block = `<div class="icon-box"><img src="../dist/img/cdn.svg" />CDN</div>` $('#peer-list-cdn').append(block) } } }) $("[data-target='#modal-network']").trigger('click'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openModal(e) {\n\tmodal.style.display = 'block'\n}", "function __BRE__show_modal(modal_id){$('#'+modal_id).modal('show');}", "function show_modal() {\n \t$('#promoModal').modal();\n }", "function orderCancleButtonClick() {\n $('#orderCancleModal').modal('show');\n}", "function openModal() {\n ...
[ "0.76985043", "0.76886654", "0.7666412", "0.76051325", "0.7592899", "0.7592899", "0.758097", "0.75543857", "0.7552299", "0.7536714", "0.7496239", "0.7483721", "0.7452537", "0.74288845", "0.7427205", "0.7420433", "0.74037445", "0.7397931", "0.7393442", "0.7377108", "0.73584586...
0.0
-1
show tooltip on hover
function displayTooltip (evt) { let feature = map.forEachFeatureAtPixel(evt.pixel, function (feature) { return feature }) tooltip.style.display = feature ? '' : 'none' if (feature) { let info = feature.N.geo.city + ', ' + feature.N.geo.country_name overlay.setPosition(evt.coordinate) $(tooltip).text(info) jTarget.css("cursor", 'pointer') } else { jTarget.css("cursor", '') } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mouseOver() {\n\t\ttooltip.style(\"display\", \"block\")\n\t\t\t .style(\"visibility\", \"visible\");\n\t}", "function mouseOver() {\n tooltip\n .style(\"opacity\", 1)\n .style(\"display\",\"inherit\");\n}", "function tooltip_show(rootNode)\n \t\t\t\t{\n \t\t\t\t\tglobal_hover...
[ "0.8077092", "0.76973206", "0.7595864", "0.7559085", "0.75526476", "0.7548938", "0.75137186", "0.7444444", "0.74397117", "0.7409592", "0.7401991", "0.73924196", "0.73853153", "0.7355257", "0.7335925", "0.73334634", "0.7298164", "0.7296399", "0.7286857", "0.72673696", "0.72440...
0.0
-1
_Bonus_: It seems some of the directors had directed multiple movies so they will pop up multiple times in the array of directors. How could you "clean" a bit this array and make it unified (without duplicates)?
function getAllDirectors (array) { return array.map (allDirectors => allDirectors.director) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUniqueDirectors(array) {\n\n const uniqueDirectors = array.map(movie => movie.director);\n let uniqueDirectorsArray = uniqueDirectors.filter((director, index) => uniqueDirectors.indexOf(director) === index)\n return uniqueDirectors;\n\n}", "function removeDuplicates(moviesArray) {\n let all...
[ "0.7698366", "0.7620447", "0.71124375", "0.707752", "0.6968643", "0.68777215", "0.6743857", "0.65551466", "0.6396464", "0.6231454", "0.6191006", "0.6040082", "0.6014061", "0.60026777", "0.59700394", "0.5928939", "0.59099823", "0.5888402", "0.58680964", "0.58316684", "0.582787...
0.5867437
19
Iteration 2: Steven Spielberg. The best? How many drama movies did STEVEN SPIELBERG direct?
function howManyMovies (array) { return array.filter (dramaMovies => dramaMovies.director === "Steven Spielberg" && dramaMovies.genre.includes ("Drama")).length }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function howManyMovies(movies){\n if (movies == 0){}\n else {\n var dramaFilms = [];\n for (var i = 0; i < movies.length; i++){\n for (var j = 0; j < movies[i].genre.length; j++){\n if (movies[i].genre[j] === 'Drama'){\n dramaFilms.push(movies[i])\n }\n }\n}\n var stevenFilms = dramaFilms.filter(...
[ "0.6615484", "0.64351207", "0.63925946", "0.63720953", "0.6357477", "0.6347654", "0.63275844", "0.63090986", "0.630258", "0.62725097", "0.6258774", "0.6219019", "0.6214817", "0.6191437", "0.6177101", "0.61580884", "0.6133858", "0.6133687", "0.61111766", "0.6110609", "0.610506...
0.5766323
74
Iteration 3: All rates average Get the average of all rates with 2 decimals
function ratesAverage (array) { if (array.length === 0) { return 0 } else { const averageRate = array.reduce ((accumulator, current) => { if (!current.rate) { return accumulator + 0 } return accumulator + current.rate }, 0) return Number ((averageRate / array.length).toFixed(2)) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ratesAverage(arr) {\n var allRates = arr.reduce(function(acc, elem) {\n return (acc += Number(elem.rate));\n }, 0);\n return parseFloat((allRates / arr.length).toFixed(2));\n}", "function ratesAverage(arr) {\n let temp = arr.reduce(function(cont, obj) {\n return cont + Number(obj.rate);\n ...
[ "0.80671453", "0.79506344", "0.7947648", "0.79257774", "0.7885511", "0.788022", "0.7833778", "0.7827568", "0.7827149", "0.77844524", "0.7758602", "0.77556115", "0.7735074", "0.77064794", "0.77026415", "0.76865137", "0.7682448", "0.7655551", "0.7654449", "0.76507545", "0.76499...
0.7599768
23
Iteration 4: Drama movies Get the average of Drama Movies
function dramaMoviesRate (array) { const dramaMoviesArray = array.filter (dramaMovies => dramaMovies.genre.includes ("Drama")) const totalDramaRate = dramaMoviesArray.reduce ((accumulator, current) => { if (!current.rate) { return accumulator + 0 } return accumulator + current.rate }, 0) if (dramaMoviesArray.length === 0) { return 0 } return Number ((totalDramaRate / dramaMoviesArray.length).toFixed(2)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateMovieAverage() {\n\tfor (let i = 0; i < movies.length; i++) {\n\t\tlet sumOfRatings = movies[i].ratings.reduce((a, b) => a + b, 0);\n\t\tmovies[i].average = sumOfRatings / movies[i].ratings.length;\n\t}\n}", "function dramaMoviesRate(movies) {\n let drama = movies.filter(function(elem){\n ...
[ "0.81957364", "0.8133081", "0.8052378", "0.80023414", "0.7962245", "0.79441017", "0.7880204", "0.7867686", "0.786345", "0.7804334", "0.7782986", "0.77755874", "0.77485806", "0.77287227", "0.7704139", "0.7699077", "0.76935977", "0.7687617", "0.76865757", "0.7664305", "0.764486...
0.0
-1
Iteration 5: Ordering by year Order by year, ascending (in growing order)
function orderByYear (array) { const yearsOrdered = array.slice().sort (function (a, b) { if (a.year > b.year) { return 1 } if (a.year < b.year) { return -1 } if (a.year === b.year) { if (a.title > b.title) { return 1 } if (a.title < b.title) { return -1 } } }) return yearsOrdered }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function orderByYear(someArr){\n const order = someArr.sort((a, b) => a.year > b.year ? 1 : -1)\n return order;\n}", "function orderByYear(arr) {\n let byYear = [...arr].sort((s1, s2) => {\n if (s1.year > s2.year) return 1;\n else return -1\n })\n return byYear\n}", "sortAlbumsYear...
[ "0.73930913", "0.72207165", "0.7199483", "0.7184372", "0.71712124", "0.7131323", "0.71258926", "0.7112834", "0.70953214", "0.7086341", "0.70824206", "0.70626515", "0.70470494", "0.7039376", "0.6998345", "0.6992632", "0.69889164", "0.6951553", "0.6943999", "0.6936583", "0.6920...
0.7076336
11
Iteration 6: Alphabetic Order Order by title and print the first 20 titles
function orderAlphabetically (array) { const sortedTitlesArray = array.map(movie => { return movie.title }).sort() if (sortedTitlesArray.length > 20) { let firstTwenty = [] for (let i=0; i < 20; i++) { firstTwenty.push(sortedTitlesArray[i]) } return firstTwenty } else { return sortedTitlesArray } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function orderAlphabetically(array){\n let titles = array.map(i=>i.title)\n if (array.length <= 20) {\n for (i = 0; i<array.length; i++) {\n console.log(titles.sort()[i]);\n }\n } else {\n for (i = 0; i<20; i++) {\n console.log(titles.sort()[i]);\n }\n }\n}", "fu...
[ "0.7854673", "0.781835", "0.76172966", "0.7562915", "0.75456494", "0.75414544", "0.75134784", "0.7492668", "0.7456303", "0.7399086", "0.7363743", "0.7331747", "0.7330319", "0.73057425", "0.7285872", "0.7259712", "0.72448254", "0.72349596", "0.72197604", "0.7199472", "0.719711...
0.69541353
58
Reset elements to their initial state.
reset() { arrayEach(this.elements, ui => ui.reset()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _reset () {\n _elements = [];\n }", "reset(){\n this.ended = false;\n this.elements = [];\n }", "function reset()\n\t\t{\n\t\t\t\n\t\t\tfor(var i=0;i<a;i++)\n\t\t\t{\n\t\t\t\tvar a1=$(element).find(\"#g\"+i).get(0);\n\t\t\t\t\n\t\t\t\tvar a2=$(element).find(\"#s\"+i).g...
[ "0.82190245", "0.73723614", "0.73670727", "0.7325234", "0.7169908", "0.71429116", "0.71264213", "0.71264213", "0.71236986", "0.71177864", "0.71028036", "0.71028036", "0.71028036", "0.71028036", "0.71022475", "0.70965993", "0.70843774", "0.70843774", "0.70525646", "0.7031606", ...
0.7656365
1
newEmployee = new Employee("Mauricio", "Cabrera", "4851356","06/28/1992", "45 St. Lanza, Sopocachi, LP", "61530245", "Programmer", "Systems Engineering"); new Employee("Luciana", "Diaz", "6524553","01/21/1988", "655 St. Carlos Medinacelli, San Miguel, LP", "79615302", "Programmer", "Systems Engineering"),
function EmploymentComponent(graphqlCrudService) { this.graphqlCrudService = graphqlCrudService; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Employee(id,firstName,lastName,title){\n this.id=id;\n this.firstName=firstName;\n this.lastName=lastName;\n this.title=title\n}", "function Employee(firstName, lastName, id, title, salary) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.id = id;\n this.title =...
[ "0.7673696", "0.7647592", "0.76313215", "0.7536549", "0.75345767", "0.7522685", "0.7522685", "0.7522511", "0.7521508", "0.75141406", "0.74753517", "0.74700046", "0.7468802", "0.7468523", "0.7442836", "0.7288481", "0.7284053", "0.72475547", "0.7201586", "0.71832836", "0.710605...
0.0
-1
Checking if confirm password box is the same as password box ///////
check() { if (this.state.signupmessage != "") { this.setState({"signupmessagevisible":"contents"}); } else { this.setState({"signupmessagevisible":"none"}); } if (this.state.loginmessage != "") { this.setState({"loginmessagevisible":"contents"}); } else { this.setState({"loginmessagevisible":"none"}); } if (this.state.confirmpasswordstatus != "") { this.setState({"confirmpasswordstatusvisible":"contents"}); } else { this.setState({"confirmpasswordstatusvisible":"none"}); } try { if (this.state.password === this.state.confirmpassword) { // Both blank if (this.state.password === "") { this.setState({confirmpasswordstatus: ""}); this.setState({signupmessage: ""}); } // Both the same else { this.setState({confirmpasswordstatus: ""}); } } else { this.setState({confirmpasswordstatus: "passwords do not match"}); } } catch (e) { console.log("Error") } if (!(this.state.password === "")) { this.setState({signupmessage:""}); var password = this.state.password; if (password.length < 8) { this.setState({signupmessage: "- Password must be at least 8 characters long\n"}); } var symbols = 0; var lowercase = 0; var uppercase = 0; var numbers = 0; for (var i=0; i<password.length; i++){ if ("abcdefghijklmnopqrstuvwxyz".includes(password[i])) { lowercase += 1; } else if ("ABCDEFGHIJKLMNOPQRSTUVWXYZ".includes(password[i])) { uppercase += 1; } else if ("1234567890".includes(password[i])) { numbers += 1; } else if ("!-_<>.&$£".includes(password[i])) { symbols += 1; } else { this.setState({signupmessage: this.state.signupmessage + "- Passwords may only contain letters, numbers and the following symbols: '!-_<>.&$£'\n"}); } } if (!((symbols > 0) && (lowercase > 0) && (uppercase > 0) && (numbers > 0))){ if (symbols == 0) { this.setState({signupmessage: this.state.signupmessage + "- Passwords must contain at least 1 allowed symbol: '!-_<>.&$£'\n"}); } if (lowercase == 0) { this.setState({signupmessage: this.state.signupmessage + "- Passwords must contain at least one lowercase letter\n"}); } if (uppercase == 0) { this.setState({signupmessage: this.state.signupmessage + "- Passwords must contain at least one uppercase letter\n"}); } if (numbers == 0) { this.setState({signupmessage: this.state.signupmessage + "- Passwords must contain at least one number\n"}); } } else if ((!(this.state.signupmessage === "Account creation error")) || (!(this.state.signupmessage === "") || (!(this.state.signupmessage === "Account already exists, try logging in")))){ this.setState({signupmessage: ""}); } } else if ((!(this.state.signupmessage === "Account creation error")) || (!(this.state.signupmessage === "") || (!(this.state.signupmessage === "Account already exists, try logging in")))){ //this.setState({signupmessage: ""}); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function confirmPassword(p1, p2 ){ if (p1.value && p1.value !== p2.value) {\n password2Ok = 0;\n showError(p2, \"Both passwords must match.\")\n} else if (p1.value && p1.value === p2.value) {\n password2Ok = 1;\n showSuccess(p2)\n}\n}", "function comparePassword() {\n\t\tvar newPassword = $(\"#txtNew...
[ "0.825452", "0.82242584", "0.81092644", "0.8101749", "0.80924803", "0.8092059", "0.80533576", "0.79814583", "0.79556125", "0.78751856", "0.7852896", "0.7852385", "0.7844596", "0.7840821", "0.7810496", "0.7810102", "0.7773194", "0.7763123", "0.77459764", "0.7736487", "0.772001...
0.0
-1
when the document is ready, then run main.js code
function initialize(){ // $ means jQuery // $('css or jquery selector') $('h1').css('color', 'red'); $('h1').css('font-size', '35px'); var currentH1Text = $('h1').text(); console.log(currentH1Text); $('h1').text('Welcome to JavaScript'); $('div').css('color', 'purple'); $('#d2').css('font-size', '24px'); $('#d3').css('background', 'yellow'); $('.c1').css('font-family', 'monospace'); $('.c1').text('Adam Thede'); $('.c1').css({'color': 'green', 'background-color': 'red'}).text('Germania'); var bgcolor = prompt('What background color do you want?'); $('#d3').css('background-color', bgcolor); var textd3 = prompt('What do you want the text in div 3 to be?'); $('#d3').text(textd3); var numPs = $('.cp').length; console.log(numPs); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callMain() {\n console.log(documentReady);\n if(documentReady>=1) {\n\n window.main && window.main();\n } else {\n documentReady+=1;\n }\n\n }", "function init() {\n //called when document is fully loaded; your \"main method\"\n}", "function mainCo...
[ "0.7603928", "0.75638664", "0.7359414", "0.730716", "0.7170651", "0.71284896", "0.70197076", "0.69391704", "0.692763", "0.6903614", "0.6875203", "0.68749505", "0.6855237", "0.6827818", "0.68195826", "0.67367786", "0.6597146", "0.65857714", "0.65451413", "0.653772", "0.6534618...
0.0
-1
when user clicks on logout => delete token from local storage
function handleLogoutClick(e) { e.preventDefault(); console.log("The link was clicked."); localStorage.clear(); window.location = "http://localhost:3000/"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function logout() {\n localStorage.removeItem(\"token\");\n}", "onLogout() {\n\t\tlocalStorage.removeItem('userToken');\n\t}", "logout() {\n localStorage.removeItem(\"token\");\n localStorage.removeItem(\"userName\");\n }", "logout() {\n localStorage.removeItem(\"id_token\");\n }", "logout() ...
[ "0.8866661", "0.87263083", "0.8692079", "0.86786264", "0.8630982", "0.8626936", "0.85571724", "0.8489406", "0.8469176", "0.84631497", "0.84571075", "0.8455713", "0.8357431", "0.8326805", "0.831313", "0.8222032", "0.8219754", "0.8192851", "0.8188027", "0.8186844", "0.8179761",...
0.0
-1
returns an array consisting of 'type' and any 'class' properties
function getClassList(type) { var classList = davinci.ve.metadata.queryDescriptor(type, 'class'); if (classList) { classList = classList.split(/\s+/); classList.push(type); return classList; } return [type]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getProperties (type) {\n\n}", "function classes() {\n var classes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n classes[_i] = arguments[_i];\n }\n return classes\n .map(function (c) { return c && typeof c === 'object' ? Object.keys(c).map(function (key) { return !!c...
[ "0.64413375", "0.63544554", "0.61874616", "0.6066649", "0.6019503", "0.5999366", "0.5942111", "0.594038", "0.5935475", "0.593419", "0.59158164", "0.5765498", "0.5745204", "0.5737128", "0.5726987", "0.5725635", "0.57159704", "0.56694007", "0.5654689", "0.5634892", "0.56270546"...
0.7040512
0
returns 'true' if any of the elements in 'classes' are in 'arr'
function containsClass(arr, classes) { return classes.some(function(elem) { return arr.indexOf(elem) !== -1; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hasClass (cls) {\r\n if (!cls) return false\r\n emptyArray.some.call({ 'a': 'asas' }, function (el) {\r\n console.log(el)\r\n })\r\n }", "anyHighlighted(arr) {\n\t\tfor (let i = 0; i < arr.length; i++) {\n\t\t\tif (arr[i])\n\t\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function valida...
[ "0.6747393", "0.648532", "0.6372377", "0.6261987", "0.6231514", "0.6092992", "0.6058115", "0.6042399", "0.60270303", "0.6022681", "0.6020663", "0.59999645", "0.59999645", "0.5996123", "0.59672314", "0.5953228", "0.59128493", "0.59070724", "0.59056646", "0.59056646", "0.589130...
0.83967656
0
Returns 'true' if the dropped widget is allowed as a child of the given parent.
function isAllowed(children, parent) { var parentType = parent instanceof davinci.ve._Widget ? parent.type : parent._dvWidget.type; var parentClassList, allowedChild = davinci.ve.metadata.getAllowedChild(parentType); // special case for HTML <body> if (parentType === "html.body") { allowedChild = ["ANY"]; } parentClassList = getClassList(parentType); // Cycle through children, making sure that all of them work for // the given parent. return children.every(function(child){ var isAllowedChild = allowedChild[0] !== "NONE" && (allowedChild[0] === "ANY" || containsClass(allowedChild, child.classList)); var isAllowedParent = child.allowedParent[0] === "ANY" || containsClass(child.allowedParent, parentClassList); return isAllowedChild && isAllowedParent; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function canDropOnWidget(element) {\n var targetWidget = viewmodel.getWidgetFromElementId(element.id);\n return draggedWidget && draggedWidget !== targetWidget && targetWidget.canHaveChildren;\n }", "isElementAllowed(parent, event) {\n if (this._overlayToIgnore?.size > 0) {\n ...
[ "0.712374", "0.66280293", "0.64605296", "0.6460221", "0.62799704", "0.62799704", "0.62799704", "0.6207811", "0.62066627", "0.6175943", "0.6142097", "0.61072016", "0.6022566", "0.59747666", "0.5956069", "0.59204423", "0.58989155", "0.58889574", "0.58308643", "0.5830085", "0.58...
0.67826295
1
Get a random hex color
function hexRandom() { var letters = '0123456789ABCDEF'; var color = '#'; for (var i = 0; i < 6; i++ ) { color += letters[Math.floor(Math.random() * 16)]; } return color; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRandomColorHex() {\n var hex = \"0123456789ABCDEF\",\n color = \"#\";\n for (var i = 1; i <= 6; i++) {\n color += hex[Math.floor(Math.random() * 16)];\n }\n return color;\n }", "function randomColor() {\n const hexa = '0123456789ABCDEF';\n let cor = '#';\n\n for (let index...
[ "0.85668033", "0.84949356", "0.8477566", "0.84574234", "0.84543955", "0.8441952", "0.8439629", "0.84316456", "0.83898795", "0.83860964", "0.83828336", "0.8363854", "0.8319679", "0.8310057", "0.83043873", "0.8287921", "0.82837385", "0.8279657", "0.826899", "0.8268499", "0.8266...
0.8333955
12
Get random transparent color
function rgbaRandom(){ var r = Math.floor(Math.random() * 255); var g = Math.floor(Math.random() * 255); var b = Math.floor(Math.random() * 255); var a = roundDecimal(Math.random(), 2); // Get a num between 0-1 and use 2 decimals return "rgba("+ r +","+ g +","+ b +","+ a +")"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomColor () {\nreturn Math.floor (Math.random() * 256) ;\n}", "function randColor() {\n return Math.floor(Math.random() * 256);\n}", "function randomColor(){\n return color3(Math.floor(Math.random()*256),\n Math.floor(Math.random()*256),\n Math.floor(Math.random(...
[ "0.8150127", "0.80947584", "0.7981961", "0.79687035", "0.7937515", "0.79124874", "0.7902498", "0.7884345", "0.788225", "0.7863379", "0.7803254", "0.7801668", "0.77953285", "0.7795316", "0.7788447", "0.7785807", "0.77852964", "0.77700734", "0.7752409", "0.77505213", "0.7747883...
0.7807199
10
Sets the global variables $rects and $origRectSpecs
function setConstants() { const wrapItems = ".image-analysis-wrapper .face-wrap, .image-analysis-wrapper .score-wrap, .image-analysis-wrapper .attribute-wrap, .image-analysis-wrapper .region-block, .image-analysis-wrapper .region-block .word-block .word-wrap"; $rects = jQuery(".image-analysis-wrapper .rectangle"); // Iterate over each rectangle and save the width, height, top position, // left position, closest stats block element, and position of the closest // stats block element to an object. Each object is then added to the // $origRectSpecs array for global use. $origRectSpecs = $rects.map(function () { closestWrapItems = jQuery(this).siblings(wrapItems); const stats = closestWrapItems.map(function () { return { origStatTop: jQuery(this).position().top || parseInt(jQuery(this).css("top")), origStatLeft: jQuery(this).position().left || parseInt(jQuery(this).css("left")) } }) return { origRectWidth: jQuery(this).width(), origRectHeight: jQuery(this).height(), origRectTop: jQuery(this).position().top || parseInt(jQuery(this).css("top")), // if the rect is on a tab that is currently not displayed it has a position of 0, so this check gets the css instead so we don't lose the value origRectLeft: jQuery(this).position().left || parseInt(jQuery(this).css("left")), statBlock: closestWrapItems[0], statPosition: stats[0] } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setup_rectangles(rects){\n let xScale = this.xScale;\n let yScale = this.yScale;\n let h = this.h;\n let y_pad = this.y_pad\n rects.attr(\"x\", function(d, i) {return xScale(i);})\n .attr(\"y\", function(d) {return yScale(d.mort_rate);})\n .attr(\"width\", x...
[ "0.63136405", "0.61685306", "0.61619914", "0.6012233", "0.5906206", "0.5901949", "0.58671635", "0.5807357", "0.57795286", "0.57289696", "0.5660493", "0.5648216", "0.55788183", "0.55577624", "0.5554394", "0.5548755", "0.55219686", "0.5506867", "0.5487357", "0.5412677", "0.5405...
0.5735856
9
Iterate over each rectangle saved in the global variable $rect and set the size and position to scale with the rendered image.
function adjustFaceWrap() { const ratioWidth = displayImage.width() / image.width; const ratioHeight = displayImage.height() / image.height; $rects.map(function (i) { const { origRectWidth, origRectHeight, origRectTop, origRectLeft, statPosition, statBlock } = $origRectSpecs[i]; jQuery(this).css({ "width": `${origRectWidth * ratioWidth}px`, "height": `${origRectHeight * ratioHeight}px`, "top": `${origRectTop * ratioHeight}px`, "left": `${origRectLeft * ratioWidth}px` }); if (statBlock) { jQuery(statBlock).css({ "top": `${statPosition.origStatTop * ratioHeight}px`, "left": `${statPosition.origStatLeft * ratioWidth}px` }); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set scale9Grid(rect) {\n if (this.$disp instanceof ScaleBitmap) {\n this.$disp.scale9Grid = rect;\n }\n }", "animateRectangles() {\n requestAnimationFrame(this.animateRectangles.bind(this));\n this.clearCanvas();\n this.rectangles.forEach(rect => rect.update(this.mouse....
[ "0.63539463", "0.6207321", "0.6199388", "0.6186508", "0.6179984", "0.60675913", "0.5999527", "0.5939361", "0.5938346", "0.5926946", "0.5893675", "0.58922666", "0.5866202", "0.578647", "0.578199", "0.57817686", "0.5768587", "0.57682097", "0.5749682", "0.57379705", "0.5718131",...
0.54756814
45
When the user clicks on the button, toggle between hiding and showing the dropdown content
function myMenu() { document.getElementById("myDropdown").classList.toggle("show"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dropDownShowClick(){\n document.getElementById(\"forDropDown\").style.display=\"block\";\n document.getElementById(\"dropDownShowBtn\").style.display=\"none\";\n document.getElementById(\"dropDownHideBtn\").style.display=\"block\";\n}", "function btn_show() {\n document.getElementById(\"drop...
[ "0.78088385", "0.7671879", "0.74918294", "0.73910683", "0.7350857", "0.73457146", "0.7332308", "0.7264288", "0.72625244", "0.7242689", "0.72131056", "0.72122794", "0.7175608", "0.71719986", "0.71553904", "0.7151304", "0.7146252", "0.71220434", "0.71034634", "0.7098101", "0.70...
0.0
-1
! vuex v3.5.1 (c) 2020 Evan You
function n(t){var e=Number(t.version.split(".")[0]);if(e>=2)t.mixin({beforeCreate:i});else{var n=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[i].concat(t.init):i,n.call(this,t)}}function i(){var t=this.$options;t.store?this.$store="function"===typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFieldVuex() {\n return store.getters.dataField;\n }", "getProfileVuex() {\n return store.getters.dataProfile;\n }", "function vuexInit(){var options=this.$options;// store injection\n\tif(options.store){this.$store=options.store;}else if(options.parent&&options.parent.$store){this.$store=options.par...
[ "0.67587286", "0.67122144", "0.6688526", "0.6349349", "0.6322197", "0.6264196", "0.6259897", "0.6259897", "0.6259897", "0.62497246", "0.61534715", "0.6144857", "0.6078976", "0.6071553", "0.6071553", "0.6071553", "0.6071553", "0.6071553", "0.60639966", "0.60370344", "0.6036347...
0.0
-1
! vuerouter v3.3.4 (c) 2020 Evan You
function i(t,e){0}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "function jj(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "private internal function m248() {}", "func...
[ "0.6006168", "0.5910948", "0.58579415", "0.58024395", "0.5760202", "0.572362", "0.56569654", "0.5647048", "0.5646177", "0.56405777", "0.562393", "0.55948853", "0.5549056", "0.5530102", "0.5519", "0.54926825", "0.54880124", "0.5483679", "0.5471095", "0.54508156", "0.5450005", ...
0.0
-1