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
Collapse elements mentioned in the cookie while the page is loading. Mark the first entry as selected for keyboard navigation, once it appear. Maintain running updates of total/new posts in the corner.
function initialUpdate() { var entries = getEntries(); /* When the first entry appears, mark it as selected for keyboard * navigation */ if (entries.length > 0 && g_prev_entries.length == 0) addClass(entries[g_cur_entry], 'current'); /* Collapse entries that should be collapsed. */ for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadCookie() {\n var collapsed = {};\n var cookies = document.cookie.split(\";\");\n for (var i = 0; i < cookies.length; i++) {\n var parts = cookies[i].trim().split(\"=\");\n if (parts[0] == \"collapse\") {\n var ids = unescape(parts[1]).split(\",\");\n for (v...
[ "0.60948575", "0.5919216", "0.569174", "0.5623394", "0.55462873", "0.5479918", "0.5470116", "0.5461947", "0.5458261", "0.5443237", "0.5436238", "0.5377876", "0.5376868", "0.5356942", "0.5352709", "0.5345709", "0.533878", "0.5291178", "0.5289737", "0.52862483", "0.5281764", ...
0.583213
2
Collapse elements mentioned in the cookie when the page finishes loading.
function onLoadHook() { g_finished_loading = true; initialUpdate(); g_initial_collapsed = {}; g_prev_entries = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadCookie() {\n var collapsed = {};\n var cookies = document.cookie.split(\";\");\n for (var i = 0; i < cookies.length; i++) {\n var parts = cookies[i].trim().split(\"=\");\n if (parts[0] == \"collapse\") {\n var ids = unescape(parts[1]).split(\",\");\n for (v...
[ "0.7385396", "0.6457774", "0.6046314", "0.6019962", "0.5980526", "0.5948199", "0.59244764", "0.5902356", "0.5693372", "0.56654406", "0.5656467", "0.55937207", "0.5570931", "0.55219024", "0.5518221", "0.5502435", "0.5490827", "0.54314274", "0.5427106", "0.54198104", "0.5419005...
0.0
-1
Save the cookie (if a save was queued) when the user closes the window or navigates away.
function onUnloadHook() { if (g_save_queued) { performQueuedSaveCookie(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "save() {\n for(const name in this.cookie)\n if (this.cookie[name] !== 'undefined')\n document.cookie = `${name} = ${this.cookie[name]}; expires = ${this.cookie.expires}`;\n }", "function queueSaveCookie() {\n if (g_save_queued) {\n return;\n }\n g_save_queued =...
[ "0.7113413", "0.6885218", "0.65199685", "0.64894027", "0.6459288", "0.64154", "0.6362265", "0.6332788", "0.6314324", "0.6307548", "0.62361413", "0.6226383", "0.6213291", "0.6188276", "0.61771256", "0.6146256", "0.61330056", "0.6091983", "0.60656106", "0.60466224", "0.6041762"...
0.72477657
0
initialize arrays for given spline dimensions.
constructor(numPoles, poleLength, order, knots) { this.knots = knots; this.packedData = new Float64Array(numPoles * poleLength); this.poleLength = poleLength; this.basisBuffer = new Float64Array(order); this.poleBuffer = new Float64Array(poleLength); this.basisBuffer1 = n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init(size) {\r\n positions = new Array(size);\r\n // y: row\r\n // x: column\r\n // This 2-dimentional array is initialized by column (x position)\r\n for (var x = 0; x < size; ++x) {\r\n positions[x] = new Array(size);\r\n for (var y = 0; y < positions[x].length;...
[ "0.60298574", "0.586861", "0.56523967", "0.5501199", "0.5494168", "0.54237175", "0.5416828", "0.53670603", "0.5367013", "0.5366944", "0.53441614", "0.53366166", "0.5335845", "0.5311298", "0.53026515", "0.52596194", "0.52287424", "0.52105296", "0.5201148", "0.51776874", "0.516...
0.50130963
35
sum poles by the weights in the basisBuffer, using poles for given span
sumPoleBufferForSpan(spanIndex) { this.poleBuffer.fill(0); let k = spanIndex * this.poleLength; for (const f of this.basisBuffer) { for (let j = 0; j < this.poleLength; j++) { this.poleBuffer[j] += f * this.packedData[k++]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sumPoleBuffer1ForSpan(spanIndex) {\n this.poleBuffer1.fill(0);\n let k = spanIndex * this.poleLength;\n for (const f of this.basisBuffer1) {\n for (let j = 0; j < this.poleLength; j++) {\n this.poleBuffer1[j] += f * this.packedData[k++];\n }\n }\n ...
[ "0.71313924", "0.69257593", "0.52483165", "0.5209927", "0.5198686", "0.5137656", "0.5083524", "0.5047203", "0.5019228", "0.500634", "0.4927877", "0.49019215", "0.48845392", "0.48623922", "0.48623922", "0.48623922", "0.48623922", "0.48623922", "0.48623922", "0.48623922", "0.48...
0.74610317
0
sum poles by the weights in the basisBuffer, using poles for given span
sumPoleBuffer1ForSpan(spanIndex) { this.poleBuffer1.fill(0); let k = spanIndex * this.poleLength; for (const f of this.basisBuffer1) { for (let j = 0; j < this.poleLength; j++) { this.poleBuffer1[j] += f * this.packedData[k++]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sumPoleBufferForSpan(spanIndex) {\n this.poleBuffer.fill(0);\n let k = spanIndex * this.poleLength;\n for (const f of this.basisBuffer) {\n for (let j = 0; j < this.poleLength; j++) {\n this.poleBuffer[j] += f * this.packedData[k++];\n }\n }\n }",...
[ "0.7463142", "0.69272876", "0.52510196", "0.52097577", "0.52018565", "0.5137969", "0.50858444", "0.50465685", "0.5020988", "0.50075173", "0.49289995", "0.49012485", "0.48850095", "0.48642284", "0.48642284", "0.48642284", "0.48642284", "0.48642284", "0.48642284", "0.48642284", ...
0.71328515
1
sum poles by the weights in the basisBuffer, using poles for given span
sumPoleBuffer2ForSpan(spanIndex) { this.poleBuffer2.fill(0); let k = spanIndex * this.poleLength; for (const f of this.basisBuffer2) { for (let j = 0; j < this.poleLength; j++) { this.poleBuffer2[j] += f * this.packedData[k++]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sumPoleBufferForSpan(spanIndex) {\n this.poleBuffer.fill(0);\n let k = spanIndex * this.poleLength;\n for (const f of this.basisBuffer) {\n for (let j = 0; j < this.poleLength; j++) {\n this.poleBuffer[j] += f * this.packedData[k++];\n }\n }\n }",...
[ "0.74616766", "0.71317554", "0.5251788", "0.5211009", "0.52022886", "0.5138692", "0.5086589", "0.5046977", "0.50211746", "0.50088376", "0.49300987", "0.49020252", "0.48834145", "0.48629177", "0.48629177", "0.48629177", "0.48629177", "0.48629177", "0.48629177", "0.48629177", "...
0.6925986
2
Test if the leading and trailing polygon coordinates are replicated in the manner of a "closed" bspline polygon which has been expanded to act as a normal bspline.
testCloseablePolygon() { const degree = this.degree; const blockSize = this.poleLength; const indexDelta = (this.numPoles - this.degree) * blockSize; const data = this.packedData; const numValuesToTest = degree * blockSize; for (let i0 = 0; i0 < numValuesToTest; i0++) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function d3_geom_polygonClosed(coordinates) {\n var a = coordinates[0],\n b = coordinates[coordinates.length - 1];\n return !(a[0] - b[0] || a[1] - b[1]);\n}", "function isPolystripe( coords ) {\n var baseline = $(coords).siblings('.Baseline');\n if ( ! $(coords).hasClass('Coords') ||\n ...
[ "0.6438731", "0.6177839", "0.5977544", "0.59692496", "0.5924494", "0.5849113", "0.58455175", "0.58317447", "0.58271694", "0.58156425", "0.58102673", "0.58102673", "0.58102673", "0.58102673", "0.5808537", "0.5791589", "0.5791589", "0.5791589", "0.57679135", "0.5759955", "0.575...
0.6739229
0
Compare two arrays and return a new array with any items only ja found in one of the two given arrays, but not both. In other words, return the symmetric difference of the two arrays.
function diffArray(arr1, arr2) { var newArr = []; for (var i = 0; i < arr1.length; i++) { if (arr2.indexOf(arr1[i]) == -1) { // -1 this just make sure it iterates through all of the index newArr.push(arr1[i]); } } for (var j = 0; j < arr2.length; j++) { if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrayDiff(a, b) {\n\treturn a.filter(ar => !b.includes(ar));\n}", "function arrayDiff(a, b) {\n return a.filter((el) => !b.includes(el));\n}", "function diffArray(arr1, arr2) {\n var newArr = [];\n // Same, same; but different.\n let symmetricDiff = arr1\n .filter(x => !arr2.includes(x))\n ....
[ "0.80780816", "0.80559677", "0.79145974", "0.7887139", "0.7852734", "0.7824016", "0.7811168", "0.77241814", "0.76712096", "0.76408756", "0.763747", "0.76266545", "0.760745", "0.7602067", "0.75968236", "0.75899786", "0.7554206", "0.75415903", "0.75143343", "0.75143343", "0.751...
0.0
-1
PREGUNTA 4 Y 5
function armarCajas(e) { e.preventDefault(); let div = ""; numero = document.getElementById("numero").value; if (numero === "") { alert("Introduzca un numero"); } else { for (let i = 0; i < numero; i++) { div += `<input type="number" id="numero${i}"><br><br>`;//i para que se lo asisge un id desferente en ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get y() { return init.h - inProptn(1, 7) * 1.5; }", "function punto_y(){\n var y;\n y = height / 5;\n\n return(y);\n}", "function pazymiuVidurkis(q,w,e,r,t) {\n var atsakymas = (q+w+e+r+t)/5;\n console.log(atsakymas);\n}", "y1(t) {\n return (\n Math.cos(t / 10) * -125 + Math.cos(t / 20) * 125 ...
[ "0.6204033", "0.58735895", "0.5865021", "0.580641", "0.5636231", "0.5634093", "0.5620989", "0.558945", "0.5578705", "0.5568968", "0.5565815", "0.55656683", "0.55596673", "0.55504423", "0.5550142", "0.5539206", "0.5529994", "0.5529994", "0.5529994", "0.5529994", "0.55069673", ...
0.0
-1
Shorthand for can afford on luna
function lunaAfford(name) { return () => getCanAfford(teams["player"].resources, getCost(name, luna)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set Restricted(value) {}", "get Restricted() {}", "allow() {\n throw new Error(\"Not implemented.\");\n }", "function Mu(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype...
[ "0.517425", "0.51730454", "0.51566184", "0.51007587", "0.50740755", "0.50598097", "0.5024592", "0.49801397", "0.49800998", "0.49714917", "0.4872558", "0.48071438", "0.48071438", "0.48071438", "0.4782942", "0.47660223", "0.47651422", "0.47630504", "0.4736567", "0.4729928", "0....
0.64714193
0
At any time when there are no messages! A great loophole for ordered monologue. Done in order of the array
function quiet() { return $("#status-centered").is(":empty"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loopOverMessages() {\n renderMessages(messagesToRender);\n messagesToRender.pop();\n messagesToRender.unshift(messages[(lastIndex + 1) % messages.length]);\n lastIndex += 1;\n }", "function shiftMessage() {\n for (i = 0; i < messageCount - 2; i++) messages[i] = messages[i + 1...
[ "0.592388", "0.5885009", "0.5752718", "0.5752123", "0.57155055", "0.570162", "0.56980044", "0.564649", "0.5618842", "0.55652255", "0.5523288", "0.5513504", "0.54863566", "0.5423269", "0.5421191", "0.53412", "0.5336266", "0.5304378", "0.5292877", "0.52886623", "0.5284851", "...
0.0
-1
random color for the screen output
function randomColor() { colors = ["red", "yellow", "blue", "green"]; return colors[Math.floor(Math.random() * 7)]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randColor()\n {\n return '#'+ Math.floor(Math.random()*16777215).toString(16);\n }", "function randomColor() {\n\t\treturn \"#\"+(0x1000000+(Math.random())*0xffffff).toString(16).substr(1,6);\n\t}", "function randomColor () {\nreturn Math.floor (Math.random() * 256) ;\n}", "...
[ "0.8434453", "0.82657427", "0.8240342", "0.82208395", "0.82090527", "0.81823176", "0.81432736", "0.81365484", "0.8123689", "0.812149", "0.811689", "0.811403", "0.8070864", "0.8055447", "0.805303", "0.8051039", "0.80503255", "0.80352104", "0.80339897", "0.8032485", "0.8028234"...
0.782892
68
for add an animation when the player press any buttton
function animatedButton(button) { var activeButton = document.querySelector("." + button) activeButton.classList.add('pressed'); setTimeout(() => { activeButton.classList.remove('pressed'); }, 100) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onClick () {\n\n play =! play;\n\tif(play){\n\t\tbutton.setFrames(0,0,1);\n\t}else{\n\t\tbutton.setFrames(1,1,0);\n\t}\n}", "function clickHandler() {\r\n\r\n playerJumpAnim();\r\n}", "playOnClick() {\n const anim = Math.floor(Math.random() * this.possibleAnims.length) + 0;\n this.playModi...
[ "0.7010743", "0.69917524", "0.69701135", "0.6867088", "0.68637776", "0.68539697", "0.6769389", "0.6752998", "0.6728987", "0.67264485", "0.67058057", "0.66552824", "0.6653898", "0.6617657", "0.6617618", "0.6569421", "0.6555546", "0.6550414", "0.65465635", "0.6517968", "0.64975...
0.0
-1
A InfiniteCylinder3D is a 3D line with a radius. axis: BoundVector3D. r: radius of the cylinder.
function InfiniteCylinder3D( x , y , z , nx , ny , nz , r ) { this.axis = new BoundVector3D( x , y , z , nx , ny , nz ).normalizeCheck() ; this.r = + r ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cylinder(radius, height) { \n this.radius = radius;\n this.height = height;\n}", "function cylinder(scene, height, br, tr, stacks, slices) {\n \tCGFobject.call(this,scene);\n\t\n\tthis.height = height;\n\tthis.br = br;\n\tthis.tr = tr;\n\tthis.slices=slices;\n\tthis.stacks=stacks;//+1;\n\t\n \...
[ "0.6007653", "0.5907317", "0.5730767", "0.5629042", "0.5564232", "0.5554305", "0.5520928", "0.54074246", "0.5378964", "0.53668845", "0.5331996", "0.5292181", "0.5286629", "0.52832216", "0.52176124", "0.5215969", "0.52084273", "0.5203373", "0.5203373", "0.5197028", "0.5196956"...
0.8601011
0
d'apres l'algo de Fisher
function randomize(tab) { var i, randNumb, tmp; for (i = tab.length - 1; i > 0; i--) { randNumb = Math.floor(Math.random() * (i + 1)); tmp = tab[i]; tab[i] = tab[randNumb]; tab[randNumb] = tmp; } return tab; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ldf_calculate_fisher(ClassA,ClassB,Opt){Opt.isFisher=1; return _ldf_calculate_ldf_mse(ClassA,ClassB,Opt);}", "get fisher(): Array<Array<number>> {\n return [[(this.alpha / Math.pow(this.xm, 2)), -1 / this.xm], [-1 / this.xm, (1 / Math.pow(this.alpha, 2))]];\n }", "function cargar_enfermedade...
[ "0.66682106", "0.6378029", "0.54542315", "0.54104877", "0.53257966", "0.5271275", "0.5270017", "0.52465826", "0.5197895", "0.51934224", "0.5141697", "0.5110608", "0.510355", "0.5099533", "0.5093572", "0.5029375", "0.5028708", "0.5023923", "0.502018", "0.50171626", "0.5002219"...
0.0
-1
Function used by passport js
async checkUserPassword(username, password, cb) { try { let user_creds = await this.getUserCreds(username); let user = await this.getUserById(user_creds.user_id); if (!user_creds || !user) { // there is no user return cb(null, false); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkAuth() { }", "configureSessions(callback){\n callback(passport_);\n }", "function Auth() {\n}", "function owLogin(req,res){\r\n passport.authenticate('local', { successRedirect: '/',failureRedirect: '/login', failureFlash : true });\r\n}", "function initialize(passport, getAdminByName, ge...
[ "0.70212835", "0.6563689", "0.65273327", "0.6487328", "0.64566725", "0.63863546", "0.6292994", "0.6270289", "0.62655616", "0.6263742", "0.62591213", "0.6248915", "0.6175181", "0.6170477", "0.61560553", "0.61205786", "0.6114005", "0.6113704", "0.609838", "0.60852164", "0.60799...
0.0
-1
gets a password and returns a hash
async getHashedPassword(password) { return bcrypt.genSalt(10) .then(async res => { return await bcrypt.hash(password, res) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hashPassword(p) {\n return hash(\"sha1\", p);\n}", "function getHashPass(password) {\n const passwordSha1 = crypto\n .createHash('sha1')\n .update(password)\n .digest('hex');\n\n return crypto\n .createHash('md5')\n .update(passwordSha1)\n .digest('hex')\n }", ...
[ "0.7414988", "0.7353052", "0.69645905", "0.6915212", "0.69085187", "0.6863997", "0.67234427", "0.6698174", "0.6693833", "0.66717666", "0.6627936", "0.6611944", "0.6596912", "0.6596028", "0.65667313", "0.6547863", "0.6530409", "0.65198267", "0.6512137", "0.650895", "0.6486599"...
0.62057436
47
Just to be sure that user didn't find a way to break client form validation
checkPasswordIntegrity(password, repeated_password) { if (password !== repeated_password) { throw new Error("Passwords are not the same"); } else { return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "preventSubmitUnlessValid() {\n }", "function skipValidation() { \n unsaved = false;\n checkChange(unsaved);\n }", "function invalidFormInput() {\n return (modalConfirm.form.linearId === undefined);\n }", "function invalidFormInput() {\n return (modalTransfer.form.cusipTr === undefin...
[ "0.7385572", "0.67981", "0.67283833", "0.67099637", "0.6639671", "0.657932", "0.6567768", "0.6446626", "0.6371515", "0.6362906", "0.6341924", "0.63369286", "0.63143975", "0.63048816", "0.6300791", "0.62878424", "0.628324", "0.62554556", "0.62344295", "0.62151545", "0.6212211"...
0.0
-1
notify all handlers if any changes to images is performed
function callGalleryHandlers(page) { galleryListeners.forEach(function(handler) { getGallery(function(err, gal){ if (err) return notifyErrorListeners(err); handler(gal); }, page); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function notifyImageListeners(image){\n let state = window.history.state;\n if (image) {\n updateState(image._id, state.imagePage, state.commentPage, state.currentAuthor);\n } else { // no image\n updateState(0, 1, 1, state.currentAuthor);\n }\n imageListen...
[ "0.6460221", "0.6255909", "0.61215365", "0.6101729", "0.6077582", "0.6074318", "0.600554", "0.5953249", "0.59292173", "0.5911609", "0.5903542", "0.58992374", "0.5871209", "0.58620507", "0.5848863", "0.5840077", "0.58297986", "0.58176535", "0.5813676", "0.581061", "0.58032787"...
0.0
-1
notify all handlers if any changes to images is performed
function callImageHandlers(galleryId, page) { let username = getUsername(); imageListeners.forEach(function(handler) { getImage(function(err, img){ if (err) return notifyErrorListeners(err); handler(img, username); }, galleryId, page); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function notifyImageListeners(image){\n let state = window.history.state;\n if (image) {\n updateState(image._id, state.imagePage, state.commentPage, state.currentAuthor);\n } else { // no image\n updateState(0, 1, 1, state.currentAuthor);\n }\n imageListen...
[ "0.64598155", "0.6255054", "0.6121671", "0.6102153", "0.60780627", "0.6075364", "0.60055494", "0.595292", "0.59289265", "0.59105057", "0.59038806", "0.5898656", "0.58699495", "0.58618605", "0.5848868", "0.58409977", "0.58287936", "0.5818625", "0.58162946", "0.5812486", "0.580...
0.5640998
38
notify all handlers if any changes to images is performed
function callCommentHandlers(galleryId, imageId, page) { let username = getUsername(); commentListeners.forEach(function(handler) { getComments(function(err, com){ if (err) return notifyErrorListeners(err); handler(com.reverse(), username); }, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function notifyImageListeners(image){\n let state = window.history.state;\n if (image) {\n updateState(image._id, state.imagePage, state.commentPage, state.currentAuthor);\n } else { // no image\n updateState(0, 1, 1, state.currentAuthor);\n }\n imageListen...
[ "0.64596653", "0.62580365", "0.61199564", "0.61023283", "0.60800606", "0.60763067", "0.60068244", "0.5954253", "0.5929746", "0.5911034", "0.59040177", "0.59009874", "0.5871919", "0.58630353", "0.5848929", "0.58420813", "0.58289444", "0.58187675", "0.5815508", "0.58115715", "0...
0.0
-1
Check url is serveable.
isServeableUrl(url) { const resolved = resolve(url); if (resolved.indexOf(join(this.dir, this.dist) + sep) !== 0) { // Seems like the user is trying to traverse the filesystem. return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function test(url) {\n let allowed = true;\n try {\n await fetch(url);\n } catch (e) {\n allowed = false;\n }\n return allowed;\n}", "function hostIsApplicable(url) {\n var anchor = document.createElement('a');\n anchor.href = url;\n var pattern;\n for (var i = 0; i < APPLICABLE_HOSTS.length...
[ "0.663571", "0.63991076", "0.6177242", "0.60777926", "0.60716975", "0.60420424", "0.6027409", "0.59983474", "0.5978798", "0.59622145", "0.5959881", "0.59594494", "0.5959364", "0.5937624", "0.59330094", "0.5932069", "0.5932069", "0.5932069", "0.5932069", "0.5929069", "0.592555...
0.79585826
0
Check url is internal.
isInternalUrl(url) { for (const prefix of internalPrefixes) { if (prefix.test(url)) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isInternalUrl(url){return /^(https?:|\\/\\/|mailto:|tel:)/.test(url)===false;}", "function isInternalURL(targetURL, currentURL, basename = '/') {\n if (targetURL.host !== currentURL.host) {\n return false;\n }\n\n if (!(targetURL.pathname || '/').startsWith(basename)) {\n return false;\n }\n\n...
[ "0.81849855", "0.7273568", "0.7217482", "0.68952477", "0.68350697", "0.6752165", "0.66880006", "0.65378815", "0.65283996", "0.6405724", "0.6231326", "0.61827856", "0.6158133", "0.61511695", "0.61292976", "0.6120958", "0.6104683", "0.6092047", "0.6083878", "0.60798305", "0.606...
0.8108406
1
not my code below Author: Jossef Harush Link:
function exportToCsv(filename, rows) { var processRow = function (row) { var finalVal = ''; for (var j = 0; j < row.length; j++) { var innerValue = row[j] === null ? '' : row[j].toString(); if (row[j] instanceof Date) { innerValue = row[j].toLocaleString(); }; var result = innerValue.replac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "static private internal function m121() {}", "transient protected internal function m189() {}", "transient private protected internal function m182() {}", "transient private internal fun...
[ "0.68862903", "0.66966814", "0.66490275", "0.63386214", "0.6209103", "0.610058", "0.60528934", "0.599228", "0.59336334", "0.59292537", "0.5849803", "0.5763071", "0.5729637", "0.5674093", "0.5619703", "0.558817", "0.5552664", "0.55452114", "0.55417985", "0.5535464", "0.5490266...
0.0
-1
Parses |filterText|, extracting a sort method, a list of filters, and a copy of |filterText| with all sort parameters removed.
function SourceFilterParser(filterText) { // Final output will be stored here. this.filter = null; this.sort = {}; this.filterTextWithoutSort = ''; var filterList = parseFilter_(filterText); // Text filters are stored here as strings and then added as a function at // the end, for performan...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseTextFilter() {\n const raw = this.filterText;\n\n const result = new Map();\n if (!raw.length) return result;\n\n let matches = raw.match(pairSplitRE);\n if (matches === null && raw.length) matches = [`name=${raw}`];\n\n return matches.reduce((result, pair) => {\n ...
[ "0.6012853", "0.5846537", "0.5800563", "0.5514954", "0.5453979", "0.5453979", "0.5453979", "0.54090434", "0.5378271", "0.53139925", "0.530326", "0.52850336", "0.5272188", "0.52573574", "0.5237809", "0.5217524", "0.51727265", "0.51727265", "0.51727265", "0.5160171", "0.5149466...
0.7351474
0
Parses a single "sort:" directive, and returns a dictionary containing the sort function and direction. Returns null on failure, including the case when no such sort function exists.
function parseSortDirective_(filterElement, backwards) { var match = /^sort:(.*)$/.exec(filterElement); if (!match) return null; return {method: match[1], backwards: backwards}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sort() {\r\n\t\treturn this.data.sort((a,b) => {\r\n\t\t\tfor(var i=0; i < this.definition.length; i++) {\r\n\t\t\t\tconst [code, key] = this.definition[i];\r\n\t\t\t\tswitch(code) {\r\n\t\t\t\t\tcase 'asc':\r\n\t\t\t\t\tcase 'desc':\r\n\t\t\t\t\t\tif (a[key] > b[key])\r\n\t\t\t\t\t\t\treturn code == 'asc' ? 1 : -...
[ "0.5839756", "0.5561955", "0.5519917", "0.54779816", "0.54779816", "0.54779816", "0.54779816", "0.54779816", "0.54779816", "0.54779816", "0.54779816", "0.5475036", "0.5475036", "0.5475036", "0.5475036", "0.5475036", "0.5450965", "0.54463375", "0.544462", "0.5425401", "0.53890...
0.7674088
0
Tries to parses |filterElement| as a single "is:" directive, and returns a new filter function. Returns null on failure.
function parseRestrictDirective_(filterElement) { var match = /^is:(.*)$/.exec(filterElement); if (!match) return null; if (match[1] == 'active') { return function(sourceEntry) { return !sourceEntry.isInactive(); }; } if (match[1] == 'error') { return function(sourceE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseStringDirective_(filterElement) {\n var match = RegExp('^([^:]*):(.*)$').exec(filterElement);\n if (!match)\n return null;\n\n // Split parameters around commas and remove empty elements.\n var parameters = match[2].split(',');\n parameters = parameters.filter(function(string) {\n...
[ "0.60593855", "0.55604446", "0.55604446", "0.55604446", "0.5421428", "0.53868854", "0.5147761", "0.51021975", "0.507096", "0.49881694", "0.49659553", "0.49531525", "0.4903516", "0.48266885", "0.48181918", "0.48152736", "0.4810534", "0.47366902", "0.47037008", "0.47037008", "0...
0.6716796
0
Tries to parse |filterElement| as a single filter of a type that takes arbitrary strings as input, and returns a new filter function on success. Returns null on failure.
function parseStringDirective_(filterElement) { var match = RegExp('^([^:]*):(.*)$').exec(filterElement); if (!match) return null; // Split parameters around commas and remove empty elements. var parameters = match[2].split(','); parameters = parameters.filter(function(string) { return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseFilter(str) {\n const allowedOps = ['=', '<', '<=', '>', '>=']; // must be only occurrence of that string in the filter\n\n let opIdx = -1;\n let op = '';\n allowedOps.forEach(o => {\n const i = str.indexOf(o);\n if (i === -1) return;\n\n opIdx = i;\n op = o;\n });\n\n const filterN...
[ "0.6170428", "0.5941937", "0.5941937", "0.5941937", "0.5904173", "0.5798661", "0.57264686", "0.5644287", "0.54217136", "0.5368653", "0.5152784", "0.515249", "0.5119124", "0.50296634", "0.50057465", "0.50057465", "0.50057465", "0.50057465", "0.50001943", "0.50001943", "0.49993...
0.6334628
0
Takes in a list of text filters and a SourceEntry. Each filter has "text" and "negated" fields. Returns true if the SourceEntry matches all filters in the (possibly empty) list.
function textFilter_(textFilters, sourceEntry) { let tablePrinter = null; for (var i = 0; i < textFilters.length; ++i) { let text = textFilters[i].text; let negated = textFilters[i].negated; let match = false; // The description, id, and source type are not always contained in the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkMatches(txtValue, filter) {\n\n for (var filterVal of filter) {\n if (txtValue.toUpperCase().indexOf(filterVal) > -1) {\n return true;\n }\n }\n\n return false;\n}", "filterTextMatched(text, ...fields){\n let status = false;\n for (let i = 0; i < fiel...
[ "0.6246465", "0.5762146", "0.57546073", "0.57361794", "0.55158895", "0.5482958", "0.5431637", "0.54281497", "0.5398325", "0.5364551", "0.53602767", "0.53522956", "0.5346092", "0.53449047", "0.5333548", "0.5305991", "0.5289283", "0.52740526", "0.5237837", "0.5236212", "0.52139...
0.73092884
0
Takes in a course (ex: CIS 160) and returns various formats (ex: CIS160, CIS 160, CIS160).
function expandCombo(course) { const a = course.split(" "); return `${course} ${a[0]}-${a[1]} ${a[0]}${a[1]}`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function flowConvertCourse(course) {\n let courseProfessor = course.classes[0].instructors[0];\n let fName;\n let lName;\n if (courseProfessor) {\n let commaIndex = courseProfessor.indexOf(',');\n let spaceIndex = courseProfessor.indexOf(' ');\n lName = courseProfessor.substring(0, commaIndex);\n f...
[ "0.74875295", "0.67218107", "0.63916254", "0.6188998", "0.61877465", "0.61065453", "0.60076004", "0.5904101", "0.5898942", "0.58381695", "0.58111817", "0.58063704", "0.5805323", "0.5796866", "0.5746264", "0.5718533", "0.5684985", "0.56827545", "0.56738806", "0.56666195", "0.5...
0.54730767
35
Remove duplicate courses by title.
function removeDuplicates(dups) { const used = new Set(); const clean = []; dups.forEach(i => { if (!used.has(i.title)) { used.add(i.title); clean.push(i); } }); return clean; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeCourse(course){\n let removedObject = this.courses.filter(value => course.courseCode+course.lp+course.year == value.data.courseCode+value.data.lp+value.data.year ).pop();\n removedObject.unlinkDockingPoints();\n removedObject.setCourseOverlay(null);\n this.courses = this.courses.f...
[ "0.5963498", "0.5891027", "0.57290787", "0.56630987", "0.54500407", "0.5437411", "0.54075456", "0.53195184", "0.53123385", "0.5255676", "0.52502835", "0.5242874", "0.5192878", "0.5181163", "0.5177683", "0.5143341", "0.5140831", "0.51317424", "0.51148367", "0.5107907", "0.5096...
0.63377047
0
Called each time the input value inside the searchbar changes
autocompleteCallback(inputValue) { this.setState({ searchValue: inputValue }); return new Promise(resolve => { if (this.state.autocompleteOptions.length) { resolve(this.state.autocompleteOptions); } else { this._autocompleteCallback.push(resolve); } }) .then(res => th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "search(value) {\n this.ux.input.value = value;\n this.ux.input.focus();\n this.onInputChanged();\n }", "onSearchTermChange() {\n this.search();\n Metrics.getInstance().updateMetric(Filters.SEARCH, 1);\n }", "onUpdateInput(inputValue) {\n const thiz = this;\n ...
[ "0.79119873", "0.7777656", "0.7470239", "0.7414866", "0.7414866", "0.73783106", "0.73712456", "0.7369229", "0.7338261", "0.73304296", "0.72703373", "0.72692466", "0.7257802", "0.725293", "0.7247363", "0.7242996", "0.72344357", "0.7183189", "0.71796566", "0.7175088", "0.716609...
0.0
-1
Hack to modify the handler to set the first option as the most relevant option
setFocusedOption() { this.selectRef.current.select.select.getNextFocusedOption = options => options[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_setSelectedOption() {\n if (this.options.length > 1) super._setSelectedOption();\n }", "optionsUpdateHook() { }", "_handleOptionFocus(e) {\n this._setActiveOption(e.detail.id);\n }", "defineOptionEvent(e) {\n this.defineOption(e.detail);\n }", "SetOption() {\n\n }", "function onClickOptio...
[ "0.6853682", "0.62482196", "0.60600656", "0.60253286", "0.59864736", "0.5973264", "0.5948811", "0.5940079", "0.5935227", "0.5852158", "0.5787148", "0.57620955", "0.5732723", "0.56900305", "0.5686846", "0.565564", "0.56540453", "0.5652641", "0.562346", "0.5618588", "0.56054765...
0.56531286
17
Called when an option is selected in the AsyncSelect component
handleChange(value) { this.props.history.push(value.url); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onSelected($e, datum) {\n onAutocompleted($e,datum);\n }", "function handleOptionChange(selection) {\n setFieldValue(props.name, selection)\n props.onValueChange && props.onValueChange()\n }", "_emitSelectEvent(option) {\n const event = new NovoOptionSelectedEvent(this, option);\...
[ "0.6826552", "0.67771316", "0.67758435", "0.6698812", "0.6681949", "0.65117544", "0.6503904", "0.64907956", "0.6472415", "0.6471229", "0.6461563", "0.64322394", "0.63760996", "0.6367502", "0.63632005", "0.6352983", "0.63047725", "0.628522", "0.62610215", "0.6251503", "0.62515...
0.0
-1
Validate the number Convert the number to a string Get the length of the number Prepend a space if the length is odd.
prepareForConversion($ascii_number) { let $validated_number = this.validateAsciiNumber($ascii_number); $validated_number = `${$validated_number}`; const $length = $validated_number.length; const $number = this.prependSpaceIfLengthIsEven($validated_number, $length); return $number; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check2(number) {\n if(number.length < 2) {\n return '0' + number\n } else {\n return number\n }\n}", "prependSpaceIfLengthIsEven($ascii_number, $length) {\n if (this.isOdd($length)) {\n return ` ${$ascii_number}`;\n }\n\n return $ascii_number;\n }", "function lengthValidate(num...
[ "0.7466743", "0.6906205", "0.6685162", "0.65319425", "0.6459257", "0.64589036", "0.6447142", "0.6447142", "0.63916487", "0.6337605", "0.6312864", "0.6309611", "0.63084096", "0.6276899", "0.62623924", "0.6251315", "0.6232434", "0.6222147", "0.6220539", "0.6215127", "0.6208428"...
0.59807223
35
Validate if the number is ascii number.
validateAsciiNumber($ascii_number) { const number = parseInt($ascii_number, 10); if (Number.isNaN(number) || `${number}` !== `${$ascii_number}` || number < 1) { throw new NotAnIntegerArgumentException($ascii_number); } return $ascii_number; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isAsciiDigit(cp) {\n return cp >= CODE_POINTS.DIGIT_0 && cp <= CODE_POINTS.DIGIT_9;\n}", "function isNumberOrAlphabet(str) {\nfor(var i=0;i<str.length;i++) {\nvar c=str.charCodeAt(i);\nif(c<0x0030 || (c>0x0039 && c<0x0041) || (c>0x005A && c<0x0061) || c>0x007A) return false;\n}\nreturn true;\n}", "...
[ "0.73678017", "0.7137295", "0.7044641", "0.70180094", "0.6979361", "0.6976533", "0.6842056", "0.682675", "0.67587", "0.67447495", "0.67223483", "0.6718233", "0.6706778", "0.6678748", "0.6678748", "0.6678748", "0.6670881", "0.66657865", "0.66586953", "0.6647303", "0.66341835",...
0.7545608
0
Prepend space if the length of the number is odd.
prependSpaceIfLengthIsEven($ascii_number, $length) { if (this.isOdd($length)) { return ` ${$ascii_number}`; } return $ascii_number; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function padToEven(a) {\n return a.length % 2 ? \"0\" + a : a;\n}", "function padToEven(a) {\n return a.length % 2 ? \"0\" + a : a;\n}", "function padToEven(a) {\n return a.length % 2 ? \"0\" + a : a;\n}", "function padToEven(a) {\n return a.length % 2 ? \"0\" + a : a;\n}", "function padToEven(...
[ "0.6990123", "0.6990123", "0.6990123", "0.6990123", "0.6990123", "0.6990123", "0.6990123", "0.6990123", "0.6942987", "0.6676574", "0.6564945", "0.65311944", "0.6497844", "0.6481444", "0.6475422", "0.6469972", "0.6453061", "0.6425009", "0.6425009", "0.6415348", "0.6391283", ...
0.75717
0
Is a number odd?
isOdd($ascii_number) { return !this.isEven($ascii_number); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isOdd(num) { return num % 2; }", "function isOdd(num) { return num % 2;}", "function isOdd(num) { return num % 2;}", "function isOdd(num) { return num % 2;}", "function isNumberOdd(number) {\r\n return number % 2 !== 0\r\n\r\n}", "function isOdd(num) {\n return num % 2 !== 0;\n}", "functio...
[ "0.8741029", "0.8698246", "0.8698246", "0.8698246", "0.8668323", "0.86313957", "0.86220884", "0.86212766", "0.8620509", "0.8600857", "0.85993654", "0.8598537", "0.85766006", "0.8568174", "0.855878", "0.85529095", "0.85434073", "0.8541539", "0.85210687", "0.84922194", "0.84911...
0.0
-1
Is a number even?
isEven($number) { return $number % 2 === 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function evenIs(num){\n\treturn num % 2 == 0;\n}", "function is_even(num) {\n return num % 2 == 0;\n}", "function even(number)\r\n{\r\n\treturn (number % 2) == 0\r\n}", "function even(number)\r\n{\r\n\treturn (number % 2) == 0\r\n}", "function even(num){\n return (num % 2 == 0);\n}", "function checkE...
[ "0.88221794", "0.87063897", "0.86973625", "0.86973625", "0.8679455", "0.8643603", "0.86398566", "0.8625149", "0.86095136", "0.86035717", "0.85934925", "0.8584652", "0.85810506", "0.85754454", "0.8572999", "0.85490894", "0.85432404", "0.85432404", "0.85432404", "0.85432404", "...
0.85418963
22
Parse each two character block.
parseEachTwoCharactersBlock($number, $index, $length) { const $geez_number = this.getGeezNumberOfTheBlock($number, $index); const $bet = this.getBet($length, $index); const $geez_separator = this.getGeezSeparator($bet); return this.combineBlockAndSeparator($geez_number, $geez_separator, $index); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseICUBlock(pattern){var cases=[];var values=[];var icuType=1/* plural */;var mainBinding=0;pattern=pattern.replace(ICU_BLOCK_REGEX,function(str,binding,type){if(type==='select'){icuType=0/* select */;}else{icuType=1/* plural */;}mainBinding=parseInt(binding.substr(1),10);return'';});var parts=extractPa...
[ "0.51037824", "0.5066971", "0.5005573", "0.4937788", "0.49027562", "0.49027562", "0.48912477", "0.48823303", "0.4875333", "0.48660302", "0.48640034", "0.47953266", "0.477623", "0.47429195", "0.47412053", "0.47328797", "0.47328797", "0.47328797", "0.47328797", "0.47328797", "0...
0.6917895
0
Fetch the two character (0099) block and convert it to geez.
getGeezNumberOfTheBlock($number, $index) { const $block = this.getBlock($number, $index); const $tenth = Number.isNaN(parseInt($block[0], 10)) ? 0 : parseInt($block[0], 10); const $once = parseInt($block[1], 10); return Converter.GEEZ_NUMBERS[$tenth * 10] + Converter.GEEZ_NUMBERS[$once]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fC2N(c) {\n if (0x30 <= c.charCodeAt(0) && c.charCodeAt(0) < 0x3a) {return c.charCodeAt(0) - 0x30;}\n else if (0x41 <= c.charCodeAt(0) && c.charCodeAt(0) <= 0x5a) {return c.charCodeAt(0) - 0x41 + 10;}\n else if (0x61 <= c.charCodeAt(0) && c.charCodeAt(0) <= 0x78) {return c.charCodeAt(0) - 0x61...
[ "0.5881093", "0.5777364", "0.5720479", "0.547085", "0.5470139", "0.5422535", "0.5344353", "0.5322957", "0.53142476", "0.5309478", "0.5291081", "0.528459", "0.52772224", "0.5272811", "0.52652955", "0.52531713", "0.52306956", "0.522399", "0.52136314", "0.51332974", "0.51135814"...
0.0
-1
Fetch two characters from the $number starting from $index.
getBlock($number, $index) { return $number.substr($index, 2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function two(n) {\n var s = '00' + n;\n return s.slice(-2);\n}", "function characterAPick(string, index){\n return string[index]\n}", "function getLetter(index) {\n return String.fromCharCode(64 + index);\n}", "get(index) { return this.input.charAt(index) }", "function at(position) {\n return va...
[ "0.62878406", "0.6177486", "0.6145712", "0.6135749", "0.6127896", "0.6127896", "0.6127896", "0.6127896", "0.61070675", "0.61034346", "0.6089842", "0.6074274", "0.60705197", "0.6067728", "0.6056038", "0.60267586", "0.5963851", "0.58770823", "0.58532524", "0.58495694", "0.58287...
0.64234585
0
Combines the block and the separator.
combineBlockAndSeparator($geez_number, $separator, $index) { /* eslint-disable no-param-reassign */ if (this.shouldRemoveGeezSeparator($geez_number, $separator)) { $separator = Converter.EMPTY_CHARACTER; } if (this.shouldRemoveGeezNumberBlock($geez_number, $separator, $index)) { $geez_numbe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "AddSeparator() {}", "function separator() {\n return \"<div style=\\\"display: block;\\\" class=\\\"vertbar\\\"><span style=\\\"display: block;\\\" class=\\\"g\\\">&nbsp;</span><span style=\\\"display: block;\\\" class=\\\"w\\\">&nbsp;</span></div>\\n\";\n}", "function seperator() {\n\tOutput('<span class=\"s...
[ "0.64750093", "0.6197364", "0.60829884", "0.5917221", "0.57850605", "0.57844645", "0.5698288", "0.5564214", "0.5442822", "0.5333578", "0.53207934", "0.52806026", "0.52806026", "0.52806026", "0.52806026", "0.52806026", "0.52806026", "0.5252583", "0.5251573", "0.5240876", "0.52...
0.6369273
1
Returns true if the block is empty and the separator is 100.
shouldRemoveGeezSeparator($block, $separator) { return $block.trim().length === 0 && this.isGeezNumberHundred($separator); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isBlocksEmpty(stringBlock){\n if (!stringBlock)\n return true;\n else\n return false;\n}", "isOneHundred($block, $separator) {\n return this.isGeezNumberHundred($separator) && this.isGeezNumberOne($block);\n }", "function endsWithBlankLine(block) {\n var curBlock = block;\n ...
[ "0.65599644", "0.6426617", "0.61825585", "0.5983529", "0.59434044", "0.59059584", "0.5890589", "0.5876854", "0.5854117", "0.580863", "0.5801108", "0.5789524", "0.5779513", "0.56864744", "0.5685494", "0.5681917", "0.5681122", "0.56807536", "0.566074", "0.5643444", "0.56287843"...
0.62838566
2
Returns true if the ascii number is 100 or if the ascii number is the leading 10000.
shouldRemoveGeezNumberBlock($block, $separator, $index) { return ( this.isOneHundred($block, $separator) || this.isLeadingTenThousand($block, $separator, $index) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isAsciiDigit(cp) {\n return cp >= CODE_POINTS.DIGIT_0 && cp <= CODE_POINTS.DIGIT_9;\n}", "function isDigit(code) {\n return code >= 0x0030 && code <= 0x0039;\n}", "function isDigit(num) {\r\n var string=\"1234567890\";\r\n if (string.indexOf(num) != -1) {\r\n return...
[ "0.64796925", "0.6440354", "0.6433584", "0.63665146", "0.63352746", "0.6263411", "0.6232197", "0.6232197", "0.6230291", "0.62040365", "0.6162059", "0.6072143", "0.60707027", "0.60588896", "0.6044623", "0.6044623", "0.6042515", "0.600998", "0.599043", "0.59868145", "0.59806436...
0.0
-1
Returns true if the number is 100.
isOneHundred($block, $separator) { return this.isGeezNumberHundred($separator) && this.isGeezNumberOne($block); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check(num)\r\n{\r\n return num % 100==0;\r\n}", "function divBy100(num) {\n if(num % 100 === 0) {\n return true\n } else {\n return false\n }\n}", "function divBy100(num) {\n return (num % 100 === 0)\n}", "function divisible(num) {\n if (num % 100 === 0) {\n return true;\n ...
[ "0.78528637", "0.77318764", "0.75374514", "0.7174791", "0.7155221", "0.6903498", "0.6889962", "0.68499875", "0.6812703", "0.67296875", "0.66719264", "0.66404235", "0.6586349", "0.65804696", "0.65244126", "0.64734316", "0.6359893", "0.6336752", "0.63138235", "0.6254631", "0.62...
0.0
-1
Returns true if the number is the leading 10000.
isLeadingTenThousand($block, $separator, $index) { return ( this.isZero($index) && this.isGeezNumberOne($block) && this.isGeezNumberTenThousand($separator) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isDigit(num) {\r\n var string=\"1234567890\";\r\n if (string.indexOf(num) != -1) {\r\n return true;\r\n }\r\n return false;\r\n }", "function isDigit(num) {\r\n\tif (num.length>1){return false;}\r\n\tvar string=\"1234567890\";\r\n\tif (stri...
[ "0.67354333", "0.6504445", "0.64785564", "0.64437497", "0.64414227", "0.6417324", "0.62733567", "0.6204123", "0.61601764", "0.6107874", "0.6107874", "0.60831815", "0.6063582", "0.60562134", "0.6036888", "0.6031176", "0.6031176", "0.6027258", "0.6023416", "0.6013704", "0.60067...
0.6137064
9
Load the next list
function loadNextList() { //First collect the basic list information var containerDiv = $('#scrolltarget').parents('.continous-scroll').first(); var url = containerDiv.data('url')? containerDiv.data('url'): (containerDiv.data('type')? getBaseURL()+'lists/load/t/'+containerDiv.data('type'): ''); var...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "next(){\n let next = this.currentId + 1;\n if(next >= this.list.length){\n next = this.list.length;\n }\n this.goto(next);\n }", "function next() {\n\t\tif (!data) {\n\t\t\tloadFile();\n\t\t}\n\t\tcounter++;\n\t\treturn data[counter-1];\n\t}", "function nextPage() {\n currentPage += 1;\n ...
[ "0.679436", "0.66539633", "0.6537696", "0.6416797", "0.63774043", "0.63309944", "0.6262264", "0.62338006", "0.6204522", "0.61509144", "0.6115543", "0.60687816", "0.6053013", "0.6042648", "0.6038717", "0.5937875", "0.5928058", "0.59143025", "0.58679813", "0.5857761", "0.580880...
0.711459
0
Check if an element has scrolled into view
function isScrolledIntoView(elem) { var docViewTop = $(window).scrollTop(); var docViewBottom = docViewTop + $(window).height(); var elemTop = $(elem).offset().top; var elemBottom = elemTop + $(elem).height(); return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom) && (elemBottom <= docView...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isScrolledIntoView(element) {\n var docViewTop = $(window).scrollTop();\n var docViewBottom = docViewTop + $(window).height();\n var elem = $(element);\n if (elem.length) {\n var elemTop = elem.offset().top;\n var elemBottom = elemTop + elem.height();\n }\n return ((elemBottom ...
[ "0.7980836", "0.7927855", "0.79168487", "0.7907902", "0.7907491", "0.78940696", "0.78766704", "0.78444135", "0.7818836", "0.7818703", "0.7814747", "0.78046787", "0.78013283", "0.7797969", "0.7797007", "0.77920544", "0.77920544", "0.77904785", "0.77886564", "0.7787713", "0.775...
0.77998334
13
Breaking the name into two lines if nescessary
function breakLines(text){ let multiLineName = { first : "", second : "" }; let splitedText = text.split(" "); if (splitedText.length > 2) { for (var i = 0; i < 2; i++) { if (i > splitedText.length) { //?? break; } multiLineName.first = multiLineName....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nameDivider(fullName) {\n return(fullName.split(\" \")[0]);\n}", "function inName(name) {\n\t// trim the white space from outer edges of name and then split it into an array at the space.\n\tname = bio.name;\n\tconsole.log(name);\n\tname = name.trim().split(\" \");\n\tconsole.log(name);\n\t// upperca...
[ "0.62054235", "0.618124", "0.612864", "0.6056067", "0.60339844", "0.60230255", "0.6002881", "0.5816493", "0.57947695", "0.5790426", "0.57794046", "0.5768721", "0.5740687", "0.56238455", "0.5611852", "0.55872923", "0.55759144", "0.5573944", "0.55654246", "0.5549347", "0.553687...
0.64740676
0
before the test runs...
before (callback) { super.before(error => { if (error) { return callback(error); } this.existingValue = this.marker[this.attribute]; this.data[this.attribute] = RandomString.generate(10); callback(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "beforeRun() {}", "function setUp() {\n}", "function setUp()/* : void*/\n {\n }", "before (callback) {\n\t\tthis.testBegins = Date.now();\n\t\tthis.init(callback);\n\t}", "function beforeTest()\n{\n\tconsole.log(\"'beforeTest' executed\");\n}", "beforeAll() {}", "function beforeTest() {\n ...
[ "0.77987254", "0.7539732", "0.744086", "0.73429054", "0.73172003", "0.7191919", "0.71533763", "0.7128467", "0.6814452", "0.679829", "0.67541057", "0.67500573", "0.6701781", "0.6678004", "0.6678004", "0.6678004", "0.66575384", "0.6638723", "0.65897566", "0.6563058", "0.6520784...
0.0
-1
set color on rating
function getClassByRate(vote) { if (vote >= 8) { return "green"; } else if (vote >= 5) { return "orange"; } else { return "red"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeRatingColor(rating) {\n if (rating >= 4) {\n return \"rgb(0, 255, 0)\";\n } else if (rating >= 2) {\n return \"rgb(255, 165, 0)\";\n }\n\n return \"rgb(255, 0, 0)\";\n}", "function getRatingColor(rating){\n if (rating > 80){\n return \"limegreen\";\n } else if (rating > 60)...
[ "0.7423629", "0.7411082", "0.7014468", "0.6997686", "0.6764988", "0.6602229", "0.6588327", "0.65517575", "0.65319043", "0.64938664", "0.6479563", "0.6420371", "0.64003086", "0.63777876", "0.6368343", "0.62872523", "0.62851703", "0.62615204", "0.6220206", "0.62104154", "0.6187...
0.5681304
96
1. wrap fetch in it's own function
function doFetch() { fetch(url) .then( function(response) { if (response.status !== 200) { console.log(response.status); return; } response.json().then(function(data) { //console.log(data) data.results.forEach(function(data){ let resultBlock = '' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrappedFetch() {\n\t var wrappedPromise = {};\n\t\n\t var promise = new PouchPromise(function (resolve, reject) {\n\t wrappedPromise.resolve = resolve;\n\t wrappedPromise.reject = reject;\n\t });\n\t\n\t var args = new Array(arguments.length);\n\t\n\t for (var i = 0; i < args.length; i++) {\n\t...
[ "0.7003981", "0.69765604", "0.6947367", "0.693553", "0.693553", "0.6933379", "0.68721795", "0.6711989", "0.6560557", "0.6558866", "0.65449554", "0.654293", "0.64895034", "0.64611787", "0.6458728", "0.6445646", "0.64366126", "0.64217", "0.6420901", "0.64186513", "0.64154214", ...
0.0
-1
Accumulate timeline and state events in a room.
accumulateJoinState(roomId, data, fromDatabase = false) { // We expect this function to be called a lot (every /sync) so we want // this to be fast. /sync stores events in an array but we often want // to clobber based on type/state_key. Rather than convert arrays to // maps all the time, just keep priv...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "activities(acts) {\n this.activityStream.add(acts)\n const newActivities = this.activityStream.since()\n\n _.each(newActivities, act => {\n const timestamp = act.modified.format(\"YYYY-MM-DD hh:mm\")\n const lineColor = colorUtils.colorForState(act.state)\n this.log.log(lineColor(`${timesta...
[ "0.5281962", "0.52183175", "0.51778936", "0.51747423", "0.51426923", "0.5006283", "0.49523282", "0.4906415", "0.49044454", "0.48927572", "0.488298", "0.48686835", "0.48363727", "0.48271257", "0.48031434", "0.46964547", "0.46911424", "0.46866274", "0.46758482", "0.46724135", "...
0.55618924
0
gets time from local storage or creates it
function getTime() { var localStorageTimeObj = localStorage.getItem('time'); if (!localStorageTimeObj) { //Time Object var time = { second: 0, minute: 0, hour: 0, day: 0, year: 0 } localStorage.setItem('time', JSON.stringify(t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getServiceTime () {\r\n var serviceTime = new Date();\r\n serviceTime.setTime(parseInt(localStorage.getItem(\"serviceTime\")));\r\n return serviceTime; \r\n}", "function getClaimTime () {\r\n var claimTime = new Date();\r\n claimTime.setTime(parseInt(localStorage.getItem(\"lastClaim\")));...
[ "0.73595345", "0.6929506", "0.6800976", "0.6778731", "0.66445714", "0.66327626", "0.64961445", "0.64834327", "0.64834327", "0.64737713", "0.64556664", "0.6377797", "0.6284635", "0.6256146", "0.62551767", "0.62411296", "0.6202564", "0.6200125", "0.61967283", "0.6193592", "0.61...
0.73052716
1
This runs through interval, checks conditions every second
function increment() { //set local storage to storageTime localStorage.setItem('time', JSON.stringify(storageTime)); //increment time by 1 storageTime.second++; //show updated time on seconds id $('#seconds').text(storageTime.second); if (storageTime.second >= ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runTimer(){\n var minutes = 1, the_interval = minutes * 60 * 1000;\n console.log(\"Running check every 1 minute ...\")\n checkStock();\n setInterval(function() {\n console.log(\"1 minute check\");\n checkStock();\n }, the_interval);\n}", "function countSeconds(){\n setInterval(checkIfCount...
[ "0.66346234", "0.65130854", "0.6471635", "0.647023", "0.6341857", "0.6325456", "0.62327176", "0.6227394", "0.6205315", "0.619951", "0.6155923", "0.6148275", "0.6148148", "0.61406416", "0.6133187", "0.6096169", "0.6088596", "0.6087408", "0.60804796", "0.6070801", "0.6043723", ...
0.0
-1
notes is an array of objects. each object inside it describes a note =============================================================================================== load json string from local storage
function loadStorage() { if (localStorage.getItem("notes")) { // load only if notes has something in it... var notes_str = localStorage.getItem("notes"); notesObj = JSON.parse(notes_str); for (var j=0; j < notesObj.notes.length; j++) { displayNote(notesObj.notes[j]); // call function to display each exis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadFromLocalStorage() {\n let notes;\n // check LS\n if (localStorage.getItem('notes') === null) {\n notes = [];\n } else {\n notes = JSON.parse(localStorage.getItem('notes'));\n\n //loop though notes and create items\n for (let i = 0; i < notes.length; i++) {\n ...
[ "0.7738022", "0.76623124", "0.7517058", "0.7482364", "0.73238784", "0.7267113", "0.7232928", "0.6975793", "0.69690824", "0.68987775", "0.6871643", "0.6830908", "0.68250215", "0.6788646", "0.6765643", "0.6758879", "0.67418826", "0.66682094", "0.6655886", "0.66514796", "0.66431...
0.72836643
5
=============================================================================================== validate user input for task's text and duedate. if validation passed, call function to save the new task (by adding a task object), and display its note on the corkboard. also, update local storage accordingly, and call fun...
function addTaskFromClick() { var noteObj = {}; // create task object var tsk_txt = document.getElementById("task-text").value; var tsk_dt = document.getElementById("task-due-date").value; if (tsk_txt === "") { alert("New Task is a mandatory field!"); document.getElementById("task-text").focus(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addTask() {\r\n let text = document.getElementById(\"inptTxt\").value;\r\n let date = document.getElementById(\"inptDate\").value;\r\n let time = document.getElementById(\"inptTime\").value;\r\n\r\n //validation checks \r\n // I didn't put in a submit button to check required feilds because...
[ "0.80676395", "0.721307", "0.70803046", "0.70231646", "0.7005046", "0.69262797", "0.68583536", "0.68567646", "0.6825049", "0.67637795", "0.6754349", "0.67490166", "0.6734785", "0.66962105", "0.6669494", "0.6668321", "0.6645631", "0.66448784", "0.6639651", "0.6605957", "0.6597...
0.7314923
1
=============================================================================================== clarification: a date in the past means here YESTERDAY OR BEFORE. checking the date selected by the user in relation to the reference point: start of today, meaning MIDNIGHT>00:00 . didn't extend the calculation to hours res...
function isDueDateInFuture(input_date) { var selectedDate = new Date(input_date).getTime(); var today_at_midnight = new Date().setHours(0,0,0,0); // zeroing for today at midnight (see clarification above) if (selectedDate < today_at_midnight) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkTime() {\n\n var dateText = $(\"#calendar\").val();\n var timeText = $(\"#clock\").val();\n var newTimeText = convertTimeStringformat(24, timeText);\n var selectedTime = new Date(dateText + ' ' + newTimeText);\n var now = new Date();\n\n console.log(selectedTime);\n console.log(now);\n\n if (...
[ "0.68620956", "0.68492466", "0.64217883", "0.6353658", "0.6343285", "0.6207092", "0.61989844", "0.61934245", "0.6186869", "0.6162293", "0.61305857", "0.6128841", "0.61180824", "0.6108801", "0.6100758", "0.61001074", "0.60865825", "0.6070247", "0.6054169", "0.6050659", "0.6044...
0.64294964
2
=============================================================================================== display the note on the corkboard, with the current note object as a parameter. this function is called in two cases: 1. the user created a new task following a mouse click on button. 2. loading a note from local storage
function displayNote(noteDataObj) { var notes_c = document.getElementById("notes-container"); // the notes container var note_div = document.createElement("div"); // create a new div element, of a single note notes_c.appendChild(note_div); // apply note div on the notes container note_div.className =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showNotes() {\n let notes = localStorage.getItem('notes');\n\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n let html = \"\";\n notesObj.forEach(function (element, index) {\n html +=\n `<div class=\"container\"...
[ "0.7343041", "0.7318729", "0.72408354", "0.72389084", "0.719984", "0.717231", "0.71654433", "0.71581596", "0.714875", "0.7135017", "0.7130151", "0.7114288", "0.7097948", "0.7046432", "0.7018136", "0.70122725", "0.700872", "0.6990677", "0.6989435", "0.6983451", "0.69798976", ...
0.74127823
0
=============================================================================================== clear input fields filled by the user
function clearInputFields() { document.getElementById("task-text").value = ""; document.getElementById("task-due-date").value = ""; document.getElementById("task-due-time").value = ""; updateRequiredFieldsDisplay(); // show/hide "required" indication (asterisk) and handle labels }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearInput() {\n inputFields[0].value = '';\n inputFields[1].value = '';\n inputFields[2].value = '';\n inputFields[3].value = ''\n}", "function ClearFields()\n {\n $(':input').each(function () {\n\n if (this.type == 'text' || this.type == 'textarea' || this.type=='file'...
[ "0.85398394", "0.84697276", "0.84573627", "0.8432975", "0.84286445", "0.84148824", "0.84148824", "0.84148824", "0.84005475", "0.8368092", "0.83212245", "0.82994795", "0.8289146", "0.8265658", "0.8241614", "0.8224755", "0.82239175", "0.8216733", "0.8211039", "0.82079387", "0.8...
0.7720367
90
=============================================================================================== show/hide "required" indication (asterisk) and handle labels
function updateRequiredFieldsDisplay() { var tt = document.getElementById("task-text").value; var tdd = document.getElementById("task-due-date").value; if ( (tt != "") && (tdd != "") ) { // the two required fields are not empty, so hide required display document.getElementById("s2").style.display = 'none'; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SP_RequiredLabelToggle(labelId,setRequired)\n{\n\tif(arguments.length > 2)\n\t{\n\t\tvar label = $('label[for='+labelId+']');\n\t\tif(setRequired == true)\n\t\t{\n\t\t\tif(label.text().indexOf(\"*\") == -1)\n\t\t\t{\n\t\t\t\tlabel.text(\"* \"+ label.text());\n\t\t\t\tlabel.addClass(\"dynamicRequiredLabel\...
[ "0.66144496", "0.65394676", "0.6399929", "0.62031955", "0.6152125", "0.5988437", "0.59613734", "0.5918761", "0.59102947", "0.5907416", "0.590412", "0.5896097", "0.5877146", "0.58099544", "0.5807172", "0.57928294", "0.57922244", "0.57916844", "0.5744322", "0.56686604", "0.5627...
0.5552734
28
=============================================================================================== reformat date to format: DD/MM/YYYY
function reformatDate(task_input_date) { function validatePrefixZero(date_elem) { return (date_elem < 10) ? '0' + date_elem : date_elem; } // consider case of prefix zero var d = new Date(task_input_date); return [validatePrefixZero(d.getDate()), validatePrefixZero(d.getMonth()+1), d.getFullYear()].join('/'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatDate(date) {\n var formattedDate = date.substr(5, 2) + '/';\n formattedDate += date.substr(8, 2) + '/';\n formattedDate += date.substr(0, 4);\n return formattedDate;\n} //end formatDate", "static formatDateDDMMYYYY(date) {\n if (Common.isNullOrUndifined(date)) return \"\";\n try ...
[ "0.76174474", "0.753018", "0.74061394", "0.7358904", "0.73441887", "0.73327976", "0.7314105", "0.73091316", "0.7271663", "0.72497463", "0.7244066", "0.72263974", "0.7215441", "0.72147477", "0.72074807", "0.7183744", "0.716099", "0.7158528", "0.7148448", "0.71484035", "0.71468...
0.730406
8
=============================================================================================== clear notes data from local storage
function clearStorage() { if (localStorage.getItem("notes")) { // first check if there's any data in the local storage... // display a warning for the user. if confirmed, clear the local storage, and also clear all notes from the corkboard var clearActionsSelected = confirm("WAIT!\nLOCAL STORAGE WILL BE CLEAR...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearAllNotes() {\n if (allNotes.length === 0) {\n alert(\"There are no notes to delete..\")\n } else {\n setAllNotes([]);\n localStorage.clear();\n }\n }", "function clearNotes() {\n // Clearing the textarea\n $(\".form-control\").val(\"\")...
[ "0.8231664", "0.8141288", "0.7746725", "0.7599028", "0.7562367", "0.7518451", "0.74965215", "0.7495851", "0.7398412", "0.7380687", "0.7352817", "0.7345144", "0.7278497", "0.7276531", "0.7271273", "0.72409075", "0.72395444", "0.7192141", "0.7181601", "0.71195656", "0.7115374",...
0.7667087
3
=============================================================================================== clear all existing notes, if there are any
function clearAllNotes() { var notes_container = document.getElementById("notes-container"); if ( notes_container.hasChildNodes() ) { // first check if there are any notes to delete... while (notes_container.firstChild) { notes_container.removeChild(notes_container.firstChild); // if so, remove them one by o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearAllNotes() {\n if (allNotes.length === 0) {\n alert(\"There are no notes to delete..\")\n } else {\n setAllNotes([]);\n localStorage.clear();\n }\n }", "function clearNotes()\n{\n if(notes.length !== 0)\n {\n notes.length = 0;\n ...
[ "0.80487806", "0.79778135", "0.77521217", "0.7703139", "0.75970507", "0.74186593", "0.73994786", "0.73650014", "0.73051447", "0.69188035", "0.6868458", "0.68416303", "0.68139946", "0.67722887", "0.6724412", "0.6674647", "0.6647607", "0.6635107", "0.6542714", "0.6529123", "0.6...
0.7689757
4
Defines a metrics checkbox which is used later for enabling available metrics in table, charts, etc.
function Metric(parent) { var self = new components.Component(parent); self.init = self.update = function(metric) { self.checked = ko.observable(metric.checked); self.slug = ko.observable(metric.slug); self.short_name = ko.observable(metric.short_name); s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isMetric() {\n\treturn metricRadio.checked\n\n}", "function updateMetricsSelection(callBuildCharts){\n\n metrics_chosen = get_checkbox_choices(\".MetricsCheckbox\");\n\n let text_highlight_styles = {\n \"style1\": \n {\n \"style\":'font-style',\n \"param_true\":'italic',\n ...
[ "0.6551617", "0.65509987", "0.6203524", "0.6203524", "0.5976616", "0.5876682", "0.5834382", "0.5834382", "0.5713347", "0.5654175", "0.5530209", "0.5521932", "0.5508577", "0.5461604", "0.5460377", "0.5388384", "0.5379698", "0.5302017", "0.5288995", "0.5257805", "0.5257413", ...
0.0
-1
Your instances below should really be a component on their own to promote reuse. There should be a "Card.js" and then in that file you'd have a single render() function and in that render() g function you'd put a single instance of up until the corresponding closing tafor that div into the render function. Then in this...
render() { return ( <div className="QuizPage"> <div className="title"> <div id="carouselExampleControls" className="carousel slide"> <div className="box22"> <div className="carousel-inner"> <div className="carousel-item active"> <h1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render (){\n const App = (<div id=\"bodyContainer\">\n <div id=\"Header\"><h3>Russ Websites</h3></div>\n <Card classes={this.state.item1} handleClick={this.handleClick} id=\"item1\" pname=\"Why Your Website Matters\" content={pageContent.WhyContent()} />\n <Card classes={this.state.item2} handleC...
[ "0.7026739", "0.69172764", "0.68595046", "0.6723277", "0.67112255", "0.67066294", "0.6665405", "0.6616353", "0.65963745", "0.6576977", "0.65620565", "0.6548923", "0.6487445", "0.64801234", "0.6458849", "0.6432989", "0.6419515", "0.6415552", "0.6412248", "0.63965875", "0.63791...
0.6697908
6
function to add locations to drop down list for selection async function to get location list
async function getLocationList(){ let requestOptions = { method : "GET", headers : { "Content-Type" : "application/json" } } const response = await fetch('/locations', requestOptions); const body = await response.json(); if (response.status != 200){ t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function locationList(){\n getLocationList().then(function (body){\n for ( let i = 0; i < body.length; i ++){\n console.log(body[i].storeName);\n console.log(\"getting locations\");\n\n let locationDrop = document.getElementById('locationDrop');\n\n locationDro...
[ "0.75513136", "0.7464871", "0.717096", "0.70137465", "0.68337893", "0.6831502", "0.68003577", "0.66557693", "0.6651931", "0.663166", "0.659786", "0.65625143", "0.654926", "0.64853203", "0.6455716", "0.6414226", "0.6379993", "0.63395464", "0.6318718", "0.6311878", "0.6300991",...
0.0
-1
function to add locations to drop down list for selection
function locationList(){ getLocationList().then(function (body){ for ( let i = 0; i < body.length; i ++){ console.log(body[i].storeName); console.log("getting locations"); let locationDrop = document.getElementById('locationDrop'); locationDrop.innerHTML += ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addLocations(locations, currentLocation) {\n let dropdown = document.getElementById(\"location-dropdown\");\n locations.forEach(element => {\n let option = document.createElement(\"option\");\n option.text = element;\n if (element == currentLocation) {\n option.select...
[ "0.79047287", "0.78130895", "0.73772544", "0.71059763", "0.7022866", "0.696781", "0.68147993", "0.6799722", "0.67533314", "0.6738505", "0.671497", "0.66632366", "0.6648785", "0.6595987", "0.65932184", "0.6573221", "0.65187865", "0.6507933", "0.64999664", "0.649419", "0.646061...
0.6127168
39
lambda should be +1 or 1
function Annulus(r0,r1,z0,lambda,id) { this.r0 = r0; this.r1 = r1; this.z0 = z0; this.lambda = lambda; this.id = id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function next() {\n setValue(()=>{\n return checkValue(value+1)\n })\n }", "function add1Functional(number) {\n return number + 1;\n}", "static step1(n) {\n return n >= 1 ? 1 : 0;\n }", "function additionByOne(num){\n return num+1;\n}", "function callbackfn1(val, id...
[ "0.632551", "0.6235337", "0.6145632", "0.6119463", "0.6104171", "0.6093693", "0.6079606", "0.6051967", "0.6030765", "0.60003215", "0.5964882", "0.58170366", "0.5806735", "0.58008444", "0.57950187", "0.5762667", "0.5760268", "0.5747349", "0.5747256", "0.57410336", "0.5733853",...
0.0
-1
Obtener y almacenar datos de usuario
function datos(){ var usuario = document.getElementById('usuario').value; var email = document.getElementById('email').value; var contraseña = document.getElementById('contraseña').value; usuario = { user: usuario, email: email, contraseña: contraseña } jsonUsuario = J...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cargarUsuarioPersistente(){\n\tvar db = obtenerBD();\n\tvar query = 'SELECT * FROM Usuario';\n\tdb.transaction(\n\t\tfunction(tx){\n\t\t\ttx.executeSql(\n\t\t\t\tquery, \n\t\t\t\t[], \n\t\t\t\tfunction (tx, resultado){\n\t\t\t\t\tvar CantFilas = resultado.rows.length;\t\t\t\t\t\n\t\t\t\t\tif (CantFilas > ...
[ "0.6609882", "0.6578425", "0.64246726", "0.6409672", "0.63413596", "0.6318149", "0.6298307", "0.6216279", "0.62097156", "0.6119228", "0.6108727", "0.61085606", "0.6102284", "0.60979277", "0.60966355", "0.60950094", "0.6087018", "0.60867685", "0.6068663", "0.6063668", "0.60516...
0.62965685
7
DO NOT EDIT. Use zipCodeMaker.py to generate.
function constructZipCodeArray() { var zipCoords = [ new google.maps.LatLng( 0.485547070000000E+02, -0.122925607000000E+03), new google.maps.LatLng( 0.485554390000000E+02, -0.122928051000000E+03), new google.maps.LatLng( 0.485592780000000E+02, -0.12292...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function main() {\n var year_zip = define_zippy('year');\n var month_zip = define_zippy('month');\n var topic_zip = define_zippy('topic');\n var collection_zip = define_zippy('collection');\n}", "get zip(){return this._zip;}", "get zip(){return this._zip;}", "get zip(){return this._zip;}", "get zip() {...
[ "0.62616396", "0.6171133", "0.6171133", "0.6171133", "0.6141213", "0.58906025", "0.58729374", "0.58729374", "0.58729374", "0.58729374", "0.586976", "0.5866391", "0.5833366", "0.5823646", "0.5813035", "0.56864625", "0.5640382", "0.56234306", "0.5590841", "0.5552588", "0.552158...
0.5128723
99
transformar ToDo em ID, class active em todos
function createListItemWithClass(className) { let toDoElement = document.createElement("li"); toDoElement.classList.add(className); toDoElement.id = toDo; let toDoText = document.createTextNode(toDo); let deleteLinkElement = document.createElement("i"); let checkInput = document.createElement("input"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ChangeDoneStatus(toDoId){\n\n\tvar toDo = document.getElementById(toDoId);\n\tvar liElement = toDo.parentNode;\n\n\tif(liElement.className === \"toDo\" ){\n\t\tliElement.className = \"done\";\n\t} else {\n\t\tliElement.className = \"toDo\";\n\t}\n}", "function addTODO(toDo, id, done, trash) {\r\n con...
[ "0.6667781", "0.6480086", "0.6422929", "0.63813275", "0.63750976", "0.6361845", "0.6359247", "0.6335851", "0.6281342", "0.62354845", "0.6231359", "0.62309486", "0.6221787", "0.6165639", "0.61639714", "0.61186695", "0.61154777", "0.597936", "0.5973613", "0.59656894", "0.596316...
0.6481279
1
We need the outer function because the back button will pass the event argument as the first argument of the onNavigateBack handler. The first argument of our onNavigateBack should be the navigation stack, so this allows us to use the default value by omitting that argument.
handleNavigateBack() { const { onNavigateBack, defaultNavigateBack } = this.props; onNavigateBack ? onNavigateBack() : defaultNavigateBack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onBack() {\n resetPageState();\n }", "function onback (fn) {\n window.addEventListener('popstate', function (event) {\n fn(event, fmt(document.location))\n })\n}", "function onGoBack() {\n // history.goBack();\n history.push(location?.state?.from ?? \"/\");\n }", "static goBack...
[ "0.70869595", "0.70339817", "0.70333934", "0.7009421", "0.68461406", "0.6839136", "0.68145394", "0.67773813", "0.676531", "0.6740996", "0.6725919", "0.6708011", "0.6656097", "0.66517514", "0.664988", "0.66495234", "0.6623811", "0.6622789", "0.66203064", "0.66040444", "0.65849...
0.7733411
0
The candidateRows functions gathers information on each candidate and inputs them into seperate rows
function candidateRows(raceNum, totalVotes) { // Sets the initial value of the local variable names rowHTML to be an empty string var rowHTML = ""; // Creating the for loop that increases by 1, starts by 0, and ends at 2 for(var j = 0; j <= 2; j++) { // Gives the candidate a name to assign ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function candidateRows(raceNum, totalVotes) {\r\n // Declares a local variable named rowHTML with an initial value of an empty text string. \r\n var rowHTML = \"\";\r\n\r\n // Creates a for loop in which the counter variable j goes from 0 to 2 in steps of 1 unit. \r\n for (let j = 0; j <= 2; j++) {\r\n...
[ "0.61718297", "0.5520619", "0.5493174", "0.5456889", "0.5438945", "0.54307866", "0.53657037", "0.53318185", "0.5316699", "0.531533", "0.53093636", "0.5264942", "0.5259221", "0.52556926", "0.5253957", "0.52487016", "0.5210782", "0.52015895", "0.5157581", "0.5146692", "0.514223...
0.67341137
0
Callback Function to calculate an array sum
function calcSum(value) { totalVotes += value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SumArray(array) {\n //Escribir la funcion\n}", "function sumArr(array){\n\n}", "function arraySum(arr){\n\n // code goes here\n\n}", "function sum_array(total, sum){\n \t\t\treturn total + sum;\n }", "_sum (arr) {\r\n return arr.reduce((acc,val) => acc+val)\r\n }", "sum(arr) {...
[ "0.81089175", "0.8075776", "0.79563445", "0.78663373", "0.75870204", "0.75768197", "0.7574231", "0.7558909", "0.75282305", "0.75246537", "0.7508352", "0.7505003", "0.74987787", "0.7480113", "0.74667674", "0.7450165", "0.74477005", "0.74446446", "0.7440888", "0.7423288", "0.74...
0.0
-1
Function to calculate a percentage
function calcPercent(value, sum) { return (100*value/sum); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function percentage() {\n return percent;\n}", "function percentage(a,b){\n return (a/b)*100;\n}", "function calcPercent(target, total){ //Declare and define function\n return target / total * 100; //Code to be calculated and returned when the function is called\n}", "function percentage(a, b){\n\t ...
[ "0.8619935", "0.8186311", "0.8074492", "0.7981857", "0.79091626", "0.7890548", "0.7841665", "0.7835709", "0.77588415", "0.7715141", "0.7708782", "0.77082044", "0.7676822", "0.766808", "0.765143", "0.76127416", "0.75923264", "0.74983233", "0.7486125", "0.74349046", "0.7429139"...
0.7822004
8
import styles from "./Layout.module.css"; Local Import import "./style.css";
function Layout(props) { return ( <div className="layout"> <customHead/> {/* Navbar */} <Navbar/> {/* App content */} <div className="app-content">{props.children}</div> {/* STYLING with styled-jsx */} <style jsx>{` .Layout{ wid...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function css() {\n return gulp\n .src(path.resolve(base, 'src', 'css', 'index.css'))\n .pipe(cssimport())\n .pipe(gulp.dest(path.resolve(base, 'temp', 'css')));\n}", "function injectStyle (ssrContext) {\n __webpack_require__(231)\n}", "function injectStyle (ssrContext) {\n __webpack_require__(222)\...
[ "0.5964272", "0.5860507", "0.5856508", "0.5836539", "0.57696116", "0.57653034", "0.5741816", "0.5736598", "0.5733416", "0.5710919", "0.5658295", "0.56390524", "0.56246346", "0.558301", "0.551249", "0.54859424", "0.54623836", "0.5455615", "0.5455337", "0.54494095", "0.5440673"...
0.49160925
98
CONFIRM PASSWORD FIELD VALIDATION
function confirm_password_validation(targetObjects){ //console.log(targetObjects); if( $(targetObjects[0]).val()==$(targetObjects[1]).val() ){ return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkPassword() {\n if (this.value.length >= 8) {\n setAccepted('password-validated');\n } else {\n setUnaccepted('password-validated');\n }\n}", "function validatePassword(){var r=document.getElementById(\"passwordfield\").value,e=document.getElementById(\"confirmPasswordfield\").value;e!=r?do...
[ "0.75260293", "0.74792355", "0.7413933", "0.74086136", "0.7252804", "0.7222506", "0.7206416", "0.7178656", "0.7174059", "0.7162505", "0.71548784", "0.7142802", "0.7138052", "0.7112579", "0.70652336", "0.7063524", "0.70569175", "0.70548546", "0.70440716", "0.7030343", "0.70183...
0.71811634
7
a default PREVALIDATE function
function beforeValidation(targetObject){ if(typeof settings.beforeValidation =='function'){ settings.beforeValidation(targetObject); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "preValidate() { }", "_validate() {\n\t}", "validate() {}", "function customValidation(input) { \n}", "preValidate(key, value, errors, values) {}", "validate() { }", "function customValidation(input){\n return input;\n \n}", "function validate (input) {\n \t//ver dps..\n \treturn true;\n }...
[ "0.7852457", "0.7335572", "0.72597116", "0.72558975", "0.7070195", "0.6942914", "0.679548", "0.676082", "0.6739555", "0.66865027", "0.664924", "0.664924", "0.6464478", "0.63974667", "0.63904464", "0.6358144", "0.63108414", "0.6301793", "0.62119067", "0.6203493", "0.61270183",...
0.55542505
48
function to show/hide busyscreen [Start]
function showBusyScreen() { if(!dialog_loading) dialog_loading = null; dialog_loading = new ModalDialog ("#loading_dialog"); dialog_loading.show(5000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function show()\n{\n // Restart any timers that were stopped on hide\n\tbgn();\n}", "function start() {\n\nopenScreen.style.display = \"none\";\nopenScreenPTag.style.display = \"none\";\nbutton.style.display = \"none\";\n}", "function showStartScreen() {\n $(\"#start-screen\").show();\n $(\"#w...
[ "0.6878428", "0.67044944", "0.6653963", "0.6530584", "0.64991075", "0.64991075", "0.64991075", "0.64991075", "0.64991075", "0.6486104", "0.6453358", "0.6449991", "0.6448024", "0.6428305", "0.6409023", "0.63583297", "0.63241196", "0.6305523", "0.62934077", "0.6245083", "0.6233...
0.668938
2
CALENDAR AND DATE METHODS // // this is a really headache // // do not touch if you're not sure what are you doing.. // funcion que recupera la sesion
function recoverSession(callback) { //read the cookie try { yto_session_service.currentSession(function (session) { //console.log('get session...',session); $scope.session = session; if (session != null && session.affiliate != null) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get calendar() {\r\n return new Calendar(this, \"calendar\");\r\n }", "get calendar() { return this._calendar; }", "function getMeetingCalendars()\r{\r\taa.print(\"--------------this getMeetingCalendars method-------------\");\r\tvar calendarName = \"Samuel\" ;\r\tvar calendarType = \"MEETING\" ;\r\t...
[ "0.5674499", "0.56563646", "0.5628414", "0.56103563", "0.5585652", "0.5446403", "0.5443381", "0.5387944", "0.53870773", "0.5377288", "0.53721344", "0.53019005", "0.5299498", "0.5291827", "0.52869093", "0.5278137", "0.5248863", "0.5197287", "0.5167437", "0.5144334", "0.5144253...
0.0
-1
CALENDAR AND DATE METHODS // // watch out what are you doing... // // do not touch if you're not sure what are you doing.. // End New Availability Managing Methods...
function _getNewAvailDay(date, available, pricesingle, pricedouble, pricetriple, priceother, currency) { var day = { date: new Date(date.getFullYear(), date.getMonth(), date.getDate()), available: available, rooms: { single: { price: pricesingle }, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dateObjects()\n{\n\n}", "function createCalendar() {\n addCalendar();\n displayDates();\n}", "function calendarACCESS(refTxtBox, position, xOffset, yOffset)\n{\n var toX, toY\n toX = getAbPos(refTxtBox,\"Left\")\n toY = getAbPos(refTxtBox,\"Top\")\n if(objCalendar == null){objCalenda...
[ "0.650999", "0.61696595", "0.6062528", "0.6006348", "0.6006348", "0.5983479", "0.5979602", "0.596465", "0.59435564", "0.59270936", "0.5904147", "0.589136", "0.58833814", "0.5823636", "0.582015", "0.5815013", "0.58080757", "0.5745524", "0.57440794", "0.5714055", "0.57033867", ...
0.0
-1
Run ESLint on save
extend (config, ctx) { if (ctx.isDev && ctx.isClient) { config.module.rules.push({ enforce: 'pre', test: /\.(js|vue)$/, loader: 'eslint-loader', exclude: /(node_modules)/ }) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function onDidSave(document) {\n \n // vscode.window.showErrorMessage(document.fileName);\n if (document.fileName.endsWith('.git')){\n freshCompile(document.fileName.slice(0, -4));}\n else{\n freshCompile(document.fileName);}\n\n}", "extend(config, ctx) {\n // Run ESLint on s...
[ "0.6254116", "0.6194986", "0.6039337", "0.6013917", "0.59941036", "0.5970687", "0.59475744", "0.5912842", "0.591067", "0.59085685", "0.5907691", "0.58788127", "0.5842818", "0.5838338", "0.5837256", "0.5837256", "0.5837256", "0.5837256", "0.5837256", "0.5837256", "0.5837256", ...
0.0
-1
Explanation: I removed the if statement in the timeToPositionPercent function as we do not want to lift off the rocket. As such, we always return the final position bottom value. We do however, want to keep the animations ongoing for the rocket.
function timeToPositionPercent(startTime) { const now = Date.now(); const timeDiff = now - startTime; return FINAL_POSITION_BOTTOM_VAL; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function move() {\n let id = setInterval(frame, 1);\n function frame() {\n if(m == 60){m = 0};\n h = m + (zl * 60);\n switch(true){ \n case h < 60:\n circle.style.stroke = (`#1d59ff`); // 1\n break;\n case h < 120:\n circle.style.stroke = (`#6...
[ "0.59037596", "0.589306", "0.5780313", "0.5776626", "0.56508636", "0.56408745", "0.5638588", "0.56127787", "0.56123275", "0.56062096", "0.55991286", "0.55710465", "0.55570376", "0.5552064", "0.55192584", "0.55087847", "0.54947585", "0.54945225", "0.54503495", "0.5447708", "0....
0.6352961
0
constructor here to include the React component 'class' and super is to not override defualts but to just include custom methods/logic
constructor(props) { super(props) this.state = { movies: null, currentUser: null } // the connection to firebase database this.moviesRef = firebase.database().ref('/movies') this.usersRef = firebase.database().ref('/users') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(props) {\n super(props);\n /** Call of methods */\n this.render = this.render.bind(this);\n this.componentDidMount = this.componentDidMount.bind(this);\n }", "constructor() {\n super(); // loading the parent component methods and properties\n return this.buildComponenent(); // thi...
[ "0.77078664", "0.7676614", "0.7658943", "0.7620643", "0.75028783", "0.7489259", "0.7489259", "0.74217045", "0.74170005", "0.7412613", "0.7379423", "0.7337205", "0.73294234", "0.73294234", "0.7301444", "0.72993284", "0.729715", "0.729715", "0.729715", "0.729715", "0.729715", ...
0.0
-1
registerUser = user => this.usersRef.push(user.providerData[0]);
render() { return ( <BrowserRouter> <div> { // if currentUser is null, show login screen !this.state.currentUser ? <SignIn signIn={this.signIn}/> : // else show app <div> <Navigation signOut={this.signOut} userInfo={this.state.cur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "registerUser(user) {\n return firebase.database().ref('users/' + this.authData.uid).set({\n username: user.username,\n name: user.name,\n lastname: user.lastname,\n address: user.address,\n phone: user.phone,\n country: user.country,\n ...
[ "0.7236983", "0.704929", "0.7001067", "0.6556482", "0.6450553", "0.6434623", "0.64160603", "0.6394356", "0.63765186", "0.6333638", "0.6275299", "0.62562", "0.6224509", "0.6195209", "0.61816347", "0.6179353", "0.61479855", "0.6135372", "0.6095713", "0.6093038", "0.6089516", ...
0.0
-1
Constructs a path from a list of points. Pre allocates the [[screenSpaceLines]] used to render.
constructor(points) { this.points = points; this.screenSpaceLines = new Array(points.length >= 2 ? points.length - 1 : 0); for (let i = 0; i < this.screenSpaceLines.length; i++) { this.screenSpaceLines[i] = new THREE.Line3(new THREE.Vector3(), new THREE.Vector3()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Path(points) {\n if (Object.prototype.toString.call(points) === '[object Array]') {\n this.points = points;\n } else {\n this.points = Array.prototype.slice.call(arguments);\n }\n}", "function Path(points) {\n if (Object.prototype.toString.call(points) === '[object Array]') {\n this.points ...
[ "0.73210263", "0.73210263", "0.6699296", "0.659984", "0.6411879", "0.63960785", "0.6378458", "0.6293241", "0.60985506", "0.6067344", "0.6060381", "0.6046252", "0.5988992", "0.5972612", "0.59689224", "0.5967517", "0.5936418", "0.59270686", "0.5923162", "0.59153324", "0.589048"...
0.6400271
5
get the name and email of the user who signs up
function getThankYouName() { var fullName = "Thank you "; fullName += document.getElementById('firstName').value + "!"; /*fullName += " " + document.getElementById('lastName').value + "!";*/ return fullName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUserEmail() {\n return firebase.auth().currentUser.email;\n}", "function getDetails() {\n var user = firebase.auth().currentUser\n if (user) {\n // User is signed in.\n if (user != null) {\n name = user.displayName\n email = user.email\n photoUrl = user.photoURL\n emailVe...
[ "0.69714695", "0.6640586", "0.6611515", "0.6574869", "0.6568223", "0.6539175", "0.65076315", "0.65037614", "0.65007615", "0.6500189", "0.6492108", "0.64822865", "0.64822865", "0.64822865", "0.64719135", "0.64719135", "0.6469101", "0.64647025", "0.64549387", "0.64549387", "0.6...
0.0
-1
add quantity on system
function addQTY(QTY){ if(QTY == 'couplesPlus'){ CouplesQTY = CouplesQTY + 1; CouplesPrice = CouplesQTY * 25; displayCouplesQTY(); displayCouplesPrice(); } else{ FamilyQTY = FamilyQTY + 1; FamilyPrice = FamilyQTY * 30; displayFamilyQTY(); displa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addQuantity(product, quantity) {\n connection.query(\n \"UPDATE products SET stock_quantity = ? WHERE item_id = ?\",\n [product.stock_quantity + quantity, product.item_id],\n function(err, res) {\n // Let the user know the purchase was successful, re-run loadProducts\n console.log(\"\\...
[ "0.78537893", "0.7791189", "0.7457163", "0.7313278", "0.730662", "0.729926", "0.72914594", "0.7280688", "0.72238684", "0.7185652", "0.7174494", "0.7134756", "0.71307033", "0.7099271", "0.7044422", "0.7041185", "0.70302016", "0.6990825", "0.69891506", "0.69775397", "0.6973798"...
0.0
-1
remove quantity on system
function removeQTY(QTY){ if(QTY =='couplesMinus'){ if(CouplesQTY > 0){ CouplesQTY = CouplesQTY - 1; CouplesPrice = CouplesQTY * 25; displayCouplesQTY(); displayCouplesPrice() } } else{ if(FamilyQTY > 0){ FamilyQTY = FamilyQT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removerItem(item) {\r\n\tif (qtd[item] > 0) {\r\n\t\tqtd[item] -= 1;\r\n\t\tvar quantidade = document.getElementById('quantidade' + item);\r\n\t\tvar total = document.getElementById('total' + item);\r\n\t\tquantidade.innerHTML = qtd[item];\r\n\t\tvalorTotal[item] = valorProduto[item] * qtd[item];\r\n\t\tt...
[ "0.72078276", "0.72000104", "0.71677744", "0.71498436", "0.714071", "0.711327", "0.7060618", "0.70261145", "0.7011937", "0.70061994", "0.7001727", "0.6984957", "0.6984551", "0.6952508", "0.69514483", "0.6948892", "0.6938291", "0.6928962", "0.69260997", "0.69035983", "0.689287...
0.0
-1
displace value of couple quantity
function displayCouplesQTY(){ document.getElementById("couplesQTYAmount").innerHTML = CouplesQTY; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cartPlusOne(product) {\r\n product.quantity = product.quantity + 1;\r\n }", "function addquatity(){\n updateQuantity(quantity + 1);\n }", "function replaceQuantity(qty, name, list) {\n // console.log(\"list\", list)\n list.forEach(function(obj) {\n if (obj.item === name...
[ "0.616938", "0.6165422", "0.5849192", "0.5792614", "0.5770368", "0.5764329", "0.5737913", "0.57007706", "0.5647062", "0.56425065", "0.5640429", "0.5637103", "0.56247574", "0.5591284", "0.5573748", "0.55630636", "0.5559171", "0.55582124", "0.55500007", "0.55469084", "0.5543753...
0.0
-1
displace value of family quantity
function displayFamilyQTY(){ document.getElementById("familyQTYAmount").innerHTML = FamilyQTY; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addquatity(){\n updateQuantity(quantity + 1);\n }", "make(allegedQuantity) {\n strategy.insistKind(allegedQuantity);\n const amount = harden({\n label,\n quantity: allegedQuantity,\n });\n brand.add(amount);\n return amount;\n }", "get quantity() {\n...
[ "0.5605321", "0.5541818", "0.5523009", "0.5489779", "0.53660494", "0.53618246", "0.53591394", "0.5304038", "0.53034127", "0.52737135", "0.52615803", "0.5258332", "0.52487725", "0.52466434", "0.52365613", "0.522147", "0.52085495", "0.52054566", "0.5205246", "0.5205246", "0.520...
0.5710895
0
displace price of couples
function displayCouplesPrice(){ document.getElementById("couplesPriceAmount").innerHTML = CouplesPrice; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculPrice () {\n for (var i = 0; i < deliveries.length; i++) {\n for (var j = 0; j < truckers.length; j++) {\n if (deliveries[i].truckerId == truckers[j].id) {\n var pricePerKm = truckers[j].pricePerKm;\n var pricePerVolume = truckers[j].pricePerVolume;\n break;\n }\n ...
[ "0.6652448", "0.6553528", "0.6518776", "0.64984244", "0.6200973", "0.6123715", "0.6108828", "0.5991001", "0.5981805", "0.5954578", "0.5936637", "0.58933014", "0.5891704", "0.5884392", "0.58440864", "0.58346516", "0.5831578", "0.58243996", "0.58234954", "0.5809968", "0.5792166...
0.6004681
7
displace price of family
function displayFamilyPrice(){ document.getElementById("familyPriceAmount").innerHTML = FamilyPrice; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculPrice () {\n for (var i = 0; i < deliveries.length; i++) {\n for (var j = 0; j < truckers.length; j++) {\n if (deliveries[i].truckerId == truckers[j].id) {\n var pricePerKm = truckers[j].pricePerKm;\n var pricePerVolume = truckers[j].pricePerVolume;\n break;\n }\n ...
[ "0.63864154", "0.6339779", "0.6161171", "0.6150231", "0.61198884", "0.6076535", "0.60700834", "0.6040429", "0.6036099", "0.60239846", "0.59825903", "0.5981369", "0.5959127", "0.59548867", "0.5954183", "0.59539384", "0.5953334", "0.59495336", "0.59224916", "0.5920542", "0.5907...
0.6144286
4
function of button skip and next
function toPay(){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function skipToNext () {\n\n\t\tcurrentlyPressed = null;\n\t\tvar skipText;\n\t\tif ( currentSection == 'buttons' ) {\n\n\t\t\tskipText = buttons[ currentButton ].description;\n\t\t\tbuttons[ currentButton ].accepted = null;\n\t\t\tnextButton();\n\n\t\t} else {\n\n\t\t\tskipText = (axis[ currentAxis ].description ...
[ "0.77217096", "0.74971884", "0.7463143", "0.7358106", "0.73564774", "0.7331158", "0.71882707", "0.7085723", "0.70463145", "0.70193124", "0.6994798", "0.69785666", "0.69594824", "0.6934373", "0.68499196", "0.6836683", "0.6820903", "0.6814127", "0.67927593", "0.6771416", "0.673...
0.0
-1
saves a goal record
function saveGoal() { if($('#goal_team').val() == 0) { alert("Please select a team."); return false; } if(!$('#goal_player').val()) { alert("Please provide goal player number."); return false; } if($('#goal_period').val() == 0) { alert("Please select a period."); return false; } if(!$('#goal_time_m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveRecord(record) {\n const transaction = db.transaction(['new_transaction'], 'readwrite');\n const budgetTrackerObjectStore = transaction.objectStore('new_transaction');\n budgetTrackerObjectStore.add(record);\n}", "function saveRecord(record) {\n // just saving a record\n const transac...
[ "0.70003396", "0.68805784", "0.6826316", "0.6764282", "0.6759114", "0.6723435", "0.67083", "0.667575", "0.66679204", "0.66577643", "0.6613823", "0.66116077", "0.66016847", "0.6551246", "0.654874", "0.6534818", "0.64828974", "0.64043933", "0.62836057", "0.62814826", "0.6277433...
0.6222115
24
formats saved period to human readable text
function formatPeriod(input) { var result = null; switch(input) { case "1": result = "1st Period"; break; case "2": result = "2nd Period"; break; case "3": result = "3rd Period"; break; case "4": result = "Overtime"; break; default: result = null; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getStringOfField_period(value) {\n if (this.cleanIntField(value)) {\n return moment(value*1000).format(\"YYYY \"+t(\"г.\"));\n } else {\n return 0;\n }\n }", "function set_period(period) {\n var per_elm = $('#period_num');\n per_elm.text(period);\n\n return ...
[ "0.6756584", "0.58878976", "0.5752977", "0.56549525", "0.56549525", "0.56549525", "0.5617853", "0.55705065", "0.55705065", "0.55705065", "0.55705065", "0.55705065", "0.5526965", "0.55164886", "0.55164886", "0.54835737", "0.54769814", "0.5463268", "0.5455244", "0.54402834", "0...
0.6647678
1
returns a promise always resolved with current position or null caller should check the resolved value
function updatePosition() { if (positionPromise) { return positionPromise; } positionPromise = new Promise(function ready(resolve) { // TODO // it looks like getCurrentPosition never returns cached position // even though we are passing a maximumAge > 0 // I would assume that ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resolve(pos) {\n return ResolvedPos.resolveCached(this, pos);\n }", "function peek() {\n if(done)\n return Promise.resolve({done: true});\n else if(R.length)\n return Promise.resolve({value: R[0], done: false});\n else \n return fe...
[ "0.67756754", "0.6450241", "0.61329824", "0.61299217", "0.61240983", "0.6079187", "0.60691684", "0.60691684", "0.600431", "0.600431", "0.5990465", "0.5980264", "0.5928762", "0.5928762", "0.5894995", "0.584393", "0.57781035", "0.57745713", "0.57498515", "0.572559", "0.5650187"...
0.5923246
14