Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 28

@To add SSH key:

ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/DELL/.ssh/id_rsa):
Created directory '/c/Users/DELL/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/DELL/.ssh/id_rsa
Your public key has been saved in /c/Users/DELL/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:nqXM0rBEE7PnUENHQMgIPNLNtbRxT5zQ+ic4OSWbNaM DELL@AmaanShaikh
The key's randomart image is:
+---[RSA 3072]----+
| o.+ +*+O*+. |
|. + +.oX =+ |
| . . B ... |
| . =o = |
| o S@.o |
| . BE+o . |
| o Bo o |
| . |
| |
+----[SHA256]-----+
$ cat /c/Users/DELL/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCyVWpG6LXZQJyaXXWJMDTdMcZUMKrc
j0OfuYoSfGPFvmPD4vJ6FUthiEiyalKr+UAf6remvFqDXsQy/aCh9T3DV7tZF8nr+
nrRJTNotJyYQi3rMHdodt+
+DUlrjpINDpHrWQo0DQAdQhzwTvNBT2q1U5FKDphz+ulpcbBabBdRSZ8HZdjkP5vWWlsJquUzwfyT
NcGbf9z4rhMrVMjgSTt5YfvQFEoosrczLoeVMltOGHzB8372nIoljAYwcI2OdhV5It9MZ+/
l0RJZ3RNeiFWI8LHHOKNjA65wmfdXb3YcsY1yTu
9jqXQAKknIYvoxW9i+NQPanld2up+iWeO0LPvoH1IfB0/1FnSZWSIyEo/
I2+Canst321Z+X8Y2V7Sk4Grd53tMwoWZUIOI97ue3FvZAyXr
T4kLuLk3pEoRJ1N6ddD5DXZMILdUnHg5u57TLF1SKZrrQEGCt3GgZbZ2RVOP5sU8yNoffel6+hyyF9oltWP
7WTw3Y/yzHKMC8= DELL@AaanShaikh

1 March 2022
@Two dimensional array

Jagged array

Demo d=new Demo();


sysout(d.getClass().getName());

packname.classname

int a[]=new int[3];


sysout(a.getClass().getName());
o/p
[I ----->Name of Class

float a[][]=new float[3][4];


sysout(a.getClass().getName());
o/p
[[F

float a[][][]=new float[3][2][4];


sysout(a.getClass().getName());
o/p
[[[F
@To clone array
int ar[]={1,2,3};
int clone[]=ar.clone();
for(int i : clone)
{
sys(i);
}

2 March 2022
@Strings
2 types
mutable (nonchangable)
String s=new String("xyz")

immutable
ways to
by new key String a=new String("a")
by string literal String s2="aA"

char[] n={'s','d'}
String s3=new String(n)

Diff ways to compare Strings


== -->reference of object is created
equals() -->Strings are compared
equalsIgnoreCase() -->Strings are compared ignoring case
compareTo() -->

String contents and objects are stored in heap and reference in stack

heap area and String constant pool

String s1=new String("Amaan")


s1.concat("Shaikh")
s1=s1.concat("fullStack")
heap| SCP
|
|
|
|

String methods
sysout(s.tocharAt(4))
sysout(s.index(4))

To split string into array


String s="my name is amaan";
String[] split=s.spilt(" ")
for(String s1: split)
{sop(s1);}

convert int
int i=100;
String v=String.valueOf(i);
sop(v);

String i="100";
int i=Integer.parseInt(s);
sop(i);

@To convert String in alphabetical order


String s="ghja";
char[] ch=s.toCharArray();
Arrays.sort(ch);
for(char c: ch)
{
System.out.println(c);}

Software testing -->

1.Unit Testing
integration
system
acceptance

1.Unit testing-- It is way of testing the smallest piece of code ie unit that can
be
logically isolated in the project.

public int add(int a, int b)


{
return a+b;}

Benefits of unit testing


1.helps find bugs in developing phase
2.Provides documentation to developer
3.Helps build better design
4.Improves the quality of code

steps to test manually


-preparation
-provide the inputs
-running test
-provide expected o/p
-verify the result
-alert the developer if testcase fails

steps to automate testing using Junit


-preparation
-provide the inputs
-provide expected o/p

Junit 5-Jupiter

@proper indentation
cntl+a then cntl+i

Why we use Mevan?


-Maven is build tool.
-Maven is mainly used for java based projects.
-The tools helps in building the code and downloading
the dependencies.

POM (Project Object Module)

()-> lamda expression

@In JUnit class there is no main method


it is executed using testlife cycle
for every testcase a new instance is created

Lifecycle hooks
@BeforeAll(annotation)
@AfterAll
@BeforeEach
@AfterEach

@Disabled
@EnabledOnOs(OS.LINUX)
@EnabledOnJre(JRE.JAVA_8)

boolean isServerUp=false;
assumeTrue(isServerUp)

assertAll(
()-> assertEquals(4,c.multiply(2,2)),
()-> assertEquals(-4,c.multiply(-2,2)),
()-> assertEquals(0,c.multiply(-2,0)),
);
// If any of testcase fails all assertEquals gets fail

@Object Orientation

point of view
perspective

1.The whole world is a collection of objects.


2.No Object are useless, every object is usefull.
3.No objects exist in complete isolation, they have constant
interaction with each other.
4.Every object belongs to a type. Object exists in reality whereas
type(class) does not exist in reality.
5.Every object has something and it does something.

"Has" part refers to properties/attributes, In java

-private
+public
#protected
~default

@Connstructor
--If there is no user defined contructor in a class then
a default constructor will be added automatically by JYM
--so either it is default constructor or user defined constructor
but not both

bean Class
1.instance variable
2.default constructor
3.setters and getters

@super()
constructor chaining

NewDog(int a)
{
super(); // parent class means Object class contructor will
// executed
sop("1 arg");
}
NewDog(int a,int b)
{
super();
sop("2arg");
}
local Chaining-calling constructor of same class
NewDog(int a)
{
this(); //either this or super
sop("1arg");
}
NewDog(int a, double b)
{
this(10);
sop("2arg");
}
NewDog()
{
this();
sop("0arg");
}

@super and this in another constructor


NewDog(int a)
{
super(); //either this or super
sop("1arg");
}
NewDog(int a, double b)
{
this(10);
sop("2arg");
}
NewDog()
{
super();
sop("0arg");
}

@
c inherit B and B inherit A if we create object of class c then sequence of
constructor
called is A, B, C

System.out.format("%10s %30s %20s %20s %20s", "ISBNNo", "BookName", "Author",


"Genre", "Price\n");
System.out.format("%10s %30s %20s %20s %20s", "9783", "The Midnight Library", "
Matt Haig", "Fiction", "340\n");
System.out.format("%10s %30s %20s %20s %20s", "9781", "The Everything World's
Religions", "Kenneth Shouler", "Religion", "365\n");
System.out.format("%10s %30s %20s %20s %20s", "9803", "Treasure Island", "Robert
Louis", "Adventure", "84\n");
System.out.format("%10s %30s %20s %20s %20s", "9870", "Tiffin", "Rukmini Srinivas",
"Cooking", "384\n");
System.out.format("%10s %30s %20s %20s %20s", "9564", "Blue Highway", "Diane
Tullson", "Travel", "784\n");
System.out.format("%10s %30s %20s %20s %20s", "9524", "Wings of Fire", "A. P. J.
Abdul Kalam", "Autobiography", "499\n");

@By printing reference it will call toString()

@Aggregation and Composition

Object has two relationship


is-A
has-A

Dog is-A Animal


student has-A brain

has-A types
tight bound relationship
if student not exist brain not exist

Has-A relationship can be satisfied by Aggregation and Composition

-Composition satisfies a tight bound has-a relationship


-Aggregation satisfies a loose bound has-a relationship

Tight bound means

@Inheritance
Single
multilevel
hierarchical
hybrid
Multiple(not supported in java)

final keyword with(class ,method, variable)

final String name;// blank final variable


int i=2;
name="ass"; // error blank final var cannot be initialized
it can be initialize throu constructor

static final String name; // blank static final var

static{
name="dsd";
}

constrname(String name,int i)
{
this.name=name;
}

Overloading
main method can also be overloaded
psvm(String[] arg)
{
}
psvm(String arg)
{
}

@Polymorphism
Poly-many
morphs-forms

1.static polymorphism or compile time polymorphism(Method overloading)


2.Dynamic polymorphism or runtime polymorphism(Method Overriding)

Abstraction

Two ways to achieve abstraction


1.abstract class
2.interface

interface
-interface is to achieve abstraction
-All the methods of interface are by default public and abstract.
-All variable of interface are by default public static and final.
-Multiple inheritance of interface is allowed in java.
-In interface only abstract methods are allowed.

since java8, we can also have default and static methods.


since java9, we can also have private methods.

@shortcut for writting scanner and main method


ctrl-2+L

@Exception Handling-- refer to mistake that occurs during the execution


time of an application due to faulty inputs

-Exception results in abrupt(sudden) termination of program

-Exception handling refers to the process of handling the exception object in


such a manner that abrupt termination does not happen.
-Java provides following keywords to handle exception
try
catch
throw
throws
finally

if checked exception is occur then it check for exception handling code


in method, however calls me they have to handle that exception
like example Thread.sleep(1000);

static void sayAgain() throws InterruptedException{


Thread.sleep(1000);
}

Exception in thread classname:description


at fullqualified name of class:java:line number
user defined exception

21/3/2022

@File Handling

main() throws IOExcep //here we are ducking the exception not handling it
{
File f=new File("dem.txt");

f.createNewFile();

File Class Constructor


1. new File(String filename);
2.new File(String subDname,String filename);
3.new File(File subdir,String filename);

methods of file
exists()
createNewFile()
mkdir()// make directory
isDirectory()
isFile()
String[] list()
length()
delete()

to check how many files are present in folder

int count=0;
File f=new File("path of folder");
String[] list=f.list();
for(String names : list)
{
count++;
sysout(names);
}
sysout("no of file"+count);

FileWriter class constructor


1. new FileWriter(String filename);
2.new FileWriter(File f)
3.write(int ch)
4.write(char[] ch)

@writing in file
FileWriter fw=new FileWriter("ad.txt");
fw.write(100);
fw.write("sdfd");
fw.write("\n);
char c[]={'a','b','c'};
fw.write(c);

fw.flush();
fw.close();

the text should not override after executing many time


so use
FileWriter fw=new FileWriter("ad.txt",true);

FileReader
new FileReader (STRING FILNAME);
new FileReader(File f)
FileReader fr=new FileReader ("ad.txt");
int i=fr.read();
while(i !=-1)
{
sop(i);// prints integer value of text in file
sop((char)i) // prints String value present in file
i=fr.read();
}
sop("all character hs been taken");

@better approach for above


--taking everthing at once and storing it somewhere

BufferedWriter constructor
1. new BufferedWriter(Writer w)
2. new BufferedWriter(Writer w,int buffersize)

methods
write(int ch)
write(char[] ch)
write(String s)
flush()
close()
newLine()

FileWriter fw=new FileWriter("ad.txt");


BufferedWriter bw=new BufferedWriter(fw); // bw connected to fw

bw.write("Amaan");
bw.newLine();
bw.write("Shaikh");
bw.flush();
bw.close();
BufferedReader

BufferedReader constructor
1. new BufferedReader(Reader r)
2. new BufferedReader(Reader r,int buffersize)

methods
read(int ch)
read(char[] ch)
read(String s)
flush()
close()
newLine()

main()throws FileNotFoundException
{
FileReader fr=new FileReader("demop.text");
BufferedReader br=new BufferedReader(fr);

String line=br.readLine();
while(line !=null)
{
sop(line);
line=br.readLine();
}
br.close();
}

fw.write("100")//to store integer use string


fw.write("10.2")// to store float
fw.write("true")// to store boolean

we can store integer and other value without using ""


using PrintWriter

PrintWriter
new PrintWriter(STRING FILNAME);
new PrintWriter(File f)
PrintWriter fr=new PrintWriter("ad.txt");

main()throws IOExcep
{
FileWriter fw=new FileWriter("ad.txt");
PrintWriter pw=new PrintWriter(fw);

pw.println(100);// int method of PrintWriter


pw.flush();

create 2 file f1(A B C) f2(1 2 3) merge f3(A B C 1 2 3)

to push folder on gitlab


git init
git add .
git commit -m "done"
git push

import java.io.BufferedReader;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

23 march 2022
@Collections-- is used to store multiple object under a single entity.
methods
add(Object o)
addAll(Collection c)
remove(Object o)
removeAll(Collection c)
retainAll(Collection c)
clear()
size() //return type int
toArray() // return type object array

-----return type of this method is boolean

@List(Interface)
-Insertion order is maintained in all subclass (insertion order means in
whatever order you add elements in the same order it will be stored
in the backend.
-can access elements through index
-duplictes are allowed
-Heterogenous elemenst can be stored(means diff types of)

Methods of List
add(int index,Object o)// on which you want add element you and write that object
here
addAll(int index, Collection c)// from which index u want to add till complete list
of elements from the collection.
remove(int index)
get(int index)
set
indexOf
lastIndexOf

@Actual class which is implementing this


ArrayList()--class
ArrayList implements -List, RandomAccess,Clonable, Serializable

Ways to create ArrayList


-new ArrayList();
--default Initial Capacity is 10, if we extend the capacity it will automatically
increase the capacity

-new ArrayList(int capacity);


-new ArrayList(Collection c);

when default capacity is full then it will extend capacity by


new capacity=currentcapacity * 3/2+1

ArrayList follows Array datastructure


--Iterator
ListIterator<Integer> aa=al.listIterator();

@Generic class-is used for type safety

to use only
public class Gene<T extends Number> // bounding T
T can be anything but should be child class of number class

Gene<Integer> gene =new Gene<Integer>(10); //only we can store integer values

Gene(T ob, T a, T b)
{
this.ob=ob;
this.a=a;
this.b=b;
}

Gene<Integer> gene =new Gene<Integer>(10,20,30);

ctrl+2->r
to change name everywhere in code

package com.route;

import java.io.*;
import java.text.ParseException;
import java.util.Collections;
import java.util.List;

public class RoutePlanner {

public static int countOfRoutes(String filename){


int routeCount=0;
try {
BufferedReader reader=new BufferedReader(new FileReader(filename));
while (reader.readLine()!=null)
routeCount++;
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return routeCount;
}

public static RecordRoute[] readRecords(String fileName,int routeCount)


throws ParseException {
RecordRoute[] routes=new RecordRoute[routeCount];

try (BufferedReader reader=new BufferedReader(new


FileReader(fileName))){
int i=0;

while (i<routeCount||reader.readLine()!=null){

String s1[]=reader.readLine().split(",");

String from=s1[0];
String to=s1[1];
int distance=Integer.parseInt(s1[2]);
String time=s1[3];
String fare=s1[4];

routes[i]=new RecordRoute(from,to,distance,time,fare);
i++;

} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
catch (NullPointerException e){
e.printStackTrace();
}

return routes;
}
public void display() throws IOException
{
String f="src\\main\\resources\\routes.csv";
BufferedReader reader = null;
String line = "";

reader = new BufferedReader(new FileReader(f));


while((line=reader.readLine())!= null) {
String[] row = line.split(",");
for(String index : row) {
System.out.printf("%-15s", index);
}
System.out.println();
}
reader.close();
}
void showDirectFlight(List<String> info, String city) {
int flag=0;
for(String i:info) {
if(i.startsWith(city)) {
System.out.println(i);
flag++;
}
}
if(flag==0) {
System.out.println("We are sorry. At this point of time, we do
not have "
+ "any information on flights "
+ "orginating from "+
city);
}
}
public void sortDirectFlight(List<String> directFlights) {
String words[];
if(directFlights.size()!=0) {
System.out.println("From To Distance in km Travel Time
Typical Airfare");
}
Collections.sort(directFlights);
for(int i=0; i<directFlights.size(); i++) {
words=directFlights.get(i).split(",");
for(int j=0; j<words.length;j++) {
System.out.println(words[j]+" ");
System.out.println();
}

}
}
public static void main(String[] args) throws IOException, ParseException {
RoutePlanner rp=new RoutePlanner();
rp.display();
String filename="src\\main\\resources\\routes.csv";
int count=countOfRoutes(filename);
RecordRoute[] routes=readRecords(filename,count);
rp.showDirectFlight(routes,"Delhi");
//sortFlights(routes,"Delhi");
}

@comparator(interface)
-used for customize sorting order
compare()
equals()

whenever TreeSet is used compareTo() is automatically called


class

key and value is called map

collection of key and value is called entry


collection of entries is called map

entry is sub interface of map

Map

put(Object key,Object value)


putAll(Map p)
containsKey(Object key)
containsValue(Object val)

keySet() // all keys will be taken and return to set


values() // return type collection // its coll of all values
getValue()
getkey()
setValue()
entrySet()
get()// returns the value of key

HashMap(c)
-16 default capacity
-0.75 is default load factor

new HashMap();
new HashMap(int );
new HashMap();
new HashMap();

import java.util.HashMap
HashMap<Integer, String> hm=new HashMap<Integer, String>();
hm.put(101,"alex");
hm.put(102,"John");
hm.put(103,"bob");
sop(hm);

@WAP
check the occurrence of character in word
HashMap<Character, Integer> hm=new HashMap<Character, Integer>();

Java 8 feature
@lambda Expression
--It is an anonymous function(Nameless, no returntype, no modifier)
eg 1
public void fun(){
sop("hello");}
----------------------
()-> sop("hello");
--------------------
eg 2
public void fun(int a,int b){
sop(a+b);}
--------------------------------
(a,b)-> sop(a+b);
-------------------------------
eg 3
public int squ(int i)
{ return i*i;}
-------------------------
i-> i*i; //lambda expression
-----------------------------
eg 4
public String disp(String s)
{ return s.length();}
----------------------------
s->s.length();
-----------------------------

to enable parallel programming


to make code concise

Function<Integer,Integer>f=i-> i*i;
sop("square is="+f.apply(4));
Functional Interface(SAM)
--function which has single abstract method
example
1.Function
2.Predicate
3.Consumer
4.Supplier
5.Runnable
6.Comparable
7.Callable
8.ActionListener

@FunctionalInterface
interface Demo
{
void m1();
}

@FunctionalInterface
interface Demo1 extends Demo{
}

@FunctionalInterface
interface Demo
{
public void m1();
}

public class Lan{


psvm(String[] a){
Demo d=()-> sop("hello");
d.m1();
}

@FunctionalInterface
interface Demo
{
public void m1(int a,int b);
}
public class Lan{
psvm(String[] a){
Demo d=(a,b)-> sop("sum is="+(a,b));
d.m1(10,20);
d.m1(20,20);
}

like
int a=10;
String s="sd";

Demo d= fun(); // we are passing method to reference variable

@MultiThreading

return (o1<o2)?+1:(o1>o2)?-1:0
using Lambda
Collections.sort(a,(o1<o2)->(o1<o2)?+1:(o1>o2)?-1:0);
OR
Comaparator<Integer> c=(o1<o2)?+1:(o1>o2)?-1:0;
Collections.sort(a,c);

Collection.binarySearch(list,1);

@-------HTML-------------

"!" type and enter u will get boilerplate


"html" type enter u will get boilerplate

<meta> tag --- will give info about particular web page
<!DOCTYPE html>
<html lang="em">
<head>
<title>Wipro</tilte>
<meta name="description" contents="web page created for learning process">
<meta name="author" contents="APJ">
<meta name="keywords" contents="Shopping">

</head>
<body>
<h1>Welcome to Wipro</h1>
<h1>Welcome to Wipro</h1>
<h1>Welcome to Wipro</h1>
.
.
<h6>

<p>Lorem ipsum -----</p>

<!--list tag : 2 types>


<!--unorderedlist-->
<ul>// for shortcut type ul>*li(how manylist)
<li>apple</li>
<li>mango</li>
</ul>
<ul type="circle">// for type

<!--Ordered list>
<ol>// for shortcut type ol>*li(how manylist)
<li>First</li>
<li>second</li>
</ol>
` <ol type="i">// for type

<details>
<sumary>Read more</sumary>
<p>---</p>
</details>
<img src="path name" alt="nature" width="300px" height="200px">
<br><br>

<!--Hyperlionk tag-->
<a href="link name" target="blank">Google</a>
<br><br>
<a href="index.html" target="blank">Click here</a>

</body>
</html>

o/p
.apple
.
.

first
second
..

//comment tag
<!--comments-->

@live server form ritwick dey install this

ctrl+shift and L // multi cursor // to change and write multiple lines

Bootstrap.com for html Css

developer release
h2{
background-color: 'red';
color:'blue'
}

production release/minified file


h2{background-color:'red';color:'blue'}

CD-640MB
audio cd-4-5-6 songs
MP3-150 songs

5 april 2022
@--------Java Script---------

MEthods of Jasmine Tool

1) describe(function/block)
--Its is used for grouping related specs
describe has 2 parameter string parameter & callback function
string parameter-- for grouping something

2) it() -it represents test cases inside a test suite.


first parameter is used for title
describe("this is for loigin scenario",function(){
beforeEach(function(){
console.log("before Each")
})
beforeAll()
AfterEach()
AfterAll()

it("invalid login credentials", function(){


console.log("This is my first testcase using jasmine")

});

it("invalid login credentials", function(){


console.log("This is my seconde testcase using jasmine")

});

});

//describe 2
describe("this is for login scenario",function(){
beforeEach(function(){
console.log("before Each")
})

it("invalid login credentials", function(){


console.log("This is my first testcase using jasmine")

});

it("invalid login credentials", function(){


console.log("This is my seconde testcase using jasmine")

});

});

prettier code formator in vs code install this extension

fDescribe() // to focus the decribe


xDescribe() // to disable the decribe

fit()-- to focus content between it()


xit()-- to disable content between it()

var a=true;
expect(a).toBe(true);
expect(a).not.toBe(true)

var b=10;
expect(b).toEqual(10)
var name='Jasmine'
expect(name).not.toBeNull()

var array={10,2,4};
expect(array).toEqual([10,2,4])

it("to test contains",function(){

var name="Amaan";
expect(name).toContain("A");});

//source file
function(a,b)
{
return a+b;
}

//spec file

describe("Testing calcu",function(){
beforeEach(function(){
console.log("before Each")
})

it("invalid login credentials", function(){


console.log("This is my first testcase using jasmine")

});

ctrl+A ->shift+alt+f-- indentation


ctrl and d-- multi cursor

TypeScript
Adds
npm install typescript --save-dev

compile typescript
tsc fname.ts fname.js
OR
tsc fname.ts

function dis(name: String, id: number,emailId?:String) // ? means this parameter is


optional you can use or not
{
console.log(name)
console.log(id)
}
dis("Amaan",7);
--------------------------------------------------

function addNum(...num: number[]) //number array // any number of parameter can


pass bcz its rest parameter
{
var n;
var sum: number=0;
for(n=0;n<num.length;n++)
{
sum=sum+num[n]
}
console.log(sum)
}

addNum(1,2,3,4,5); // any number of parameter can pass bcz its rest parameter
addNum(2,4,1,2,3,4,5);
----------------------------------------------------
// default paramter
function discount(price: number, rate:number =0.50)
{
var dis=price*rate;
console.log(dis);
}
discount(5000);
discount(5000,0.25);

------------------------------------------------
///////////multiple lines comment ctrl+/

--------------------------------------------------
//anonymus function

var disp=function()
{
return "hello"
}
console.log(disp())

--------------------------------------------------
// FunctionConstructor
var myfun=new Function("a","b","return a+b");

var x=myfun(4,4);
console.log(x)

--------------------------------------------------

interface Person{
fname: string;
lname: string;

disp: () =>string
}

var PersonObject: Person=


{
fname:"Amaan"
lname:"shaikh"
disp:():string =>{return "Hello world"}
}
console.log(PersonObject.fname)

--------------------------------------------------
class Employee
{
empid:string
constructor(Empid:string)
{
this.empid=empid
}

display(): void{
console.log("Employee Id is:"+this.empid)
}
}

//create object of class

var empobj= new Employee("007");


console.log(empobj.empid)

empobj.display();

--------------------------------------------------

class Animal
{
name: string

constructor(name: string)
{
this.name=name;
}
}
class Dog extends Animal
{
display(): void{
console.log("Name is"+this.name)
}
}
var obj=new Dog("Tommy");
obj.display();

--------------------------------------------------

interface Emp{
ename: string
}
class Empployee implements Emp{
ename: string

constructor(ename

To clone git

git config --global user.name 750763

git clone ssh://git@gitlab-wipro.stackroute.in:2225/amaanshkh.392/develop-test-


cases-for-contact-form-app.git
Promise example

function funPromise()
{
let marks=20;
let prom=new Promise((resolve,reject))
{

});

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/
Promise
https://developer.mozilla.org/en-US/docs/Web/Guide/AJAX
https://developer.mozilla.org/en-US/docs/learn/javascript/asynchronous/introducing

Installing dependencies of Angular


npm init -y
npm install --save core-js zone.js rxjs
npm i --save systemjs
npm i --save @angular/core
npm i --save @angular/common
npm i --save @angular/complier
npm i --save @angular/platform-browser
npm i --save @angular/platform-browser-dynamic

system.js.config.js ---file
jsconfig.json---file

npm i --save-dev typescript

under nodemodules src/app under this create below files


app.component.css
app.component.html
app.component.specs.ts
app.component.ts
app.module.ts

and under src create main.ts file

Angular Project with Command Line interface


npm install -g @angular/cli

ng new foldername // to create new project // ng-- angular


ng serve // projevt will start // applic will reload the website
ng generate component header-component
OR
ng g c header-component
ng g directive|service|class|interface|pipes|enum|guard

ng build // build the project


ng test // to test
ng e2e // end to end testing
ng help

https://www.npmjs.com/

##21 April 2022

i -g @angular/cli

publishing component to npm lib

1. ng g library my-button
2. modify file --> my-button.component.ts
3. ng build my-button --prod
4.

npm login
npm publish --access=public

Angular Directives
-- are used to extend the power of html by giving new syntax.
Directives can change, modify, extend behavior of DOM elements

1.Components Directives
2.Structural Directives -ngfor, ngIf, ngSwitch
3.Attribute Directives -ngStyle, ngClass

4.custom directive -ng g directive my-button

ngIf
-----
ngIf
ngIf with else
ngIf then and else

<div *ngIf='condition'></div>

ngFor
-----

<div *ngFor='let ele of elements'>{{ele}}</div>

index
first
last
even
odd

<h2> Making use of for loop</h2>


<ul>
<li *ngFor=let ele of elements; index as i">
{{ele.Fname}} {{ele.Lname}} {{i}}
</li>
</ul>
<h2> Making use of for loop</h2>
<ul>
<li *ngFor=let ele of elements; index as i; fisrt as f">
<div *ngIf='f'>This is first record</div>

<div> {{ele.Fname}} {{ele.Lname}} {{i}}</div>


</li>
</ul>

<h2> Making use of for loop</h2>


<ul>
<li *ngFor=let ele of elements; even as e; odd as o">
<div *ngIf='e'> style="background-color: brown;">
{{ele.Fname}} {{ele.Lname}} </div>

<div *ngIf='o'> style="background-color: red;">


{{ele.Fname}} {{ele.Lname}} </div>

</li>
</ul>

ipl="CSK"

<h2> Making use of Switch</h2>


<div [ngSwitch]="ipl">
<div *ngSwitchCase="'CSK'">CSK won</div>
<div *ngSwitchCase="'RSH'">RSH won</div>
<div *ngSwitchCase="'MI'">MI won</div>
</div>

//In app.component.html file


<div [ngStyle]="{'background-color':'blue','color':'white'}">This is ngStyle</div>

//In app.component.html file


<div [ngClass]="'c1'">This from class c1</div>

//In app.component.css file


.c1{
background-color:red;
font-family:'fontname';
color: white;
}

what is reactive programming


-it is an asynchronous programming paradigm concerned with streams and the
propagation of changes.

RxJS(Reactive Extension for JavaScript)- is a library for reactive programming


using observables
that makes easier to compose asynchronous of callback-based code.

Observables(Producer)rxjs - Its is producer of multiple value


Observable(consumer)
Subscription

https://rxjs.dev/guide/overview

ng new MyRxJSProject

in terminal --> ng g c rxjs


2) ng s

1. of Operator
2. from operator
3. fromEvent operator
4. internal operator
5. debounceTime operator

Angular Material
ng add @angular/material

https://material.angular.io/

https://www.angularjswiki.com/angular/angular-material-icons-list-mat-icon-list/

function changeTheme(event) {
var target=event.target || event.srcElement;
document.body.style.backgroundColor = themes[target.id].backgroundColor;
document.body.style.color=themes[target.id].color;
}

5 May 2022
@@Spring framework

#dependency injection

class Stud extends Human


{
psvm()
{
human s =getObject() //dependency injection
}
}

@IOC (Inversion of Control)

@Plain old Java Object(POJO) - Bean class


class Emp
{
String name;
int idl
address add;
}
class Address
{
String city;
String state;
int doorno;
}

ApplicationContext(I)
-classPathXMLApplicationContext(config.xml)
-FileSystemXMLApplicationContext("c/sd/config.xml")
-AnnotationConfigApplicationContext

DI can be done in two ways


1.Setter Injection
2.Constructor Injection

Steps
1. create maven project
2. get jars ->Spring Core and Spring context(Two dependencies require)
search maven repository and copy this two dependency and write in pom file
3. Create Bean class
-- creating spring bean congigration file

each bean represents objects in ioc container

https://docs.spring.io/spring-framework/docs/current/reference/html/core.html

data persistence
getConnection()

ORM - Object-Relational Mapping (Object comes from java and relation comes from
database)

@JWt 24 may 2022


https://jwt.io/introduction

@26 May 2022

CI/CD - Continuos Integration, Continuos Delivery, Continuos deployment


https://www.redhat.com/en/topics/devops/what-is-ci-cd

-commit
-Build - Source code is converted into executable form
-Test - Checks if all test cases are passing
-Deploy - Deploys the app to production environment

Jenkins- Github

Gitlab CI CD is a tool built into Gitlab allows you to apply continuos


Integration, Continuos Delivery, Continuos deployment to you application with no
third party application.

How to apply CI CD?


-Application codebase hosted on git
-create a YAML file-(Yet another Markup Language) file (YAML ain't markup language)
file
-Sequentially define scripts in YAML file
-YAML fine in root path of our repository
-Name of the file should be .gitlab-ci.yml

how to write Yaml?


Stages: Build, Test, Deploy

Build:
Build_a
Build_b
Test:
Test_a
Test_b
Deploy:
Deploy_a

Services:

https://docs.gitlab.com/ee/ci/yaml/

@27 May 2022


Docker
https://docker-docs.netlify.app/install/overview/

docker pull mongo -to pull the image

You might also like