Posts

CN Lab Manual

Computer Network Pdf. CN Lab Book Chatgpt Practical No 5. Write a program using TCP socket for wired network for Following a. Say Hello to Each other b. File transfer Code   Server code: **************** import socket # Server configuration HOST = '127.0.0.1'   # Localhost (you can replace with your IP) PORT = 65432         # Port number (make sure it's free) # Create TCP socket server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server_socket.bind((HOST, PORT)) server_socket.listen(1) print(f"[*] Server listening on {HOST}:{PORT}") conn, addr = server_socket.accept() print(f"[+] Connected by {addr}") # (a) Say Hello client_msg = conn.recv(1024).decode() print(f"Client says: {client_msg}") conn.send("Hello Client, connection established!".encode()) # (b) File Transfer filename = conn.recv(1024).decode() print(f"[+] Receiving file: {filename}") with open("received_" + filename, 'wb') as f: ...

SL-1 lab practical

 Practical book for an Ai  AI lab book Perplexity Chatgpt Ai Codes ..... Q1. from collections import deque # ------------------------------- # Undirected Graph Representation # ------------------------------- graph = {     'A': ['B', 'C'],     'B': ['A', 'D', 'E'],     'C': ['A', 'F'],     'D': ['B'],     'E': ['B', 'F'],     'F': ['C', 'E'] } # ------------------------------- # Depth First Search (Recursive) # ------------------------------- def dfs_recursive(graph, node, visited=None):     if visited is None:         visited = set()     visited.add(node)     print(node, end=" ")     for neighbour in graph[node]:         if neighbour not in visited:             dfs_recursive(graph, neighbour, visited) # ------------------------------- # Breadth First Search (Iterative) # ------------------------------- def bf...

OOPs practical codes

 oops practical SE ,AIDS practical practical no :1 /* Implement a class Complex which represents the Complex Number data type. Implement the following 1.  Constructor (including a default constructor which creates the complex number 0+0i). 2.  Overload operator+ to add two complex numbers. 3.  Overload operator* to multiply two complex numbers. 4.  Overload operators << and >> to print and read Complex Numbers */ #include <iostream> using namespace std; class Complex {     double real;     double img; public:     Complex();                                              // Default Constructor     friend istream & operator>>(istream & , Complex & );       // Input     friend ostream & operator<<(ostream & , const Complex & );...

Life lessons to learn from lord Shiva

Image
L ord Shiva, one of the most revered deities in Hinduism, is known as the  Mahadeva , or the "Great God." He embodies a range of profound life lessons that can guide us through both personal and spiritual growth. From the power of transformation to the practice of self-control, Shiva’s attributes offer timeless wisdom for navigating life’s challenges and finding inner peace. Here are key life lessons we can learn from Lord Shiva: 1.  Oneness: Embracing Unity in Diversity Lord Shiva represents the concept of oneness, transcending divisions of caste, creed, and social status. In his cosmic dance of  Nataraja , Shiva embodies both the creator and destroyer, signifying the unity of all things in the universe. This teaches us that despite our individual differences, we are all interconnected. Embracing the principle of oneness encourages compassion and tolerance, helping us view others not as separate entities but as part of the same universal whole. 2.  Renunciation: Let...

Safeguarding Your Digital Footprint: The Growing Importance of Data Privacy and Protection

The Growing Importance of Data Privacy and Protection In today’s digital age, where information flows seamlessly across platforms and borders, the importance of data privacy and protection cannot be overstated. With the rapid advancement of technology and the ever-increasing reliance on the internet, individuals and organizations alike are more vulnerable than ever to data breaches, identity theft, and misuse of personal information. As our lives become more intertwined with technology, understanding and prioritizing data privacy has become a crucial responsibility for both consumers and businesses. The Landscape of Data Privacy Data privacy refers to the proper handling, processing, and storage of personal information. It encompasses everything from the collection of user data to its retention and destruction. With the rise of social media, online shopping, and cloud computing, vast amounts of personal data are generated and collected every day. According to a recent report, over 2.5 ...