Add multilingual language and systems learning tracks
This commit is contained in:
1 parent
07338189fc
commit
d8d1c40118
844 files changed
+6061
No files matched your search
@@ -0,0 +1,9 @@
|
||||
# BASIC — first steps
|
||||
|
||||
[Agila University track](https://edu.agilaos.com/track.php?track=21&lang=en)
|
||||
|
||||
About 15 minutes per lesson. Predict, run, change, explain, then complete the check in University.
|
||||
|
||||
- [Lesson 1: Your first explainable program](lesson-1/lesson.html)
|
||||
- [Lesson 2: Values and decisions](lesson-2/lesson.html)
|
||||
- [Lesson 3: Functions and a clear policy](lesson-3/lesson.html)
|
||||
@@ -0,0 +1,4 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Your first explainable program</title><h1>Your first explainable program</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A program is a set of instructions. Read the example from its entry point to the output statement. Text in quotes is data; the output operation is an instruction. Predict the printed line before running. Change only the message, run again, then remove one required punctuation mark and read the first error. Restore the working source.</p><p>Line numbers describe program order. <code>GOSUB</code> visits a subroutine and <code>RETURN</code> resumes the caller. <code>SYSTEM</code> exits this interpreter. BASIC dialects differ: a 6502 or Z80 computer does not automatically run this exact dialect.</p><pre><code class="language-basic">10 REM Change the message
|
||||
20 PRINT "Ready"
|
||||
30 SYSTEM
|
||||
</code></pre><p><strong>Expected result:</strong> <code>Ready</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://packages.ubuntu.com/noble/bwbasic">Language reference</a></p></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
10 REM Change the message
|
||||
20 PRINT "Ready"
|
||||
30 SYSTEM
|
||||
@@ -0,0 +1,5 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Values and decisions</title><h1>Values and decisions</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A decision chooses which statements run. The policy here is “ready at 80 or higher.” Trace 85, 79, 80, and 81 before running each case. The comparison includes 80. A program that prints the right answer for 85 may still be wrong at the boundary. Add a separate check rejecting scores below 0 or above 100; rejection and needing practice mean different things.</p><p>Line numbers describe program order. <code>GOSUB</code> visits a subroutine and <code>RETURN</code> resumes the caller. <code>SYSTEM</code> exits this interpreter. BASIC dialects differ: a 6502 or Z80 computer does not automatically run this exact dialect.</p><pre><code class="language-basic">10 LET S = 85
|
||||
20 IF S >= 80 THEN PRINT "Ready"
|
||||
30 IF S < 80 THEN PRINT "Practice"
|
||||
40 SYSTEM
|
||||
</code></pre><p><strong>Expected result:</strong> <code>Ready</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://packages.ubuntu.com/noble/bwbasic">Language reference</a></p></html>
|
||||
@@ -0,0 +1,4 @@
|
||||
10 LET S = 85
|
||||
20 IF S >= 80 THEN PRINT "Ready"
|
||||
30 IF S < 80 THEN PRINT "Practice"
|
||||
40 SYSTEM
|
||||
@@ -0,0 +1,9 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Functions and a clear policy</title><h1>Functions and a clear policy</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A function or subroutine names a reusable calculation. Our policy accepts nonnegative total and completed counts and returns zero when completed reaches or exceeds total. Otherwise it returns their difference. Trace (4,1), (4,4), (4,5), and (0,0). Keep printing separate from calculation. Write down why negative inputs are outside this exercise’s domain, then design an explicit rejection policy before accepting external input.</p><p>Line numbers describe program order. <code>GOSUB</code> visits a subroutine and <code>RETURN</code> resumes the caller. <code>SYSTEM</code> exits this interpreter. BASIC dialects differ: a 6502 or Z80 computer does not automatically run this exact dialect.</p><pre><code class="language-basic">30 LET T=4
|
||||
40 LET D=1
|
||||
50 GOSUB 200
|
||||
60 PRINT R
|
||||
70 SYSTEM
|
||||
200 LET R=T-D
|
||||
210 IF R<0 THEN LET R=0
|
||||
220 RETURN
|
||||
</code></pre><p><strong>Expected result:</strong> <code>3</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://packages.ubuntu.com/noble/bwbasic">Language reference</a></p></html>
|
||||
@@ -0,0 +1,8 @@
|
||||
30 LET T=4
|
||||
40 LET D=1
|
||||
50 GOSUB 200
|
||||
60 PRINT R
|
||||
70 SYSTEM
|
||||
200 LET R=T-D
|
||||
210 IF R<0 THEN LET R=0
|
||||
220 RETURN
|
||||
@@ -0,0 +1,9 @@
|
||||
# BASIC — build and test
|
||||
|
||||
[Agila University track](https://edu.agilaos.com/track.php?track=21&lang=en)
|
||||
|
||||
About 15 minutes per lesson. Predict, run, change, explain, then complete the check in University.
|
||||
|
||||
- [Lesson 1: Collections and repeated work](lesson-1/lesson.html)
|
||||
- [Lesson 2: A language feature worth understanding](lesson-2/lesson.html)
|
||||
- [Lesson 3: Build, break, and test a study planner](lesson-3/lesson.html)
|
||||
@@ -0,0 +1,11 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Collections and repeated work</title><h1>Collections and repeated work</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A collection stores related values. The loop visits 1, 2, and 3, updating the total from 0 to 1, then 3, then 6. Record this trace rather than guessing. Identify the first and last valid positions in this language: Pascal can declare a 1-based array, while many other examples use zero-based containers. Add another value and update the bounds correctly. Explain what an empty collection should produce.</p><p>Line numbers describe program order. <code>GOSUB</code> visits a subroutine and <code>RETURN</code> resumes the caller. <code>SYSTEM</code> exits this interpreter. BASIC dialects differ: a 6502 or Z80 computer does not automatically run this exact dialect.</p><pre><code class="language-basic">10 DIM M(3)
|
||||
20 LET M(1)=1
|
||||
30 LET M(2)=2
|
||||
40 LET M(3)=3
|
||||
50 LET T=0
|
||||
60 FOR I=1 TO 3
|
||||
70 LET T=T+M(I)
|
||||
80 NEXT I
|
||||
90 PRINT T
|
||||
100 SYSTEM
|
||||
</code></pre><p><strong>Expected result:</strong> <code>6</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://packages.ubuntu.com/noble/bwbasic">Language reference</a></p></html>
|
||||
@@ -0,0 +1,10 @@
|
||||
10 DIM M(3)
|
||||
20 LET M(1)=1
|
||||
30 LET M(2)=2
|
||||
40 LET M(3)=3
|
||||
50 LET T=0
|
||||
60 FOR I=1 TO 3
|
||||
70 LET T=T+M(I)
|
||||
80 NEXT I
|
||||
90 PRINT T
|
||||
100 SYSTEM
|
||||
@@ -0,0 +1,6 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>A language feature worth understanding</title><h1>A language feature worth understanding</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>Use the language note below to explain this example’s state changes. Identify what is copied, what is shared, what can fail, and what is released. Only some of those questions apply to this particular program: say which ones. Make one deliberate change, predict the effect, and compare it with the actual result. A familiar-looking operator in another language may obey a different rule.</p><p>Line numbers describe program order. <code>GOSUB</code> visits a subroutine and <code>RETURN</code> resumes the caller. <code>SYSTEM</code> exits this interpreter. BASIC dialects differ: a 6502 or Z80 computer does not automatically run this exact dialect.</p><p>The MOD expression deliberately models an unsigned 8-bit wrap: 255 + 1 becomes 0 modulo 256. It does not change the BASIC interpreter’s numeric representation or emulate a 6502 CPU.</p><pre><code class="language-basic">10 REM An 8-bit unsigned wrap is modeled explicitly
|
||||
20 LET VALUE=255
|
||||
30 LET WRAPPED=(VALUE+1) MOD 256
|
||||
40 PRINT WRAPPED
|
||||
50 SYSTEM
|
||||
</code></pre><p><strong>Expected result:</strong> <code>0</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://packages.ubuntu.com/noble/bwbasic">Language reference</a></p></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
10 REM An 8-bit unsigned wrap is modeled explicitly
|
||||
20 LET VALUE=255
|
||||
30 LET WRAPPED=(VALUE+1) MOD 256
|
||||
40 PRINT WRAPPED
|
||||
50 SYSTEM
|
||||
@@ -0,0 +1,10 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Build, break, and test a study planner</title><h1>Build, break, and test a study planner</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A useful test compares a result with a requirement. The planner must never report negative remaining work for its stated nonnegative input domain. Run the starter, then deliberately remove the protection for completed counts above total. At least one check should fail. Restore it. Add two named study tasks, a summary, and boundary cases. Save the source and evidence on Agila Forge. Explain every line, including anything suggested by AI.</p><p>Line numbers describe program order. <code>GOSUB</code> visits a subroutine and <code>RETURN</code> resumes the caller. <code>SYSTEM</code> exits this interpreter. BASIC dialects differ: a 6502 or Z80 computer does not automatically run this exact dialect.</p><pre><code class="language-basic">10 LET T=4
|
||||
20 LET D=5
|
||||
30 GOSUB 200
|
||||
40 IF R<>0 THEN PRINT "Test failed"
|
||||
50 IF R=0 THEN PRINT "Passed"
|
||||
60 SYSTEM
|
||||
200 LET R=T-D
|
||||
210 IF R<0 THEN LET R=0
|
||||
220 RETURN
|
||||
</code></pre><p><strong>Expected result:</strong> <code>Passed</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://packages.ubuntu.com/noble/bwbasic">Language reference</a></p></html>
|
||||
@@ -0,0 +1,9 @@
|
||||
10 LET T=4
|
||||
20 LET D=5
|
||||
30 GOSUB 200
|
||||
40 IF R<>0 THEN PRINT "Test failed"
|
||||
50 IF R=0 THEN PRINT "Passed"
|
||||
60 SYSTEM
|
||||
200 LET R=T-D
|
||||
210 IF R<0 THEN LET R=0
|
||||
220 RETURN
|
||||
@@ -0,0 +1,9 @@
|
||||
# C — first steps
|
||||
|
||||
[Agila University track](https://edu.agilaos.com/track.php?track=12&lang=en)
|
||||
|
||||
About 15 minutes per lesson. Predict, run, change, explain, then complete the check in University.
|
||||
|
||||
- [Lesson 1: Your first explainable program](lesson-1/lesson.html)
|
||||
- [Lesson 2: Values and decisions](lesson-2/lesson.html)
|
||||
- [Lesson 3: Functions and a clear policy](lesson-3/lesson.html)
|
||||
@@ -0,0 +1,8 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Your first explainable program</title><h1>Your first explainable program</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A program is a set of instructions. Read the example from its entry point to the output statement. Text in quotes is data; the output operation is an instruction. Predict the printed line before running. Change only the message, run again, then remove one required punctuation mark and read the first error. Restore the working source.</p><p>C begins at <code>main</code>. <code>stdio.h</code> declares output functions; <code>puts</code> adds a newline. Semicolons terminate statements. An integer and a pointer are different kinds of value.</p><pre><code class="language-c">#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
int main(void) {
|
||||
puts("Ready");
|
||||
return 0;
|
||||
}
|
||||
</code></pre><p><strong>Expected result:</strong> <code>Ready</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://gcc.gnu.org/onlinedocs/gcc/Standards.html">Language reference</a></p></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
int main(void) {
|
||||
puts("Ready");
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Values and decisions</title><h1>Values and decisions</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A decision chooses which statements run. The policy here is “ready at 80 or higher.” Trace 85, 79, 80, and 81 before running each case. The comparison includes 80. A program that prints the right answer for 85 may still be wrong at the boundary. Add a separate check rejecting scores below 0 or above 100; rejection and needing practice mean different things.</p><p>C begins at <code>main</code>. <code>stdio.h</code> declares output functions; <code>puts</code> adds a newline. Semicolons terminate statements. An integer and a pointer are different kinds of value.</p><pre><code class="language-c">#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
int main(void) {
|
||||
int score = 85;
|
||||
if (score >= 80) puts("Ready"); else puts("Practice");
|
||||
return 0;
|
||||
}
|
||||
</code></pre><p><strong>Expected result:</strong> <code>Ready</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://gcc.gnu.org/onlinedocs/gcc/Standards.html">Language reference</a></p></html>
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
int main(void) {
|
||||
int score = 85;
|
||||
if (score >= 80) puts("Ready"); else puts("Practice");
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Functions and a clear policy</title><h1>Functions and a clear policy</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A function or subroutine names a reusable calculation. Our policy accepts nonnegative total and completed counts and returns zero when completed reaches or exceeds total. Otherwise it returns their difference. Trace (4,1), (4,4), (4,5), and (0,0). Keep printing separate from calculation. Write down why negative inputs are outside this exercise’s domain, then design an explicit rejection policy before accepting external input.</p><p>C begins at <code>main</code>. <code>stdio.h</code> declares output functions; <code>puts</code> adds a newline. Semicolons terminate statements. An integer and a pointer are different kinds of value.</p><pre><code class="language-c">#include <stdio.h>
|
||||
#include <assert.h>
|
||||
int remaining(int total, int done) { return done >= total ? 0 : total - done; }
|
||||
int main(void) {
|
||||
printf("%d\n", remaining(4, 1));
|
||||
return 0;
|
||||
}
|
||||
</code></pre><p><strong>Expected result:</strong> <code>3</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://gcc.gnu.org/onlinedocs/gcc/Standards.html">Language reference</a></p></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
int remaining(int total, int done) { return done >= total ? 0 : total - done; }
|
||||
int main(void) {
|
||||
printf("%d\n", remaining(4, 1));
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# C — build and test
|
||||
|
||||
[Agila University track](https://edu.agilaos.com/track.php?track=12&lang=en)
|
||||
|
||||
About 15 minutes per lesson. Predict, run, change, explain, then complete the check in University.
|
||||
|
||||
- [Lesson 1: Collections and repeated work](lesson-1/lesson.html)
|
||||
- [Lesson 2: A language feature worth understanding](lesson-2/lesson.html)
|
||||
- [Lesson 3: Build, break, and test a study planner](lesson-3/lesson.html)
|
||||
@@ -0,0 +1,11 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Collections and repeated work</title><h1>Collections and repeated work</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A collection stores related values. The loop visits 1, 2, and 3, updating the total from 0 to 1, then 3, then 6. Record this trace rather than guessing. Identify the first and last valid positions in this language: Pascal can declare a 1-based array, while many other examples use zero-based containers. Add another value and update the bounds correctly. Explain what an empty collection should produce.</p><p>C begins at <code>main</code>. <code>stdio.h</code> declares output functions; <code>puts</code> adds a newline. Semicolons terminate statements. An integer and a pointer are different kinds of value.</p><pre><code class="language-c">#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
int main(void) {
|
||||
int minutes[] = {1, 2, 3};
|
||||
int total = 0;
|
||||
for (size_t i = 0; i < sizeof minutes / sizeof minutes[0]; ++i) total += minutes[i];
|
||||
printf("%d\n", total);
|
||||
return 0;
|
||||
}
|
||||
</code></pre><p><strong>Expected result:</strong> <code>6</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://gcc.gnu.org/onlinedocs/gcc/Standards.html">Language reference</a></p></html>
|
||||
@@ -0,0 +1,10 @@
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
int main(void) {
|
||||
int minutes[] = {1, 2, 3};
|
||||
int total = 0;
|
||||
for (size_t i = 0; i < sizeof minutes / sizeof minutes[0]; ++i) total += minutes[i];
|
||||
printf("%d\n", total);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>A language feature worth understanding</title><h1>A language feature worth understanding</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>Use the language note below to explain this example’s state changes. Identify what is copied, what is shared, what can fail, and what is released. Only some of those questions apply to this particular program: say which ones. Make one deliberate change, predict the effect, and compare it with the actual result. A familiar-looking operator in another language may obey a different rule.</p><p>C begins at <code>main</code>. <code>stdio.h</code> declares output functions; <code>puts</code> adds a newline. Semicolons terminate statements. An integer and a pointer are different kinds of value.</p><p><code>address</code> points to the live local variable <code>completed</code>; <code>*address</code> updates that variable. Never return a pointer to an expired local or use an arbitrary numeric address.</p><pre><code class="language-c">#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
int main(void) {
|
||||
int completed = 2;
|
||||
int *address = &completed;
|
||||
*address += 1;
|
||||
printf("%d\n", completed);
|
||||
return 0;
|
||||
}
|
||||
</code></pre><p><strong>Expected result:</strong> <code>3</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://gcc.gnu.org/onlinedocs/gcc/Standards.html">Language reference</a></p></html>
|
||||
@@ -0,0 +1,10 @@
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
int main(void) {
|
||||
int completed = 2;
|
||||
int *address = &completed;
|
||||
*address += 1;
|
||||
printf("%d\n", completed);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Build, break, and test a study planner</title><h1>Build, break, and test a study planner</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A useful test compares a result with a requirement. The planner must never report negative remaining work for its stated nonnegative input domain. Run the starter, then deliberately remove the protection for completed counts above total. At least one check should fail. Restore it. Add two named study tasks, a summary, and boundary cases. Save the source and evidence on Agila Forge. Explain every line, including anything suggested by AI.</p><p>C begins at <code>main</code>. <code>stdio.h</code> declares output functions; <code>puts</code> adds a newline. Semicolons terminate statements. An integer and a pointer are different kinds of value.</p><pre><code class="language-c">#include <stdio.h>
|
||||
#include <assert.h>
|
||||
int remaining(int total, int done) { return done >= total ? 0 : total - done; }
|
||||
int main(void) {
|
||||
assert(remaining(4,1)==3);
|
||||
assert(remaining(4,4)==0);
|
||||
assert(remaining(4,5)==0);
|
||||
assert(remaining(0,0)==0);
|
||||
puts("Passed");
|
||||
return 0;
|
||||
}
|
||||
</code></pre><p><strong>Expected result:</strong> <code>Passed</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://gcc.gnu.org/onlinedocs/gcc/Standards.html">Language reference</a></p></html>
|
||||
@@ -0,0 +1,11 @@
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
int remaining(int total, int done) { return done >= total ? 0 : total - done; }
|
||||
int main(void) {
|
||||
assert(remaining(4,1)==3);
|
||||
assert(remaining(4,4)==0);
|
||||
assert(remaining(4,5)==0);
|
||||
assert(remaining(0,0)==0);
|
||||
puts("Passed");
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# C++ — first steps
|
||||
|
||||
[Agila University track](https://edu.agilaos.com/track.php?track=13&lang=en)
|
||||
|
||||
About 15 minutes per lesson. Predict, run, change, explain, then complete the check in University.
|
||||
|
||||
- [Lesson 1: Your first explainable program](lesson-1/lesson.html)
|
||||
- [Lesson 2: Values and decisions](lesson-2/lesson.html)
|
||||
- [Lesson 3: Functions and a clear policy](lesson-3/lesson.html)
|
||||
@@ -0,0 +1,9 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Your first explainable program</title><h1>Your first explainable program</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A program is a set of instructions. Read the example from its entry point to the output statement. Text in quotes is data; the output operation is an instruction. Predict the printed line before running. Change only the message, run again, then remove one required punctuation mark and read the first error. Restore the working source.</p><p><code>std::cout</code> writes output. <code>std::vector</code> manages a growing sequence and releases its storage when its lifetime ends. The lab selects C++17; an example that compiles under a different standard needs its settings recorded.</p><pre><code class="language-cpp">#include <iostream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
int main() {
|
||||
std::cout << "Ready\n";
|
||||
}
|
||||
</code></pre><p><strong>Expected result:</strong> <code>Ready</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://isocpp.org/get-started">Language reference</a></p></html>
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
int main() {
|
||||
std::cout << "Ready\n";
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Values and decisions</title><h1>Values and decisions</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A decision chooses which statements run. The policy here is “ready at 80 or higher.” Trace 85, 79, 80, and 81 before running each case. The comparison includes 80. A program that prints the right answer for 85 may still be wrong at the boundary. Add a separate check rejecting scores below 0 or above 100; rejection and needing practice mean different things.</p><p><code>std::cout</code> writes output. <code>std::vector</code> manages a growing sequence and releases its storage when its lifetime ends. The lab selects C++17; an example that compiles under a different standard needs its settings recorded.</p><pre><code class="language-cpp">#include <iostream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
int main() {
|
||||
int score = 85;
|
||||
std::cout << (score >= 80 ? "Ready" : "Practice") << "\n";
|
||||
}
|
||||
</code></pre><p><strong>Expected result:</strong> <code>Ready</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://isocpp.org/get-started">Language reference</a></p></html>
|
||||
@@ -0,0 +1,9 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
int main() {
|
||||
int score = 85;
|
||||
std::cout << (score >= 80 ? "Ready" : "Practice") << "\n";
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Functions and a clear policy</title><h1>Functions and a clear policy</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A function or subroutine names a reusable calculation. Our policy accepts nonnegative total and completed counts and returns zero when completed reaches or exceeds total. Otherwise it returns their difference. Trace (4,1), (4,4), (4,5), and (0,0). Keep printing separate from calculation. Write down why negative inputs are outside this exercise’s domain, then design an explicit rejection policy before accepting external input.</p><p><code>std::cout</code> writes output. <code>std::vector</code> manages a growing sequence and releases its storage when its lifetime ends. The lab selects C++17; an example that compiles under a different standard needs its settings recorded.</p><pre><code class="language-cpp">#include <iostream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
int remaining(int total, int done) { return done >= total ? 0 : total - done; }
|
||||
int main() {
|
||||
std::cout << remaining(4, 1) << "\n";
|
||||
}
|
||||
</code></pre><p><strong>Expected result:</strong> <code>3</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://isocpp.org/get-started">Language reference</a></p></html>
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
int remaining(int total, int done) { return done >= total ? 0 : total - done; }
|
||||
int main() {
|
||||
std::cout << remaining(4, 1) << "\n";
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# C++ — build and test
|
||||
|
||||
[Agila University track](https://edu.agilaos.com/track.php?track=13&lang=en)
|
||||
|
||||
About 15 minutes per lesson. Predict, run, change, explain, then complete the check in University.
|
||||
|
||||
- [Lesson 1: Collections and repeated work](lesson-1/lesson.html)
|
||||
- [Lesson 2: A language feature worth understanding](lesson-2/lesson.html)
|
||||
- [Lesson 3: Build, break, and test a study planner](lesson-3/lesson.html)
|
||||
@@ -0,0 +1,12 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Collections and repeated work</title><h1>Collections and repeated work</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A collection stores related values. The loop visits 1, 2, and 3, updating the total from 0 to 1, then 3, then 6. Record this trace rather than guessing. Identify the first and last valid positions in this language: Pascal can declare a 1-based array, while many other examples use zero-based containers. Add another value and update the bounds correctly. Explain what an empty collection should produce.</p><p><code>std::cout</code> writes output. <code>std::vector</code> manages a growing sequence and releases its storage when its lifetime ends. The lab selects C++17; an example that compiles under a different standard needs its settings recorded.</p><pre><code class="language-cpp">#include <iostream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
int main() {
|
||||
std::vector<int> minutes{1, 2, 3};
|
||||
int total = 0;
|
||||
for (int value : minutes) total += value;
|
||||
std::cout << total << "\n";
|
||||
}
|
||||
</code></pre><p><strong>Expected result:</strong> <code>6</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://isocpp.org/get-started">Language reference</a></p></html>
|
||||
@@ -0,0 +1,11 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
int main() {
|
||||
std::vector<int> minutes{1, 2, 3};
|
||||
int total = 0;
|
||||
for (int value : minutes) total += value;
|
||||
std::cout << total << "\n";
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>A language feature worth understanding</title><h1>A language feature worth understanding</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>Use the language note below to explain this example’s state changes. Identify what is copied, what is shared, what can fail, and what is released. Only some of those questions apply to this particular program: say which ones. Make one deliberate change, predict the effect, and compare it with the actual result. A familiar-looking operator in another language may obey a different rule.</p><p><code>std::cout</code> writes output. <code>std::vector</code> manages a growing sequence and releases its storage when its lifetime ends. The lab selects C++17; an example that compiles under a different standard needs its settings recorded.</p><p>The vector copy owns a separate sequence. Appending to it leaves the original length at 2 while the copy has 3. This differs from copying a reference to a shared object.</p><pre><code class="language-cpp">#include <iostream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
int main() {
|
||||
std::vector<std::string> plan{"Read", "Test"};
|
||||
auto copy = plan;
|
||||
copy.push_back("Explain");
|
||||
std::cout << plan.size() << " " << copy.size() << "\n";
|
||||
}
|
||||
</code></pre><p><strong>Expected result:</strong> <code>2 3</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://isocpp.org/get-started">Language reference</a></p></html>
|
||||
@@ -0,0 +1,11 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
int main() {
|
||||
std::vector<std::string> plan{"Read", "Test"};
|
||||
auto copy = plan;
|
||||
copy.push_back("Explain");
|
||||
std::cout << plan.size() << " " << copy.size() << "\n";
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Build, break, and test a study planner</title><h1>Build, break, and test a study planner</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A useful test compares a result with a requirement. The planner must never report negative remaining work for its stated nonnegative input domain. Run the starter, then deliberately remove the protection for completed counts above total. At least one check should fail. Restore it. Add two named study tasks, a summary, and boundary cases. Save the source and evidence on Agila Forge. Explain every line, including anything suggested by AI.</p><p><code>std::cout</code> writes output. <code>std::vector</code> manages a growing sequence and releases its storage when its lifetime ends. The lab selects C++17; an example that compiles under a different standard needs its settings recorded.</p><pre><code class="language-cpp">#include <iostream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
int remaining(int total, int done) { return done >= total ? 0 : total - done; }
|
||||
int main() {
|
||||
assert(remaining(4,1)==3);
|
||||
assert(remaining(4,4)==0);
|
||||
assert(remaining(4,5)==0);
|
||||
assert(remaining(0,0)==0);
|
||||
std::cout << "Passed\n";
|
||||
}
|
||||
</code></pre><p><strong>Expected result:</strong> <code>Passed</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://isocpp.org/get-started">Language reference</a></p></html>
|
||||
@@ -0,0 +1,12 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
int remaining(int total, int done) { return done >= total ? 0 : total - done; }
|
||||
int main() {
|
||||
assert(remaining(4,1)==3);
|
||||
assert(remaining(4,4)==0);
|
||||
assert(remaining(4,5)==0);
|
||||
assert(remaining(0,0)==0);
|
||||
std::cout << "Passed\n";
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# C# — first steps
|
||||
|
||||
[Agila University track](https://edu.agilaos.com/track.php?track=14&lang=en)
|
||||
|
||||
About 15 minutes per lesson. Predict, run, change, explain, then complete the check in University.
|
||||
|
||||
- [Lesson 1: Your first explainable program](lesson-1/lesson.html)
|
||||
- [Lesson 2: Values and decisions](lesson-2/lesson.html)
|
||||
- [Lesson 3: Functions and a clear policy](lesson-3/lesson.html)
|
||||
@@ -0,0 +1,9 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Your first explainable program</title><h1>Your first explainable program</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A program is a set of instructions. Read the example from its entry point to the output statement. Text in quotes is data; the output operation is an instruction. Predict the printed line before running. Change only the message, run again, then remove one required punctuation mark and read the first error. Restore the working source.</p><p><code>Main</code> is the entry method inside <code>Program</code>. <code>Console.WriteLine</code> prints a line. A class instance can have several references to the same object; assigning a reference does not clone the object.</p><pre><code class="language-csharp">using System;
|
||||
using System.Collections.Generic;
|
||||
class Program {
|
||||
|
||||
static void Main() {
|
||||
Console.WriteLine("Ready");
|
||||
}
|
||||
}
|
||||
</code></pre><p><strong>Expected result:</strong> <code>Ready</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://learn.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/">Language reference</a></p></html>
|
||||
@@ -0,0 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
class Program {
|
||||
|
||||
static void Main() {
|
||||
Console.WriteLine("Ready");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Values and decisions</title><h1>Values and decisions</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A decision chooses which statements run. The policy here is “ready at 80 or higher.” Trace 85, 79, 80, and 81 before running each case. The comparison includes 80. A program that prints the right answer for 85 may still be wrong at the boundary. Add a separate check rejecting scores below 0 or above 100; rejection and needing practice mean different things.</p><p><code>Main</code> is the entry method inside <code>Program</code>. <code>Console.WriteLine</code> prints a line. A class instance can have several references to the same object; assigning a reference does not clone the object.</p><pre><code class="language-csharp">using System;
|
||||
using System.Collections.Generic;
|
||||
class Program {
|
||||
|
||||
static void Main() {
|
||||
int score = 85;
|
||||
Console.WriteLine(score >= 80 ? "Ready" : "Practice");
|
||||
}
|
||||
}
|
||||
</code></pre><p><strong>Expected result:</strong> <code>Ready</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://learn.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/">Language reference</a></p></html>
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
class Program {
|
||||
|
||||
static void Main() {
|
||||
int score = 85;
|
||||
Console.WriteLine(score >= 80 ? "Ready" : "Practice");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Functions and a clear policy</title><h1>Functions and a clear policy</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A function or subroutine names a reusable calculation. Our policy accepts nonnegative total and completed counts and returns zero when completed reaches or exceeds total. Otherwise it returns their difference. Trace (4,1), (4,4), (4,5), and (0,0). Keep printing separate from calculation. Write down why negative inputs are outside this exercise’s domain, then design an explicit rejection policy before accepting external input.</p><p><code>Main</code> is the entry method inside <code>Program</code>. <code>Console.WriteLine</code> prints a line. A class instance can have several references to the same object; assigning a reference does not clone the object.</p><pre><code class="language-csharp">using System;
|
||||
using System.Collections.Generic;
|
||||
class Program {
|
||||
static int Remaining(int total, int done) { return done >= total ? 0 : total - done; }
|
||||
static void Main() {
|
||||
Console.WriteLine(Remaining(4, 1));
|
||||
}
|
||||
}
|
||||
</code></pre><p><strong>Expected result:</strong> <code>3</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://learn.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/">Language reference</a></p></html>
|
||||
@@ -0,0 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
class Program {
|
||||
static int Remaining(int total, int done) { return done >= total ? 0 : total - done; }
|
||||
static void Main() {
|
||||
Console.WriteLine(Remaining(4, 1));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# C# — build and test
|
||||
|
||||
[Agila University track](https://edu.agilaos.com/track.php?track=14&lang=en)
|
||||
|
||||
About 15 minutes per lesson. Predict, run, change, explain, then complete the check in University.
|
||||
|
||||
- [Lesson 1: Collections and repeated work](lesson-1/lesson.html)
|
||||
- [Lesson 2: A language feature worth understanding](lesson-2/lesson.html)
|
||||
- [Lesson 3: Build, break, and test a study planner](lesson-3/lesson.html)
|
||||
@@ -0,0 +1,12 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Collections and repeated work</title><h1>Collections and repeated work</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A collection stores related values. The loop visits 1, 2, and 3, updating the total from 0 to 1, then 3, then 6. Record this trace rather than guessing. Identify the first and last valid positions in this language: Pascal can declare a 1-based array, while many other examples use zero-based containers. Add another value and update the bounds correctly. Explain what an empty collection should produce.</p><p><code>Main</code> is the entry method inside <code>Program</code>. <code>Console.WriteLine</code> prints a line. A class instance can have several references to the same object; assigning a reference does not clone the object.</p><pre><code class="language-csharp">using System;
|
||||
using System.Collections.Generic;
|
||||
class Program {
|
||||
|
||||
static void Main() {
|
||||
int[] minutes = {1, 2, 3};
|
||||
int total = 0;
|
||||
foreach (int value in minutes) total += value;
|
||||
Console.WriteLine(total);
|
||||
}
|
||||
}
|
||||
</code></pre><p><strong>Expected result:</strong> <code>6</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://learn.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/">Language reference</a></p></html>
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
class Program {
|
||||
|
||||
static void Main() {
|
||||
int[] minutes = {1, 2, 3};
|
||||
int total = 0;
|
||||
foreach (int value in minutes) total += value;
|
||||
Console.WriteLine(total);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>A language feature worth understanding</title><h1>A language feature worth understanding</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>Use the language note below to explain this example’s state changes. Identify what is copied, what is shared, what can fail, and what is released. Only some of those questions apply to this particular program: say which ones. Make one deliberate change, predict the effect, and compare it with the actual result. A familiar-looking operator in another language may obey a different rule.</p><p><code>Main</code> is the entry method inside <code>Program</code>. <code>Console.WriteLine</code> prints a line. A class instance can have several references to the same object; assigning a reference does not clone the object.</p><pre><code class="language-csharp">using System;
|
||||
using System.Collections.Generic;
|
||||
class Program {
|
||||
class Plan { public int Done = 2; }
|
||||
static void Main() {
|
||||
var plan = new Plan();
|
||||
var alias = plan;
|
||||
alias.Done = 3;
|
||||
Console.WriteLine(plan.Done);
|
||||
}
|
||||
}
|
||||
</code></pre><p><strong>Expected result:</strong> <code>3</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://learn.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/">Language reference</a></p></html>
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
class Program {
|
||||
class Plan { public int Done = 2; }
|
||||
static void Main() {
|
||||
var plan = new Plan();
|
||||
var alias = plan;
|
||||
alias.Done = 3;
|
||||
Console.WriteLine(plan.Done);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Build, break, and test a study planner</title><h1>Build, break, and test a study planner</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A useful test compares a result with a requirement. The planner must never report negative remaining work for its stated nonnegative input domain. Run the starter, then deliberately remove the protection for completed counts above total. At least one check should fail. Restore it. Add two named study tasks, a summary, and boundary cases. Save the source and evidence on Agila Forge. Explain every line, including anything suggested by AI.</p><p><code>Main</code> is the entry method inside <code>Program</code>. <code>Console.WriteLine</code> prints a line. A class instance can have several references to the same object; assigning a reference does not clone the object.</p><pre><code class="language-csharp">using System;
|
||||
using System.Collections.Generic;
|
||||
class Program {
|
||||
static int Remaining(int total, int done) { return done >= total ? 0 : total - done; }
|
||||
static void Main() {
|
||||
if (Remaining(4,1)!=3 || Remaining(4,4)!=0 || Remaining(4,5)!=0 || Remaining(0,0)!=0)
|
||||
throw new Exception("Test failed");
|
||||
Console.WriteLine("Passed");
|
||||
}
|
||||
}
|
||||
</code></pre><p><strong>Expected result:</strong> <code>Passed</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://learn.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/">Language reference</a></p></html>
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
class Program {
|
||||
static int Remaining(int total, int done) { return done >= total ? 0 : total - done; }
|
||||
static void Main() {
|
||||
if (Remaining(4,1)!=3 || Remaining(4,4)!=0 || Remaining(4,5)!=0 || Remaining(0,0)!=0)
|
||||
throw new Exception("Test failed");
|
||||
Console.WriteLine("Passed");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# CPU Architecture & Portability · 1
|
||||
|
||||
[Agila University track](https://edu.agilaos.com/track.php?track=22&lang=en)
|
||||
|
||||
About 15 minutes per lesson. Predict, run, change, explain, then complete the check in University.
|
||||
|
||||
- [Lesson 1: Source, machine code, and ISA](lesson-1/lesson.html)
|
||||
- [Lesson 2: Bits, bytes, and integer width](lesson-2/lesson.html)
|
||||
- [Lesson 3: Endianness is a byte-order rule](lesson-3/lesson.html)
|
||||
@@ -0,0 +1,3 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Source, machine code, and ISA</title><h1>Source, machine code, and ISA</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A CPU executes instructions from its instruction-set architecture (ISA). Source text needs a compiler or interpreter. The same Python source may work on x86-64 and Arm64 when each has a compatible interpreter; a compiled x86-64 executable is a different artifact. Print the lab machine’s architecture, then write a table separating source language, ISA, operating system, and runtime. An emulator implements another machine’s behavior and is not the same as recompilation.</p><pre><code class="language-python">import platform
|
||||
print(platform.machine())
|
||||
</code></pre><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html">Language reference: www.intel.com</a></p><p><a href="https://developer.arm.com/Architectures/Learn%20the%20Architecture">Language reference: developer.arm.com</a></p><p><a href="https://docs.riscv.org/">Language reference: docs.riscv.org</a></p></html>
|
||||
@@ -0,0 +1,2 @@
|
||||
import platform
|
||||
print(platform.machine())
|
||||
@@ -0,0 +1,5 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Bits, bytes, and integer width</title><h1>Bits, bytes, and integer width</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>Eight bits represent 256 bit patterns. Unsigned 8-bit values range from 0 to 255. The model uses modulo arithmetic to wrap 256 to zero; Python integers do not naturally have this fixed width. Compare signed and unsigned interpretations of 255. Predict the range for 16 bits. Do not infer pointer size or a language’s integer size solely from a CPU’s marketing name.</p><pre><code class="language-python">bits=8
|
||||
print(2**bits)
|
||||
print((255+1) % (2**bits))
|
||||
</code></pre><p><strong>Expected result:</strong> <code>256
|
||||
0</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html">Language reference: www.intel.com</a></p><p><a href="https://developer.arm.com/Architectures/Learn%20the%20Architecture">Language reference: developer.arm.com</a></p><p><a href="https://docs.riscv.org/">Language reference: docs.riscv.org</a></p></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
bits=8
|
||||
print(2**bits)
|
||||
print((255+1) % (2**bits))
|
||||
@@ -0,0 +1,5 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Endianness is a byte-order rule</title><h1>Endianness is a byte-order rule</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>The number 0x1234 can be stored as bytes 34 12 in little-endian order or 12 34 in big-endian order. The number is unchanged; the representation changes. Run both conversions and decode them back. A file or network protocol must specify byte order instead of copying a host struct blindly. C struct padding and alignment are separate concerns.</p><pre><code class="language-python">value=0x1234
|
||||
print(value.to_bytes(2,"little").hex())
|
||||
print(value.to_bytes(2,"big").hex())
|
||||
</code></pre><p><strong>Expected result:</strong> <code>3412
|
||||
1234</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html">Language reference: www.intel.com</a></p><p><a href="https://developer.arm.com/Architectures/Learn%20the%20Architecture">Language reference: developer.arm.com</a></p><p><a href="https://docs.riscv.org/">Language reference: docs.riscv.org</a></p></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
value=0x1234
|
||||
print(value.to_bytes(2,"little").hex())
|
||||
print(value.to_bytes(2,"big").hex())
|
||||
@@ -0,0 +1,9 @@
|
||||
# CPU Architecture & Portability · 2
|
||||
|
||||
[Agila University track](https://edu.agilaos.com/track.php?track=22&lang=en)
|
||||
|
||||
About 15 minutes per lesson. Predict, run, change, explain, then complete the check in University.
|
||||
|
||||
- [Lesson 1: Compare x86-64, Arm64, and RISC-V](lesson-1/lesson.html)
|
||||
- [Lesson 2: BASIC on 6502, Z80, and modern hosts](lesson-2/lesson.html)
|
||||
- [Lesson 3: A reproducible portability report](lesson-3/lesson.html)
|
||||
@@ -0,0 +1 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Compare x86-64, Arm64, and RISC-V</title><h1>Compare x86-64, Arm64, and RISC-V</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>x86-64, AArch64, and RV64 use different instruction encodings and register conventions. AArch64 names 64-bit general registers X0–X30; RV64I has x0–x31 with x0 fixed to zero. The ABI adds calling conventions, stack rules, and binary interfaces. Compare a function call in the official manuals, then list which assumptions a compiler backend must change. A shared 64-bit label does not make binaries interchangeable.</p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html">Language reference: www.intel.com</a></p><p><a href="https://developer.arm.com/Architectures/Learn%20the%20Architecture">Language reference: developer.arm.com</a></p><p><a href="https://docs.riscv.org/">Language reference: docs.riscv.org</a></p></html>
|
||||
@@ -0,0 +1 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>BASIC on 6502, Z80, and modern hosts</title><h1>BASIC on 6502, Z80, and modern hosts</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A BASIC dialect belongs to an interpreter or compiler, not directly to a CPU. Classic 6502 and Z80 systems often provided different BASIC dialects and device commands. Separate portable arithmetic from machine-specific graphics, PEEK/POKE addresses, and file commands. Port a three-line greeting by consulting the target dialect manual. In this lab Bywater runs on Linux; it does not emulate either historical machine.</p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html">Language reference: www.intel.com</a></p><p><a href="https://developer.arm.com/Architectures/Learn%20the%20Architecture">Language reference: developer.arm.com</a></p><p><a href="https://docs.riscv.org/">Language reference: docs.riscv.org</a></p></html>
|
||||
@@ -0,0 +1 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>A reproducible portability report</title><h1>A reproducible portability report</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>Choose one small program and two target environments. Record compiler/interpreter version, ISA, OS, input, expected result, actual result, and limitations. Distinguish compile success from a successful target execution. If only one target is available, mark the other untested. Use the official Intel, Arm, and RISC-V references linked in the course resources. Your next step is the core and memory mapping track.</p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html">Language reference: www.intel.com</a></p><p><a href="https://developer.arm.com/Architectures/Learn%20the%20Architecture">Language reference: developer.arm.com</a></p><p><a href="https://docs.riscv.org/">Language reference: docs.riscv.org</a></p></html>
|
||||
@@ -0,0 +1,9 @@
|
||||
# Build Open Agila OS · 1
|
||||
|
||||
[Agila University track](https://edu.agilaos.com/track.php?track=23&lang=en)
|
||||
|
||||
About 15 minutes per lesson. Predict, run, change, explain, then complete the check in University.
|
||||
|
||||
- [Lesson 1: Build the public kernel prototype](lesson-1/lesson.html)
|
||||
- [Lesson 2: Trace initialization honestly](lesson-2/lesson.html)
|
||||
- [Lesson 3: Model page translation](lesson-3/lesson.html)
|
||||
@@ -0,0 +1 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Build the public kernel prototype</title><h1>Build the public kernel prototype</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>The public open_kernel repository uses Ada, kernel.gpr, and a Makefile. make run builds and executes a host program. It is not a bootable bare-metal image. Main calls Kernel.Start. Inspect the current source before changing it; the reference revision is 9af96aa.</p><p><strong>Practice and evidence:</strong> Clone from Forge in your development environment, install GNAT and gprbuild, run make and make run, and record the exact commit and output. The browser lab is single-file; use your own development environment for this multi-file build.</p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://git.agilaos.com/matt/open_kernel">Language reference: git.agilaos.com</a></p><p><a href="https://git.agilaos.com/matt/agila_open_tool">Language reference: git.agilaos.com</a></p></html>
|
||||
@@ -0,0 +1 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Trace initialization honestly</title><h1>Trace initialization honestly</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>Kernel.Start calls CPU, Memory, Console, Interrupt, Timer, and Scheduler initialization. Several bodies currently contain null. The subsequent initialized messages do not prove those subsystems exist. Trace each call into its body and classify it as implemented behavior, host-backed behavior, or a stub.</p><p><strong>Practice and evidence:</strong> Create an evidence table with file, procedure, observable behavior, and one test still needed. Console currently uses Ada.Text_IO, which relies on the host runtime.</p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://git.agilaos.com/matt/open_kernel">Language reference: git.agilaos.com</a></p><p><a href="https://git.agilaos.com/matt/agila_open_tool">Language reference: git.agilaos.com</a></p></html>
|
||||
@@ -0,0 +1,6 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Model page translation</title><h1>Model page translation</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A virtual address can be split into page number and offset. This model uses 4096-byte pages and a dictionary from virtual page to physical frame. Real page tables also encode permissions and are managed by architecture-specific hardware and kernel code. This is a model, not access to real physical memory.</p><p><strong>Practice and evidence:</strong> Predict the output, remove mapping 2, and handle the missing page explicitly. Add read/write permissions to your model and a test that denies a write.</p><pre><code class="language-python">page_size=4096
|
||||
table={2:7}
|
||||
address=2*page_size+13
|
||||
page,offset=divmod(address,page_size)
|
||||
print(table[page]*page_size+offset)
|
||||
</code></pre><p><strong>Expected result:</strong> <code>28685</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://git.agilaos.com/matt/open_kernel">Language reference: git.agilaos.com</a></p><p><a href="https://git.agilaos.com/matt/agila_open_tool">Language reference: git.agilaos.com</a></p></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
page_size=4096
|
||||
table={2:7}
|
||||
address=2*page_size+13
|
||||
page,offset=divmod(address,page_size)
|
||||
print(table[page]*page_size+offset)
|
||||
@@ -0,0 +1,9 @@
|
||||
# Build Open Agila OS · 2
|
||||
|
||||
[Agila University track](https://edu.agilaos.com/track.php?track=23&lang=en)
|
||||
|
||||
About 15 minutes per lesson. Predict, run, change, explain, then complete the check in University.
|
||||
|
||||
- [Lesson 1: A scheduler with observable order](lesson-1/lesson.html)
|
||||
- [Lesson 2: Interrupts and driver boundaries](lesson-2/lesson.html)
|
||||
- [Lesson 3: From host prototype toward a bootable system](lesson-3/lesson.html)
|
||||
@@ -0,0 +1,9 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>A scheduler with observable order</title><h1>A scheduler with observable order</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A scheduler chooses which runnable task receives a turn. Model round-robin with a queue. Each task consumes one unit before returning to the queue if work remains. This deterministic model omits interrupts, context switching, and true parallel execution.</p><p><strong>Practice and evidence:</strong> Trace A=2 and B=1, then add an empty task and document whether it should enter the runnable queue. Test fairness by checking the execution order.</p><pre><code class="language-python">from collections import deque
|
||||
ready=deque([("A",2),("B",1)])
|
||||
order=[]
|
||||
while ready:
|
||||
name,left=ready.popleft()
|
||||
order.append(name)
|
||||
if left>1: ready.append((name,left-1))
|
||||
print(" ".join(order))
|
||||
</code></pre><p><strong>Expected result:</strong> <code>A B A</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://git.agilaos.com/matt/open_kernel">Language reference: git.agilaos.com</a></p><p><a href="https://git.agilaos.com/matt/agila_open_tool">Language reference: git.agilaos.com</a></p></html>
|
||||
@@ -0,0 +1,8 @@
|
||||
from collections import deque
|
||||
ready=deque([("A",2),("B",1)])
|
||||
order=[]
|
||||
while ready:
|
||||
name,left=ready.popleft()
|
||||
order.append(name)
|
||||
if left>1: ready.append((name,left-1))
|
||||
print(" ".join(order))
|
||||
@@ -0,0 +1 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Interrupts and driver boundaries</title><h1>Interrupts and driver boundaries</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A hardware interrupt transfers control through architecture-specific entry code. A host callback is not a hardware interrupt. A driver validates device state, manages buffers, and observes ordering rules. Begin with a fake device so you can test invalid lengths and timeouts without writing to arbitrary hardware addresses.</p><p><strong>Practice and evidence:</strong> Design a read(buffer,length) contract with success, invalid argument, and timeout outcomes. Write one test per outcome before choosing an emulator and documented device.</p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://git.agilaos.com/matt/open_kernel">Language reference: git.agilaos.com</a></p><p><a href="https://git.agilaos.com/matt/agila_open_tool">Language reference: git.agilaos.com</a></p></html>
|
||||
@@ -0,0 +1 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>From host prototype toward a bootable system</title><h1>From host prototype toward a bootable system</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A bootable kernel needs a chosen target, boot protocol, linker layout, freestanding runtime, exception entry, memory management, and drivers. The current repository does not supply all of these. Choose one small contribution: replace a stub with a tested host model, add a boundary test, or document an interface. Later milestones must boot in an emulator and prove each subsystem through observations.</p><p><strong>Practice and evidence:</strong> Create a Forge branch, commit the change and test evidence, and open a pull request. Your report must distinguish a host test from a boot test. A track certificate records these lesson checks; it is not a claim that a production OS is complete.</p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://git.agilaos.com/matt/open_kernel">Language reference: git.agilaos.com</a></p><p><a href="https://git.agilaos.com/matt/agila_open_tool">Language reference: git.agilaos.com</a></p></html>
|
||||
@@ -0,0 +1,9 @@
|
||||
# Server OS Engineering · 1
|
||||
|
||||
[Agila University track](https://edu.agilaos.com/track.php?track=24&lang=en)
|
||||
|
||||
About 15 minutes per lesson. Predict, run, change, explain, then complete the check in University.
|
||||
|
||||
- [Lesson 1: What makes a server operating system?](lesson-1/lesson.html)
|
||||
- [Lesson 2: Service state and recovery](lesson-2/lesson.html)
|
||||
- [Lesson 3: Accounts and least privilege](lesson-3/lesson.html)
|
||||
@@ -0,0 +1 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>What makes a server operating system?</title><h1>What makes a server operating system?</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A server OS combines a kernel with boot and service management, storage, networking, accounts, updates, and recovery. Building a server distribution is different from writing a new kernel. Choose which goal your project has. Draw the request path from a network interface through a service to storage, and mark every trust boundary.</p><p><strong>Practice and evidence:</strong> Predict the example or draw its state transitions. Change one assumption, test the boundary, and record the actual result. Explain what this small model does not establish about a production system.</p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Service state and recovery</title><h1>Service state and recovery</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A service can be stopped, starting, ready, failed, or restarting. Readiness means it can serve its intended workload, not merely that a PID exists. A restart policy needs backoff and a limit to avoid an endless crash loop. Model startup failure and a dependency becoming available.</p><p><strong>Practice and evidence:</strong> Predict the example or draw its state transitions. Change one assumption, test the boundary, and record the actual result. Explain what this small model does not establish about a production system.</p><pre><code class="language-python">delays=[min(2**attempt,30) for attempt in range(6)]
|
||||
print(delays)
|
||||
</code></pre><p><strong>Expected result:</strong> <code>[1, 2, 4, 8, 16, 30]</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p></html>
|
||||
@@ -0,0 +1,2 @@
|
||||
delays=[min(2**attempt,30) for attempt in range(6)]
|
||||
print(delays)
|
||||
@@ -0,0 +1,6 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Accounts and least privilege</title><h1>Accounts and least privilege</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>Give each service only the files and capabilities it needs. Separate administrator access from application identity. Authentication asks who is calling; authorization asks which action that identity may perform. Test a student trying to read another student’s record. A hidden button is not an access-control check.</p><p><strong>Practice and evidence:</strong> Predict the example or draw its state transitions. Change one assumption, test the boundary, and record the actual result. Explain what this small model does not establish about a production system.</p><pre><code class="language-python">def can_read(caller,owner):
|
||||
return caller==owner
|
||||
assert can_read(7,7)
|
||||
assert not can_read(7,8)
|
||||
print("Passed")
|
||||
</code></pre><p><strong>Expected result:</strong> <code>Passed</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
def can_read(caller,owner):
|
||||
return caller==owner
|
||||
assert can_read(7,7)
|
||||
assert not can_read(7,8)
|
||||
print("Passed")
|
||||
@@ -0,0 +1,9 @@
|
||||
# Server OS Engineering · 2
|
||||
|
||||
[Agila University track](https://edu.agilaos.com/track.php?track=24&lang=en)
|
||||
|
||||
About 15 minutes per lesson. Predict, run, change, explain, then complete the check in University.
|
||||
|
||||
- [Lesson 1: Durable storage and restore tests](lesson-1/lesson.html)
|
||||
- [Lesson 2: Observe latency, errors, and capacity](lesson-2/lesson.html)
|
||||
- [Lesson 3: A server-system capstone](lesson-3/lesson.html)
|
||||
@@ -0,0 +1,6 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Durable storage and restore tests</title><h1>Durable storage and restore tests</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A backup is useful only if it restores the data and required metadata. Plan consistent database and repository snapshots together. A checksum detects changed bytes; it does not prove a database is logically valid. Define a recovery-point target and recovery-time target. Practice a restore in an isolated environment before an outage.</p><p><strong>Practice and evidence:</strong> Predict the example or draw its state transitions. Change one assumption, test the boundary, and record the actual result. Explain what this small model does not establish about a production system.</p><pre><code class="language-python">import hashlib
|
||||
original=b"study record v1"
|
||||
restored=bytes(original)
|
||||
assert hashlib.sha256(original).digest()==hashlib.sha256(restored).digest()
|
||||
print("Bytes match; application checks still needed")
|
||||
</code></pre><p><strong>Expected result:</strong> <code>Bytes match; application checks still needed</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
import hashlib
|
||||
original=b"study record v1"
|
||||
restored=bytes(original)
|
||||
assert hashlib.sha256(original).digest()==hashlib.sha256(restored).digest()
|
||||
print("Bytes match; application checks still needed")
|
||||
@@ -0,0 +1,6 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Observe latency, errors, and capacity</title><h1>Observe latency, errors, and capacity</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>Averages hide slow requests. Record a latency distribution, error count, resource use, and the measurement window. Avoid logging passwords or private payloads. The sample computes a median from fixed demonstration data; it is not a measurement of the server. Replace the data with a bounded local experiment and label its environment.</p><p><strong>Practice and evidence:</strong> Predict the example or draw its state transitions. Change one assumption, test the boundary, and record the actual result. Explain what this small model does not establish about a production system.</p><pre><code class="language-python">from statistics import median
|
||||
samples_ms=[2,3,3,4,40]
|
||||
print(median(samples_ms))
|
||||
print(max(samples_ms))
|
||||
</code></pre><p><strong>Expected result:</strong> <code>3
|
||||
40</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p></html>
|
||||
@@ -0,0 +1,4 @@
|
||||
from statistics import median
|
||||
samples_ms=[2,3,3,4,40]
|
||||
print(median(samples_ms))
|
||||
print(max(samples_ms))
|
||||
@@ -0,0 +1 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>A server-system capstone</title><h1>A server-system capstone</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>Design a reproducible server image in a disposable VM: documented base, service user, firewall, HTTPS, update policy, backup, health check, and restore drill. Record a clean install and a controlled service failure. For an Agila-native server, list missing kernel and driver prerequisites instead of claiming a host application is a new OS. Publish source and a redacted evidence report on Forge.</p><p><strong>Practice and evidence:</strong> Predict the example or draw its state transitions. Change one assumption, test the boundary, and record the actual result. Explain what this small model does not establish about a production system.</p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p></html>
|
||||
@@ -0,0 +1,9 @@
|
||||
# AI Runtime Engineering · 1
|
||||
|
||||
[Agila University track](https://edu.agilaos.com/track.php?track=25&lang=en)
|
||||
|
||||
About 15 minutes per lesson. Predict, run, change, explain, then complete the check in University.
|
||||
|
||||
- [Lesson 1: What an AI runtime does](lesson-1/lesson.html)
|
||||
- [Lesson 2: Shapes before matrix multiplication](lesson-2/lesson.html)
|
||||
- [Lesson 3: Numerical tolerance and a reference](lesson-3/lesson.html)
|
||||
@@ -0,0 +1,6 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>What an AI runtime does</title><h1>What an AI runtime does</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A model describes parameters and operations. A runtime loads that representation, validates shapes and types, allocates memory, schedules operations, and executes kernels. Training and inference are different workflows. Begin with a tiny deterministic computation so correctness can be checked by hand before introducing acceleration.</p><p><strong>Practice and evidence:</strong> Predict the example or draw its state transitions. Change one assumption, test the boundary, and record the actual result. Explain what this small model does not establish about a production system.</p><pre><code class="language-python">x=[2.0,3.0]
|
||||
w=[0.5,2.0]
|
||||
bias=1.0
|
||||
y=sum(a*b for a,b in zip(x,w))+bias
|
||||
print(y)
|
||||
</code></pre><p><strong>Expected result:</strong> <code>8.0</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://git.agilaos.com/matt/open_agx">Language reference: git.agilaos.com</a></p><p><a href="https://onnx.ai/onnx/intro/">Language reference: onnx.ai</a></p></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
x=[2.0,3.0]
|
||||
w=[0.5,2.0]
|
||||
bias=1.0
|
||||
y=sum(a*b for a,b in zip(x,w))+bias
|
||||
print(y)
|
||||
@@ -0,0 +1,6 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Shapes before matrix multiplication</title><h1>Shapes before matrix multiplication</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>For A with shape m×k and B with shape k×n, the result has shape m×n. The inner dimensions must match. Check empty and ragged inputs before indexing. A shape check prevents some errors but cannot establish that the weights mean the right thing. The example is a small CPU reference, not a trained language model.</p><p><strong>Practice and evidence:</strong> Predict the example or draw its state transitions. Change one assumption, test the boundary, and record the actual result. Explain what this small model does not establish about a production system.</p><pre><code class="language-python">a=[[1,2],[3,4]]
|
||||
b=[[5],[6]]
|
||||
assert all(len(row)==len(b) for row in a)
|
||||
out=[[sum(a[i][k]*b[k][j] for k in range(len(b))) for j in range(len(b[0]))] for i in range(len(a))]
|
||||
print(out)
|
||||
</code></pre><p><strong>Expected result:</strong> <code>[[17], [39]]</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://git.agilaos.com/matt/open_agx">Language reference: git.agilaos.com</a></p><p><a href="https://onnx.ai/onnx/intro/">Language reference: onnx.ai</a></p></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
a=[[1,2],[3,4]]
|
||||
b=[[5],[6]]
|
||||
assert all(len(row)==len(b) for row in a)
|
||||
out=[[sum(a[i][k]*b[k][j] for k in range(len(b))) for j in range(len(b[0]))] for i in range(len(a))]
|
||||
print(out)
|
||||
@@ -0,0 +1,4 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Numerical tolerance and a reference</title><h1>Numerical tolerance and a reference</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>Floating-point calculations can differ slightly after reordering. Compare an optimized implementation with a trusted reference using documented absolute and relative tolerances, and reject NaN when it is not expected. Never choose an enormous tolerance merely to make a test pass. Test zero, negative values, large magnitudes, and the application’s normal range.</p><p><strong>Practice and evidence:</strong> Predict the example or draw its state transitions. Change one assumption, test the boundary, and record the actual result. Explain what this small model does not establish about a production system.</p><pre><code class="language-python">import math
|
||||
actual=0.1+0.2
|
||||
print(math.isclose(actual,0.3,rel_tol=1e-9,abs_tol=1e-12))
|
||||
</code></pre><p><strong>Expected result:</strong> <code>True</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://git.agilaos.com/matt/open_agx">Language reference: git.agilaos.com</a></p><p><a href="https://onnx.ai/onnx/intro/">Language reference: onnx.ai</a></p></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
import math
|
||||
actual=0.1+0.2
|
||||
print(math.isclose(actual,0.3,rel_tol=1e-9,abs_tol=1e-12))
|
||||
@@ -0,0 +1,9 @@
|
||||
# AI Runtime Engineering · 2
|
||||
|
||||
[Agila University track](https://edu.agilaos.com/track.php?track=25&lang=en)
|
||||
|
||||
About 15 minutes per lesson. Predict, run, change, explain, then complete the check in University.
|
||||
|
||||
- [Lesson 1: Plan memory lifetimes](lesson-1/lesson.html)
|
||||
- [Lesson 2: Quantization has an error budget](lesson-2/lesson.html)
|
||||
- [Lesson 3: An explainable runtime capstone](lesson-3/lesson.html)
|
||||
@@ -0,0 +1,4 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Plan memory lifetimes</title><h1>Plan memory lifetimes</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>An execution graph has values with creation and last-use points. Reuse a buffer only after its old value is no longer needed and no asynchronous operation is still using it. Weights, activations, temporary workspaces, and caches need separate accounting. Calculate element count times bytes per element, then include alignment and overhead in a real implementation.</p><p><strong>Practice and evidence:</strong> Predict the example or draw its state transitions. Change one assumption, test the boundary, and record the actual result. Explain what this small model does not establish about a production system.</p><pre><code class="language-python">shape=(4,8)
|
||||
bytes_per_element=4
|
||||
print(shape[0]*shape[1]*bytes_per_element)
|
||||
</code></pre><p><strong>Expected result:</strong> <code>128</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://git.agilaos.com/matt/open_agx">Language reference: git.agilaos.com</a></p><p><a href="https://onnx.ai/onnx/intro/">Language reference: onnx.ai</a></p></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
shape=(4,8)
|
||||
bytes_per_element=4
|
||||
print(shape[0]*shape[1]*bytes_per_element)
|
||||
@@ -0,0 +1,8 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Quantization has an error budget</title><h1>Quantization has an error budget</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>A simple symmetric quantizer divides by a scale, rounds, and clamps to an integer range. Dequantization multiplies by the scale. Clipping and rounding lose information. Measure both numerical error and the task’s accuracy before calling a smaller representation acceptable. This scalar exercise is not an implementation of every production quantization format.</p><p><strong>Practice and evidence:</strong> Predict the example or draw its state transitions. Change one assumption, test the boundary, and record the actual result. Explain what this small model does not establish about a production system.</p><pre><code class="language-python">value=0.36
|
||||
scale=0.1
|
||||
q=max(-127,min(127,round(value/scale)))
|
||||
restored=q*scale
|
||||
print(q)
|
||||
print(round(abs(value-restored),3))
|
||||
</code></pre><p><strong>Expected result:</strong> <code>4
|
||||
0.04</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://git.agilaos.com/matt/open_agx">Language reference: git.agilaos.com</a></p><p><a href="https://onnx.ai/onnx/intro/">Language reference: onnx.ai</a></p></html>
|
||||
Loaded 100 of 844 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user