Video summary
MAD I AQ/PQ Session Week 2
Main summary
Key takeaways
Main ideas & lessons
1) Week 2 overview (what will be covered)
- The instructor explains that Week 2 consists of:
- Numericals on encoding
- Basics of HTML and CSS
- A set of questions (about 10–11) has been compiled into a document to be shared later.
2) Encoding basics (characters → bits)
Why encoding is needed
- Humans understand characters (letters, spaces, symbols).
- Computers work only with 0s and 1s.
- Encoding converts human-readable text into machine-readable binary, so it can be stored/transmitted and later decoded back.
Common encoding types mentioned
- ASCII (7-bit): each character stored in 7 bits
- ASCII (8-bit) / Extended ASCII: each character stored in 8 bits
- UCS (8-bit): each character stored using 8 bits
- UCS2: each character uses 2 bytes = 16 bits
- UCS4: each character uses 4 bytes = 32 bits
Core bit-to-combinations logic
- An n-bit encoding provides (2^n) distinct combinations.
- Examples used:
- 1 bit → (2^1 = 2) combinations
- 2 bits → (2^2 = 4) combinations
- 3 bits → (2^3 = 8) combinations
- 4 bits → (2^4 = 16) combinations
Handling numerical questions
- General method taught:
- File size (bits) = (number of characters) × (bits per character)
- When given file size and bits-per-character:
- Number of characters = file_size_bits ÷ bits_per_character
3) Encoding numericals solved (method + key results)
Numerical 1 (simple 8-bit case)
- Given: 8,000 alphanumeric characters, encoded using 8-bit
- Method:
- total bits = 8000 × 8
- Result:
- 64,000 bits
Numerical 2 (use UCS4 then compute for ASCII 7-bit)
- Given: document size is 136,000 bits encoded with UCS4
- Steps:
- Characters = 136,000 ÷ 32 (since UCS4 = 32 bits/character)
- Re-encode size for ASCII 7-bit:
- new bits = characters × 7
- Result:
- 29,750 bits (taught as option C)
Numerical 3 (minimum bits for a fixed character set; file size in KB)
- Given:
- Character set includes:
- small letters + capital letters (A–D mentioned specifically as part of the example set)
- digits 0 and 1
- space
- Total characters in the set counted as 11 characters
- File size = 2 KB
- Character set includes:
- Method:
- Determine minimum bits to represent 11 characters:
- 3 bits → 8 combos (not enough)
- 4 bits → 16 combos (enough)
- so 4 bits per character
- Convert KB to bits using instructor’s approach:
- 1 byte = 8 bits
- kilo used as 1000
- total characters = (2 × 1000 × 8) ÷ 4
- Determine minimum bits to represent 11 characters:
- Result:
- 4,000 characters
- Variations discussed:
- If you add characters but stay within what 4 bits can represent (up to 16 combinations), file size can remain consistent if the character count adjusts accordingly.
- If total characters exceeds what 4 bits can represent (e.g., 17), then:
- bits per character must increase to 5
- file size increases.
4) HTML basics (VS Code workflow + tags)
Creating/running HTML in VS Code
- Create a project folder and open it in VS Code
- Create an .html file
- Use VS Code Emmet/abbreviation:
- Type
!then Enter to generate HTML boilerplate
- Type
- For preview/rendering:
- Install/use VS Code extension(s):
- Live Server (for “Go Live”)
- Live Preview (Microsoft extension mentioned for side-by-side preview)
- Install/use VS Code extension(s):
HTML structure explained
Boilerplate includes:
<!doctype html>(HTML5 declaration)<html>root element<head>for metadata and<title><body>for visible content
Basic tags mentioned + natural behavior
- Heading tags:
h1toh6- Natural behavior: sizes decrease from
h1(largest) toh6(smallest)
- Natural behavior: sizes decrease from
- Inline vs block elements
- Inline elements: sit side-by-side and take only needed width (e.g.,
span,a,img)- Instructor emphasized: “you cannot give width to inline” (natural behavior context)
- Block elements: take full width and appear stacked vertically
- examples:
div,p, heading tags
- examples:
- Inline elements: sit side-by-side and take only needed width (e.g.,
- div tag
- Used to create sections
- p tag
- Used to write paragraph/content
- Instructor notes:
pis block-level;spanis inline
Other HTML tags demonstrated
- Commenting
Ctrl + /used to comment/uncomment lines
- Anchor tag (
a) for hyperlinks- Anchor text appears between
<a>and</a> - Destination is inside
href="..."
- Anchor text appears between
- Link tag (
link) for attaching external resources- Used to attach external stylesheets (e.g.,
style.css) from the<head>
- Used to attach external stylesheets (e.g.,
- Image tag (
img)- Attributes:
src= image source URL/pathalt= alternative text shown if image fails to load
- Instructor emphasized: image behaves inline and appears alongside other inline elements
- Attributes:
- Background images in CSS
- Mentioned as
background-image: url(...)(explained in the CSS portion)
- Mentioned as
5) CSS basics (inline/internal/external + precedence)
Types of CSS styling
- Inline CSS
- Put styling directly inside an element using
style="..."
- Put styling directly inside an element using
- Internal CSS
- Put styling inside
<style>...</style>within the HTML document’s<head>
- Put styling inside
- External CSS
- Put styling in a separate
.cssfile (e.g.,style.css) - Attach it using a
<link>tag in the<head>
- Put styling in a separate
Precedence (which style wins)
Instructor gave ordering of importance:
!important(highest precedence)- Inline styling
- Internal styling
- External styling (lowest precedence)
Additional rule taught:
- If multiple rules of the same precedence apply, the latest rule in the stylesheet overrides earlier ones.
“Sequence” convention issue discussed
- Instructor emphasized that expected precedence/behavior can be disrupted if the stylesheet is linked in the wrong order, and advised to “follow the standard sequence” (attach stylesheet first, then internal style rules).
6) CSS selectors (ID, class, element)
What selectors are used for
- To target specific HTML elements and apply styles.
Selector categories taught (with analogy)
- Element selector
- Styles all matching tags (e.g.,
div { ... })
- Styles all matching tags (e.g.,
- Class selector
- HTML:
class="className" - CSS:
.className { ... } - Styles a group of elements
- HTML:
- ID selector
- HTML:
id="uniqueId" - CSS:
#uniqueId { ... } - Styles a unique element
- HTML:
ID vs class vs element explanation (student analogy)
- ID ≈ a specific student (unique)
- Class ≈ a group of students
- Element selector ≈ a larger department/grouping of related element types
- Precedence order among these selectors (as taught):
- ID > Class > Element
!importantoverrides selector precedence (as previously explained).
7) Practice guidance & additional resources
Practice guidance
- Instructor advises learners to:
- Practice by creating HTML using the boilerplate
- Write tags and CSS themselves (not only watch)
Suggested resources
- W3Schools
- Mentioned later as optional:
- MDN Web Docs
- Frontend Mentor
Course support
- “Solve with instructor source code” under Supplementary contents includes code and notes.
- Instructor plans to add the materials to a YouTube playlist as well.
Speakers / sources featured
People
- Main speaker/instructor (“ma’am”) — leading Week 2 sessions
- Students/participants:
- Anika
- Lux / Lakshi (referred to as “Lux”)
- Sanjay
- Arian
- Salman Khan
- Joti
- RN L (appears as “RN” in chat/roll call)
References/resources mentioned
- W3Schools
- Microsoft Live Server / Live Preview extensions
- YouTube playlist / YouTube link (reference link mentioned)
- MDN Web Docs