Operating Systems Exam Preparation: Core Concepts
CPU Scheduling Fundamentals
CPU scheduling is the process by which the operating system selects which process to execute next. Algorithms aim to optimize metrics such as waiting time, turnaround time, and response time.
Key Performance Metrics
- Completion Time (CT): The moment a process finishes.
- Turnaround Time (TAT):
TAT = Completion Time - Arrival Time - Waiting Time (WT):
WT = Turnaround Time - Burst Time - Response Time (RT):
RT = First time it runs - Arrival Time
Base Example Data
| Process | Arrival | Burst |
|---|---|---|
| P1 | 0 | 6 |
| P2 | 1 | 3 |
| P3 | 2 | 8 |
| P4 | 3 | 4 |
Scheduling
Read MoreGeopolitics: African Growth and Middle Eastern Conflict
Legacies and Governance in Modern Africa
Africa isn’t poor because it’s Africa. It’s poor because it carries three destructive legacies (slavery, colonization, and corruption), but the decisive factor today is governance: countries with strong institutions thrive (such as Rwanda and Botswana), while countries without them collapse (such as the DRC and Nigeria).
Slavery: The Structural Shock
- Catastrophic demographic loss: The loss of people in their most productive years halted agricultural innovation.
IoT Interoperability, Arduino Integration, and Cloud Basics
Understanding Interoperability in IoT
Interoperability in the Internet of Things (IoT) refers to the ability of different IoT devices, platforms, applications, and communication systems to exchange, understand, and use data effectively. It enables devices from various vendors to work together seamlessly, which is critical given the billions of connected smart devices.
Levels of IoT Interoperability
- Device Interoperability: Communication using common protocols.
- Network Interoperability: Interaction between
Implement BERT for Sentiment Analysis in PyTorch
This implementation demonstrates how to build a BERT-based model from scratch using PyTorch and the Hugging Face Transformers library for sentiment classification.
Required Libraries and Imports
import torch
import torch.nn as nn
import torch.nn.functional as F
from transformers import AutoTokenizer
from datasets import load_dataset
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")The Self-Attention Mechanism
The core of the Transformer architecture is the Multi-Head Self-Attention mechanism,
Read MoreData Structures and Algorithms Cheat Sheet
Big-O and Theta Notation
1 < log n < (log n)² < n < n log n < n² < n²log n < n³ < 2ⁿ
- Θ (Theta): Tight bound/actual growth.
- O (Big-O): Upper bound/worst-case.
- Ω (Omega): Lower bound.
Note: Ignore constants and smaller terms. Example: 3n²+5n+1 = Θ(n²)
Loop Complexity Rules
- i++ or i=i+2: O(n)
- i=i*2 or i=i/2: O(log n)
- Nested loops: Multiply complexities (e.g., O(n log n)).
- Sequential loops: Add complexities (e.g., O(n) + O(log n) = O(n)).
Universal Loop Analysis
“Outer loop
Read MoreEssential Romantic Poetry: Analysis of Key Works
Lines Composed a Few Miles above Tintern Abbey (1798)
This Romantic poem by William Wordsworth summarizes his return to the Wye Valley after five years. It examines the restorative power of nature on the mind, shifting from sensory appreciation to spiritual insight, and serves as a testament to memory’s power to provide solace and moral direction.
Key Aspects of the Poem
- The Power of Memory: The speaker explains that memories of this scenic landscape brought him comfort and “tranquil restoration” while
Financial Markets, Intermediaries, and Fixed Income Assets
Markets, Intermediaries & Financing Instruments
Money Markets vs. Capital Markets
| Feature | Money Market | Capital Market |
|---|---|---|
| Maturity | < 1 year | > 1 year |
| Instruments | Promissory notes, treasury bills, credit lines, commercial discounts | Bonds, stocks, fixed-term loans |
| Purpose | Finance working capital | Finance fixed asset investments & expansion |
| Liquidity | High | Lower |
| Credit Risk | Relatively low | Higher |
The 3 Channels of Market Operation
- Organised institutions: NYSE, regional exchanges, regulated markets
- OTC market: Brokers
English Grammar Exercises and Informal Letter Writing Tips
English Sentence Transformation Exercises
- It’s said that the way people learn will change in the next few decades. The way people learn is said to change in the next few decades.
- Although the test was very easy, they decided to use a cheat sheet. Despite the test being very easy, they decided to use a cheat sheet.
- You won’t pass the test if you don’t speak to your teacher and apologise. Unless you speak to your teacher and apologise, you won’t pass the test.
- No other city in Spain is as big as
Hhsfhh
1. Algebraic System
An algebraic system is a non-empty set together with one or more operations (like addition or multiplication) defined on it.
Example: A set AAA with an operation ∗*∗ is written as (A,∗)(A, *)(A,∗).
2. Semigroup
A semigroup is a set SSS with a binary operation ∗*∗ that is associative:
(a∗b)∗c=a∗(b∗c),∀a,b,c∈S(a * b) * c = a * (b * c), \quad \forall a,b,c \in S(a∗b)∗c=a∗(b∗c),∀a,b,c∈S
3. Monoid
A monoid is a semigroup that has an identity element eee,
Read MoreHuman Anatomy and Physiology Vocabulary Reference
Nervous and Endocrine System Terminology
- Neuron: A cell that transmits information by electrical and chemical signaling.
- Motor Neuron: A neuron that helps to create the ability to move.
- Nervous System: The bodily system that transmits signals and coordinates actions of the body.
- Network: A group of connected neurons that process information.
- Vertebrae: The small bones that together make up the backbone and surround the nerves of the spinal cord.
- Reflex: An involuntary and immediate movement in response
