-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
447 lines (439 loc) · 22.9 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
<!DOCTYPE html>
<!-- 22/9/21 - Nev Goodyer - Page revised from last year's cut and paste from Word, with it's hundreds of errors.
Yr12 SDD at Blackwattle Bay - starting in term 4 of 2021, graduating at the end of 2022
A simple index file to provide links to the version files.
-->
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Home: Arrays of records</title>
<meta charset="utf-8" />
<style type="text/css">
body {
background-color: rgb(229,230,243); /* #E5E6F3 */
}
table {
border-collapse: collapse;
width: 100%;
border: 1px solid #000;
}
th, td {
/*text-align: center;*/
padding: 10px;
border: 1px solid #000;
font-size: 16pt;
}
</style>
</head>
<body>
<h1>"Arrays of Records" in 4 languages.</h1>
<h2>Visual Basic (VB), JavaScript (JS), Python (Py) and Pascal (Pas) all have data structures for "arrays of records".
This repository uses "student" records with string, integer and float data types as the example.</h2>
<h3><b><span style="color: red">The repository for this site is at: </span></b><a href="https://github.com/bwattle/arrRecords"
title="Link to repository" target="_blank">https://github.com/bwattle/arrRecords</a></h3>
<h3><b><span style="color: green">The help docs for the project are at: </span></b><a href="js/AssTaskSteps.html"
title="Link to help docs" target="_blank">AssTaskSteps.html</a></h3>
The site gives practical examples of the NSW Software Development & Design
<a href="https://educationstandards.nsw.edu.au/wps/wcm/connect/0a5fce0b-d3a6-4ca9-9b9b-a8d96550f066/software-design-development-st6-syll-from2011(1)+Software+Design+and+Development.pdf?MOD=AJPERES&CVID="
title="Link to syllabus" target="_blank">syllabus</a>, sections 8.2.2 & 9.2.2. <br />
<br />
Students are encouraged to use the free "Community" version of
<a href="https://visualstudio.microsoft.com/downloads/">Visual Studio desktop </a>which integrates
with GitHub and runs all code except Pascal. Documents attached to this site step through the load,
switching between solutions, error messaging, break points and "Locals".
<br />
<br />
After an overview of the syntax for each language, students will use Visual Basic and possibly
JavaScript to build a Pizza ordering app, consolidating concepts of:
<br />
<ul>
<li>adding additional fields and the corresponding screen elements.</li>
<li>updating data and screen element dictionaries to keep track of additions.</li>
<li>ergonomics, consisting of "appropriate" screen elements and "tab order".<ul>
<li>text boxes</li>
<li>radio buttons</li>
<li>check boxes</li>
<li>a data picker</li>
<li>dropdown boxes for times</li>
</ul>
</li>
<li>constantly updating version numbers in:<ul>
<li>form header (VB & html)</li>
<li>page title (html)</li>
<li>links below</li>
</ul>
</li>
<li>validation, so that the app is "unbreakable" in 2 ways:
<ul>
<li>on submit.</li>
<li>on exit from each text box.</li>
</ul>
The 1.05 version is easily broken with an invalid date or character instead of a number.</li>
<li>the creation of a case insensitive search, possibly including non "utf-8" characters.</li>
<li>constantly dealing with VS "Errors", "Warnings" and "Messages", so that code is high quality.</li>
<li>handling "infinite loop" (runtime) and "logic" errors.</li>
<li>using the student database as a template for the development of a similar "Pizza" ordering database</li>
</ul>
<p>
Python and exe files are stored in the "Releases" section of GitHub.
Code files are in the repository. Links are provided below:
</p>
<table>
<tr>
<td><b>Version and link</b></td>
<td><b>Change notes</b></td>
</tr>
<tr>
<td>Pascal<br />
<br />
<a href="https://github.com/bwattle/arrRecords/blob/master/Pas/StDB-v105.pas"
title="Link to Pascal v1.05 code" target="_blank">code</a>
<br />
<br />
<a href="https://github.com/bwattle/arrRecords/releases/download/v1.05-Pas/StDB-Pas-v105.exe"
title="Link to Pascal v1.05 exe" target="_blank">exe</a>
<br />
<br />
<a href="https://github.com/bwattle/arrRecords/releases/download/v1.05-Pas/StDB-Pas-v105.zip"
title="Link to Pascal v1.05 zip of exe" target="_blank">zip</a> </td>
<td>The syntax of Pascal, being an older language, is imn many respects
similar to that used in our syllabus (now over 20 years old).
<ul>
<li>First, a record, "STUDENT" is defined as a "Type",
with its different data types.</li>
<li>Next, an array, "students" is declared to have up to
10 records and populated with 4 students. </li>
<li>Last, a loop concatenates the fields in each record and displays
on separate lines.</li>
</ul>
(Editing of this file can be done in <a href="https://sourceforge.net/projects/pascalxe/">Pascal XE</a>. a much simpler IDE than Free Pascal.)<br />
If security prevents the download of the exe, a zip is provided.</td>
</tr>
<tr>
<td>Python<br />
<br />
<a href="https://github.com/bwattle/arrRecords/blob/master/Py/StDB-105.py"
title="Link to Python v1.05 zip of exe" target="_blank">code</a>
<br />
<br />
<a href="https://github.com/bwattle/arrRecords/releases/download/v1.05-Py/StDB-105.py"
title="Link to Python v1.05 zip of exe" target="_blank">.py</a> </td>
<td>As a modern interprative language, Python uses "data objects",
allowing arrays to contain a multiple data types and other arrays.
This file uses a custom class to define and associative array, or dictionary, or map.
<ul>
<li>First, a class, "Student" is defined with the field
names. Note the UPPER case 1st letter.</li>
<li>Next, a concatenation function is defined as a print statement. </li>
<li>Last, the 4 records are loaded and then the concat function is called 4 times.
<br />
This file could be refined further, but the basics are here
to compare the structure of the "array of records".</li>
</ul>
Python can be run within Visual Studio with a break point and "Locals"
will show the distinct integer, float and string fields within each record.
</td>
</tr>
<tr>
<td>JavaScript<br />
v1.05<br />
<br />
<a href="https://github.com/bwattle/arrRecords/blob/master/JS/StDB-v105.html"
title="Link to JavaScript v1.05 code" target="_blank">code</a>
<br />
<br />
<a href="JS/StDB-v105.html" title="Link to JavaScript v1.05 page" target="_blank">page</a><br />
</td>
<td>Javascript is a very flexibe interprative language, with the "students"
array being declared as a "constant". Although changes can be
made to a constant, it's structure will remain immutable.
<ul>
<li>First, the 4 records are loaded with an integer, strings and a float.</li>
<li>Next, additional students can be added from the contents of text boxes.</li>
<li>Last, a loop allows the display of the full array of records.</li>
</ul>
An additional test box and paragraph are included at the end of the form for testing.
</td>
</tr>
<tr>
<td>VB StDB<br />
v1.05<br />
<br />
<a href="https://github.com/bwattle/arrRecords/blob/master/VB-StDB-v105/StDB105.vb"
title="Link to VB v1.05 zip of exe" target="_blank">code</a>
<br />
<br />
<a href="https://github.com/bwattle/arrRecords/releases/download/v1.05-VB/StDBv105.exe"
title="Link to VB v1.05 zip of exe" target="_blank">exe</a> </td>
<td>This language most closely simulates the pseudocode you may see in exams and will be the focus of later versions.
<ul>
<li>First, a public class STUDENT is is defined with field data types of int16, string, date, char and single.</li>
<li>Next, a public array is declared, allowing for 9 students (this is kept small to demonstrate overflow errors). The 4 startup test records are added and further records can be added from the form text boxes.</li>
<li>Last, "displayList" loops through a concatenation, allowing the display of the full array of records.</li>
</ul>
This form will be constantly improved with validation and improved screen elements.
</td>
</tr>
<tr>
<td>JavaScript<br />
v1.06<br />
<a href="https://github.com/bwattle/arrRecords/blob/master/JS/StDB-v106.html"
title="Link to JavaScript v1.06 zip of exe" target="_blank">code</a>
<br />
<br />
<a href="JS/StDB-v106.html" title="Link to JS v1.06 page" target="_blank">page</a></td>
<td>Fix the 1 Visual Studio "Warning".<br />
Change the version number in the "Title"<br />
Change the version number in the "h3" heading.<br />
Add a text box for phone number and a check box for "Paid"<br />
Add additional fields to the 4 test records and to the "displayStudents" function</td>
</tr>
<tr>
<td>VB StDB<br />
v1.06<br />
<br />
<a href="https://github.com/bwattle/arrRecords/blob/master/VB-StDB-v106/StDB106.vb"
title="Link to VB v1.05 zip of exe" target="_blank">code
</a>
<br />
<br />
<a href="JS/UnderConstruction.html" title="Link to VB v1.06 exe" target="_blank">exe</a></td>
<td>Fix the 3 Visual Studio "Messages":
<ul>
<li>Make field readonly</li>
<li>Naming rule violation: These words must begin with upper case characters: btnAddStud_Click</li>
</ul>
Change the version number in the "Form header"
<br />
Add 2 additional fields:
<ul>
<li>Phone number (text box - possibly with an input mask)</li>
<li>Paid (checkbox)</li>
</ul>
Add additional fields to the 4 test records and to the "displayStudents" function.</td>
</tr>
<tr>
<td>JavaScript<br />
v1.07<br />
<a href="JS/UnderConstruction.html"
title="Link to JavaScript v1.07" target="_blank">code</a>
<br />
<br />
<a href="JS/UnderConstruction.html" title="Link to JS v1.07 page" target="_blank">page</a></td>
<td>Not started yet</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>3 Sample files:</td>
</tr>
<tr>
<td><a href="https://github.com/bwattle/arrRecords/releases/download/v0.02-VB/StudDB-Chloe-2019.exe"
title="Link to VB Student Graduation exe - Choe" target="_blank">VB-Chloe</a> </td>
<td>Grad booking exe. Chloe 2019</td>
</tr>
<tr>
<td><a href="https://github.com/bwattle/arrRecords/releases/download/v0.03-VB/StudDB-Jason-2019.exe"
title="Link to VB Student Graduation exe - Jason" target="_blank">VB-Jason</a></td>
<td>Grad booking exe. Jason 2019</td>
</tr>
<tr>
<td><a href="https://github.com/bwattle/arrRecords/releases/download/v0.01-VB/Pizza-PeterLi-2019.exe"
title="Link to Pizza ordering exe - Peter" target="_blank">VB-Peter</a></td>
<td>Pizza ordering app. Peter 2019</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>The versions below here are from the class of 2020 which only did VB.
<a href="https://bwattle.github.io/11-StudDB_VB/"
title="Link to 2020 VB site" target="_blank">https://bwattle.github.io/11-StudDB_VB/</a>
<br />
with repo at: <a href="https://github.com/bwattle/11-StudDB_VB"
title="Link to 2020 VB repository" target="_blank">https://github.com/bwattle/11-StudDB_VB</a> </td>
</tr>
<tr>
<td>
<a href="https://github.com/bwattle/11-StudDB_VB/releases/download/1.5.0/StudArrayWithFind.exe">1.05</a>
</td>
<td>v1.05 - Four hard coded records, then the entry of further records checks the
code for the "Array of Records"
</td>
</tr>
<tr>
<td>
<a href="https://github.com/bwattle/11-StudDB_VB/releases/download/v1.6.0/StudArrayWithFind.exe">1.06</a>
</td>
<td>2 additional fields are added and the tab order is checked.
</td>
</tr>
<tr>
<td>
<a href="https://github.com/bwattle/11-StudDB_VB/releases/download/v1.6.1/StudArrayWithFind.exe">1.06.1</a>
</td>
<td>The label for "Paid" was changing to false rather than the checkbox! Now fixed.
</td>
</tr>
<tr>
<td>
<a href="https://github.com/bwattle/11-StudDB_VB/releases/download/1.7.0/StudArrayWithFind.exe">1.07.0</a>
</td>
<td>Form re-organised so that the tab order makes sense. 1st attempt at validation on gender.
</td>
</tr>
<tr>
<td>
<a href="https://github.com/bwattle/11-StudDB_VB/releases/download/v1.7.1/StudArrayWithFind.exe">1.07.1</a>
</td>
<td>Gender validation had an error
</td>
</tr>
<tr>
<td>
<a href="https://github.com/bwattle/11-StudDB_VB/releases/download/1.7.4/StudArrayWithFind.exe">1.07.4</a>
</td>
<td>There are still bugs in this validation - can you find them??
</td>
</tr>
<tr>
<td>
<a href="https://github.com/bwattle/11-StudDB_VB/releases/download/v1.7.5/StudArrayWithFind.exe">1.07.5</a>
</td>
<td>Validation on "Submit" started
</td>
</tr>
<tr>
<td>
<a href="https://github.com/bwattle/11-StudDB_VB/releases/download/v1.7.6/StudArrayWithFind.exe">1.70.6</a>
</td>
<td>Validation on exit of each field as well as on submit. A date picker for DoB with default of 1/1/2003
</td>
</tr>
<tr>
<td>
<a href="https://github.com/bwattle/11-StudDB_VB/releases/download/v1.7.7/StudArrayWithFind.exe">1.07.7</a>
</td>
<td>Minor corrections to format - validation now on field exit and on submit
</td>
</tr>
<tr>
<td>
<a href="https://github.com/bwattle/11-StudDB_VB/releases/tag/v1.8.1">1.08.1</a>
</td>
<td>Find working, but 3 errors in the search algorithm:
<ul>
<li>First record never found </li>
<li>Search is CASE sensitive </li>
<li>Only the first of multiple records found </li>
</ul>
</td>
</tr>
<tr>
<td>
<a href="https://github.com/bwattle/11-StudDB_VB/releases/download/v1.8.2/StudArrayWithFind.exe">1.08.2</a>
</td>
<td>Infinite loop version - this is what DEVELOPERS DO NOT DO!
<ul style="margin-left: .375in; direction: ltr; unicode-bidi: embed; margin-top: 0in; margin-bottom: 0in"
type="disc">
<li>Changed increment code for "Find" from: </li>
<li>searchCount = searchCount + 1 to </li>
<li>searchCount = searchCount </li>
</ul>
</td>
</tr>
<tr>
<td>
<a href="https://github.com/bwattle/11-StudDB_VB/releases/download/v1.8.3/StudArrayWithFind.exe">1.08.3</a>
</td>
<td>Added 8 extra test records.<br />
Learning to use the list box:
<ul>
<li>Added text boxes to view list box elements clicked and the index of the element </li>
<li>Added a module triggered by the "IndexChanged" action of the listBox </li>
<li>view data using: lstStud.SelectedItem </li>
<li>view index using: lstStud.SelectedIndex </li>
<li>set focus on a line in the listBox with: lstStud.SelectedIndex = searchCount </li>
<li>clear the highlighted rows with: stStud.ClearSelected() </li>
<li>Used List box info from:
<a href="https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.listbox.selecteditem?view=netcore-3.1">https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.listbox.selecteditem?view=netcore-3.1 </a></li>
<li>Changed increment code from: </li>
</ul>
Changed variable: " foundName " to " foundStud "<br />
Made top form label bold & 12 point
</td>
</tr>
</table>
<p>
In Chrome on PC, when you download a release above, click "Keep" as shown below:
</p>
<p>
<img alt="Image of an arrow pointing to the 'Keep' option"
height="91" src="images/clip_image001.png" width="384" />
</p>
<p>
If you see this message, click "More Info":
</p>
<p>
<img alt="Image of 'Windows protected your PC' dialog box. Use the 'More info' option "
height="100" src="images/clip_image002.png" width="391" />
</p>
<p>
And then "Run anyway":
</p>
<p>
<img alt="Image of 'Windows protected your PC' dialog box. Use the 'Run anyway' option "
height="359" src="images/clip_image003.png" width="384" />
</p>
<p>
This video was made for the 2020 class and although "Git Changes" now replaces "
Team Explorer", most of the techniques are still valid:<br />
<a href="https://youtu.be/YGv8Li3tQfo">https://youtu.be/YGv8Li3tQfo</a><br />
The video demonstrates GitHub's ability to compare code between releases and shows that pushing,
pulling and loading releases can be done without any command line code. apologies for the fact that the
cursor is showing not showing in the correct position. For those who want to go straight to the relevant part, here are the timings:
<br />
<a href="https://www.youtube.com/watch?v=YGv8Li3tQfo&t=0s">0:00 </a> Overview of GitHub commits
<br />
<a href="https://www.youtube.com/watch?v=YGv8Li3tQfo&t=50s">0:50 </a> Releases and comparison of v1.6.0 to 1.6.1
<br />
<a href="https://www.youtube.com/watch?v=YGv8Li3tQfo&t=300s">5:00 </a> View the v1.7.0 code with gender validation
<br />
<a href="https://www.youtube.com/watch?v=YGv8Li3tQfo&t=410s">6:50 </a> Trying the various combinations of m f M and F, only the F works
<br />
<a href="https://www.youtube.com/watch?v=YGv8Li3tQfo&t=520s">8:40 </a> Repair of code
<br />
<a href="https://www.youtube.com/watch?v=YGv8Li3tQfo&t=540s">9:00 </a> Team explorer finds the changes
<br />
<a href="https://www.youtube.com/watch?v=YGv8Li3tQfo&t=560s">9:20 </a> Commit comment
<br />
<a href="https://www.youtube.com/watch?v=YGv8Li3tQfo&t=590s">9:50 </a> Commit
<br />
<a href="https://www.youtube.com/watch?v=YGv8Li3tQfo&t=630s">10:30 </a>View latest commit in repository
<br />
<a href="https://www.youtube.com/watch?v=YGv8Li3tQfo&t=710s">11:50 </a>Change version # on form (I forgot to tab out of the cell)
<br />
<a href="https://www.youtube.com/watch?v=YGv8Li3tQfo&t=735s">12:15 </a>HTML text change
<br />
<a href="https://www.youtube.com/watch?v=YGv8Li3tQfo&t=775s">12:55 </a>Push the latest changes to GitHub
<br />
<a href="https://www.youtube.com/watch?v=YGv8Li3tQfo&t=835s">13:55 </a>View latest commit in GitHub
<br />
<a href="https://www.youtube.com/watch?v=YGv8Li3tQfo&t=875s">14:35 </a>Create another release
<br />
<a href="https://www.youtube.com/watch?v=YGv8Li3tQfo&t=980s">16:20 </a>Drag new exe to the publish box
<br />
<a href="https://www.youtube.com/watch?v=YGv8Li3tQfo&t=1005s">16:45 </a>Run exe from the latest release
<br />
<a href="https://www.youtube.com/watch?v=YGv8Li3tQfo&t=1070s">17:50 </a>Comparison between v1.7.0 and v1.7.1
<br />
<a href="https://www.youtube.com/watch?v=YGv8Li3tQfo&t=1095s">18:15 </a>View the latest change to the HTML "index" file
<br />
<a href="https://www.youtube.com/watch?v=YGv8Li3tQfo&t=1115s">18:35 </a>Finish
</p>
</body>
</html>