<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Disqus - Latest Comments for norvig</title><link>http://disqus.com/by/norvig/</link><description></description><atom:link href="http://disqus.com/norvig/comments.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Thu, 27 Sep 2018 23:46:46 -0000</lastBuildDate><item><title>Re: Stop writing lambda expressions in Python</title><link>http://treyhunner.com/2018/09/stop-writing-lambda-expressions/#comment-4118318698</link><description>&lt;p&gt;`sorted(colors, key=str.casefold)` is simpler.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Thu, 27 Sep 2018 23:46:46 -0000</pubDate></item><item><title>Re: Revisiting Knuth and McIlroy's word count programs - Franklin's grain of sand</title><link>http://franklinchen.com/blog/2011/12/08/revisiting-knuth-and-mcilroys-word-count-programs/#comment-3520820500</link><description>&lt;p&gt;def wordcount(filename, n=10):&lt;br&gt;        text = open(filename).read().lower()&lt;br&gt;        counts = collections.Counter(re.findall('[a-z]+', text))&lt;br&gt;        for i, w in counts.most_common(n):&lt;br&gt;             print(i, w)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Sat, 16 Sep 2017 18:32:41 -0000</pubDate></item><item><title>Re: Leaked photos reveal Sigma is set to release fast 50-100mm f/1.8 Art lens</title><link>https://www.diyphotography.net/leaked-photos-reveal-sigma-is-set-to-release-fast-50-100mm-f1-8-art-lens/#comment-2523577548</link><description>&lt;p&gt;Interesting lens. You mean 75-150mm equivalent.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Fri, 19 Feb 2016 12:39:18 -0000</pubDate></item><item><title>Re: How to make polished Jupyter presentations with optional code visibility</title><link>http://www.chris-said.io/2016/02/13/how-to-make-polished-jupyter-presentations-with-optional-code-visibility/#comment-2517670414</link><description>&lt;p&gt;This is great ... one of the features that I was hoping for, and had gotten Fernando Perez to agree to put on the list of future enhancements; great to see it here now.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Tue, 16 Feb 2016 17:32:06 -0000</pubDate></item><item><title>Re: Dance Photography</title><link>http://norvig.com/dance-photography.html#comment-1857796343</link><description>&lt;p&gt;Fixed it. Thanks, Mickey!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Mon, 16 Feb 2015 04:24:33 -0000</pubDate></item><item><title>Re: Peter Norvig's Spell Checker in Two Lines of Base R</title><link>http://www.sumsar.net/blog/2014/12/peter-norvigs-spell-checker-in-two-lines-of-r/#comment-1747122354</link><description>&lt;p&gt;Very nice, Rasmus. I think you are correct that this does basically the same thing as mine (except perhaps for breaking ties), and that the reasons why it is so concise are (1) the adist function, and (2) vector processing in R. Forgetting the word counts and just keeping the ordering is certainly justified, but I kept the counts because I was thinking ahead to extensions such as finding the most probable correction in the context of other words -- for that you would need probabilities, not just orderings.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Wed, 17 Dec 2014 13:34:34 -0000</pubDate></item><item><title>Re: How To Convert Scrap Flooring Into A Lens Drawer</title><link>https://www.diyphotography.net/convert-scrap-flooring-lens-drawer/#comment-1579628537</link><description>&lt;p&gt;I find it easier to use the foam insert for a pelican case.  Order the size that fits your drawer, then customize the foam to your lenses.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Mon, 08 Sep 2014 13:42:45 -0000</pubDate></item><item><title>Re: English Letter Frequency Counts: Mayzner RevisitedorETAOIN SRHLDCU</title><link>http://norvig.com/mayzner.html#comment-757365919</link><description>&lt;p&gt;They all appear in published text that is published in English.  You may have preconceptions about what counts as an "English," but the simplest approach is to include everything.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Sat, 05 Jan 2013 21:20:43 -0000</pubDate></item><item><title>Re: English Letter Frequency Counts: Mayzner RevisitedorETAOIN SRHLDCU</title><link>http://norvig.com/mayzner.html#comment-756975246</link><description>&lt;p&gt;Yes -- maybe next month I'll go back and generate the data grouped by time period.  Probably not by year, but maybe by 20-year buckets.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Sat, 05 Jan 2013 13:46:01 -0000</pubDate></item><item><title>Re: English Letter Frequency Counts: Mayzner RevisitedorETAOIN SRHLDCU</title><link>http://norvig.com/mayzner.html#comment-756974338</link><description>&lt;p&gt;I don't have his complete results, just a couple sample pages from which I got a feel for what he did.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Sat, 05 Jan 2013 13:44:55 -0000</pubDate></item><item><title>Re: English Letter Frequency Counts: Mayzner RevisitedorETAOIN SRHLDCU</title><link>http://norvig.com/mayzner.html#comment-756973934</link><description>&lt;p&gt;The major difference is that when he reports a count of 0, you can't tell if that means 1 in 100 thousand, or 1 in 100 billion.  With my results, you can differentiate these cases pretty well.  The ngrams with high counts (like the top 50 bigrams) remain fairly consistent.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Sat, 05 Jan 2013 13:44:24 -0000</pubDate></item><item><title>Re: English Letter Frequency Counts: Mayzner RevisitedorETAOIN SRHLDCU</title><link>http://norvig.com/mayzner.html#comment-756972129</link><description>&lt;p&gt;I think that means that your connection was broken mid-way and you didn't get the whole file.  I just tried and it works for me.  The file size is 46,302,906 bytes.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Sat, 05 Jan 2013 13:42:03 -0000</pubDate></item><item><title>Re: 
Niniane's Blog
</title><link>http://niniane.blogspot.com/2012/12/lasik.html#comment-741388833</link><description>&lt;p&gt;Good luck, Niniane, I hope your vision turns out 20/20.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Tue, 18 Dec 2012 00:18:23 -0000</pubDate></item><item><title>Re: Dance Photography (Steps 5-9)</title><link>http://norvig.com/dance-photography2.html#comment-562227788</link><description>&lt;p&gt;Thanks, Jesse.  It is still two buttons, but you are right; this is easier than the button on the top panel.  I have a 5D III now, and I am using your suggestion; thanks!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Tue, 19 Jun 2012 17:35:10 -0000</pubDate></item><item><title>Re: Solving Every Sudoku Puzzle</title><link>http://norvig.com/sudoku.html#comment-534951937</link><description>&lt;p&gt;Normally you wouldn't use Iterative Deepening on a problem where every terminal state is the same distance from the start.  But I suppose that with the automatic inferences., you have terminals at different distances. However, I'm not sure that the solution would tend to me nearer the start.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Mon, 21 May 2012 22:06:16 -0000</pubDate></item><item><title>Re: (How to Write a ((Better) Lisp) Interpreter (in Python))</title><link>http://norvig.com/lispy2.html#comment-486980027</link><description>&lt;p&gt;You raise an important point about the treatment of false values.  When embedding one language in another, you always have choices: do I maintain compatibility with the host language or the target language.  You are right that to be true to Scheme, only #f (or False) should be considered false.  But if you want to use the myriad of Python functions naturally from within the scheme, then it is convenient to stick with Python's conventions for false values.  Either choice leads to some confusion when the two language bump up against each other.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Thu, 05 Apr 2012 05:43:12 -0000</pubDate></item><item><title>Re: Solving Every Sudoku Puzzle</title><link>http://norvig.com/sudoku.html#comment-449014593</link><description>&lt;p&gt;Thanks for the comments.  I'm not sure what motivated you to make the changes to the calls to all.  Certainly your changes are reasonable; I would say they are equally good as what I had, and choosing between them is a question of style.  I'm not sure which version is faster; you'd have to measure to see, but the difference won't be large. Perhaps you thought that all(... for ... in ...) needs to evaluate all the items before checking if they are true.  That is not the case -- this is a generator expression, and as soon as one is false, all returns false.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Sat, 25 Feb 2012 20:52:06 -0000</pubDate></item><item><title>Re: Solving Every Sudoku Puzzle</title><link>http://norvig.com/sudoku.html#comment-424542771</link><description>&lt;p&gt;Good suggestion -- the only way to tell if it is really faster is to run some timing experiments.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Mon, 30 Jan 2012 14:54:52 -0000</pubDate></item><item><title>Re: (How to Write a (Lisp) Interpreter (in Python))</title><link>http://norvig.com/lispy.html#comment-378162330</link><description>&lt;p&gt;Thank you for doing the translation.  I appreciate it.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Sat, 03 Dec 2011 00:56:10 -0000</pubDate></item><item><title>Re: http://norvig.com/dance-photography3.html</title><link>http://norvig.com/dance-photography3.html#comment-374376160</link><description>&lt;p&gt;You're right again on the Tamron!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Mon, 28 Nov 2011 14:34:58 -0000</pubDate></item><item><title>Re: http://norvig.com/dance-photography3.html</title><link>http://norvig.com/dance-photography3.html#comment-374101661</link><description>&lt;p&gt;Thanks, nnamdi; I knew there were some issues with autofocus on Nikon, but didn't know the details.  I've swapped in compatible lenses.  But maybe I should just recommend stepping up to a D7000.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Mon, 28 Nov 2011 05:46:09 -0000</pubDate></item><item><title>Re: Dance Photography</title><link>http://norvig.com/dance-photography.html#comment-373012423</link><description>&lt;p&gt;stolen data, I admit I am an amateur with a lot yet to learn. I'm no Lois Greenfield.  I haven't sold a million copies of my dance pictures. But I have given away 3/4 million views: I've done about two dozen shows over the last 7 years, and my audience seems to be happy enough with the results; they view about 20 to 40,000 images each show and the most popular images get 50 to 100 downloads at full size, indicating that not all the views are "I just want to see my kid" and that the viewers like the image enough to get the full size, not just a small thumbnail to share on Facebook. To me that is the practical experience that counts; I'm sorry I don't measure up to your standards.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Sat, 26 Nov 2011 21:44:33 -0000</pubDate></item><item><title>Re: Dance Photography (Steps 5-9)</title><link>http://norvig.com/dance-photography2.html#comment-373007830</link><description>&lt;p&gt;Flash is not allowed at our study, so I didn't discuss it.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Sat, 26 Nov 2011 21:26:34 -0000</pubDate></item><item><title>Re: (How to Write a (Lisp) Interpreter (in Python))</title><link>http://norvig.com/lispy.html#comment-359339548</link><description>&lt;p&gt;You are right -- we are relying on many features of Python: call stack, data types, garbage collection, etc. The next step would be to show a compiler to some sort of assembly language.  I think either the Java JVM or the Python byte code would be good targets.  We'd also need a runtime system with GC. I show the compiler in my PAIP book.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Wed, 09 Nov 2011 13:58:13 -0000</pubDate></item><item><title>Re: Solving Every Sudoku Puzzle</title><link>http://norvig.com/sudoku.html#comment-351082821</link><description>&lt;p&gt;Good point!  The naive search algorithm you describe is indeed simpler, both in terms of lines of code and in conceptual complexity.  And for many puzzles, it arrives at the solution in less than a second, so it has a lot to recommend it.  But for other puzzles, it takes many minutes.  Consider the puzzle I show above, which you would encode as [4, 0, 0, 0, 0, 0, 8, 0, 5,&lt;br&gt; 0, 3, 0, 0, 0, 0, 0, 0, 0,&lt;br&gt; 0, 0, 0, 7, 0, 0, 0, 0, 0,&lt;br&gt; 0, 2, 0, 0, 0, 0, 0, 6, 0,&lt;br&gt; 0, 0, 0, 0, 8, 0, 4, 0, 0,&lt;br&gt; 0, 0, 0, 0, 1, 0, 0, 0, 0,&lt;br&gt; 0, 0, 0, 6, 0, 3, 0, 7, 0,&lt;br&gt; 5, 0, 0, 2, 0, 0, 0, 0, 0,&lt;br&gt; 1, 0, 4, 0, 0, 0, 0, 0, 0] I started to run this with your code, but after 20 minutes it still hadn't completed and I interrupted the process. The algorithm I describe is over 10,000 times faster on hard puzzles like this.  That's why I dismissed the naive search approach, although I should have covered it in my article.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Norvig</dc:creator><pubDate>Sun, 30 Oct 2011 17:21:07 -0000</pubDate></item></channel></rss>