SENG1050 Cheatsheet · Web Technologies · Rules, Syntax & Decisions

University of Newcastle · memory aid cheat sheet for the final exam. Semester 2 final exam period, 16–27 November 2026. Full SENG1050 study guide →

A4 landscape · 7pt · 6 columns · ink + yellow · print at 100% 2 sides · SENG1050 · University of Newcastle
SENG1050
Web Technologies · Rules, Syntax & Decisions
University of Newcastle · Computer Science · Level 1
SENG1050 cheatsheet QR code – open the full SENG1050 study guide
Full guide + ask Sia about SENG1050
SIDE 1/2   EXAM MAP · W1–12 METHODS · CODE SHAPES · CHOOSERS MEMORY AIDT3 2026 · final 40% · v2

0 · Exam Map COURSE DATA · FAQ

Quiz 20%WA1 15%WA2 25%Final 40%
AssessmentWeightFormat
Mid-Semester Quiz (Assessment 1)20%Individual online quiz, Week 7; Weeks 1–5
Web-Based Assignment 1 (Assessment 2)15%Individual web assignment, Week 6
Web-Based Assignment 2 (Assessment 3)25%Individual web assignment, Week 12
Final Exam (Assessment 4)40%Formal examination; exam review sets 40% minimum

Permitted materials · verbatim"What can I bring into the exam hall? Stationery. Non-programmable calculator. 1 A4 memory aid." (SENG1050 Formal Examination FAQs)

Practice-paper shape: 120 min + 10 min reading; A: 10 MCQ/20 marks; B: 6 short answers/50; C: 3 long answers/30. Section C = code writing + Huffman.

1 · Networks & Addressing W1–2

busringstarmesh
LAN shapes: star is cheap and manageable but its central switch is a single failure point; mesh trades cables for resilience.
SwitchingRule / cost
CircuitDedicated reserved path; reliable, but wastes capacity.
MessageWhole message stored then forwarded; needs large buffers.
Virtual circuitPackets share a pre-set route; setup first.
DatagramEach packet independent; Internet method; loss/order handled above.

Routing chooses an end-to-end path and builds the table; forwarding uses header + table to move one arriving packet to an output. IP names/routes unreliably; TCP adds connection, ordering and reliability. Ports identify applications: HTTP 80, HTTPS 443.

httpsshopex…com.aucatalogfileprotohostdomainfolder
URL anatomy: https://shop.example.com.au/catalogue/index.html; use relative URLs within your own site.

IPv4 block → 8 bits using 128 64 32 16 8 4 2 1.
CIDR a.b.c.d/x: x leading bits identify network.
HTTP class: 1 info · 2 success · 3 redirect · 4 client · 5 server error.

2 · HTML Structure W2

Minimal valid document<!DOCTYPE html>
<html><head><meta charset="UTF-8">
<title>…</title></head>
<body><h1>…</h1>…</body></html>

NeedUse / rule
Meaningh1–h6, strong, em, lists; appearance belongs in CSS.
Link<a href="…" >; relative inside site, absolute outside; #id for fragment.
Imagesrc plus useful alt text; no end tag.
Reserved text&lt; for <; character references prevent parsing as markup.
ValidationFix the first reported error, then validate again.

Head = metadata, title, encoding. Body = displayed content. An element is start tag + content + end tag; void elements have no content/end tag. Phrasing content cannot contain block content such as p.

3 · XML + DTD Method W3 · STARRED

menu rootdishdishname · pricename
Read XML as one tree: exactly one root; element children are ordered; attributes attach to their element.
TestMust hold
Well-formedDeclaration first; one root; close every element; proper nesting; quoted attributes; case matches.
ValidWell-formed and conforms to its DTD: legal elements, order and attributes.
TextPCDATA is parsed; CDATA leaves raw text alone; < and & otherwise need entities.

<!ELEMENT menu (dish+)>
<!ELEMENT dish (name,price?)>
<!ATTLIST dish type CDATA #IMPLIED>
none=exactly 1 · +=1+ · *=0+ · ?=0/1
, = sequence · | = choice

Exam First classify well-formed versus valid; a syntactically correct tree may still violate the DTD.

4 · CSS Rule Selection W4 · STARRED

marginbordercontentpaddingoutside → margin
Box model inside→out: content, padding, border, margin. Default width names content only; border-box includes padding + border.
SelectorMeaning
div p / div > pAny descendant / direct child.

5 · Forms + Layout W5

headernavmainarticle · articleasidefooter
Semantic outline: one visible main; article stands alone; aside is tangential; header/footer may belong to page or section.
GETPOST
name=value pairs appended after ? in URLValues in request body
Bookmark/share; searches and filtersLogins, payments, stored-data changes
Length-limited; never sensitive dataNo practical size limit; still needs secure transport

Every control needs a name; it becomes the server key. Match label for to control id. Radios in one group share a name and allow one value; checkboxes allow several. Group with fieldset + legend. Form action = receiving program.

Table: caption → thead/tbody → tr → th/td.
colspan reduces cells in that row; rowspan occupies position in later rows.

LayoutBehaviour
normal flowBlocks stack; inline boxes run along a line.
relativeOffset; original gap remains.
absoluteOut of flow; nearest positioned ancestor.
fixed / stickyViewport-fixed / normal until threshold.
flexArranges children on row or column axis.

6 · Client–Server + PHP W6

>clientpresentationapplicationprocessingdatabasestoragerequest → process → response
Three tiers separate presentation, processing and storage so each can scale and be secured independently.
Client–serverPeer-to-peer
Central storage, trusted source, one place for rules/backup.Each device is client and server; contributes resources.
Server may be failure point, target and bottleneck.No central control; harder security/consistency.

Apache: document root publishes files; virtual hosts allow multiple sites. ServerSignature Off + ServerTokens Prod reduce leakage. Browser gets PHP output, not source.

$qty=(int)$_GET["qty"];
$price=(float)$_GET["price"];
$total=$qty*$price;
echo "<p>$total</p>";

7 · CMS + XPath W7

>templateXML dataPHP engineHTML page
Templating: shared layout + page-specific XML feed one PHP engine; change common navigation once.

CMA = authorised administrative back end that creates/edits content. CDA = public read-only front end that compiles/caches pages. Apply least privilege.

XPathSelects
/cinema/filmAbsolute path from root.
//titleEvery title at any depth.
film[1]First film; XPath positions start at 1.
film[@rating]Films having rating attribute.
film[@id="f1"]/titleTitle of matched film.
* / @*Any element / attribute.

$xml=simplexml_load_file("films.xml");
$nodes=$xml->xpath('//film[@rating]');
foreach($nodes as $film) echo $film->title;

xpath() returns an array; use [0] for first node. XPath counts from 1; PHP arrays from 0. Attribute: $film["rating"].

CSS conflict checkpoint

source priority → specificity IDs | classes+pseudo | elements → exact tie: later rule wins.

One ID outranks any number of classes. External CSS holds rules only. Link reset before your sheet. px = 1/96 inch; em follows parent; rem follows root.

8 · JavaScript + DOM W8

windowdocumentformelementsget by id
DOM access starts at document: through named forms/elements or directly through a unique id.

function checkQty(){
var q=document.getElementById("qty").value;
if(q===""){alert("Enter quantity");return false;}
return true;}
<form onsubmit="return checkQty();">

ControlRead / fail test
text.value === ""
checkbox.checked true/false
radio groupLoop; at least one checked
selectselectedIndex is 0-based

9 · Site Design + SEO W9

linear: fixed orderhomesectionsectionsection
Use linear for ordered tutorials; hierarchy for general→specific sites. Keep depth within the three-click rule.
DesignApplication
RepetitionConsistent elements/navigation.
ContrastAttention + readable colour difference.
ProximityGroup related items.
AlignmentCreate visual unity.
AccessibilityPerceivable, operable, understandable, robust.

Speed: size/compress/lazy-load images; defer blocking JS; load essential CSS first. The lecture warns that pages over about three seconds lose roughly half their traffic. Responsive: flexible layout + media queries.

Structure: linear suits fixed sequences; augmented linear adds a return-to-start link; hierarchy suits categories. Avoid a hierarchy so deep that the three-click rule fails or so broad that menus exceed about four manageable chunks.

SEO: unique title, meta description, natural keywords, alt text, clear links and trusted inbound links. A sitemap helps large or new sites with few external links. Crawlers read markup/text. SEO = organic; paid listings = search marketing.

10 · Encoding + Compression W10 · CERTAIN

>generatork bitsappendk−1 zerosXOR longdivisionappendremainderreceiver divides transmitted bitsremainder 0 → no error detected
CRC: generator width fixes appended zeros and remainder width; modulo-2 subtraction is XOR.
MethodRule
ParityMakes ones even/odd; can miss two flips.
CRCPolynomial→bits; append k−1 zeros; XOR-divide.
Run lengthCount+symbol for repeated runs.
HuffmanMerge two lowest; left 0/right 1; prefix-free.
Lossless/lossyExact reconstruction / discards detail.

original=characters×8
compressed=Σ(frequency×code length)
saving=1−compressed/original

Huffman ties may change codes, not total bits. State tie rule. ASCII = 7 bits; Unicode covers over a million characters; UTF-8 uses 8-bit units. Week 10 marks CRC + Huffman as certain exam content.

11 · Encryption Chooser W11

BobAlice publicAlice privateonly Alicereadsencrypt public → decrypt private
Confidentiality uses the recipient’s pair: encrypt with Alice’s public key; decrypt with Alice’s private key.
GoalMethod
ConfidentialityRecipient public → recipient private.
Origin + integrityHash; sender private signs; sender public verifies.
Fast bulk dataSymmetric shared key.
Trust a keyCertificate authority signs identity+public key.

Goals: authentication, integrity, non-repudiation, confidentiality. TLS/PGP use asymmetric encryption to carry a random session key, then symmetric encryption for data. A certificate contains owner identity and public key, issuer, validity period, serial number and issuer signature.

RSA: primes p,q → n=pq → φ=(p−1)(q−1) → public e coprime with φ → private d: ed≡1 (mod φ).

Substitution preserves frequencies; transposition reorders; XOR flips bits. A counterfeit-key attacker substitutes a directory key; certificate signatures defend the binding. Always name whose key.

12 · Security, Privacy, Ethics W12

1 recon2 compromise3 foothold4 privilege5 internal recon6 move7 persist8 mission9 erase traces
Nine stages: break the chain at any point with layered controls, least privilege, updates, authentication and monitoring.
PairDistinction
Virus / wormHost file must run / spreads unaided.
Phishing / pharmingDeceives person / alters DNS mapping.
DoSFloods service so real users cannot be served.
Opt-in / opt-outNothing until agreement / collected unless refused.

Cookies are text files, not executable, but permit tracking. Personally identifiable information identifies, locates or contacts a person. Informed consent follows full relevant disclosure. Ethics asks right/wrong; law is government-made rules—legal need not mean ethical.

Answer Threat → attack stage → targeted layered defence → how it breaks that stage.

asksia.ai/cheatsheet/uon-seng1050 · Full SENG1050 study guide → · side 1/2
Your exam allows one A4 memory aid. Check the course outline for sides and format before you print.
Forward this to your tutorial groupShared by ________
v2 · 2026-10-16
Semester 2 final exam period, 16–27 November 2026.
SENG1050
Web Technologies · Worked Methods & Fast Recall
University of Newcastle · final exam drills · write every step
SENG1050 cheatsheet QR code – open the full SENG1050 study guide
Full guide + ask Sia about SENG1050
SIDE 2/2   METHOD CHOOSER · CODE SKELETONS · 5 WORKED EXAMPLES · TRAPS MEMORY AIDshow working · validate · state assumptions

13 · Final-Question Triage REVIEW + PRACTICE

prompt verb?explainvalid codeshow steps
Triage by output: theory needs the deciding distinction; code needs valid syntax and flow; calculation needs every intermediate state.
Prompt clueWrite this method
Path / resourceLabel URL; relative versus absolute.
XML correctnessWell-formed checklist, then DTD validity.
CSS conflictSource → specificity ID/class/type → later tie.
Form sentmethod→URL/body; name→key; cast server input.
Select XMLXPath path/predicate; 1-based positions.
Stop submitBoolean JS + return false/true.
CRCgenerator → zeros → XOR → remainder → check.
Huffmancounts → merges → codes → bits → saving/ratio.
Secret / signaturerecipient public / sender private.
Incidentthreat → cycle stage → defence.

Long answer Allocate time by marks. Skeleton first; final pass for tags, braces, semicolons, names, branch labels and ratio direction.

14 · HTTP + Web Stack Recall W1–2 · W6

ItemExam sentence
DNSMaps memorable name to numeric IP.
HTTPBrowser requests; server returns status, headers, body.
SMTPSends email over TCP/IP using store-and-forward.
Web ≠ InternetWeb is one service using Internet infrastructure.
PHP ≠ JSServer-side output / browser-side visible source.

GET /catalogue/index.html HTTP/1.1
Host: shop.example.com.au
2xx success · 3xx redirect · 4xx client · 5xx server

IPv4 drill: convert each decimal block separately into exactly eight bits. DNS drill: names help people; routers need numeric IP addresses.

httpsshopex…com.aucatalogfileproto · host · domain · folder · file
From the same catalogue folder, the shortest link to this resource is href="index.html".

15 · Worked 1: CSS Box CH4 WORKED EXAMPLE

Given: width 200px, padding 10px, border 2px, margin 15px.

content 200+ 2×10 padding + 2×2 border = 224+ 2×15 margin = 254 occupiedmargin 15 each side
Default content-box arithmetic adds two horizontal sides at every layer.
  1. Visible border box = 200 + 2×10 + 2×2 = 224px.
  2. Occupied space = 224 + 2×15 = 254px.
  3. With box-sizing:border-box, border box = 200px and content = 200 − 20 − 4 = 176px.

Trap Margin never enters declared border-box width; it remains outside.

16 · HTML + Form Build Order W2 · W5 · SECTION C

>namedcontrolsGET URL /POST bodyPHPresponselabel↔id · name→key · action→programvalidate client + validate server
Submission chain: label/id aids use; name becomes key; method carries it; action chooses receiver.
  1. Doctype, html, head/title, body, one h1.
  2. Form action + method; labels/controls with matching for/id and name.
  3. Correct types; radios share name; submit control.
  4. One JS validation hook with return.
  5. Close non-void elements; validate generated HTML.
Semantic choiceDeciding test
articleCould it be published independently?
asideIs it tangential support?
navIs it a major navigation block?
mainUnique visible central content.
headernavmainarticle · articleasidefooter
Outline before styling: regions convey role to readers, assistive technology and crawlers.
ControlCritical attributes
Text/numbertype, id, name, value/range as needed.
Radio groupSame name, distinct values; only one selected.
CheckboxesSeveral may be checked and share a name.
Selectoption values; JavaScript selectedIndex is 0-based.

17 · Worked 2: DOM Read CH8 WORKED EXAMPLE

Given: form named order, text box named and identified as qty.

documentorder.qty.valuegetElementById("qty").value
Both routes begin at document; one follows named form objects, the other a unique id.

document.order.qty.value
document.getElementById("qty").value

Answer: both read the same value and start from document under window. The second route reaches any element with that unique id.

Trap getElementById is case-sensitive; final d is lower-case.

18 · JavaScript Long Answer PRACTICE PAPER

<script>
function total(){
 var p=document.getElementById("price").value;
 var q=document.getElementById("quantity").value;
 if(p===""||q===""){
  alert("Complete both fields");return false;
 }
 alert(Number(p)*Number(q));
 return true;
}
</script>

CheckReason
Valid page shellQuestion asks for an HTML page.
Exact idsDOM lookup is case-sensitive.
Numeric conversionForm values begin as text; + may join.
false on failurePrevents submit after alert.
clear names/commentReduces tracing mistakes.

Use either onsubmit="return total();" or button onclick, not both. Client validation can be bypassed.

19b · XML→PHP→HTML Drill W7

XML dataserver fileSimpleXMLXPath + loopHTMLbrowserload → select → foreach → echo
The browser receives generated HTML; the XML and PHP source remain on the server.

20 · Worked 3: CRC CH10 WORKED EXAMPLE

Given: message 110101; generator x³ + 1 = 1001.

110101 + 000 → 110101000110101000⊕ 1001= 010001000 → 000011000→ 000001010 → 000000011rem 011 · send 110101011
Modulo-2 division uses XOR, no carries or borrows; preserve leading zeros in the three-bit remainder.
  1. Generator has 4 bits; append 3 zeros: 110101000.
  2. XOR: 010001000 → 000011000 → 000001010 → 000000011.
  3. Remainder 011; transmit 110101011.
  4. Receiver divides by 1001 and gets 000: no error detected.

Self-check Remainder width k−1 = 3. Zero detects no error; it does not prove correctness.

21 · Error/Compression Traps W10

TrapCorrection
Append generator length zerosAppend one fewer.
Ordinary subtractionUse XOR only.
Drop leading zerosKeep width k−1.
Huffman prefixNo code begins another.
Saving=compressed/originalThat is retained; saving=1−it.
Unlabelled ratioState direction.

Parity: one flip changes parity; two can preserve it. Run length: good for runs, poor for alternating data. Dictionary: replaces repeated phrases. Lossy media trades detail for size.

22 · CRC/Huffman Chooser W10

If asked for…Finish with…
Error detectionTransmitted bits + receiver remainder.
Prefix treeCodes and encoded message.
Space savedOriginal bits, compressed bits, percentage.
Exact ratioSimplified labelled original:compressed.
Encoding / formatWhat to say
ASCII7 bits, 128 values; uppercase/lowercase have distinct codes.
Unicode / UTF-8Over a million characters; UTF-8 uses 8-bit units and keeps ASCII compatibility.

23 · Worked 4: Huffman COURSE WORKED EXAMPLE

Encode: coffeetoffee (12 characters).

1284f 4e 4o 2c+t 20110110c 1110 · t 1111
One valid tie-break: f 0, e 10, o 110, c 1110, t 1111. Left=0, right=1.
  1. Counts: f 4, e 4, o 2, c 1, t 1; total 12.
  2. Merge c+t→2; o+2→4; e+4→8; f+8→12.
  3. Codes: f 0; e 10; o 110; c 1110; t 1111.
  4. Message: 11101100010101111110001010 = 26 bits.
  5. Original 12×8=96. Saving 1−26/96=70/96≈72.9%. Original:compressed=96:26=48:13.

bit check = 4×1 + 4×2 + 2×3 + 1×4 + 1×4 = 26

Trap Ties may change codes, not total. Show merges so the tree is traceable.

24 · Decode / Verify W10

CheckExpected
Frequencies/rootBoth total 12.
PrefixNo code begins another.
DecodeRoot per bit; emit at leaf; restart.
Bit totalΣ frequency×length = 26.
PercentageRetained 27.1%; saving 72.9%.

Build + decode

StageInvariant
CountEvery source symbol appears once in the frequency list.
MergeChoose the two lowest available weights; insert their sum.
LabelUse one direction as 0 and the other as 1 throughout.
CodeRead root→leaf; frequent symbols normally have short paths.
DecodeStart at root, follow each bit, emit only on a leaf, restart.
MeasureDo not count the tree itself unless the question asks; use stated 8-bit original assumption.

Prefix-free: no code begins another, so symbol endings need no separators. A violation means the tree was read wrongly.

Ties: several valid trees may result. Record merge order; verify length by frequency×depth and direct bit count.

Compression ideaRecognition rule
Prefix codeNo code is the start of another; separators are unnecessary.

25 · Worked 5: Key Choice CH11 WORKED EXAMPLE

CONFIDENTIALITYBob: Alice public → Alice: Alice privateSIGNATUREAlice private: sign → Alice public: verify
Name owner + key type; “the public key” is ambiguous.
  1. Only Alice reads Bob’s contract: Bob encrypts with Alice’s public key.
  2. Only Alice holds Alice’s private key, so only she decrypts.
  3. Alice proves reply: hash, sign digest with Alice’s private key.
  4. Bob verifies with Alice’s public key and compares his digest: match supports origin + integrity.

Counterfeit key: attacker replaces a directory key, reads, re-encrypts with genuine key and forwards. A certificate authority signature binds identity to public key; verify chain and validity period.

26 · Attack/Defence Drill W12 METHOD

studywebsitemaliciousfileinstallbackdoorgainadminreconbreachfootholdprivilegefilter · MFA · least privilege · patch
Classify by attacker goal: learn → get in → stay in → gain power.
EventStage + defence
Studies websiteRecon; limit exposed technical detail.
Opens attachmentCompromise; filtering + awareness.
Backdoor installedFoothold; patching + monitoring.
Admin rights gainedPrivilege escalation; MFA + least privilege.

A virus copies into files and needs its host run; a worm spreads unaided. Phishing deceives a person; pharming alters DNS so a genuine address reaches a spoofed site. Not all malware is a virus.

Privacy: cookies are text, not code, but enable tracking. Opt-in requires agreement first; opt-out collects until refused.

27 · One-Minute Error Scan ALL WEEKS

  • Routing ≠ forwarding; Web ≠ Internet.
  • XML valid includes DTD; HTML meaning before appearance.
  • ID specificity before classes; margin outside width.
  • GET visible in URL; POST not automatically encrypted.
  • XPath starts 1; PHP array starts 0.
  • JS + joins; PHP . joins; cast values.
  • CRC width = generator bits − 1.
asksia.ai/cheatsheet/uon-seng1050 · Full SENG1050 study guide → · side 2/2
Your exam allows one A4 memory aid. Check the course outline for sides and format before you print.
Forward this to your tutorial groupShared by ________
v2 · 2026-10-16
Semester 2 final exam period, 16–27 November 2026.

Want one for YOUR exact syllabus?

Sia is your free desktop study agent. Drop your University of Newcastle SENG1050 slides — Sia builds a sheet tailored to YOUR exam. Better than this library because it knows YOUR materials.

↓ Download Sia · Free