-
Notifications
You must be signed in to change notification settings - Fork 5
/
index-18.atom
1189 lines (1001 loc) · 40.3 KB
/
index-18.atom
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
<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="http://cestlaz.github.io/assets/xml/atom.xsl" type="text/xsl media="all"?>
<feed xmlns:fh="http://purl.org/syndication/history/1.0" xml:lang="en" xmlns="http://www.w3.org/2005/Atom">
<title>C'est la Z (old posts, page 18)</title>
<id>http://cestlaz.github.io/index-18.atom</id>
<updated>2017-12-22T12:59:45Z</updated>
<author>
<name>Mike Zamansky</name>
</author>
<link rel="self" type="application/atom+xml" href="http://cestlaz.github.io/index-18.atom"/>
<link rel="next" type="application/atom+xml" href="http://cestlaz.github.io/index-17.atom"/>
<link rel="previous" type="application/atom+xml" href="http://cestlaz.github.io/index-19.atom"/>
<link rel="current" type="application/atom+xml" href="http://cestlaz.github.io/index.atom"/>
<link rel="next-archive" type="application/atom+xml" href="http://cestlaz.github.io/index-19.atom"/>
<link rel="prev-archive" type="application/atom+xml" href="http://cestlaz.github.io/index-17.atom"/>
<fh:archive/>
<link rel="alternate" type="text/html" href="http://cestlaz.github.io/index-18.html"/>
<generator uri="https://getnikola.com/">Nikola</generator>
<entry>
<title>Cellular Automata for Pathfinding in NetLogo</title>
<id>http://cestlaz.github.io/posts/2016-01-17-maze-ca.html/</id>
<updated>2016-01-17T00:00:00-05:00</updated>
<published>2016-01-17T00:00:00-05:00</published>
<author>
<name>Mike Zamansky</name>
</author>
<link rel="alternate" type="text/html" href="http://cestlaz.github.io/posts/2016-01-17-maze-ca.html/"/>
<summary type="html"><link href="//cdn.rawgit.com/noelboss/featherlight/1.3.5/release/featherlight.min.css" type="text/css" rel="stylesheet">
<script src="//cdn.rawgit.com/noelboss/featherlight/1.3.5/release/featherlight.min.js" type="text/javascript" charset="utf-8"></script>
<style>
div.center {text-align:center;}
.smaller {height:200px;width:200px}
.center {text-align:center;}
.frame {width:600px;height:800px;}
</style>
<div class="center">
<a class="center" href="http://cestlaz.github.io/posts/2016-01-17-maze-ca.html/" data-featherlight="/img/maze-ca/maze-start.png">
<img src="http://cestlaz.github.io/img/maze-ca/maze-start.png">
</a>
</div>
<br>
<div id="outline-container-orgheadline1" class="outline-2">
<h2 id="orgheadline1"></h2>
<div class="outline-text-2" id="text-orgheadline1">
<p>
<a href="http://cestlaz.github.io/2016/01/15/shift-image.html#.Vpvy4x8SrmE">Last time</a> we took a look at implementing a Cellular Automaton in
NetLogo to do some simple image manipulation. We just scratched the
surface. In class, the kids write pretty nice Photoshop Light
applications.
</p>
<p>
Today we'll look at some more ambitious problem solving - using a
Cellular Automaton to find a path through a maze.
</p>
</div>
</div>
<div id="outline-container-orgheadline2" class="outline-2">
<h2 id="orgheadline2">Part 1 - finding possible paths</h2>
<div class="outline-text-2" id="text-orgheadline2">
<p>
We'll use the image above as an example and a live model with all the
code is at the end of this post.
</p>
<p>
Each square of the maze is a
NetLogo patch. White square represent possible paths, Red is our
entrance, green our exit. As we explore the maze, we'll color the
cells yellow.
</p>
<p>
Remember, in a Cellular Automaton (CA), each cell makes a decision as to
it's next state based on information about its neighbors (up, down,
left, and right only in this case).
</p>
<p>
So, if every cell is looking around at it's neighbors, most cells
don't have enough information. The only white cell that might be on
the path from entrance to exit is the one next to the entrance - it
might be on the path.
</p>
<p>
This leads us to the first step of our CA rule set:
</p>
<div class="org-src-container">
<pre class="src src-netlogo">; if I have a green neighbor, I might be on the path, turn yellow
ask patches with [pcolor = white] [
if any? neighbors with [pcolor = red] [
set pcolor yellow
]
]
</pre>
</div>
<p>
(click images to enlarge)
</p>
<a href="http://cestlaz.github.io/posts/2016-01-17-maze-ca.html/" data-featherlight="/img/maze-ca/maze-1.png">
<img class="smaller" src="http://cestlaz.github.io/img/maze-ca/maze-1.png">
</a>
<p>
Next time through, we notice that a cell might be on the path if it's
white and it has either red or yellow neighbors.
</p>
<a href="http://cestlaz.github.io/posts/2016-01-17-maze-ca.html/" data-featherlight="/img/maze-ca/maze-2.png">
<img class="smaller" src="http://cestlaz.github.io/img/maze-ca/maze-2.png">
</a>
<a href="http://cestlaz.github.io/posts/2016-01-17-maze-ca.html/" data-featherlight="/img/maze-ca/maze-3.png">
<img class="smaller" src="http://cestlaz.github.io/img/maze-ca/maze-3.png">
</a>
<a href="http://cestlaz.github.io/posts/2016-01-17-maze-ca.html/" data-featherlight="/img/maze-ca/maze-4.png">
<img class="smaller" src="http://cestlaz.github.io/img/maze-ca/maze-4.png">
</a>
<p>
Eventually, we end up with a yellow abutting green - the exit.
</p>
<a href="http://cestlaz.github.io/posts/2016-01-17-maze-ca.html/" data-featherlight="/img/maze-ca/maze-found.png">
<img class="smaller" src="http://cestlaz.github.io/img/maze-ca/maze-found.png">
</a>
<p>
Notice that each yellow cell is also numbered. The number indicates
how many steps it took to get there from the entrance. The
implementation is trivial:
</p>
<ul class="org-ul">
<li>Start by giving each patch a variable <b><b>step</b></b> and starting it at 0.</li>
<li>When a cell is about to turn yellow, it should look at it's yellow
or red neighbors, ask for their <b><b>step</b></b> value (they'll all be the
same - think about why), and set it's <b><b>step</b></b> value to one more
than that.</li>
</ul>
<p>
We'll use these step numbers to recover the actual shortest path.
</p>
</div>
</div>
<div id="outline-container-orgheadline3" class="outline-2">
<h2 id="orgheadline3">Part 2 - recovering the shortest path.</h2>
<div class="outline-text-2" id="text-orgheadline3">
<p>
We can now use the yellow patches with the step numbers to find our
way back.
</p>
<p>
We're going to build a solution set.
</p>
<ol class="org-ol">
<li>start with an empty solution set.</li>
<li>take the only green cell not in the solution set (let's call it <b><b>G</b></b>).</li>
<li>Ask <b><b>G</b></b>'s yellow neighbor with lowest step number to turn
itself green (that cell will be <b><b>G</b></b> next time around).</li>
<li>Place <b><b>G</b></b> into the solution set (leaving the new green cell as
the only green cell not in the solution set).</li>
<li>Repeat 2 - 5 until we're back at the entrance.</li>
</ol>
<a href="http://cestlaz.github.io/posts/2016-01-17-maze-ca.html/" data-featherlight="/img/maze-ca/maze-back-1.png">
<img class="smaller" src="http://cestlaz.github.io/img/maze-ca/maze-back-1.png">
</a>
<a href="http://cestlaz.github.io/posts/2016-01-17-maze-ca.html/" data-featherlight="/img/maze-ca/maze-back-2.png">
<img class="smaller" src="http://cestlaz.github.io/img/maze-ca/maze-back-2.png">
</a>
<a href="http://cestlaz.github.io/posts/2016-01-17-maze-ca.html/" data-featherlight="/img/maze-ca/maze-solved.png">
<img class="smaller" src="http://cestlaz.github.io/img/maze-ca/maze-solved.png">
</a>
<p>
This is one of my favorite intro topics. It's using a CA - something
normally just presented as a toy idea, to solve a real problem. It
reinforces parallel processing and foreshadows all sorts of pathfinding
ideas to come.
</p>
<p>
Below is the complete NetLogo program. You can look at the code by
clicking on the code tab at the bottom.
</p>
<p>
To run:
</p>
<ul class="org-ul">
<li><b><b>setup</b></b> sets up all the variables and clears the world.</li>
<li><b><b>buildmaze</b></b> builds a random maze.</li>
<li><b><b>solve</b></b> is a toggle to run through an entire solution.</li>
<li><b><b>step</b></b> single steps through the CA.</li>
<li><b><b>reset</b></b> Resets all the variables and recolors the maze to
unsolved.</li>
<li>The other buttons are toggles for drawing your own maze.</li>
</ul>
<div class="center frame">
<iframe class="center frame" src="http://cestlaz.github.io/img/maze-ca/maze.html"></iframe>
</div>
</div>
</div></summary>
<category term="netlogo" label="netlogo"/>
<category term="pedagogy" label="pedagogy"/>
</entry>
<entry>
<title>Cellular Automata, NetLogo and real problems</title>
<id>http://cestlaz.github.io/posts/2016-01-15-shift-image.html/</id>
<updated>2016-01-15T00:00:00-05:00</updated>
<published>2016-01-15T00:00:00-05:00</published>
<author>
<name>Mike Zamansky</name>
</author>
<link rel="alternate" type="text/html" href="http://cestlaz.github.io/posts/2016-01-15-shift-image.html/"/>
<summary type="html"><style>
.center {text-align:center;}
.frame {width:640px;height:800px;}
</style>
<p>
We've been using <a href="https://ccl.northwestern.edu/netlogo/">NetLogo</a> in our intro course for years. It's a
wonderful programming environment. Many of you recall the <a href="https://en.wikipedia.org/wiki/Logo_(programming_language)">Logo</a>
programming language. NetLogo is like Logo but instead of programming
a turtle, you write a program that's run by multiple, perhaps hundreds
of turtles and also by the world the turtles live on.
</p>
<p>
Some of the reasons we like it are that it's:
</p>
<ul class="org-ul">
<li>An easy accessible textual programming language</li>
<li>Makes building a graphical interface trivial</li>
<li>great for modeling</li>
<li>Comes with tons of demo models</li>
</ul>
<p>
And now, with the latest version, NetLogo programs/models can be
deployed as web sites. All you have to do is save your program as
"NetLogo Web" and put it up on a observer somewhere.
</p>
<p>
If you haven't you should download and install NetLogo, run it, then
go to the file menu and look at the built in models.
</p>
<p>
I also enjoy playing with <a href="https://en.wikipedia.org/wiki/Cellular_automaton">Cellular Automata</a> and NetLogo's a wonderful
platform to play with. The turtles live on a grid of patches and just
like the turtles, the patches will all run your program over and over.
</p>
<p>
The patches make perfect cells for a cellular automaton and you can
implement a rule set in your patches.
</p>
<p>
NetLogo even comes with a bunch of built in demo models for Cellular
Automata including <a href="https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life">Conway's Game of Life</a>, probably the most famous CA.
</p>
<p>
On the other hand, Conway's Game of Life is somewhat cliche and while
I find it fascinating, it doesn't really solve a practical problem, at
least on on the surface.
</p>
<p>
So, I was looking for something more practical to do and something
where we could explore some deeper CS concepts.
</p>
<p>
Image manipulation.
</p>
<p>
In class, we make a Cellular Automaton where each cell or patch is a
pixel in an image. In NetLogo, you can do this with the
"import-pcolors" command. Lower down, I have a demo that just manually
colors patches - the web version of NetLogo doesn't yet support that
command.
</p>
<p>
Task 1 - what if we want to shift the image over? The kids come up
with a solution pretty quickly: "We can just have each patch ask its
neighbor for its color." Here's the code they try:
</p>
<div class="org-src-container">
<pre class="src src-netlogo">; ask each patch to set its color to the color of the
; patch at relative location -1,0
to shift-naive
ask patches [ set pcolor [pcolor] of patch-at -1 0]
end
</pre>
</div>
<p>
To see what happens, scroll down to the NetLogo model below, click on
setup and then hit the <b><b>shift-naive</b></b> button a few times.
</p>
<p>
It doesn't work.
</p>
<p>
What's going on?
</p>
<p>
It's a synchronization issue.
</p>
<p>
Suppose we have the following three cells in a row:
</p>
<div class="figure">
<p><img src="http://cestlaz.github.io/img/shift-image/image1.png" alt="image1.png">
</p>
</div>
<p>
If cell 3 asks cell 2 it's color before cell 2 asks cell 1's color, we
get the desired result:
</p>
<div class="figure">
<p><img src="http://cestlaz.github.io/img/shift-image/image2.png" alt="image2.png">
</p>
</div>
<p>
But if cell 2 asks cell 1 for it's color first then cell 3 will
actually get cell 1's color:
</p>
<div class="figure">
<p><img src="http://cestlaz.github.io/img/shift-image/image3.png" alt="image3.png">
</p>
</div>
<p>
So now we have the students thinking about synchronization and
parallel processing and they don't even know it.
</p>
<p>
The solution's pretty easy, break the problem up into two steps.
</p>
<p>
First, have every patch ask its neighbor for its color and then once
everyone knows their neighbor's color, then change:
</p>
<div class="org-src-container">
<pre class="src src-html">patches-own [next-color]
to shift-correct
; figure out my next color
ask patches [ set next-color [pcolor] of patch-at -1 0 ]
; then switch to it
ask patches [ set pcolor next-color]
end
</pre>
</div>
<p>
You can run that by clicking <b><b>setup</b></b> again and then <b><b>shift-correct</b></b> a
few times.
</p>
<p>
There's some of the beauty of NetLogo - we can get kids to think about
some deep concepts while playing with an easy to use, fun, interactive
environment with a real textual programming language.
</p>
<p>
Stay tuned for part 2 when I'll talk about creating a cellular
automaton that can solve a maze.
</p>
<div class="center frame">
<iframe class="center frame" src="http://cestlaz.github.io/img/shift-image/shift-image.html"></iframe>
</div></summary>
<category term="netlogo" label="netlogo"/>
<category term="pedagogy" label="pedagogy"/>
</entry>
<entry>
<title>International Blog Delurking Week 2016</title>
<id>http://cestlaz.github.io/posts/2016-01-06-delurking-week.html/</id>
<updated>2016-01-06T00:00:00-05:00</updated>
<published>2016-01-06T00:00:00-05:00</published>
<author>
<name>Mike Zamansky</name>
</author>
<link rel="alternate" type="text/html" href="http://cestlaz.github.io/posts/2016-01-06-delurking-week.html/"/>
<summary type="html"><style>
div.center {text-align:center;}
</style>
<p>
It's been pointed out by a couple of bloggers I follow:
</p>
<ul class="org-ul">
<li><a href="https://gasstationwithoutpumps.wordpress.com/">Gas station without pumps</a></li>
<li><a href="http://blog.acthompson.net/">Computer Science Teacher (Alfred Thompson's blog)</a></li>
</ul>
<p>
That it's International Blog Delurking Week.
</p>
<p>
So, I know I don't have a large readership, but if you do read this
blog, why not give a brief hi in the comments. I'd love to know who you are and what you do.
</p></summary>
</entry>
<entry>
<title>Discussion Silos</title>
<id>http://cestlaz.github.io/posts/2016-01-03-discussion-silos.html/</id>
<updated>2016-01-03T00:00:00-05:00</updated>
<published>2016-01-03T00:00:00-05:00</published>
<author>
<name>Mike Zamansky</name>
</author>
<link rel="alternate" type="text/html" href="http://cestlaz.github.io/posts/2016-01-03-discussion-silos.html/"/>
<summary type="html"><style>
div.center {text-align:center;}
</style>
<p>
In response to the past couple of days where my friends and fellow CS
Ed advocates Alfred Thompson, Rob Underwood, and I had a nice little
discussion via our blogs, Alfred wrote <a href="http://blog.acthompson.net/2016/01/when-blogging-works-for-educators.html">this</a>.
</p>
<p>
It's great when a number of voices in the community have an open
discussion but one of the things I found myself lamenting was the fact
that a lot of the discussion isn't truly accessible.
</p>
<p>
Why not?
</p>
<p>
The silo known as Facebook.
</p>
<p>
I have no problem with Facebook - I like it and use it daily - it's a great way to
keep in touch with former students turned friends. The problem is that
much like Las Vegas, discussions that happen on Facebook stay on
Facebook.
</p>
<p>
Recently I've seen a number of blog posts, some mine, some Alfred's,
some others where the post garnered nary a comment. Head over to
Facebook and if you're friends with the right people, you might find
a lively, informative discussion.
</p>
<p>
In one case in particular, one post had independent, overlapping
discussions in at least three Facebook threads.
</p>
<p>
How much richer would the discussion have been in a public forum
plus it would be left open for people to discover in the future.
</p>
<p>
Personally, I use <a href="http://disqus.com/">Disqus</a>. I like it since I can also follow people on
it and I can just embed the code in any page but others like what
Wordpress or Blogger uses for comment threads. In any event, it keeps
the conversation open.
</p>
<p>
Is this really a problem? Maybe not but I do wish people would look
beyond Facebook for discussions.
</p>
<p>
It's something I've been trying to get my students to do for
years. I've used a number of tools for class communication:
</p>
<ul class="org-ul">
<li>mail lists</li>
<li>Piazza</li>
<li>custom forum software like vanilla</li>
<li>slack</li>
</ul>
<p>
and haven't found anything that really does the job quite right. I'm
still looking.
</p>
<p>
The kids use these but invariably end up also setting up a Facebook
group for my class and their other classes. I encourage this - they
certainly should have a forum that I can't see. How else can they plan
that surprise party for me :-). In all seriousness though, ideally
they should have a forum free of teachers but they should use the one
with the teacher as much as possible.
</p>
<p>
The real problem with the kids setting up Facebook groups every year
is that there's no institutional memory. I see the kids, year after
year, have to clear the same hurdles. If they started thinking outside
of the silo of their Facebook communities and just had an ongoing
community for each class - one that passed on from year to year, it
would be of tremendous value for them.
</p>
<p>
So, I'd like to encourage everyone out there to get our discussions
out into public forums. It would be terrific if more of us would blog
or blog more often and also to take the time to add to the dialog in a
public place.
</p></summary>
<category term="community" label="community"/>
</entry>
<entry>
<title>Teaching Coding - getting beyond superficial syntax</title>
<id>http://cestlaz.github.io/posts/2016-01-01-different-languages.html/</id>
<updated>2016-01-01T00:00:00-05:00</updated>
<published>2016-01-01T00:00:00-05:00</published>
<author>
<name>Mike Zamansky</name>
</author>
<link rel="alternate" type="text/html" href="http://cestlaz.github.io/posts/2016-01-01-different-languages.html/"/>
<summary type="html"><style>
div.center {text-align:center;}
</style>
<p>
The other day, Alfred Thompson put up a piece about <a href="http://blog.acthompson.net/2015/12/code-in-different-languages.html">coding in multiple
languages</a>. Alfred references a post written last May by <a href="http://robunderwood.com/2015/05/31/code-syntax-compared-part-1/%0A">Rob Underwood.</a>
</p>
<p>
Both pieces are worth a look.
</p>
<p>
Rob is trying to illustrate many of the superficial similarities in
popular languages.
</p>
<p>
In the comments on Alfred's blog, both Alfred and I alluded to coding
in an appropriate style for the language.
</p>
<p>
For me the issue is even bigger.
</p>
<p>
Learning to code is all the rage and places to learn are popping out of
the woodwork.
</p>
<p>
There are:
</p>
<ul class="org-ul">
<li>In classes, in schools, with teachers</li>
<li>Drop in programs in schools.</li>
<li>Programs run by coding schools</li>
<li>Moocs and other online resources</li>
<li>Summer and weekend programs</li>
</ul>
<p>
And probably more. All of these options are giving more and more
people a way to learn to code.
</p>
<p>
That's great, but it also raises concerns given that very few people
involved in CS education have both strong teaching and CS backgrounds.
</p>
<p>
What I'm starting to see are the results as I meet young people coming
out of all of these programs.
</p>
<p>
Unfortunately, what I'm frequently seeing, at best, is very
superficial coverage of syntax.
</p>
<p>
I've seen kids who would have no basis for understanding that the
ramifications of this Python code:
</p>
<div class="org-src-container">
<pre class="src src-python">a = 30
def f():
a=20
print a
print a
</pre>
</div>
<p>
and this Javascript code:
</p>
<div class="org-src-container">
<pre class="src src-javascript">a = 30;
function f(){
a = 20
console.log(a);
}
console.log(a);
</pre>
</div>
<p>
are very different.
</p>
<p>
It gets worse when I meet kids who "know C" because they were exposed
to constructs like:
</p>
<div class="org-src-container">
<pre class="src src-c">for (i=0;i&lt;10;i++){
// code goes here
}
</pre>
</div>
<p>
I think the most common issue come from kids being "taught"
programming using javascript which seems deceptively simple but is
really rather deep.
</p>
<p>
It's important that as CS becomes more mainstream that we make sure
that we have teachers and programs that are teaching the real deal. It
can be fun and accessible but it does require teachers that know their
stuff and are willing to continue to learn.
</p>
<p>
Do our kids deserve any less?
</p></summary>
<category term="pedagogy" label="pedagogy"/>
</entry>
<entry>
<title>Leaving Stuyvesant</title>
<id>http://cestlaz.github.io/posts/2015-12-23-leaving-stuy.html/</id>
<updated>2015-12-23T00:00:00-05:00</updated>
<published>2015-12-23T00:00:00-05:00</published>
<author>
<name>Mike Zamansky</name>
</author>
<link rel="alternate" type="text/html" href="http://cestlaz.github.io/posts/2015-12-23-leaving-stuy.html/"/>
<summary type="html"><style>
div.center {text-align:center;}
</style>
<p>
Almost twenty six years. That's how long I've been a NYC public school
teacher. Most of that time at my alma mater, Stuyvesant.
</p>
<p>
A couple of years ago, the school paper wrote up an overview of my
career. I re-posted it <a href="http://cestlaz.github.io/2014/09/17/stuycs-spectator.html#.Vnqfxh8Sr0o">here</a>. I'm somtimes amazed at where we are now
and how we got here.
</p>
<p>
Regulars here also know my frustrations. To Stuy, I'm an
interchangeable, generic math teacher and the DOE has shown no
interested in supporting what we've built. I've also written about my
concerns with the direction the city's going with respect to K12 CS
education.
</p>
<p>
It was time for me to start the next phase of my career.
</p>
<p>
I'm happy to say that I will be joining Hunter College in late
January. I'll be developing their CS Teacher Ed program and also
working with their computer science undergrads. I'll also have the
opportunity to work with the Manhattan/Hunter Science High School and
Hunter College High School.
</p>
<p>
I also look forward to the opportunity to work more closely with my
friends in the K12 Ed space.
</p>
<p>
I'm very excited about this opportunity but it feels a bit weird after
being in the same place for so long. I don't feel any special
attachment to the institution that is Stuyvesant, my allegiance is to
my current and former students and that community isn't going
anywhere. Next year I'll still be working with terrific young people,
just in a different location under a different name.
</p>
<p>
I will miss the team that we've put together but even then, we get to
continue our work with CSTUY.
</p>
<p>
With the new year comes new opportunity and I can't wait.
</p></summary>
<category term="misc" label="misc"/>
</entry>
<entry>
<title>Advent of Code - because I'm an idiot</title>
<id>http://cestlaz.github.io/posts/2015-12-17-im-an-idiot.html/</id>
<updated>2015-12-17T00:00:00-05:00</updated>
<published>2015-12-17T00:00:00-05:00</published>
<author>
<name>Mike Zamansky</name>
</author>
<link rel="alternate" type="text/html" href="http://cestlaz.github.io/posts/2015-12-17-im-an-idiot.html/"/>
<summary type="html"><style>
div.center {text-align:center;}
</style>
<div class="figure">
<p><img src="http://cestlaz.github.io/img/advent/advent.png" alt="advent.png" width="480px" align="center">
</p>
</div>
<p>
I wish our kids believed us when we tell them that we have the same
programming troubles as they do. We stare at code for hours not seeing
problems that could be a simple as passing the wrong value. We spend
an inordinate amount of time trying to see the problem and then
realize that we just forgot something silly.
</p>
<p>
At this point, it's common for us CS teachers to tell each other "I
figured out the problem I was having – it's that I was an idiot."
</p>
<p>
Last time, I talked about <a href="http://adventofcode.com/">Advent of Code</a> and how I was somewhat behind
the curve. In part because I started late and in part because I've
been using it as an excuse to learn some Clojure.
</p>
<p>
Here's how I burned over two days on <a href="http://adventofcode.com/day/6">Day 6</a>.
</p>
<p>
The problem is pretty straight forward. You have a 1,000 x 1,000 grid
representing a light board and you have to repeatedly do operations on
smaller rectangles on that grid. Turning individual lights on and off,
if you would.
</p>
<p>
If I were doing this in a language like C, I'd probably just take a
big block of memory and loop through the instructions but since I was
working in Clojure, I thought I'd try to do something in more of the
functional mode, that is, with immutable data types.
</p>
<p>
After a while, I was getting the feeling that it was going to be too
slow so I shifted to just modifying a big block of memory.
</p>
<p>
Try as I could, I couldn't get it to work. I was sure my algorithm was
fine - it wasn't a hard problem, but I couldn't get the right answer.
</p>
<p>
After a while, I started looking at existing solutions and they were
basically the same as mine.
</p>
<p>
I was stumped.
</p>
<p>
Two days after the start, I figured it out.
</p>
<p>
No matter how hard you try, if your problem specifies the data in the
form <b><b>row1,col1 row2,col2</b></b>, you're not going to get the right answer
if you decide that the input is in the form <b><b>row1,row2 col1,col2</b></b>.
</p>
<p>
<b><b>D'Oh</b></b>
</p>
<p>
Ok, after that the problem was pretty trivial.
</p>
<p>
Hopefully I'll have some time to do problem 7 and beyond this weekend.
</p>
<p>
If there are any Clojure people out there, I'm putting my solutions up
on <a href="https://github.com/zamansky/adventofcodeclojure">GitHub</a> - I'd love some feedback on how to get more idiomatic.
</p></summary>
<category term="pedagogy" label="pedagogy"/>
</entry>
<entry>
<title>Advent of Code</title>
<id>http://cestlaz.github.io/posts/2015-12-15-advent.html/</id>
<updated>2015-12-15T00:00:00-05:00</updated>
<published>2015-12-15T00:00:00-05:00</published>
<author>
<name>Mike Zamansky</name>
</author>
<link rel="alternate" type="text/html" href="http://cestlaz.github.io/posts/2015-12-15-advent.html/"/>
<summary type="html"><style>
div.center {text-align:center;}
</style>
<div class="figure">
<p><img src="http://cestlaz.github.io/img/advent/advent.png" alt="advent.png" width="480px" align="center">
</p>
</div>
<p>
Has everyone seen <a href="http://adventofcode.com/">Advent of Code</a>?
</p>
<p>
It's a site with a series of programming problems that are being
revealed one a day, a la an advent calendar. You can read more about
it <a href="http://adventofcode.com/about">here</a>.
</p>
<p>
I came to the party a little late so I'm only up to day 6.
</p>
<p>
Each problem comes in two parts. The second is revealed after you
complete the first. Both students and teachers are enjoying the
problems.
</p>
<p>
What I like about the Advent of code, besides the one a day release,
is the fact that at least so far, the problems aren't super crazy
hard. They require a little thought but they seem very doable.
</p>
<p>
For me, that makes them a perfect platform on which to play with a new
language. I'm working through these in Clojure. I've been putting my
solutions up <a href="https://github.com/zamansky/adventofcodeclojure">here</a>. I have no idea if my code is "good" Clojure but
it's been fun nonetheless.
</p>
<p>
So, if you're looking for a nice set of small programming problems
and want to explore something new, check it out.
</p></summary>
<category term="misc" label="misc"/>
</entry>
<entry>
<title>We're Number One!! We're Number One!!!</title>
<id>http://cestlaz.github.io/posts/2015-11-19-were-number-one.html/</id>
<updated>2015-11-19T00:00:00-05:00</updated>
<published>2015-11-19T00:00:00-05:00</published>
<author>
<name>Mike Zamansky</name>
</author>
<link rel="alternate" type="text/html" href="http://cestlaz.github.io/posts/2015-11-19-were-number-one.html/"/>
<summary type="html"><style>
div.center {text-align:center;}
</style>
<p>
I woke up this morning to an email from my principal "Stuy is #1."
This followed a bunch of Facebook posts by friends and alums of a
similar vein.
</p>
<p>
It was all about a couple of reports, <a href="https://k12.niche.com/rankings/public-high-schools/best-overall/">here</a>, and <a href="http://www.businessinsider.com/best-public-high-schools-in-america-2015-11">here</a>. It turns out
Stuy is ranked #1. Woo Hoo. We're awesome.
</p>
<p>
Of course, everyone whooping it up now was quick to say "all those
rankings are meaningless" back when US News and World report ranked
Stuy way down on their list.
</p>
<p>
We all know what makes a great school: great students. At least in
terms of perception. Look at most of these lists and they'll be
dominated by high schools that take in high performing students.
</p>
<p>
Truth be told, in many ways, Stuyvesant isn't a special place, but
more on that down below.
</p>
<p>
In terms of the ratings and rankings they're meaningless but in a way
dangerous. I see it at Stuy. Under the current administration AP is
the word of the day. It's all Advanced Placement all the time. Why?
That's one of the ways to rise up in the rankings. So are the school
surveys which is why there's been more pressure to get those done.
</p>
<p>
My feelings? AP is all about making money for the College Board. I'm
not a fan of "early college," I'm a fan of enrichment. I've said it
many times - if a course is such that it can be mastered equally well
by a 15 year old in 10th grade as by a 19 or 20 year old in college,
well, it really isn't college level. High achieving, well prepared
high school kids can do college level work in 11th and 12th grades but
probably not in all subject areas. Sure they can memorize, ape, and
mimic, but the depth of knowledge won't be there. Regardless, we
should trust schools and teachers to do it right. Schools can roll out
rigorous courses as good or better than AP. There's no real need for
the College Board seal of approval. Look at <a href="http://www.huffingtonpost.com/alex-mallory/private-schools-ap-tests_b_823616.html">Fieldston and other
private schools</a> as examples.
</p>