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
Load books from database
loadBooksFromServer () { fetch('http://localhost:8080/books') .then(result => result.json()) .then(result => this.setState({ books: result }) ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function loadBooks() {\n const response = await api.get('books');\n setBooks(response.data);\n }", "function loadBooks() {\n API.getBooks()\n .then((res) => setBooks(res.data))\n .catch((err) => console.log(err));\n }", "function loadBooks() {\n API.getBooks()\n ...
[ "0.73091424", "0.7290693", "0.7220285", "0.71934724", "0.714373", "0.714373", "0.70611095", "0.70088816", "0.69589275", "0.6952009", "0.69478875", "0.6935226", "0.68015105", "0.6620518", "0.65562296", "0.65348136", "0.6474608", "0.6464824", "0.64141494", "0.639832", "0.638676...
0.56735015
62
binding functions to the buttons on the page the functions we use to do the actual work are defined in dataManager.js
function add(){ addDatapoints(1); // we add new code below: //UPDATE BARS // we add new code below: console.log("new data", data) elementsForPage = graphGroup.selectAll(".datapoint").data(data); update(); elementsForPage.transition().duration(1000).attr("transform", function(d, i){//horizontal retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function theClick() {\r\n console.log('inicia')\r\n dataNodes()\r\n dataElements()\r\n backEnd()\r\n}", "function listenToButtons() {\n\t\tconst currentlyDisplayed = employeesData.find(isDisplayed);\n\t\tif (hasPrevious(currentlyDisplayed.id)) {\n\t\t\tpreviousButton.addEventListener('click', () => {\n\t\t\t...
[ "0.6936122", "0.68501586", "0.6843578", "0.67094857", "0.67069066", "0.66692674", "0.6648185", "0.6648083", "0.6648083", "0.6648083", "0.6593003", "0.658165", "0.65339345", "0.65111166", "0.6509807", "0.64963937", "0.64778745", "0.6434199", "0.6407726", "0.63865703", "0.63841...
0.0
-1
Ray from a to b
function ray(a, b) { return normalize(sub(b, a)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static buildRayFromPoints(a, b) {\n return new Ray(a, b.sub(a).normalize());\n }", "Raycast() {}", "function ray(origin) {\n var stepX = step(sin, cos, origin.x, origin.y);\n var stepY = step(cos, sin, origin.y, origin.x, true);\n\n //nextStep.height = game field row\n var nextStep = stepX.leng...
[ "0.76192194", "0.65528744", "0.6244245", "0.62295485", "0.61978775", "0.6055971", "0.60293376", "0.5966607", "0.59098554", "0.5829589", "0.57442605", "0.5679074", "0.5656898", "0.56280214", "0.5618509", "0.5614038", "0.5586523", "0.55417347", "0.55339867", "0.55325454", "0.55...
0.8114135
0
Rotate vector v by t radians
function rotate(v, t) { var ct = Math.cos(t); var st = Math.sin(t); return make(ct * v.x - st * v.y, st * v.x + ct * v.y); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rotate(v){\n\t\treturn $M([[0, -1],[1, 0]]).x(v)\n\t}", "function vecRot(v1, v2) {\n // calculate l1, l2\n var l1 = Math.sqrt(Math.pow(v1.x, 2) + Math.pow(v1.y, 2));\n var l2 = Math.sqrt(Math.pow(v2.x, 2) + Math.pow(v2.y, 2));\n\n // calculate cos, sin\n var cosPhi1 = v1.x / l1;\n var sinPhi1 = v1...
[ "0.8118559", "0.7186568", "0.71607965", "0.69167805", "0.6900447", "0.68511283", "0.68289566", "0.68216753", "0.6810087", "0.6716649", "0.6712563", "0.65697676", "0.6555961", "0.6537773", "0.6512613", "0.6484479", "0.64771104", "0.643612", "0.64356273", "0.6418194", "0.640953...
0.8653902
0
Angle between two normalized vectors with sign
function angle(a, b) { var t = Math.atan2(b.y, b.x) - Math.atan2(a.y, a.x); if (t < 0) { return 2 * Math.PI + t; } else { return t; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "angle(vec1, vec2){\n\t\tlet dot = vec1.dot(vec2);\n\t\tlet res = dot/(vec1.norm()*vec2.norm());\n\t\t//Temp fix?\n\t\tif(res > 1){\n\t\t\tres = 1;\n\t\t}\n\t\telse if(res < -1){\n\t\t\tres = -1;\n\t\t}\n\t\tlet red = Math.acos(res);\n\t\treturn red;\n\t}", "function angle( v1, v2 ) {\n let z = cross( v1, v2 );...
[ "0.7786753", "0.75425607", "0.7313229", "0.73037875", "0.70945626", "0.7040418", "0.6999569", "0.6946886", "0.6919233", "0.6893066", "0.6853533", "0.6777004", "0.6769409", "0.6731029", "0.671716", "0.6715354", "0.6715354", "0.67050546", "0.6665995", "0.6658089", "0.66506547",...
0.6505789
23
Rotate from a towards b, by a maximum of 't' radians.
function rotateToward(a, b, t) { var full = angle(a, b); if (full == 0 || Math.abs(full) < t) { return b; } else { if (full > Math.PI) { return rotate(a, -t); } else { return rotate(a, t); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rotate(v, t) {\n var ct = Math.cos(t);\n var st = Math.sin(t);\n return make(ct * v.x - st * v.y, st * v.x + ct * v.y);\n}", "rotateTurtle(x, y, z) {\n x = x * this.angle;\n y = 45;\n z = z * this.angle ;\n var e = new THREE.Euler(\n x * 3.14/180,\n\t\...
[ "0.6909034", "0.6217009", "0.61668533", "0.6149795", "0.6078641", "0.60144997", "0.59981275", "0.591788", "0.5896683", "0.5804831", "0.57752234", "0.57640266", "0.5745729", "0.5742408", "0.57064706", "0.56969506", "0.56952083", "0.56526476", "0.5569452", "0.5553368", "0.55487...
0.7182912
0
Validation Rules : 1. Item quantities must be between 0 and 10 2. First and Last Names must contain only alphabets and cannot be empty or contain spaces. 3. Card number must be of the format xxxxxxxxxxxxxxxx (hyphens needed) 4. Expiry Date must be mm/dd/yyyy format. Any year after 2017 is ok. 5. Cvv must have 3 numeric...
function submission() { validateHouseNumber(); validateStreetName(); validateZipCode(); validatePhoneNumber(); validateFirstName(); validateLastName(); validateCardNumber(); validateExpiryDate(); validateCvv(); var errorString = document.getElementById(p1).innerHTML + document.getElementById(p2).innerHTML + q...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateInputs(){\n\n var $errors = [];\n\n // Quantity\n var $quantity = $('[name=\"quantity\"]');\n var quantity = parseInt($quantity.val());\n if( isNaN( quantity ) || quantity < 1 ){\n $quantity.addClass('error');\n $errors.push($quantity);\n ...
[ "0.7326673", "0.7137591", "0.6849879", "0.6771263", "0.67037266", "0.6680757", "0.6634923", "0.65074277", "0.6504549", "0.64977056", "0.6472346", "0.6460069", "0.6435748", "0.64311725", "0.64206", "0.63731", "0.63706905", "0.6361889", "0.6340106", "0.63308793", "0.6314967", ...
0.6388983
15
Called when the mayo checkbox is clicked.
function selectMayo() { mayoCost = 1 - mayoCost ; calculateTotal(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "click () {\n this._chkInput.click();\n }", "function checkBox(e){\n\t\t\t\t$(this).toggleClass(\"on\");\n\n\t\t\t\tif($(this).hasClass(\"stab\")){\n\t\t\t\t\tself.generateExploreResults(false);\n\t\t\t\t}\n\t\t\t}", "function checkBox(checkbox){\r\n\t\tcheckbox.checked=true;\r\n\t\ttriggerEvent(check...
[ "0.72423744", "0.7061715", "0.6922964", "0.6827201", "0.6827201", "0.6750238", "0.6692544", "0.6356481", "0.6355658", "0.63448244", "0.6318347", "0.63172907", "0.6298917", "0.62948656", "0.62893975", "0.62462115", "0.6230785", "0.6195021", "0.6180346", "0.61536217", "0.615134...
0.0
-1
Called when the seasoning checkbox is clicked.
function selectSeasoning() { seasoningCost = 1 - seasoningCost ; calculateTotal(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function switchSeasons() {\n\tcurrentSeasonSelected =event.target.value;\n\tprintToDom();\n}", "function seasonsOnClick () {\n module.exports.internal.stateManager.showState('main-branch', 'season-stats')\n}", "function seasonAddOnClick () {\n if (module.exports.internal.seasonName.value.length > 0) {\n m...
[ "0.71032083", "0.6788462", "0.6152916", "0.5901856", "0.58440995", "0.5787024", "0.5751576", "0.56317496", "0.5592423", "0.5532809", "0.55261976", "0.5520974", "0.5509391", "0.5498478", "0.54842174", "0.53861624", "0.53849316", "0.53762513", "0.5344758", "0.5341681", "0.52850...
0.62175846
2
Called when the ketchup checkbox is clicked.
function selectKetchup() { ketchupCost = 1 - ketchupCost ; calculateTotal(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "click () {\n this._chkInput.click();\n }", "function checkBox(e){\n\t\t\t\t$(this).toggleClass(\"on\");\n\n\t\t\t\tif($(this).hasClass(\"stab\")){\n\t\t\t\t\tself.generateExploreResults(false);\n\t\t\t\t}\n\t\t\t}", "function checkClicked() {\n \n}", "function fCheckBox(e)\n\t{\n\t\tvar id = e.t...
[ "0.6940923", "0.67647564", "0.6517569", "0.631434", "0.6144744", "0.6144744", "0.6109294", "0.61018425", "0.6094059", "0.6085129", "0.6050623", "0.60251385", "0.60243607", "0.60017985", "0.5990762", "0.5987209", "0.59616596", "0.59442323", "0.59316653", "0.59287953", "0.59017...
0.54083693
87
Changes the heading background color every 5 seconds
function changeHeadingColor() { document.getElementById("heading").style.backgroundColor = colors[colorIndex]; colorIndex = (colorIndex + 1) % colors.length; // Alternates the next heading background color. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeBackgroundColorWithTimer() {\n window.setInterval('getRandomColor()', 10000);\n}", "function backgroundColor() {\n if($(\"body\").css(\"backgroundColor\") === \"rgb(128, 0, 128)\") {\n \n $(\"body\").css(\"backgroundColor\", \"green\")\n\n } else {\n\n $(\"body\").css(\"bac...
[ "0.7253462", "0.6862091", "0.67279804", "0.6600626", "0.657288", "0.65407073", "0.6529141", "0.6510713", "0.650805", "0.6502039", "0.6501593", "0.64979154", "0.64878666", "0.6444455", "0.6430815", "0.6396343", "0.6361212", "0.63499814", "0.6321157", "0.6298952", "0.62948006",...
0.70508265
1
Validates the house number. Called when the house number field is blurred.
function validateHouseNumber(){ var nameFormat = /^\d{1,}$/; // Regex indicating at least one numerical digit and no other types of characters. var errorFormat = /Invalid House Number<br>/; var houseNumber = document[formName]["houseNumber"].value; var errorString=""; /* If invalid input field */ if(!nameFo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validation(){\n\tvar withpeople = document.getElementById(\"switch-people\").checked;\n\tif (withpeople){\n\t\tvar x=document.getElementById(\"people-num\").value;\n\t var regex=/^[0-9]+$/;\n\t if (x.match(regex) == null)\n\t {\n\t \t//alert(\"Must input a number\");\n\t document.getEle...
[ "0.6208644", "0.58668244", "0.5854845", "0.57157737", "0.57112336", "0.5676479", "0.566458", "0.5654447", "0.56382483", "0.5612107", "0.5584763", "0.5555671", "0.5544807", "0.55270314", "0.55105275", "0.54942316", "0.54923415", "0.5486994", "0.5472176", "0.54662585", "0.54542...
0.718694
0
Validates the street name. Called when the street name input field is blurred.
function validateStreetName(){ var nameFormat = /^([a-zA-Z]{1,}(\s*)){1,}$/; // Regex to indicate alphabets followed by any number of spaces. This pattern has to repeat atleast once. var nameFormat2=/\s{1,}$/; // Regex to indicate trailing spaces. var errorFormat = /Invalid Street Name<br>/; var streetName = docume...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function streetName() {\n var errors = document.querySelector(\"#errors\");\n var sName = document.querySelector(\"#streetName\");\n var name = sName.value.trim();\n var patt = /^[a-z]{5,15}$/ig;\n if(!patt.test(name)) {\n errorMessage(\"<p>Please enter a valid Street Name</p>\");\n re...
[ "0.7409912", "0.68567455", "0.6733329", "0.6711663", "0.6685307", "0.6523056", "0.6509618", "0.6442993", "0.6424804", "0.64182186", "0.6356347", "0.6340853", "0.63372445", "0.63239545", "0.6284633", "0.62687665", "0.62406826", "0.62116104", "0.62054497", "0.6191413", "0.61679...
0.76796025
0
Validates the zip code. Called when the zip code field is blurred.
function validateZipCode(){ var nameFormat = /^\d{5}$/; // Regex to indicate 5 numerical digits. var errorFormat = /Invalid Zip Code<br>/; var zipCode = document[formName]["zipCode"].value; var errorString=""; if(!nameFormat.test(zipCode)) { if(!errorFormat.test(document.getElementById(p2).innerH...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateZip () {\n\n isValid(zipInput);\n isZipValid= true;\n\n if (paymentSelect.value === 'credit card') {\n if (!/^\\d{5}$/.test(zipInput.value)) {\n isInvalid(zipInput);\n isZipValid = false;\n }\n }\n}", "function validateZip () {\n var text = $('#zi...
[ "0.7711022", "0.76697195", "0.75792956", "0.7572538", "0.7564649", "0.7509126", "0.73794895", "0.7342353", "0.7322351", "0.732091", "0.7292041", "0.7277237", "0.7234599", "0.7219239", "0.7208339", "0.7203467", "0.7183931", "0.71807605", "0.7148144", "0.71280605", "0.71071357"...
0.73326606
8
Validates the phone number. Called when the phone number field is blurred.
function validatePhoneNumber(){ var nameFormat = /^\(\d{3}\)\d{7}$/; // Regex to indicate a phone number of the formn (xxx)xxxxxxx where x is a numerical digit. var errorFormat = /Invalid Phone Number<br>/; var phoneNumber = document[formName]["phoneNumber"].value; var errorString=""; if(!nameFormat.test(phone...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validatePhone () {\n\t\t\t$scope.errorPhone = false;\n\n\t\t\tif(isNaN($scope.phone)) {\n\t\t\t\t$scope.errorPhone = true;\n\t\t\t\t$scope.messagePhone = \"The phone number has a wrong format. It must be only numbers.\"\n\t\t\t}\n\t\t}", "processPhone() {\n let input = this.phone\n ...
[ "0.7453728", "0.7260825", "0.7186309", "0.71673065", "0.70753914", "0.70708925", "0.69941723", "0.6991337", "0.69184715", "0.69096243", "0.68491083", "0.68348587", "0.679437", "0.6773057", "0.67376316", "0.67314863", "0.672255", "0.67223305", "0.6717868", "0.6699225", "0.6680...
0.6645852
24
Validates the First Name. Called when the first name field is blurred.
function validateFirstName(){ var nameFormat = /^[a-zA-z]{1,}$/; // Regex to indicate that the first name can contain only alphabets and no spaces. var errorFormat = /Invalid First Name<br>/; var firstName = document[formName]["firstName"].value; var errorString=""; if(!nameFormat.test(firstName)) { if(!errorF...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validFirstName() {\r\n\r\n var firstName = $firstName.val();\r\n\r\n if (firstName.length < 2 || firstName.length > 30) {\r\n $firstName.addClass('is-invalid');\r\n } else {\r\n $firstName.removeClass('is-invalid');\r\n }\r\n }", "function validateFir...
[ "0.76500136", "0.7630069", "0.7561363", "0.73385257", "0.7305944", "0.72960865", "0.7237281", "0.7169277", "0.70695376", "0.69976395", "0.69867355", "0.6986404", "0.6985498", "0.6964906", "0.69600534", "0.6938255", "0.6933418", "0.68610066", "0.6834382", "0.6791521", "0.67888...
0.7387616
3
Validate the last name. Called when the last name field is blurred.
function validateLastName(){ var nameFormat = /^[a-zA-z]{1,}$/; // Regex to indicate that last name should contain only alphabets and no spaces. var errorFormat = /Invalid Last Name<br>/; var lastName = document[formName]["lastName"].value; var errorString=""; if(!nameFormat.test(lastName)) { if(!errorFormat.t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validLastName() {\r\n\r\n var lastName = $lastName.val();\r\n\r\n if (lastName.length < 2 || lastName.length > 30) {\r\n $lastName.addClass('is-invalid');\r\n } else {\r\n $lastName.removeClass('is-invalid');\r\n }\r\n }", "function checkLastname(last...
[ "0.80264604", "0.7805189", "0.76362836", "0.75888795", "0.7405746", "0.73046535", "0.72755975", "0.72414684", "0.7209411", "0.7102709", "0.7069313", "0.7036218", "0.70131433", "0.700729", "0.6999228", "0.6996242", "0.6995505", "0.6951506", "0.6903478", "0.6891342", "0.6877650...
0.77106786
2
Validate the card number. Called when the card number field is blurred.
function validateCardNumber(){ var nameFormat = /^\d{4}-\d{4}-\d{4}-\d{4}$/; // Regex to indicate that the card number should be of the form xxxx-xxxx-xxxx-xxxx where x is a numerical digit. var errorFormat = /Invalid Card Number<br>/; var cardNumber = document[formName]["cardNumber"].value; var errorString=""; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateCard () {\n\n isValid(cardNumInput);\n isCardValid = true;\n\n if (paymentSelect.value === 'credit card') {\n if (!/^\\d{13,16}$/.test(cardNumInput.value)) {\n isInvalid(cardNumInput);\n isCardValid = false;\n }\n }\n}", "function validateCard(elem...
[ "0.766393", "0.71440065", "0.7000103", "0.6950335", "0.68227506", "0.67926615", "0.6721468", "0.66427326", "0.65940267", "0.65869427", "0.65733445", "0.6563983", "0.6563983", "0.6512074", "0.65059227", "0.6501664", "0.6473416", "0.64557976", "0.64500046", "0.6444231", "0.6425...
0.73048186
1
Validate the Expiry date. Called when the expiry date field is blurred.
function validateExpiryDate(){ console.log("Expiry" ); var nameFormat = /^\d{4}-\d{2}-\d{2}$/; // Regex to indicate that the expiry date is of the form yyyy-mm-dd. var errorFormat = /Invalid Expiry Date<br>/; var expiryDate = document[formName]["expiryDate"].value; var errorString=""; if(!nameFormat.test(expir...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validate_expiry()\n{\n\t//var validformat=/^\\d{2}\\-\\d{2}\\-\\d{4}$/ //Basic check for format validity\n\tvar today = new Date();\n var maxDate = new Date(today.getFullYear(), today.getMonth(), today.getDate()+parseInt(maximumDate));\n\tvar returnval=false\n\t\n\t//var monthfield=$(\"#datepicker\").v...
[ "0.7473098", "0.7404604", "0.72402024", "0.72384745", "0.67916584", "0.6486654", "0.644915", "0.64439243", "0.64128983", "0.6220362", "0.6160588", "0.61192346", "0.6046062", "0.6043503", "0.59508365", "0.5939187", "0.5899159", "0.58854395", "0.5885244", "0.58710206", "0.58689...
0.757257
0
Validate the CVV. Called when the Cvv field is blurred.
function validateCvv(){ var nameFormat = /^\d{3}$/; // Cvv to contain only 3 numerical digits. var errorFormat = /Invalid Cvv<br>/; var cvv = document[formName]["cvv"].value; var errorString=""; if(!nameFormat.test(cvv)) { if(!errorFormat.test(document.getElementById(p1).innerHTML)) errorString += "I...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateCVV(field, value) {\n const hint = document.getElementById('cvv-hint');\n if(!isValidCVV(value)) {\n showError(field, hint);\n } else {\n hideError(field, hint);\n }\n}", "function validateCVV () {\n\n isValid(cvvInput);\n isCvvValid = true;\n \n if ...
[ "0.7491824", "0.7463781", "0.73135513", "0.697766", "0.6977372", "0.69641316", "0.66966367", "0.66051084", "0.6399723", "0.6242283", "0.6241087", "0.62111974", "0.6189223", "0.6077249", "0.5931789", "0.5875877", "0.5762771", "0.5720163", "0.5659115", "0.5492947", "0.5381759",...
0.6915131
6
Produces a string containing all the items for which there is an invalid quantity Called by the submission function.
function quantityErrorString() { var error = "" ; for (var i = 0; i<items.length; i++) { var quantity = parseInt(document.forms[formName][numberName[i]].value,10); if(quantity < 0 || quantity > maxQuantity) { error +="Please enter between 0 and 10" + formalNames[i] + "<br>"; } } return error; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateQuantity() {\n\tfor (var i = 0; i<items.length; i++) {\n\t\tvar quantity = parseInt(document.forms[formName][numberName[i]].value, 10);\n\t\tif(quantity < 0 || quantity > maxQuantity) {\n\t\t\tdocument.getElementById(\"total\").innerHTML = \"Please enter a valid (between 0 and 10) \" + formalNames...
[ "0.6639201", "0.589844", "0.58484924", "0.5738569", "0.56822044", "0.5662052", "0.56444955", "0.56413925", "0.56169105", "0.560696", "0.5534791", "0.552453", "0.55040276", "0.54888046", "0.5471486", "0.5424016", "0.5376073", "0.53708655", "0.5370461", "0.53578883", "0.5351273...
0.7508699
0
Validates if all the items have valid quantities. Called when a quantity field is blurred. If a quantity is invalid an error message is displayed and the validquantities flag is set to false. If all quantities are valid the calidquantities flag is set to true and the calculate total field is called to update the total ...
function validateQuantity() { for (var i = 0; i<items.length; i++) { var quantity = parseInt(document.forms[formName][numberName[i]].value, 10); if(quantity < 0 || quantity > maxQuantity) { document.getElementById("total").innerHTML = "Please enter a valid (between 0 and 10) " + formalNames[i]; validQuantiti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateQuantity() {\n var formId = '#load-editing-form';\n if ($('#load-editing-form').length == 0) {\n formId = '#load-announcement-form';\n }\n\n var quantities = countCarQuantities();\n $.each($('.car-quantity select'), function (index) {\n var id = 'loadcar-' + index + '-...
[ "0.6725486", "0.6342559", "0.6111401", "0.606009", "0.5905377", "0.5873835", "0.5862625", "0.5845862", "0.5840827", "0.5783392", "0.5758798", "0.5732231", "0.57275695", "0.57122207", "0.5704817", "0.5684183", "0.56416035", "0.5610044", "0.55669343", "0.55571365", "0.5556188",...
0.7484392
0
Calculates the total order amount based on the quantity and size of each item ordered as well as condiments selected. If a quantity is invalid this function has no effect and the total price is not displayed. If all quantities are valid, the total price is displayed and the price is returned.
function calculateTotal() { if(validQuantities == false) return; var totalPrice = 0; for (var i = 0; i< items.length; i++){ var size = document.forms[formName][sizeName[i]].value; var quantity= parseInt(document.forms[formName][numberName[i]].value, 10); var itemPrice = 0; console.log(size +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CalculateTotal(objQuantity, unitPrice) {\n var quantity = 0;\n //if (parseInt(objQuantity.value) < 1 || isNaN(objQuantity.value)) { quantity = 1; objQuantity.value = 1; }\n //Commented above line of code and added below after modifying w.r.t task #256\n if (parseInt(objQuantity.value) < 1 || i...
[ "0.6338186", "0.61556953", "0.61389744", "0.61326873", "0.6073156", "0.6014756", "0.60097325", "0.5993468", "0.59884053", "0.59884053", "0.59808743", "0.58917946", "0.5840132", "0.58360803", "0.5725006", "0.57154006", "0.5680175", "0.56726646", "0.56597996", "0.5654175", "0.5...
0.7173931
0
Called when the webpage is loaded. initializes arrays used for computation. sets the function changeHeadingColor() to be called every 5s.
function initialize() { interval = setInterval(changeHeadingColor, 5000); alert("Welcome to my restaurant"); for(var i = 0; i<items.length; i++) { numberName.push("num"+items[i]); sizeName.push("size" + items[i]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initializeWebpage() {\r\n drawGridLines();\r\n drawGridLines();\r\n initArray();\r\n populateGameGrid(gameGrid);\r\n // Add any necessary functionality you need for the Reach portion below here\r\n }", "function setValues(){\n pageload();\n dataUpdate(User...
[ "0.67919135", "0.6140018", "0.5982026", "0.5963299", "0.5942361", "0.5896467", "0.5836516", "0.5811679", "0.57820904", "0.5774992", "0.5758595", "0.57340807", "0.5716223", "0.57071054", "0.56947136", "0.56746477", "0.56665856", "0.5664984", "0.5654924", "0.56337994", "0.56251...
0.59111965
5
Plugging in the AREA template cards for the Area divs
function populateAreas(areaData){ console.log("poparea is running"); let newAreaDiv = document.createElement("div"); newAreaDiv.innerHTML = areaTemplate(areaData); $('#areaCont').html(newAreaDiv); console.log($('#areaCont')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAreas() {\n\tlet scalingFactor = Math.min(clientWidth / 1200, clientHeight / 1000);\n\t// Change the blocks' size according to the input surface area\n\tlet size1 = Math.min(48, 5 + Math.sqrt(area1) * scalingFactor * 8) + \"px\";\n\tlet size2 = Math.min(48, 5 + Math.sqrt(area2) * scalingFactor * 8) + \...
[ "0.6169991", "0.58508474", "0.5823156", "0.5715068", "0.5714198", "0.5700098", "0.5691651", "0.5689493", "0.56876343", "0.56475294", "0.559922", "0.5580753", "0.55726916", "0.5569036", "0.55433375", "0.5537424", "0.5486876", "0.5466086", "0.5452849", "0.5442422", "0.5442098",...
0.5967651
1
Plugging in the information for the Desctription Area
function populateDescription(descData){ console.log(descData); let newDescriptionDiv = document.createElement("div"); newDescriptionDiv.innerHTML = descriptionTemplate(descData); $('#descriptionArea').html(newDescriptionDiv); console.log($('#descriptionArea')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setDescriptionTemplate(){\r\n CKEDITOR.instances.app_bundle_product_form_longDescription.setData(`<p>Your satisfaction is our number one goal. Keep in mind that we offer hassle-free returns if needed. If you have any questions or problems, please contact us.</p>\r\n\r\n<p>Please Note: All included ...
[ "0.6124171", "0.6076673", "0.5882501", "0.5839956", "0.5834282", "0.57955176", "0.5768288", "0.57550144", "0.57428855", "0.5742322", "0.5732901", "0.57244897", "0.56945086", "0.5687021", "0.56834954", "0.5681869", "0.56721723", "0.5659933", "0.56433344", "0.5632334", "0.56202...
0.5420523
59
For compatibility and usage outside of module systems, make the Handlebars object a namespace
function create() { var hb = new base.HandlebarsEnvironment(); Utils.extend(hb, base); hb.SafeString = _handlebarsSafeString2['default']; hb.Exception = _handlebarsException2['default']; hb.Utils = Utils; hb.escapeExpression = Utils.escapeExpression; hb.VM = runtime; hb.template = function (spec) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handlebars(hljs) {\n var BUILT_INS = {'builtin-name': 'each in with if else unless bindattr action collection debugger log outlet template unbound view yield lookup'};\n\n var IDENTIFIER_PLAIN_OR_QUOTED = {\n begin: /\".*?\"|'.*?'|\\[.*?\\]|\\w+/\n };\n\n var EXPRESSION_OR_HELPER_CALL = hljs.inheri...
[ "0.6172546", "0.604681", "0.604681", "0.604681", "0.604681", "0.60276735", "0.60271466", "0.59807104", "0.59807104", "0.59807104", "0.59807104", "0.59807104", "0.59807104", "0.59807104", "0.59807104", "0.59807104", "0.59807104", "0.59807104", "0.5933552", "0.59230536", "0.591...
0.585121
42
Older IE versions do not directly support indexOf so we must implement our own, sadly.
function indexOf(array, value) { for (var i = 0, len = array.length; i < len; i++) { if (array[i] === value) { return i; } } return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "indexOf(val) {}", "function _indexOf(a,s){\n\t// Do we need the hack?\n\tif(a.indexOf){\n\t\treturn a.indexOf(s);\n\t}\n\n\tfor(var j=0;j<a.length;j++){\n\t\tif(a[j]===s){\n\t\t\treturn j;\n\t\t}\n\t}\n\treturn -1;\n}", "indexOf(data) {}", "indexOf(elemento){}", "function indexOf(val) {\n return this.in...
[ "0.79164463", "0.77106816", "0.747478", "0.7374453", "0.7154309", "0.7046932", "0.6903651", "0.6882808", "0.6882808", "0.6859151", "0.68189937", "0.68133277", "0.67676383", "0.6753085", "0.67432564", "0.6736804", "0.66630554", "0.66630554", "0.66630554", "0.66630554", "0.6647...
0.0
-1
get each answer score
function answerScore (qName) { var radiosNo = document.getElementsByName(qName); for (var i = 0, length = radiosNo.length; i < length; i++) { if (radiosNo[i].checked) { // do something with radiosNo var answerValue = Number(radiosNo[i].value); } } // change NaNs to zero if (isNaN(answerValue)) {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scoreAnswers(){}", "answerScore (index) { return this.answers[index].score; }", "calculateScore () {\n this.allCorrectAnswers = {};\n this.allSelectedAnswers = readFromCache('selectedAnswers');\n this.quizData.map((qA) => {\n const correctAnswers = [];\n for (const [key, value] of O...
[ "0.8055512", "0.76779217", "0.73948604", "0.71932644", "0.7123344", "0.710924", "0.70938146", "0.7022943", "0.7020471", "0.700674", "0.6984659", "0.69447523", "0.6898365", "0.68646914", "0.6803988", "0.6776057", "0.67657644", "0.6756604", "0.67517823", "0.67514825", "0.673050...
0.0
-1
Get data for a specific book and the bookId is urlparameter
function init() { searchBookFactory.getBookById(bookId) .success(function (book) { $scope.book = book; }) .error(function (data, status, headers, config) { $log.log(data.error + ' ' + status); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchBook() {\n Books.get($stateParams.id)\n .then(function(book) {\n $scope.book = book;\n })\n .catch(function(error) {\n $scope.error = error;\n });\n }", "function getSingleBook(request, response) {\n // console.log...
[ "0.7250035", "0.71678466", "0.7133421", "0.7052913", "0.68188024", "0.6815213", "0.68138534", "0.67308897", "0.6722944", "0.6719762", "0.6708889", "0.6697052", "0.66697043", "0.66408944", "0.6610648", "0.6607349", "0.65196764", "0.6517627", "0.65110654", "0.64827716", "0.6425...
0.0
-1
Notification system for debugging
function AlertMessageService() { this.ALERT_IMG = "http://www.mozilla.com/favicon.ico"; this.displayMessage = function(msg) { var text = msg; var title = "Debugging Notification"; var icon = this.ALERT_IMG; if (typeof(msg) == "object") { text = msg.text; if (msg.title) title =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Notification(){}", "function TurbulenzGameNotifications() {}", "function Notification() {\n\t\n}", "function Notification() {\n\n }", "function Notification() {\n\n}", "setupNotifications() {\n dojo.subscribe('pawnMoved', this, 'notifPawnMoved');\n dojo.subscribe('pawnEa...
[ "0.74033463", "0.7284606", "0.71543837", "0.6956215", "0.6809018", "0.6798839", "0.6464367", "0.63777876", "0.6363266", "0.63068956", "0.6282624", "0.6270774", "0.6245002", "0.6244502", "0.6198938", "0.6198824", "0.61626065", "0.6140005", "0.61094236", "0.609663", "0.60831815...
0.0
-1
Set loading bar visibility
function setLoading(state) { if (state) { $("#loading-bar").removeClass("hidden"); } else { $("#loading-bar").addClass("hidden"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_setLoadingIndicatorVisibility() {\n const that = this;\n\n if (that.displayLoadingIndicator) {\n that.$.loadingIndicatorContainer.classList.remove('jqx-visibility-hidden');\n return;\n }\n\n that.$.loadingIndicatorContainer.classList.add('jqx-visibility-hidden');\...
[ "0.8345595", "0.82725614", "0.79128534", "0.7691062", "0.76364607", "0.76230156", "0.7569523", "0.7539895", "0.75083447", "0.74651366", "0.74494636", "0.73587304", "0.73587304", "0.7351448", "0.73154426", "0.729788", "0.72699225", "0.7265808", "0.7257437", "0.72428966", "0.72...
0.8041161
2
Write a function to subtract the values from these text fields and display the result in the div named "result". HTML and JavaScript Code Implement the above to provide the following functionality: Your function should take the values of "firstNumber" and "secondNumber", convert them to numbers, subtract the second num...
function subtract() { let num1 = +(document.getElementById('firstNumber').value); let num2 = +(document.getElementById('secondNumber').value); document.getElementById('result').textContent = num1 - num2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function subt() {\n var a = parseInt(firstNum.value);\n var b = parseInt(secondNum.value);\n var nah = a - b;\n let resultDiv = document.getElementById(\"result\"); \n resultDiv.innerHTML = nah;\n}", "function subtractNumbers() {\r\n const result = document.getElementById(\"addResult\");\r\n\r...
[ "0.7339941", "0.7259126", "0.72527003", "0.720503", "0.71466386", "0.69549596", "0.68982905", "0.68549544", "0.6786087", "0.6755842", "0.67322177", "0.66949314", "0.66759425", "0.6603689", "0.658853", "0.6557833", "0.6538391", "0.6534804", "0.65322554", "0.6508899", "0.650659...
0.8273019
0
Returns a promise: done if associated html element has override, reject if element has the no override
function validateOverride(dataid, columnName, owner) { var deferred = $.Deferred(); var myObject = new Object(); myObject.dataid = dataid; var devUrl = "MapUtilService.asmx/GetOverridePrecedence"; var deploymentUrl = common.deploymentUrl(devUrl);//common.deploymentUrl(de...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function waitForElementIfNotPresent(selector, ancestor) {\n return domReadyPromise.then(function() {\n if ($(selector).length > 0) {\n return resolvedPromise;\n }\n\n var defer = $.Deferred();\n $(ancestor).arrive(selector, { onceOnly: true }, funct...
[ "0.6089074", "0.5336577", "0.52505213", "0.50532943", "0.50336534", "0.5031187", "0.49802583", "0.4937309", "0.49332896", "0.49231362", "0.4871053", "0.4802522", "0.4737829", "0.47370464", "0.47023946", "0.46956047", "0.4686529", "0.46801293", "0.46801293", "0.4672152", "0.46...
0.5412271
1
Reject if there is no handshake , otherwise resolve.
function validateHandshake(originalValue, observable) { var deferred = $.Deferred(); var devUrl = "MapUtilService.asmx/ProcessHandshake"; var deploymentUrl = common.deploymentUrl(devUrl); //common.deploymentUrl(devUrl); var myObject = new Object(); myObject.dataid = obse...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "[kHandshake](\n servername,\n alpn,\n cipher,\n cipherVersion,\n maxPacketLength,\n verifyErrorReason,\n verifyErrorCode,\n earlyData) {\n const state = this[kInternalState];\n state.handshakeComplete = true;\n state.servername = servername;\n state.alpn = alpn;\n state.ciphe...
[ "0.5817598", "0.56027776", "0.5516293", "0.55038136", "0.54745406", "0.5389791", "0.5379727", "0.53702044", "0.53150666", "0.52409977", "0.52319324", "0.52233875", "0.5206122", "0.5202919", "0.51585877", "0.5121493", "0.51162636", "0.5109665", "0.5105874", "0.5105874", "0.510...
0.0
-1
evaluate redirect flag (if is clicked) then whether
render() { const { content, redirect } = this.props; const { isHovering, auth, remove } = this.state; const path = this.getURL(); return ( <Fragment> {redirect && <Redirect to={`/user/${path}/review`} />} {remove ? null : ( <ReviewElement setReview={this.set...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isRedirect (res) {\n return (\n statuses.redirect[res.status] ||\n (res.get('Location') && !res.get('Refresh'))\n )\n}", "function checkForRedirect() {\n const redirectError = document.querySelector('#error .impatient a[href]');\n if (redirectError) {\n const archiveUrl = getArchiveUrl(redi...
[ "0.66974473", "0.6557247", "0.6322536", "0.6188094", "0.61052144", "0.6074426", "0.6017887", "0.5972265", "0.59624726", "0.5958856", "0.58993685", "0.5865976", "0.58496726", "0.5826176", "0.5824861", "0.57996917", "0.5769584", "0.5756236", "0.5735404", "0.5722555", "0.5719473...
0.0
-1
Use Check Content in Text Editer
function CheckContent(field, rules, i, options) { ///Get Contents from Text Editer var text = tinyMCE.activeEditor.getContent({ format: 'text' }); ///Remove extra spaces from text text = $.trim(text); ///Check Lenght of text if (text.length == 0) { $("#Area_Text").val(''); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testOutput(text, check) {\n checkBlock.innerHTML += '<p><span class=\"code\">' + text.substring(0, text.indexOf(')') + 1) + \"</span>\" + text.substring(text.indexOf(')') + 1, text.length) + ': <span class=\"' + check + '\">' + e.cap(check) + '!</span></p><hr/>';\n }", "function esBasics(){ askAbout...
[ "0.5986215", "0.59792334", "0.5757698", "0.56649685", "0.5656774", "0.56250894", "0.5609479", "0.55947214", "0.55902386", "0.5575247", "0.55402863", "0.5514972", "0.54992926", "0.54929376", "0.54754364", "0.54636055", "0.5462495", "0.5433841", "0.54123133", "0.5409838", "0.54...
0.60979676
0
Use Check Charecters only
function CheckCharecters(field, rules, i, options) { ///Assign a Reguler experassion in a variable var regex = /^\D+$/; ///Match Reguler expression with user input data if (!regex.test(field.val())) { ///Show Message if Invalid Information return "Please Enter Charecters Only." } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check() {}", "function check_and_report() {\n \n }", "function check3 (){\n\n}", "checkAll() {\n this.checkEnyo(this.props.example.resultEnyo)\n ? this.setEnyoCheckState('OK')\n : this.setEnyoCheckState('KO');\n this.checkCSS(this.props.example.resultCSS)\n ? this.setCss...
[ "0.71867985", "0.6411459", "0.63418084", "0.6122642", "0.60049915", "0.59717345", "0.5955439", "0.59385276", "0.5923876", "0.59157693", "0.5892502", "0.58711076", "0.58383757", "0.5828816", "0.58278066", "0.58230656", "0.5813088", "0.5808063", "0.57952464", "0.578155", "0.577...
0.6224259
3
Use Check Numbers only
function CheckNumbers(field, rules, i, options) { ///Assign Reguler experassion in a variable var regex = /^[0-9]+$/; //Match Reguler expression with user input data if (!regex.test(field.val())) { ///Show Message if Invalid Information return "Please Enter Numbers Only." } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function only_num(i, number) {\n return number > 0;\n }", "function only_num(i, number) {\n return number > 0;\n }", "function checkNumber (input, error, extra) {\n if (input.length > extra) {\n return true\n }\n error.classList.remove('...
[ "0.68071854", "0.68071854", "0.6512688", "0.6510538", "0.64325386", "0.6411073", "0.64093894", "0.63346714", "0.6306238", "0.62897295", "0.6283729", "0.62751734", "0.62258375", "0.62253195", "0.6220162", "0.6203696", "0.61641335", "0.6160762", "0.61429274", "0.6140465", "0.61...
0.6605496
2
Use for Check URL
function checkUrl(field, rules, i, options) { //regular expression for URL var regex = /([\d\w]+?:\/\/)?([\w\d\.\-]+)(\.\w+)(:\d{1,5})?(\/\S*)?/; //Match Reguler expression with user input data if (!regex.test(field.val())) { ///Show Message if Invalid Information return "Please Enter Va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validator_url(x){\n \n }", "function checkUrl(){\n // get hash the URL\n var hash = window.location.hash;\n // check if something is in the hash\n if (hash){\n var splitted = hash.split(\"/\");\n if (splitted.length == 3){\n var ...
[ "0.734758", "0.7306276", "0.71377754", "0.7025711", "0.7018348", "0.6909156", "0.69023687", "0.6900793", "0.67811316", "0.6780049", "0.67609537", "0.6734081", "0.6733607", "0.67302674", "0.67132384", "0.66913545", "0.66646427", "0.6663128", "0.6652607", "0.66448283", "0.66360...
0.6794885
8
Use for Check Float Type Data
function CheckFloatDataType(field, rules, i, options) { ///Assign a Reguler experassion in a variable var regex = /([\d\w]+?:\/\/)?([\w\d\.\-]+)(\.\w+)(:\d{1,5})?(\/\S*)?/; //Match Reguler expression with user input data if (!regex.test(field.val())) { ///Show Message if Invalid Information ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isFloat(n){\n\t return parseFloat(n.match(/^-?\\d*(\\.\\d+)?$/))>0;\n\t}", "function isFloat(n){ //fonction pour n'avoir que des chiffres.\n return n != \"\" && !isNaN(n) && n !==0;\n}//fin de la fonction", "isFloat(val) {\n return !isNaN(Number(val)) && Number(val) % 1 !== 0;\n }", ...
[ "0.77009946", "0.7687334", "0.75535554", "0.7415548", "0.7406354", "0.7314367", "0.7224578", "0.72241014", "0.71900225", "0.71888566", "0.71576", "0.71477216", "0.71214366", "0.70918125", "0.7086218", "0.7075713", "0.7075713", "0.7075713", "0.7075713", "0.7075713", "0.7052597...
0.7173763
10
Use for Check Form Validation on click
function IsvalidForm() { ///Apply Bootstrap validation with Requird Controls in Input Form var result = jQuery('#InputForm').validationEngine('validate', { promptPosition: 'topRight: -20', validateNonVisibleFields: true, autoPositionUpdate: true }); ///If all requird Information is Given if (result) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function activerBouttonValidation(){\n\t activerChamp(ID_BOUTON_VALIDER);\n\t $(ID_BOUTON_VALIDER).removeClass(\"disabled\");\n\t $(ID_BOUTON_VALIDER).click(function(){\n\t \tactiverChargementPage();\n\t \tsubmit();\n\t });\n }", "function validation() {\r\n\t\t\r\n\t}", "function validarR...
[ "0.7093027", "0.7011755", "0.6899994", "0.67671275", "0.666763", "0.664752", "0.66250724", "0.662263", "0.65977424", "0.6573163", "0.65161705", "0.65039015", "0.64888334", "0.6485514", "0.64818156", "0.6480837", "0.64774734", "0.64487165", "0.6441019", "0.64254284", "0.641000...
0.6534269
10
Use For Reset Input Form
function ResetFields() { ///reset form jQuery('#form1')[0].reset(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reset(input) {\n // YOUR SOLUTION HERE\n}", "function reset() {\n tfInput.value = \"\";\n tfResultado.value = \"\";\n taLogArea.value = \"\";\n numPrevio = 0;\n numActual = 0;\n numAcumulado = 0;\n strOperacion = \"\";\n cOperador = \"\";\n}", "function formReset() {\n\tvalue = 0;\n\t$progres...
[ "0.80261344", "0.77729726", "0.7680169", "0.76184285", "0.7599951", "0.7595654", "0.7561989", "0.7552861", "0.75273293", "0.75144285", "0.74829185", "0.7480588", "0.7474514", "0.7460127", "0.74351054", "0.7424545", "0.741227", "0.74037117", "0.7397251", "0.73870856", "0.73643...
0.0
-1
Holds the javascript to validate user form on client side author: Josh Varone Validate the form in Javascript, clientside
function validateAccount(form) { //error variable holds all error messages error = validateFirstName(form.firstName.value); error += validateLastName(form.lastName.value); error += validateEmail(form.email.value); error += validateUsername(form.username.value); error += validateAddress(form.addr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateForm()\n{\n return true;\n}", "function validateForm()\n{\n return true;\n}", "function validateForm() {\n return true;\n}", "function jsFormValidate(oForm) {\n if ($(\"#\" + oForm).valid()) {\n // sessionStorage.getItem(\"LoginType\");\n ShowProgressBar();\n ...
[ "0.7201735", "0.7201735", "0.7129398", "0.70982796", "0.68960506", "0.68907744", "0.6855187", "0.68056285", "0.6750926", "0.6722024", "0.66824657", "0.6670272", "0.6667975", "0.6647533", "0.6576117", "0.6555658", "0.6539378", "0.6516783", "0.64938635", "0.64937925", "0.648569...
0.0
-1
Make sure first name entry is valid
function validateFirstName(field) { //Make sure field is not blank if(field == "") return "Please specify your first name.\n"; //Return an error if invalid input if(!/^[a-zA-Z ,.'-]+$/.test(field)) return "Invalid characters in first name.\n"; return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validate_newFirstName(fname)\n{\n if (fname === null || fname === '') {\n index = index + 1;\n errorsList[index] = 'First name required';\n return false;\n }\n else if (!fname.match(nameRegExp)) {\n index = index + 1;\n errorsList[index] = 'Invalid first name';\...
[ "0.7564959", "0.7474964", "0.7449707", "0.7316228", "0.72998667", "0.72256196", "0.7150712", "0.7099803", "0.7066053", "0.7022558", "0.7017714", "0.7001299", "0.696567", "0.6963884", "0.69599915", "0.6957018", "0.69382566", "0.6934324", "0.6902947", "0.6883246", "0.68622416",...
0.7229008
5
Make sure last name entry is valid
function validateLastName(field) { //Make sure field is not blank if(field == "") return "Please specify your last name.\n"; //Return an error if invalid input if(!/^[a-zA-Z ,.'-]+$/.test(field)) return "Invalid characters in last name.\n"; return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validate_newLastname(lname)\n{\n if (lname === null || lname === '') {\n index = index + 1;\n errorsList[index] = 'Last name required';\n return false;\n }\n else if (!lname.match(nameRegExp)) {\n index = index + 1;\n errorsList[index] = 'Invalid last name';\n ...
[ "0.77728635", "0.7633152", "0.7624674", "0.7556702", "0.7390978", "0.7205413", "0.71046823", "0.7098208", "0.7096051", "0.70602065", "0.7027306", "0.7024914", "0.6960371", "0.69401425", "0.6917579", "0.68933797", "0.689103", "0.68783534", "0.6859161", "0.68502355", "0.6785350...
0.7241976
5
Make sure email entry is valid
function validateEmail(field) { //Make sure field is not blank if(field == "") return "Please specify an email address.\n"; //Return an error if invalid input emailRegex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]+)+$/; if(!emailRegex.test(field)) return "Invalid email address given...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkEmail() {\r\n const emailValue = email.value.trim();\r\n\r\n var mailformat = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/;\r\n if (emailValue === '' || !emailValue.match(mailformat)) {\r\n isValid &= false;\r\n setErrorFor(email, 'Email not valid');\...
[ "0.776838", "0.77602834", "0.77218187", "0.77061427", "0.7658911", "0.7567795", "0.75189465", "0.74835527", "0.74346733", "0.7434312", "0.7428489", "0.7428397", "0.74222624", "0.73956543", "0.7365525", "0.73652273", "0.73566", "0.73549217", "0.73352724", "0.7332472", "0.73241...
0.0
-1
Make sure username entry is valid
function validateUsername(field) { //Make sure field is not blank if(field == "") return "Please specify a username.\n"; //Return an error if invalid input if(!/^[a-zA-Z0-9]+$/.test(field)) return "Invalid characters in username.\n"; return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateUsername() {\n\n\t// Comprobamos si esta vacio\n\tif (checkIfEmpty(username)) return;\n\n\t// Comprobamos RegEx\n\tif (!checkUsername(username)) return;\n\t\n\treturn true;\n}", "function isValidName(username) {\n return /^[A-z ]+$/.test(username);\n }", "function validate_username(usernam...
[ "0.8198741", "0.8030771", "0.801717", "0.7995104", "0.79726785", "0.7790351", "0.7769948", "0.7730576", "0.7729256", "0.77225846", "0.7721412", "0.7714022", "0.7708268", "0.77047545", "0.76960266", "0.76842487", "0.7683024", "0.767617", "0.76720333", "0.76674706", "0.7662466"...
0.7614576
27
Make sure address entry is valid (not blank)
function validateAddress(field) { //Make sure field is not blank; unable to validate anything beyond that. if(field == "") return "Please specify your address.\n"; return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkValidAddress (){\n \"use strict\";\n UpdateAddressInfor();\n if(address.firstName.value == \"\" || address.lastName.value == \"\" || address.streetName.value == \"\" || address.streetNumber == \"\" || address.postcode.value == \"\" || address.city.value == \"\"){\n return false;\n ...
[ "0.7799065", "0.7425289", "0.7372909", "0.7369461", "0.72570574", "0.7245597", "0.7140729", "0.71217924", "0.7080485", "0.70564365", "0.7043105", "0.70415133", "0.70415133", "0.70373416", "0.69981897", "0.6951761", "0.69175684", "0.68590355", "0.6841477", "0.6805994", "0.6757...
0.72597235
4
Graphing / visualization: Width / height are values exposed from the createCanvas fn. That is to say, the canvas is 700px wide by 400px tall
function setup() { createElement("h2", "Quick Sort Visualization"); createCanvas(700, 400); values = new Array(floor(width / w)); for (let i = 0; i < values.length; i++) { values[i] = random(height); } quickSort(values, 0, values.length - 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupCanvasSize() {\n margin = {top: 20, left: 80, bottom: 20, right: 100};\n width = 350 - margin.left - margin.right;\n height = 300 - margin.top - margin.bottom;\n}", "function setupCanvasSize() {\n margin = {top: 0, left: 80, bottom: 20, right: 30};\n width = 960 - margin.left - margin.right;\n...
[ "0.7377299", "0.723892", "0.72355056", "0.7179241", "0.7111696", "0.7111696", "0.6993865", "0.6993438", "0.6966048", "0.6905352", "0.68270224", "0.67591316", "0.6747196", "0.6724032", "0.6707757", "0.66602534", "0.66465867", "0.66401154", "0.6623026", "0.66197926", "0.6583633...
0.0
-1
Update all cached images, with the real ones
function updateImages() { /** * First get extension options, * and then update the images */ getOptions(update); function update(domains) { // Don't update images, if there aren't added domains if ( ! domains || domains.length === 0) { return; } $.each($('img'), function(key, value) { // Cache...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateCache() {\n this.imageCache.src = this.config.src;\n }", "function refreshImages() {\n var images = document.querySelectorAll('img[data-src]');\n\n for (var i = 0; i < images.length; i++) {\n ImageLoader.load(images[i]);\n }\n }", "function cacheImages() {\n\t\t$images = ...
[ "0.7810421", "0.7239295", "0.72273684", "0.6918044", "0.6766357", "0.67594576", "0.6667581", "0.663931", "0.6539157", "0.6475951", "0.6374254", "0.6333399", "0.6318118", "0.6310745", "0.631073", "0.6271186", "0.61969495", "0.61925346", "0.61872643", "0.6163016", "0.6161085", ...
0.71510804
3
text div for responses from the server
function setup() { // create the shutter button, position it, and give it a callback: shutterButton = createButton('shutter'); shutterButton.position(windowWidth/2, 20); shutterButton.touchEnded(getShutter); // create the message div and position it: messageDiv = createDiv("waiting for messages"); message...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getResponse(data) {\n responseDiv.innerHTML = data;\n}", "function renderMessage(text) {\n document.getElementById('res').innerHTML = text;\n}", "function response(err, data) {\n if (err) {\n console.err(err);\n }\n showText(data[0].label);\n}", "function draw_command_sent(response_text){\...
[ "0.7247315", "0.70501566", "0.69887054", "0.6909591", "0.68842167", "0.6800545", "0.6765649", "0.67016983", "0.66999364", "0.66963696", "0.6685733", "0.6673938", "0.6661676", "0.6647363", "0.663141", "0.663141", "0.6622235", "0.6568072", "0.65392137", "0.65267575", "0.6515287...
0.0
-1
callback function for the shutter button:
function getShutter() { httpGet('/click', 'text', clickDone); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hitShutter(){\n digitalWrite(PIN_SHUTTER, 1);\n digitalWrite(PIN_LED_BLUE, 1);\n setTimeout(function(){\n digitalWrite(PIN_SHUTTER, 0);\n digitalWrite(PIN_LED_BLUE, 0);\n },300); //button press duration\n}", "function ActiveShutter(thisObj)\r\n\t{\r\n\t\tvar activeShutterData = new Object();...
[ "0.7126301", "0.61803454", "0.583379", "0.58066714", "0.57654", "0.57490486", "0.57482743", "0.56875086", "0.5679558", "0.5653177", "0.56090504", "0.56055486", "0.5574048", "0.55266595", "0.5509051", "0.54635817", "0.5453303", "0.54514366", "0.5441784", "0.5437968", "0.543564...
0.58342755
2
callback function for httpGet() request:
function clickDone(data) { messageDiv.html("server response: " + data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get(url, callback) {}", "function httpGet(theUrl, callback){\n request(theUrl, function (error, response, body){\n\n\t\tif (!error && response.statusCode == 200){\n\t\t \tcallback(body) // Call the callback function passed in\n\t\t}else if(response.statusCode == 403){\n\t\t\tconsole.log('ACCESS DENIED: This ...
[ "0.8059241", "0.770748", "0.7633182", "0.75760496", "0.74521154", "0.7320211", "0.7221519", "0.7207421", "0.71638185", "0.7157069", "0.71350896", "0.7076316", "0.706149", "0.7059325", "0.7044749", "0.7031658", "0.70259196", "0.6978337", "0.6971804", "0.6969834", "0.696653", ...
0.0
-1
create paginated report from details panel
function onDocXDetails(){ var controller = View.controllers.get('abRepmPfadminLsFinancialSumCtrl'); onDocX('abRepmPfadminLsFinancialSum_gridPanel', controller.ctry_code); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "displayRecordPerPage(page) {\n /*let's say for 2nd page, it will be => \"Displaying 6 to 10 of 23 records. Page 2 of 5\"\n page = 2; pageSize = 5; startingRecord = 5, endingRecord = 10\n so, slice(5,10) will give 5th to 9th records.\n */\n this.startingRecord = (page - 1) * this.pa...
[ "0.62048095", "0.61750543", "0.61750543", "0.612125", "0.6057928", "0.6020371", "0.6018133", "0.600388", "0.59515965", "0.59418386", "0.59221125", "0.5877877", "0.5871772", "0.5819529", "0.57987165", "0.5792589", "0.5763502", "0.57582545", "0.5744708", "0.5740709", "0.571413"...
0.0
-1
create paginated report from overview panel
function onDocXSum(){ onDocX('abRepmPfadminLsFinancialSum_gridPanel', null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _pagination_setPageData() {\r\n var _pagination = _data['pagination'];\r\n\r\n var _startIdx = _pagination['currentPage'] * _pagination['numElementsPerPage'];\r\n\r\n _pagination['current']['elyos'].empty().pushAll(_data['elyos'].slice(_startIdx, _startIdx + _pagination['numElementsPerPage'...
[ "0.62817174", "0.61962616", "0.6128215", "0.6128215", "0.60459596", "0.59411037", "0.5863566", "0.58034676", "0.57610804", "0.57569104", "0.5738466", "0.57360417", "0.57326406", "0.566928", "0.5667257", "0.5659091", "0.5658985", "0.5642331", "0.5554762", "0.5553627", "0.55360...
0.0
-1
TODO: rename to something less generic that is easier to grep
function stop(m, error) { if (error) { setTimeout(function () { return emitEvent(m, "unrecoverable_error", error); }, 17); } return set(m, "stopped", true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "find(input) {}", "function find() {}", "search (string) {\n\t\tlet lines = this.output.split('\\n');\n\t\tlet rgx = new RegExp(string);\n\t\tlet matched = [];\n\t\t// can't use a simple Array.prototype.filter() here\n\t\t// because we need to add the line number\n\t\tfor (let i = 0; i < lines.length; i++) {\n\...
[ "0.6243818", "0.60589224", "0.6032615", "0.6018877", "0.5659343", "0.55636513", "0.55031097", "0.5470653", "0.5451028", "0.54291433", "0.53815675", "0.5351704", "0.53461313", "0.5341041", "0.53203464", "0.5295039", "0.52838457", "0.5280503", "0.52397186", "0.5202639", "0.5197...
0.0
-1
TODO: this should handle icons, and everything. TODO: also there should be a similar fn for regular fields.
function registerOptionField(m, field, options, initialValue) { var valid = true, hasInitial = !initialValue, initialOption = void 0; options.forEach(function (x) { valid = valid && x.get("label") && typeof x.get("label") === "string" && x.get("value") && typeof x.get("value") === "string"; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function attFields() {\n\n\tlet code = '<div id=\"fieldadd\">';\n\tfor (i = 0; i < NAME_LIST.length; i++) {\n\n\t\tif (NAME_LIST[i] === 'color') {\n\n\t\t\tcode += '<div class=\"w3-col l3 m4 w3-padding\">'+ NAME_LIST[i] +':<a class=\"w3-text-red\">*</a><br>'+\n\t\t\t\t\t\t'<input type=\"color\" id=\"color\" value=...
[ "0.5940043", "0.5889784", "0.55914915", "0.5536542", "0.5511456", "0.54928994", "0.5484765", "0.54394895", "0.54257166", "0.53777784", "0.53777623", "0.5374809", "0.5361621", "0.5350444", "0.5345625", "0.5343097", "0.5330422", "0.5297353", "0.5297168", "0.52899706", "0.528292...
0.0
-1
TODO: only used in passwordless, when we update it to use validateAndSubmit this won't be needed anymore.
function setFieldShowInvalid(m, field, value) { return m.setIn(["field", field, "showInvalid"], value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleValidSubmit() {\n const { login } = this.props;\n const formData = this.state;\n this.register(formData.email, formData.password, formData.confirmPassword);\n }", "submit() {\n if (this.isValid()) {\n this.props.onSubmit({\n email: this.state[EMAIL_FIELD].value,\n ...
[ "0.7072913", "0.701996", "0.6927136", "0.68911105", "0.6722186", "0.6563261", "0.65486157", "0.65270436", "0.6504023", "0.64735514", "0.64463776", "0.64448774", "0.643069", "0.6413591", "0.63711894", "0.63565934", "0.6328246", "0.6274219", "0.6243615", "0.62324303", "0.622319...
0.0
-1
A function which returns a value representing an "owner" for transient writes to tries. The return value will only ever equal itself, and will not equal the return of any subsequent call of this function.
function OwnerID() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get owner() {\n return new User_1.default(this.data.owner, this.client);\n }", "function getOwner(){\n return owner;\n }", "get owner() { return this.ownerIn; }", "getOwner() {\n return this.currentOwner;\n }", "function lookupHash(owner) {\n var hash = ownerData.get(owner)...
[ "0.6106036", "0.6015336", "0.60108495", "0.57769084", "0.57563955", "0.57151484", "0.5643053", "0.56369644", "0.5578523", "0.5568767", "0.5534882", "0.54996806", "0.5460029", "0.53954214", "0.5384508", "0.5350391", "0.53399676", "0.53217036", "0.5303584", "0.5236557", "0.5232...
0.5617779
82
v8 has an optimization for storing 31bit signed numbers. Values which have either 00 or 11 as the high order bits qualify. This function drops the highest order bit in a signed number, maintaining the sign bit.
function smi(i32) { return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "function as_signed(value, bits) { var s = 32 - bits; retu...
[ "0.6923097", "0.6923097", "0.6923097", "0.6923097", "0.6923097", "0.6923097", "0.6923097", "0.6923097", "0.6923097", "0.6923097", "0.6923097", "0.6923097", "0.6923097", "0.6923097", "0.6923097", "0.6923097", "0.6923097", "0.6923097", "0.6923097", "0.6923097", "0.6923097", "...
0.0
-1
IE has a `uniqueID` property on DOM nodes. We can construct the hash from it and avoid memory leaks from the IE cloneNode bug.
function getIENodeHash(node) { if (node && node.nodeType > 0) { switch (node.nodeType) { case 1: // Element return node.uniqueID; case 9: // Document return node.documentElement && node.documentElement.uniqueID; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getIENodeHash(node){if(node&&node.nodeType>0){switch(node.nodeType){case 1: // Element\n\treturn node.uniqueID;case 9: // Document\n\treturn node.documentElement&&node.documentElement.uniqueID;}}} // If possible, use a WeakMap.", "function getIENodeHash(node){if(node&&node.nodeType>0){switch(node.nodeTy...
[ "0.7386984", "0.73721313", "0.73721313", "0.71632826", "0.71632826", "0.7009901", "0.7009901", "0.7009901", "0.7009901", "0.7009901", "0.7009901", "0.7009901", "0.7009901", "0.7009901", "0.7009901", "0.7009901", "0.7009901", "0.7009901", "0.7009901", "0.7009901", "0.7009901",...
0.7017885
24
Contributes additional methods to a constructor
function mixin(ctor, methods) { var keyCopier = function(key ) { ctor.prototype[key] = methods[key]; }; Object.keys(methods).forEach(keyCopier); Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(methods).forEach(keyCopier); return ctor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "function HelperConstructor() {}", "constructor(a, b, c) {\n super(a, b, c);\n }", "constructur() {}", "function ExtraMethods() {}", "function mixin(ctor,methods){var keyCopier=function keyCopier(key){ctor.proto...
[ "0.6711224", "0.6711224", "0.6711224", "0.66712135", "0.661554", "0.6549054", "0.6541559", "0.65297145", "0.65297145", "0.65297145", "0.6490964", "0.63391995", "0.6323375", "0.6320301", "0.6317812", "0.62991256", "0.6297659", "0.6291466", "0.6290314", "0.62786216", "0.6223624...
0.5982308
64
TODO: try to remove this fn
function updateCollection(state, coll, f) { for (var _len3 = arguments.length, args = Array(_len3 > 3 ? _len3 - 3 : 0), _key3 = 3; _key3 < _len3; _key3++) { args[_key3 - 3] = arguments[_key3]; } return state.update(coll, function (xs) { return f.apply(undefined, [xs].concat(args)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "static private internal fun...
[ "0.67125326", "0.6520185", "0.64978683", "0.6140048", "0.59758663", "0.5925934", "0.5864783", "0.583099", "0.5811348", "0.56604606", "0.5593165", "0.55582505", "0.55300313", "0.5488409", "0.53746635", "0.5368919", "0.5319434", "0.5217317", "0.5214214", "0.5201801", "0.5199822...
0.0
-1
Observer function / decorator
function observer(arg1, arg2) { if (typeof arg1 === "string") { throw new Error("Store names should be provided as array"); } if (Array.isArray(arg1)) { // component needs stores if (!warnedAboutObserverInjectDeprecation) { warnedAboutObserverInjectDeprecation = true; conso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Observer() {}", "function Observer(){\n this.update = function(){\n // ...\n };\n}", "addObserverFunc(func) {\n this.__notifyFunc.push(func);\n }", "notifyObservers(){}", "notifyObservers(){}", "notifyObservers(){}", "function Observer() {\n this.update = function () {\n ...
[ "0.7840305", "0.688439", "0.6875777", "0.67828315", "0.67828315", "0.67828315", "0.67482877", "0.66023284", "0.6394971", "0.63392055", "0.6294907", "0.6185566", "0.6160778", "0.61577857", "0.6130326", "0.6130326", "0.6100668", "0.605793", "0.6053924", "0.6040888", "0.5996026"...
0.5404918
89
higher order component that injects stores to a child. takes either a varargs list of strings, which are stores read from the context, or a function that manually maps the available stores from the context to props: storesToProps(mobxStores, props, context) => newProps
function inject() /* fn(stores, nextProps) or ...storeNames */{ var _arguments = arguments; var grabStoresFn = void 0; if (typeof arguments[0] === "function") { grabStoresFn = arguments[0]; return function (componentClass) { var injected = createStoreInjector(grabStoresFn, componentCla...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inject() /* fn(stores, nextProps) or ...storeNames */{\n\t\t var grabStoresFn = void 0;\n\t\t if (typeof arguments[0] === \"function\") {\n\t\t grabStoresFn = arguments[0];\n\t\t } else {\n\t\t var storesNames = [];\n\t\t for (var i = 0; i < arguments.length; i++) {\n\t\t storesNames[i] =...
[ "0.7482308", "0.7330899", "0.73112285", "0.72197366", "0.7208274", "0.71789765", "0.71660376", "0.71660376", "0.7152754", "0.6931035", "0.6856362", "0.6847183", "0.6719103", "0.6145518", "0.60108227", "0.5956127", "0.59411526", "0.5748873", "0.5717414", "0.56091577", "0.55988...
0.7212109
4
This handles more types than `getPropType`. Only used for error messages. Copied from React.PropTypes
function getPreciseType(propValue) { var propType = getPropType(propValue); if (propType === 'object') { if (propValue instanceof Date) { return 'date'; } else if (propValue instanceof RegExp) { return 'regexp'; } } return propType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. W...
[ "0.7693476", "0.7693476", "0.7682279", "0.7682279", "0.7682279", "0.7682279", "0.7679895", "0.7679895", "0.7679895", "0.7679895", "0.7679895", "0.7679895", "0.7679895", "0.7679895", "0.7679895", "0.7679895", "0.7679895", "0.7679895", "0.7679895", "0.7679895", "0.7679895", "...
0.0
-1
`parse()` Parse a UUID into it's component bytes
function parse(s, buf, offset) { var i = (buf && offset) || 0, ii = 0; buf = buf || []; s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) { if (ii < 16) { // Don't overflow! buf[i + ii++] = _hexToByte[oct]; } }); // Zero out remaining bytes if string was short while (ii < 16) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseUUID(uuid) {\n if (typeof uuid !== 'string') {\n throw new TypeError('Invalid type for UUID, expected string but got ' + typeof uuid);\n }\n if (!UUID_RX.test(uuid)) {\n throw new TypeError('Invalid format for UUID: ' + uuid);\n }\n let v;\n const arr = new Uint8Array(...
[ "0.7384558", "0.6504025", "0.6486697", "0.6460371", "0.6460371", "0.6008473", "0.58945024", "0.5759498", "0.57438576", "0.5729614", "0.5729614", "0.5725069", "0.5706968", "0.56981784", "0.56683767", "0.56683767", "0.56683767", "0.56683767", "0.56683767", "0.56683767", "0.5668...
0.0
-1
`unparse()` Convert UUID byte array (ala parse()) into a string
function unparse(buf, offset) { var i = offset || 0, bth = _byteToHex; return bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rawGetStrUuid4(binUuid4)\n{\n\tif(!rawIsSafeEntity(binUuid4) || !(binUuid4 instanceof Buffer)){\n\t\tbinUuid4 = rawGetBinUuid4();\n\t}\n\tvar\tparsed\t= binUuid4.toString('hex').match(/(.{8})(.{4})(.{4})(.{4})(.{12})/);\n\tparsed.shift();\t\t\t\t\t\t\t\t// first element is all, then skip it.\n\tvar\tstrUu...
[ "0.6613022", "0.6559673", "0.65545094", "0.65545094", "0.65503526", "0.65372753", "0.6511837", "0.6506906", "0.6490102", "0.64707506", "0.64707506", "0.64707506", "0.64707506", "0.64707506", "0.64707506", "0.64707506", "0.64707506", "0.64707506", "0.64707506", "0.64707506", "...
0.64307266
63
See for API details
function v1(options, buf, offset) { var i = buf && offset || 0; var b = buf || []; options = options || {}; var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // UUID timestamps are 100 nano-second units since the Gregorian epoch, // (1582-10-15 00:00). JSNumbers aren...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "obtain(){}", "function API(){}", "function API(){}", "private internal function m248() {}", "transient private internal function m185() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "protected ...
[ "0.64539295", "0.628222", "0.6083875", "0.6083875", "0.58966196", "0.58931714", "0.5843906", "0.5807617", "0.56874675", "0.55977154", "0.55894995", "0.55894995", "0.5536012", "0.54927725", "0.547576", "0.5461862", "0.5457917", "0.54515964", "0.54515964", "0.54515964", "0.5451...
0.0
-1
`v4()` Generate random UUID See for API details
function v4(options, buf, offset) { // Deprecated - 'format' argument, as supported in v1.2 var i = buf && offset || 0; if (typeof(options) == 'string') { buf = options == 'binary' ? new Array(16) : null; options = null; } options = options || {}; var rnds = options.random || (options.rn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateUUIDv4() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0,\n v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n}", "generateUUIDv4()\n\t{\n\t\tlet tmpBuffer = new Array(16);\n\t\tva...
[ "0.8774061", "0.8716146", "0.8656419", "0.86425877", "0.8622066", "0.8619174", "0.86123294", "0.8610929", "0.86079603", "0.85691327", "0.85302216", "0.85225886", "0.8518848", "0.8504304", "0.8488843", "0.84795076", "0.847476", "0.84740543", "0.8469278", "0.84679675", "0.84658...
0.0
-1
returns a function for filtering head child elements which shouldn't be duplicated, like .
function unique() { var tags = new _set2.default(); var metaTypes = new _set2.default(); var metaCategories = {}; return function (h) { switch (h.type) { case 'title': case 'base': if (tags.has(h.type)) return false; tags.add(h.type); break; case 'meta'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filtered (input){\n Array.from(list.children).filter((arr)=>{\n return !arr.textContent.includes(input);\n }).forEach((arr)=>{\n arr.classList.add('filtered');\n });\n\n Array.from(list.children).filter((arr)=>{\n return arr.textContent.includes(input);\n}).forEach((arr)=>{\n arr.classList.rem...
[ "0.6009648", "0.58517104", "0.5774305", "0.55775553", "0.55755895", "0.5521663", "0.5506748", "0.5466993", "0.54195356", "0.53634846", "0.5292962", "0.5288609", "0.5258431", "0.5218615", "0.5218615", "0.5218615", "0.52024096", "0.51854414", "0.5163822", "0.5163822", "0.514675...
0.0
-1
Build a destructive iterator for the value list
function iteratorFor(items) { var iterator = { next: function() { var value = items.shift() return {done: value === undefined, value: value} } } if (support.iterable) { iterator[Symbol.iterator] = function() { return iterator } } return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static createIteratorFromValue(value){\n return (function(){\n let used = false;\n\n return {\n next: function(){\n try {\n return used ? {done: true} : {value: value, done: false};\n ...
[ "0.6567051", "0.61971587", "0.6129268", "0.60959846", "0.6081213", "0.6081213", "0.60518825", "0.60518825", "0.60518825", "0.60518825", "0.60518825", "0.60395825", "0.6019784", "0.6000144", "0.593555", "0.59003186", "0.5864537", "0.58550805", "0.57782644", "0.57182074", "0.56...
0.0
-1
Create a reducing function iterating left or right.
function createReduce(dir) { // Optimized iterator function as using arguments.length // in the main function will deoptimize the, see #1991. function iterator(obj, iteratee, memo, keys, index, length) { for (; index >= 0 && index < length; index += dir) { var currentKey = keys ? keys[ind...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static *reduceRight$e(thiz, args, s) {\n\t\tlet l = yield * getLength(thiz);\n\t\tlet acc;\n\t\tlet fx = args[0];\n\n\t\tif ( args.length < 1 || !fx.isCallable ) {\n\t\t\treturn yield CompletionRecord.makeTypeError(s.realm, 'First argument to reduceRight must be a function.');\n\t\t}\n\n\t\tif ( args.length > 1 ) ...
[ "0.69307965", "0.68434834", "0.67686254", "0.62968653", "0.6292559", "0.62247425", "0.6172193", "0.6078777", "0.607583", "0.6016731", "0.60144776", "0.60141987", "0.5947723", "0.59183216", "0.59162104", "0.5871401", "0.5871401", "0.5871401", "0.5871401", "0.5871401", "0.58714...
0.5698298
51
Optimized iterator function as using arguments.length in the main function will deoptimize the, see 1991.
function iterator(obj, iteratee, memo, keys, index, length) { for (; index >= 0 && index < length; index += dir) { var currentKey = keys ? keys[index] : index; memo = iteratee(memo, obj[currentKey], currentKey, obj); } return memo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TestAssignmentToIterator2() {\n var i = 0;\n arguments.__defineGetter__('callee', function(){});\n arguments.__defineGetter__('length', function(){ return 1 });\n arguments[Symbol.iterator] = [].entries;\n for (var entry of arguments) {\n assertEquals([i, arguments[i]], entry);\n i++;\n }\n\n ...
[ "0.6527962", "0.6066208", "0.5999062", "0.591489", "0.58546805", "0.5802807", "0.5767986", "0.57578146", "0.57457936", "0.57436895", "0.57320154", "0.5721297", "0.5700889", "0.5644879", "0.56352806", "0.56041086", "0.5602883", "0.5602458", "0.55890894", "0.5584199", "0.558147...
0.5579649
37
Generator function to create the findIndex and findLastIndex functions
function createPredicateIndexFinder(dir) { return function(array, predicate, context) { predicate = cb(predicate, context); var length = getLength(array); var index = dir > 0 ? 0 : length - 1; for (; index >= 0 && index < length; index += dir) { if (predicate(array[index], inde...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "location(index) {\n var idx = this.search.findLeft(index)\n if(idx+1<this.rows.length && this.rows[idx+1]==index) return [idx+1,0]\n return [idx, index-this.rows[idx]]\n }", "function createIndexFinder(dir,predicateFind,sortedIndex){return function(array,item,idx){var i=0,length=getLength...
[ "0.6169708", "0.61012435", "0.60185516", "0.60123676", "0.60123676", "0.60076076", "0.59661746", "0.5918533", "0.5918533", "0.5918533", "0.5918533", "0.5918533", "0.5918533", "0.5918533", "0.5918533", "0.5918533", "0.5907632", "0.58996195", "0.5897573", "0.58974653", "0.58974...
0.0
-1
Generator function to create the indexOf and lastIndexOf functions
function createIndexFinder(dir, predicateFind, sortedIndex) { return function(array, item, idx) { var i = 0, length = getLength(array); if (typeof idx == 'number') { if (dir > 0) { i = idx >= 0 ? idx : Math.max(idx + length, i); } else { length = idx >= 0 ?...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "LastIndexOf() {\n\n }", "IndexOf() {\n\n }", "indexOf(val) {}", "function myIndexOf2(source, searchValue, startIdx=0) {\n for (let i = startIdx; i <= source.length - searchValue.length; i++) {\n let substring = source.slice(i, i + searchValue.length);\n \n if (substring === searchValue) {...
[ "0.6704978", "0.61552393", "0.60958135", "0.5932218", "0.5810419", "0.5789355", "0.5777259", "0.5732596", "0.56094474", "0.55971", "0.5525533", "0.55069697", "0.5505558", "0.5496774", "0.5481369", "0.5341538", "0.53364044", "0.53041726", "0.52636915", "0.5210988", "0.5210491"...
0.0
-1
TODO: enterprise connections should not depend on database connections. However, we now allow a username input to contain also an email and this information is in the database module. We should make this information flow from the UI (like we do for the startHRD function). Including this dependency here allows us to do ...
function cancelHRD(id) { (0, _index.swap)(_index.updateEntity, "lock", id, function (m) { m = (0, _enterprise.toggleHRD)(m, false); m = (0, _index2.hideInvalidFields)(m); return m; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _user(){\n\t//userconfig = getCredentials();\n\tvar userconfig = cloudfn.users.cli.get();\n\n\tvar schema = {\n\t\tproperties: {\n\t\t\tusername: {\n\t\t\t\tdescription: colors.green(\"Username\"),\n\t\t\t\tvalidator: /^[a-zA-Z]+$/,\n\t\t\t\twarning: 'Username must be only letters',\n\t\t\t\tdefault: user...
[ "0.6296655", "0.60500896", "0.58948714", "0.58339524", "0.58206344", "0.5809002", "0.5789363", "0.5655977", "0.5634568", "0.56301284", "0.5601898", "0.5584077", "0.5563617", "0.55463827", "0.55372345", "0.553658", "0.5494569", "0.5494569", "0.5476993", "0.54588133", "0.545472...
0.0
-1
The CSSCore module specifies the API (and implements most of the methods) that should be used when dealing with the display of elements (via their CSS classes and visibility on screen. It is an API focused on mutating the display and not reading it as no logical state should be encoded in the display of elements. / Slo...
function matchesSelector_SLOW(element, selector) { var root = element; while (root.parentNode) { root = root.parentNode; } var all = root.querySelectorAll(selector); return Array.prototype.indexOf.call(all, element) !== -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cssDisplay(x,objetos) {\n\tvar i=1;\n\twhile (i<arguments.length){\n\t\tdocument.querySelector(arguments[i]).style.display=x;\n\t\ti++;\n\t}\n}", "function computeStyleTests() { // 6092\n ...
[ "0.5391598", "0.5163245", "0.51322645", "0.5129545", "0.51060575", "0.5084644", "0.5053952", "0.5052231", "0.50518", "0.5031567", "0.5024571", "0.5012928", "0.5006788", "0.49926826", "0.49894056", "0.49813983", "0.49620855", "0.49620855", "0.49515873", "0.49462533", "0.494147...
0.0
-1
NOTE: These type checking functions intentionally don't use `instanceof` because it is fragile and can be easily faked with `Object.create()`.
function isArray(ar) { return Array.isArray(ar); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isOfType(obj, type) {\n obj = Object(obj)\n return typeof type === \"string\"\n ? obj.constructor.name === type\n : obj instanceof type\n}", "function isType(obj, type) {\n return obj instanceof type\n}", "function isObj$1(something) {\n return typeDetect(something) === 'Object';\n}", "functio...
[ "0.6396579", "0.6386313", "0.6359798", "0.6342864", "0.63172853", "0.6297039", "0.62751883", "0.62706465", "0.6232471", "0.6219457", "0.62045527", "0.6202601", "0.6196258", "0.6159293", "0.61125714", "0.6049724", "0.6038965", "0.6038305", "0.60209715", "0.60185313", "0.601729...
0.0
-1
Initialize a new `Emitter`.
function Emitter(obj) { if (obj) return mixin(obj); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Emitter() {\n this.events = {};\n}", "constructor() {\n this.eventEmitter = new Emitter();\n }", "function Emitter() {\n\t\tthis.listeners = {};\n\t\tthis.singleListener = {};\n\t}", "function Emitter() {\r\n this.events = {};\r\n}", "function Emitter() {\r\n\t\tthis.callbacks = {};\r\n\...
[ "0.7571564", "0.7560046", "0.75450575", "0.7514628", "0.7456722", "0.74460644", "0.7429575", "0.7429575", "0.7429575", "0.7429575", "0.7405929", "0.7387901", "0.7187168", "0.710413", "0.7097545", "0.7092573", "0.7062321", "0.7041538", "0.6998895", "0.696564", "0.68401015", ...
0.0
-1
Initialize a new `RequestBase`.
function RequestBase(obj) { if (obj) return mixin(obj); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(request) {\n this.request = request;\n }", "function Request(input, init) {\n if (arguments.length < 1) throw TypeError('Not enough arguments');\n\n Body.call(this, null);\n\n // readonly attribute ByteString method;\n this.method = 'GET';\n\n // readonly attribute USVString ...
[ "0.72321206", "0.68049115", "0.6729837", "0.6633801", "0.64722556", "0.63840234", "0.63576514", "0.6337622", "0.63319606", "0.62633926", "0.6195456", "0.6146439", "0.6118087", "0.61083794", "0.6018175", "0.6012823", "0.6004675", "0.59726137", "0.5947511", "0.592685", "0.58815...
0.5877946
25
Initialize a new `ResponseBase`.
function ResponseBase(obj) { if (obj) return mixin(obj); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ResponseBase() {}", "constructor() { \n \n MailServiceBaseResponse.initialize(this);\n }", "constructor(init = {}) {\n super(init);\n this.type = HttpEventType.Response;\n this.body = init.body !== undefined ? init.body : null;\n }", "constructor(init = {}) {\n supe...
[ "0.7987212", "0.73618984", "0.7078738", "0.7039042", "0.7039042", "0.7039042", "0.7039042", "0.7039042", "0.6988082", "0.6988082", "0.6988082", "0.6988082", "0.6988082", "0.6988082", "0.6988082", "0.6988082", "0.6988082", "0.6988082", "0.6988082", "0.69836783", "0.6959615", ...
0.6343465
37
TODO: handle this from CSS
function icon(strategy) { if (strategy === "google-apps") return strategy; if (~["adfs", "office365", "waad"].indexOf(strategy)) return "windows"; return "auth0"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getStyle() {\n return \"\";\n }", "function css(){ /*...*/ }", "get css() {\n return '';\n }", "get style(){ return this.__baseStyle; }", "protected internal function m252() {}", "insertCss() { }", "renderCssStyle() {\n this.cssStyle = [\n // `width: ${parseFloat(this.width) != th...
[ "0.55564606", "0.54004383", "0.53983116", "0.5332525", "0.53084433", "0.52661175", "0.5224084", "0.51773727", "0.51679397", "0.51572573", "0.5152465", "0.51385397", "0.5135096", "0.5105101", "0.50943434", "0.50887704", "0.50887704", "0.50887704", "0.50887704", "0.50887704", "...
0.0
-1
TODO: handle this from CSS
function icon(strategy) { if (_index3.STRATEGIES[strategy]) return strategy; if (strategy === "google-apps") return strategy; if (~["adfs", "office365", "waad"].indexOf(strategy)) return "windows"; return "auth0"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getStyle() {\n return \"\";\n }", "function css(){ /*...*/ }", "get css() {\n return '';\n }", "get style(){ return this.__baseStyle; }", "protected internal function m252() {}", "insertCss() { }", "renderCssStyle() {\n this.cssStyle = [\n // `width: ${parseFloat(this.width) != th...
[ "0.55564606", "0.54004383", "0.53983116", "0.5332525", "0.53084433", "0.52661175", "0.5224084", "0.51773727", "0.51679397", "0.51572573", "0.5152465", "0.51385397", "0.5135096", "0.5105101", "0.50943434", "0.50887704", "0.50887704", "0.50887704", "0.50887704", "0.50887704", "...
0.0
-1
Add integers, wrapping at 2^32. This uses 16bit operations internally to work around bugs in some JS interpreters.
function safe_add (x, y) { var lsw = (x & 0xFFFF) + (y & 0xFFFF) var msw = (x >> 16) + (y >> 16) + (lsw >> 16) return (msw << 16) | (lsw & 0xFFFF) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add32(a, b) {\n return (a + b) & 0xFFFFFFFF;\n }", "function add32(a, b) {\n return (a + b) & 0xFFFFFFFF;\n }", "function add32(a, b) {\n return (a + b) & 0xFFFFFFFF;\n}", "function add32(a, b) {\n return a + b & 0xFFFFFFFF;\n }", "function add32(a, b) {\n return (a + b...
[ "0.7799111", "0.7799111", "0.7757517", "0.774088", "0.7736112", "0.7729691", "0.7729691", "0.7722427", "0.77195686", "0.7696254", "0.7692515", "0.7692515", "0.76807004", "0.76807004", "0.76807004", "0.7522529", "0.74486244", "0.72894424", "0.71557206", "0.71396667", "0.706356...
0.0
-1
Bitwise rotate a 32bit number to the left.
function bit_rol (num, cnt) { return (num << cnt) | (num >>> (32 - cnt)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bitRotateLeft(num,cnt){return num<<cnt|num>>>32-cnt;}", "function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }", "function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }", "function bitRotateLeft (num, cnt) {\n return (num << cnt...
[ "0.87508583", "0.8438198", "0.8438198", "0.8438198", "0.8438198", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8334637", "0.83200794", "0.8303131", ...
0.7127272
71
These functions implement the four basic operations the algorithm uses.
function md5_cmn (q, a, b, x, s, t) { return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BasicOp(a, b) {\n var sum = a + b;\n console.log(\"sum\" + sum);\n var sub = a - b;\n console.log(\"sub\" + sub);\n var multi = a * b;\n console.log(\"multiplication\" + multi);\n var div = a / b;\n console.log(\"devision\" + sub);\n}", "function arithmaticOpration(){\n\taddition();\n\tSubstrati...
[ "0.614667", "0.60421485", "0.5994541", "0.5898469", "0.57985216", "0.5742825", "0.5727613", "0.57271165", "0.56053096", "0.55835235", "0.5573103", "0.55728894", "0.55604", "0.5515135", "0.550902", "0.55050015", "0.54754686", "0.5475394", "0.5429418", "0.54290855", "0.54249525...
0.0
-1
Calculate the MD5 of an array of littleendian words, and a bit length.
function binl_md5 (x, len) { /* append padding */ x[len >> 5] |= 0x80 << (len % 32) x[(((len + 64) >>> 9) << 4) + 14] = len var i var olda var oldb var oldc var oldd var a = 1732584193 var b = -271733879 var c = -1732584194 var d = 271733878 for (i = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function binl_md5 (x, len) {\n\t /* append padding */\n\t x[len >> 5] |= 0x80 << (len % 32)\n\t x[(((len + 64) >>> 9) << 4) + 14] = len\n\n\t var i\n\t var olda\n\t var oldb\n\t var oldc\n\t var oldd\n\t var a = 1732584193\n\t var b = -271733879\n\t var c = -1732584194\n\t var d...
[ "0.7711468", "0.7711468", "0.769378", "0.76609445", "0.764113", "0.7627985", "0.7625578", "0.762372", "0.762372", "0.7616212", "0.7613274", "0.7613274", "0.7601431", "0.75948286", "0.7581376", "0.7568087", "0.75637054", "0.7548342", "0.754634", "0.75431746", "0.7542246", "0...
0.77541673
1
Convert an array of littleendian words to a string
function binl2rstr (input) { var i var output = '' var length32 = input.length * 32 for (i = 0; i < length32; i += 8) { output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF) } return output }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bin2string(array){\n var result = \"\";\n for(var i = 0; i < array.length; ++i){\n result += (String.fromCharCode(array[i]));\n }\n return result;\n}", "function utf8ArrayToStr(array) {\n\t\tvar out, i, len, c;\n\t\tvar char2, char3;\n\n\t\tout = '';\n\t\tlen = array.length;\n\t\ti = 0;...
[ "0.7227761", "0.7191436", "0.7142591", "0.71034354", "0.6979802", "0.69587374", "0.69587374", "0.6913381", "0.6477294", "0.6435072", "0.6383508", "0.6374211", "0.63532215", "0.6330374", "0.6330374", "0.6330374", "0.6324924", "0.6324924", "0.63201535", "0.6301874", "0.62910783...
0.587032
75
Convert a raw string to an array of littleendian words Characters >255 have their highbyte silently ignored.
function rstr2binl (input) { var i var output = [] output[(input.length >> 2) - 1] = undefined for (i = 0; i < output.length; i += 1) { output[i] = 0 } var length8 = input.length * 8 for (i = 0; i < length8; i += 8) { output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) <<...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rawstr2leword(input) {\n\tvar i,\n\t\toutput = [];\n\t\n\toutput[(input.length >> 2) - 1] = undefined;\n\tfor (i = 0; i < output.length; i += 1) {\n\t\toutput[i] = 0;\n\t}\n\tfor (i = 0; i < input.length * 8; i += 8) {\n\t\toutput[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n\t}\n\treturn out...
[ "0.7377179", "0.67109495", "0.66496176", "0.66496176", "0.66496176", "0.66496176", "0.66496176", "0.66496176", "0.65724576", "0.65720904", "0.65571463", "0.65571463", "0.65571463", "0.65571463", "0.64650285", "0.6414274", "0.64138454", "0.6411602", "0.6385195", "0.63804746", ...
0.635515
29
Calculate the MD5 of a raw string
function rstr_md5 (s) { return binl2rstr(binl_md5(rstr2binl(s), s.length * 8)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rawMD5(s){return rstrMD5(str2rstrUTF8(s));}", "function rawMD5(s) {\n return rstrMD5(str2rstrUTF8(s));\n}", "function rawMD5(s) {\n return rstrMD5(str2rstrUTF8(s));\n }", "function rawMD5 (s) {\n return rstrMD5(str2rstrUTF8(s))\n }", "function rawMD5 (s) {\n return rstrMD5(str2rstrUT...
[ "0.8842126", "0.8585926", "0.85637033", "0.8544214", "0.8544214", "0.8544214", "0.8544214", "0.85271174", "0.8526803", "0.8485089", "0.8485089", "0.8485089", "0.8485089", "0.8474243", "0.8432323", "0.84313136", "0.84234524", "0.84234524", "0.84075475", "0.8406686", "0.840443"...
0.82009065
35
Calculate the HMACMD5, of a key and some data (raw strings)
function rstr_hmac_md5 (key, data) { var i var bkey = rstr2binl(key) var ipad = [] var opad = [] var hash ipad[15] = opad[15] = undefined if (bkey.length > 16) { bkey = binl_md5(bkey, key.length * 8) } for (i = 0; i < 16; i += 1) { ipad[i] = bkey[i] ^ 0x3636363...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rstrHMACMD5 (key, data) {\r\n var i;\r\n var bkey = rstr2binl(key);\r\n var ipad = [];\r\n var opad = [];\r\n var hash;\r\n ipad[15] = opad[15] = undefined;\r\n if (bkey.length > 16) {\r\n bkey = binlMD5(bkey, key.length * 8);\r\n }\r\n for (i = 0; i < 1...
[ "0.82557803", "0.8244259", "0.82403255", "0.82403255", "0.8228592", "0.8228592", "0.82034165", "0.81724143", "0.69504243", "0.69092995", "0.6897242", "0.6885432", "0.6885013", "0.6880891", "0.68639404", "0.6845281", "0.6814352", "0.6814352", "0.6814352", "0.6814352", "0.68143...
0.69442296
12
Convert a raw string to a hex string
function rstr2hex (input) { var hex_tab = '0123456789abcdef' var output = '' var x var i for (i = 0; i < input.length; i += 1) { x = input.charCodeAt(i) output += hex_tab.charAt((x >>> 4) & 0x0F) + hex_tab.charAt(x & 0x0F) } return output }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rawstr2hex(input) {\n\tvar x, i,\n\t\thex_tab = '0123456789abcdef',\n\t\toutput = '';\n\t\n\tfor (i = 0; i < input.length; i += 1) {\n\t\tx = input.charCodeAt(i);\n\t\toutput += hex_tab.charAt((x >>> 4) & 0x0F) + hex_tab.charAt(x & 0x0F);\n\t}\n\treturn output;\n}", "function hex(s) {\n\tif (typeof s ==...
[ "0.76136947", "0.7395255", "0.7256084", "0.7166303", "0.71622133", "0.7061839", "0.7026583", "0.7019449", "0.7019449", "0.7017855", "0.7017855", "0.696714", "0.696714", "0.696714", "0.696714", "0.696714", "0.696714", "0.696714", "0.69597274", "0.69590193", "0.69583756", "0....
0.7021295
10
Encode a string as utf8
function str2rstr_utf8 (input) { return unescape(encodeURIComponent(input)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function encode_utf8(s) {\n\t return encode_latin1(unescape(encodeURIComponent(s)));\n\t }", "function encode_utf8(s) {\r\n\treturn unescape(encodeURIComponent(s));\r\n }", "function encode_utf8( s )\n{\n \n return unescape( encodeURIComponent( s ) );\n}", "function encode_utf8(s) {\n return ...
[ "0.8098524", "0.8040454", "0.80273587", "0.80082214", "0.7992286", "0.78417027", "0.7840318", "0.7834677", "0.77939355", "0.779122", "0.7780487", "0.7772413", "0.7751415", "0.7716268", "0.7697578", "0.7656776", "0.76243126", "0.75728256", "0.7563958", "0.7563016", "0.7445292"...
0.7030388
31
Take string arguments and return either raw or hex encoded strings
function raw_md5 (s) { return rstr_md5(str2rstr_utf8(s)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toHex(...args) {\n return ethers_1.utils.hexlify(...args);\n}", "function hex_sha1(s) { return rstr2hex(rstr_sha1(str2rstr_utf8(s))); }", "function encode(arg) {\n return arg.split('').map(x => (x.charCodeAt(0) / 255));\n}", "function rstr2hex(input){var hexTab='0123456789abcdef';var output='...
[ "0.67150456", "0.61773396", "0.6171435", "0.6140593", "0.6091071", "0.60602134", "0.60283774", "0.6008874", "0.5997579", "0.5989233", "0.59890795", "0.5967075", "0.5965895", "0.5919137", "0.5918674", "0.59186566", "0.59186566", "0.59186566", "0.59186566", "0.59186566", "0.591...
0.0
-1
Copyright Joyent, Inc. and other Node contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish...
function EventEmitter() { this._events = this._events || {}; this._maxListeners = this._maxListeners || undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function me(e,t,a,s){var n,i=arguments.length,r=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,a):s;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,s);else for(var d=e.length-1;d>=0;d--)(n=e[d])&&(r=(i<3?n(r):i>3?n(t,a,r):n(t,a))||r);return i>3&&r&&Object.definePro...
[ "0.6146709", "0.5424584", "0.5392798", "0.5368343", "0.5368343", "0.5368343", "0.53409165", "0.53225315", "0.53225315", "0.53225315", "0.5310671", "0.5262444", "0.52569795", "0.5255571", "0.5255571", "0.5255571", "0.5255571", "0.5255571", "0.5255571", "0.5255571", "0.5255571"...
0.0
-1
return new, unset BigInteger
function nbi() { return new BigInteger(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BigInteger(a, b) {\n if (a != null) this.fromString(a, b);\n} // return new, unset BigInteger", "clone() {\n return new BigInteger(this.digits.slice());\n }", "clone() {\n return new BigInteger(this.digits.slice());\n }", "function nbi()\n{\n return new BigInteger(null);\n}", ...
[ "0.7428058", "0.69610363", "0.69610363", "0.64015156", "0.6362602", "0.6362602", "0.623988", "0.623988", "0.6111579", "0.6111579", "0.6111579", "0.60725933", "0.60725933", "0.60725933", "0.60725933", "0.60725933", "0.6041273", "0.60077846", "0.5987963", "0.5987963", "0.597454...
0.6249981
61
am: Compute w_j += (xthis_i), propagate carries, c is initial carry, returns final carry. c < 3dvalue, x < 2dvalue, this_i < dvalue We need to select the fastest one that works in this environment. am1: use a single mult and divide to get the high bits, max digit bits should be 26 because max internal value = 2dvalue^2...
function am1(i,x,w,j,c,n) { while(--n >= 0) { var v = x*this[i++]+w[j]+c; c = Math.floor(v/0x4000000); w[j++] = v&0x3ffffff; } return c; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function am1(i, x, w, j, c, n) {\n while (--n >= 0) {\n var v = x * this[i++] + w[j] + c;\n c = Math.floor(v / 0x4000000);\n w[j++] = v & 0x3ffffff;\n }\n\n return c;\n} // am2 avoids a big mult-and-extract completely.", "function am1(i, x, w, j, c, n) {\n while (--n >= 0) {\n ...
[ "0.7296007", "0.7271371", "0.7237652", "0.7232795", "0.7232795", "0.7232795", "0.7232795", "0.7232795", "0.7232795", "0.7232795", "0.717233", "0.7160439", "0.7145397", "0.71351385", "0.71337384", "0.71337384", "0.71337384", "0.71337384", "0.71337384", "0.7125931", "0.7125931"...
0.6961814
97
am2 avoids a big multandextract completely. Max digit bits should be <= 30 because we do bitwise ops on values up to 2hdvalue^2hdvalue1 (< 2^31)
function am2(i,x,w,j,c,n) { var xl = x&0x7fff, xh = x>>15; while(--n >= 0) { var l = this[i]&0x7fff; var h = this[i++]>>15; var m = xh*l+h*xl; l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff); c = (l>>>30)+(m>>>15)+xh*h+(c>>>30); w[j++] = l&0x3fffffff; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function am2(i,x,w,j,c,n){var xl=x&0x7fff,xh=x>>15;while(--n>=0){var l=this[i]&0x7fff;var h=this[i++]>>15;var m=xh*l+h*xl;l=xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);c=(l>>>30)+(m>>>15)+xh*h+(c>>>30);w[j++]=l&0x3fffffff;}return c;}// Alternately, set max digit bits to 28 since some", "function am2(i, x, w, j, c,...
[ "0.6854062", "0.62608975", "0.6120893", "0.6057112", "0.5709845", "0.5694351", "0.5694351", "0.5694351", "0.5694351", "0.5694351", "0.5694351", "0.5694351", "0.5694351", "0.5694351", "0.5694351", "0.5694351", "0.5694351", "0.5694351", "0.5694351", "0.5694351", "0.5694351", ...
0.5774353
5