Unit 1
Unit 1
HTML :
HTML, or Hypertext Markup Language, is a markup language for the web that defines the structure of
web pages.
It is used to design web pages .
It is one of the most basic building blocks of every website,
HTML 5 is the fifth and current version of HTML.
HTML Tags :
HTML tags are like keywords which defines that how web browser will format and display the content.
With the help of tags, a web browser can distinguish between an HTML content and a simple content.
HTML tags contain three main parts: opening tag, content and closing tag. But some HTML tags are
unclosed tags.(<br>,<hr>)
HTML Elements :
An element consists of the opening tag, a character, the content, and a closing tag.
Ex:- <h1> hello </h1>
HTML :
Semantic clearly describes it’s meaning to both the browser and the developer.
a website that uses semantics becomes more informative, adaptable, and accessible to those who use
screen readers to access websites.
Ex:- <header>, <footer> ,<section>,<article>,<figure> etc.
1
04-05-2024
HTML :
HTML 4 :-
HTML 5 :-
JavaScript programming :
JavaScript:-
JavaScript is a scripting or programming language that enables you to create dynamically updating content,
control multimedia, animate images, interactive maps, implement complex features on web pages.
2
04-05-2024
JavaScript programming :
JavaScript:-
JavaScript is a scripting or programming language that enables you to create dynamically updating content,
control multimedia, animate images, interactive maps, implement complex features on web pages.
Function in JavaScript:-
• function is the block of code designed to perform a particular task.
• we can reuse code it means Define the code once , and use it many times .
• a JavaScript function is executed when invokes it (calls it).
• Syntax :-
function function_Name() // creating a function
{
// statement
}
functionName() // calling a function
JavaScript programming :
JavaScript:-
console.log("hiii") // stmt
///*************************************************************************///////
console.log("hiii") // stmt
console.log(5)
console.log(true)
3
04-05-2024
JavaScript programming :
ex:-
function sum(a,b){
var total = a+b;
console.log(total);
}
sum(10,20);
sum(20,30);
JavaScript programming :
4
04-05-2024
JavaScript programming :
Callbacks are used to handle the results of asynchronous operations in a non-blocking manner.
Asynchronous operations are operations that take a significant amount of time to complete, such as
network requests, file I/O, and database queries. If these operations were executed synchronously, the
program would freeze and wait for the operation to complete before continuing. This can lead to a poor user
experience, as the program would appear unresponsive.
Callbacks allow you to continue executing code while the operation is being executed in the background.
Once the operation has completed, the callback function is called with the result of the operation. This way,
you can ensure that the program remains responsive and the user experience is not impacted.
JavaScript programming :
// callback function
function fn1(callback){
setTimeout(() => {
console.log("first")
callback()
}, 3000);
}
function fn2(callback){
setTimeout(()=>{
console.log("second")
callback()
},1500)
}
5
04-05-2024
JavaScript programming :
function fn3(callback){
setTimeout(()=>{
console.log("third")
callback()
},2000) o/p :-
} first
second
third
fn1(()=>{ all executed
fn2(()=>{
fn3(()=>{
console.log("all executed")
})
})
})
JavaScript programming :
Promise in JavaScript:-
JavaScript Promise are easy to manage when dealing with multiple asynchronous operations where
callbacks can create callback hell leading to unmanageable code.
Prior to promises events and callback functions were used but they had limited functionalities and created
unmanageable code. Multiple callback functions would create callback hell that leads to unmanageable
code. Promises are used to handle asynchronous operations in JavaScript.
Syntax:
• The promise constructor takes only one argument which is a callback function
• The callback function takes two arguments, resolve and reject
• Perform operations inside the callback function and if everything went well then call resolve.
• If desired operations do not go well then call reject
6
04-05-2024
JavaScript programming :
Promise in JavaScript:-
promise.
then(function () {
console.log('Success');
}). o/p:-
catch(function () {
console.log('error'); Success
});
JavaScript programming :
Async simply allows us to write promises-based code as if it was synchronous and it checks that we are not
breaking the execution thread.
Async functions will always return a value. It makes sure that a promise is returned and if it is not returned
then JavaScript automatically wraps it in a promise which is resolved with its value.
Await function is used to wait for the promise. It could be used within the async block only.
It makes the code wait until the promise returns a result.
7
04-05-2024
JavaScript programming :
function fn1(){
return new Promise((resolve,reject)=>{
setTimeout(() => {
console.log("first")
resolve("one")
}, 3000);
})
}
function fn2(){
return new Promise((resolve,reject)=>{
setTimeout(() => {
console.log("second")
resolve("two")
}, 1500);
})
}
JavaScript programming :
function fn3(){
return new Promise((resolve,reject)=>{
setTimeout(() => {
console.log("third")
resolve("three")
}, 2000);
})
}
o/p :- first
async function fnn(){ one
const nm1 = await fn1() second
console.log(nm1) third
const nm2 = await fn2()
const nm3 = await fn3()
}
fnn()
8
04-05-2024
BlockChain:
A hash function is a mathematical function that converts a numerical input value into another compressed
numerical value. The input to the hash function is of arbitrary length but output is always of fixed length.
BlockChain:
It is strong and difficult to duplicate the same hash with unique inputs and is a one-way function so revert is
not possible. Hashing is also known by different names such as Digest, Message Digest, Checksum, etc.
• Deterministic: This means that the same message always results in the same hash.
• Quick: It is quick to compute the hash value for any given message.
• Avalanche Effect: This means that every minor change in the message results in a major change in the
hash value.
• One-Way Function: You cannot reverse the cryptographic hash function to get to the data.
9
04-05-2024
BlockChain:
Encryption is the process of converting normal message (plaintext) into meaningless message (Ciphertext).
Whereas Decryption is the process of converting meaningless message (Ciphertext) into its original form
(Plaintext).
BlockChain:
Symmetric Key Encryption: Encryption is a process to change the form of any message in order to
protect it from reading by anyone. In Symmetric-key encryption the message is encrypted by using a key
and the same key is used to decrypt the message which makes it easy to use but less secure.
Asymmetric Key Encryption: Asymmetric Key Encryption is based on public and private key encryption
techniques. It uses two different key to encrypt and decrypt the message. It is more secure than the
symmetric key encryption.
10
04-05-2024
BlockChain:
What is Blockchain :-
Blockchain is a method of recording information that makes it impossible or difficult for the system to be
changed, hacked, or manipulated.
A block chain is a distributed ledger that duplicates and distributes transactions across the network of
computers participating in the block chain.
Blockchain technology is a structure that stores transactional records, also known as the block, of the public
in several databases, known as the “chain,” in a network connected through peer-to-peer nodes. Typically,
this storage is referred to as a ‘digital ledger.’
Every transaction in this ledger is authorized by the digital signature of the owner, which authenticates the
transaction and safeguards it from tampering. Hence, the information the digital ledger contains is highly
secure.
In simpler words, the digital ledger is like a Google spreadsheet shared among numerous computers in a
network, in which, the transactional records are stored based on actual purchases. The fascinating angle is
that anybody can see the data, but they can’t corrupt it
BlockChain:
Decentralization and Trust: Traditional centralized systems rely on intermediaries like banks,
governments, or third-party service providers to facilitate transactions and verify information. However,
these intermediaries introduce single points of failure, increase transaction costs, and may not always be
trustworthy. Block chain technology decentralizes data storage and transaction validation across a network
of nodes, eliminating the need for intermediaries and fostering trust through consensus mechanisms. This
ensures that transactions are transparent, tamper-resistant, and verifiable by all participants, reducing the
risk of fraud and manipulation.
Transparency and Immutability: Centralized databases are susceptible to data manipulation and
unauthorized access, leading to issues like data breaches, fraud, and corruption. Blockchain provides a
transparent and immutable ledger where transactions are recorded in a chronological order that cannot be
altered or deleted. Each transaction is cryptographically linked to the previous one, creating a tamper-
resistant audit trail. This transparency and immutability enhance accountability, facilitate regulatory
compliance, and build trust among stakeholders.
11
04-05-2024
BlockChain:
Security: Cyber security threats, such as hacking, data breaches, and identity theft, pose significant risks
to centralized systems, compromising sensitive information and undermining user privacy. Block chain
employs cryptographic techniques, including public-private key pairs, hashing, and digital signatures, to
secure transactions and data. Each transaction is cryptographically signed and verified by network
participants, ensuring its integrity and authenticity. Additionally, consensus mechanisms like proof of work
(PoW) or proof of stake (PoS) make it computationally expensive to alter the block chain, further enhancing
security.
Data Integrity and Trust: In centralized systems, data is stored in databases controlled by single entities,
making it vulnerable to manipulation, corruption, or loss. Block chain ensures data integrity and trust by
distributing data across multiple nodes in a network, making it resistant to tampering or censorship. Each
node maintains a copy of the block chain, and consensus mechanisms validate transactions, ensuring that
only valid transactions are added to the ledger. This redundancy and decentralization enhance data
reliability, availability, and resilience against cyber attacks or system failures.
BlockChain:
Smart Contracts: Block chain supports the execution of self-executing smart contracts, which
automatically enforce the terms of an agreement when predefined conditions are met, thereby reducing the
need for intermediaries and streamlining processes.
12
04-05-2024
BlockChain:
Efficiency and Cost Savings: Blockchain helps businesses save time and money by streamlining
processes and reducing the need for intermediaries.
Transparency and Trust: It provides a transparent and trustworthy system where transactions are
recorded securely, boosting confidence between parties.
Supply Chain Management: Blockchain improves supply chain visibility, reducing fraud and enhancing
collaboration between suppliers, manufacturers, and distributors.
Identity Management: It offers secure and decentralized identity solutions, enhancing data privacy and
security for businesses and individuals.
Intellectual Property Protection: Blockchain helps protect intellectual property rights by creating tamper-
proof records on a decentralized ledger.
Data Privacy and Security: It strengthens data privacy and security by encrypting data and distributing it
across a network, reducing the risk of breaches and unauthorized access.
BlockChain:
Business Blockchain:
Focus: Streamlining business processes, improving security and trust between collaborating parties.
Network Type: Permissioned networks – Think of them as exclusive clubs. Only authorized participants
can join and participate, ensuring a known level of trust and control.
Transparency: Can be private or public. Businesses can choose to share data only with authorized
participants or create a public record for specific purposes.
Regulation: Designed to be compliant with regulations. Permissioned networks make it easier to identify
participants and ensure adherence to rules.
Use Cases: Supply chain management, trade finance, asset tracking, identity management, secure data
sharing within a consortium of businesses.
13
04-05-2024
BlockChain:
Focus: Varied depending on the application. Some common examples include crypto currencies,
decentralized applications (dApps), and public record-keeping.
Network Type: Permission less networks – Open to everyone, fostering transparency and
decentralization.
Transparency: Completely transparent. All transactions are publicly viewable on the blockchain.
Use Cases: Crypto currencies like Bitcoin and Ethereum, dApps that provide a variety of services without a
central authority, secure and transparent public records for things like voting or land ownership.
BlockChain:
Business Blockchain: Imagine a high-security document shared between trusted partners in a business
deal. Access is controlled, and only authorized parties can see the document.
Business block chains may be built on existing public block chains but with modifications for permissioned
access and control.
Security is paramount in both types of blockchain. However, permissioned networks can add extra layers of
security since participants are vetted.
Public Blockchain: Think of a public bulletin board where anyone can post information. Everything is
transparent, and anyone can see what's been posted.
14
04-05-2024
BlockChain:
Crypto currencies and Digital Assets: Crypto currencies like Bitcoin and Ethereum are decentralized
digital currencies built on blockchain technology.
Digital assets, including tokens and stablecoins, represent various types of value on blockchain networks.
Financial Services and Payments: Blockchain solutions in this category include remittances, cross-border
payments, and peer-to-peer lending platforms that leverage blockchain for faster, cheaper, and more
transparent transactions.
Supply Chain Management: Blockchain is used to track and trace products across the supply chain,
ensuring transparency, authenticity, and efficiency. It helps in combating counterfeiting, reducing fraud, and
optimizing logistics.
Smart Contracts and Decentralized Applications (DApps): Smart contracts are self-executing contracts
with the terms of the agreement directly written into code. They automate and enforce the execution of
agreements in a transparent and trustless manner.
Decentralized applications (DApps) are applications that run on blockchain networks, offering various
functionalities, including finance, gaming, social networking, and more.
BlockChain:
Healthcare: Blockchain solutions in healthcare facilitate secure and interoperable sharing of patient data
among healthcare providers, improving data accuracy, patient privacy, and healthcare outcomes.
Governance and Voting: Blockchain can be used for transparent and tamper-resistant voting systems,
enabling secure and verifiable elections and governance processes.
Real Estate: Blockchain solutions in real estate streamline property transactions, title management, and
land registry systems, reducing fraud, eliminating intermediaries, and enhancing transparency.
15
04-05-2024
BlockChain:
blockchain future:-
Scalability Solutions: Improving scalability is essential for blockchain to handle larger transaction volumes
and accommodate widespread adoption. Innovations like layer 2 scaling solutions, sharding, and improved
consensus mechanisms aim to address scalability challenges.
Enterprise Adoption: Enterprises will continue to explore and implement blockchain solutions for various
use cases, including supply chain management, financial services, identity management, and decentralized
finance (DeFi), driving efficiency gains, cost savings, and innovation.
NFTs and Digital Ownership: Non-fungible tokens (NFTs) will continue to gain popularity, enabling unique
digital assets, such as artwork, collectibles, and virtual real estate, to be bought, sold, and traded on
blockchain platforms, revolutionizing concepts of ownership and value.
BlockChain:
Understand the state of the blockchain industry in 2019, in terms of technologies, topics and
communities, See how today's blockchain implementations vary :-
In 2019, the blockchain industry experienced significant growth and evolution across various technologies,
topics, and communities. Here's an overview of the state of the blockchain industry in 2019 and how today's
blockchain implementations vary:
Technologies:
Scalability Solutions: Scalability was a major focus, with projects exploring solutions like sharding, off-
chain transactions, and layer 2 scaling solutions to improve transaction throughput.
Interoperability: Efforts to enhance interoperability between different blockchain networks gained traction,
with projects working on cross-chain communication protocols and interoperable blockchain platforms.
16
04-05-2024
BlockChain:
Understand the state of the blockchain industry in 2019, in terms of technologies, topics and
communities, See how today's blockchain implementations vary :-
Smart Contracts and DApps: There was continued innovation in smart contract platforms and
decentralized applications (DApps), with projects aiming to improve developer tools, user experience, and
scalability.
Consensus Mechanisms: Projects explored alternative consensus mechanisms beyond proof of work
(PoW), such as proof of stake (PoS), delegated proof of stake (DPoS), and practical Byzantine fault
tolerance (PBFT), to improve scalability, energy efficiency, and security.
Enterprise Adoption: Enterprises began exploring blockchain solutions for various use cases, leading to
the development of enterprise-grade blockchain platforms and consortia focused on industry-specific
applications like supply chain management, identity verification, and financial services.
17