Snippets Collections
#include <stdio.h>
#include <string.h>

void encrypt(char *text, int key) {
    for (int i = 0; text[i] != '\0'; i++) {
        // Encrypt uppercase letters
        if (text[i] >= 'A' && text[i] <= 'Z') {
            text[i] = (text[i] - 'A' + key) % 26 + 'A';
        }
        // Encrypt lowercase letters
        else if (text[i] >= 'a' && text[i] <= 'z') {
            text[i] = (text[i] - 'a' + key) % 26 + 'a';
        }
    }
}

void decrypt(char *text, int key) {
    // Decrypt by shifting in the opposite direction
    for (int i = 0; text[i] != '\0'; i++) {
        // Decrypt uppercase letters
        if (text[i] >= 'A' && text[i] <= 'Z') {
            text[i] = (text[i] - 'A' - key + 26) % 26 + 'A';  // +26 to handle negative
        }
        // Decrypt lowercase letters
        else if (text[i] >= 'a' && text[i] <= 'z') {
            text[i] = (text[i] - 'a' - key + 26) % 26 + 'a';  // +26 to handle negative
        }
    }
}

int main() {
    char text[100];
    int key;

    printf("Enter the text to encrypt: ");
    fgets(text, sizeof(text), stdin);
    text[strcspn(text, "\n")] = 0; // Remove trailing newline

    printf("Enter the encryption key (shift): ");
    scanf("%d", &key);

    encrypt(text, key);
    printf("Encrypted text: %s\n", text);

    decrypt(text, key);
    printf("Decrypted text: %s\n", text);

    return 0;
}

#include <stdio.h>

struct node {
    unsigned dist[20];
    unsigned from[20];
} rt[10];

int main() {
    int costmat[20][20];
    int nodes, i, j, k, count;

    printf("Enter the number of nodes: ");
    scanf("%d", &nodes);

    printf("Enter the cost matrix:\n");
    for (i = 0; i < nodes; i++) {
        for (j = 0; j < nodes; j++) {
            scanf("%d", &costmat[i][j]);
            rt[i].dist[j] = costmat[i][j]; // Initialize distance
            rt[i].from[j] = (costmat[i][j] != 0 && costmat[i][j] != 1000) ? j : -1; // Set 'from' based on cost
        }
    }

    // Set diagonal to 0
    for (i = 0; i < nodes; i++) {
        rt[i].dist[i] = 0;
        rt[i].from[i] = i;
    }

    // Floyd-Warshall Algorithm
    do {
        count = 0;
        for (i = 0; i < nodes; i++) {
            for (j = 0; j < nodes; j++) {
                for (k = 0; k < nodes; k++) {
                    if (rt[i].dist[j] > rt[i].dist[k] + rt[k].dist[j]) {
                        rt[i].dist[j] = rt[i].dist[k] + rt[k].dist[j];
                        rt[i].from[j] = k;
                        count++;
                    }
                }
            }
        }
    } while (count != 0);

    // Output the final routing table
    printf("\nUpdated routing table\n");
    for (i = 0; i < nodes; i++) {
        for (j = 0; j < nodes; j++) {
            if (rt[i].from[j] != -1) {
                printf("%d ", rt[i].dist[j]);
            } else {
                printf("inf ");  // Use "inf" to indicate no path
            }
        }
        printf("\n");
    }

    return 0;
}
#include<stdio.h>
int p,q,u,v,n;
int min=99;
int minCost=0;
int t[50][2],i,j;
int parent[50],edge[50][50];

int main(){
    clrsrc();
    printf("\nEnter the number of nodes");
    scanf("%d",&n);
    for(i=0;i<n;i++){
        printf("%d",i);
        parent[i]=-1;
    }
    printf("\n");
    for(i=0;i<n;i++){
        printf("%c",65+i);
        for(j=0;j<n;j++){
            scanf("%d",&edge[i][j]);
        }
        for(i=0;i<n;i++){
            for(j=0;j<n;j++){
                if(edge[1][j]!=99){
                    if(min<edge[i][j]){
                        min=edge[i][j];
                        u=i;
                        v=j;
                    }
                    p=find(u);
                    q=find(v);
                    
                    if(p!=q){
                        t[i][0]=u;
                        t[i][1]=v;
                        minCost =minCost+edge[u][v];
                        sunion(p,q);
                    }
                    else{
                        t[i][0]=-1;
                        t[i][1]=-1;
                    }
                }
            }
        }
        min = 99;
    }
    printf("Minimum cost is %d\n Minimum spanning tree is\n",minCost);
    for(i=0;i<n;i++){
        if(t[i][0]!=-1 && t[i][1]!=1){
            printf("%c %c %d",65+t[i][0],65+t[i][1],edge[t[i][0]] [t[i][1]]);
            printf("\n");
        }
        getch();
    }
    sunion(int I,int m){
        parent[] = m;
    }
    find(int I){
        if(parent[1]>0){
            I=parent[I];
        }
        return I;
    }
}
#include<stdio.h>
#include<stdbool.h>
#include<limits.h>
#define V 9

int minDistance(int dist[] ,bool sptset[]){
    int min = INT_MAX;  
    int min_index;
    for(int v=0;v<V;v++){
        if(sptset[v] == false && dist[v]<=min){
            min = dist[v];
            min_index = v;
        }
    }
    return min_index;
}

void printSolution(int dist[]){
    printf("Vertex\t\tDistance from source\n");
    for(int i=0;i<V;i++){
        printf("%d\t\t\t\t %d\n",i,dist[i]);
    }
}

void dijkstra(int graph[V][V],int src){
    int dist[V];
    bool sptset[V];
    for(int i=0;i<V;i++){
        dist[i] = INT_MAX;
        sptset[1]=false;
    }
    dist[src]=0;
    for(int count=0;count<V-1;count++){
        int u = minDistance(dist,sptset);
        sptset[u]=true;
        for(int v=0;v<V;v++){
            if(!sptset[v] && graph[u][v] && dist[u]!=INT_MAX && dist[u]+graph[u][v] < dist[v])
                dist[v] = dist[u]+graph[u][v];
        }
    }
    printSolution(dist);
}

int main(){
    int graph[V][V] = {{0,4,0,0,0,0,0,8,0},
               {4,0,8,0,0,0,0,11,0},
               {0,8,0,7,0,4,0,0,2},
               {0,0,7,0,9,14,0,0,0},
               {0,0,0,9,0,10,0,0,0},
               {0,0,4,14,10,0,2,0,0},
               {0,0,0,0,0,2,0,1,6},
               {8,11,0,0,0,0,1,0,7},
               {0,0,2,0,0,0,6,7,0}};
    dijkstra(graph,0);
    return 0;
}
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdbool.h>

#define MAX_SEQ 4 // Maximum sequence number (0 to 7)
#define WINDOW_SIZE 4  // Size of the sliding window

// Packet structure
typedef struct {
    int seq_num;  // Sequence number
    bool ack;     // Acknowledgment flag
} Packet;

// Function prototypes
void sender();
void receiver();
void send_packet(Packet packet);
bool receive_packet(Packet packet);
bool simulate_packet_loss();

int main() {
    // Start sender and receiver (in a real implementation, these would run in separate threads or processes)
    sender();
    receiver();
    return 0;
}

void sender() {
    int next_seq_num = 0; // Next sequence number to send
    int acked = 0; // Last acknowledged packet
    int window_start = 0; // Start of the sliding window

    while (window_start <= MAX_SEQ) {
        // Send packets within the window
        while (next_seq_num < window_start + WINDOW_SIZE && next_seq_num <= MAX_SEQ) {
            Packet packet = {next_seq_num, false};
            send_packet(packet);
            next_seq_num++;
            sleep(1); // Simulate time taken to send a packet
        }

        // Simulate receiving an acknowledgment (in real systems this would be from the receiver)
        for (int i = acked; i < next_seq_num; i++) {
            if (receive_packet((Packet){i, true})) {
                acked++;
            }
        }

        // Slide the window
        window_start = acked;
        next_seq_num = window_start; // Move next_seq_num to the next unacknowledged packet
    }

    printf("Sender finished transmitting all packets.\n");
}

void receiver() {
    for (int i = 0; i <= MAX_SEQ; i++) {
        sleep(1); // Simulate processing time for receiving a packet
        if (simulate_packet_loss()) {
            printf("Receiver: Lost packet with seq_num %d\n", i);
            continue; // Simulate loss
        }
        printf("Receiver: Received packet with seq_num %d\n", i);
    }
}

void send_packet(Packet packet) {
    printf("Sender: Sending packet with seq_num %d\n", packet.seq_num);
}

bool receive_packet(Packet packet) {
    // Simulate acknowledgment logic
    if (packet.ack) {
        printf("Receiver: Acknowledgment for packet with seq_num %d\n", packet.seq_num);
        return true;
    }
    return false;
}

bool simulate_packet_loss() {
    // Randomly simulate packet loss (30% chance)
    return (rand() % 10) < 3;
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>University Demo</title>
    <style>
        /* Basic CSS styles for layout and appearance */
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f4f9;
        }
        header {
            background-color: #4CAF50;
            color: white;
            padding: 20px;
            text-align: center;
        }
        nav {
            background-color: #333;
            overflow: hidden;
        }
        nav a {
            float: left;
            display: block;
            color: white;
            padding: 14px 20px;
            text-align: center;
            text-decoration: none;
        }
        nav a:hover {
            background-color: #ddd;
            color: black;
        }
        section {
            padding: 20px;
        }
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
        }
        footer {
            background-color: #333;
            color: white;
            text-align: center;
            padding: 10px 0;
            position: fixed;
            width: 100%;
            bottom: 0;
        }
    </style>
</head>
<body>
    <header>
        <h1>Welcome to Our University</h1>
        <p>Empowering Future Leaders</p>
    </header>
    
    <nav>
        <a href="#about">About</a>
        <a href="#courses">Courses</a>
        <a href="#contact">Contact</a>
    </nav>

    <section id="about">
        <div class="container">
            <h2>About Us</h2>
            <p>Our University is dedicated to providing world-class education to students from all walks of life. We offer a wide range of academic programs designed to foster growth and leadership in our students.</p>
        </div>
    </section>

    <section id="courses">
        <div class="container">
            <h2>Our Courses</h2>
            <ul>
                <li>Bachelor of Science in Computer Science</li>
                <li>Master of Business Administration</li>
                <li>Bachelor of Arts in History</li>
                <li>PhD in Physics</li>
                <li>Master of Engineering in Civil</li>
            </ul>
        </div>
    </section>

    <section id="contact">
        <div class="container">
            <h2>Contact Us</h2>
            <p>Email: contact@university.com</p>
            <p>Phone: +123 456 7890</p>
            <p>Address: 123 University St, City, Country</p>
        </div>
    </section>

    <footer>
        <p>&copy; 2024 University Demo. All rights reserved.</p>
    </footer>
</body>
</html>
include <stdio.h>
#include <string.h>

#define MAX_LEN 28

char t[MAX_LEN], cs[MAX_LEN], g[MAX_LEN];
int a, e, c, b;

void xor() {
    for (c = 1; c < strlen(g); c++)
        cs[c] = ((cs[c] == g[c]) ? '0' : '1');
}

void crc() {
    for (e = 0; e < strlen(g); e++)
        cs[e] = t[e];
    
    do {
        if (cs[0] == '1') {
            xor();
        }
        
        for (c = 0; c < strlen(g) - 1; c++)
            cs[c] = cs[c + 1];
        
        cs[c] = t[e++];
    } while (e <= a + strlen(g) - 1);
}

int main() {
    int flag = 0;
    do {
        printf("\n1. CRC-12\n2. CRC-16\n3. CRC-CCITT\n4. Exit\n\nEnter your option: ");
        scanf("%d", &b);

        switch (b) {
            case 1: 
                strcpy(g, "1100000001111");
                break;
            case 2: 
                strcpy(g, "11000000000000101");
                break;
            case 3: 
                strcpy(g, "10001000000100001");
                break;
            case 4: 
                return 0;
            default:
                printf("Invalid option. Please try again.\n");
                continue;
        }

        printf("\nEnter data: ");
        scanf("%s", t);
        printf("\n-----------------------\n");
        printf("Generating polynomial: %s\n", g);
        a = strlen(t);

        // Append zeros to the data
        for (e = a; e < a + strlen(g) - 1; e++)
            t[e] = '0';
        t[e] = '\0';  // Null terminate the string

        printf("--------------------------\n");
        printf("Modified data is: %s\n", t);
        printf("-----------------------\n");
        crc();
        printf("Checksum is: %s\n", cs);
        
        // Prepare the final codeword
        for (e = a; e < a + strlen(g) - 1; e++)
            t[e] = cs[e - a];
        printf("-----------------------\n");
        printf("Final codeword is: %s\n", t);
        printf("------------------------\n");

        // Error detection option
        printf("Test error detection (0: yes, 1: no)?: ");
        scanf("%d", &e);
        if (e == 0) {
            do {
                printf("\n\tEnter the position where error is to be inserted: ");
                scanf("%d", &e);
            } while (e <= 0 || e > a + strlen(g) - 1);
            
            t[e - 1] = (t[e - 1] == '0') ? '1' : '0'; // Toggle the bit
            printf("-----------------------\n");
            printf("\nErroneous data: %s\n", t);
        }

        crc();
        for (e = 0; (e < strlen(g) - 1) && (cs[e] != '1'); e++);
        if (e < strlen(g) - 1)
            printf("Error detected\n\n");
        else
            printf("No error detected\n\n");
        
        printf("-----------------------\n");
    } while (flag != 1);

    return 0;
}


#include<stdio.h>
#include<string.h>

void bitStuffing(char *str) {
    int i, count = 0;
    char stuffedStr[100] = ""; // initialize an empty string to store the stuffed bits

    for (i = 0; i < strlen(str); i++) {
        if (str[i] == '1') {
            count++;
            if (count == 5) {
                strcat(stuffedStr, "0"); // stuff a '0' bit
                count = 0;
            }
        } else {
            count = 0;
        }
        char temp[2];
        sprintf(temp, "%c", str[i]);
        strcat(stuffedStr, temp);
    }

    printf("Original string: %s\n", str);
    printf("Bit-stuffed string: %s\n", stuffedStr);
}

int main() {
    char str[100];
    printf("Enter a binary string: ");
    scanf("%s", str);

    bitStuffing(str);

    return 0;
}
include <stdio.h>
#include <string.h>

#define FRAME_START 0x7E // Start of Frame
#define FRAME_END 0x7E   // End of Frame
#define STUFFING_CHAR 0x7D // Escape character
#define ESCAPED_CHAR 0x20  // Value to append after STUFFING_CHAR

void stuffCharacters(char *input, char *output) {
    int i, j = 0;
    int length = strlen(input);

    // Adding the frame start character
    output[j++] = FRAME_START;

    for (i = 0; i < length; i++) {
        if (input[i] == FRAME_START || input[i] == FRAME_END || input[i] == STUFFING_CHAR) {
            output[j++] = STUFFING_CHAR; // Stuffing character
            output[j++] = input[i] ^ ESCAPED_CHAR; // Escape the character
        } else {
            output[j++] = input[i]; // Normal character
        }
    }

    // Adding the frame end charactera
    output[j++] = FRAME_END;
    output[j] = '\0'; // Null-terminate the output string
}

void unstuffCharacters(char *input, char *output) {
    int i, j = 0;
    int length = strlen(input);

    // Skip frame start
    i = 1; 

    while (i < length - 1) { // Skip frame end
        if (input[i] == STUFFING_CHAR) {
            // Unstuffing character
            output[j++] = input[i + 1] ^ ESCAPED_CHAR;
            i += 2; // Move past the stuffed character
        } else {
            output[j++] = input[i++];
        }
    }

    output[j] = '\0'; // Null-terminate the output string
}

int main() {
    char input[256]; // Buffer for input message
    char stuffed[512]; // Buffer for stuffed message (larger to accommodate potential expansion)
    char unstuffed[256]; // Buffer for unstuffed message

    printf("Enter your message: ");
    fgets(input, sizeof(input), stdin); // Read input from the keyboard

    // Remove newline character if present
    input[strcspn(input, "\n")] = 0;

    printf("Original Message: %s\n", input);

    // Perform character stuffing
    stuffCharacters(input, stuffed);
    printf("Stuffed Message: ");
    for (int i = 0; stuffed[i] != '\0'; i++) {
        printf("%02X ", (unsigned char)stuffed[i]);
    }
    printf("\n");

    // Perform character unstuffing
    unstuffCharacters(stuffed, unstuffed);
    printf("Unstuffed Message: %s\n", unstuffed);

    return 0;
}

#include<stdio.h>
#include<string.h>

int main(){
    int n,i,j,c=0,count=0;
    char str[100]; 
    printf("Enter the string: ");
    scanf("%s", str); 

    printf("Enter the number of frames:");
    scanf("%d",&n);
    int frames[n];

    printf("Enter the frame size of the frames:\n");
    for(int i=0;i<n;i++){
        printf("Frame %d:",i);
        scanf("%d",&frames[i]);
    }

    printf("\nThe number of frames:%d\n",n);
    c = 0;
    for(int i=0;i<n;i++){
        printf("The content of the frame %d:",i);
        j=0;
        count = 0; 
        while(c < strlen(str) && j < frames[i]){
            printf("%c",str[c]);
            if(str[c]!='\0'){
                count++;
            }
            c=c+1;
            j=j+1;
        }
        printf("\nSize of frame %d: %d\n\n",i,count);
    }
    return 0;
}
/*
* Clears the keyboard if an invalid input was put in
*/
void clear_keyboard_buffer(void)
{
	char c = 'a';
	while (c != '\n')
	{
		scanf("%c", &c);
	}
	return;
}
/*
* Gets a user integer greater than a specified value
* @param int val
*		- The value that the user input is to be greater than 
*/
int get_user_greater_int(int val)
{
	int input, noc;
	printf("Enter an Interger Greater than %d: ", val);
	noc = scanf("%d", &input);
	clear_keyboard_buffer();

	while (noc != 1 || !(input >= 0))
	{
		printf("Invalid input\nEnter an Interger Greater than %d", val);
		noc = scanf("%d", &input);
		clear_keyboard_buffer();
	}

	return input;
}
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.annotation.WebServlet;

@WebServlet("/hello")
public class HelloWorldServlet extends HttpServlet {
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html");
        response.getWriter().println("<h1>Hello, World!</h1>");
    }
}
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.ServletConfig;
import javax.servlet.annotation.WebServlet;

@WebServlet("/lifecycle")
public class LifecycleServlet implements javax.servlet.Servlet {
    public void init(ServletConfig config) throws ServletException {
        System.out.println("Servlet Initialized");
    }

    public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
        System.out.println("Servlet is servicing the request");
    }

    public void destroy() {
        System.out.println("Servlet Destroyed");
    }

    public ServletConfig getServletConfig() {
        return null;
    }

    public String getServletInfo() {
        return null;
    }
}
web.xml

<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="3.0">
    <servlet>
        <servlet-name>LifecycleServlet</servlet-name>
        <servlet-class>LifecycleServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>LifecycleServlet</servlet-name>
        <url-pattern>/lifecycle</url-pattern>
    </servlet-mapping>
</web-app>
import java.sql.*;

public class DatabaseMetadataExample {
    public static void main(String[] args) {
        try {
            Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/your_database", "username", "password");
            DatabaseMetaData metaData = connection.getMetaData();
            
            System.out.println("Database Product Name: " + metaData.getDatabaseProductName());
            System.out.println("Database Product Version: " + metaData.getDatabaseProductVersion());
            System.out.println("Driver Name: " + metaData.getDriverName());
            System.out.println("Driver Version: " + metaData.getDriverVersion());
            
            connection.close();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
import org.w3c.dom.*;
import javax.xml.parsers.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.validation.*;
import java.io.File;

public class DOMXMLValidator {
    public static void main(String[] args) {
        try {
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = factory.newDocumentBuilder();
            Document doc = builder.parse(new File("example.xml"));
            
            SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
            Schema schema = schemaFactory.newSchema(new File("schema.xsd"));
            Validator validator = schema.newValidator();
            validator.validate(new DOMSource(doc));
            
            System.out.println("XML is valid.");
        } catch (Exception e) {
            System.out.println("XML is not valid: " + e.getMessage());
        }
    }
}
function greetUserPromise(name) {
    return new Promise((resolve) => {
        console.log(`Hi ${name}`);  
        resolve();
    });
}

function greetUserCallback(name, callback) {
    callback();
    console.log(`${name}`); 
}

function greetforCall() {
    console.log("Hello");
}

async function greetUserAsync() {
    try {
        await greetUserPromise("Arun");
        console.log("Hello Arun");
    } catch (error) {
        console.error("An error occurred:", error);
    }
}

greetUserAsync();

greetUserCallback("Arun", greetforCall);
int user_wishes_to_continue(void)
{
	char c;
	do
	{
		printf("Do you wish to continue? (Y/N)");
		scanf("%c", &c);
		clear_keyboard_buffer();
	} while (c != 'y' && c != 'Y' && c != 'n' && c != 'N');

	return (c == 'Y');
}

void clear_keyboard_buffer(void)
{
	char c = 'a';
	while (c != '\n')
	{
		scanf_s("%c", &c);
	}
	return;
}
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Responsive Web Design</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
        }


        header {
            background-color: #3498db;
            color: white;
            padding: 20px;
            text-align: center;
        }


        .container {
            padding: 20px;
        }


        .content {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
        }

        .content div {
            background-color: #2980b9;
            color: white;
            text-align: center;
            padding: 20px;
            border-radius: 8px;
        }

        @media (max-width: 768px) {
            .content {
                grid-template-columns: repeat(2, 1fr);

            }
        }


        @media (max-width: 480px) {
            .content {
                grid-template-columns: 1fr;

            }

            header {
                padding: 15px;

            }

            .content div {
                font-size: 14px;

            }
        }
    </style>
</head>

<body>
    <header>
        <h1>Responsive Web Design</h1>
    </header>

    <div class="container">
        <div class="content">
            <div>Item 1</div>
            <div>Item 2</div>
            <div>Item 3</div>
        </div>
    </div>
</body>

</html>
popUpDemo.html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JavaScript Pop-Up Boxes</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            text-align: center;
            margin-top: 50px;
        }

        button {
            padding: 10px 15px;
            font-size: 16px;
            margin: 10px;
        }
    </style>
</head>
<body>

    <h1>JavaScript Pop-Up Box Demonstration</h1>
    <button onclick="showAlert()">Show Alert</button>
    <button onclick="showConfirm()">Show Confirm</button>
    <button onclick="showPrompt()">Show Prompt</button>

    <script>
        function showAlert() {
            alert("This is an alert box!");
        }

        function showConfirm() {
            const result = confirm("Do you want to proceed?");
            if (result) {
                alert("You clicked OK!");
            } else {
                alert("You clicked Cancel!");
            }
        }

        function showPrompt() {
            const name = prompt("Please enter your name:");
            if (name) {
                alert("Hello, " + name + "!");
            } else {
                alert("No name entered.");
            }
        }
    </script>

</body>
</html>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Basic Flexbox with Animation</title>
    <style>
       
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background-color: #f0f0f0;
        }

        
        .flex-container {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            gap: 20px;
            width: 80%;
            max-width: 800px;
        }

        
        .flex-item {
            background-color: #3498db;
            color: white;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 150px;
            width: 30%;
            font-size: 20px;
            font-weight: bold;
            border-radius: 8px;
            transition: transform 0.3s ease, background-color 0.3s ease;
        }

       
        .flex-item:hover {
            transform: scale(1.1);
            background-color: #2980b9;
        }
    </style>
</head>

<body>
    <div class="flex-container">
        <div class="flex-item">Item 1</div>
        <div class="flex-item">Item 2</div>
        <div class="flex-item">Item 3</div>
        <div class="flex-item">Item 4</div>
        <div class="flex-item">Item 5</div>
        <div class="flex-item">Item 6</div>
    </div>
</body>

</html>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Basic CSS Grid with Animation</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background-color: #f0f0f0;
        }

        .grid-container {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
            width: 80%;
            max-width: 800px;
        }

       
        .grid-item {
            background-color: #3498db;
            color: white;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 150px;
            font-size: 20px;
            font-weight: bold;
            border-radius: 8px;
            transition: transform 0.3s ease, background-color 0.3s ease;
        }

        .grid-item:hover {
            transform: scale(1.1);
            background-color: #2980b9;
        }
    </style>
</head>

<body>
    <div class="grid-container">
        <div class="grid-item">Item 1</div>
        <div class="grid-item">Item 2</div>
        <div class="grid-item">Item 3</div>
        <div class="grid-item">Item 4</div>
        <div class="grid-item">Item 5</div>
        <div class="grid-item">Item 6</div>
    </div>
</body>

</html>
calculator.html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Scientific Calculator</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100vh;
            background-color: #f4f4f4;
        }

        #calculator {
            border: 1px solid #ccc;
            border-radius: 8px;
            padding: 20px;
            background-color: white;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }

        #display {
            width: 100%;
            height: 40px;
            text-align: right;
            font-size: 24px;
            border: 1px solid #ccc;
            margin-bottom: 10px;
            padding: 5px;
            border-radius: 5px;
        }

        button {
            width: 60px;
            height: 60px;
            font-size: 20px;
            margin: 5px;
            border: none;
            border-radius: 5px;
            background-color: #6200ea;
            color: white;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        button:hover {
            background-color: #3700b3;
        }

        .row {
            display: flex;
        }
    </style>
</head>
<body>

<div id="calculator">
    <input type="text" id="display" disabled>
    <div class="row">
        <button onclick="appendToDisplay('7')">7</button>
        <button onclick="appendToDisplay('8')">8</button>
        <button onclick="appendToDisplay('9')">9</button>
        <button onclick="appendToDisplay('/')">/</button>
    </div>
    <div class="row">
        <button onclick="appendToDisplay('4')">4</button>
        <button onclick="appendToDisplay('5')">5</button>
        <button onclick="appendToDisplay('6')">6</button>
        <button onclick="appendToDisplay('*')">*</button>
    </div>
    <div class="row">
        <button onclick="appendToDisplay('1')">1</button>
        <button onclick="appendToDisplay('2')">2</button>
        <button onclick="appendToDisplay('3')">3</button>
        <button onclick="appendToDisplay('-')">-</button>
    </div>
    <div class="row">
        <button onclick="appendToDisplay('0')">0</button>
        <button onclick="appendToDisplay('.')">.</button>
        <button onclick="calculateResult()">=</button>
        <button onclick="appendToDisplay('+')">+</button>
    </div>
    <div class="row">
        <button onclick="clearDisplay()">C</button>
    </div>
</div>

<script>
    function appendToDisplay(value) {
        document.getElementById("display").value += value;
    }

    function clearDisplay() {
        document.getElementById("display").value = "";
    }

    function calculateResult() {
        const display = document.getElementById("display");
        try {
            const result = eval(display.value);
            display.value = result;
        } catch (error) {
            display.value = "Error";
        }
    }
</script>

</body>
</html>
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class SelectExample {
    public static void main(String[] args) {
        try {
            Class.forName("oracle.jdbc.driver.OracleDriver");
            Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", "system", "pragna");

            String selectQuery = "SELECT EID, ESAL, ENAME FROM emp WHERE ESAL > ?";
            PreparedStatement pstmt = con.prepareStatement(selectQuery);
            pstmt.setInt(1, 30000); // Minimum ESAL for selection

            ResultSet rs = pstmt.executeQuery();
            while (rs.next()) {
                int eid = rs.getInt("EID");
                int esal = rs.getInt("ESAL");
                String ename = rs.getString("ENAME");
                System.out.println("EID: " + eid + ", ESAL: " + esal + ", ENAME: " + ename);
            }

            rs.close();
            pstmt.close();
            con.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;

public class UpdateExample {
    public static void main(String[] args) {
        try {
            Class.forName("oracle.jdbc.driver.OracleDriver");
            Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", "system", "pragna");

            String updateQuery = "UPDATE emp SET ESAL = ? WHERE EID = ?";
            PreparedStatement pstmt = con.prepareStatement(updateQuery);
            pstmt.setInt(1, 60000); // New ESAL
            pstmt.setInt(2, 30);    // EID of the employee to update

            int rowsUpdated = pstmt.executeUpdate();
            System.out.println("Rows updated: " + rowsUpdated);

            pstmt.close();
            con.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;

public class InsertExample {
    public static void main(String[] args) {
        try {
            Class.forName("oracle.jdbc.driver.OracleDriver");
            Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", "system", "pragna");

            String insertQuery = "INSERT INTO emp (EID, ESAL, ENAME) VALUES (?, ?, ?)";
            PreparedStatement pstmt = con.prepareStatement(insertQuery);
            pstmt.setInt(1, 30);          // Set EID
            pstmt.setInt(2, 50000);       // Set ESAL
            pstmt.setString(3, "Manish"); // Set ENAME

            int rowsInserted = pstmt.executeUpdate();
            System.out.println("Rows inserted: " + rowsInserted);

            pstmt.close();
            con.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
Logics:
1)Tip Calculator
super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        binding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(binding.root)
 
        binding.button.setOnClickListener() {
            calculateTip()
        }
    }
    fun calculateTip()
    {
        val cost =(binding.cost.text.toString()).toDouble()
        val selected =binding.RG.checkedRadioButtonId
        val tipPercent=when(selected)
        {
            R.id.radioButton ->15
            R.id.radioButton2 ->18
            else -> 20
        }
        var tip=tipPercent*cost
        if(binding.switch2.isChecked)
        {
            tip= ceil(tip)
        }
        binding.textView7.text=tip.toString()
    }
}
2)Toast message
val button:Button=findViewById(R.id.button)
        button.setOnClickListener{
            Toast.makeText(this,"Clicked",Toast.LENGTH_LONG).show()
        }
3)dice roller
val button: Button=findViewById(R.id.button)
        button.setOnClickListener{
            rollDice()
        }
    }
    private fun rollDice(){
        val dice=Dice(6)
        val diceRoll=dice.roll()
        val img :ImageView=findViewById(R.id.imageView)
        val drawableResource = when(diceRoll){
            1->R.drawable.dice1
            2->R.drawable.dice2
            3->R.drawable.dice3
            4->R.drawable.dice4
            5->R.drawable.dice5
            else->R.drawable.dice5
        }
        img.setImageResource(drawableResource)
    }
}
class Dice(private val numsides:Int){
    fun roll():Int{
        return (1..numsides).random()
    }
}
4)explicit intent
//Explicit Intent
        var t: TextView = findViewById(R.id.textView)
        var f: FloatingActionButton = findViewById(R.id.floatingActionButton)
        f.setOnClickListener()
        {
            var i = Intent(this, MainActivity2::class.java)
            startActivity(i)
        }
    }
}
5)activity lifecycle
@SuppressLint("MissingInflatedId")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_main)
        Toast.makeText(applicationContext,"ONCREATE() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onStart() {
        super.onStart()
        Toast.makeText(applicationContext,"ONSTART() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onRestart() {
        super.onRestart()
        Toast.makeText(applicationContext,"ONRESTART() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onResume() {
        super.onResume()
        Toast.makeText(applicationContext,"ONRESUME() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onPause() {
        super.onPause()
        Toast.makeText(applicationContext,"ONPAUSE() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onStop() {
        super.onStop()
        Toast.makeText(applicationContext,"ONSTOP() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onDestroy() {
        super.onDestroy()
        Toast.makeText(applicationContext,"ONDESTROY() CALLED",Toast.LENGTH_SHORT).show()
    }
}
6)copy and paste
setContentView(R.layout.activity_main)
        val button:Button=findViewById(R.id.button)
        val et:EditText=findViewById(R.id.editTextText)
        val tv:TextView=findViewById(R.id.textView)
 
        button.setOnClickListener{
            tv.text=et.text.toString()
            Toast.makeText(this,"Text Copied",Toast.LENGTH_LONG).show()
        }
    }
}
7)hello world
<TextView
        android:id="@+id/textView3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:inputType="textPersonName"
        android:minHeight="48dp"
        android:textAllCaps="true"
        android:textColor="#289428"
        android:text="MAD LAB"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.5" />
8)implicit intent
//implicit
        val url = "https://www.google.com"
        val implicitButton : FloatingActionButton = findViewById(R.id.floatingActionButton)
        implicitButton.setOnClickListener{
            val implicitIntent =Intent(Intent.ACTION_VIEW, Uri.parse(url))
            startActivity(implicitIntent)
        }
    }
}
9)login module
setContentView(R.layout.activity_main)
 
        userET = findViewById(R.id.editTextText3)
        passET = findViewById(R.id.editTextText4)
        loginBtn =findViewById(R.id.button3)
        loginBtn.setOnClickListener {
 
            if(userET.text.toString()=="cvr" && passET.text.toString()=="cvr123")
            {
                val intent= Intent(this,MainActivity2::class.java)
                intent.putExtra("Username",userET.text.toString())
                intent.putExtra("Password",passET.text.toString())
                startActivity(intent)
                Toast.makeText(this,"login success",Toast.LENGTH_LONG).show()
            }
            else
            {
                Toast.makeText(this,"error login ",Toast.LENGTH_LONG).show()
            }
        }
 
 
 
    }
}
ActivityMain.kt: 
package com.example.quizapp 
 
import androidx.appcompat.app.AppCompatActivity 
import android.os.Bundle 
 
class MainActivity : AppCompatActivity() { 
    override fun onCreate(savedInstanceState: Bundle?) { 
        super.onCreate(savedInstanceState) 
        setContentView(R.layout.activity_main) 
 
    } 
    companion object{ 
        var count:Int=0 
    } 
} 
main_activity: 
<?xml version="1.0" encoding="utf-8"?> 
<androidx.constraintlayout.widget.ConstraintLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context=".MainActivity"> 
 
    <androidx.fragment.app.FragmentContainerView 
        android:id="@+id/fragmentContainerView" 
        android:name="androidx.navigation.fragment.NavHostFragment" 
        android:layout_width="409dp" 
        android:layout_height="729dp" 
        app:defaultNavHost="true" 
        app:layout_constraintBottom_toBottomOf="parent" 
        app:layout_constraintEnd_toEndOf="parent" 
        app:layout_constraintStart_toStartOf="parent" 
        app:layout_constraintTop_toTopOf="parent" 
        app:navGraph="@navigation/navgraph" /> 
</androidx.constraintlayout.widget.ConstraintLayout> 
win.kt: 
package com.example.quizapp 
 
import android.os.Bundle 
import androidx.fragment.app.Fragment 
import android.view.LayoutInflater 
import android.view.View 
import android.view.ViewGroup 
import android.widget.Button 
import android.widget.TextView 
import androidx.navigation.Navigation 
 
private const val ARG_PARAM1 = "param1" 
private const val ARG_PARAM2 = "param2" 
 
class win : Fragment() { 
    // TODO: Rename and change types of parameters 
    private var param1: String? = null 
    private var param2: String? = null 
 
    override fun onCreate(savedInstanceState: Bundle?) { 
        super.onCreate(savedInstanceState) 
        arguments?.let { 
            param1 = it.getString(ARG_PARAM1) 
            param2 = it.getString(ARG_PARAM2) 
        } 
    } 
 
    override fun onCreateView( 
        inflater: LayoutInflater, container: ViewGroup?, 
        savedInstanceState: Bundle? 
    ): View? { 
        var view:View=inflater.inflate(R.layout.fragment_win, container, false) 
        var tv:TextView=view.findViewById(R.id.textView) 
        var btn:Button=view.findViewById(R.id.next) 
        if(MainActivity.count==4) 
            tv.text="Congratulations you won the quiz \n score : "+MainActivity.count 
        else 
            tv.text="" 
        btn.setOnClickListener{ 
            tv.text="" 
            MainActivity.count=0 
            Navigation.findNavController(view).navigate(R.id.action_win2_to_quest1) 
        } 
        return view 
    } 
 
    companion object { 
                @JvmStatic 
        fun newInstance(param1: String, param2: String) = 
            win().apply { 
                arguments = Bundle().apply { 
                    putString(ARG_PARAM1, param1) 
                    putString(ARG_PARAM2, param2) 
                } 
            } 
    } 
} 
fragment_win.xml: 
<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context=".win"> 
 
    <androidx.constraintlayout.widget.ConstraintLayout 
        android:layout_width="match_parent" 
        android:layout_height="match_parent"> 
 
        <Button 
            android:id="@+id/next" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:text="Start quiz" 
            app:layout_constraintBottom_toBottomOf="parent" 
            app:layout_constraintEnd_toEndOf="parent" 
            app:layout_constraintStart_toStartOf="parent" 
            app:layout_constraintTop_toTopOf="parent" 
            app:layout_constraintVertical_bias="0.314" /> 
 
        <TextView 
            android:id="@+id/textView" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:textColor="#000000" 
            android:textSize="28dp" 
            app:layout_constraintBottom_toBottomOf="parent" 
            app:layout_constraintEnd_toEndOf="parent" 
            app:layout_constraintHorizontal_bias="0.498" 
            app:layout_constraintStart_toStartOf="parent" 
            app:layout_constraintTop_toTopOf="parent" 
            app:layout_constraintVertical_bias="0.593" /> 
 
    </androidx.constraintlayout.widget.ConstraintLayout> 
 
</FrameLayout> 
lose.kt: 
package com.example.quizapp 
 
import android.os.Bundle 
import androidx.fragment.app.Fragment 
import android.view.LayoutInflater 
import android.view.View 
import android.view.ViewGroup 
import android.widget.Button 
import androidx.navigation.Navigation 
 
// TODO: Rename parameter arguments, choose names that match 
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER 
private const val ARG_PARAM1 = "param1" 
private const val ARG_PARAM2 = "param2" 
 
class lose : Fragment() { 
    // TODO: Rename and change types of parameters 
    private var param1: String? = null 
    private var param2: String? = null 
 
    override fun onCreate(savedInstanceState: Bundle?) { 
        super.onCreate(savedInstanceState) 
        arguments?.let { 
            param1 = it.getString(ARG_PARAM1) 
            param2 = it.getString(ARG_PARAM2) 
        } 
    } 
 
    override fun onCreateView( 
        inflater: LayoutInflater, container: ViewGroup?, 
        savedInstanceState: Bundle? 
    ): View? { 
 
        var view:View= inflater.inflate(R.layout.fragment_lose, container, false) 
        var btn:Button=view.findViewById(R.id.next) 
        btn.setOnClickListener { 
            Navigation.findNavController(view).navigate(R.id.action_lose_to_win2) 
 
        } 
        return view 
    } 
 
    companion object { 
        @JvmStatic 
        fun newInstance(param1: String, param2: String) = 
            lose().apply { 
                arguments = Bundle().apply { 
                    putString(ARG_PARAM1, param1) 
                    putString(ARG_PARAM2, param2) 
                } 
            } 
    } 
} 
fragment_lose.xml: 
<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context=".lose"> 
 
    <androidx.constraintlayout.widget.ConstraintLayout 
        android:layout_width="match_parent" 
        android:layout_height="match_parent"> 
 
        <Button 
            android:id="@+id/next" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:text="Try again" 
            app:layout_constraintBottom_toBottomOf="parent" 
            app:layout_constraintEnd_toEndOf="parent" 
            app:layout_constraintHorizontal_bias="0.498" 
            app:layout_constraintStart_toStartOf="parent" 
            app:layout_constraintTop_toBottomOf="@+id/textView" 
            app:layout_constraintVertical_bias="0.5" /> 
 
        <TextView 
            android:id="@+id/textView" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:text="Sorry you lost the quiz" 
            android:textColor="#000000" 
            android:textSize="28dp" 
            app:layout_constraintBottom_toBottomOf="parent" 
            app:layout_constraintEnd_toEndOf="parent" 
            app:layout_constraintStart_toStartOf="parent" 
            app:layout_constraintTop_toTopOf="parent" 
            app:layout_constraintVertical_bias="0.357" /> 
 
    </androidx.constraintlayout.widget.ConstraintLayout> 
</FrameLayout> 
quest1.kt: 
package com.example.quizapp 
 
import android.os.Bundle 
import android.provider.MediaStore.Audio.Radio 
import androidx.fragment.app.Fragment 
import android.view.LayoutInflater 
import android.view.View 
import android.view.ViewGroup 
import android.widget.Button 
import android.widget.RadioGroup 
import androidx.lifecycle.findViewTreeViewModelStoreOwner 
import androidx.navigation.Navigation 
 
// TODO: Rename parameter arguments, choose names that match 
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER 
private const val ARG_PARAM1 = "param1" 
private const val ARG_PARAM2 = "param2" 
 
class quest1 : Fragment() { 
    // TODO: Rename and change types of parameters 
    private var param1: String? = null 
    private var param2: String? = null 
 
    override fun onCreate(savedInstanceState: Bundle?) { 
        super.onCreate(savedInstanceState) 
        arguments?.let { 
            param1 = it.getString(ARG_PARAM1) 
            param2 = it.getString(ARG_PARAM2) 
        } 
    } 
 
    override fun onCreateView( 
        inflater: LayoutInflater, container: ViewGroup?, 
        savedInstanceState: Bundle? 
    ): View? { 
        var view:View= inflater.inflate(R.layout.fragment_quest1, container, false) 
        var btn:Button=view.findViewById(R.id.next) 
        var rg:RadioGroup=view.findViewById(R.id.radioGroup) 
        btn.setOnClickListener{ 
            if(rg.checkedRadioButtonId==R.id.radio1) 
                MainActivity.count++ 
            Navigation.findNavController(view).navigate(R.id.action_quest1_to_quest2) 
        } 
        return view 
    } 
 
    companion object { 
        @JvmStatic 
        fun newInstance(param1: String, param2: String) = 
            quest1().apply { 
                arguments = Bundle().apply { 
                    putString(ARG_PARAM1, param1) 
                    putString(ARG_PARAM2, param2) 
                } 
            } 
    } 
} 
fragment_quest1.xml: 
<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context=".quest1"> 
 
    <androidx.constraintlayout.widget.ConstraintLayout 
        android:layout_width="match_parent" 
        android:layout_height="match_parent"> 
 
        <TextView 
            android:id="@+id/textView" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:text="welcome to quiz" 
            android:textColor="#000000" 
            android:textSize="28dp" 
            app:layout_constraintBottom_toBottomOf="parent" 
            app:layout_constraintEnd_toEndOf="parent" 
            app:layout_constraintStart_toStartOf="parent" 
            app:layout_constraintTop_toTopOf="parent" 
            app:layout_constraintVertical_bias="0.059" /> 
 
        <TextView 
            android:id="@+id/quest" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:text="Quest1 : who is chiranjeevi" 
            android:textColor="#000000" 
            android:textSize="28dp" 
            app:layout_constraintBottom_toBottomOf="parent" 
            app:layout_constraintEnd_toEndOf="parent" 
            app:layout_constraintStart_toStartOf="parent" 
            app:layout_constraintTop_toTopOf="parent" 
            app:layout_constraintVertical_bias="0.18" /> 
 
        <RadioGroup 
            android:id="@+id/radioGroup" 
            android:layout_width="180dp" 
            android:layout_height="wrap_content" 
            app:layout_constraintBottom_toBottomOf="parent" 
            app:layout_constraintEnd_toEndOf="parent" 
            app:layout_constraintHorizontal_bias="0.168" 
            app:layout_constraintStart_toStartOf="parent" 
            app:layout_constraintTop_toBottomOf="@+id/quest" 
            app:layout_constraintVertical_bias="0.114"> 
 
            <RadioButton 
                android:id="@+id/radio1" 
                android:layout_width="match_parent" 
                android:layout_height="wrap_content" 
                android:text="actor" /> 
 
            <RadioButton 
                android:id="@+id/radio2" 
                android:layout_width="match_parent" 
                android:layout_height="wrap_content" 
                android:text="cricketer" /> 
 
            <RadioButton 
                android:id="@+id/radio3" 
                android:layout_width="match_parent" 
                android:layout_height="wrap_content" 
                android:text="comedian" /> 
 
            <RadioButton 
                android:id="@+id/radio4" 
                android:layout_width="match_parent" 
                android:layout_height="wrap_content" 
                android:text="Prime minister" 
                app:layout_constraintBottom_toBottomOf="parent" 
                app:layout_constraintTop_toTopOf="parent" /> 
        </RadioGroup> 
 
        <Button 
            android:id="@+id/next" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:text="next" 
            app:layout_constraintBottom_toBottomOf="parent" 
            app:layout_constraintEnd_toEndOf="parent" 
            app:layout_constraintHorizontal_bias="0.498" 
            app:layout_constraintStart_toStartOf="parent" 
            app:layout_constraintTop_toBottomOf="@+id/radioGroup" 
            app:layout_constraintVertical_bias="0.361" /> 
    </androidx.constraintlayout.widget.ConstraintLayout> 
</FrameLayout> 
quest2.kt: 
package com.example.quizapp 
 
import android.os.Bundle 
import androidx.fragment.app.Fragment 
import android.view.LayoutInflater 
import android.view.View 
import android.view.ViewGroup 
import android.widget.Button 
import android.widget.RadioGroup 
import androidx.navigation.Navigation 
 
// TODO: Rename parameter arguments, choose names that match 
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER 
private const val ARG_PARAM1 = "param1" 
private const val ARG_PARAM2 = "param2" 
 
/** 
 * A simple [Fragment] subclass. 
 * Use the [quest2.newInstance] factory method to 
 * create an instance of this fragment. 
 */ 
class quest2 : Fragment() { 
    // TODO: Rename and change types of parameters 
    private var param1: String? = null 
    private var param2: String? = null 
 
    override fun onCreate(savedInstanceState: Bundle?) { 
        super.onCreate(savedInstanceState) 
        arguments?.let { 
            param1 = it.getString(ARG_PARAM1) 
            param2 = it.getString(ARG_PARAM2) 
        } 
    } 
 
    override fun onCreateView( 
        inflater: LayoutInflater, container: ViewGroup?, 
        savedInstanceState: Bundle? 
    ): View? { 
        // Inflate the layout for this fragment 
        var view:View=inflater.inflate(R.layout.fragment_quest2, container, false) 
        var btn: Button =view.findViewById(R.id.next) 
        var rg: RadioGroup =view.findViewById(R.id.radioGroup) 
        btn.setOnClickListener{ 
            if(rg.checkedRadioButtonId==R.id.radio2) 
                MainActivity.count++ 
            Navigation.findNavController(view).navigate(R.id.action_quest2_to_quest3) 
        } 
        return view 
    } 
 
    companion object { 
        /** 
         * Use this factory method to create a new instance of 
         * this fragment using the provided parameters. 
         * 
         * @param param1 Parameter 1. 
         * @param param2 Parameter 2. 
         * @return A new instance of fragment quest2. 
         */ 
        // TODO: Rename and change types and number of parameters 
        @JvmStatic 
        fun newInstance(param1: String, param2: String) = 
            quest2().apply { 
                arguments = Bundle().apply { 
                    putString(ARG_PARAM1, param1) 
                    putString(ARG_PARAM2, param2) 
                } 
            } 
    } 
} 
fragment_quest2.xml: 
<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context=".quest2"> 
 
    <androidx.constraintlayout.widget.ConstraintLayout 
        android:layout_width="match_parent" 
        android:layout_height="match_parent"> 
 
        <TextView 
            android:id="@+id/quest" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:text="Quest2 : who is virat Kohli" 
            android:textColor="#000000" 
            android:textSize="28dp" 
            app:layout_constraintBottom_toBottomOf="parent" 
            app:layout_constraintEnd_toEndOf="parent" 
            app:layout_constraintStart_toStartOf="parent" 
            app:layout_constraintTop_toTopOf="parent" 
            app:layout_constraintVertical_bias="0.18" /> 
 
        <RadioGroup 
            android:id="@+id/radioGroup" 
            android:layout_width="180dp" 
            android:layout_height="wrap_content" 
            app:layout_constraintBottom_toBottomOf="parent" 
            app:layout_constraintEnd_toEndOf="parent" 
            app:layout_constraintHorizontal_bias="0.168" 
            app:layout_constraintStart_toStartOf="parent" 
            app:layout_constraintTop_toBottomOf="@+id/quest" 
            app:layout_constraintVertical_bias="0.114"> 
 
            <RadioButton 
                android:id="@+id/radio1" 
                android:layout_width="match_parent" 
                android:layout_height="wrap_content" 
                android:text="actor" /> 
 
            <RadioButton 
                android:id="@+id/radio2" 
                android:layout_width="match_parent" 
                android:layout_height="wrap_content" 
                android:text="cricketer" /> 
 
            <RadioButton 
                android:id="@+id/radio3" 
                android:layout_width="match_parent" 
                android:layout_height="wrap_content" 
                android:text="comedian" /> 
 
            <RadioButton 
                android:id="@+id/radio4" 
                android:layout_width="match_parent" 
                android:layout_height="wrap_content" 
                android:text="Prime minister" 
                app:layout_constraintBottom_toBottomOf="parent" 
                app:layout_constraintTop_toTopOf="parent" /> 
        </RadioGroup> 
 
        <Button 
            android:id="@+id/next" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:text="next" 
            app:layout_constraintBottom_toBottomOf="parent" 
            app:layout_constraintEnd_toEndOf="parent" 
            app:layout_constraintHorizontal_bias="0.498" 
            app:layout_constraintStart_toStartOf="parent" 
            app:layout_constraintTop_toBottomOf="@+id/radioGroup" 
            app:layout_constraintVertical_bias="0.361" /> 
    </androidx.constraintlayout.widget.ConstraintLayout> 
 
</FrameLayout> 
 
quest3.kt: 
package com.example.quizapp 
 
import android.os.Bundle 
import androidx.fragment.app.Fragment 
import android.view.LayoutInflater 
import android.view.View 
import android.view.ViewGroup 
import android.widget.Button 
import android.widget.RadioGroup 
import androidx.navigation.Navigation 
 
// TODO: Rename parameter arguments, choose names that match 
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER 
private const val ARG_PARAM1 = "param1" 
private const val ARG_PARAM2 = "param2" 
 
/** 
 * A simple [Fragment] subclass. 
 * Use the [quest3.newInstance] factory method to 
 * create an instance of this fragment. 
 */ 
class quest3 : Fragment() { 
    // TODO: Rename and change types of parameters 
    private var param1: String? = null 
    private var param2: String? = null 
 
    override fun onCreate(savedInstanceState: Bundle?) { 
        super.onCreate(savedInstanceState) 
        arguments?.let { 
            param1 = it.getString(ARG_PARAM1) 
            param2 = it.getString(ARG_PARAM2) 
        } 
    } 
 
    override fun onCreateView( 
        inflater: LayoutInflater, container: ViewGroup?, 
        savedInstanceState: Bundle? 
    ): View? { 
        // Inflate the layout for this fragment 
        var view:View= inflater.inflate(R.layout.fragment_quest3, container, false) 
        var btn: Button =view.findViewById(R.id.next) 
        var rg: RadioGroup =view.findViewById(R.id.radioGroup) 
        btn.setOnClickListener{ 
            if(rg.checkedRadioButtonId==R.id.radio3) 
                MainActivity.count++ 
            Navigation.findNavController(view).navigate(R.id.action_quest3_to_quest4) 
        } 
        return view 
    } 
 
    companion object { 
        /** 
         * Use this factory method to create a new instance of 
         * this fragment using the provided parameters. 
         * 
         * @param param1 Parameter 1. 
         * @param param2 Parameter 2. 
         * @return A new instance of fragment quest3. 
         */ 
        // TODO: Rename and change types and number of parameters 
        @JvmStatic 
        fun newInstance(param1: String, param2: String) = 
            quest3().apply { 
                arguments = Bundle().apply { 
                    putString(ARG_PARAM1, param1) 
                    putString(ARG_PARAM2, param2) 
                } 
            } 
    } 
} 
fragment_quest3.xml: 
<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context=".quest3"> 
 
    <androidx.constraintlayout.widget.ConstraintLayout 
        android:layout_width="match_parent" 
        android:layout_height="match_parent"> 
 
 
        <TextView 
            android:id="@+id/quest" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:text="Quest3 : who is bramhanandham" 
            android:textColor="#000000" 
            android:textSize="28dp" 
            app:layout_constraintBottom_toBottomOf="parent" 
            app:layout_constraintEnd_toEndOf="parent" 
            app:layout_constraintStart_toStartOf="parent" 
            app:layout_constraintTop_toTopOf="parent" 
            app:layout_constraintVertical_bias="0.18" /> 
 
        <RadioGroup 
            android:id="@+id/radioGroup" 
            android:layout_width="180dp" 
            android:layout_height="wrap_content" 
            app:layout_constraintBottom_toBottomOf="parent" 
            app:layout_constraintEnd_toEndOf="parent" 
            app:layout_constraintHorizontal_bias="0.168" 
            app:layout_constraintStart_toStartOf="parent" 
            app:layout_constraintTop_toBottomOf="@+id/quest" 
            app:layout_constraintVertical_bias="0.114"> 
 
            <RadioButton 
                android:id="@+id/radio1" 
                android:layout_width="match_parent" 
                android:layout_height="wrap_content" 
                android:text="actor" /> 
 
            <RadioButton 
                android:id="@+id/radio2" 
                android:layout_width="match_parent" 
                android:layout_height="wrap_content" 
                android:text="cricketer" /> 
 
            <RadioButton 
                android:id="@+id/radio3" 
                android:layout_width="match_parent" 
                android:layout_height="wrap_content" 
                android:text="comedian" /> 
 
            <RadioButton 
                android:id="@+id/radio4" 
                android:layout_width="match_parent" 
                android:layout_height="wrap_content" 
                android:text="Prime minister" 
                app:layout_constraintBottom_toBottomOf="parent" 
                app:layout_constraintTop_toTopOf="parent" /> 
        </RadioGroup> 
 
        <Button 
            android:id="@+id/next" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:text="next" 
            app:layout_constraintBottom_toBottomOf="parent" 
            app:layout_constraintEnd_toEndOf="parent" 
            app:layout_constraintHorizontal_bias="0.498" 
            app:layout_constraintStart_toStartOf="parent" 
            app:layout_constraintTop_toBottomOf="@+id/radioGroup" 
            app:layout_constraintVertical_bias="0.361" /> 
    </androidx.constraintlayout.widget.ConstraintLayout> 
 
</FrameLayout> 
quest4.kt: 
package com.example.quizapp 
 
import android.os.Bundle 
import androidx.fragment.app.Fragment 
import android.view.LayoutInflater 
import android.view.View 
import android.view.ViewGroup 
import android.widget.Button 
import android.widget.RadioGroup 
import androidx.navigation.Navigation 
 
// TODO: Rename parameter arguments, choose names that match 
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER 
private const val ARG_PARAM1 = "param1" 
private const val ARG_PARAM2 = "param2" 
 
/** 
 * A simple [Fragment] subclass. 
 * Use the [quest4.newInstance] factory method to 
 * create an instance of this fragment. 
 */ 
class quest4 : Fragment() { 
    // TODO: Rename and change types of parameters 
    private var param1: String? = null 
    private var param2: String? = null 
 
    override fun onCreate(savedInstanceState: Bundle?) { 
        super.onCreate(savedInstanceState) 
        arguments?.let { 
            param1 = it.getString(ARG_PARAM1) 
            param2 = it.getString(ARG_PARAM2) 
        } 
    } 
 
    override fun onCreateView( 
        inflater: LayoutInflater, container: ViewGroup?, 
        savedInstanceState: Bundle? 
    ): View? { 
        // Inflate the layout for this fragment 
        var view:View= inflater.inflate(R.layout.fragment_quest4, container, false) 
        var btn: Button =view.findViewById(R.id.next) 
        var rg: RadioGroup =view.findViewById(R.id.radioGroup) 
        btn.setOnClickListener{ 
            if(rg.checkedRadioButtonId==R.id.radio4) 
                MainActivity.count++ 
            if(MainActivity.count==4) 
                Navigation.findNavController(view).navigate(R.id.action_quest4_to_win2) 
            else 
                Navigation.findNavController(view).navigate(R.id.action_quest4_to_lose) 
        } 
        return view 
    } 
 
    companion object { 
        /** 
         * Use this factory method to create a new instance of 
         * this fragment using the provided parameters. 
         * 
         * @param param1 Parameter 1. 
         * @param param2 Parameter 2. 
         * @return A new instance of fragment quest4. 
         */ 
        // TODO: Rename and change types and number of parameters 
        @JvmStatic 
        fun newInstance(param1: String, param2: String) = 
            quest4().apply { 
                arguments = Bundle().apply { 
                    putString(ARG_PARAM1, param1) 
                    putString(ARG_PARAM2, param2) 
                } 
            } 
    } 
} 
fragment_quest4.xml: 
<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context=".quest4"> 
 
    <androidx.constraintlayout.widget.ConstraintLayout 
        android:layout_width="match_parent" 
        android:layout_height="match_parent"> 
 
 
        <TextView 
            android:id="@+id/quest" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:text="Quest4 : who is narendra modi" 
            android:textColor="#000000" 
            android:textSize="28dp" 
            app:layout_constraintBottom_toBottomOf="parent" 
            app:layout_constraintEnd_toEndOf="parent" 
            app:layout_constraintStart_toStartOf="parent" 
            app:layout_constraintTop_toTopOf="parent" 
            app:layout_constraintVertical_bias="0.18" /> 
 
        <RadioGroup 
            android:id="@+id/radioGroup" 
            android:layout_width="180dp" 
            android:layout_height="wrap_content" 
            app:layout_constraintBottom_toBottomOf="parent" 
            app:layout_constraintEnd_toEndOf="parent" 
            app:layout_constraintHorizontal_bias="0.168" 
            app:layout_constraintStart_toStartOf="parent" 
            app:layout_constraintTop_toBottomOf="@+id/quest" 
            app:layout_constraintVertical_bias="0.114"> 
 
            <RadioButton 
                android:id="@+id/radio1" 
                android:layout_width="match_parent" 
                android:layout_height="wrap_content" 
                android:text="actor" /> 
 
            <RadioButton 
                android:id="@+id/radio2" 
                android:layout_width="match_parent" 
                android:layout_height="wrap_content" 
                android:text="cricketer" /> 
 
            <RadioButton 
                android:id="@+id/radio3" 
                android:layout_width="match_parent" 
                android:layout_height="wrap_content" 
                android:text="comedian" /> 
 
            <RadioButton 
                android:id="@+id/radio4" 
                android:layout_width="match_parent" 
                android:layout_height="wrap_content" 
                android:text="Prime minister" 
                app:layout_constraintBottom_toBottomOf="parent" 
                app:layout_constraintTop_toTopOf="parent" /> 
        </RadioGroup> 
 
        <Button 
            android:id="@+id/next" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:text="submit" 
            app:layout_constraintBottom_toBottomOf="parent" 
            app:layout_constraintEnd_toEndOf="parent" 
            app:layout_constraintHorizontal_bias="0.498" 
            app:layout_constraintStart_toStartOf="parent" 
            app:layout_constraintTop_toBottomOf="@+id/radioGroup" 
            app:layout_constraintVertical_bias="0.361" /> 
    </androidx.constraintlayout.widget.ConstraintLayout> 
 
</FrameLayout> 
Navgraph: 
fragment_win: 
fragment_lose: 
fragment_quest1: 
fragment_quest2: 
fragment_quest3: 
fragment_quest4: 
PROCEDURE TO FOLLOW IN NAVIGATION USING FRAGMENTS APP 
1) Create empty Activity 
2) Create layout folder and add “activity_main.xml” file in it 
3) How to create Navigation folder and navigation graph: 
i) 
Add dependencies in build.gradle file 
implementation("androidx.constraintlayout:constraintlayout-compose:1.0.0
alpha08") 
implementation("androidx.navigation:navigation-fragment-ktx:2.3.5") 
implementation("androidx.navigation:navigation-ui-ktx:2.3.5") 
implementation("androidx.navigation:navigation-dynamic-features
fragment:2.3.5") 
ii) 
iii) 
Create navigation folder and add nav_graph.xml in it 
Create “new destination” in nav_graph.xml then select 2 blank fragments and 
name it as “HomeFragment” and “DataFragment” 
4) Add the following steps in activity_main.xml: 
i) 
Add constraint layout 
ii) 
Drag and drop fragment container view and select “HomeFragment.kt” 
add:navGraph=”@navigation/nav_graph” 
5) Add the following steps in HomeFragment in xml: 
i) 
Add Constraint View 
ii) 
iii) 
Add Text View 
Add Button  
6) Add the following steps in DataFragment in xml: 
i) 
Add Constraint View 
ii) 
iii) 
Add Text View 
Add Button 
MainActivity:
package com.example.myapp

import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_main)

    }
}
activity_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <androidx.fragment.app.FragmentContainerView
        android:id="@+id/fragmentContainerView"
        android:name="androidx.navigation.fragment.NavHostFragment"
        android:layout_width="409dp"
        android:layout_height="729dp"
        app:defaultNavHost="true"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.5"
        app:navGraph="@navigation/nav_graph" />

</androidx.constraintlayout.widget.ConstraintLayout>
nav_graph.xml:
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/nav_graph"
    app:startDestination="@id/homeFragment">

    <fragment
        android:id="@+id/homeFragment"
        android:name="com.example.myapp.homeFragment"
        android:label="fragment_home"
        tools:layout="@layout/fragment_home" >
        <action
            android:id="@+id/action_homeFragment_to_dataFragment"
            app:destination="@id/dataFragment" />
    </fragment>
    <fragment
        android:id="@+id/dataFragment"
        android:name="com.example.myapp.dataFragment"
        android:label="fragment_data"
        tools:layout="@layout/fragment_data" >
        <action
            android:id="@+id/action_dataFragment_to_homeFragment"
            app:destination="@id/homeFragment" />
    </fragment>
</navigation>
HomeFragment.kt:
package com.example.myapp

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import androidx.navigation.Navigation

// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private const val ARG_PARAM1 = "param1"
private const val ARG_PARAM2 = "param2"

/**
 * A simple [Fragment] subclass.
 * Use the [homeFragment.newInstance] factory method to
 * create an instance of this fragment.
 */
class homeFragment : Fragment() {
    // TODO: Rename and change types of parameters
    private var param1: String? = null
    private var param2: String? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        arguments?.let {
            param1 = it.getString(ARG_PARAM1)
            param2 = it.getString(ARG_PARAM2)
        }
    }

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View {
        // Inflate the layout for this fragment
        val view:View=inflater.inflate(R.layout.fragment_home, container, false)
        val btn:Button=view.findViewById(R.id.button)
        btn.setOnClickListener {
            Navigation.findNavController(view).navigate(R.id.action_homeFragment_to_dataFragment)
        }
        return view
    }

    companion object {
        /**
         * Use this factory method to create a new instance of
         * this fragment using the provided parameters.
         *
         * @param param1 Parameter 1.
         * @param param2 Parameter 2.
         * @return A new instance of fragment homeFragment.
         */
        // TODO: Rename and change types and number of parameters
        @JvmStatic
        fun newInstance(param1: String, param2: String) =
            homeFragment().apply {
                arguments = Bundle().apply {
                    putString(ARG_PARAM1, param1)
                    putString(ARG_PARAM2, param2)
                }
            }
    }
}

fragment_home.xml:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".homeFragment">
    <!-- TODO: Update blank fragment layout -->
    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <TextView
            android:id="@+id/textView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="home fragment"
            android:textSize="24sp"
            app:layout_constraintBottom_toTopOf="@+id/button"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.5"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.5" />

        <Button
            android:id="@+id/button"
            android:layout_width="125dp"
            android:layout_height="69dp"
            android:text="Button"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.5"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/textView"
            app:layout_constraintVertical_bias="0.5" />
    </androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

DataFragment.kt:
package com.example.myapp

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import androidx.navigation.Navigation

// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private const val ARG_PARAM1 = "param1"
private const val ARG_PARAM2 = "param2"

/**
 * A simple [Fragment] subclass.
 * Use the [dataFragment.newInstance] factory method to
 * create an instance of this fragment.
 */
class dataFragment : Fragment() {
    // TODO: Rename and change types of parameters
    private var param1: String? = null
    private var param2: String? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        arguments?.let {
            param1 = it.getString(ARG_PARAM1)
            param2 = it.getString(ARG_PARAM2)
        }
    }

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        // Inflate the layout for this fragment
        val view: View = inflater.inflate(R.layout.fragment_data, container, false)
        val btn: Button = view.findViewById(R.id.button2)
        btn.setOnClickListener() {
            Navigation.findNavController(view).navigate(R.id.action_dataFragment_to_homeFragment)
        }
        return view
    }

    companion object {
        /**
         * Use this factory method to create a new instance of
         * this fragment using the provided parameters.
         *
         * @param param1 Parameter 1.
         * @param param2 Parameter 2.
         * @return A new instance of fragment dataFragment.
         */
        // TODO: Rename and change types and number of parameters
        @JvmStatic
        fun newInstance(param1: String, param2: String) =
            dataFragment().apply {
                arguments = Bundle().apply {
                    putString(ARG_PARAM1, param1)
                    putString(ARG_PARAM2, param2)
                }
            }
    }
}

fragment_data.xml:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".dataFragment">

    <!-- TODO: Update blank fragment layout -->


    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <TextView
            android:id="@+id/textView2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="data fragment"
            android:textSize="24sp"
            app:layout_constraintBottom_toTopOf="@+id/button2"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.5"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.5" />

        <Button
            android:id="@+id/button2"
            android:layout_width="124dp"
            android:layout_height="51dp"
            android:text="Button"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.5"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/textView2"
            app:layout_constraintVertical_bias="0.5" />
    </androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

Builde kartle:
plugins {
    alias(libs.plugins.android.application)
    alias(libs.plugins.jetbrains.kotlin.android)
}

android {
    namespace = "com.example.myapp"
    compileSdk = 35

    defaultConfig {
        applicationId = "com.example.myapp"
        minSdk = 24
        targetSdk = 34
        versionCode = 1
        versionName = "1.0"

        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            isMinifyEnabled = false
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = "1.8"
    }
}

dependencies {

    implementation(libs.androidx.core.ktx)
    implementation(libs.androidx.appcompat)
    implementation(libs.material)
    implementation(libs.androidx.activity)
    implementation(libs.androidx.constraintlayout)
    implementation(libs.androidx.navigation.fragment.ktx)
    implementation(libs.androidx.navigation.ui.ktx)

    implementation("androidx.navigation:navigation-fragment-ktx:2.8.1")
    implementation("androidx.navigation:navigation-ui-ktx:2.8.1")
    implementation("androidx.navigation:navigation-dynamic-features-fragment:2.8.1")

    testImplementation(libs.junit)
    androidTestImplementation(libs.androidx.junit)
    androidTestImplementation(libs.androidx.espresso.core)
}
#include<stdio.h>
#include<string.h>

int main(){
    int n,i,j,c=0,count=0;
    char str[100]; 
    printf("Enter the string: ");
    scanf("%s", str); 

    printf("Enter the number of frames:");
    scanf("%d",&n);
    int frames[n];

    printf("Enter the frame size of the frames:\n");
    for(int i=0;i<n;i++){
        printf("Frame %d:",i);
        scanf("%d",&frames[i]);
    }

    printf("\nThe number of frames:%d\n",n);
    c = 0;
    for(int i=0;i<n;i++){
        printf("The content of the frame %d:",i);
        j=0;
        count = 0; 
        while(c < strlen(str) && j < frames[i]){
            printf("%c",str[c]);
            if(str[c]!='\0'){
                count++;
            }
            c=c+1;
            j=j+1;
        }
        printf("\nSize of frame %d: %d\n\n",i,count);
    }
    return 0;
}
import java.sql.*;
import java.util.Scanner;

public class BookDatabaseApp {

    private static final String URL = "jdbc:mysql://localhost:3306/books";
    private static final String USER = "root";
    private static final String PASSWORD = "ramesh";

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.println("Enter Book ID: ");
        int id = scanner.nextInt();
        scanner.nextLine();

        System.out.println("Enter Book Title: ");
        String title = scanner.nextLine();

        System.out.println("Enter Book Author: ");
        String author = scanner.nextLine();

        System.out.println("Enter Book Publisher: ");
        String publisher = scanner.nextLine();

        System.out.println("Enter Book Price: ");
        double price = scanner.nextDouble();

        insertBook(id, title, author, publisher, price);
        scanner.close();
    }

    public static void insertBook(int id, String title, String author, String publisher, double price) {
        try (Connection conn = DriverManager.getConnection(URL, USER, PASSWORD);
             PreparedStatement pstmt = conn.prepareStatement("INSERT INTO book (id, title, author, publisher, price) VALUES (?, ?, ?, ?, ?)")) {
            pstmt.setInt(1, id);
            pstmt.setString(2, title);
            pstmt.setString(3, author);
            pstmt.setString(4, publisher);
            pstmt.setDouble(5, price);
            System.out.println(pstmt.executeUpdate() + " row(s) inserted.");
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
import java.io.File;

import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;

public class SAXValidator {
    public static void main(String[] args) {

        String xmlFilePath = "C:\\Users\\91630\\OneDrive\\Desktop\\Web_technologies_lab\\Book\\book.xml";
        String xsdFilePath = "C:\\Users\\91630\\OneDrive\\Desktop\\Web_technologies_lab\\Book\\book.xsd";

        File xmlFile = new File(xmlFilePath);
        File xsdFile = new File(xsdFilePath);

        try {

            SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
            Schema schema = schemaFactory.newSchema(xsdFile);

            SAXParserFactory saxFactory = SAXParserFactory.newInstance();
            saxFactory.setSchema(schema);

            SAXParser parser = saxFactory.newSAXParser();
            parser.parse(xmlFile, new DefaultHandler() {
                @Override
                public void error(SAXParseException e) {
                    System.out.println("Validation Error: " + e.getMessage());
                }
            });
            System.out.println("XML file is valid according to the schema.");
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = factory.newDocumentBuilder();
            org.w3c.dom.Document document = builder.parse(xmlFile);
            NodeList nodeList = document.getElementsByTagName("book");
            for (int i = 0; i < nodeList.getLength(); i++) {
                Node node = nodeList.item(i);
                System.out.println("Element Content: " + node.getTextContent());
            }
        } catch (Exception e) {

            System.out.println("Validation error: " + e.getMessage());
        }
    }
}

book.xml

<?xml version="1.0" encoding="UTF-8"?>
<book>
    <Name>Arun</Name>
    <Roll>506</Roll>
</book>

book.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="book">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="Name" type="xsd:string"/>
                <xsd:element name="Roll" type="xsd:integer"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
</xsd:schema>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>jQuery Events Demo</title>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <style>
        /* CSS for styling buttons and message */
        body {
            font-family: Arial, sans-serif;
            margin: 20px;
        }
        
        button {
            padding: 10px 20px;
            font-size: 16px;
            margin: 10px;
            cursor: pointer;
        }

        #message {
            font-size: 20px;
            color: blue;
            margin-top: 20px;
        }

        input[type="text"] {
            padding: 10px;
            margin: 10px 0;
            font-size: 16px;
            width: 300px;
        }
    </style>
</head>
<body>

    <h1>jQuery Events Demo</h1>

    <button id="clickButton">Click Me</button>
    <button id="dblClickButton">Double Click Me</button>
    <button id="hoverButton">Hover Over Me</button>
    <input type="text" id="focusInput" placeholder="Click or focus here">
    
    <div id="message"></div>

    <script>
        // jQuery event demonstrations
        $(document).ready(function() {

            // Click event
            $('#clickButton').click(function() {
                $('#message').text('Button Clicked!').css('color', 'green');
            });

            // Double click event
            $('#dblClickButton').dblclick(function() {
                $('#message').text('Button Double Clicked!').css('color', 'purple');
            });

            // Hover event (mouseenter and mouseleave)
            $('#hoverButton').hover(
                function() {  // mouseenter
                    $('#message').text('Mouse Hovering!').css('color', 'orange');
                },
                function() {  // mouseleave
                    $('#message').text('Mouse Left!').css('color', 'blue');
                }
            );

            // Focus event on input field
            $('#focusInput').focus(function() {
                $(this).css('background-color', '#e0f7fa');  // Change background color on focus
                $('#message').text('Input Focused!').css('color', 'brown');
            });

            // Blur event (when the input field loses focus)
            $('#focusInput').blur(function() {
                $(this).css('background-color', 'white');  // Reset background color
                $('#message').text('Input Lost Focus!').css('color', 'red');
            });
        });
    </script>

</body>
</html>
import java.io.File;

import javax.xml.XMLConstants;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;

import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;

public class SAXValidator {
    public static void main(String[] args) {

        String xmlFilePath = "C:\\Users\\91630\\OneDrive\\Desktop\\Web_technologies_lab\\Book\\book.xml";
        String xsdFilePath = "C:\\Users\\91630\\OneDrive\\Desktop\\Web_technologies_lab\\Book\\book.xsd";

        File xmlFile = new File(xmlFilePath);
        File xsdFile = new File(xsdFilePath);

        try {

            SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
            Schema schema = schemaFactory.newSchema(xsdFile);

            SAXParserFactory saxFactory = SAXParserFactory.newInstance();
            saxFactory.setSchema(schema);

            SAXParser parser = saxFactory.newSAXParser();
            parser.parse(xmlFile, new DefaultHandler() {
                @Override
                public void error(SAXParseException e) {
                    System.out.println("Validation Error: " + e.getMessage());
                }
            });
            System.out.println("XML file is valid according to the schema.");

        } catch (Exception e) {

            System.out.println("Validation error: " + e.getMessage());
        }
    }
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>jQuery Selectors Demo</title>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <style>
        .highlight {
            background-color: yellow;
        }
        #message {
            font-size: 20px;
            color: blue;
        }
    </style>
</head>
<body>

    <h1>jQuery Selectors Demo</h1>

    <p>This is a <span class="highlight">simple</span> paragraph with some text.</p>
    <p id="first-paragraph">This is the first paragraph.</p>
    <p>This is the second paragraph.</p>

    <div id="container">
        <div class="box">Box 1</div>
        <div class="box">Box 2</div>
        <div class="box">Box 3</div>
    </div>

    <input type="text" placeholder="Text input">
    <input type="password" placeholder="Password input">
    <input type="button" value="Click me">

    <button id="showMessage">Click to Show Message</button>
    
    <div id="message"></div>

    <script>
        $(document).ready(function() {

            // Select by tag name
            $('p').css('color', 'green');  // All <p> elements will turn green

            // Select by class name
            $('.highlight').css('font-weight', 'bold');  // Highlights text within .highlight class

            // Select by ID
            $('#first-paragraph').css('font-size', '18px');  // Changes font size of #first-paragraph

            // Select by attribute
            $('[type="text"]').css('border', '2px solid red');  // Selects text input and adds a border

            // Select all children of a parent (box divs inside #container)
            $('#container .box').css('background-color', '#f0f0f0');  // Applies background to all .box elements inside #container

            // Select first element
            $('p:first').css('color', 'purple');  // First <p> element turns purple

            // Select last element
            $('p:last').css('color', 'orange');  // Last <p> element turns orange

            // Select hidden elements
            $('input[type="password"]').css('border', '2px dashed green');  // Highlight password input

            // Select multiple classes
            $('.box.highlight').css('border', '2px solid blue');  // Selects .box and .highlight elements

            // Demonstrate on button click
            $('#showMessage').click(function() {
                $('#message').text('You clicked the button!').fadeIn().css('color', 'red');
            });

        });
    </script>

</body>
</html>
import jakarta.servlet.*;
import jakarta.servlet.http.*;
import java.io.*;
import jakarta.servlet.annotation.*;

@WebServlet("/hitcounter")
public class HitCounterServlet extends HttpServlet {
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // Set the content type to HTML
        response.setContentType("text/html");

        // Get the writer to send the response
        PrintWriter out = response.getWriter();

        // Get the cookies from the request
        Cookie[] cookies = request.getCookies();
        int hitCount = 0;

        // Check if there's a cookie for 'hitCount'
        if (cookies != null) {
            for (Cookie cookie : cookies) {
                if ("hitCount".equals(cookie.getName())) {
                    hitCount = Integer.parseInt(cookie.getValue());
                    break;
                }
            }
        }

        // Increment the hit count
        hitCount++;

        // Create or update the 'hitCount' cookie
        Cookie hitCountCookie = new Cookie("hitCount", String.valueOf(hitCount));
        hitCountCookie.setMaxAge(60 * 60 * 24 * 7); // 1 week expiry time
        response.addCookie(hitCountCookie);

        // Generate the HTML response
        out.println("<html>");
        out.println("<head><title>Hit Counter</title></head>");
        out.println("<body>");
        out.println("<h1>Page hit count: " + hitCount + "</h1>");
        out.println("</body>");
        out.println("</html>");
    }
}
package hitcount1;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class count1
 */
@WebServlet("/count1")
public class count1 extends HttpServlet {
	private static final long serialVersionUID = 1L;
	//public int count;
	public int count;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public count1() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see Servlet#init(ServletConfig)
	 */
	public void init(ServletConfig config) throws ServletException {
		 count=0;
		// TODO Auto-generated method stub
	}

	/**
	 * @see Servlet#destroy()
	 */
	public void destroy() {
		// TODO Auto-generated method stub
	}

	/**
	 * @see HttpServlet#service(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		response.setContentType("text/html");
		//response.getWriter().append("Served at: ").append(request.getContextPath());
		PrintWriter out =response.getWriter();
		
		count++;
		out.println("<h1> the count will be incremented </h1>");
		out.println("<h1>count :"+count+"</h1>");
	}

}
//login.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Login Page</title>
</head>
<body>
    <h2>Login Page</h2>
    <form action="LoginServlet" method="post">
        <label for="username">Enter Username:</label>
        <input type="text" id="username" name="username" required>
        <br><br>
        <input type="submit" value="Login">
    </form>
</body>
</html>


//LoginServlet.java

import java.io.IOException;
import java.io.PrintWriter;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;

@WebServlet("/LoginServlet")
public class LoginServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();

        // Get the username from the request
        String username = request.getParameter("username");

        if (username != null && !username.isEmpty()) {
            // Create a session and store the username
            HttpSession session = request.getSession();
            session.setAttribute("username", username);

            // Redirect to the welcome page
            response.sendRedirect("WelcomeServlet");
        } else {
            out.println("<h2>Username cannot be empty. Please try again.</h2>");
        }

        out.close();
    }
}


//WelcomeServlet.java

import java.io.IOException;
import java.io.PrintWriter;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;

@WebServlet("/WelcomeServlet")
public class WelcomeServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();

        // Get the existing session (if any)
        HttpSession session = request.getSession(false);

        if (session != null) {
            // Retrieve the username from the session
            String username = (String) session.getAttribute("username");
            if (username != null) {
                out.println("<h2>Welcome, " + username + "!</h2>");
                out.println("<a href='LogoutServlet'>Logout</a>");
            } else {
                out.println("<h2>No user found in session.</h2>");
            }
        } else {
            out.println("<h2>No session found. Please login again.</h2>");
        }

        out.close();
    }
}


//LogoutServlet.java

import java.io.IOException;
import java.io.PrintWriter;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;

@WebServlet("/LogoutServlet")
public class LogoutServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();

        // Invalidate the session
        HttpSession session = request.getSession(false);
        if (session != null) {
            session.invalidate();
        }

        out.println("<h2>You have been logged out successfully!</h2>");
        out.println("<a href='login.html'>Login again</a>");
        out.close();
    }
}
//login.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Login Page</title>
</head>
<body>
    <h2>Login Page</h2>
    <form action="WelcomeServlet" method="get">
        <label for="username">Enter Username:</label>
        <input type="text" id="username" name="username" required>
        <br><br>
        <input type="submit" value="Login">
    </form>
</body>
</html>


//WelcomeServlet.java

import java.io.IOException;
import java.io.PrintWriter;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

@WebServlet("/WelcomeServlet")
public class WelcomeServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();

        // Get the username from the request
        String username = request.getParameter("username");

        if (username != null && !username.isEmpty()) {
            // Display the welcome message
            out.println("<h2>Welcome, " + username + "!</h2>");

            // URL Rewriting - Append the username to the next link
            out.println("<a href='DashboardServlet?username=" + username + "'>Go to Dashboard</a>");
        } else {
            out.println("<h2>Username is missing. Please go back and enter your username.</h2>");
        }

        out.close();
    }
}


//DashboardServlet.java

import java.io.IOException;
import java.io.PrintWriter;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

@WebServlet("/DashboardServlet")
public class DashboardServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();

        // Retrieve the username from the rewritten URL
        String username = request.getParameter("username");

        if (username != null && !username.isEmpty()) {
            out.println("<h2>Welcome to your dashboard, " + username + "!</h2>");
        } else {
            out.println("<h2>Invalid access. Username not found!</h2>");
        }

        out.close();
    }
}
//login.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login Page</title>
</head>
<body>
    <h2>Login</h2>
    <form action="LoginServlet" method="post">
        <label for="username">Username:</label>
        <input type="text" id="username" name="username" required><br><br>
        
        <label for="password">Password:</label>
        <input type="password" id="password" name="password" required><br><br>
        
        <!-- Hidden field to send a welcome message on successful login -->
        <input type="hidden" name="welcomeMessage" value="Welcome to the site!">
        
        <input type="submit" value="Login">
    </form>
</body>
</html>


//LoginServlet.java

import java.io.IOException;
import java.io.PrintWriter;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

@WebServlet("/LoginServlet")
public class LoginServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        
        String username = request.getParameter("username");
        String password = request.getParameter("password");
        String welcomeMessage = request.getParameter("welcomeMessage"); // Getting hidden field data
        
        // Simple login validation (for demonstration only)
        if ("user".equals(username) && "password".equals(password)) {
            out.println("<h2>Login Successful!</h2>");
            out.println("<p>" + welcomeMessage + "</p>");
            out.println("<p>Welcome, " + username + "!</p>");
        } else {
            out.println("<h2>Login Failed</h2>");
            out.println("<p>Invalid username or password. Please try again.</p>");
        }
        
        out.close();
    }
}
MainActivity.kt:
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import com.google.android.material.floatingactionbutton.FloatingActionButton

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_main)

        //implicit
        val url = "https://www.google.com"
        val implicitButton : FloatingActionButton = findViewById(R.id.floatingActionButton)
        implicitButton.setOnClickListener{
            val implicitIntent =Intent(Intent.ACTION_VIEW, Uri.parse(url))
            startActivity(implicitIntent)
        }
    }
}
activity_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">
    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Welcome to MAD Lab"
        android:textSize="24sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.5"
        tools:ignore="HardcodedText" />

    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/floatingActionButton"
        android:layout_width="56dp"
        android:layout_height="76dp"
        android:clickable="true"
        app:fabSize="auto"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textView"
        app:layout_constraintVertical_bias="0.5"
        app:maxImageSize="30dp"
        app:srcCompat="@drawable/baseline_add_24"
        tools:ignore="ContentDescription,KeyboardInaccessibleWidget,SpeakableTextPresentCheck,SpeakableTextPresentCheck"/>

</androidx.constraintlayout.widget.ConstraintLayout>
response = zoho.books.getRecordsByID("Contacts","60027666993","1717348000001708124","zoho_books");
//info response;
contact = response.get("contact").get("bank_accounts");
//info contact;
for each  rec in contact
{
	account_number = rec.get("account_number");
	info account_number;
	IFSC_CODE  = rec.get("routing_number");
}

//////////////
//////////////////////

headers = map();
headers.put("Content-Type", "application/json");
headers.put("api-key", "4c7e1f57-ae9b-411d-bf8a-079b37cd7dab");
headers.put("account-id", "0c85c3939596/9eeccde7-d9ae-4948-845f-3b0286bdad55");


data = map();
data.put("task_id", "task-123");
data.put("group_id", "group-1234");

bank_data = map();
bank_data.put("bank_account_no", "10087431715");
bank_data.put("bank_ifsc_code", "IDFB0080221");
bank_data.put("nf_verification", false);
data.put("data", bank_data);
payload = data.toString();


validate_bank_account = invokeUrl
[
    url : "https://eve.idfy.com/v3/tasks/async/verify_with_source/validate_bank_account"
    type : POST
    parameters : payload
    headers : headers
];

//info validate_bank_account;
request_id = validate_bank_account.get("request_id");
//info request_id;
////////////////////////
/////////////////////////////////////////
get_tasks_data = invokeUrl
[
    url : "https://eve.idfy.com/v3/tasks?request_id="+request_id+""
    type : GET
    headers : headers
];
info get_tasks_data;
 import java.sql.Connection;
 import java.sql.ResultSet;
 import java.sql.Statement;
 import  java.sql.SQLException;
 import java.sql.DriverManager;
  
    public class JdbcExamplePrg1 {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
  
        String QUERY = "select * from book where id <46";
      
        Class.forName("com.mysql.cj.jdbc.Driver"); 
  
        try {
		
  Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/books","root","ramesh");
        
                Statement statemnt1 = conn.createStatement();
              
          ResultSet rs1 = statemnt1.executeQuery(QUERY); 
                                      
                    while(rs1.next())
                    {
                        int id = rs1.getInt(1);
                        String title = rs1.getString(2);
                        String author = rs1.getString(3);
                        String publisher = rs1.getString(4);
                        int price = rs1.getInt(5);

                    System.out.println(id + ","+title+ ","+author+ ","+publisher +","+price );
                    }
                 
        }
        catch(SQLException e) {
            e.printStackTrace();
        }
       }
    }
MainActivity.kt:
import android.content.Intent
import android.os.Bundle
import android.widget.TextView
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import com.google.android.material.floatingactionbutton.FloatingActionButton

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_main)

        //Explicit Intent
        var t: TextView = findViewById(R.id.textView)
        var f: FloatingActionButton = findViewById(R.id.floatingActionButton)
        f.setOnClickListener()
        {
            var i = Intent(this, MainActivity2::class.java)
            startActivity(i)
        }
    }
}
activity_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">
    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Welcome to MAD Lab"
        android:textSize="24sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.5"
        tools:ignore="HardcodedText" />

    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/floatingActionButton"
        android:layout_width="56dp"
        android:layout_height="76dp"
        android:clickable="true"
        app:fabSize="auto"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textView"
        app:layout_constraintVertical_bias="0.5"
        app:maxImageSize="30dp"
        app:srcCompat="@drawable/baseline_add_24"
        tools:ignore="ContentDescription,KeyboardInaccessibleWidget,SpeakableTextPresentCheck,SpeakableTextPresentCheck"/>
</androidx.constraintlayout.widget.ConstraintLayout>
MainActivity2.kt:
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity

class MainActivity2 : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_main2)
    }
}
activity_main2.xml:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity2">
    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="CSE-A"
        android:textSize="34sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.5"
        tools:ignore="HardcodedText" />
</androidx.constraintlayout.widget.ConstraintLayout>
import java.sql.*;

public class UpdateEmpAndAccounts {
    public static void main(String[] args) {
        // Database credentials
        String jdbcURL = "jdbc:mysql://localhost:3306/nehal";
        String username = "root";
        String password = "nehal@123";

        // Stored procedure
        String storedProcedureCall = "{CALL UpdateEmpAndAccounts(?, ?, ?)}";

        // Input values
        int empId = 5; // Employee ID to update
        String newName = "John Updated"; // New name
        int newBalance = 1200; // New account balance (integer)

        try (Connection connection = DriverManager.getConnection(jdbcURL, username, password);
             CallableStatement callableStatement = connection.prepareCall(storedProcedureCall)) {

            // Set parameters for the stored procedure
            callableStatement.setInt(1, empId);
            callableStatement.setString(2, newName);
            callableStatement.setInt(3, newBalance);

            // Execute the stored procedure
            callableStatement.execute();

            System.out.println("Employee name and account balance updated successfully!");

        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
//run procedure code in mysql
DELIMITER $$

CREATE PROCEDURE UpdateEmpAndAccounts(
    IN empId INT,           -- Employee ID to identify the record
    IN newName VARCHAR(255), -- New name for the employee
    IN newBalance INT        -- New balance for the account
)
BEGIN
    -- Update the name in the emp table
    UPDATE emp
    SET name = newName
    WHERE id = empId;

    -- Update the balance in the accounts table
    UPDATE accounts
    SET balance = newBalance
    WHERE id = empId;
END $$

DELIMITER ;
//status check for procedure
SHOW PROCEDURE STATUS WHERE Db = 'nehal';
import java.sql.*;

public class TransactionExample {

    public static void main(String[] args) {
        // Database URL and credentials
        String dbUrl = "jdbc:mysql://localhost:3306/nehal";
        String user = "root";
        String password = "nehal@123";

        Connection conn = null;

        try {
            // Establish connection
            conn = DriverManager.getConnection(dbUrl, user, password);

            // Disable auto-commit mode
            conn.setAutoCommit(false);

            // SQL queries
            String deductMoney = "UPDATE accounts SET balance = balance - ? WHERE id = ?";
            String addMoney = "UPDATE accounts SET balance = balance + ? WHERE id = ?";

            try (
                PreparedStatement stmt1 = conn.prepareStatement(deductMoney);
                PreparedStatement stmt2 = conn.prepareStatement(addMoney)
            ) {
                // Deduct money from account 1
                stmt1.setDouble(1, 500.0); // Deduct $500
                stmt1.setInt(2, 1);        // From account ID 1
                stmt1.executeUpdate();

                // Add money to account 2
                stmt2.setDouble(1, 500.0); // Add $500
                stmt2.setInt(2, 2);        // To account ID 2
                stmt2.executeUpdate();

                // Commit the transaction
                conn.commit();
                System.out.println("Transaction successful!");
            } catch (SQLException e) {
                // Rollback the transaction in case of an error
                if (conn != null) {
                    conn.rollback();
                    System.out.println("Transaction rolled back due to an error.");
                }
                e.printStackTrace();
            }

        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            try {
                if (conn != null) {
                    // Re-enable auto-commit mode
                    conn.setAutoCommit(true);
                    conn.close();
                }
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }
}
import java.sql.*;

public class ScrollableAndUpdatableResultSetExample {

    public static void main(String[] args) {
        // Database URL and credentials
        String dbUrl = "jdbc:mysql://localhost:3306/nehal";
        String user = "root";
        String password = "nehal@123";

        // SQL query
        String sql = "SELECT id, name FROM emp";

        try (Connection conn = DriverManager.getConnection(dbUrl, user, password)) {
            // Create a statement with scrollable and updatable result set
            Statement stmt = conn.createStatement(
                ResultSet.TYPE_SCROLL_INSENSITIVE,  // Scrollable
                ResultSet.CONCUR_UPDATABLE          // Updatable
            );

            // Execute the query and get the result set
            ResultSet rs = stmt.executeQuery(sql);

            // Move to the last row
            if (rs.last()) {
                System.out.println("Last row: " + rs.getInt("id") + ", " + rs.getString("name"));
            }

            // Move to the first row
            if (rs.first()) {
                System.out.println("First row: " + rs.getInt("id") + ", " + rs.getString("name") );
            }

            // Move to the second row (using absolute position)
            if (rs.absolute(2)) {
                System.out.println("Second row: " + rs.getInt("id") + ", " + rs.getString("name") );
            }

            // Update a column in the result set
            if (rs.absolute(1)) {
                rs.updateString("name", "ramesh"); // Update name for the first row
                rs.updateRow(); // Apply the update to the database
                System.out.println("Updated first row: " + rs.getInt("id") + ", " + rs.getString("name"));
            }

        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
import java.sql.*;

public class ResultSetMetadataExample {

    public static void main(String[] args) {
        // Database URL and credentials
        String dbUrl = "jdbc:mysql://localhost:3306/nehal";
        String user = "root";
        String password = "nehal@123";

        // SQL query
        String sql = "SELECT id, name FROM emp";

        try (Connection conn = DriverManager.getConnection(dbUrl, user, password);
             Statement stmt = conn.createStatement();
             ResultSet rs = stmt.executeQuery(sql)) {
             
            // Get the ResultSetMetaData
            ResultSetMetaData rsMetaData = rs.getMetaData();
            
            // Get the number of columns in the result set
            int columnCount = rsMetaData.getColumnCount();
            
            System.out.println("Number of Columns: " + columnCount);
            
            // Print column names and types
            for (int i = 1; i <= columnCount; i++) {
                String columnName = rsMetaData.getColumnName(i);
                String columnType = rsMetaData.getColumnTypeName(i);
                
                System.out.println("Column " + i + ": " + columnName + " (" + columnType + ")");
            }
            
            // Iterate through the result set and print data
            while (rs.next()) {
                System.out.println("ID: " + rs.getInt("id") + ", Name: " + rs.getString("name"));
            }

        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
const person = {
    name: "Alice",
    age: 25,
    greet: function() {
        console.log(`Hi, I'm ${this.name}.`);
    }
};
console.log(person.name);
person.greet();

const car = new Object();
car.brand = "Toyota";
car.model = "Corolla";
car.year = 2021;
console.log(car.brand);

function Book(title, author) {
    this.title = title;
    this.author = author;
    this.getInfo = function() {
        return `${this.title} by ${this.author}`;
    };
}
const book1 = new Book("1984", "George Orwell");
console.log(book1.getInfo());

class Animal {
    constructor(type, sound) {
        this.type = type;
        this.sound = sound;
    }
    makeSound() {
        console.log(this.sound);
    }
}

const cat = new Animal("Cat", "Meow");
cat.makeSound();

const student = {
    name: "Bob",
    grade: "A",
    subjects: ["Math", "Science"]
};
console.log(student.subjects[0]);
const fruits = ["Apple", "Banana", "Orange", "Mango", "Grapes"];

console.log("Original Array:", fruits);

// Using slice()
const slicedFruits = fruits.slice(1, 4);
console.log("\nUsing slice:");
console.log("Sliced Array:", slicedFruits); 
console.log("After slice, Original Array:", fruits); 

// Using splice()
const splicedFruits = fruits.splice(2, 2, "Pineapple", "Strawberry");
console.log("\nUsing splice:");
console.log("Removed Elements:", splicedFruits);
console.log("After splice, Modified Array:", fruits);
star

Fri Nov 15 2024 17:55:08 GMT+0000 (Coordinated Universal Time)

@coding1

star

Fri Nov 15 2024 17:54:36 GMT+0000 (Coordinated Universal Time)

@coding1

star

Fri Nov 15 2024 17:53:58 GMT+0000 (Coordinated Universal Time)

@coding1

star

Fri Nov 15 2024 17:53:26 GMT+0000 (Coordinated Universal Time)

@coding1

star

Fri Nov 15 2024 17:52:53 GMT+0000 (Coordinated Universal Time)

@coding1

star

Fri Nov 15 2024 17:52:46 GMT+0000 (Coordinated Universal Time)

@signup_returns

star

Fri Nov 15 2024 17:52:16 GMT+0000 (Coordinated Universal Time)

@coding1

star

Fri Nov 15 2024 17:51:43 GMT+0000 (Coordinated Universal Time)

@coding1

star

Fri Nov 15 2024 17:51:04 GMT+0000 (Coordinated Universal Time)

@coding1

star

Fri Nov 15 2024 17:50:13 GMT+0000 (Coordinated Universal Time)

@coding1

star

Fri Nov 15 2024 17:37:48 GMT+0000 (Coordinated Universal Time)

@Bantling21

star

Fri Nov 15 2024 17:37:17 GMT+0000 (Coordinated Universal Time)

@Bantling21

star

Fri Nov 15 2024 17:21:33 GMT+0000 (Coordinated Universal Time)

@webtechnologies

star

Fri Nov 15 2024 17:20:51 GMT+0000 (Coordinated Universal Time)

@webtechnologies

star

Fri Nov 15 2024 17:19:50 GMT+0000 (Coordinated Universal Time)

@webtechnologies

star

Fri Nov 15 2024 17:19:05 GMT+0000 (Coordinated Universal Time)

@webtechnologies

star

Fri Nov 15 2024 17:07:43 GMT+0000 (Coordinated Universal Time)

@Bantling21

star

Fri Nov 15 2024 17:06:58 GMT+0000 (Coordinated Universal Time)

@webtechnologies

star

Fri Nov 15 2024 17:04:57 GMT+0000 (Coordinated Universal Time)

@webtechnologies

star

Fri Nov 15 2024 16:58:24 GMT+0000 (Coordinated Universal Time)

@webtechnologies

star

Fri Nov 15 2024 16:54:54 GMT+0000 (Coordinated Universal Time)

@login123

star

Fri Nov 15 2024 16:54:31 GMT+0000 (Coordinated Universal Time)

@login123

star

Fri Nov 15 2024 16:54:11 GMT+0000 (Coordinated Universal Time)

@login123

star

Fri Nov 15 2024 16:44:05 GMT+0000 (Coordinated Universal Time)

@varuntej #kotlin

star

Fri Nov 15 2024 16:29:17 GMT+0000 (Coordinated Universal Time)

@varuntej #kotlin

star

Fri Nov 15 2024 16:20:53 GMT+0000 (Coordinated Universal Time)

@varuntej #kotlin

star

Fri Nov 15 2024 15:43:07 GMT+0000 (Coordinated Universal Time)

@login

star

Fri Nov 15 2024 15:27:34 GMT+0000 (Coordinated Universal Time)

@login123

star

Fri Nov 15 2024 15:25:39 GMT+0000 (Coordinated Universal Time)

@signup_returns

star

Fri Nov 15 2024 15:25:14 GMT+0000 (Coordinated Universal Time)

@webtechnologies

star

Fri Nov 15 2024 15:22:34 GMT+0000 (Coordinated Universal Time)

@signup_returns

star

Fri Nov 15 2024 15:17:11 GMT+0000 (Coordinated Universal Time)

@signup_returns

star

Fri Nov 15 2024 15:01:20 GMT+0000 (Coordinated Universal Time)

@wtlab

star

Fri Nov 15 2024 14:59:35 GMT+0000 (Coordinated Universal Time)

@signup_returns

star

Fri Nov 15 2024 14:42:59 GMT+0000 (Coordinated Universal Time)

@signup_returns

star

Fri Nov 15 2024 14:34:58 GMT+0000 (Coordinated Universal Time)

@signup_returns

star

Fri Nov 15 2024 14:26:12 GMT+0000 (Coordinated Universal Time)

@varuntej #kotlin

star

Fri Nov 15 2024 14:16:10 GMT+0000 (Coordinated Universal Time)

@usman13

star

Fri Nov 15 2024 14:06:25 GMT+0000 (Coordinated Universal Time)

@login123

star

Fri Nov 15 2024 14:03:45 GMT+0000 (Coordinated Universal Time)

@varuntej #kotlin

star

Fri Nov 15 2024 14:00:52 GMT+0000 (Coordinated Universal Time)

@wtlab

star

Fri Nov 15 2024 13:48:34 GMT+0000 (Coordinated Universal Time)

@wtlab

star

Fri Nov 15 2024 13:27:15 GMT+0000 (Coordinated Universal Time)

@wtlab

star

Fri Nov 15 2024 13:26:53 GMT+0000 (Coordinated Universal Time)

@wtlab

star

Fri Nov 15 2024 13:18:09 GMT+0000 (Coordinated Universal Time)

@login123

star

Fri Nov 15 2024 12:45:57 GMT+0000 (Coordinated Universal Time)

@login123

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension