summaryrefslogtreecommitdiffstats
path: root/2021/captions/emacsconf-2021-teach--using-org-mode-to-teach-programming--daniel-german--main.vtt
blob: aee8f7badb556a35eeee335109652a303ceb4971 (plain) (blame)
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
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
WEBVTT

00:01.040 --> 00:03.520
Hello, everybody. My name is Daniel German.

00:03.520 --> 00:00:04.799
I'm a professor of computer science 

00:00:04.799 --> 00:00:06.080
at the University of Victoria,

00:00:06.080 --> 00:00:07.680
and I have been teaching programming 

00:00:07.680 --> 00:00:12.080
for more than 10 years.

00:12.080 --> 00:00:14.639
I want to tell you today

00:00:14.639 --> 00:00:15.759
about how I have been

00:00:15.759 --> 00:00:17.680
using Emacs effectively 

00:00:17.680 --> 00:00:20.000
during the last 10 years,

00:00:20.000 --> 00:00:22.880
and to try to improve how I not only

00:00:22.880 --> 00:00:24.720
create content for my students,

00:24.720 --> 00:00:26.480
but also how I deliver it, 

00:00:26.480 --> 00:00:27.680
and particularly how, 

00:00:27.680 --> 00:00:29.119
within the last five years, 

00:00:29.119 --> 00:00:31.599
I have been using Org mode

00:00:31.599 --> 00:00:33.200
in a very effective way

00:33.200 --> 00:00:35.600
that benefits both 

00:00:35.600 --> 00:00:38.239
my students and myself

00:38.239 --> 00:00:40.480
in the creation and the delivery 

00:00:40.480 --> 00:00:42.399
of content.

00:42.399 --> 00:00:45.200
Let me switch to my computer. 

00:00:45.200 --> 00:00:46.480
I'm going to remove myself

00:00:46.480 --> 00:00:47.840
because I can use 

00:00:47.840 --> 00:00:50.800
all the real-estate screen.

00:51.840 --> 00:54.079
The goal of my presentation today

00:54.079 --> 00:00:55.600
is really to give you 

00:00:55.600 --> 00:00:59.280
a little bit of an overview

00:00:59.280 --> 00:01:03.440
of how I have been able to 

01:03.440 --> 00:01:06.240
combine the use of Org mode 

00:01:06.240 --> 00:01:08.560
and with some other tools.

00:01:08.560 --> 00:01:10.880
I'll talk about specifically about them

00:01:10.880 --> 00:01:13.680
and then also offer some suggestions 

00:01:13.680 --> 00:01:14.640
and recommendations 

00:01:14.640 --> 00:01:16.240
in how to get it started.

01:16.240 --> 00:01:18.799
I have created a configuration, 

00:01:18.799 --> 00:01:20.080
a set of configuration files 

00:01:20.080 --> 00:01:20.799
that you can use. 

00:01:20.799 --> 00:01:22.880
I will describe them towards the end.

01:22.880 --> 00:01:28.240
Hopefully, it will make it easy

00:01:28.240 --> 00:01:31.439
for all of you to get started on using it.

01:31.439 --> 01:33.200
So we start talking a little bit

01:33.200 --> 00:01:34.079
about the challenges 

00:01:34.079 --> 00:01:35.119
of teaching programming. 

00:01:35.119 --> 00:01:37.200
I think that the fundamental one

00:01:37.200 --> 00:01:41.680
is that keeping the content 

00:01:41.680 --> 00:01:45.280
and the slides up to date is hard, 

00:01:45.280 --> 00:01:46.960
because the content is programs.

00:01:46.960 --> 00:01:47.840
There are programs 

00:01:47.840 --> 00:01:50.399
that sometimes have errors,

00:01:50.399 --> 00:01:53.759
and sometimes the slides are 

00:01:53.759 --> 00:01:58.079
incomplete snippets of code, and that 

00:01:58.079 --> 00:02:00.240
once they go into the slides software, 

00:02:00.240 --> 00:02:01.840
like Google Slides or PowerPoint, 

00:02:01.840 --> 00:02:04.159
they're essentially static objects.

02:05.520 --> 00:02:07.439
If we need to update them,

00:02:07.439 --> 00:02:09.920
we basically don't know

00:02:09.920 --> 00:02:12.160
whether the update code actually works,

00:02:12.160 --> 00:02:13.440
or does it work? 

00:02:13.440 --> 00:02:16.000
Also, we cannot insert automatically 

00:02:16.000 --> 00:02:16.400
the output. 

00:02:16.400 --> 00:02:18.480
We'll have to run the snippet outside,

00:02:18.480 --> 00:02:20.560
and run it, and then insert that code.

00:02:20.560 --> 00:02:22.080
So that's very cumbersome.

00:02:22.080 --> 00:02:23.200
It's really, really one of the 

00:02:23.200 --> 00:02:26.080
major challenges of using a slide software 

00:02:26.080 --> 00:02:29.360
to teach programming.

02:29.360 --> 00:02:30.879
The other thing is that 

00:02:30.879 --> 00:02:32.000
during the presentation, 

00:02:32.000 --> 00:02:33.440
there's nothing you can do with the code.

00:02:33.440 --> 00:02:34.480
You might be able to edit it,

00:02:34.480 --> 00:02:35.440
but you cannot run it. 

00:02:35.440 --> 00:02:37.360
You have to move outside of the

00:02:37.360 --> 00:02:38.640
presentation software

00:02:38.640 --> 00:02:41.200
to be able to execute the code.

02:42.800 --> 00:02:44.640
The last one is kind of related to 

00:02:44.640 --> 00:02:46.959
the previous two. 

02:46.959 --> 00:02:48.800
You don't have a single file 

00:02:48.800 --> 00:02:51.121
and your information is spread across

00:02:51.121 --> 00:02:52.879
many, many different files,

00:02:52.879 --> 00:02:54.080
especially if you have lots of

00:02:54.080 --> 00:02:55.760
different snippets in your slides. 

00:02:55.760 --> 00:02:56.959
You probably have a lot of 

00:02:56.959 --> 00:02:59.440
different small files, each of them

02:59.440 --> 03:01.599
contributing something to your slides,

03:01.599 --> 03:06.239
and so it becomes a pain to manage.

03:07.280 --> 00:03:10.080
All of this is where Org mode 

00:03:10.080 --> 00:03:12.640
really excels. Org mode is capable of

00:03:12.640 --> 00:03:15.840
doing everything, and it needs 

00:03:15.840 --> 00:03:18.400
a little bit of help from some friends. 

00:03:18.400 --> 00:03:22.159
I will describe what I mean by that. 

00:03:22.159 --> 00:03:23.040
But the other thing 

00:03:23.040 --> 00:03:24.480
that is also very valuable

03:24.480 --> 00:03:27.440
is that it's within the magic of Emacs. 

00:03:27.440 --> 00:03:30.480
I absolutely love to be able to

03:30.480 --> 00:03:32.879
work with text within Emacs.

00:03:32.879 --> 00:03:34.799
I enjoy actually creating my notes

00:03:34.799 --> 00:03:36.640
in Org mode way more than if I was

00:03:36.640 --> 00:03:39.360
making them in Google Slides.

03:39.360 --> 00:03:42.400
Let me start by giving you a short demo.

00:03:42.400 --> 00:03:46.400
I have been teaching programming in C++ 

00:03:46.400 --> 00:03:47.519
for around five years, 

00:03:47.519 --> 00:03:50.159
and this was really the trigger towards

03:50.159 --> 00:03:53.280
trying to do everything within Org mode.

00:03:53.280 --> 00:03:58.159
So I have a repository in GitHub, 

00:03:58.159 --> 00:03:59.439
and I think that GitHub 

00:03:59.439 --> 00:04:00.560
is an excellent tool 

00:04:00.560 --> 00:04:04.480
that works collaboration with Org mode.

04:04.480 --> 00:04:05.439
I'll describe actually 

00:04:05.439 --> 00:04:07.680
what I mean by that. 

00:04:07.680 --> 00:04:09.680
My lectures are essentially Org files.

00:04:09.680 --> 00:04:12.480
So, for example, let's go into

00:04:12.480 --> 00:04:15.040
one of these files.

04:15.040 --> 00:04:16.799
This is a an Org file.

00:04:16.799 --> 00:04:21.199
You can actually see it in the extension.

04:21.199 --> 04:26.160
I get a table of contents.

04:26.160 --> 00:04:28.000
GitHub creates or give us actually

00:04:28.000 --> 00:04:31.280
the ability to quickly jump, and it creates 

00:04:31.280 --> 00:04:32.880
a dynamic table of contents, 

00:04:32.880 --> 00:04:33.759
but I also can actually 

00:04:33.759 --> 00:04:35.280
create it automatically, 

00:04:35.280 --> 00:04:36.800
and then here it goes. 

00:04:36.800 --> 00:04:38.479
This is the code that i have. 

00:04:38.479 --> 00:04:41.440
This is a snippet 

00:04:41.440 --> 00:04:44.240
that I present in the class.

04:44.240 --> 00:04:45.680
Let me actually show you 

00:04:45.680 --> 00:04:48.400
how I do it within Emacs.

04:48.400 --> 00:04:52.160
So what I will do is the following. 

00:04:52.160 --> 00:04:55.440
Let me try to open that file.

04:57.919 --> 04:59.440
Here's the file,

04:59.440 --> 00:05:00.880
and it's exactly the same

00:05:00.880 --> 00:05:03.759
that we were browsing in GitHub. 

00:05:03.759 --> 00:05:08.720
What I do is I simply just scroll through

05:08.720 --> 00:05:10.160
the document. It's almost like 

00:05:10.160 --> 00:05:13.440
movie credits at the end of the movie. 

00:05:13.440 --> 00:05:15.360
I don't break them into chunks 

00:05:15.360 --> 00:05:16.639
that I show in the screen. 

00:05:16.639 --> 00:05:18.320
I see no point in doing that.

00:05:18.320 --> 00:05:20.880
What I do is I simply scroll through

00:05:20.880 --> 00:05:24.160
the text. The students are able to see

00:05:24.160 --> 00:05:26.560
the same information in GitHub

00:05:26.560 --> 00:05:27.759
on their computer,

05:27.759 --> 00:05:29.680
or they can print it if they want,

00:05:29.680 --> 00:05:31.039
and they are able to actually 

00:05:31.039 --> 00:05:32.560
follow with me, and then having

00:05:32.560 --> 00:05:33.759
a much bigger picture

05:33.759 --> 05:36.320
than if i just show a very small snippet.

05:36.320 --> 00:05:38.800
In the case that the snippet is too big,

00:05:38.800 --> 00:05:40.800
for example, let's say this one 

00:05:40.800 --> 00:05:42.240
actually doesn't cover the... 

00:05:42.240 --> 00:05:43.759
covers more than full screen, 

00:05:43.759 --> 00:05:45.360
I actually reduce the size 

00:05:45.360 --> 00:05:48.000
and then give a little bit of

00:05:48.000 --> 00:05:49.759
an explanation of the whole thing, 

00:05:49.759 --> 00:05:51.600
and then focus and say this is the line

00:05:51.600 --> 00:05:53.600
where we have to pay attention.

05:53.600 --> 00:05:55.600
Notice actually how I use color for that.

00:05:55.600 --> 00:05:57.759
I think that the ability to use color

00:05:57.759 --> 00:05:59.759
and typesetting is fundamental 

00:05:59.759 --> 00:06:01.520
to be able to do this effectively,

00:06:01.520 --> 00:06:02.720
and the nice thing is that

00:06:02.720 --> 00:06:04.160
we can configure Org mode 

00:06:04.160 --> 00:06:05.840
to be able to do most of this

06:05.840 --> 06:08.160
automatically.

06:08.160 --> 00:06:09.360
As I said before, 

00:06:09.360 --> 00:06:10.960
one of the great advantages is that 

00:06:10.960 --> 00:06:13.600
I can actually run the code dynamically. 

00:06:13.600 --> 00:06:15.360
So let's say that the student says,

00:06:15.360 --> 00:06:17.360
"But what if I change that value to 10?"

00:06:17.360 --> 00:06:18.560
Well, let's try it. 

00:06:18.560 --> 00:06:20.560
Let's change it, run it,

06:20.560 --> 00:06:21.840
and then you can see here 

00:06:21.840 --> 00:06:24.720
that it has a 10. 

00:06:24.720 --> 00:06:26.960
That's really powerful because

00:06:26.960 --> 00:06:29.280
you're not tied to 

00:06:29.280 --> 00:06:30.560
what is the content you have 

00:06:30.560 --> 00:06:33.120
on the slides. If you find an error

00:06:33.120 --> 00:06:34.880
or an omission, or you want to talk about

06:34.880 --> 00:06:36.880
something else, you can very quickly 

00:06:36.880 --> 00:06:40.720
do it. You can add comments 

00:06:40.720 --> 00:06:42.080
and then make some suggestions 

00:06:42.080 --> 00:06:43.840
specifically to that,

06:43.840 --> 00:06:45.680
or worst-case scenario,

00:06:45.680 --> 00:06:48.880
if you really, really, need it,

06:48.880 --> 00:06:55.440
you can say, "Let's load it into..."

00:06:55.440 --> 00:06:58.400
Let's actually do some hand annotation. 

00:06:58.400 --> 00:07:00.319
Let's actually say, "look at this thing, 

00:07:00.319 --> 00:07:01.840
this is the value that I want you to

07:01.840 --> 00:07:02.800
concentrate on."

00:07:02.800 --> 00:07:03.599
It's not perfect. 

00:07:03.599 --> 00:07:04.960
I'm not doing it with an Emacs. 

00:07:04.960 --> 00:07:06.960
I wish there was a way to do it,

00:07:06.960 --> 00:07:09.120
but it is absolutely effective 

00:07:09.120 --> 00:07:10.720
because I'm actually able to

00:07:10.720 --> 00:07:12.800
use the power. Notice that all that is

07:12.800 --> 07:15.520
exported is just the block, and also 

07:15.520 --> 07:22.400
the color and typesetting,

07:22.400 --> 00:07:24.560
the typesetting of the content. 

00:07:24.560 --> 00:07:25.759
So this is actually great. 

00:07:25.759 --> 00:07:30.639
I have the colors red, purple, etc. etc.

00:07:30.639 --> 00:07:34.160
I love being able to do that.

07:34.160 --> 00:07:35.919
This is just a temporary file. 

00:07:35.919 --> 00:07:36.880
I can actually discard it, 

00:07:36.880 --> 00:07:39.680
and it doesn't really matter.

07:39.680 --> 07:41.919
Let me go back to the presentation.

07:41.919 --> 00:07:43.360
So that's the delivery.

00:07:43.360 --> 00:07:44.639
So the delivery is great,

00:07:44.639 --> 00:07:46.400
and I can tell the students 

00:07:46.400 --> 00:07:48.080
now you're actually in GitHub,

00:07:48.080 --> 00:07:50.160
if you want to test the code,

07:50.160 --> 00:07:51.360
just cut and paste. 

00:07:51.360 --> 00:07:54.240
Notice that I clicked on the little icon. 

00:07:54.240 --> 00:07:56.639
Now it's copied. It's now part of 

00:07:56.639 --> 00:07:57.440
the kill buffer ([kill-ring]), 

00:07:57.440 --> 00:07:59.520
so if I want to actually create a file

00:07:59.520 --> 00:08:00.560
that has that content, 

00:08:00.560 --> 00:08:02.560
I can very quickly do it.

08:02.560 --> 00:08:05.840
Try that with PowerPoint. 

00:08:05.840 --> 00:08:08.160
You will have to have the text 

00:08:08.160 --> 00:08:10.000
without any nice typesetting,

00:08:10.000 --> 00:08:11.280
or you will have to have a picture

00:08:11.280 --> 00:08:13.120
that is impossible to cut and paste.

00:08:13.120 --> 00:08:14.400
So that's something that the students

00:08:14.400 --> 00:08:17.440
really, really appreciate of this. 

00:08:17.440 --> 00:08:18.879
They can try it on the computer.

00:08:18.879 --> 00:08:19.919
They can load it into 

00:08:19.919 --> 00:08:22.319
their favorite editor. 

00:08:22.319 --> 00:08:24.720
I don't force them to use Emacs,

00:08:24.720 --> 00:08:26.879
but I have to say that some of them

00:08:26.879 --> 00:08:28.479
really get intrigued by this power

00:08:28.479 --> 00:08:30.000
that they want to try Emacs

08:30.000 --> 08:31.440
because they see that they can do things,

08:31.440 --> 08:33.760
that I can do things that they cannot do

08:33.760 --> 08:35.919
with other tools.

08:35.919 --> 08:39.039
Okay, so let's go back to presentation.

08:39.039 --> 00:08:40.080
The other half of it is 

00:08:40.080 --> 00:08:41.039
preparing the notes. 

00:08:41.039 --> 00:08:44.640
I think the preparatory notes 

08:44.640 --> 00:08:46.320
is something that I want to do

00:08:46.320 --> 00:08:48.240
as easy as possible. 

00:08:48.240 --> 00:08:52.560
I want to be able to reduce the time

00:08:52.560 --> 00:08:53.760
that I waste on things,

00:08:53.760 --> 00:08:55.120
that they are done.

08:55.120 --> 08:57.519
They're not part of the actual thinking

08:57.519 --> 00:09:01.760
or the delivery of the presentation.

00:09:01.760 --> 00:09:03.440
So let me create a file.

09:03.440 --> 00:09:05.720
Let's call it rip2.org. 

00:09:05.720 --> 00:09:07.839
Well, I have this one,

00:09:07.839 --> 00:09:09.519
so let's call it rip.org. 

00:09:09.519 --> 00:09:10.480
Oh, I have this one too, 

00:09:10.480 --> 00:09:12.800
so let's call it rip4.org.

09:12.800 --> 09:15.040
So it's empty.

09:15.040 --> 00:09:17.200
I use yasnippets. I think yasnippets 

00:09:17.200 --> 00:09:17.920
are very important, 

00:09:17.920 --> 00:09:19.040
and I'll go through this 

00:09:19.040 --> 00:09:19.760
in a little bit later. 

00:09:19.760 --> 00:09:21.200
It's important to set up 

00:09:21.200 --> 00:09:23.440
the properties for each language

00:09:23.440 --> 00:09:24.399
that I use properly.

09:24.399 --> 09:26.320
I'll describe this a little bit later.

09:26.320 --> 00:09:28.000
Unfortunately, the properties 

00:09:28.000 --> 00:09:30.080
have to be evaluated one at a time,

00:09:30.080 --> 00:09:33.839
and so I'm just going to 

00:09:33.839 --> 00:09:35.040
kill the buffer and open it again.

00:09:35.040 --> 00:09:36.480
So now all of these properties 

00:09:36.480 --> 00:09:38.000
are properly set.

09:40.560 --> 00:09:43.760
As I said before, I have some yasnippets,

00:09:43.760 --> 00:09:46.560
so I can actually do very quickly... 

00:09:46.560 --> 00:09:55.200
This is C++, cout << "hello world",

09:55.200 --> 09:58.080
std::endl.

09:58.080 --> 00:10:00.080
And then I run it, 

00:10:00.080 --> 00:10:02.720
and then it's inserted down here, 

00:10:02.720 --> 00:10:04.000
so nothing special.

10:04.000 --> 10:06.160
Let's assume that I make a mistake

10:06.160 --> 00:10:08.480
and I type a double l here. 

00:10:08.480 --> 00:10:10.720
I will get an error.

10:10.720 --> 00:10:12.399
These line numbers unfortunately 

00:10:12.399 --> 00:10:13.600
don't perfectly match 

00:10:13.600 --> 00:10:15.040
with the line numbers

10:15.040 --> 10:17.839
in the little snippet

10:17.839 --> 00:10:18.959
because there's some code 

00:10:18.959 --> 00:10:22.160
that org-babel inserts,

00:10:22.160 --> 00:10:23.040
so that shifts them.

00:10:23.040 --> 00:10:25.440
So that's something to be aware of.

10:25.440 --> 00:10:27.680
I can correct it, run it, 

00:10:27.680 --> 00:10:30.160
and then it inserts the result.

10:30.160 --> 00:10:36.079
Let's do one in C.

10:36.079 --> 00:10:37.680
I'll explain the exports both 

00:10:37.680 --> 00:10:38.640
a little bit. 

00:10:38.640 --> 00:10:40.079
So let's assume that I don't want to

10:40.079 --> 00:10:41.519
have a full main program. 

00:10:41.519 --> 00:10:42.560
Let's assume that i just want to

00:10:42.560 --> 00:10:45.200
demonstrate how to use a printf

00:10:45.200 --> 00:10:54.959
"hello world %s\n", "my friend".

10:54.959 --> 10:56.800
Let's run it.

10:56.800 --> 00:10:58.800
I get a bunch of errors. Why?

00:10:58.800 --> 00:11:00.480
Because I don't have a main program,

00:11:00.480 --> 00:11:03.279
so I have to actually tell org-babel 

00:11:03.279 --> 00:11:05.200
that I want a main product, 

00:11:05.200 --> 00:11:07.360
so yes put a main around it. 

00:11:07.360 --> 00:11:09.040
So now I run it and it says, oh,

11:09.040 --> 00:11:09.760
in the function main, 

00:11:09.760 --> 00:11:10.959
we have an implicit declaration 

00:11:10.959 --> 00:11:12.640
for function printf. 

00:11:12.640 --> 00:11:14.000
I'm very, very stringent 

00:11:14.000 --> 00:11:16.959
on my compilation options,

00:11:16.959 --> 00:11:18.959
so I want to have every single

11:18.959 --> 00:11:21.279
potential error displayed ,

00:11:21.279 --> 00:11:22.959
so that's actually why. 

00:11:22.959 --> 00:11:24.640
In this case, I actually need include, 

00:11:24.640 --> 00:11:29.040
so I can say :includes <stdio.h>,

11:29.040 --> 00:11:31.040
and I'll run it and it runs perfectly.

00:11:31.040 --> 00:11:32.480
So why is this important? 

00:11:32.480 --> 00:11:35.440
Well, it allows me to just have 

00:11:35.440 --> 00:11:37.600
the snippet that I'm concerned about. 

00:11:37.600 --> 00:11:39.920
I don't have to have all the overhead 

00:11:39.920 --> 00:11:43.279
of having to have the include, main, etc., 

00:11:43.279 --> 00:11:44.000
if I want to show

00:11:44.000 --> 00:11:45.440
just one specific concept

00:11:45.440 --> 00:11:46.560
and I can do it 

00:11:46.560 --> 00:11:48.079
in very few lines of code. 

00:11:48.079 --> 00:11:50.240
I can do that immediately, of course.

00:11:50.240 --> 00:11:51.279
The students will not be able to 

00:11:51.279 --> 00:11:53.600
cut and paste it without the main file,

00:11:53.600 --> 00:11:54.320
but that's something 

00:11:54.320 --> 00:11:56.800
that we can explain to them.

11:57.600 --> 00:11:59.440
We can do all the languages. 

00:11:59.440 --> 00:12:02.079
So I can say print,

12:02.079 --> 12:07.680
let's print just a list,

12:07.680 --> 12:10.000
or let's actually keep updating it,

12:10.000 --> 00:12:16.000
and let's do a map of a lambda x, 

00:12:16.000 --> 00:12:19.279
x multiplied by x,

12:19.279 --> 00:12:22.079
and then we run it. Okay. 

00:12:22.079 --> 00:12:23.200
The thing that is important

00:12:23.200 --> 00:12:25.120
is that if we also have 

00:12:25.120 --> 00:12:26.720
the full power of the environment, 

00:12:26.720 --> 00:12:28.320
right, so we can actually edit it

00:12:28.320 --> 00:12:31.519
in the native mode of the language,

00:12:31.519 --> 00:12:34.560
and wherever we actually want to use

00:12:34.560 --> 00:12:36.720
specific features, that they are available 

00:12:36.720 --> 00:12:38.800
in the particular mode.

12:38.800 --> 00:12:40.720
But for most of the cases, 

00:12:40.720 --> 00:12:41.519
I don't need that,

00:12:41.519 --> 00:12:44.160
because my examples are relatively simple.

12:44.160 --> 12:46.720
Let's do one more.

12:46.720 --> 00:12:48.399
This is a little bit different: SQLite. 

00:12:48.399 --> 00:12:49.760
In the previous examples,

00:12:49.760 --> 00:12:51.200
the output that is inserted 

00:12:51.200 --> 00:12:52.720
is a standard output. 

00:12:52.720 --> 00:12:54.320
In SQLite, I want to actually see

00:12:54.320 --> 00:12:55.279
the tables. I want to see 

00:12:55.279 --> 00:12:56.720
how the tables are,

00:12:56.720 --> 00:12:58.880
what the results are. 

00:12:58.880 --> 00:13:04.000
So let's create table s.

13:04.000 --> 00:13:08.399
Let's call it r, a int, b int,

13:08.399 --> 00:13:09.200
and let's run it. 

00:13:09.200 --> 00:13:10.639
This is-- oh, the table already exists. 

00:13:10.639 --> 00:13:16.240
Okay. So drop table if exists r,

13:16.240 --> 00:13:17.440
and then we run it. Okay. 

00:13:17.440 --> 00:13:21.120
So now it's created. sqlite...

00:13:21.120 --> 00:13:25.920
So we can say create a table,

00:13:25.920 --> 00:13:27.760
and let's actually add SQL, 

00:13:27.760 --> 00:13:32.079
and here we're actually going to add...

13:32.079 --> 00:13:34.240
This is an example in C, 

00:13:34.240 --> 00:13:38.240
and here we're going to have C++. 

00:13:38.240 --> 00:13:42.160
Okay. So, SQL, 

00:13:42.160 --> 00:13:43.920
and then we create a table, 

00:13:43.920 --> 00:13:47.839
and then we populate 

00:13:47.839 --> 00:13:51.360
and then insert into R 

00:13:51.360 --> 00:13:57.839
values 1,2 2,3 3,4.

13:57.839 --> 00:13:59.519
Okay. So now I have a table, 

00:13:59.519 --> 00:14:01.600
I have values, 

00:14:01.600 --> 00:14:04.560
and I can do "select * from here,"

14:04.560 --> 14:07.040
and then I get the result. Okay.

14:07.040 --> 00:14:07.920
It's almost magic 

00:14:07.920 --> 00:14:10.399
because I can actually get, formatted, 

00:14:10.399 --> 00:14:13.040
the output in the way that I expected.

14:13.040 --> 14:15.279
Obviously, if my result is too big,

14:15.279 --> 00:14:18.399
then it will basically just create 

00:14:18.399 --> 00:14:20.880
a huge, huge buffer, or Org will say

00:14:20.880 --> 00:14:21.920
the output is too big. 

00:14:21.920 --> 00:14:24.079
So often with databases, 

00:14:24.079 --> 00:14:26.480
I actually narrow my output, right,

00:14:26.480 --> 00:14:28.639
or I might do it with a clause, 

00:14:28.639 --> 00:14:32.800
"where a > 1". 

14:34.959 --> 00:14:36.959
If the language is supported by Org Babel,

00:14:36.959 --> 00:14:39.920
then you can do all of this.

14:39.920 --> 00:14:42.079
Let me go back to the presentation. 

00:14:42.079 --> 00:14:43.760
I'm running out of time. 

00:14:43.760 --> 00:14:45.680
Let me give you a short tour 

00:14:45.680 --> 00:14:47.279
of how this is done.

14:47.279 --> 00:14:53.279
I have created a repository that has 

00:14:53.279 --> 00:14:54.800
all the configuration that I have.

00:14:54.800 --> 00:14:56.639
Everything is self-contained.

14:56.639 --> 14:59.600
You can just download it and run it.

14:59.600 --> 00:15:01.360
You will have to replace 

00:15:01.360 --> 00:15:03.760
your ~/.emacs.d directory, 

00:15:03.760 --> 00:15:07.440
and then you can explore it, test it, 

00:15:07.440 --> 00:15:11.039
and then pick things out of it, 

00:15:11.039 --> 00:15:14.639
choose, etc. 

15:14.639 --> 00:15:16.800
Let me go through the README.

00:15:16.800 --> 00:15:17.920
I think that the README 

00:15:17.920 --> 00:15:19.600
is actually useful. 

00:15:19.600 --> 00:15:21.760
I have a function called actually start.

00:15:21.760 --> 00:15:22.480
That is the one 

00:15:22.480 --> 00:15:24.000
that creates indentation 

00:15:24.000 --> 00:15:28.399
and sets up the mode, etc.

15:28.399 --> 00:15:29.440
Let me talk about GitHub. 

00:15:29.440 --> 00:15:31.839
So GitHub is a great resource. Why?

00:15:31.839 --> 00:15:32.880
Well its publishing, 

00:15:32.880 --> 00:15:34.240
as i mentioned before, 

00:15:34.240 --> 00:15:35.519
is very simple. 

00:15:35.519 --> 00:15:37.120
To publish, you basically just 

00:15:37.120 --> 00:15:37.920
push your changes 

00:15:37.920 --> 00:15:43.199
and it automatically renders the code.

15:43.199 --> 00:15:46.800
It's something that is quite useful.

15:46.800 --> 00:15:48.720
But it is not perfect, 

00:15:48.720 --> 00:15:50.399
and it's not able to understand

00:15:50.399 --> 00:15:52.880
the full Org. But for most of the things

00:15:52.880 --> 00:15:53.680
that I use for teaching, 

00:15:53.680 --> 00:15:55.600
it's sufficiently good.

00:15:55.600 --> 00:15:57.360
It would be better if it was full 

00:15:57.360 --> 00:16:00.720
at compliance, but it's not bad as it is.

16:00.720 --> 00:16:02.463
Version control. I think 

00:16:02.463 --> 00:16:03.839
it's extremely valuable 

00:16:03.839 --> 00:16:05.199
to have version control.

00:16:05.199 --> 00:16:08.079
It allows to actually use 

00:16:08.079 --> 00:16:08.959
different computers 

00:16:08.959 --> 00:16:10.560
or keep track of my changes,

00:16:10.560 --> 00:16:11.920
collaborate with authors,

00:16:11.920 --> 00:16:13.040
even have pull requests 

00:16:13.040 --> 00:16:13.759
from the students.

16:13.759 --> 16:16.320
Actually it's very empowering

16:16.320 --> 16:18.800
for the students.

16:18.800 --> 00:16:20.480
Navigation, links, cut and paste 

00:16:20.480 --> 00:16:21.920
between code blocks, 

00:16:21.920 --> 00:16:23.199
you can even edit in place

16:23.199 --> 16:26.160
if you want to.

16:26.160 --> 16:27.920
In a pinch, you can actually use GitHub

16:27.920 --> 00:16:30.000
to do the editing of your file. 

00:16:30.000 --> 00:16:33.199
Of course, it will not update your buffers.

16:33.199 --> 00:16:35.199
:exports both. This is very important.

00:16:35.199 --> 00:16:40.160
If we have a block, by default,

16:40.160 --> 16:43.199
GitHub will not typeset

16:43.199 --> 00:16:44.399
the output of that block.

00:16:44.399 --> 00:16:45.839
It will only put the source code,

00:16:45.839 --> 00:16:47.199
but not its output.

16:47.199 --> 00:16:50.079
In this case, if I actually showed this

00:16:50.079 --> 00:16:52.720
in GitHub, "hello world" will not appear. 

00:16:52.720 --> 00:16:55.120
So what we need to do is for every block, 

00:16:55.120 --> 00:16:57.040
we have to do :exports both.

16:57.040 --> 00:16:58.720
okay that's unfortunate, 

00:16:58.720 --> 00:17:01.120
but we can deal with that.

17:01.120 --> 00:17:03.920
Once it's done, then the output

00:17:03.920 --> 00:17:06.079
is actually typeset.

17:06.079 --> 00:17:07.520
I mentioned that header args 

00:17:07.520 --> 00:17:09.039
are very important, 

00:17:09.039 --> 00:17:10.079
because those are the ones 

00:17:10.079 --> 00:17:12.799
that set the parameters 

00:17:12.799 --> 00:17:14.640
for each one of the blocks that you have.

17:14.640 --> 17:16.000
You don't want to have to type every

17:16.000 --> 00:17:19.120
single one of them at once. 

00:17:19.120 --> 00:17:20.880
For example, let me go back to 

00:17:20.880 --> 00:17:22.880
my presentation.

17:23.839 --> 17:26.160
Here's actually the parameters for C.

17:26.160 --> 00:17:28.880
C, I say, I don't want you to

00:17:28.880 --> 00:17:30.000
automatically add a main. 

00:17:30.000 --> 00:17:31.120
I want to provide my main, 

00:17:31.120 --> 00:17:34.160
and these are the flags to the compiler.

17:34.160 --> 00:17:37.280
With C++, similar. With SQLite, 

00:17:37.280 --> 00:17:38.720
I said this is my database,

17:38.720 --> 00:17:39.600
this is the data, 

00:17:39.600 --> 00:17:41.360
the file where the database lives,

00:17:41.360 --> 00:17:44.559
and for the results, I want you to insert

17:44.559 --> 00:17:46.160
the column names. I want to see 

00:17:46.160 --> 00:17:48.400
the names of the columns in the result.

17:48.400 --> 17:50.960
So those are actually why

17:50.960 --> 17:53.840
the headers are important.

17:53.840 --> 00:17:55.520
There's one in general. 

00:17:55.520 --> 00:17:56.880
That's :results output. 

00:17:56.880 --> 00:17:59.039
If you're interested on showing

00:17:59.039 --> 00:18:01.760
the standard output of your snippet,

00:18:01.760 --> 00:18:03.600
then you have to use :results output.

00:18:03.600 --> 00:18:04.799
Otherwise, it will insert 

00:18:04.799 --> 00:18:06.720
the result of the last expression. 

00:18:06.720 --> 00:18:08.000
It just depends on what you want to show,

18:08.000 --> 00:18:08.720
but it's important 

00:18:08.720 --> 00:18:11.200
that you are aware of that.

18:11.200 --> 18:13.440
I'm almost running out of time.

18:13.440 --> 00:18:15.919
There are some things that are C-specific

00:18:15.919 --> 00:18:18.400
and that I sort of covered

00:18:18.400 --> 00:18:23.919
during the demo.

18:23.919 --> 00:18:26.000
You can use advanced Org features,

00:18:26.000 --> 00:18:29.039
and you can actually use noweb.

00:18:29.039 --> 00:18:30.640
Now that's confusing for students,

00:18:30.640 --> 00:18:33.600
so i will suggest that you actually do it

18:33.600 --> 00:18:34.880
but then inform the students 

00:18:34.880 --> 00:18:37.760
very clearly of that.

18:37.760 --> 00:18:39.280
Some potential issues: 

00:18:39.280 --> 00:18:42.400
_ (underscore). _ is used everywhere. 

00:18:42.400 --> 00:18:44.640
By default, it will try to export it-- 

00:18:44.640 --> 00:18:46.960
Org will try to export it as circumflex, 

00:18:46.960 --> 00:18:48.400
the same as with GitHub. 

00:18:48.400 --> 00:18:52.480
So we want to inform Org and GitHub

00:18:52.480 --> 00:18:53.840
not to do anything with them,

00:18:53.840 --> 00:18:55.520
and this is via the circumflex. 

00:18:55.520 --> 00:18:57.440
So we said in #+OPTIONS: ^:nil , 

00:18:57.440 --> 00:18:58.720
and that actually takes care 

00:18:58.720 --> 00:19:01.679
of the circumflex and also the underscore.

00:19:01.679 --> 00:19:02.720
It's kind of confusing 

00:19:02.720 --> 00:19:04.080
because it's both,

00:19:04.080 --> 00:19:05.120
but it's actually named 

00:19:05.120 --> 00:19:06.720
after the circumflex.

19:06.720 --> 00:19:07.840
The pipe character 

00:19:07.840 --> 00:19:08.880
is one of those characters 

00:19:08.880 --> 00:19:10.640
that is actually very, very common

00:19:10.640 --> 00:19:12.799
in programming, but if you put in a table,

00:19:12.799 --> 00:19:14.480
there's no way to do it. Like, okay, 

00:19:14.480 --> 00:19:16.559
I wish I had this table nicely

19:16.559 --> 00:19:19.520
where I can say || here, 

00:19:19.520 --> 00:19:21.280
but if I put this ||, 

00:19:21.280 --> 00:19:22.799
it will actually interpret it

00:19:22.799 --> 00:19:23.919
as the separator. 

00:19:23.919 --> 00:19:25.760
So that's one of the few things

00:19:25.760 --> 00:19:27.679
that's kind of annoying.

19:27.679 --> 00:19:31.679
Final words. See my configuration file,

19:31.679 --> 00:19:35.520
and try to typeset the code, 

00:19:35.520 --> 00:19:37.520
the buffer as close as possible 

00:19:37.520 --> 00:19:38.720
to what you want to present.

00:19:38.720 --> 00:19:40.000
As you can see here, 

00:19:40.000 --> 00:19:42.240
I'm actually using colors to highlight

00:19:42.240 --> 00:19:44.320
by using the current line.

19:44.320 --> 19:46.960
Use yasnippets.

19:46.960 --> 19:48.480
They're amazing, and they will actually

19:48.480 --> 19:51.440
make your life much more useful.

19:51.440 --> 19:53.280
Experiment.

19:53.280 --> 19:56.720
Just a conclusion.

19:56.720 --> 00:19:58.400
Org mode and Emacs really make

00:19:58.400 --> 00:20:01.039
a wonderful, amazing environment 

00:20:01.039 --> 00:20:03.360
for teaching programming.

20:03.360 --> 20:06.640
I just want to end by saying that 

20:06.640 --> 00:20:10.320
I'm very grateful to all the Emacs community

20:10.320 --> 00:20:14.159
because I have benefited tremendously

00:20:14.159 --> 00:20:16.080
over the years. I have been using Emacs

00:20:16.080 --> 00:20:18.960
since 1991, so this is essentially 

00:20:18.960 --> 00:20:22.240
my 30th year that have been using Emacs.

00:20:22.240 --> 00:20:24.640
I think that is the most important,

00:20:24.640 --> 00:20:26.980
most fundamental tool that I use

00:20:26.980 --> 00:20:29.760
day-to-day, from reading email, 

00:20:29.760 --> 00:20:32.480
to doing my teaching, doing my papers,

00:20:32.480 --> 00:20:34.960
my research... it's everything. 

00:20:34.960 --> 00:20:37.039
So thank you all

20:37.039 --> 20:40.799
and I hope that you find this useful.

20:40.799 --> 00:20:42.799
Bye.

00:20:42.799 --> 00:20:43.799
[captions by sachac]