Posts

21CS735

Image
 The evolution of IoT can be described as follows, based on the given content: ATMs (Automated Teller Machines): Introduced in 1974, these machines were among the early examples of connecting systems for financial transactions, providing cash distribution and account access outside of regular bank hours. Web (World Wide Web): Launched in 1991, the Web played a significant role in revolutionizing communication and information sharing, paving the way for IoT connectivity. Smart Meters: Emerging in the early 2000s, these devices communicated with power grids remotely, allowing real-time monitoring of power usage and facilitating easier billing and energy distribution. Digital Locks: Evolved into smart home automation systems, digital locks became controllable via smartphones, allowing remote access and management of security functions. Connected Healthcare: Wearable devices and medical monitors enabled real-time connectivity between patients, hospitals, and caregiv...

21CS62

 Program 1:Date and Time Step 1:Terminal django-admin startproject myproject  cd myproject py manage.py startapp myapp Step 2:settings.py Open the settings.py file inside the myproject directory.  Find the INSTALLED_APPS list and add your app's name ('myapp') to the list.  INSTALLED_APPS = [      ...      'myapp',  ]  Step 3:views.py Open the views.py file inside your myapp directory and  define a view. from django.http import HttpResponse  from datetime import datetime, timedelta    def datetime_with_offsets(request):      now = datetime.now()      offset_hours = 4            four_hours_ahead = now + timedelta(hours=offset_hours)      four_hours_before = now - timedelta(hours=offset_hours)        html = f"<html><body><h1>Current Date and Time with Offs...

21CSL66

Program 1:Bresenham's Line Algorithm #include <GL/glut.h> #include <stdio.h> int x1, y1, x2, y2; void draw_pixel(int x, int y) {     glColor3f(1.0, 0.0, 0.0);     glBegin(GL_POINTS);     glVertex2i(x, y);     glEnd(); } void bresenhams_line_draw(int x1, int y1, int x2, int y2) {     int dx = x2 - x1;     int dy = y2 - y1;     int x = x1;     int y = y1;     int p = 2 * dy - dx;  // Corrected calculation of p     int twoDy = 2 * dy;     int twoDyMinusDx = 2 * (dy - dx);     draw_pixel(x, y);     while (x < x2)     {         x++;         if (p < 0)             p += twoDy;         else         {             y++;             p += twoDyMinusDx;      ...