This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| LazyLoadImages = () => { | |
| const images = document.querySelectorAll("[data-src]"); | |
| const options = { | |
| rootMargin: "0px 0px 200px 0px" | |
| }; | |
| const imgObserver = new IntersectionObserver((entries, imgObserver) => { | |
| entries.forEach(entry => { | |
| if(!entry.isIntersecting){ | |
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| toHHMM = (secs) => { | |
| var hours = Math.floor(secs / 3600) < 10 ? ("00" + Math.floor(secs / 3600)).slice(-2) : Math.floor(secs / 3600); | |
| var minutes = ("00" + Math.floor((secs % 3600) / 60)).slice(-2); | |
| return hours + ":" + minutes; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set @r1=0, @r2=0, @r3=0, @r4=0; | |
| select min(Doctor), min(Professor), min(Singer), min(Actor) | |
| from( | |
| select case when Occupation='Doctor' then (@r1:=@r1+1) | |
| when Occupation='Professor' then (@r2:=@r2+1) | |
| when Occupation='Singer' then (@r3:=@r3+1) | |
| when Occupation='Actor' then (@r4:=@r4+1) end as RowNumber, | |
| case when Occupation='Doctor' then Name end as Doctor, | |
| case when Occupation='Professor' then Name end as Professor, | |
| case when Occupation='Singer' then Name end as Singer, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT concat(NAME,concat("(",concat(substr(OCCUPATION,1,1),")"))) FROM OCCUPATIONS ORDER BY NAME ASC; | |
| SELECT "There are a total of ", count(OCCUPATION), concat(lower(occupation),"s.") FROM OCCUPATIONS GROUP BY OCCUPATION ORDER BY count(OCCUPATION), OCCUPATION ASC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ###Hackerranks solve SQL ### | |
| select H.hacker_id, H.name from Hackers As H, Submissions AS S, Challenges AS C, Difficulty AS D where S.challenge_id = C.challenge_id AND C.difficulty_level = D.difficulty_level AND S.hacker_id = H.hacker_id AND S.score = D.score group by H.hacker_id, H.name having count(S.hacker_id) > 1 order by count(S.hacker_id) desc, S.hacker_id asc; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream> | |
| #include<stdlib.h> | |
| using namespace std; | |
| class Vector | |
| { | |
| int a,b,c; | |
| public: | |
| Vector(int x,int y,int z) | |
| { | |
| a=x; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream> | |
| #include<stdlib.h> | |
| using namespace std; | |
| class STUDENT | |
| { | |
| int STU_ROLL; | |
| char STU_NAME[20]; | |
| char STU_SEC[20]; | |
| char STU_DEPT[20]; | |
| public: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<stdio.h> | |
| #include<conio.h> | |
| int visited[10]={0}, cost[10][10], min, mincost=0; | |
| int input(int); | |
| int display(int); | |
| int prims(int); | |
| int input(int num) | |
| { | |
| int i, j; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<stdio.h> | |
| int main() | |
| { | |
| int i,j,k,pass,n; | |
| int m[20][20],s[10][10],p[10],result; | |
| printf("Enter the elements:"); | |
| scanf("%d",&n); | |
| printf("Enter the value of P:"); | |
| for(i=0;i<=n;i++) |
NewerOlder