query stringlengths 9 14.6k | document stringlengths 8 5.39M | metadata dict | negatives listlengths 0 30 | negative_scores listlengths 0 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
the longitudinal distance between points i and k | function dx(i, k){
var latlng = new google.maps.LatLng(pointarray[i].LatLng.lat(), pointarray[k].LatLng.lng());
var sign = (pointarray[k].LatLng.lng() > pointarray[i].LatLng.lng()) ? 1 : -1;
return sign * google.maps.geometry.spherical.computeDistanceBetween(pointarray[i].LatLng, latlng);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dy(i, k){\n\tvar latlng = new google.maps.LatLng(pointarray[k].LatLng.lat(), pointarray[i].LatLng.lng());\n\tvar sign = (pointarray[k].LatLng.lat() > pointarray[i].LatLng.lat()) ? 1 : -1;\n\treturn sign * google.maps.geometry.spherical.computeDistanceBetween(latlng, pointarray[i].LatLng);\n}",
"function... | [
"0.67786604",
"0.62765473",
"0.6053718",
"0.59932667",
"0.5943284",
"0.57277036",
"0.57270545",
"0.57172847",
"0.56388736",
"0.5634655",
"0.56286424",
"0.56047046",
"0.5599009",
"0.5593887",
"0.5580052",
"0.55335015",
"0.55155176",
"0.54399455",
"0.5432419",
"0.54315674",
"0.... | 0.6682368 | 1 |
the lateral distance between points i and k | function dy(i, k){
var latlng = new google.maps.LatLng(pointarray[k].LatLng.lat(), pointarray[i].LatLng.lng());
var sign = (pointarray[k].LatLng.lat() > pointarray[i].LatLng.lat()) ? 1 : -1;
return sign * google.maps.geometry.spherical.computeDistanceBetween(latlng, pointarray[i].LatLng);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dx(i, k){\n\tvar latlng = new google.maps.LatLng(pointarray[i].LatLng.lat(), pointarray[k].LatLng.lng());\n\tvar sign = (pointarray[k].LatLng.lng() > pointarray[i].LatLng.lng()) ? 1 : -1;\n\treturn sign * google.maps.geometry.spherical.computeDistanceBetween(pointarray[i].LatLng, latlng);\n}",
"function... | [
"0.702653",
"0.6447083",
"0.63794065",
"0.62759477",
"0.6182576",
"0.6167447",
"0.61447847",
"0.60284674",
"0.5956133",
"0.59430903",
"0.5916947",
"0.5865775",
"0.5865561",
"0.5706482",
"0.57038635",
"0.5680996",
"0.5658824",
"0.56480646",
"0.56450343",
"0.56025165",
"0.55994... | 0.7116098 | 0 |
add a tenth of a second to timeplayed | function addTime(){
timePlayed += 0.1;
checkTime();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateTime() {\n scorePanel.playTime = Math.trunc((performance.now() - scorePanel.startTime) / 1000);\n $(\".time\").text(scorePanel.playTime.toString().padStart(3, \"0\").concat(\" seconds\"));\n}",
"increaseTime(t) {\n this.currentTime += t;\n this.timeElement.textContent = this.currentTime;\n... | [
"0.6950761",
"0.68150246",
"0.67656493",
"0.65703493",
"0.6562626",
"0.65467334",
"0.65063256",
"0.64813876",
"0.6477621",
"0.64759576",
"0.6474559",
"0.64367175",
"0.6428651",
"0.64158666",
"0.64085037",
"0.6401229",
"0.6379555",
"0.63769436",
"0.63725543",
"0.63715714",
"0.... | 0.6912446 | 1 |
update the best score array | function updateBestScore(){
//select correct best score to update
bestScoreArray.forEach((score,index) => {
if(questionAmount == score.questions){
//return bast score as a number with one decimal
const savedBestScore = Number(bestScoreArray[index].bestScore);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateScores(){\n currentScore = currentGame.length;\n if (bestScore <= 0){\n //update best score from storage.\n var prevScore = scorestorage.getRecord(KEY_BEST_SCORE); \n if (prevScore){\n bestScore = prevScore;\n }\n ... | [
"0.78118235",
"0.7089091",
"0.7076697",
"0.7059087",
"0.70383704",
"0.6911687",
"0.6772529",
"0.67457175",
"0.6727227",
"0.67117745",
"0.66908455",
"0.66661996",
"0.6647496",
"0.66472286",
"0.6575841",
"0.6544597",
"0.6530948",
"0.6524539",
"0.65065426",
"0.63613486",
"0.6352... | 0.7466263 | 1 |
Update the user profile in the database | function update() {
// PREPARE
let uid = $rootScope.account.authData.uid;
let profile = $rootScope.account.profile;
// NEW USER ACTION
if (profile.newUser) {
instance.addAchievement(profile, ACHIEVEMENTS.PROFILE_COMPLETED);
pro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateProfile(profile) {\n checkUser();\n UserId = userId;\n $.ajax({\n method: \"PUT\",\n url: \"/api/profile_data\",\n data: profile\n })\n .then(function () {\n window.location.href = \"/members\";\n });\n }",
"updateProfile() {}",
"function updateUserPr... | [
"0.7807826",
"0.7778466",
"0.7765767",
"0.77542657",
"0.7745856",
"0.7446681",
"0.7410113",
"0.7356065",
"0.7341599",
"0.7287491",
"0.7237825",
"0.72129244",
"0.71763974",
"0.7146402",
"0.7118101",
"0.7116507",
"0.7106716",
"0.7081433",
"0.7080873",
"0.7080873",
"0.70777625",... | 0.7960154 | 0 |
Remove the user profile in the database | function remove() {
// REMOVE FROM DB
let uid = $rootScope.account.authData.uid;
$rootScope.db.users.child(uid).remove();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"deleteProfile() {}",
"deleteProfile() {\n // console.log(\"deleteProfile()\");\n return store.delete('CURRENT_PROFILE');\n }",
"function deleteUserProfile(){\n\tconsole.log(\"deleteUserProfile ran \" + userProfileId);\n\tconst settings = {\n\turl: DATABASE_URL + 'userprofile/' + userProfileId,... | [
"0.75565994",
"0.70803505",
"0.7065429",
"0.70616907",
"0.6964795",
"0.6938524",
"0.68980575",
"0.6887883",
"0.6860602",
"0.68469507",
"0.68426275",
"0.6790303",
"0.67643714",
"0.6751246",
"0.6741149",
"0.6636863",
"0.6632147",
"0.6563877",
"0.6535319",
"0.65207636",
"0.65140... | 0.7704827 | 0 |
Extract the initial user profile from the provider authData | function extract(authData) {
let name = {first: "", last: "", display: ""};
let profile = {
// The private bits
uid: authData.uid,
provider: authData.providerData[0].providerId,
newUser: true,
email: authData.email,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getUserInfo(authData) {\n var fbData = authData.providerData[0];\n var fbCachedUserProfile = fbData.cachedUserProfile || {};\n return {\n name: fbData.displayName,\n email: fbData.email || null,\n avatar: fbData.photoURL || null,\n gender: fbCachedU... | [
"0.7119658",
"0.6738343",
"0.66323805",
"0.6538854",
"0.65366083",
"0.6403593",
"0.6363583",
"0.6363583",
"0.63276255",
"0.6311589",
"0.62563896",
"0.62213933",
"0.6190144",
"0.6171722",
"0.6138962",
"0.61311245",
"0.61270314",
"0.61220217",
"0.6119551",
"0.6092727",
"0.60694... | 0.72407746 | 0 |
Add an achievement to the user's profile | function addAchievement( profile, achievement ) {
if (!profile.expose.achievements) profile.expose.achievements = [];
profile.expose.achievements.push( achievement );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function NewAchievement( appid, achievement )\n{\n\tvar parentDiv = document.getElementById( \"appAchievementDisplay\" );\n\tvar sourceDiv = document.getElementById( \"achievementTableSource\" );\n\ttheTable = parentDiv.firstChild;\n\n\tvar newRow = theTable.tBodies[ 0 ].insertRow( -1 );\n\tnewRow.vAlign = \"top\"... | [
"0.6708486",
"0.66089743",
"0.6458496",
"0.60735923",
"0.60678715",
"0.6029028",
"0.60103714",
"0.58658814",
"0.5839668",
"0.58071905",
"0.5729417",
"0.5568488",
"0.5523191",
"0.551997",
"0.55024505",
"0.54988754",
"0.5480935",
"0.5477365",
"0.5455532",
"0.5448211",
"0.542440... | 0.81612325 | 0 |
format the date to be displayed in the legend | function niceDate(date) {
return legendDateFormat(new Date(date))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"formatDates() {\n for (let i = 0; i < this.results.length; i++) {\n const g = this.results[i];\n g.label = g.name;\n if (g.label instanceof Date) {\n g.label = g.label.toLocaleDateString();\n }\n if (g.series) {\n for (let ... | [
"0.6819712",
"0.6819712",
"0.66999257",
"0.6654725",
"0.6452557",
"0.6452557",
"0.6452557",
"0.64485043",
"0.64357054",
"0.63821864",
"0.637969",
"0.63708043",
"0.63325256",
"0.6323073",
"0.62836605",
"0.62768424",
"0.6266034",
"0.626415",
"0.6263533",
"0.6251099",
"0.6247347... | 0.7079235 | 0 |
retrieve the number of students for the current year from the specified state data string | function students(d,curdate) {
if (d.properties.students) {
var dateloc=d.properties.students.search(niceDate(curdate));
if (dateloc > -1) {
return Number(d.properties.students.substr(dateloc+5,3));
} else { return "0";}
} else {return "0";}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getStudentYears(studentName) {\n /*\n * Filter the transcriptList for the specfied student\n */\n let transcriptList = database_data.getTranscripts();\n let findStudentTrans = transcriptList.filter(function (obj) {\n return (obj.studentName===studentName);\n });\n\n /*\n * Using the records ... | [
"0.59928185",
"0.5751827",
"0.56746644",
"0.55173886",
"0.54779744",
"0.54779744",
"0.544003",
"0.53880924",
"0.5353189",
"0.5349633",
"0.5332062",
"0.531892",
"0.5275218",
"0.52262175",
"0.5222822",
"0.5198719",
"0.5192834",
"0.51871246",
"0.51866966",
"0.51818204",
"0.51739... | 0.6153663 | 0 |
git foreachref format="%(if)%(upstream)%(then)%(refname:short)=====%(upstream:short)%(else)%(refname:short)%(end)" refs/heads Output: brancha conflictbranch=====origin/conflictbranch master=====origin/master orangebranch1=====origin/orangebranch1 origin/testbranch3=====origin/origin/testbranch3 test1=====origin/test1 t... | function getLocalAndRemoteBranches(repo) {
const child = spawnGitProcess(repo, ['for-each-ref', '--format="%(refname:short)===XXX===%(if)%(upstream)%(then)%(upstream:short)%(end)===XXX===%(if)%(HEAD)%(then)HEAD%(end)"', 'refs/heads']);
return redirectIO(child, null, null).then(function (res) {
if (!res.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function print_with_commit(base_body){\r\n var msg = \"Issue co maju commit: \";\r\n for(var i in base_body) {\r\n if (base_body[i].pull_request != undefined) {\r\n msg += \" \" + i;\r\n }\r\n }\r\n console.log(msg);\r\n}",
"function talk_to_git (refs) {\n process.stdin.setE... | [
"0.54114103",
"0.5204545",
"0.50449944",
"0.49945587",
"0.49767423",
"0.49517336",
"0.49473965",
"0.49467558",
"0.49040538",
"0.48349437",
"0.48229373",
"0.48080593",
"0.47618443",
"0.4715491",
"0.47031298",
"0.467832",
"0.46716523",
"0.46553308",
"0.46229312",
"0.46035722",
... | 0.5440312 | 0 |
return; / Identify the cluster and the client/server container: Figure out if the host has a parent lookup the most recent entry in hosts table. Maybe not the most recent... just overwrite them as new relationships are made If yes, figure out parent chain from container to cluster Insert into TIME MAP database using th... | function retrieveClusters(currentId){
function data(currentId){//Define closure function to pass current variables to callback. Don't ask how
//debugger;
return currentId;
}
var params = [];
for (var a = 0; a<hostAttrs[currentId].subnets.length; a++){params.push('?')};
var params = params.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function test_cluster_graph_by_host_tag_vsphere65() {}",
"function main(user, hostname, hostAndPort)\n{\n\n var result = {};\n if (user.toString() == \"\" || user.toString() == \"#N/A\" ||\n user.empty())\n {\n result[\"error_msg\"] = \"Argument 'user' not specified\"; \n print(resu... | [
"0.59436774",
"0.57877105",
"0.5773753",
"0.57273227",
"0.57084966",
"0.57065123",
"0.56778544",
"0.56060505",
"0.55737275",
"0.55737275",
"0.55671185",
"0.55547965",
"0.55064",
"0.54834527",
"0.5422067",
"0.541295",
"0.5358403",
"0.53452945",
"0.5304326",
"0.5261183",
"0.521... | 0.6155328 | 0 |
integer IP to dottedquad | function IPv4_intA_to_dotquadA( strnum ) {
var byte1 = ( strnum >>> 24 );
var byte2 = ( strnum >>> 16 ) & 255;
var byte3 = ( strnum >>> 8 ) & 255;
var byte4 = strnum & 255;
return ( byte1 + '.' + byte2 + '.' + byte3 + '.' + byte4 );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function IPAddress$dottedQuadNotation(ipv4part) {\n var ipv4 = IPAddress$IPv4ToInt(ipv4part);\n\n // convert to unsigned int\n var bits = ipv4 >>> 0;\n\n // take IPv4 bits and stuff them in two hextets\n var hextets = [];\n hextets.push(((bits >>> 16) & 0xffff).toString(16));\n hextets.push((b... | [
"0.66691685",
"0.6656301",
"0.65467286",
"0.6528585",
"0.6415432",
"0.64053726",
"0.63745654",
"0.6355883",
"0.6326696",
"0.62906796",
"0.62012213",
"0.6025194",
"0.60071456",
"0.59007293",
"0.5771361",
"0.56877965",
"0.5649471",
"0.56186336",
"0.55782306",
"0.55221874",
"0.5... | 0.71540564 | 0 |
The IPv4_Calc_ functions operate on string representations of the binary value because I don't trust JavaScript's sign + 31bit bitwise functions. / logical AND between address & netmask | function IPv4_Calc_netaddrBinStr( addressBinStr, netmaskBinStr ) {
var netaddressBinStr = '';
var aBit = 0; var nmBit = 0;
for( pos = 0; pos < 32; pos ++ ) {
aBit = addressBinStr.substr( pos, 1 );
nmBit = netmaskBinStr.substr( pos, 1 );
if( aBit == nmBit ) { netaddressBinStr += aBit.toString(); }
else... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function maskAnd(ip, mask) {\n /* The following line adjusts the ip address to match the first address in the subnet (filtering all non-subnet mask bits in the ip */\n /* Not that this is done for the left 16 bits and the right 16 bits separately since the bitwise operator works on 32 bit signed integers yie... | [
"0.6851703",
"0.6516667",
"0.6452689",
"0.6411952",
"0.6330019",
"0.6179437",
"0.6168678",
"0.615925",
"0.611519",
"0.61085916",
"0.6059655",
"0.6057545",
"0.6039801",
"0.6007558",
"0.5983626",
"0.59814966",
"0.59600306",
"0.5897673",
"0.584507",
"0.57592183",
"0.5719682",
... | 0.68596375 | 0 |
Clamps a value n between min and max values. | function clampValue(min, n, max) {
return Math.min(Math.max(min, n), max);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clamp(min, n, max) {\n\t return Math.max(min, Math.min(n, max));\n\t}",
"function clamp(min, n, max) {\n return Math.max(min, Math.min(n, max));\n}",
"function clamp(n, min, max) {\n if (n > max) { n = max; }\n if (n < min) { n = min; }\n\n return n;\n }",
"function cla... | [
"0.7785194",
"0.7721507",
"0.7696209",
"0.7658065",
"0.756306",
"0.7496826",
"0.72142243",
"0.7176106",
"0.6973683",
"0.6969374",
"0.68676674",
"0.6848788",
"0.6822472",
"0.6794801",
"0.6776545",
"0.6768619",
"0.6762097",
"0.6760018",
"0.67585105",
"0.6755517",
"0.67548186",
... | 0.78985715 | 1 |
1) definition of class property 2) definition of class method 3) link method to external function 4) constructor doesnt return object 5) exernal function | function Person(firstName, lastName){
this.firstName=firstName; //1)this.property
this.lastName=lastName;
this.sayHello = function(){ //2)this.method
console.log('Hello '+this.firstName);
}
this.anotherMethod=externalFunction; //3)this.method=function
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function constructor() {\n // Private members\n var privateVar1 = \"Nishant\";\n var privateVar2 = [1,2,3,4,5];\n\n function privateMethod1() {\n // code stuff\n }\n\n function privateMethod1() {\n // code stuff\n }\n\n return {\n attribute1 : \"Nishant\",\n publicMethod... | [
"0.6355889",
"0.6313863",
"0.6313863",
"0.6313863",
"0.6235644",
"0.61712515",
"0.61492634",
"0.6117808",
"0.6101189",
"0.6101189",
"0.6101189",
"0.6096892",
"0.6078937",
"0.605987",
"0.60179394",
"0.60070187",
"0.59815913",
"0.59646124",
"0.59252024",
"0.59252024",
"0.592520... | 0.67150396 | 0 |
/ PART 1: INTERFACE / Checks if FileSaver.js is compatible. If it isn't, show alert. | function checkBrowser() {
try {
var isFileSaverSupported = !!new Blob;
} catch (e) {
window.alert("This browser is not supported!\nPlease, use a recent version of Chrome or Firefox instead.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function file_save_check() {\n\tif (!fs || !schedule_path || !schedule.autosave) {\n\t\t// Show the holy button of justice.\n\t\timg.save.style.opacity = 1;\n\t\timg.save.style.pointerEvents = \"auto\";\n\t} else\n\t\t// The user is no fun. Just auto-save it.\n\t\tfile_save();\n}",
"function browserSupportFileUp... | [
"0.6255532",
"0.57877773",
"0.57870805",
"0.57688266",
"0.5761578",
"0.5759723",
"0.57472",
"0.57296425",
"0.57270783",
"0.572517",
"0.56940734",
"0.56857806",
"0.56829935",
"0.5672152",
"0.5658792",
"0.5650534",
"0.5635586",
"0.563379",
"0.55685383",
"0.5513384",
"0.5413848"... | 0.7640485 | 0 |
Adjusts number of mines (max and current) according to lines and collumns | function adjustMines() {
maxMines = (lines*collumns) - 1;
document.getElementById("mineSlider").setAttribute("max", maxMines);
document.getElementById("valueMax").innerHTML = maxMines;
if (mines > maxMines) {
document.getElementById("valueM").innerHTML = maxMines;
mines = parse... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function increaseMinMax() {\n min -= 10;\n max += 10;\n }",
"function createMinMaxRangeLines(lines){\n // console.log(\"Entering createMinMaxRangelines function with lines\")\n //console.log(lines.length)\n //\n //console.log(\"\\n\\n Value 0,0:\")\n //console.dir(lines)\n //console.log(lines[0][0].... | [
"0.6695079",
"0.66375417",
"0.6620301",
"0.6238601",
"0.6237543",
"0.616682",
"0.61139566",
"0.6091268",
"0.6032945",
"0.59048116",
"0.5900105",
"0.5896101",
"0.589425",
"0.5871503",
"0.58661646",
"0.5858506",
"0.58562315",
"0.58234906",
"0.5817086",
"0.581665",
"0.57899624",... | 0.7379214 | 0 |
/ PART 2: BOARD GENERATION / Generate a Minesweeper array and place it in a board | function generateBoard() {
var array = [], // 1-d array, with LxC, which will be ported to the main board at the end
i, max = lines*collumns;
// Put all mines in the beginning
for (i = 0; i < max; i++) {
if (i < mines) {
array[i] = 1;
}
else {
array[i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function boardGenerator() {\n for (var i = 0; i < boardSize; i++) {\n for (var j = 0; j < boardSize; j++) {\n board.cells.push({\n row: i,\n col: j,\n isMine: randomMines(),\n hidden: true,\n });\n }\n }\n}",
"function makeBoard() {\n //Make an empty array for board... | [
"0.7574005",
"0.7389867",
"0.7277623",
"0.71575075",
"0.7149459",
"0.71318465",
"0.7103886",
"0.7102805",
"0.709265",
"0.7091244",
"0.70705867",
"0.70338184",
"0.7013336",
"0.7012744",
"0.7009111",
"0.69877744",
"0.6975426",
"0.6965226",
"0.696433",
"0.69549036",
"0.6931066",... | 0.7624286 | 0 |
Attaches attrs.chartRisk scope variable watcher | function attachListener() {
scope.$watch(attrs.chartRisk, function (riskSummaryData) {
setChartBlockWidth(riskSummaryData);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onRiskCreated() {\n vm.riskList = getRiskList();\n }",
"function updateAtRisk(){\n\tvar svgAtRisk = d3.select(\"#vis-sec-at-risk\")\n\t\t\t\t\t\t.append(\"svg\")\n\t\t\t\t\t\t.attr(\"width\", width + margin.left + margin.right)\n\t\t\t\t\t\t.attr(\"height\", height + margin.top + margin.bottom)\n\t\... | [
"0.62455934",
"0.5657551",
"0.5550135",
"0.548623",
"0.54443216",
"0.5205934",
"0.51886714",
"0.5124011",
"0.5082364",
"0.50385934",
"0.5036777",
"0.50070745",
"0.49811822",
"0.4980709",
"0.4980709",
"0.49757075",
"0.49747786",
"0.49603048",
"0.491466",
"0.49080738",
"0.49080... | 0.7296781 | 0 |
surname can be have no value or reg exp | function validateSurname(surname){
const validSurname = /[A-Za-zА-Яа-яЁёІіЇїЄє']/;
const userSurname = surname.value || "no info";
const validationResult = validateData(validSurname, userSurname, surname);
return validationResult;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function regExpLastName() {\n // Récupération des données saisies\n const lastNameValid = contact.lastName;\n // Injection du HTML\n const checklastName = document.querySelector(\"#lastNameErrorMsg\");\n\n // Indication de la bonne saisie ou l'erreur dans le HTML\n if (/^([A-Za-z]{3,20})?([-]{0,1... | [
"0.6811819",
"0.6428622",
"0.6312391",
"0.62947375",
"0.628149",
"0.6278202",
"0.6204949",
"0.61900586",
"0.615965",
"0.60962886",
"0.60597867",
"0.6051963",
"0.6034478",
"0.6034478",
"0.6025808",
"0.6011059",
"0.5980031",
"0.5978023",
"0.5961357",
"0.5955188",
"0.59283406",
... | 0.7801563 | 0 |
Date Formatting TODO: use same function formatDate(date, [date2], format, [options]) | function formatDate(date, format, options) {
return formatDates(date, null, format, options);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formatDate(date, format){\n if(!date){\n return '0000-00-00';\n }\n var dd = date.substring(0, 2);\n var mm = date.substring(3, 5);\n var yy = date.substring(6);\n if (format == 'dmy') {\n return dd + '-' + mm + '-' + yy;\n } else {\n... | [
"0.7012748",
"0.69397384",
"0.6936459",
"0.69123596",
"0.68826747",
"0.68826747",
"0.68826747",
"0.68826747",
"0.68826747",
"0.6882154",
"0.68381953",
"0.6758893",
"0.67564595",
"0.674587",
"0.6669971",
"0.66589844",
"0.6653689",
"0.663809",
"0.663248",
"0.66087043",
"0.65712... | 0.7590613 | 1 |
Dragging when event starts out FULLDAY overrides DayEventRenderer's version because it needs to account for dragging elements to and from the slot area. | function draggableDayEvent(event, eventElement, seg) {
var isStart = seg.isStart;
var origWidth;
var revert;
var allDay = true;
var dayDelta;
var hoverListener = getHoverListener();
var colWidth = getColWidth();
var snapHeight = getSnapHeight();
var snapMinutes = getSnapMinutes();
var minMinute = ge... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function draggableDayEvent(event, eventElement, seg) {\n\t\tvar isStart = seg.isStart;\n\t\tvar origWidth;\n\t\tvar revert;\n\t\tvar allDay = true;\n\t\tvar dayDelta;\n\n\t\tvar hoverListener = getHoverListener();\n\t\tvar colWidth = getColWidth();\n\t\tvar minTime = getMinTime();\n\t\tvar slotDuration = getSlotDu... | [
"0.7330154",
"0.73251206",
"0.7316514",
"0.6536271",
"0.64647335",
"0.6203449",
"0.6203449",
"0.6203449",
"0.6156504",
"0.61459124",
"0.6135377",
"0.5807905",
"0.57835174",
"0.574367",
"0.57217723",
"0.57146806",
"0.5701051",
"0.5700214",
"0.56108963",
"0.56026596",
"0.558511... | 0.7400583 | 1 |
Imprime consola log si tenemos activa gb_log_debug | function DebugLog(cad)
{
try
{
if (gb_log_debug === true)
{
console.log(cad);
}
}
catch(err)
{
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function log() {\n\ttry { \n\t\tconsole.log(\n\t\t\tshowOnly(logjs).forFilter(\n\t\t\t\t{\n\t\t\t\t\tapp: \"opsebf\",\n\t\t\t\t\tdate: \"20180623\",\n\t\t\t\t\tafter: \"1900\",\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\t}\n\tcatch(err) {\n\t\tvar msg = \"opsebf logs only in development stage\";\n\t\tconsole.warn(msg);\n\t}\n}... | [
"0.6858884",
"0.65588164",
"0.65382206",
"0.6520181",
"0.65099853",
"0.62979925",
"0.62972194",
"0.62966883",
"0.62569255",
"0.6244638",
"0.62391585",
"0.62187636",
"0.61886066",
"0.61867064",
"0.61478215",
"0.6144665",
"0.6136041",
"0.6135759",
"0.61000836",
"0.6099957",
"0.... | 0.76270914 | 1 |
Numero de D para activar VOX PTT | function UpdateNumPTT()
{
try
{
let numPTT = Number(gb_ctrl_input_ptt.elt.value);
let i=0;
gb_cadPTT = '';
for (i=0;i<numPTT;i++)
{
gb_cadPTT += 'D';
}
}
catch(err)
{
DebugLog(err.message.toString());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tNumber() {\n const [h, k] = [opt.h, opt.k];\n eid(\"tnumber\").innerHTML = `= ${h}<sup>2</sup> + (${h})(${k}) + ${k}<sup>2</sup> = ${h * h + h * k + k * k}`;\n}",
"function telefone(e){\r\n e.value=e.value.replace(/\\D/g,\"\") //REMOVE TUDO O QU... | [
"0.55350643",
"0.553259",
"0.5451237",
"0.5447314",
"0.54074",
"0.5385545",
"0.5361611",
"0.5349261",
"0.5300222",
"0.52612275",
"0.52318263",
"0.5229801",
"0.519442",
"0.51936823",
"0.51904696",
"0.51897794",
"0.51769674",
"0.51434004",
"0.5141143",
"0.5141143",
"0.5141143",... | 0.57257485 | 0 |
Convierte de 2 DTMF a Base64 | function DTMFtoCharBase64(dtmf)
{
let aReturn = '';
try
{
switch(dtmf)
{
case '00': aReturn='A'; break;
case '01': aReturn='B'; break;
case '02': aReturn='C'; break;
case '03': aReturn='D'; break;
case '04': aReturn='E'; break;
case '05': aReturn='F'; break;
case '06': aReturn... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CharBase64To2DTMF(car)\r\n{\r\n let aReturn = '';\r\n try\r\n {\r\n switch(car)\r\n { \r\n case 'A': aReturn='00'; break;\r\n case 'B': aReturn='01'; break;\r\n case 'C': aReturn='02'; break;\r\n case 'D': aReturn='03'; break;\r\n case 'E': aReturn='04'; break;\r\n case 'F': aReturn='05'; b... | [
"0.6250404",
"0.6170061",
"0.61428016",
"0.61284786",
"0.6121006",
"0.6117859",
"0.6108484",
"0.61060137",
"0.6085503",
"0.60733056",
"0.60656935",
"0.6018246",
"0.6016483",
"0.6014514",
"0.5995327",
"0.5983649",
"0.59485555",
"0.59349895",
"0.59348315",
"0.59345365",
"0.5891... | 0.6234314 | 1 |
Genera CRC de todo el frame a enviar | function FrameGenerateCRC(frameOrigen)
{
let aReturn = '00';
let aux = 0;
try
{
let i = 0;
for (i=0; i<frameOrigen.length; i++)
{
aux += Number(frameOrigen[i]);
}
if (aux > 63)
{
aux = aux % 64;
}
aReturn = aux.toString().padStart(2,'0');
}
catch(err)
{
DebugLog(err.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function crc(buf){return(updateCrc(-1,buf,buf.length)^-1)>>>0;// u32\n}",
"function updateCrc(crc,buf,len){for(let n=0;n<len;n++){crc=crc>>>8^crcTable[(crc^buf[n])&255]}return crc}",
"computeIdemCrc() {\n let crc = 0xFFFF;\n for (let i = -3; i < 5; i++) {\n crc = Crc16_1.CRC_16_CCITT.u... | [
"0.6853199",
"0.6817945",
"0.6426775",
"0.63545346",
"0.61762613",
"0.61584264",
"0.6044017",
"0.5965166",
"0.594299",
"0.59208256",
"0.591945",
"0.5898417",
"0.5898417",
"0.58749074",
"0.57686824",
"0.5739841",
"0.5715014",
"0.56501323",
"0.56498694",
"0.5621926",
"0.5604970... | 0.8403116 | 0 |
Send SMS de Prueba basica tipo 1 con longitud y CRC | function SendSMSTipo1Serv(cadToSend, servicio)
{
//#10CRxxYYzz*
//Tipo:1
//Servicio:0 Diccionario Espaniol
//Longitud 00
//CRC 00
try
{
gb_buf_send_dtmf = (gb_use_relay === true) ? 'C' : '';
gb_buf_send_dtmf += gb_cadPTT + gb_cadSilenceStart + '#';
let cadLog = '';
let frameData = '1'; //Ti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ProcesSMSTipo1()\r\n{\r\n let auxLen= 0; //longiud trama\r\n let auxCadLen=0; //longitud cadena\r\n let auxCRC= 0;\r\n let cadServ= 0;\r\n let cadLog='';\r\n let i=0;\r\n let cont=0;\r\n let cadBase64='';\r\n let cadDTMF ='';\r\n let cadDecompress='';\r\n let cadAreaRX ='';\r\n try\r\n {\r\n auxLen = gb_... | [
"0.6995498",
"0.6894542",
"0.666541",
"0.64961565",
"0.6451183",
"0.6260964",
"0.6248307",
"0.62290585",
"0.6117647",
"0.6045322",
"0.59831",
"0.59566313",
"0.5903152",
"0.5884233",
"0.5860891",
"0.5833471",
"0.5805979",
"0.576053",
"0.5735613",
"0.5735475",
"0.57321835",
"... | 0.7173016 | 0 |
Convierte un caracter a codigo 2key dtmf | function CharTo2KeyDTMF(valor)
{
let aReturn='';
try
{
switch(valor)
{
case 'A': aReturn= '2A';break;
case 'B': aReturn= '2B';break;
case 'C': aReturn= '2C';break;
case 'D': aReturn= '3A';break;
case 'E': aReturn= '3B';break;
case 'F': aReturn= '3C';break;
case 'G': aReturn= '4A... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function StringTwoKeyDTMFToString(cad)\r\n{\r\n let aReturn=''; \r\n let i=0;\r\n try\r\n {\r\n for (i=0;i<(cad.length-2);i+=2)\r\n {\r\n aReturn += TwoKeyDTMFTochar(cad[i]+cad[i+1]);\r\n }\r\n }\r\n catch(err)\r\n {\r\n DebugLog(err.message.toString());\r\n } \r\n return (aReturn);\r\n}",
"function String... | [
"0.66612995",
"0.6583459",
"0.6580413",
"0.65202546",
"0.61486924",
"0.593506",
"0.5693366",
"0.5693366",
"0.568712",
"0.5684501",
"0.5681833",
"0.5679486",
"0.5679486",
"0.5679486",
"0.5679486",
"0.5679486",
"0.5679486",
"0.5679486",
"0.5679486",
"0.5679486",
"0.5679486",
... | 0.674081 | 0 |
Convierte string 2KeyDTMFTo String normal | function StringTwoKeyDTMFToString(cad)
{
let aReturn='';
let i=0;
try
{
for (i=0;i<(cad.length-2);i+=2)
{
aReturn += TwoKeyDTMFTochar(cad[i]+cad[i+1]);
}
}
catch(err)
{
DebugLog(err.message.toString());
}
return (aReturn);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function StringTo2KeyDTMF(cad)\r\n{\r\n let aReturn='';\r\n let i=0;\r\n try\r\n {\r\n for (i=0;i<cad.length;i++)\r\n {\r\n aReturn = aReturn+CharTo2KeyDTMF(cad[i].toUpperCase());\r\n }\r\n }\r\n catch(err)\r\n {\r\n DebugLog(err.message.toString());\r\n } \r\n return aReturn;\r\n}",
"function CharTo2KeyDT... | [
"0.74133885",
"0.66777056",
"0.6553963",
"0.6067563",
"0.58732074",
"0.5837891",
"0.583367",
"0.56118786",
"0.5601498",
"0.5519546",
"0.5493411",
"0.5493411",
"0.5463884",
"0.54617226",
"0.54569054",
"0.5456802",
"0.5432094",
"0.5432094",
"0.54316854",
"0.5425919",
"0.5378922... | 0.79674417 | 0 |
Convierte un string a 2key dtmf | function StringTo2KeyDTMF(cad)
{
let aReturn='';
let i=0;
try
{
for (i=0;i<cad.length;i++)
{
aReturn = aReturn+CharTo2KeyDTMF(cad[i].toUpperCase());
}
}
catch(err)
{
DebugLog(err.message.toString());
}
return aReturn;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DTMFtoCharBase64(dtmf)\r\n{\r\n let aReturn = '';\r\n try\r\n {\r\n switch(dtmf)\r\n { \r\n case '00': aReturn='A'; break;\r\n case '01': aReturn='B'; break;\r\n case '02': aReturn='C'; break;\r\n case '03': aReturn='D'; break;\r\n case '04': aReturn='E'; break;\r\n case '05': aReturn='F'; ... | [
"0.6370067",
"0.6353441",
"0.60405606",
"0.5996002",
"0.59314215",
"0.5842472",
"0.5836141",
"0.57355326",
"0.55778056",
"0.5561348",
"0.5537075",
"0.5532573",
"0.55318564",
"0.55318564",
"0.55218655",
"0.55218655",
"0.55218655",
"0.55218655",
"0.55218655",
"0.55218655",
"0.5... | 0.64494807 | 0 |
Lee tonos DTMF desde el gamepad conectado a MT8870 | function Poll_Pad_DTMF()
{
try
{
if (gb_use_gamepad_dtmf === true)
{
let pads = navigator.getGamepads();
let pad0 = pads[0];
let i=0;
if (pad0)
{
gb_cad_botones='';
for (i=0;i<pad0.buttons.length;i++)
{
if (pad0.buttons[i].value === 1)
{
gb_cad_botones+='... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Poll_Pad_DTMF()\r\n{ \r\n try\r\n {\r\n if (gb_use_gamepad_dtmf === false)\r\n {\t\r\n return;\r\n }\r\n\t\r\n let pads = navigator.getGamepads();\r\n let pad0 = pads[0];\r\n let i=0;\r\n if (pad0)\r\n {\r\n gb_cad_botones='';\r\n for (i=0;i<pad0.buttons.length;i++)\r\n {\r\n if (pad0.b... | [
"0.6907961",
"0.6067778",
"0.60327035",
"0.58857167",
"0.58231556",
"0.5782203",
"0.5747616",
"0.57162505",
"0.5669428",
"0.56650484",
"0.5605578",
"0.55369365",
"0.54975027",
"0.5477136",
"0.5442367",
"0.5435744",
"0.54341644",
"0.5350091",
"0.5347595",
"0.5329132",
"0.52777... | 0.6828581 | 1 |
Procesa un SMS Tipo 0 con longitud y CRC | function ProcesSMSTipo0()
{
//#0xxYYzz..*
let auxLen= 0;
let auxCRC= 0;
let cadLog='';
let i=0;
let cont=0;
let cadBase64='';
let cadRX='';
let cadAreaRX ='';
let cadDTMF ='';
try
{
auxLen = gb_buf_rcv_dtmf.length-2; //Quitamos * y Type 0
cadLog += new Date(Date.now()).toLocaleString... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ProcesSMSTipo1()\r\n{\r\n let auxLen= 0; //longiud trama\r\n let auxCadLen=0; //longitud cadena\r\n let auxCRC= 0;\r\n let cadServ= 0;\r\n let cadLog='';\r\n let i=0;\r\n let cont=0;\r\n let cadBase64='';\r\n let cadDTMF ='';\r\n let cadDecompress='';\r\n let cadAreaRX ='';\r\n try\r\n {\r\n auxLen = gb_... | [
"0.69878644",
"0.6129404",
"0.6125521",
"0.61132395",
"0.6023254",
"0.5928832",
"0.56959",
"0.5633107",
"0.562692",
"0.5540894",
"0.55408686",
"0.5540184",
"0.55230504",
"0.5514316",
"0.54076415",
"0.53659517",
"0.53628266",
"0.5311578",
"0.5234766",
"0.5210593",
"0.517258",
... | 0.65842795 | 1 |
Procesa un SMS Tipo 1 con longitud y CRC | function ProcesSMSTipo1()
{
let auxLen= 0; //longiud trama
let auxCadLen=0; //longitud cadena
let auxCRC= 0;
let cadServ= 0;
let cadLog='';
let i=0;
let cont=0;
let cadBase64='';
let cadDTMF ='';
let cadDecompress='';
let cadAreaRX ='';
try
{
auxLen = gb_buf_rcv_dtmf.length-7; //Quitamos *... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SendSMSTipo1Serv(cadToSend, servicio)\r\n{\r\n //#10CRxxYYzz*\r\n //Tipo:1 \r\n //Servicio:0 Diccionario Espaniol\r\n //Longitud 00\r\n //CRC 00\r\n try\r\n {\r\n gb_buf_send_dtmf = (gb_use_relay === true) ? 'C' : '';\r\n gb_buf_send_dtmf += gb_cadPTT + gb_cadSilenceStart + '#';\r\n let cadLog = '';\r... | [
"0.6368657",
"0.6356379",
"0.63394445",
"0.6154589",
"0.5858009",
"0.5661778",
"0.5523624",
"0.5504698",
"0.5498333",
"0.5498029",
"0.5491549",
"0.5463454",
"0.5411878",
"0.5390254",
"0.538085",
"0.53661954",
"0.53593934",
"0.53526956",
"0.53269225",
"0.5297519",
"0.52930635"... | 0.725428 | 0 |
Procesa los buffers de datos DTMF recibidos y eventos | function PollProcessDTMF()
{
try
{
if (gb_begin_sync_dtmf === true)
{
gb_begin_sync_dtmf= false; //Comienzo trama
//gb_cadDTMF +=' Sync';
//let aux_cad = gb_buf_rcv_dtmf;
//console.log(aux_cad);
//gb_cadDTMF+=' '+StringTwoKeyDTMFToString(aux_cad);
gb_buf_rcv_dtmf =''; //rese... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ProcesSMSTipo0()\r\n{\r\n //#0xxYYzz..*\r\n let auxLen= 0;\r\n let auxCRC= 0;\r\n let cadLog='';\r\n let i=0;\r\n let cont=0;\r\n let cadBase64='';\r\n let cadRX='';\r\n let cadAreaRX ='';\r\n let cadDTMF ='';\r\n \r\n try\r\n {\r\n auxLen = gb_buf_rcv_dtmf.length-2; //Quitamos * y Type 0 \r\n cadLog +... | [
"0.6233689",
"0.60080945",
"0.59937626",
"0.5856266",
"0.5838191",
"0.58273494",
"0.58273494",
"0.5747404",
"0.5731132",
"0.5697753",
"0.5631476",
"0.56230956",
"0.5618751",
"0.56152976",
"0.5606243",
"0.5586834",
"0.55648774",
"0.5557434",
"0.55422467",
"0.55340457",
"0.5507... | 0.6577281 | 0 |
!AngularListOperator object parameters items: the item array which will be operate. tempItem: a single default template item. return | function AngularListOperator(items,tempItem){
this.tempItem={};
this.items=[];
this.tempItem=tempItem;
this.items=items;
//operate tag values
this.operate={
opr_id:{name:"opr_id"},
opr_display:{name:"opr_display",enum:{"display":true,"hidden":false}},
opr_status:{name:"opr_status",en... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function templateCntl($scope) {\n console.log('in template');\n var items = [];\n var anItem = {\n type: 'text' //or table, or calendar\n ,isSection: false\n ,title: 'my first item'\n ,content: 'and this is the content'\n };\n $scope.items = items;\n}",
"function listI... | [
"0.56641924",
"0.55928785",
"0.55308694",
"0.5529264",
"0.5476436",
"0.5461293",
"0.5406746",
"0.539825",
"0.5385362",
"0.5379865",
"0.5379865",
"0.5379865",
"0.53781545",
"0.5375956",
"0.532436",
"0.5322039",
"0.5311958",
"0.53069633",
"0.5297092",
"0.5257466",
"0.5250631",
... | 0.77381706 | 0 |
Searches a team stats given team term | function searchTeam(term) {
return search(term, 'soccer club', true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function search( searchTerm ) {\n //If teams[] array is empty, return (maybe it is still loading or is empty for some reason)\n if(teams.length === 0) {\n return;\n }\n \n var convertedSearchTerm = searchTerm.toUpperCase(); \n hits.length = 0; \n\n for ( var i = 0; i < teams.length; i++ ) { \n // Search... | [
"0.7499354",
"0.6815976",
"0.62446386",
"0.62212443",
"0.6100092",
"0.6062966",
"0.6039086",
"0.5995693",
"0.5986417",
"0.592927",
"0.59111893",
"0.59098005",
"0.5815349",
"0.5781848",
"0.5740773",
"0.5733888",
"0.5726606",
"0.570673",
"0.56988865",
"0.5666331",
"0.56544834",... | 0.81517166 | 0 |
POINTS UPDATE THE COUNTER | function updateCounter() {
document.querySelector('#counter').textContent = (points);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function incrementPoints() {\n currentPointValue++;\n }",
"addPoint() {\n this.points += 1;\n this.updateScore();\n }",
"function increasePoints() {\n\tvar points = parseInt(pointsLabel.innerHTML);\n\tnewPoints = 20 / (seconds + 1) + 3;\n\tnewPoints = Math.round(newPoints);\n\tnewPoints *= 100... | [
"0.8081689",
"0.74488485",
"0.7242448",
"0.71695",
"0.71073014",
"0.70761055",
"0.6985826",
"0.6974689",
"0.689769",
"0.68555206",
"0.6814216",
"0.677296",
"0.67685807",
"0.6724368",
"0.6695941",
"0.66217613",
"0.66174316",
"0.6609617",
"0.6605062",
"0.6587106",
"0.6563072",
... | 0.76945406 | 1 |
digest the queue of open buy/sell orders | async consume() {
if (this.state.consuming) return;
if (!this.queue.meta.length) return;
this.state.consuming = true;
console.log('Consuming queue...', 'Orders in queue: ' + this.queue.meta.length);
const filledTransactions = await this.queue.digest();
//repopulate que... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async sendOrders()\n\t{\n\t\tvar currentBlock = await EtherMiumApi.getCurrentBlockNumber();\n\t\ttry {\n\t\t\tfor (let token of this.tokensList)\n\t\t\t{\n\t\t\t\tvar found_buy_order = false;\n\t\t\t\tvar found_sell_order = false;\n\n\t\t\t\t// check if there active orders\n\t\t\t\tvar orders = await EtherMiumApi.... | [
"0.602205",
"0.59220463",
"0.5908035",
"0.5846901",
"0.57785326",
"0.57484376",
"0.5724596",
"0.56473637",
"0.56043786",
"0.5581398",
"0.5576218",
"0.55615354",
"0.5551782",
"0.55470496",
"0.5515174",
"0.55141234",
"0.5476634",
"0.5473289",
"0.54628617",
"0.5459224",
"0.54413... | 0.67462915 | 0 |
calculate quantity of coin to purchase based on given budget from .env | calculateQuantity() {
console.log('Calculating quantity... ');
const symbol = this.symbol.meta;
const minQuantity = symbol.minQty;
const maxQuantity = symbol.maxQty;
const quantitySigFig = symbol.quantitySigFig;
const stepSize = symbol.stepSize; //minimum quantity differ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getMoneySpent(keyboards, drives, budget) {\n\tlet totalPrice = -1;\n\n\tfor (let i = 0; i < keyboards.length; i++) {\n\t\tfor (let j = 0; j < drives.length; j++) {\n\t\t\tlet sum = keyboards[i] + drives[j];\n\n\t\t\tif (sum <= budget && sum > totalPrice) {\n\t\t\t\ttotalPrice = sum;\n\t\t\t}\n\t\t}\n\t}\n... | [
"0.6711728",
"0.65935516",
"0.65357095",
"0.65249914",
"0.65060085",
"0.6499298",
"0.64533114",
"0.6421219",
"0.6417626",
"0.64006317",
"0.63867164",
"0.6385053",
"0.6344331",
"0.63169014",
"0.63153183",
"0.6281409",
"0.6265249",
"0.6265069",
"0.62632066",
"0.62494195",
"0.62... | 0.6699428 | 1 |
OBSERVER INTERSECT HANDLING if TOP edge of step crosses threshold, bottom must be > 0 which means it is on "screen" (shifted by offset) | function intersectStepAbove(entries) {
updateDirection();
entries.forEach(function (entry) {
var isIntersecting = entry.isIntersecting;
var boundingClientRect = entry.boundingClientRect;
var target = entry.target;
// bottom is how far bottom edge of el is from top of viewport
var ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function intersectViewportAbove(entries) {\n updateDirection();\n entries.forEach(function (entry) {\n var isIntersecting = entry.isIntersecting;\n var target = entry.target;\n var index = getIndex(target);\n var ss = stepStates[index];\n if (\n isIntersecting &&\n dire... | [
"0.6143489",
"0.58449256",
"0.5767074",
"0.5740196",
"0.5728758",
"0.5672009",
"0.56013745",
"0.5534198",
"0.55125445",
"0.5510008",
"0.55081093",
"0.5491274",
"0.54620564",
"0.5454768",
"0.5450353",
"0.54456985",
"0.54325503",
"0.54309464",
"0.5427237",
"0.5417503",
"0.54152... | 0.6843457 | 0 |
Get the CDN url for a given version | function getCdnUrl(version) {
if (version === void 0) { version = DEFAULT_VERSION; }
return "https://js.arcgis.com/" + version + "/";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getCdnCssUrl(version) {\n if (version === void 0) { version = DEFAULT_VERSION; }\n var baseUrl = getCdnUrl(version);\n var parsedVersion = parseVersion(version);\n if (parsedVersion !== NEXT && parsedVersion.major === 3) {\n // NOTE: at 3.11 the CSS moved from the /js folder to the root... | [
"0.76298445",
"0.59565395",
"0.58338195",
"0.57067233",
"0.5681178",
"0.56209636",
"0.56209636",
"0.55520535",
"0.55397296",
"0.55076385",
"0.5487545",
"0.54704607",
"0.54704607",
"0.54704607",
"0.54704607",
"0.5463031",
"0.54569316",
"0.5442826",
"0.5439542",
"0.54254913",
"... | 0.83662266 | 0 |
Get the CDN url for a the CSS for a given version and/or theme | function getCdnCssUrl(version) {
if (version === void 0) { version = DEFAULT_VERSION; }
var baseUrl = getCdnUrl(version);
var parsedVersion = parseVersion(version);
if (parsedVersion !== NEXT && parsedVersion.major === 3) {
// NOTE: at 3.11 the CSS moved from the /js folder to the root
v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getCdnUrl(version) {\n if (version === void 0) { version = DEFAULT_VERSION; }\n return \"https://js.arcgis.com/\" + version + \"/\";\n}",
"function loadCss(urlOrVersion, before) {\n var url = getCssUrl(urlOrVersion);\n var link = getCss(url);\n if (!link) {\n // create & load the c... | [
"0.67419565",
"0.6357386",
"0.60145587",
"0.5997408",
"0.58317834",
"0.5720094",
"0.5697154",
"0.56858796",
"0.56594324",
"0.5656791",
"0.5652614",
"0.5649191",
"0.5633978",
"0.5565854",
"0.55261964",
"0.5480301",
"0.54639876",
"0.540195",
"0.5386361",
"0.5375671",
"0.5336255... | 0.8284624 | 0 |
get the script injected by this library | function getScript() {
return document.querySelector('script[data-esri-loader]');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static get script() {\n return _PROPERTIES_.get(this).script;\n }",
"get pythonScript() {\n return this.getStringAttribute('python_script');\n }",
"function getScript() {\n const content = fs.readFileSync(\"./index.html\", { encoding: \"utf-8\" });\n return content.substring(\n \"<sc... | [
"0.7264153",
"0.67184806",
"0.65152717",
"0.6400939",
"0.6387205",
"0.6367396",
"0.6355622",
"0.6351141",
"0.63247997",
"0.632227",
"0.62329966",
"0.62262034",
"0.61479837",
"0.6143391",
"0.6143391",
"0.61118203",
"0.60588646",
"0.604979",
"0.60409033",
"0.60301435",
"0.60258... | 0.6790733 | 1 |
Attach is called as soon as the layer view is ready to start rendering. | attach() {
// We use a full-screen quad and shaders to composite the frame rendered
// with deck.gl on top of the MapView. Composition uses the MapView context.
const gl = this.context;
_commons__WEBPACK_IMPORTED_MODULE_0__["initializeResources"].call(this, gl);
// Update deck props
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"layerSetup() {\n this._layer = this.createLayer();\n this._addObservers();\n this._addEventListeners();\n if (this.get('containerLayer')) {\n this.get('containerLayer')._layer.addLayer(this._layer);\n }\n this.didCreateLayer();\n }",
"attachedCallback () {\n /**\n * Now that we... | [
"0.6572414",
"0.64931905",
"0.61101204",
"0.60131717",
"0.6007124",
"0.5979971",
"0.59760785",
"0.59735936",
"0.5958832",
"0.5958832",
"0.59204024",
"0.5912956",
"0.59070295",
"0.59070295",
"0.59070295",
"0.59015703",
"0.5897831",
"0.58674765",
"0.58674765",
"0.5862239",
"0.5... | 0.69439304 | 0 |
the icons to display after filtering and then pagination | displayedIcons () {
let icons = []
if (this.iconsList) {
icons = this.filteredIcons
// should the icons be paged?
if (this.pagination && this.pagination.itemsPerPage !== 0) {
icons = icons.slice(this.firstItemIndex, this.lastItemIndex)
}
}
return icons
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function icons() {\r\n var arr = [], style = 'style=\"width:18px\"';\r\n if (iconMapper.map(link)) add(iconMapper.map(link));\r\n if (iconMapper.map(obj.Type)) add(iconMapper.map(obj.Type));\r\n if (reg !== 'Message' && iconMapper.map(reg)) add(iconMapper... | [
"0.66693234",
"0.63949674",
"0.63713473",
"0.63447237",
"0.6320429",
"0.6286965",
"0.62754756",
"0.6275414",
"0.6272162",
"0.6271752",
"0.62562484",
"0.6255028",
"0.62520313",
"0.62520313",
"0.6246123",
"0.62438166",
"0.62399817",
"0.6231459",
"0.62271047",
"0.6222596",
"0.62... | 0.70175177 | 0 |
index of first item on a page | firstItemIndex () {
const { page, itemsPerPage } = this.computedPagination
return (page - 1) * itemsPerPage
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getFirstIndex() {\n // index of the top item\n return (this.maxIndex - Math.floor(this.index)) % this.maxIndex; \n }",
"pageIndex(itemIndex) {\n return this.pages.findIndex(page =>\n page.element.find(element => element.originalIndex === itemIndex)\n )\n }",
"pageIndex(item... | [
"0.7556923",
"0.718312",
"0.68336385",
"0.6669309",
"0.6665736",
"0.6621129",
"0.661494",
"0.66136426",
"0.63970935",
"0.636323",
"0.63482213",
"0.6331011",
"0.63157237",
"0.62895787",
"0.6276888",
"0.61815226",
"0.6169175",
"0.6164825",
"0.61278075",
"0.6072376",
"0.606803",... | 0.8189742 | 0 |
index of last item on a page | lastItemIndex () {
const { page, itemsPerPage } = this.computedPagination
return page * itemsPerPage
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DDLightbarMenu_GetTopItemIdxToTopOfLastPage()\n{\n\tvar numItemsPerPage = this.size.height;\n\tif (this.borderEnabled)\n\t\tnumItemsPerPage -= 2;\n\tvar topItemIndex = this.items.length - numItemsPerPage;\n\tif (topItemIndex < 0)\n\t\ttopItemIndex = 0;\n\treturn topItemIndex;\n}",
"getLastIndex() {\n ... | [
"0.7885593",
"0.72848046",
"0.71616876",
"0.71616876",
"0.7120428",
"0.7120428",
"0.7120428",
"0.70950335",
"0.6981801",
"0.6973843",
"0.6928072",
"0.6910117",
"0.6901462",
"0.684304",
"0.66649127",
"0.6657009",
"0.66147333",
"0.6581623",
"0.6565948",
"0.6531726",
"0.6522002"... | 0.8167566 | 0 |
returns true if on first page | isFirstPage () {
return this.computedPagination.page === 1
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isFirstPage() {\n if(curPageNumber == 0) {\n return true;\n }\n return false;\n }",
"checkForBeginning() {\n if (this.leftPage !== 1) {\n this.onFirstPage = false;\n } else {\n this.onFirstPage = true;\n }\... | [
"0.8903105",
"0.7308396",
"0.7279377",
"0.70288473",
"0.69304216",
"0.6842652",
"0.67781967",
"0.6692301",
"0.6643592",
"0.6592898",
"0.65603137",
"0.6496737",
"0.6483121",
"0.64164335",
"0.636084",
"0.633188",
"0.6269731",
"0.625849",
"0.60955364",
"0.6094413",
"0.6086183",
... | 0.82283676 | 1 |
returns true if on last page | isLastPage () {
return this.lastItemIndex === 0
? true
: this.computedPagination.page >= this.pagesNumber
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isLastPage() {\n var viewLastIndex = curPageNumber * curPageLimit + curCount + 1;\n if(viewLastIndex >= totalCount) {\n return true;\n }\n return false;\n }",
"checkForEnd() {\n if (this.rightPage !== 50) {\n this.onLast... | [
"0.87675834",
"0.7379917",
"0.7246415",
"0.7234081",
"0.7224729",
"0.7213127",
"0.72072417",
"0.7009767",
"0.69000065",
"0.66082054",
"0.6597224",
"0.6535723",
"0.6523987",
"0.6499764",
"0.6441594",
"0.6415252",
"0.6338917",
"0.6332047",
"0.63066614",
"0.62934965",
"0.6244535... | 0.8747827 | 1 |
returns true if the pagination is the same, otherwise returns false if it has changed | samePagination (oldPag, newPag) {
// eslint-disable-next-line no-unused-vars
for (let prop in newPag) {
if (newPag[prop] !== oldPag[prop]) {
return false
}
}
return true
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPageChanges() {\n if (getQueryStringValue(document.location.href, 'mode') == 'view') {\n return false;\n }\n\n if (typeof (HasChanges) != \"undefined\" && HasChanges || typeof (HasRCChanges) != \"undefined\" && HasRCChanges)\n return true;\n else if (typeof (vrGridIds) != \"un... | [
"0.66265327",
"0.6623938",
"0.6551788",
"0.64546496",
"0.643768",
"0.6314968",
"0.61530423",
"0.6151851",
"0.612437",
"0.60716563",
"0.60175425",
"0.59909964",
"0.59672666",
"0.59613895",
"0.5952157",
"0.58393776",
"0.5820974",
"0.58036137",
"0.576282",
"0.5761691",
"0.575387... | 0.8537391 | 0 |
Used to remove fields from a nested form See | function remove_fields (link) {
//Sets hidden field for _destroy value to 1 (i.e. true) to indicate to remove fields
//when submit button is clicked.
$(link).previous("input[type=hidden]").value = "1";
//Navigates up DOM tree to first tag with class 'fields' and hides them
$(link).up(".fields").hide();
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeField(form, fieldName) {\n\n // Scan sections\n form.sections.forEach(function (section, key) {\n scanFields(section.fields, fieldName);\n });\n\n // Form fields\n scanFields(form.fields, fieldName);\n\n return form;\n\n}",
"function removeField(form, fieldName) {\n\n // Scan sections\n ... | [
"0.7164074",
"0.7159699",
"0.7067147",
"0.6965832",
"0.695082",
"0.6932741",
"0.6909635",
"0.68553734",
"0.6849415",
"0.68368894",
"0.66259015",
"0.6619221",
"0.65998423",
"0.65247715",
"0.6523213",
"0.6499889",
"0.64180547",
"0.6414398",
"0.6405315",
"0.63259405",
"0.6325940... | 0.720877 | 0 |
Outputs copyright date range. Parameters: organization name of organization holding copyright start_date original start date of copyright | function copyDate(organization,start_date) {
var copyright=new Date();
var update=copyright.getFullYear();
//---write copyright
if ( start_date == update )
document.write("<br />Copyright © " + start_date + "<br />" + organization + ", All Rights Reserved.");
else
document.wri... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"formatYearRange(start, end) {\n return `${start} \\u2013 ${end}`;\n }",
"formatYearRange(start, end) {\n return `${start} \\u2013 ${end}`;\n }",
"function addYearRangeOptions() {\n var min = minDate.getFullYear();\n var max = maxDate.getFullYear();\n var optionsStart = \"\";\n v... | [
"0.6707442",
"0.6707442",
"0.6143815",
"0.5983119",
"0.59599334",
"0.58763766",
"0.5841859",
"0.5741077",
"0.5640219",
"0.5564247",
"0.5558027",
"0.55010337",
"0.54752797",
"0.54715085",
"0.54132587",
"0.5412277",
"0.54074526",
"0.5380579",
"0.53444535",
"0.5334175",
"0.53224... | 0.71713346 | 0 |
Toggle between showing and hiding the navigation menu links when the user clicks on the hamburger menu / bar icon | function hamburger() {
var x = document.getElementById("myLinks");
if (x.style.display === "block") {
x.style.display = "none";
} else {
x.style.display = "block";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toggleNavLinks() {\n let hamburgerLinks = document.getElementById(\"myLinks\");\n if (hamburgerLinks.style.display === \"block\") {\n hamburgerLinks.style.display = \"none\";\n } else {\n hamburgerLinks.style.display = \"block\";\n }\n}",
"function toggleHamburgerMenu() {\n $('.hamburger-icon... | [
"0.7900794",
"0.77206933",
"0.77206933",
"0.77206933",
"0.7645828",
"0.7583689",
"0.7554876",
"0.7508217",
"0.7505159",
"0.74974805",
"0.7492261",
"0.7456871",
"0.7410768",
"0.7402226",
"0.739964",
"0.73755246",
"0.7335794",
"0.73274475",
"0.7320287",
"0.73109514",
"0.7285642... | 0.7743017 | 1 |
Sort the display based on an Ascending button push | function sortArrayAsc(index){
console.log("Display before sort: ", displayArray);
// switch/case based on asc button index
switch (index) {
case 0:
displayArray.sort(function (a,b) {
var x = a.property[1].propertyName.toLow... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sortButtonClick() {\n\tvar id = $(this).attr(\"data-col\");\n\t// console.log('id discovered was'+ id);\n\n\tvar f = Filters[id];\n\n\tswitch (f.Direction) {\n\t\tcase SortOptions.None:\n\t\t\tf.Direction = SortOptions.Ascending;\n\t\t\tf.Priority = getMaxPriority() + 1;\n\t\t\tbreak;\n\n\t\tcase SortOpti... | [
"0.7222609",
"0.7106427",
"0.7000969",
"0.6950897",
"0.69493973",
"0.68966794",
"0.68938327",
"0.6888303",
"0.6850631",
"0.67841345",
"0.67760634",
"0.6766374",
"0.67270833",
"0.67044157",
"0.6690328",
"0.66815317",
"0.6678537",
"0.66670996",
"0.6666851",
"0.6627237",
"0.6625... | 0.7250752 | 0 |
import GamesPage from './GamesPage'; | function App() {
return (
<div className="App">
<header className="App-header">
<h2>HTML Table</h2>
<ExpenseTable />
{/* <Link to="/games">Games</Link> */}
</header>
{/* <Switch> */}
{/* <Route exact strict path="/games" component={GamesPage} /> */}
{/* </Swi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"render() {\n return (\n <div className=\"App\">\n <Game />\n </div>\n );\n }",
"function MyApp() {\n return (\n <div>\n <AppPage /> \n </div>\n )\n}",
"function App() {\n //return <Game></Game>;\n return <Game></Game>;\n}",
"function App() {\n ret... | [
"0.6244587",
"0.61006117",
"0.6098538",
"0.609818",
"0.6036862",
"0.6028734",
"0.6005854",
"0.59312445",
"0.5911038",
"0.5890058",
"0.5859224",
"0.58329254",
"0.5829629",
"0.5825954",
"0.5812619",
"0.5799401",
"0.57777035",
"0.5760471",
"0.575151",
"0.571828",
"0.5716437",
... | 0.6330631 | 0 |
Creates an object from an array of tuples | function makeObject(tuples){
var result = {};
_.each(tuples, function(tuple){
fromTuple(result, tuple);
});
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tuple (iterable) {\n\t\tvar instance = iterable ? [] .slice.apply (iterable) : [];\n\t\tinstance.__class__ = tuple;\t// Not all arrays are tuples\n\t\treturn instance;\n\t}",
"function tuple(t) {\r\n var ntuple = \"Tuple\" + t.length;\r\n t.constructor = Tuple[ntuple];\r\n return t;\r\n}",
"f... | [
"0.6577601",
"0.6523656",
"0.6372333",
"0.6135914",
"0.6128947",
"0.61259276",
"0.605052",
"0.60345745",
"0.5850212",
"0.5823852",
"0.5748564",
"0.5734126",
"0.56744844",
"0.56512856",
"0.56365234",
"0.5601409",
"0.5594239",
"0.5568129",
"0.5555841",
"0.5530465",
"0.5522089",... | 0.69237643 | 0 |
convert a number into "chunks" of 0999 | function chunk(number) {
var thousands = [];
while(number > 0) {
thousands.push(number % 1000);
number = Math.floor(number / 1000);
}
return thousands;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function chunk(number) {\n var thousands = [];\n \n while(number > 0) {\n thousands.push(number % 1000);\n number = Math.floor(number / 1000);\n }\n \n return thousands;\n }",
"function convert(n) {\n\tvar output = [];\n\twhile(n > 0) {\n\t\toutput.unshift(n % 10);\n\t\tn = Math.floor(n ... | [
"0.74570066",
"0.69409204",
"0.6778664",
"0.66010445",
"0.65276176",
"0.6515498",
"0.65051067",
"0.6462788",
"0.6449673",
"0.63362104",
"0.62806803",
"0.6268133",
"0.62567323",
"0.62550986",
"0.62451947",
"0.62222016",
"0.62200385",
"0.6202866",
"0.61516166",
"0.6128454",
"0.... | 0.73995775 | 1 |
emit SDK_SEGMENTS_ARRIVED (and thus SDK_READY) if not ready yet and splits are not using segments | function smartReady() {
const isReady = context.get(context.constants.READY, true);
if (!isReady && !splitsStorage.usesSegments()) segmentsEventEmitter.emit(segmentsEventEmitter.SDK_SEGMENTS_ARRIVED);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setupSegmentLoaderListeners_() {\n this.mainSegmentLoader_.on('bandwidthupdate', () => {\n // Whether or not buffer based ABR or another ABR is used, on a bandwidth change it's\n // useful to check to see if a rendition switch should be made.\n this.checkABR_('bandwidthupdate');\n this.tech_... | [
"0.5750641",
"0.56873024",
"0.5651679",
"0.5588243",
"0.53916925",
"0.53481543",
"0.5339523",
"0.53202355",
"0.52985066",
"0.5227055",
"0.5175594",
"0.5111908",
"0.50463575",
"0.5001606",
"0.49936208",
"0.48734024",
"0.48707643",
"0.4848429",
"0.48399127",
"0.48289707",
"0.47... | 0.77702093 | 0 |
smartly pause/resume mySegmentsUpdaterTask while doing polling | function smartPausing() {
if (!running) return; // noop if not doing polling
const splitsHaveSegments = splitsStorage.usesSegments();
if (splitsHaveSegments !== mySegmentsUpdaterTask.isRunning()) {
log.info(`Turning segments data polling ${splitsHaveSegments ? 'ON' : 'OFF'}.`);
if (splitsHaveSeg... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"start() {\n running = true;\n if (splitsStorage.usesSegments()) mySegmentsUpdaterTask.start();\n }",
"function SegmentUpdateWorker(segment) {\n var maxChangeNumber = 0;\n var handleNewEvent = false;\n var isHandlingEvent;\n var cdnBypass;\n var backoff = new Backof... | [
"0.6381206",
"0.631058",
"0.62410367",
"0.61266255",
"0.59800893",
"0.5872631",
"0.5849767",
"0.58467734",
"0.5786298",
"0.5768773",
"0.565462",
"0.5642172",
"0.56027126",
"0.55994445",
"0.55923426",
"0.55735224",
"0.55529857",
"0.555044",
"0.5513171",
"0.5490042",
"0.5483377... | 0.7401371 | 0 |
ON SELECT SORT CHANGE This function is called when the "Sort By: " select box is changed This function will call sortChange | onSortChange(e){
const sort = e.target.value;
const viewList = this.state.viewItems;
this.sortChange(sort, viewList);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onSortValueChanged() {\n $scope.options.filter = { sort: $scope.sortValue };\n }",
"function sortSelectCallback() {\n let sortType = $(this).val();\n setStatus(\"sortType\", sortType);\n\n console.log(\"sort clicked\");\n\n //TODO: Can we do this without ref... | [
"0.7887432",
"0.7607547",
"0.7379757",
"0.735196",
"0.73405117",
"0.7321879",
"0.70538723",
"0.7052784",
"0.69722575",
"0.6880879",
"0.6872265",
"0.6821036",
"0.6816971",
"0.6798275",
"0.67950207",
"0.67900306",
"0.67745024",
"0.6745036",
"0.6701516",
"0.66981304",
"0.6653831... | 0.76273346 | 1 |
Gets all dependencies recursively on a codebook. Only works where getDirectDeps has been used to populate directDependencies | function getDepsRecursive(field, visited = []) {
if (visited.indexOf(field) !== -1) return
visited.push(field)
for (let dep of field.directDependencies) getDepsRecursive(dep, visited)
return visited
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDependencies() {\n logger.info('Fetching dependencies');\n return new Promise((resolve, reject) => {\n const dependencies = {};\n\n (0, _readPackageTree2.default)('./', (err, data) => {\n if (err) {\n logger.error('Error fetching dependencies');\n return reject(err);\n }... | [
"0.6216771",
"0.6191409",
"0.591352",
"0.584134",
"0.56730884",
"0.56607074",
"0.5646538",
"0.5615499",
"0.5601988",
"0.55997866",
"0.5598915",
"0.5596652",
"0.5558506",
"0.55505353",
"0.5544376",
"0.5540254",
"0.55269617",
"0.55110514",
"0.55070966",
"0.550581",
"0.5504508",... | 0.61925787 | 1 |
Converts a parsed csv codebook to internal format Also calculate field dependencies | function csvToCodebook(csv) {
let columns = csv[0]
let codebook = []
// Create items
for (let i = 1; i < csv.length; i++) {
let o = {}
for (let j = 0; j < columns.length; j++) o[columns[j]] = csv[i][j]
codebook.push(o)
}
for (let field of codebook)
field.directDependencies = getDirectDeps(field, (e) =>... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"parseInputData(csv) {\n const lines = csv.split(\"\\n\");\n let i;\n for (i = 0; i < lines.length; ++i) {\n lines[i] = lines[i].split(\",\");\n }\n const echelon = lines[0][1];\n this.echelonRef.current.setState({echelon: parseInt(echelon)});\n\n i = 1;\... | [
"0.65200263",
"0.6224067",
"0.6217271",
"0.61175054",
"0.609903",
"0.5964658",
"0.5936103",
"0.59125036",
"0.58283424",
"0.58017915",
"0.5798679",
"0.5795237",
"0.57747024",
"0.5766139",
"0.5732697",
"0.56692064",
"0.5603033",
"0.5577659",
"0.55305666",
"0.5526983",
"0.552630... | 0.7547464 | 0 |
sum all the elements in array | function sumArray(array) {
var result = 0
array.forEach(function(element) {
result += element;
});
return result
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sumArr(array){\n\n}",
"function sumArray(array){\n\tvar total = 0;\n\tarray.forEach(function(element){\n\t\ttotal += element;\n\t\n\t});\n\treturn total;\n}",
"function sumArray(array) {\n return array.reduce(function (prev, cur) {\n return prev + cur;\n }, 0);\n ... | [
"0.84384453",
"0.82795733",
"0.81848747",
"0.8175737",
"0.8158236",
"0.8156284",
"0.8149095",
"0.8146506",
"0.81426555",
"0.81393033",
"0.8121696",
"0.8116467",
"0.81116194",
"0.81077546",
"0.8106488",
"0.8089912",
"0.80859715",
"0.8082965",
"0.80771184",
"0.80372703",
"0.802... | 0.8307777 | 1 |
This function searches for all elements with the class name "vmCartModule" and updates them with the contents of the page "shop.basket_short" after a cart modification event | function updateMiniCarts() {
var callbackCart = {
success : function(o) {
carts = document.getElementsByClassName( 'vmCartModule' );
if( carts ) {
for (var i=0; i<carts.length; i++){
carts[i].innerHTML = o.responseText;
new Effect.Highlight( carts[i] );
}
}
},
failur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateShoppingCart(){\n\t\"use strict\";\n\n\t\t$j('body').bind('added_to_cart', add_to_cart);\n\t\tfunction add_to_cart(event, parts, hash) {\n\t\t\tvar miniCart = $j('.shopping_cart_header');\n\t\t\tif ( parts['div.widget_shopping_cart_content'] ) {\n\t\t\t\tvar $cartContent = jQuery(parts['div.widget_s... | [
"0.67036283",
"0.66117615",
"0.637926",
"0.63623977",
"0.62695074",
"0.623118",
"0.6191522",
"0.61724985",
"0.6134941",
"0.6080991",
"0.6031651",
"0.60217434",
"0.60215133",
"0.60180527",
"0.5995665",
"0.59633714",
"0.5958319",
"0.595564",
"0.59544957",
"0.59362006",
"0.59360... | 0.66700846 | 1 |
toggles the possession indicator class | function changePossession() {
leftDiv.classList.toggle("possessionIndicator");
rightDiv.classList.toggle("possessionIndicator");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showHideRanking () {\n if (!!document.querySelector('.opened')) {\n document.getElementById('ranking-container').classList.remove('opened');\n document.getElementById('ranking-container').classList.add('closed');\n document.querySelector('.arrow-up').classList.remove('arrow-open');... | [
"0.63407874",
"0.62081236",
"0.59952676",
"0.5958171",
"0.58692276",
"0.5857468",
"0.5845423",
"0.58351785",
"0.5772964",
"0.5761842",
"0.57190996",
"0.5715361",
"0.56927",
"0.56871164",
"0.56395596",
"0.56392854",
"0.5637211",
"0.56359226",
"0.5619984",
"0.5613556",
"0.56118... | 0.7589035 | 0 |
Write an algorithm which searches through a 2D array, and whenever it finds a 0 should set the entire row and column to 0. Input: [[1,0,1,1,0], [0,1,1,1,0], [1,1,1,1,1], [1,0,1,1,1], [1,1,1,1,1]]; Output: [[0,0,0,0,0], [0,0,0,0,0], [0,0,1,1,0], [0,0,0,0,0], [0,0,1,1,0]]; | function twoD(arr) {
const zeroArr = [...arr]
const col = []
const row = []
for (let i = 0; i < arr.length; i++) {
if (arr[i].includes(0)) {
for (let j = 0; j < arr[i].length; j++) {
if (zeroArr[i][j] === 0 && arr[i].includes(0)) {
col[j] = true
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function zeroRowsAndCols(arr) {\r\n\tif(arr.length == 0) return arr;\r\n\r\n\t//array to hold coordinates of the zeros found \r\n\tvar coordinates = [];\r\n\r\n\t//loop through the rows \r\n\tfor(var y = 0; y < arr.length; y++) {\r\n\t\t//loop through the columns \r\n\t\tfor(var x = 0; x < arr[y].length; x++) {\r\... | [
"0.79185754",
"0.776488",
"0.7545264",
"0.74999195",
"0.7497253",
"0.74829",
"0.74065346",
"0.7399838",
"0.73928577",
"0.7243474",
"0.7208734",
"0.71588004",
"0.7022825",
"0.7017211",
"0.7010906",
"0.6828268",
"0.6702739",
"0.6697767",
"0.6675574",
"0.6662391",
"0.6640263",
... | 0.7912751 | 1 |
Common command init wrapper with error reporting. | function init(cmd) {
return function() {
var args = Array.prototype.slice.call(arguments, 0);
cmd.apply(program, args)
.catch(function(err) {
console.error(err);
process.exit(1);
});
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"init() {\n this._checkOptions();\n this._sendErrors();\n }",
"function init()\n\t{\n\t\tif (options.info)\n\t\t{\n\t\t\tlog = new Log('info');\n\t\t}\n\t\tif (options.debug)\n\t\t{\n\t\t\tlog = new Log('debug');\n\t\t}\n\t\toptions.log = log;\n\t\tfor (var operation in syntaxes.commandMap)\n\t\t{\n\t\t\ts... | [
"0.6486814",
"0.6226673",
"0.61067957",
"0.61067957",
"0.6065396",
"0.6031841",
"0.59624225",
"0.59624225",
"0.59624225",
"0.59624225",
"0.59624225",
"0.59624225",
"0.59624225",
"0.59624225",
"0.59624225",
"0.59624225",
"0.59198534",
"0.5871797",
"0.5816837",
"0.5794707",
"0.... | 0.69210666 | 0 |
Repeat an array. The argument 'shuff' is True if the elements of the array should be shuffled in each repetition. Very useful for interleaving blocks of trials in counterbalancing. Example: repeatArray([1, 2, 3], 2, true) => [2, 1, 3, 3, 2, 1] | function repeatArray(arr, count, shuff) {
shuff = shuff || false;
new_array = new Array();
for(i=0; i<count; i++) {
p = shuff ? _.shuffle(arr) : (arr);
new_array = new_array.concat(p);
}
return new_array
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = arr... | [
"0.6710646",
"0.67063725",
"0.6700379",
"0.66977406",
"0.6696252",
"0.6693695",
"0.66927963",
"0.6686247",
"0.6684939",
"0.6684939",
"0.6684939",
"0.6684939",
"0.6684939",
"0.6671153",
"0.6668661",
"0.66655886",
"0.66642076",
"0.66624117",
"0.6660669",
"0.6659945",
"0.6658767... | 0.76142645 | 0 |
Conditionally pushes file to list returns true if pushed, false otherwise (e.g. prevents hidden files to be included unless explicitly told so) | function pushFile(file, query) {
// console.log(file,query)
// hidden file?
if (path.basename(file)[0] === '.') {
// not explicitly asking for hidden files?
if (!options.all && !(path.basename(query)[0] === '.' && path.basename(query).length > 1))
return false;
}
if (platform() ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pushFile(file, query) {\n // hidden file?\n if (path.basename(file)[0] === '.') {\n // not explicitly asking for hidden files?\n if (!options.all && !(path.basename(query)[0] === '.' && path.basename(query).length > 1))\n return false;\n }\n \n i... | [
"0.6725154",
"0.6051597",
"0.59479606",
"0.57999605",
"0.5557223",
"0.55292946",
"0.54454684",
"0.53361726",
"0.5302144",
"0.51968294",
"0.5192904",
"0.51854026",
"0.5172493",
"0.5159069",
"0.51478344",
"0.5131427",
"0.5119291",
"0.511389",
"0.51109594",
"0.510256",
"0.509867... | 0.6745698 | 0 |
Constructs a new CreateBinRequest. Request needed for creating a new bin | constructor() {
CreateBinRequest.initialize(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CreateBucketCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }",
"async createRequest(ctx, supplyRequestNumber, state, paid, ite... | [
"0.5642105",
"0.5639927",
"0.53857887",
"0.5119158",
"0.5076296",
"0.49476135",
"0.49351484",
"0.4931083",
"0.49013814",
"0.48532367",
"0.48532367",
"0.48507434",
"0.48486698",
"0.4837291",
"0.48300388",
"0.48300388",
"0.48002663",
"0.47790077",
"0.47439548",
"0.47359577",
"0... | 0.71598876 | 0 |
Password Request Link Sending | function vpb_request_password_link()
{
var ue_data = $("#ue_data").val();
if(ue_data == "")
{
$("#ue_data").focus();
$("#this_page_errors").html('<div class="vwarning">'+$("#empty_username_field").val()+'</div>');
$('html, body').animate({
scrollTop: $('#ue_data').offset().top-parseInt(200)+'px'
}, 1600... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generate_password() {\n base.emit(\"generate-password\", {\n url: document.location.toString(),\n username: find_username(),\n });\n }",
"function sendsignuplink(name, email, password, ctx) {\n var pw_aes = new sjcl.cipher.aes(prepare_key_pw(password));\n var... | [
"0.69612795",
"0.6187634",
"0.5917167",
"0.584847",
"0.58439255",
"0.58269995",
"0.5811878",
"0.57724285",
"0.57614",
"0.5750133",
"0.5719176",
"0.5641513",
"0.5633307",
"0.5608548",
"0.56066954",
"0.5591217",
"0.55796796",
"0.55636513",
"0.55555433",
"0.55283433",
"0.5512275... | 0.6309521 | 1 |
get journal entries and img | function getJournalStuff(request, response){
var imgId = parseInt(request.query.imgId);
var id = parseInt(request.query.id);
getJournalandImage(imgId, id, function(error, result){
if(error){
response.status(500).json({success: false, data: error});
}
var je = { ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getEntries() {\n console.log(\"Getting Entries\");\n dbShellStudents.transaction(function(tx) {\n tx.executeSql(\"select id,name,image from students order by name\",[],renderEntries,dberrorhandler);\n }, dberrorhandler);\n}",
"static loadJournal() {\n fetch(`${baseURL}/entri... | [
"0.6795039",
"0.6263869",
"0.6259499",
"0.61480516",
"0.59501135",
"0.5835227",
"0.5817778",
"0.57195795",
"0.57001436",
"0.56883055",
"0.56704706",
"0.5597916",
"0.5573763",
"0.5503539",
"0.54829913",
"0.54603",
"0.5455251",
"0.54551864",
"0.5447759",
"0.54463595",
"0.542246... | 0.648005 | 1 |
Given an array of ones and zeroes, convert the equivalent binary value to an integer. Eg: [0, 0, 0, 1] is treated as 0001 which is the binary representation of 1. Solution 1 | function binaryArrayToNumber(arr) {
return arr.reduce( (a, b) => a << 1 | b );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function binaryToInt(arr)\n{\n return arr[0] * 1 + arr[1] * 2 + arr[2] * 4\n}",
"function binaryToInteger(binary) {\n var bits = [128,64,32,16,8,4,2,1];\n var result = 0;\n\n binary = binary.split(\"\");\n\n for (x = 0; x < binary.length; x++) {\n if (binary[x] == 1) {\n... | [
"0.77285737",
"0.71276456",
"0.70025176",
"0.6991608",
"0.6976708",
"0.6727256",
"0.66772145",
"0.65974927",
"0.65657187",
"0.6551371",
"0.6518932",
"0.644911",
"0.64329964",
"0.6403435",
"0.6362438",
"0.6346446",
"0.63458097",
"0.63349164",
"0.6334038",
"0.6307304",
"0.62933... | 0.7761853 | 0 |
Function that grabs form input from beerInventoryForm and uses its information to create Beercard instances | function createBeercard() {
var beername = document.getElementById('beerName').value;
var beertype = document.getElementById('beerTypeInput').value;
var abv = document.getElementById('abv').value;
var hopType = document.getElementById('hopType').value;
var shortDescription = document.getElementById('shortDesc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function beerFormHandler(event){\n event.preventDefault();\n createBeercard();\n currentInventory.saveToLocalStorage();\n renderTable();\n}",
"function grabItems(){\n\tvar MainEventsCount = document.getElementById('numEvents').value;\n\tvar SubEventsCount = document.getElementById('numSub').value;\n\tvar New... | [
"0.67084557",
"0.57612437",
"0.57494575",
"0.5739553",
"0.5659527",
"0.56530905",
"0.5616397",
"0.55904",
"0.55742466",
"0.55654615",
"0.55453557",
"0.55112076",
"0.550682",
"0.5503611",
"0.55029356",
"0.5493678",
"0.5440749",
"0.53960514",
"0.5391581",
"0.5373697",
"0.536949... | 0.72318274 | 0 |
Announcement Handler and Listener that saves current banner text to local storage | function announcementHandler(event) {
event.preventDefault();
localStorage.setItem('announcement', JSON.stringify(document.getElementById('announcement').value));
console.log(localStorage.announcement);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateHomePageAnnouncement(ev){\n ev.preventDefault();\n toggleLoadingGif(true);\n var params ={};\n params.method = \"POST\";\n params.url = \"/section/back/home/updateAnnouncement\";\n params.data = \"announcement_text=\"+document.getElementById(\"announcement-t... | [
"0.58695555",
"0.58184373",
"0.5784017",
"0.5782758",
"0.5521414",
"0.5418067",
"0.5358815",
"0.5302146",
"0.528037",
"0.5279779",
"0.5279417",
"0.5245109",
"0.5216014",
"0.5215091",
"0.51342523",
"0.5128738",
"0.51286644",
"0.5123119",
"0.51221716",
"0.51048607",
"0.50896144... | 0.6171641 | 0 |
Password Handler and Listener that saves current password to local storage | function passwordHandler(event) {
event.preventDefault();
localStorage.setItem('password', JSON.stringify(document.getElementById('password').value));
console.log(localStorage.password);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function storePassword(pw, callback) {\n // Salt the password with a random string of characters.\n // This will be stored along with the password, reducing the effectiveness\n // brute force attacks\n let salt = randomChars(saltiness);\n\n // Pepper is also appended to the password, but i... | [
"0.7189524",
"0.6988077",
"0.6946029",
"0.68856853",
"0.66842216",
"0.6626268",
"0.6571419",
"0.65698683",
"0.655263",
"0.65193254",
"0.65091544",
"0.6494614",
"0.64942116",
"0.6479871",
"0.64792",
"0.64730066",
"0.646386",
"0.64631295",
"0.64368993",
"0.6425131",
"0.6409651"... | 0.78387 | 0 |
Beer Form Handler and Listener that grabs info from the beercard form, creates a Beercard object, adds it to the Inventory object, saves it to local storage, and redraws the chart | function beerFormHandler(event){
event.preventDefault();
createBeercard();
currentInventory.saveToLocalStorage();
renderTable();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createBeercard() {\n var beername = document.getElementById('beerName').value;\n var beertype = document.getElementById('beerTypeInput').value;\n var abv = document.getElementById('abv').value;\n var hopType = document.getElementById('hopType').value;\n var shortDescription = document.getElementById(... | [
"0.7291681",
"0.6113008",
"0.57691824",
"0.5753719",
"0.5621543",
"0.5554116",
"0.553133",
"0.5530581",
"0.551923",
"0.5514995",
"0.5514877",
"0.548318",
"0.5436078",
"0.54336834",
"0.54094785",
"0.53969836",
"0.5361355",
"0.5357503",
"0.5344315",
"0.53091884",
"0.5307436",
... | 0.7238345 | 1 |
Handler and Listener for Toggling Beercard Sales | function saleToggle(event) {
// console.log(event);
if (event.target.name === 'sale') {
currentInventory.beers[event.target.id].toggleSale();
currentInventory.saveToLocalStorage();
// console.log(currentInventory);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"on_desklet_clicked(event) {\n this.retrieveEvents();\n }",
"function handleSeatClicked() {\r\n const seatDiv = this;\r\n const seat = seatDiv.seat;\r\n\r\n if (!seat.isBooked) {\r\n SeatUI.toggleHeld(seat);\r\n\r\n displayTotals();\r\n }\r\n }",
"p... | [
"0.6145147",
"0.61355317",
"0.6115102",
"0.60952073",
"0.6087643",
"0.60831505",
"0.60302204",
"0.60200286",
"0.6008819",
"0.6006349",
"0.5986497",
"0.59576255",
"0.59378916",
"0.5916777",
"0.58721423",
"0.5865145",
"0.5836384",
"0.579455",
"0.5777346",
"0.5776209",
"0.577091... | 0.67904466 | 0 |
Clear the highscore list and remove from local storage | function clearHighscores(){
highscoreList.innerHTML = "";
localStorage.removeItem("highscores");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearLocalStorage() {\n highScoreList = [];\n var highScoreListStr = JSON.stringify(highScoreList);\n localStorage.removeItem(\"movieFighterHighScoreList\");\n}",
"function clearHighScore() {\n var listAmt = highScoreListEl.childElementCount;\n var index = document.querySelectorAll(\"li\");\n\n... | [
"0.86626697",
"0.85618275",
"0.84123963",
"0.838725",
"0.83759576",
"0.83457035",
"0.83097434",
"0.828868",
"0.82090944",
"0.8202304",
"0.81739014",
"0.81689864",
"0.81611365",
"0.8160189",
"0.81579715",
"0.8149594",
"0.8142807",
"0.8119328",
"0.8041429",
"0.803282",
"0.80257... | 0.89766735 | 0 |
Close search overlay when clicking outside of it | function lkyph_force_close_search_overlay() {
jQuery("#search-overlay").bind("click", function(e) {
if (jQuery(e.target).parents("#search-overlay .search-form").length <= 0) {
jQuery("#search-overlay").removeClass("in");
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function closeSearch() {\n document.getElementById(\"myOverlay\").style.display = \"none\";\n \n }",
"function closeSearch() {\n document.getElementById(\"myOverlay\").style.display = \"none\";\n}",
"function closeSearch() {\n document.getElementById(\"myOverlay\").style.display = \"none\";\n}",
"cl... | [
"0.792006",
"0.780308",
"0.780308",
"0.76376194",
"0.7356014",
"0.7313525",
"0.72840995",
"0.7283736",
"0.727552",
"0.7190886",
"0.7170211",
"0.7170211",
"0.7157167",
"0.71364343",
"0.71121436",
"0.70965093",
"0.7051281",
"0.70388275",
"0.69828016",
"0.69708264",
"0.6970462",... | 0.8670112 | 0 |
Sorts the highscore and shows it in li tags | function highScore() {
storedScore.sort();
storedScore.reverse();
for (var i = 0; i < storedScore.length; i++) {
var highScore = storedScore[i];
var li = document.createElement("li");
li.textContent = highScore;
scoreList.appendChild(li);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderHighScore() {\n let highScores = JSON.parse(localStorage.getItem(\"high-scores\"));\n\n //this will sort the scores in numerical order\n highScores.sort(function(a, b) {\n return b.currentScore - a.currentScore;\n });\n\n for (let i = 0; i < highScores.length; i++) {\n let c... | [
"0.7703978",
"0.7623032",
"0.74838436",
"0.7396112",
"0.7287228",
"0.725145",
"0.7154519",
"0.7119541",
"0.7112684",
"0.70930684",
"0.698958",
"0.698033",
"0.69360465",
"0.69307923",
"0.68872434",
"0.6849326",
"0.6837412",
"0.68339795",
"0.68195677",
"0.6814455",
"0.6808405",... | 0.8156971 | 0 |
= require d3/treeMapDesigner.js Creates a treemap and a list of data having weight = 0 If there is a div with id="treemapSpan" and another one with id="zeroWeightSpan" the diagram will use these divs and fit right into them. | function createTreemap(altWidth, altHeight, data, design, id) {
var rawWidth, rawHeight;
// filter data with 0 weight
// TODO remove filteredData from data (only necessary for less calculation)
var filteredData = [];
for (var i = 0; i < data.children.length; i++) {
var testNode = data.child... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function TreeMap(htmlID) {\n \"use strict\";\n var self = this, margin = {top: 40, right: 0, bottom: 10, left: 0},\n width, height,\n color = d3.scale.category20c(),\n treemap,\n fScale,\n div;\n\n fScale = d3.scale.linear()\n .domain([10, 30000])\n .range(... | [
"0.7242493",
"0.70613617",
"0.70539737",
"0.7025227",
"0.69640905",
"0.66913444",
"0.66566694",
"0.6632271",
"0.65739286",
"0.6439622",
"0.6339739",
"0.63352597",
"0.6270326",
"0.62191176",
"0.6202769",
"0.6183479",
"0.6148252",
"0.61297685",
"0.61133474",
"0.61085516",
"0.60... | 0.78153306 | 0 |
Init search if it wasn't already. Initialization is only executed once a user starts searching. | init() {
if (!this.isInit) {
return this.loadSearch();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"initSearch() {\n this.search.init();\n\n if (this.visible) {\n this.closeSearch();\n } else {\n this.openSearch();\n }\n }",
"function initSearch() {\r\n\tconsole.log(\"searchReady\");\r\n}",
"function init_search() {\n\tif(Info.browser.isIEpre6) return;\n\t... | [
"0.852638",
"0.7585972",
"0.73536956",
"0.7257967",
"0.7131785",
"0.7101173",
"0.70451117",
"0.70080364",
"0.6991197",
"0.6984699",
"0.69390714",
"0.6925646",
"0.69013375",
"0.6890376",
"0.6877409",
"0.6864544",
"0.682902",
"0.6751776",
"0.6742171",
"0.66980016",
"0.66788244"... | 0.84194475 | 1 |
Loads the JSON site index and creates the Fuse.io engine object for search | async loadSearch() {
let fs = this;
return fetchJSONFile(fs.index, function(data) {
//data = data.filter(function(page) {
// return page.lang == document.documentElement.lang;
//})
fs.fuse = new Fuse(data, fs.fuseConfig);
fs.isInit = true;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initLunr() {\n if (!endsWith(baseurl,\"/\")){\n baseurl = baseurl+'/'\n };\n\n // First retrieve the index file\n $.getJSON(baseurl +\"workflow.json\")\n .done(function(index) {\n pagesIndex = index;\n // Set up lunrjs by declaring the fields we use\n ... | [
"0.5969461",
"0.5948373",
"0.5942745",
"0.5686151",
"0.5640357",
"0.5625639",
"0.56143075",
"0.56143075",
"0.5597252",
"0.5576088",
"0.5541216",
"0.55369246",
"0.55334604",
"0.5533023",
"0.5527667",
"0.5522264",
"0.5514544",
"0.5512344",
"0.54588324",
"0.5447411",
"0.5436897"... | 0.76123655 | 0 |
Quick live check on the compatibility of the search component with this keyboard handler It must have the 5 controlled functions: initSearch, openSearch, closeSearch, navigateUp, navigateDown | validateComponent() {
let requiredFunctions = ['initSearch', 'openSearch', 'closeSearch', 'navigateUp', 'navigateDown'];
for (var f in requiredFunctions) {
if (typeof(this.searchComponent[requiredFunctions[f]]) != "function") {
return false; }
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"search(){\n // Condition checks if nothing has been input when first entering website and clicking the button or when something is typed and then deleted\n // returns out of method if this is the case as there will be no results\n if(this.state === null || this.state.term === ''){\n return;\n }\n\... | [
"0.6715124",
"0.6653462",
"0.662693",
"0.6518495",
"0.64232194",
"0.6405861",
"0.6393959",
"0.6371647",
"0.6308363",
"0.6296724",
"0.6293114",
"0.62735015",
"0.6261043",
"0.6236059",
"0.620848",
"0.6204718",
"0.6201838",
"0.619269",
"0.61867064",
"0.61829704",
"0.61797637",
... | 0.6756157 | 0 |
Open the search component, check if fusesearch is already initiated, do so if necessary | initSearch() {
this.search.init();
if (this.visible) {
this.closeSearch();
} else {
this.openSearch();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"openSearch() {\n this.element_main.style.visibility = \"visible\"; // show search box\n this.element_input.focus(); // put focus in input box so you can just start typing\n this.visible = true; // search visible\n }",
"startSearch() {\n ... | [
"0.6815135",
"0.66539484",
"0.65874344",
"0.65874344",
"0.65457237",
"0.6424384",
"0.639838",
"0.63893384",
"0.63445395",
"0.6287897",
"0.6285508",
"0.628222",
"0.6270529",
"0.6227657",
"0.62151414",
"0.62070286",
"0.6201566",
"0.61643827",
"0.61580133",
"0.6141851",
"0.61374... | 0.7113447 | 0 |
Move the focus down between results and the searchbar | navigateDown(event) {
if (this.visible && this.resultsAvailable) {
event.preventDefault(); // stop window from scrolling
if ( document.activeElement == this.element_input) { this.top_result.firstElementChild.focus(); } // if the currently focused element is the main input --> focus the f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _focusSearch() {\n setTimeout(function() {\n _$search.focus();\n }, CFG.TIME.DELAY);\n }",
"navigateUp(event) {\n if (this.visible && this.resultsAvailable) {\n event.preventDefault(); // stop window from scrolling\n if ( document.activeElement ==... | [
"0.76003265",
"0.7212361",
"0.7126582",
"0.71073157",
"0.70856935",
"0.70404977",
"0.70146346",
"0.69570446",
"0.6918477",
"0.68925667",
"0.6869234",
"0.6842849",
"0.6749831",
"0.67424625",
"0.67304176",
"0.67186606",
"0.6576615",
"0.64974165",
"0.6457505",
"0.64563453",
"0.6... | 0.76444477 | 0 |
Move the focus up between results and the searchbar | navigateUp(event) {
if (this.visible && this.resultsAvailable) {
event.preventDefault(); // stop window from scrolling
if ( document.activeElement == this.element_input) { this.element_input.focus(); } // If we're in the input box, do nothing
else if ( document.activeElement.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _focusSearch() {\n setTimeout(function() {\n _$search.focus();\n }, CFG.TIME.DELAY);\n }",
"navigateDown(event) {\n if (this.visible && this.resultsAvailable) {\n event.preventDefault(); // stop window from scrolling\n if ( document.activeElement ... | [
"0.7314933",
"0.7159656",
"0.6975068",
"0.68999374",
"0.6798788",
"0.6778126",
"0.67639023",
"0.6687383",
"0.6637259",
"0.6605472",
"0.6603954",
"0.65734935",
"0.65734935",
"0.65734935",
"0.6540389",
"0.65312034",
"0.6480829",
"0.6473608",
"0.645744",
"0.6450812",
"0.64290994... | 0.7580102 | 0 |
Check if browser is already in full screen | function checkFullScreen() {
if ((window.fullScreen) || (window.innerWidth == screen.width && window.innerHeight == screen.height)) {
console.log("Yes");
}
else {
console.log("No");
toggleFullScreen();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fullScreenCheck() {\n if (document.fullscreenElement) return;\n return document.documentElement.requestFullscreen();\n}",
"function isFullScreen() {\n return window.fullScreen || (window.innerWidth == screen.width && window.innerHeight == screen.height);\n}",
"function isFullScreen() {\n return ... | [
"0.8016148",
"0.7704504",
"0.76758903",
"0.7569065",
"0.75649625",
"0.7553847",
"0.7503396",
"0.74950075",
"0.74854714",
"0.74749744",
"0.7434379",
"0.7408569",
"0.73504394",
"0.7232741",
"0.72245306",
"0.72192407",
"0.72054565",
"0.71647924",
"0.71578306",
"0.71545666",
"0.7... | 0.7843703 | 1 |
===== End of logueo ====== /================================= = VerifToken = ================================= | function VerifToken(req, res, next){
let token = req.get('token');
jwt.verify(token, process.env.SEED_TOKEN, (err, decoded) => {
if (err) {
res.status(500).send({
succes:false,
error: err
});
} else {
req.usuario = decoded.usuar... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tokenHandler( result )\n{\n $( \"#app-status-ul\" ).append( '<li>token: ' + result + '</li>' );\n}",
"function _token(){\n\tvar len = util_args2int() || 32;\n\tvar suid = require('rand-token').suid;\n\tvar token = suid(len);\n\tconsole.log( esrever.reverse(token) );\n}",
"function showToken(respons... | [
"0.57728505",
"0.57672375",
"0.57497686",
"0.5748823",
"0.56736195",
"0.5600588",
"0.55926174",
"0.55657256",
"0.55538857",
"0.55421114",
"0.5527276",
"0.5502193",
"0.5492844",
"0.5464654",
"0.54621464",
"0.54611063",
"0.5452202",
"0.54483",
"0.5440748",
"0.5440483",
"0.54334... | 0.6139094 | 0 |
convert mm/dd/yyyy strings to Date objects | function mmddyyyyToDate(dateString) {
var split = dateString.split("/");
return new Date(split[2], split[0] - 1, split[1]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function convertStr2Date(dateStr)\r\n{\r\n\t//wrap firt four char to year\r\n\tvar year = parseInt(dateStr.substring(0,4));\r\n\r\n\t//get month str\r\n\tvar sMonth = dateStr.substring(4,6);\r\n\r\n\t//splice the '0' when sMonth like '01','02',,...\r\n\tif('0'==sMonth.charAt(0))\r\n\t\tsMonth = sMonth.substring(1,... | [
"0.71350735",
"0.7062008",
"0.70036495",
"0.6872586",
"0.6844754",
"0.68180287",
"0.67998827",
"0.6773076",
"0.65806746",
"0.6575949",
"0.6560446",
"0.6549368",
"0.6547575",
"0.6538812",
"0.6536198",
"0.6536198",
"0.6536198",
"0.6536198",
"0.6521352",
"0.6516348",
"0.65109104... | 0.7243855 | 0 |
Displays a tag with the search term that can be clicked to clear search | function displaySearchTag(searchTerm) {
$("#countCopy").html(" for: <strong>" + searchTerm + "</strong> <span id='clearSearch'>Clear Search</span>");
$("#clearSearch").click(function () {
//reset global array, search field contents, and result count on page
SearchArray = [];
$("#search")... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clear () {\n self.searchTerm = '';\n search();\n }",
"function clearSearchText () {\n // Set the loading to true so we don't see flashes of content.\n // The flashing will only occur when an async request is running.\n // So the loading process will stop when the re... | [
"0.7134636",
"0.6828675",
"0.6828675",
"0.682581",
"0.68016094",
"0.6751084",
"0.6735517",
"0.6728522",
"0.66995066",
"0.66995066",
"0.66868895",
"0.6665313",
"0.66345114",
"0.66290665",
"0.6609459",
"0.66066897",
"0.6592361",
"0.6583079",
"0.65684146",
"0.65619206",
"0.65395... | 0.769905 | 0 |
true if f is contained by one of the layers listed in this_.layers | function layersContain(f) {
// if a single layer is used, it is simple
if (!Array.isArray(this_.layers))
return this_.layers.getSource().hasFeature(f);
// otherways iterate over layer sources and return true if found something
for (var i=0;i<this_.layers.length;i++)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function F(e){return e.layers.some((e=>null!=e.layerDefinition.visibilityField))}",
"function MatchingFeatureTypes() {\n\tfor (var i=0; i < checkedLayers.length-1; i++) {\n\t\tfor (var j=i+1; j < checkedLayers.length; j++) {\n\t\t\tif (checkedLayers[i].protocol.featureType != checkedLayers[j].protocol.featureTyp... | [
"0.6350343",
"0.5971203",
"0.5919843",
"0.55278057",
"0.55161625",
"0.55132467",
"0.5477452",
"0.5400826",
"0.5356923",
"0.52706295",
"0.52531236",
"0.52361584",
"0.5229913",
"0.52187705",
"0.52044857",
"0.51867014",
"0.5181223",
"0.5174418",
"0.51342785",
"0.5120446",
"0.512... | 0.85632825 | 0 |
Constructor Sets type of template to 'BodyTemplate1' | constructor() {
super();
this.type = 'BodyTemplate7';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor() {\n super(template);\n }",
"constructor(templateInfo){\n\t\tthis.templateInfo = templateInfo;\n\t}",
"constructor (template, name) {\n\t\tif (template instanceof DataType) {\n\t\t\tthis.type = template;\n\t\t\tthis.name = null;\n\t\t\tthis.modelName = null;\n\t\t\tthis.model = null;\n\t... | [
"0.6243404",
"0.61946875",
"0.59188026",
"0.5787224",
"0.5734301",
"0.5619204",
"0.5606267",
"0.55844307",
"0.5459901",
"0.5402338",
"0.535991",
"0.53564686",
"0.52782893",
"0.52664226",
"0.5236249",
"0.52264607",
"0.52166456",
"0.52106637",
"0.5204904",
"0.5188302",
"0.51694... | 0.7914559 | 0 |
la funcion handleRegister llega desde navBar container como props y hace que se cierre el modal si esta abierto y que se abra si esta cerrado!!!! | render() {
return (
<div>
<RegisterModal handleSubmit={this.handleSubmit} handleRegister={this.props.handleRegister} handleChanges={this.handleChanges} />
</div>
)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleRegister() {\n navigation.navigate('SignUp');\n }",
"function handleRegister(e) {\n\n e.preventDefault();\n\n if (!setPassword || !setConfirmpass || !setEmail || !setCellPhone || !setAddress || !setCountry || !setName || !setLastName) {\n setTimeout((e) => {\n ... | [
"0.6718139",
"0.6576076",
"0.6424759",
"0.63756156",
"0.62653357",
"0.6224625",
"0.6192854",
"0.6126806",
"0.60798216",
"0.60772437",
"0.6074369",
"0.6027761",
"0.6012791",
"0.59998065",
"0.59851015",
"0.5923791",
"0.592197",
"0.59067184",
"0.586691",
"0.58664876",
"0.5865402... | 0.6579263 | 1 |
function to set value and formula of clicked cell | function setCell(v, currFormula) {
let address = addressInput.value;
let cell = getClickedCell();
cell.innerText = v;
let { rid, cid } = getValueOfRC(address);
sheetDB[rid][cid].value = v;
sheetDB[rid][cid].formula = currFormula;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clickCell(ref) {\n //var rcArray = ref.id.split('_'); \n // alert(\"You selected row \" + rcArray[0] + \" and column \" + rcArray[1]);\n\n //Set Colour of previous id back to the rest of the grid\n document.getElementById(prevSelect).style.background = \"#C3DAF9\";\n\n //Set Colour of se... | [
"0.70288885",
"0.67332155",
"0.6292799",
"0.62528706",
"0.62113047",
"0.6206088",
"0.6190872",
"0.6190872",
"0.61873597",
"0.618615",
"0.615176",
"0.59196335",
"0.589872",
"0.58873296",
"0.58755124",
"0.58435076",
"0.5790213",
"0.57709265",
"0.5769433",
"0.5758778",
"0.571956... | 0.74177825 | 0 |
to set parents of curr cell (which we got from formula) | function setParents(currFormula) {
let arr = currFormula.split(" ");
for (let i = 0; i < arr.length; i++) {
let c = arr[i].charCodeAt(0); // if it starts from A-Z
if (c >= 65 && c <= 90) {
let { rid, cid } = getValueOfRC(arr[i]); // address nikala and then putted it in children array
sheetDB[rid... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setParentCHArray(formula, chAddress) {\r\n let formulaTokens = formula.split(\" \");\r\n for (let i = 0; i < formulaTokens.length; i++) {\r\n let ascii = formulaTokens[i].charCodeAt(0);\r\n // ascii valid or not\r\n if (ascii >= 65 && ascii <= 90) {\r\n let { rid, cid... | [
"0.6189308",
"0.58609384",
"0.58184016",
"0.5812562",
"0.58069843",
"0.5588556",
"0.55669147",
"0.5478237",
"0.54714036",
"0.54548585",
"0.5436084",
"0.5433979",
"0.537615",
"0.5358216",
"0.5354825",
"0.53545636",
"0.5304146",
"0.52902573",
"0.52790225",
"0.52786595",
"0.5272... | 0.708428 | 0 |
ZmProfileUserCtrl is use to retrieve user list from services | function ZmProfileUserCtrl(zmUserService) {
var vm = this;
var vm.viewMode = true;
var about = {};
//Method
vm.deleteUser = deleteUser;
vm.addUser = addUser;
zmUserService.readListOfUser(function(data){
vm.contacts = data;
});
/**
* @name deleteUser
* @param index,id
* @descript... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GetUsers() {\n UserApi.getUser().then(function (response) {\n $scope.user = response.data;\n }), function () {\n aler(\"Unable to load users info\");\n }\n }",
"function getProfileData() {\n // obtener los datos del usuario al iniciar sesión\n IN.A... | [
"0.6907308",
"0.6850841",
"0.6767247",
"0.6745933",
"0.6708694",
"0.6661176",
"0.6640582",
"0.66327035",
"0.66024053",
"0.6586556",
"0.6576485",
"0.6571571",
"0.65334123",
"0.6475877",
"0.6473198",
"0.64632905",
"0.64446497",
"0.6444295",
"0.6443883",
"0.64241606",
"0.6419983... | 0.72267175 | 0 |
Setup container for image panorama | function setupPanolens()
{
viewer = new PANOLENS.Viewer({container: mainContainer});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function init() {\n\t\t\tif (!container) return;\n\t\t\trequestImages();\n\t\t\tbuildLayout();\n\t\t}",
"_initContainer() {\n this._element.classList.add('carousel');\n\n this._element.append(this._createContainerHeader());\n\n this._cardsContainer = this._createContainerContent();\n ... | [
"0.6269188",
"0.60151124",
"0.5990365",
"0.5983682",
"0.59760267",
"0.5749327",
"0.57397646",
"0.57266194",
"0.5720707",
"0.57166696",
"0.5680916",
"0.560975",
"0.5598776",
"0.55916435",
"0.5560125",
"0.5541513",
"0.55287504",
"0.5515471",
"0.5508581",
"0.5500087",
"0.5494124... | 0.61522496 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.