Norvig is a beast. For those that don't know, he is high up in Google Research (AI director I believe) and also wrote the #1 AI textbook. He has the #1 AI course on coursera or edx too (can't remember which one). He's a big lisp advocate (look at his review of SICP on amazon), but also has the programs for his books in Java, and Python.
His Design of Computer programs course on Udacity is amazing.<p><a href="https://in.udacity.com/course/design-of-computer-programs--cs212" rel="nofollow">https://in.udacity.com/course/design-of-computer-programs--c...</a>
Literate programming / ipython notebooks make me very uncomfortable.<p>Primarily the problem is that it's a living body of mutable state -- like an Excel spreadsheet, except it doesn't auto-update -- if I poke at some bit of it, and then re-evaluate a cell, some state will change, probably. And then maybe other cells' outputs will be invalid. Hmm, maybe I should re-evaluate the whole notebook? Oh, but some of the cells contain shell commands, for example to download a dictionary file from norvig.com. Do I want to do that? Maybe I should just undo the change I made. The ipynb is in git of course. But instead of a nice diff showing lines of code, the python code is held inside some JSON document.<p>Ipython notebook is beautiful technology, the front-end is really-well done. But accumulating all that mutable state goes against all my instincts as a programmer. I prefer editing .py files in my text editor, with Make when necessary. And then creating output from input with a single, transient, execution.
You can run these notebooks for free in the cloud (on MyBinder.org provided by the Jupyter team). Just head there: <a href="https://mybinder.org/v2/gh/norvig/pytudes/master" rel="nofollow">https://mybinder.org/v2/gh/norvig/pytudes/master</a> You may need to `pip install numpy`. Watch out images are ephemeral.
Norvig's notebooks are my favorite resource for code reading. He has so much of them, written is such a nice, clean, clever but yet understandable and readable way, it's always a pleasure and amazing learning experience to go through them.<p>For example, going through his notebook for code advent (the first linked) [1].<p>[1] <a href="https://nbviewer.jupyter.org/url/norvig.com/ipython/Advent%20of%20Code.ipynb" rel="nofollow">https://nbviewer.jupyter.org/url/norvig.com/ipython/Advent%2...</a>
I really like his (How to Write a (Lisp) Interpreter (in Python)) :
<a href="http://norvig.com/lispy.html" rel="nofollow">http://norvig.com/lispy.html</a><p>You learn to build a lisp interpreter in about 100 lines of python (you miss a few features like macros, but it's still quite complete). Very nice to learn how language interpretation works
'Etudes for Programmers' itself remains an interesting read and entertaining problem set. And not a single one is about implementing a Red-Black tree from memory.
Is the adventofcode.com fun/educational/worthwhile? I see it starts again Dec 1. I like doing things like this but end up regretting it as it sucks too much time solving unnecessary problems.
Here is code for "Artificial Intelligence: A Modern Approach" <a href="https://github.com/aimacode" rel="nofollow">https://github.com/aimacode</a><p>Norvig wrote some of the Python version <a href="https://github.com/aimacode/aima-python" rel="nofollow">https://github.com/aimacode/aima-python</a>
His regex golf seems kind of strange; he never mentions suffix trees. It seems like a fairly straightforward process to go through and mark the shortest distinguishing infix for each string in a generalized suffix tree.
The algorithms I browsed make sense, but his coding style is peculiar, and somewhat un-pythonic.<p>For instance: <a href="https://github.com/norvig/pytudes/blob/master/py/SET.py" rel="nofollow">https://github.com/norvig/pytudes/blob/master/py/SET.py</a><p>Why the CAPS name? Why are we defining `test` if we’re just running it on the next line - or rather, why are running the test in that same file as it’s definition, and then running an example 100k times?<p>Any professional python developer will know this, but when an adventuring friend calls me to help him debug something, with code modeled on what he’s seen in examples like these, I’ll likely just throw my hands up.<p>On the flip side, this isn’t bad for showing how something works, and the cognitive overload for a beginner to “get to the meat” if he’d used `argparse` or `click` might be a bit high.
Kind of OT, but... according to his CV Norvig was the Chief Designer for Harlequin?!<p><a href="http://norvig.com/resume.html" rel="nofollow">http://norvig.com/resume.html</a>
I get it that Peter Norvig is a very smart programmer. But can someone explain to me - like a farmer to his cow - how do these resources differ from typical programming challenges found on the web ?<p>How will these make me a better programmer ? Is each designed to teach a different programming concept or technique ? Are they useful in fields lower than machine learning or AI ?<p>What's the benefit of a program that detects palindromes ?