Repository navigation
Expand file tree
/
Copy pathpresentation.txt
More file actions
399 lines (399 loc) · 31.6 KB
/
Copy pathpresentation.txt
File metadata and controls
399 lines (399 loc) · 31.6 KB
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
Final presentation for SoftSys, 2019-05-09.
Sized for the canvas window in an 80x24 terminal.
To start: pan below this line, use PG_UP/PG_DOWN to switch between slides.
|
| General Notes:
|
|
|
|
|
|
|
|
| presentation notes ------------------------------------+
| slide line #s -------------------------------------+ |
| last visible col when presenting -----------------+| |
| || |
v v| |
+-------------------------------------8<-------------------------------------+v v
/----------------------------------------------------------------------------\00 Title slide
| |01
| |02
| |03
| |04
| |05
| |06
| COLLASCII |07
| |08
| "The Future Editor of Yesterday, Tomorrow" |09
| |10
| github.com/olin/collascii |11
| |12
| |13
| |14
| |15
| |16
| 01|17
\----------------------------------------------------------------------------/18
00
01
60_ 02
q##QGAU&&j< 03
K@@ENNRqVUz2<``. 04
=RE@@@ANAGGUzzi~ - 05
/---------\ `#MMMMNNRqqW2zx_`-- 06
|COLLASCII| -A@MMMM@ERR8qqzzi|||ij 07
\---------/ R@@EqQKqd2zjj?zz<?/v` 08
\ qx_~@U.H| ~_=Ir&2~=_ 09
\ WW8qBlIbNBNKzrz25zz0 10
\ B##@Nz<oARZRozrr&zz 11
\ RNf|x+_2~K3I/zv22_ 12
-- AoM/RN~, U<t??? 13
qG/#@U333Ax++j?v 14
RNEMMgRd?=(]j/z_o 15
H8Pe=/<<t]???/@ 16
NNo^MRq0~</t(j\/'H@HF 17
M@NM@MoMMoP//]=<?]=~HWWHFAWAaoa18
/------------+---------------------------------------------------------------\00 What It Is (Matt)
| WHAT IT IS | |01
+------------+- |02
| |03
| * a terminal-based editor, built with ncurses |04
| |05
| * ASCII-based and *.txt-compatible |06
| |07
| * suited for text art |08
| * also presentations |09
| |10
| * features cutting-edge input methods, bringing it closer still to |11
| industry standards like Notepad, Microsoft Paint |12
| |13
| |14
| |15
| |16
| 03|17
\----------------------------------------------------------------------------/18
/----------------------------+-----------------------------------------------\00 Feature - Examples (Matt)
| COOL FEATURE 1 - EXAMPLES! | |01
+----------------------------+ |02
| |03
| |04
| |05
| |06
| |07
| |08
| |09
| |10
| |11
| |12
| |13
| |14
| |15
| See more (and add your own!) at: o.olin.build/art/ |16
| Remember to use #madewithcollascii when sharing! 04|17
\----------------------------------------------------------------------------/18
EXAMPLE - THREAD DIAGRAM 00
01
PARENT 02
| 03
"Creating child 0" ------------------ CHILD 0 04
| | 05
fork sleep 0 06
| | 07
"Creating child 1" ---- CHILD 1 "Hello from child 0" 08
| | | 09
fork sleep 1 /---< exit 10
| | / 11
"Hello from parent" /-----|-----/ 12
| /----/ | 13
wait 0 <-----/ "Hello from child 1" 14
| | 15
wait 1 <---------------< exit 16
| 17
exit 18
EXAMPLE - BIRTHDAY GIFT 00
01
CCCCCCCCCCCCCC 02
CCCCC CCCCC 03
CCC \|/ CCC 04
CC --*-- CC 05
C /|\ C 06
C | C 07
CC | CC 08
C CC CC C 09
C CCC CCC C 10
C CCCCC CCCCC C 11
C CCCCCCCCCCCCCC C 12
CC CC 13
CCC CCC 14
CCCCC CCCCC 15
CCCCCCCCCCCCCC 16
17
18
EXAMPLE - CODE DOCUMENTATION 00
01
* 02
* +---------------------------------------+ canvas window: 03
* | 0 -- X, COLS | 04
* | | | 05
* | Y, ROWS | 06
* | | 07
* | | 08
* | | 09
* | | 10
* | | 11
* | | 12
* +---------------------------------------+ status window: 13
* |Saved to file "art.txt" [INSERT](2,6)| Message Info 14
* |step: ON, TRANSPARENT: OFF | Mode 15
* +---------------------------------------+ 16
*/ 17
18
/-------------------------------+--------------------------------------------\00 Feature - Modes (Matt)
| COOL FEATURE 2 - INPUT MODES! | |01
+-------------------------------+ |02
| |03
| * Insert |04
| |05
| * Panning |06
| |07
| * Free line |08
| |09
| * Brush |10
| |11
| |12
| |13
| |14
| |15
| |16
| 08|17
\----------------------------------------------------------------------------/18
/-----------------+----------------------------------------------------------\00 What we learned (Adam)
| WHAT WE LEARNED | |01
+-----------------+ |02
| |03
| * How to work on a programming project that is tangible |04
| |05
| * Separating abstractions effectively |06
| * (M:canvas, V:frontend, C:input, network) |07
| |08
| * Managing state |09
| |10
| * Networking is hard! |11
| |12
| |13
| |14
| |15
| |16
| 09|17
\----------------------------------------------------------------------------/18
/-----------------+----------------------------------------------------------\00 What we learned (Adam)
| STATE | |01
+-----------------+ |02
| |03
| typedef struct { typedef struct { |04
| int ch_in; int num_cols, num_rows; |05
| Cursor *cursor; char **rows; |06
| Mode_ID current_mode; } Canvas; |07
| |08
| Mode_ID last_canvas_mode; |09
| int last_arrow_direction; |10
| View *view; |11
| Cursor *last_cursor; |12
| char *filepath; |13
| } State; |14
| |15
| |16
| 10|17
\----------------------------------------------------------------------------/18
/-----------------+----------------------------------------------------------\00 TEMPLATE CONTENT
| NETWORK | |01
|-----------------+ |02
| |03
| API: |04
| |05
| |06
| `s y x c` sets the spot `(x,y)` |07
| |08
| `c` makes the server respond with the entire canvas |09
| |10
| `q` closes the connection |11
| |12
| |13
| |14
| |15
| |16
| 11|17
\----------------------------------------------------------------------------/18
/-----------------+----------------------------------------------------------\00 TEMPLATE CONTENT
| NETWORK | |01
|-----------------+ |02
| |03
| |04
| |05
| |06
| |07
| fdopen() is wonderful. It makes a FILE * wrapper for sockets. |08
| |09
| Then you can run functions like: |10
| |11
| getline() |12
| and |13
| fprintf() |14
| |15
| |16
| 12|17
\----------------------------------------------------------------------------/18
/-------------------------------+--------------------------------------------\00 Lesson - Variadic Functions (Evan)
| LESSON 1 - VARIADIC FUNCTIONS | |01
+-------------------------------+ |02
| |03
| * How do both `printf(foo);` and `printf(foo, foo1, foo2, foo3);` work? |04
| |05
| * Use `<stdarg.h>`: |06
| * Make the real function with `...`: |07
| ```c |08
| void foo(char fmt, ...) { |09
| va_list argp; |10
| va_start(argp, thing1); |11
| vprintf(fmt, argp); // call a va_list variant or use it yourself |12
| va_end(argp); |13
| } |14
| ``` |15
| * We used this to print to specific ncurses windows nicely |16
| 13|17
\----------------------------------------------------------------------------/18
/--------------------------------------------+-------------------------------\00 Lesson - Macros (Evan)
| LESSON 2 - DEBUGGING THE FRONTEND & MACROS | |01
+--------------------------------------------+ |02
| |03
| * lots of complex function interactions to debug |04
| |05
| * sadly, ncurses uses stdin and stdout - printing to stdout or stderr |06
| writes to the screen in an unpleasant manner |07
| |08
| * solution: let ncurses keep stdout, but use stderr for logging/debugging |09
| |10
| |11
| |12
| |13
| |14
| |15
| |16
| 14|17
\----------------------------------------------------------------------------/18
/----------------------------------------------------+-----------------------\00 Lesson - Macros (Evan)
| LESSON 2 - DEBUGGING THE FRONTEND & MACROS (CONT.) | |01
+----------------------------------------------------+ |02
| |03
| * syntax: |04
| ```C |05
| #define foo(bar) printf(bar) // macro function syntaxout or stderr |06
| #define eprintf(...) fprintf(stderr, __VA_ARGS__) // variadic syntax |07
| |08
| #define foo2(bar) \ // multiline macro function |09
| do { \ // use a do-while so a semicolon works when it's |10
| thing1(bar); \ // "called": `foo2(bar);` |11
| thing2(bar); \ |12
| } while (0) |13
| ``` |14
| |15
| |16
| 15|17
\----------------------------------------------------------------------------/18
/-------------------------------------+--------------------------------------\00 Feature - Networked (Matt)
| COOL FAETURE X - CATCHY TITLE HERE! | |01 * Matt: feign confusion about unfinished slide
+-------------------------------------+ |02 * Adam: fix typo in title
| |03 * Adam: write "IT'S COLLABORATIVE" in title box
| impossible |04 * Adam: start editing page
| huh? |05 * Evan: demonstrate that there are no wires
| |06
| |07 TODO: add a download link here?
| n |08
| ?eb ti dluoc tahW |09
| o |10
| |11
| p |12
| |13
| e |14
| |15
| |16
| 16|17
\----------------------------------------------------------------------------/18
/----------------------------------------------------------------------------\00 Fin.
| |01 * give people access?
| |02 "End not with a bang, but with a segfault"
| |03
| |04
| |05
| |06
| COLLASCII |07
| |08
| "The Future Editor of Yesterday, Tomorrow" |09
| |10
| github.com/olin/collascii |11
| |12
| |13
| |14
| |15
| |16
| Thanks! <3 Matt, Evan, and Adam 17|17
\----------------------------------------------------------------------------/18
00 This slide intentionally left blank.
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
/----------------------------------------------------------------------------\00 TEMPLATE EMPTY
| |01
| |02
| |03
| |04
| |05
| |06
| |07
| |08
| |09
| |10
| |11
| |12
| |13
| |14
| |15
| |16
| ##|17
\----------------------------------------------------------------------------/18
/-----------------+----------------------------------------------------------\00 TEMPLATE CONTENT
| SECTION - TITLE | |01
|-----------------+ |02
| |03
| * FIRST ITEM |04
| |05
| * SECOND ITEM |06
| |07
| |08
| |09
| |10
| |11
| |12
| |13
| |14
| |15
| |16
| FOOTER ##|17
\----------------------------------------------------------------------------/18