Notes, summaries, assignments, exams, and exercises for Computer science for Primary education

Essential Network Hardware Components Explained

Computer science2.43 KB

Network Interface Card (NIC)

The Network Interface Card (NIC), also known as a Media Access Unit (MAU), is the device that connects a station (computer or other network device) to the physical network environment. While often presented as an expansion card for computers, many modern computers have integrated network interfaces, primarily Ethernet.

Sometimes, a network card requires a transceiver. This device connects the physical medium to the card, either because a direct connection is impossible (e.g., 10Base5) or because the medium type differs from what the card supports.

Bridge or Bridges

A bridge interconnects two segments of a computer network or divides one network into two segments. It filters data based on the MAC address. Therefore,...

Continue reading "Essential Network Hardware Components Explained" »

Python Fundamentals: Strings, Lists, Math, and Plotting Examples

Computer science6.74 KB

P1: Python String Manipulation Techniques

Demonstrating String Operations

s = "hello"
print(s.capitalize())
print(s.upper())
print(s.rjust(100))
print(s.center(100))
print(s.replace('l','(M)'))
print(s)
print("don't")

Indexing

a = 'symbiosis2024'
print(a[2])

Negative Indexing

print(a[-1])
print(a[-6])

Slicing

print(a[9:12])
print(a[9:])
print(a[9:-1])
print(a[:8])
print(a[-12:-1])

Stride [start index:end index:step size]

print(a[0:13:2])
print(a[0::2])

Concatenation

b = 'hello'
c = 'world'
d = b + c
print(d)
e = b + " " + c
print(e)

Repetition

f = a * 3
print(f)
g = "2024"
print(g * 2)
print(a + '2')

Reversing a String

print(a[::-1])

Split

h = "sspu"
print(h.split()) # Returns a list
i = "05/08/2024"
print(i.split("/"))
j = "14:20:25"
print(j.split("
...
Continue reading "Python Fundamentals: Strings, Lists, Math, and Plotting Examples" »

Understanding Firewall Architecture and Network Security

Computer science3.36 KB

Understanding Firewalls

A firewall is a point between two or more networks, acting as a component or set of components through which all traffic passes. It enables the control, authentication, and logging of all network traffic.

Note: A firewall does not authenticate or protect data from viruses.

Key Features

  • Packet Filter: Performs selective packet routing by analyzing data from headers.
  • Proxies: Analyzes packets at the application layer.
  • Bastion Hosts: Dedicated equipment with minimal services installed, kept at the latest version, to offer services to the internet.

Network Address Translation (NAT)

  • Converts invalid or reserved IP addresses into valid, routable addresses.
  • Solves the shortage of valid IP addresses.
  • Provides masking for the internal
...
Continue reading "Understanding Firewall Architecture and Network Security" »

Understanding Computer Systems: Functions and Components

Computer science3.41 KB

What Is a Computer?

A computer is an electronic device that accepts input, processes data according to instructions, stores information, and produces output. It operates through both hardware (physical components like CPU, memory, and storage) and software (programs and operating systems).

Definition

A computer is an electronic device that processes information based on a set of instructions, storing, retrieving, and manipulating data to perform a wide range of tasks efficiently.

Key Characteristics

  • Speed: Computers perform millions of operations per second.
  • Accuracy: High precision in calculations and data processing.
  • Automation: Performs tasks automatically once programmed.
  • Storage: Can store vast amounts of data and software.
  • Versatility: Can execute
...
Continue reading "Understanding Computer Systems: Functions and Components" »

Understanding Email Systems and Cybersecurity Threats

Computer science10.97 KB

Electronic Mail (Email) Fundamentals

Email is a method of exchanging digital messages from an author to one or more recipients. 📧

Introduction to Email

Email works similarly to physical mail, but electronically. It uses the internet to deliver messages almost instantaneously to an address on a global network. Key protocols like Simple Mail Transfer Protocol (SMTP) handle sending mail, while Post Office Protocol (POP3) or Internet Message Access Protocol (IMAP) handle receiving it.

Advantages of Email

  • Speed: Messages are delivered almost instantly, even across vast distances.
  • Cost-Effective: It's virtually free compared to traditional postal services or long-distance calls.
  • Accessibility: You can send and receive emails from almost any internet-
...
Continue reading "Understanding Email Systems and Cybersecurity Threats" »

Java Abstract Classes, Interfaces, and JDBC Database Connectivity

Computer science3.03 KB

What Are Abstract Classes?

An abstract class is a class that cannot be instantiated and is used only to define subclasses. A class becomes abstract if at least one of its methods has no implementation. In Java, an abstract method is marked with the abstract keyword.

When to Use Abstract Classes

Abstract classes are used when we want to define an abstraction that encompasses objects of different types and leverage polymorphism.

Understanding Interfaces in Java

An interface is a completely abstract class (a class without implementation). In Java, interfaces are declared with the interface keyword, similar to how abstract classes are declared.

An interface declaration can only contain method declarations (name and signature, without implementation)...

Continue reading "Java Abstract Classes, Interfaces, and JDBC Database Connectivity" »

Microprocessors and Memory Types: A Deep Dive

Computer science2.71 KB

Microprocessors

The microprocessor is the device responsible for processing the data received. It is able to perform arithmetic operations and transfer blocks of information. The increase in processing power allows for faster and faster PCs. This is mainly due to improvements in architecture, microcode, and operating speeds.

Overclocking

Overclocking is a method used to obtain faster processing speed by increasing the domestic multiplier value of the microprocessor. It is not advisable because it causes overheating of the processor. Besides the increased frequency, it may result in errors of "timing" and then produce erroneous results or hang the system. You can also overclock the system clock speed, which will affect the overall team bus. This...

Continue reading "Microprocessors and Memory Types: A Deep Dive" »

Web Page Creation and CMS Management Essentials

Computer science2.46 KB

Web Page Creation

Application of Hyperlinks

A hyperlink is a cross-reference to another document. It consists of a point (the object where you insert the hyperlink) and a destination (the document or section displayed when the link is activated).

There are several ways to create hyperlinks:

  • Internal Hyperlinks: Links to a specific part of the same document. To create these, you must first define the destination by setting an anchor or bookmark within the document.
  • External Links: Links to other documents that are displayed, executed, or downloaded from the internet. These require specific attributes to define how the linked document is displayed.

Types of External Links

  • Relative URLs: These refer to documents located in the same folder as your HTML
...
Continue reading "Web Page Creation and CMS Management Essentials" »

Deadlock Prevention and Banker's Algorithm in C

Computer science2.93 KB

Dining Philosophers Deadlock Prevention

The following implementation addresses the Dining Philosophers problem using POSIX threads and semaphores. To prevent deadlock, the logic ensures that the last philosopher picks up the forks in a different order than the others.

#include <stdio.h>
#include <pthread.h>
#include <semaphore.h>
#include <unistd.h>
#include <stdlib.h>

#define N 5

sem_t forkS[N];

void *philosopher(void *n)
{
    int id = *(int *)n;
    int left = id;
    int right = (id + 1) % N;

    while (1)
    {
        printf("P%d Thinking\n", id);

        fflush(stdout); // Force print immediately
        sleep(1);

        // Deadlock prevention: last philosopher picks right fork first
        if (id ==
...
Continue reading "Deadlock Prevention and Banker's Algorithm in C" »

Computer Networking Fundamentals and Architecture

Computer science3.55 KB

Network Architectures and Technologies

According to the architecture: Arcnet, Ethernet, Token Ring, FDDI, ATM, ISDN, Frame Relay, DSL, and X.25.

Geographic Extent of Networks

  • PAN (Personal Area Network): Home networks covering nearby areas within the same environment, such as the dependencies of a house (living room, bedroom, office, etc.). Example: Home Office.
  • LAN (Local Area Network): Covers areas around local area networks within the same environment, such as offices, condominiums, schools, or a university campus.
  • MAN (Metropolitan Area Network): Networks covering the metropolitan area of a large city or between nearby cities. Example: Speedy, Virtua.
  • WAN (Wide Area Network): Long-distance networks connecting computers located in different cities,
...
Continue reading "Computer Networking Fundamentals and Architecture" »